├── .gitignore ├── README.md ├── css ├── jquery.mobile.simpledialog.css ├── jquery.swipeButton-1.0.1.css └── style.css ├── img ├── ajax_loader.gif ├── apple-touch-icon-114x114-precomposed.png ├── apple-touch-icon-72x72-precomposed.png ├── apple-touch-icon-precomposed.png ├── circle_green.png ├── circle_red.png ├── error_facebook.png ├── error_twitter.png ├── facebook_icon.png ├── favicon.png ├── google_article.png ├── google_icon.png ├── google_photo.png ├── google_video.png ├── ok_facebook.png ├── ok_twitter.png ├── people_icon.png ├── posts_icon.png ├── twitter_favourite.png ├── twitter_icon.png ├── twitter_reply.png ├── twitter_retweet.png └── twitter_verified.png ├── index.html ├── js ├── amplify.store.min.js ├── handlebars-1.0.0.beta.6.js ├── jquery.ba-serializeobject.js ├── jquery.cookie.js ├── jquery.deserialize.js ├── jquery.mobile.simpledialog2.js ├── jquery.oauthpopup.js ├── jquery.prettydate.js ├── jquery.swipeButton-1.1.js ├── json2.js └── scripts.js └── php ├── EpiCurl.php ├── EpiOAuth.php ├── EpiTwitter.php ├── facebook_auth.php ├── facebook_keys.php ├── facebook_sign_out.php ├── twitter_auth.php ├── twitter_keys.php ├── twitter_search_people.php └── twitter_sign_out.php /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | social-web-search 2 | ================= 3 | 4 | Search the social web... Find people & posts on Twitter, Facebook and Google+. 5 | 6 | Live Demo: http://sws.jensdriller.com 7 | -------------------------------------------------------------------------------- /css/jquery.mobile.simpledialog.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Mobile Framework : plugin to provide a simple Dialog widget. 3 | * Copyright (c) JTSage 4 | * CC 3.0 Attribution. May be relicensed without permission/notifcation. 5 | * https://github.com/jtsage/jquery-mobile-simpledialog 6 | */ 7 | 8 | /* Shared Styles */ 9 | 10 | .ui-simpledialog-header h4 { margin-top: 5px; margin-bottom: 5px; text-align: center; } 11 | .ui-simpledialog-container { border: 5px solid #111 !important; width:85%; max-width:500px;} 12 | .ui-simpledialog-screen { position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; } 13 | .ui-simpledialog-hidden { display: none; } 14 | .ui-simpledialog-input { width: 85% !important; display: block !important; margin-left: auto; margin-right: auto;} 15 | .ui-simpledialog-screen-modal { background-color: black; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } 16 | .ui-simpledialog-subtitle { text-align: center; } 17 | .ui-simpledialog-controls .buttons-separator {min-height: .6em;} 18 | .ui-simpledialog-controls .button-hidden { display:none; } 19 | 20 | .ui-dialog .ui-simpledialog-container { border: none !important; } 21 | .ui-dialog-simpledialog .ui-content { padding: 5px !important;} -------------------------------------------------------------------------------- /css/jquery.swipeButton-1.0.1.css: -------------------------------------------------------------------------------- 1 | /* 2 | Name: jquery.swipeButton.css 3 | Author: Andy andyMatthews 4 | Website: http://andyMatthews.net 5 | Packed With: http://jsutility.pjoneil.net/ 6 | Version: 1.0.1 7 | */ 8 | li[data-swipeurl] .ui-btn { 9 | margin: 30px; 10 | float: right; 11 | font-size: 12px; 12 | margin: 4px 4px 0 0 !important; 13 | padding: 0; 14 | z-index: 100; 15 | border-radius: .5em; 16 | } 17 | li[data-swipeurl] .ui-btn .ui-btn-inner { 18 | padding: 0.6em .9em !important; 19 | } 20 | li[data-swipeurl] .ui-btn .ui-btn-corner-all { 21 | border-radius: .5em; 22 | } -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | /*******************/ 2 | /* GENERAL STUFF */ 3 | /*******************/ 4 | body { 5 | text-align: center; 6 | } 7 | 8 | .ui-header { 9 | background: #3B5998; 10 | } 11 | 12 | a.ui-mini.ui-input-clear { 13 | right: 0 !important; 14 | } 15 | 16 | a.profileLink, a.profileLink:visited { 17 | color: #2489CE; 18 | font-weight: bold; 19 | } 20 | 21 | li.loadingAnimation img { 22 | margin: 25% 50%; 23 | } 24 | 25 | .ui-header .ui-title { 26 | margin-left: 0; 27 | margin-right: 0; 28 | white-space: normal; 29 | } 30 | 31 | .ui-li .ui-btn-text a { 32 | white-space: normal !important; 33 | overflow: visible !important; 34 | } 35 | 36 | 37 | 38 | /***************/ 39 | /* HOME PAGE */ 40 | /***************/ 41 | form#searchFormHome, form#searchForm { 42 | padding: 0 20px 15px 20px; 43 | } 44 | 45 | #btnAuthFacebook img, #btnAuthTwitter img { 46 | padding-right: 0.4em; 47 | } 48 | 49 | form#searchFormHome #lblPosts, form#searchFormHome #lblPeople { 50 | display: block; 51 | } 52 | 53 | #formFirstRow { 54 | width: 300px; 55 | margin: 0 auto; 56 | } 57 | 58 | #formFirstRow #searchPlatforms { 59 | float: left; 60 | margin-right: 1em; 61 | } 62 | 63 | #formSecondRow .ui-block-b .ui-btn { 64 | display: block !important; 65 | } 66 | 67 | #formSecondRow .ui-block-b .ui-mini { 68 | margin: .25em 5px; 69 | } 70 | 71 | span#facebookUser img, span#twitterUser img { 72 | margin-right: 0.5em; 73 | -webkit-border-radius: 5px; 74 | -moz-border-radius: 5px; 75 | border-radius: 5px; 76 | border: 1px solid #CCCCCC; 77 | } 78 | 79 | div#home a[href='#preferences'] { 80 | margin: 0; 81 | } 82 | span#facebookUser img, span#facebookUser span, span#twitterUser img, span#twitterUser span { 83 | vertical-align: middle; 84 | } 85 | 86 | div#authTwitter { 87 | margin-top: 1em; 88 | } 89 | 90 | div#authFacebook { 91 | margin-top: 0.5em; 92 | } 93 | img.socialNetworkImg { 94 | display: block; 95 | } 96 | 97 | 98 | /*********************/ 99 | /* TRENDING TOPICS */ 100 | /*********************/ 101 | ul#trendingTopicsList img.twitterThumbnail { 102 | float: left; 103 | margin: 0 0.5em; 104 | padding-top: 10px; 105 | } 106 | 107 | div#trendingTopicsWrapper span.ui-btn-inner { 108 | text-align: center; 109 | } 110 | 111 | 112 | 113 | /********************/ 114 | /* RECENT QUERIES */ 115 | /********************/ 116 | ul#recentQueries { 117 | display: none; 118 | } 119 | 120 | ul#recentQueries .ui-bar-b { 121 | border: none; 122 | } 123 | 124 | ul#recentQueries img { 125 | float: left; 126 | margin-left: 0.5em; 127 | padding-top: 0.6em; 128 | } 129 | 130 | ul#recentQueries div.type { 131 | float: left; 132 | } 133 | 134 | ul#recentQueries div.arrow { 135 | float: left; 136 | padding-top: 0.6em; 137 | padding-left: 0.6em; 138 | } 139 | 140 | ul#recentQueries div.platforms img:last-child { 141 | margin-right: 0.7em; 142 | } 143 | 144 | 145 | 146 | /******************/ 147 | /* SEARCH PAGE */ 148 | /******************/ 149 | span#searchType { 150 | font-style: italic; 151 | } 152 | 153 | span#searchPlatform img { 154 | margin-right: 5px; 155 | } 156 | 157 | div#search a.linkAuthFacebook, div#search a.linkAuthTwitter { 158 | color: #2489CE; 159 | font-weight: bold; 160 | } 161 | 162 | div#search a.linkAuthFacebook:visited, div#search a.linkAuthTwitter:visited { 163 | color: #2489CE; 164 | } 165 | 166 | div#search a.linkAuthFacebook:hover, div#search a.linkAuthTwitter:hover { 167 | cursor: pointer; 168 | } 169 | 170 | div#search div.ui-block-b .ui-btn { 171 | display: block; 172 | } 173 | 174 | div#search div.ui-block-b .ui-mini { 175 | margin: 0.25em 5px; 176 | } 177 | 178 | @media (max-width: 450px) { 179 | span#searchPlatform { 180 | display: block; 181 | margin-top: 0.2em; 182 | } 183 | } 184 | 185 | 186 | 187 | /**************************/ 188 | /* RESULT LISTS GENERAL */ 189 | /**************************/ 190 | .ui-content .ui-listview { 191 | margin-bottom: 15px; 192 | } 193 | 194 | ul.resultList a { 195 | text-decoration: none; 196 | color: #333; 197 | } 198 | 199 | ul.resultList a:hover { 200 | text-decoration: underline; 201 | } 202 | 203 | ul.resultList p.post a { 204 | color: #666666; 205 | text-decoration: underline; 206 | } 207 | 208 | ul.resultList img.thumbnail { 209 | -webkit-border-radius: 5px; 210 | -moz-border-radius: 5px; 211 | border-radius: 5px; 212 | border: 1px solid #CCCCCC; 213 | } 214 | 215 | ul.resultList li.loadMore { 216 | background: #FADB4E; 217 | background-image: -webkit-linear-gradient(#FFEFAA,#FFE155); 218 | background-image: -moz-linear-gradient(#FFEFAA,#FFE155); 219 | background-image: -o-linear-gradient(#FFEFAA,#FFE155); 220 | background-image: -ms-linear-gradient(#FFEFAA,#FFE155); 221 | background-image: linear-gradient(#FFEFAA,#FFE155); 222 | } 223 | 224 | ul.resultList p.img_wrapper { 225 | float: left; 226 | margin-right: 1em; 227 | margin-bottom: 0; 228 | } 229 | 230 | ul.resultList li.loadMore div { 231 | text-align: center !important; 232 | } 233 | 234 | ul.resultList .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li { 235 | padding: 1.2em 15px 0.8em 15px; 236 | } 237 | 238 | ul.resultList li.divider img { 239 | padding-left: 0.6em; 240 | padding-top: 0.5em; 241 | } 242 | 243 | ul.resultList li.divider { 244 | padding: 0.7em 0 0.7em 2.6em !important; 245 | } 246 | 247 | ul.resultList li.loadMore a.ui-link-inherit { 248 | padding: 0.7em 15px 0.7em 15px !important; 249 | } 250 | 251 | ul.resultList li.error { 252 | padding-top: 1.3em; 253 | padding-bottom: 0.9em !important; 254 | } 255 | 256 | ul.resultList li.error p { 257 | margin-bottom: 0; 258 | } 259 | 260 | ul.resultList .ui-li-aside { 261 | width: auto; 262 | } 263 | 264 | ul.resultList span.name { 265 | font-size: 16px; 266 | font-weight: bold; 267 | display: block; 268 | margin-top: 0.2em; 269 | margin-left: 0.6em; 270 | } 271 | 272 | ul.resultList li.ui-li-has-count { 273 | padding-right: 80px; 274 | } 275 | 276 | ul.resultList li.posts span.name { 277 | padding-right: 80px; 278 | } 279 | 280 | ul.resultList li.posts span.text-only { 281 | display: block; 282 | margin-bottom: 0.5em; 283 | } 284 | 285 | ul.resultList li.posts span.attachment { 286 | display:block; 287 | clear: both; 288 | padding-top: 0.5em; 289 | } 290 | 291 | ul.resultList .ui-li .ui-li-heading a, .ui-li-desc { 292 | white-space: normal !important; 293 | } 294 | 295 | ul.resultList li.posts span.attachment img.preview { 296 | margin-top: 0.4em; 297 | } 298 | 299 | 300 | 301 | /******************/ 302 | /* TWITTER LIST */ 303 | /******************/ 304 | ul#twitterList a.twitterLink { 305 | color: #2489CE; 306 | font-weight: bold; 307 | } 308 | 309 | ul#twitterList span.screenName { 310 | color: #777; 311 | font-size: 0.9em; 312 | display: block; 313 | } 314 | 315 | ul.resultList span.post { 316 | font-size: 12px; 317 | font-weight: normal; 318 | display: block; 319 | margin-top: 0.2em; 320 | } 321 | 322 | ul#twitterList li.people span.latestTweet a.timestamp { 323 | color: #666; 324 | } 325 | 326 | ul.resultList li.people span.name { 327 | margin-top: -0.4em; 328 | margin-left: 3.9em; 329 | } 330 | 331 | ul#twitterList li.people span.description { 332 | font-size: 12px; 333 | font-weight: normal; 334 | font-style: italic; 335 | margin-top: 0.35em; 336 | display: block; 337 | } 338 | 339 | ul#twitterList li.people span.description { 340 | font-size: 12px; 341 | font-weight: normal; 342 | font-style: italic; 343 | margin-top: 0.35em; 344 | display: block; 345 | } 346 | 347 | ul#twitterList li.people span.latestTweet { 348 | font-size: 12px; 349 | font-weight: normal; 350 | display: block; 351 | clear: both; 352 | margin-top: 1em; 353 | } 354 | 355 | ul#twitterList li.people span.latestTweetLabel { 356 | font-weight: bold; 357 | } 358 | 359 | ul#twitterList li.posts span.name { 360 | margin-top: 0; 361 | } 362 | 363 | ul#twitterList li.posts span.replyLinks { 364 | font-size: 12px; 365 | font-weight: normal; 366 | display: block; 367 | margin-top: 0.25em; 368 | } 369 | 370 | ul#twitterList li.posts span.replyLinks a { 371 | margin-right: 1em; 372 | } 373 | 374 | 375 | 376 | /*******************/ 377 | /* FACEBOOK LIST */ 378 | /*******************/ 379 | ul#facebookList li.people.ui-li-static.ui-li { 380 | padding-bottom: 2.1em; 381 | } 382 | 383 | ul#facebookList li.people span.name { 384 | margin-top: 0.6em; 385 | } 386 | 387 | ul#facebookList li.posts span.post img { 388 | margin-right: 0.5em; 389 | } 390 | 391 | 392 | 393 | /*****************/ 394 | /* GOOGLE LIST */ 395 | /*****************/ 396 | ul#googleList li.people.ui-li-static.ui-li { 397 | padding-bottom: 2.1em; 398 | } 399 | 400 | ul#googleList li.people span.name { 401 | margin-top: 0.6em; 402 | } 403 | 404 | ul#googleList li.posts span.attachment img { 405 | margin-right: 0.2em; 406 | } 407 | 408 | 409 | 410 | /**********************/ 411 | /* PREFERENCES PAGE */ 412 | /**********************/ 413 | @media (min-width: 450px) { 414 | .ui-field-contain .ui-controlgroup-controls { 415 | width: 35%; 416 | } 417 | } 418 | 419 | @media (max-width: 450px) { 420 | .controlsWrapper { 421 | margin: 0 auto; 422 | width: 250px; 423 | } 424 | } 425 | 426 | 427 | 428 | /*************************/ 429 | /* AUTHENTICATION PAGE */ 430 | /*************************/ 431 | div.authError { 432 | display: none; 433 | } 434 | p.user img { 435 | margin-right: 0.5em; 436 | -webkit-border-radius: 5px; 437 | -moz-border-radius: 5px; 438 | border-radius: 5px; 439 | border: 1px solid #CCCCCC; 440 | } 441 | p.user img, p.user span { 442 | vertical-align: middle; 443 | font-weight: bold; 444 | } 445 | 446 | 447 | 448 | /***************/ 449 | /* INFO PAGE */ 450 | /***************/ 451 | div#info div.row { 452 | margin-top: 0.8em; 453 | } 454 | div#info div#networks { 455 | width: 115px; 456 | text-align: left; 457 | margin: 0 auto; 458 | margin-bottom: 2em; 459 | } 460 | div#info div.row img { 461 | vertical-align: middle; 462 | margin-right: 0.2em; 463 | } 464 | div#info div#about p { 465 | margin-bottom: 2em; 466 | } 467 | div#info div#about span { 468 | margin-bottom: 0.3em; 469 | display: block; 470 | font-weight: bold; 471 | } 472 | div#info p#author { 473 | margin-bottom: 0 !important; 474 | } 475 | div#info p#contact img { 476 | margin-right: 0.5em; 477 | } 478 | 479 | 480 | 481 | /***************/ 482 | /* COPYRIGHT */ 483 | /***************/ 484 | div.copyright { 485 | color: #CCCCCC; 486 | font-weight: bold; 487 | } -------------------------------------------------------------------------------- /img/ajax_loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/ajax_loader.gif -------------------------------------------------------------------------------- /img/apple-touch-icon-114x114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/apple-touch-icon-114x114-precomposed.png -------------------------------------------------------------------------------- /img/apple-touch-icon-72x72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/apple-touch-icon-72x72-precomposed.png -------------------------------------------------------------------------------- /img/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /img/circle_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/circle_green.png -------------------------------------------------------------------------------- /img/circle_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/circle_red.png -------------------------------------------------------------------------------- /img/error_facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/error_facebook.png -------------------------------------------------------------------------------- /img/error_twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/error_twitter.png -------------------------------------------------------------------------------- /img/facebook_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/facebook_icon.png -------------------------------------------------------------------------------- /img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/favicon.png -------------------------------------------------------------------------------- /img/google_article.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/google_article.png -------------------------------------------------------------------------------- /img/google_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/google_icon.png -------------------------------------------------------------------------------- /img/google_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/google_photo.png -------------------------------------------------------------------------------- /img/google_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/google_video.png -------------------------------------------------------------------------------- /img/ok_facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/ok_facebook.png -------------------------------------------------------------------------------- /img/ok_twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/ok_twitter.png -------------------------------------------------------------------------------- /img/people_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/people_icon.png -------------------------------------------------------------------------------- /img/posts_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/posts_icon.png -------------------------------------------------------------------------------- /img/twitter_favourite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/twitter_favourite.png -------------------------------------------------------------------------------- /img/twitter_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/twitter_icon.png -------------------------------------------------------------------------------- /img/twitter_reply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/twitter_reply.png -------------------------------------------------------------------------------- /img/twitter_retweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/twitter_retweet.png -------------------------------------------------------------------------------- /img/twitter_verified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenzz/social-web-search/75b62b947a13857bddc194109f19dfa958ee0d36/img/twitter_verified.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |© 2012 Jens Driller, University of Kent.
142 |© 2012 Jens Driller, University of Kent.
178 |© 2012 Jens Driller, University of Kent.
323 |This mobile web app allows you to search for people and posts
on the three main social networks:
364 | Based on: 365 | jQuery 1.7.1 and 366 | jQuery Mobile 1.1.0 367 |
368 | 374 | 379 | 380 |© 2012 Jens Driller, University of Kent.
388 |You have been authorised successfully.
411 |You can now start searching for people on Twitter.
412 |You have cancelled the authentication or an error occurred.
417 |© 2012 Jens Driller, University of Kent.
425 |You have been authorised successfully.
448 |You can now start searching for people on Facebook.
449 |You have cancelled the authentication or an error occurred.
454 |© 2012 Jens Driller, University of Kent.
462 |You were successfully logged out from Twitter.
483 | 484 |© 2012 Jens Driller, University of Kent.
490 |You were successfully logged out from Facebook.
511 | 512 |© 2012 Jens Driller, University of Kent.
518 |"+o.buttonPrompt+"
").appendTo(buttonHTML); 127 | } 128 | 129 | if ( o.buttonInput !== false ) { 130 | $.mobile.sdLastInput = ""; 131 | pickerInput.appendTo(buttonHTML); 132 | pickerInput.find('input').bind('change', function () { 133 | $.mobile.sdLastInput = pickerInput.find('input').first().val(); 134 | self.thisInput = pickerInput.find('input').first().val(); 135 | }); 136 | } 137 | 138 | pickerChoice.appendTo(buttonHTML); 139 | 140 | self.butObj = []; 141 | 142 | $.each(o.buttons, function(name, props) { 143 | props = $.isFunction( props ) ? { click: props } : props; 144 | props = $.extend({ 145 | text : name, 146 | id : name + self.internalID, 147 | theme : o.themeButtonDefault, 148 | icon : 'check', 149 | iconpos: 'left', 150 | corners: 'true', 151 | shadow : 'true', 152 | args : [], 153 | close : true 154 | }, props); 155 | 156 | self.butObj.push($(""+name+"") 157 | .appendTo(pickerChoice) 158 | .attr('id', props.id) 159 | .buttonMarkup({ 160 | theme : props.theme, 161 | icon : props.icon, 162 | iconpos: props.iconpos, 163 | corners: props.corners, 164 | shadow : props.shadow 165 | }).unbind("vclick click") 166 | .bind(o.clickEvent, function() { 167 | if ( o.buttonInput ) { self.sdIntContent.find('input [name=pickin]').trigger('change'); } 168 | //var returnValue = props.click.apply(self.element[0], arguments); 169 | var returnValue = props.click.apply(self, $.merge(arguments, props.args)); 170 | if ( returnValue !== false && props.close === true ) { 171 | self.close(); 172 | } 173 | }) 174 | ); 175 | }); 176 | 177 | return buttonHTML; 178 | }, 179 | _getCoords: function(widget) { 180 | var self = widget, 181 | docWinWidth = $.mobile.activePage.width(), 182 | docWinHighOff = $(window).scrollTop(), 183 | docWinHigh = $(window).height(), 184 | diaWinWidth = widget.sdIntContent.innerWidth(), 185 | diaWinHigh = widget.sdIntContent.outerHeight(), 186 | 187 | coords = { 188 | 'high' : $(window).height(), 189 | 'width' : $.mobile.activePage.width(), 190 | 'fullTop' : $(window).scrollTop(), 191 | 'fullLeft': $(window).scrollLeft(), 192 | 'winTop' : docWinHighOff + ((widget.options.top !== false) ? widget.options.top : (( docWinHigh / 2 ) - ( diaWinHigh / 2 ) )), 193 | 'winLeft' : ((widget.options.left !== false) ? widget.options.left : (( docWinWidth / 2 ) - ( diaWinWidth / 2 ) )) 194 | }; 195 | 196 | if ( coords.winTop < 45 ) { coords.winTop = 45; } 197 | 198 | return coords; 199 | }, 200 | _orientChange: function(e) { 201 | var self = e.data.widget, 202 | o = e.data.widget.options, 203 | coords = e.data.widget._getCoords(e.data.widget); 204 | 205 | e.stopPropagation(); 206 | 207 | if ( self.isDialog === true ) { 208 | return true; 209 | } else { 210 | if ( o.fullScreen === true && ( coords.width < 400 || o.fullScreenForce === true ) ) { 211 | self.sdIntContent.css({'border': 'none', 'position': 'absolute', 'top': coords.fullTop, 'left': coords.fullLeft, 'height': coords.high, 'width': coords.width, 'maxWidth': coords.width }).removeClass('ui-simpledialog-hidden'); 212 | } else { 213 | self.sdIntContent.css({'position': 'absolute', 'top': coords.winTop, 'left': coords.winLeft}).removeClass('ui-simpledialog-hidden'); 214 | } 215 | } 216 | }, 217 | repos: function() { 218 | var bsEvent = { data: {widget:this}, stopPropagation: function () { return true; }}; 219 | this._orientChange(bsEvent); 220 | }, 221 | open: function() { 222 | var self = this, 223 | o = this.options, 224 | coords = this._getCoords(this); 225 | 226 | self.sdAllContent.find('.ui-btn-active').removeClass('ui-btn-active'); 227 | self.sdIntContent.delegate('[rel=close]', o.clickEvent, function (e) { e.preventDefault(); self.close(); }); 228 | 229 | if ( ( o.dialogAllow === true && coords.width < 400 ) || o.dialogForce ) { 230 | self.isDialog = true; 231 | 232 | if ( o.mode === 'blank' ) { // Custom selects do not play well with dialog mode - so, we turn them off. 233 | self.sdIntContent.find('select').each(function () { 234 | $(this).jqmData('nativeMenu', true); 235 | }); 236 | } 237 | 238 | self.displayAnchor.parent().unbind("pagehide.remove"); 239 | self.sdAllContent.append(self.sdIntContent); 240 | self.sdAllContent.trigger('create'); 241 | if ( o.headerText !== false ) { 242 | self.sdHeader.find('h1').appendTo(self.dialogPage.find('[data-role=header]')); 243 | self.sdIntContent.find('.ui-header').empty().removeClass(); 244 | } 245 | if ( o.headerClose === true ) { 246 | self.dialogPage.find('.ui-header a').bind('click', function () { 247 | setTimeout("$.mobile.sdCurrentDialog.destroy();", 1000); 248 | }); 249 | } else { 250 | self.dialogPage.find('.ui-header a').remove(); 251 | } 252 | 253 | self.sdIntContent.removeClass().css({'top': 'auto', 'width': 'auto', 'left': 'auto', 'marginLeft': 'auto', 'marginRight': 'auto', 'zIndex': o.zindex}); 254 | $.mobile.changePage(self.dialogPage, {'transition': (o.animate === true) ? o.transition : 'none'}); 255 | } else { 256 | self.isDialog = false; 257 | self.selects = []; 258 | 259 | if ( o.fullScreen === false ) { 260 | if ( o.showModal === true && o.animate === true ) { self.screen.fadeIn('slow'); } 261 | else { self.screen.removeClass('ui-simpledialog-hidden'); } 262 | } 263 | 264 | self.sdIntContent.addClass('ui-overlay-shadow in').css('zIndex', o.zindex).trigger('create'); 265 | 266 | if ( o.fullScreen === true && ( coords.width < 400 || o.fullScreenForce === true ) ) { 267 | self.sdIntContent.removeClass('ui-simpledialog-container').css({'border': 'none', 'position': 'absolute', 'top': coords.fullTop, 'left': coords.fullLeft, 'height': coords.high, 'width': coords.width, 'maxWidth': coords.width }).removeClass('ui-simpledialog-hidden'); 268 | } else { 269 | self.sdIntContent.css({'position': 'absolute', 'top': coords.winTop, 'left': coords.winLeft}).removeClass('ui-simpledialog-hidden'); 270 | } 271 | 272 | $(document).bind('orientationchange.simpledialog', {widget:self}, function(e) { self._orientChange(e); }); 273 | if ( o.resizeListener === true ) { 274 | $(window).bind('resize.simpledialog', {widget:self}, function (e) { self._orientChange(e); }); 275 | } 276 | } 277 | if ( $.isFunction(o.callbackOpen) ) { 278 | o.callbackOpen.apply(self, o.callbackOpenArgs); 279 | } 280 | }, 281 | close: function() { 282 | var self = this, retty; 283 | 284 | if ( $.isFunction(self.options.callbackClose) ) { 285 | retty = self.options.callbackClose.apply(self, self.options.callbackCloseArgs); 286 | if ( retty === false ) { return false; } 287 | } 288 | 289 | if ( self.isDialog ) { 290 | $(self.dialogPage).dialog('close'); 291 | self.sdIntContent.addClass('ui-simpledialog-hidden'); 292 | self.sdIntContent.appendTo(self.displayAnchor.parent()); 293 | if ( $.mobile.activePage.jqmData("page").options.domCache != true ) { 294 | $.mobile.activePage.bind("pagehide.remove", function () { 295 | $(this).remove(); 296 | }); 297 | } 298 | } else { 299 | if ( self.options.showModal === true && self.options.animate === true ) { 300 | self.screen.fadeOut('slow'); 301 | } else { 302 | self.screen.addClass('ui-simpledialog-hidden'); 303 | } 304 | self.sdIntContent.addClass('ui-simpledialog-hidden').removeClass('in'); 305 | $(document).unbind('orientationchange.simpledialog'); 306 | if ( self.options.resizeListener === true ) { $(window).unbind('resize.simpledialog'); } 307 | } 308 | 309 | //$.mobile.activePage.find('.ui-btn-active').removeClass('ui-btn-active'); 310 | 311 | if ( self.isDialog === true || self.options.animate === true ) { 312 | setTimeout("$.mobile.sdCurrentDialog.destroy();", 1000); 313 | } else { 314 | self.destroy(); 315 | } 316 | }, 317 | destroy: function() { 318 | var self = this, 319 | ele = self.element; 320 | 321 | if ( self.options.mode === 'blank' ) { 322 | $.mobile.sdCurrentDialog.sdIntContent.find('select').each(function() { 323 | if ( $(this).data('nativeMenu') == false ) { 324 | $(this).data('selectmenu').menuPage.remove(); 325 | $(this).data('selectmenu').screen.remove(); 326 | $(this).data('selectmenu').listbox.remove(); 327 | } 328 | }); 329 | } 330 | 331 | $(self.sdIntContent).remove(); 332 | $(self.dialogPage).remove(); 333 | $(self.screen).remove(); 334 | $(document).unbind('simpledialog.'+self.internalID); 335 | delete $.mobile.sdCurrentDialog; 336 | $.Widget.prototype.destroy.call(self); 337 | if ( self.options.safeNuke === true && $(ele).parents().length === 0 && $(ele).contents().length === 0 ) { 338 | ele.remove(); 339 | } 340 | }, 341 | updateBlank: function (newHTML) { 342 | var self = this, 343 | o = this.options; 344 | 345 | self.sdIntContent.empty(); 346 | 347 | if ( o.headerText !== false || o.headerClose !== false ) { 348 | self.sdHeader = $(''); 349 | if ( o.headerClose === true ) { 350 | $("Close").appendTo(self.sdHeader).buttonMarkup({ theme : o.themeHeader, icon : 'delete', iconpos: 'notext', corners: true, shadow : true }); 351 | } 352 | $('