1 From 77d1c8c71a7bc71b807e2fe1e0eca3b286bcb04b Mon Sep 17 00:00:00 2001
2 From: Minkyeong Kim <minkyeong.kim@samsung.com>
3 Date: Wed, 30 Jan 2013 19:11:23 +0900
4 Subject: [PATCH] JQM performance tuning
7 .../js/events/orientationchange.js | 8 +++---
8 libs/js/jquery-mobile-1.2.0/js/events/touch.js | 4 +-
9 .../js/jquery.mobile.buttonMarkup.js | 23 ++++++++++---------
10 .../jquery-mobile-1.2.0/js/jquery.mobile.core.js | 8 +++++-
11 .../js/jquery.mobile.degradeInputs.js | 2 +-
12 .../js/jquery.mobile.fieldContain.js | 2 +-
13 .../jquery-mobile-1.2.0/js/jquery.mobile.init.js | 12 +++++-----
14 .../jquery-mobile-1.2.0/js/jquery.mobile.links.js | 2 +-
15 .../jquery-mobile-1.2.0/js/jquery.mobile.media.js | 2 +-
16 .../js/jquery.mobile.navigation.js | 14 ++++++------
17 .../js/jquery.mobile.navigation.pushstate.js | 6 ++--
18 .../jquery-mobile-1.2.0/js/jquery.mobile.nojs.js | 2 +-
19 .../js/jquery.mobile.transition.js | 10 ++++----
20 .../jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js | 2 +-
21 .../js/jquery.mobile.zoom.iosorientationfix.js | 2 +-
22 .../jquery-mobile-1.2.0/js/widgets/collapsible.js | 2 +-
23 .../js/widgets/collapsibleSet.js | 2 +-
24 libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js | 2 +-
25 .../jquery-mobile-1.2.0/js/widgets/fixedToolbar.js | 8 +++---
26 .../jquery-mobile-1.2.0/js/widgets/forms/button.js | 4 +-
27 .../js/widgets/forms/checkboxradio.js | 2 +-
28 .../js/widgets/forms/select.custom.js | 4 +-
29 .../jquery-mobile-1.2.0/js/widgets/forms/select.js | 2 +-
30 .../jquery-mobile-1.2.0/js/widgets/forms/slider.js | 4 +-
31 .../js/widgets/forms/textinput.js | 6 ++--
32 .../js/widgets/listview.autodividers.js | 2 +-
33 .../js/widgets/listview.filter.js | 2 +-
34 libs/js/jquery-mobile-1.2.0/js/widgets/listview.js | 2 +-
35 libs/js/jquery-mobile-1.2.0/js/widgets/loader.js | 6 ++--
36 libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js | 2 +-
37 .../js/widgets/page.sections.js | 11 +++++----
38 libs/js/jquery-mobile-1.2.0/js/widgets/popup.js | 8 +++---
39 32 files changed, 87 insertions(+), 81 deletions(-)
41 diff --git a/libs/js/jquery-mobile-1.2.0/js/events/orientationchange.js b/libs/js/jquery-mobile-1.2.0/js/events/orientationchange.js
42 index 95674f3..de903c8 100644
43 --- a/libs/js/jquery-mobile-1.2.0/js/events/orientationchange.js
44 +++ b/libs/js/jquery-mobile-1.2.0/js/events/orientationchange.js
45 @@ -7,7 +7,7 @@ define( [ "jquery", "../jquery.mobile.support.orientation", "./throttledresize"
46 //>>excludeEnd("jqmBuildExclude");
48 (function( $, window ) {
49 - var win = $( window ),
50 + var win = $.mobile.$window,
51 event_name = "orientationchange",
54 @@ -44,8 +44,8 @@ define( [ "jquery", "../jquery.mobile.support.orientation", "./throttledresize"
55 // developer console. The actual threshold value is somewhat arbitrary, we just
56 // need to make sure it is large enough to exclude the developer console case.
58 - var ww = window.innerWidth || $( window ).width(),
59 - wh = window.innerHeight || $( window ).height(),
60 + var ww = window.innerWidth || $.mobile.$window.width(),
61 + wh = window.innerHeight || $.mobile.$window.height(),
62 landscape_threshold = 50;
64 initial_orientation_is_landscape = ww > wh && ( ww - wh ) > landscape_threshold;
65 @@ -151,4 +151,4 @@ define( [ "jquery", "../jquery.mobile.support.orientation", "./throttledresize"
67 //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
69 -//>>excludeEnd("jqmBuildExclude");
70 \ No newline at end of file
71 +//>>excludeEnd("jqmBuildExclude");
72 diff --git a/libs/js/jquery-mobile-1.2.0/js/events/touch.js b/libs/js/jquery-mobile-1.2.0/js/events/touch.js
73 index 6083faf..9e616cc 100644
74 --- a/libs/js/jquery-mobile-1.2.0/js/events/touch.js
75 +++ b/libs/js/jquery-mobile-1.2.0/js/events/touch.js
76 @@ -103,7 +103,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
78 $this.unbind( "vclick", clickHandler )
79 .unbind( "vmouseup", clearTapTimer );
80 - $( document ).unbind( "vmousecancel", clearTapHandlers );
81 + $.mobile.$document.unbind( "vmousecancel", clearTapHandlers );
84 function clickHandler( event ) {
85 @@ -118,7 +118,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
87 $this.bind( "vmouseup", clearTapTimer )
88 .bind( "vclick", clickHandler );
89 - $( document ).bind( "vmousecancel", clearTapHandlers );
90 + $.mobile.$document.bind( "vmousecancel", clearTapHandlers );
92 timer = setTimeout( function() {
93 triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
94 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
95 index cd95245..b0b1f19 100644
96 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
97 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
98 @@ -11,6 +11,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.vmouse" ], function
100 $.fn.buttonMarkup = function( options ) {
101 var $workingSet = this,
102 + prefix = "data-" + $.mobile.ns,
103 mapToDataAttr = function( key, value ) {
104 e.setAttribute( "data-" + $.mobile.ns + key, value );
105 el.jqmData( key, value );
106 @@ -22,14 +23,14 @@ $.fn.buttonMarkup = function( options ) {
107 var el = $workingSet.eq( i ),
109 o = $.extend( {}, $.fn.buttonMarkup.defaults, {
110 - icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ),
111 - iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ),
112 - theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ),
113 - inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ),
114 - shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ),
115 - corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ),
116 - iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" ),
117 - mini: options.mini !== undefined ? options.mini : el.jqmData( "mini" )
118 + icon: options.icon !== undefined ? options.icon : ( e.getAttribute( prefix + "icon" ) || undefined ),
119 + iconpos: options.iconpos !== undefined ? options.iconpos : ( e.getAttribute( prefix + "iconpos" ) || undefined ),
120 + theme: options.theme !== undefined ? options.theme : e.getAttribute( prefix + "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ),
121 + inline: options.inline !== undefined ? options.inline : /^true$/i.test( e.getAttribute( prefix + "inline" ) ),
122 + shadow: options.shadow !== undefined ? options.shadow : !/^false$/i.test( e.getAttribute( prefix + "shadow" ) ),
123 + corners: options.corners !== undefined ? options.corners : !/^false$/i.test( e.getAttribute( prefix + "corners" ) ),
124 + iconshadow: options.iconshadow !== undefined ? options.iconshadow : !/^false$/i.test( e.getAttribute( prefix + "iconshadow" ) ),
125 + mini: options.mini !== undefined ? options.mini : /^true$/i.test( e.getAttribute( prefix + "mini" ) )
129 @@ -44,7 +45,7 @@ $.fn.buttonMarkup = function( options ) {
131 $.each( o, mapToDataAttr );
133 - if ( el.jqmData( "rel" ) === "popup" && el.attr( "href" ) ) {
134 + if ( e.getAttribute( prefix + "rel" ) === "popup" && el.attr( "href" ) ) {
135 e.setAttribute( "aria-haspopup", true );
136 e.setAttribute( "aria-owns", e.getAttribute( "href" ) );
138 @@ -249,7 +250,7 @@ function closestEnabledButton( element ) {
139 var attachEvents = function() {
140 var hoverDelay = $.mobile.buttonMarkup.hoverDelay, hov, foc;
142 - $( document ).bind( {
143 + $.mobile.$document.bind( {
144 "vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart touchend touchcancel": function( event ) {
146 $btn = $( closestEnabledButton( event.target ) ),
147 @@ -303,7 +304,7 @@ var attachEvents = function() {
149 //links in bars, or those with data-role become buttons
150 //auto self-init widgets
151 -$( document ).bind( "pagecreate create", function( e ) {
152 +$.mobile.$document.bind( "pagecreate create", function( e ) {
154 $( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target )
156 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
157 index 4e8ebfe..873293c 100644
158 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
159 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
160 @@ -84,6 +84,10 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
164 + // define the window and the document objects
165 + $window: $( window ),
166 + $document: $( document ),
168 // TODO might be useful upstream in jquery itself ?
171 @@ -131,7 +135,7 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
173 setTimeout( function() {
174 window.scrollTo( 0, ypos );
175 - $( document ).trigger( "silentscroll", { x: 0, y: ypos });
176 + $.mobile.$document.trigger( "silentscroll", { x: 0, y: ypos });
179 setTimeout( function() {
180 @@ -237,7 +241,7 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
181 getScreenHeight: function() {
182 // Native innerHeight returns more accurate value for this across platforms,
183 // jQuery version is here as a normalized fallback for platforms like Symbian
184 - return window.innerHeight || $( window ).height();
185 + return window.innerHeight || $.mobile.$window.height();
189 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.degradeInputs.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.degradeInputs.js
190 index 28abc52..6951e17 100644
191 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.degradeInputs.js
192 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.degradeInputs.js
193 @@ -26,7 +26,7 @@ $.mobile.page.prototype.options.degradeInputs = {
196 //auto self-init widgets
197 -$( document ).bind( "pagecreate create", function( e ) {
198 +$.mobile.$document.bind( "pagecreate create", function( e ) {
200 var page = $.mobile.closestPageData( $( e.target ) ), options;
202 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.fieldContain.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.fieldContain.js
203 index daf66e7..c7fd931 100644
204 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.fieldContain.js
205 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.fieldContain.js
206 @@ -19,7 +19,7 @@ $.fn.fieldcontain = function( options ) {
209 //auto self-init widgets
210 -$( document ).bind( "pagecreate create", function( e ) {
211 +$.mobile.$document.bind( "pagecreate create", function( e ) {
212 $( ":jqmData(role='fieldcontain')", e.target ).jqmEnhanceable().fieldcontain();
215 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.init.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.init.js
216 index 52f6434..d31ddf0 100644
217 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.init.js
218 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.init.js
219 @@ -10,7 +10,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
220 (function( $, window, undefined ) {
221 var $html = $( "html" ),
223 - $window = $( window );
224 + $window = $.mobile.$window;
226 //remove initial build class (only present on first pageshow)
227 function hideRenderingClass() {
228 @@ -70,7 +70,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
229 var $this = $( this );
231 // unless the data url is already set set it to the pathname
232 - if ( !$this.jqmData( "url" ) ) {
233 + if ( !$this[0].getAttribute( "data-" + $.mobile.ns + "url" ) ) {
234 $this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) || location.pathname + location.search );
237 @@ -79,7 +79,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
238 $.mobile.firstPage = $pages.first();
240 // define page container
241 - $.mobile.pageContainer = $pages.first().parent().addClass( "ui-mobile-viewport" );
242 + $.mobile.pageContainer = $.mobile.firstPage.parent().addClass( "ui-mobile-viewport" );
244 // alert listeners that the pagecontainer has been determined for binding
245 // to events triggered on it
246 @@ -127,13 +127,13 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
247 // if defaultHomeScroll hasn't been set yet, see if scrollTop is 1
248 // it should be 1 in most browsers, but android treats 1 as 0 (for hiding addr bar)
249 // so if it's 1, use 0 from now on
250 - $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $( window ).scrollTop() === 1 ) ? 0 : 1;
251 + $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $.mobile.$window.scrollTop() === 1 ) ? 0 : 1;
254 // TODO: Implement a proper registration mechanism with dependency handling in order to not have exceptions like the one below
255 //auto self-init widgets for those widgets that have a soft dependency on others
256 if ( $.fn.controlgroup ) {
257 - $( document ).bind( "pagecreate create", function( e ) {
258 + $.mobile.$document.bind( "pagecreate create", function( e ) {
259 $( ":jqmData(role='controlgroup')", e.target )
261 .controlgroup({ excludeInvisible: false });
262 @@ -154,7 +154,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
263 // by adding the 'ui-disabled' class to them. Using a JavaScript workaround for those browser.
264 // https://github.com/jquery/jquery-mobile/issues/3558
266 - $( document ).delegate( ".ui-disabled", "vclick",
267 + $.mobile.$document.delegate( ".ui-disabled", "vclick",
270 e.stopImmediatePropagation();
271 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.links.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.links.js
272 index a3bfdba..4145d30 100644
273 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.links.js
274 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.links.js
275 @@ -8,7 +8,7 @@ define( [ "jquery" ], function( $ ) {
276 //>>excludeEnd("jqmBuildExclude");
277 (function( $, undefined ) {
279 -$( document ).bind( "pagecreate create", function( e ) {
280 +$.mobile.$document.bind( "pagecreate create", function( e ) {
282 //links within content areas, tests included with page
284 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.media.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.media.js
285 index 73b6802..2068ca5 100644
286 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.media.js
287 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.media.js
288 @@ -8,7 +8,7 @@ define( [ "jquery", "./jquery.mobile.core" ], function( $ ) {
289 //>>excludeEnd("jqmBuildExclude");
290 (function( $, undefined ) {
292 -var $window = $( window ),
293 +var $window = $.mobile.$window,
296 /* $.mobile.media method: pass a CSS media type or query and get a bool return
297 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
298 index 9048789..203557a 100644
299 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
300 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
301 @@ -15,7 +15,7 @@ define( [
302 (function( $, undefined ) {
304 //define vars for interal use
305 - var $window = $( window ),
306 + var $window = $.mobile.$window,
310 @@ -1256,7 +1256,7 @@ define( [
311 $.mobile.navreadyDeferred = $.Deferred();
312 $.mobile.navreadyDeferred.done(function() {
313 //bind to form submit events, handle with Ajax
314 - $( document ).delegate( "form", "submit", function( event ) {
315 + $.mobile.$document.delegate( "form", "submit", function( event ) {
316 var $this = $( this );
318 if ( !$.mobile.ajaxEnabled ||
319 @@ -1309,7 +1309,7 @@ define( [
322 //add active state on vclick
323 - $( document ).bind( "vclick", function( event ) {
324 + $.mobile.$document.bind( "vclick", function( event ) {
325 // if this isn't a left click we don't care. Its important to note
326 // that when the virtual event is generated it will create the which attr
327 if ( event.which > 1 || !$.mobile.linkBindingEnabled ) {
328 @@ -1335,7 +1335,7 @@ define( [
331 // click routing - direct to HTTP or Ajax, accordingly
332 - $( document ).bind( "click", function( event ) {
333 + $.mobile.$document.bind( "click", function( event ) {
334 if ( !$.mobile.linkBindingEnabled ) {
337 @@ -1433,7 +1433,7 @@ define( [
340 //prefetch pages when anchors with data-prefetch are encountered
341 - $( document ).delegate( ".ui-page", "pageshow.prefetch", function() {
342 + $.mobile.$document.delegate( ".ui-page", "pageshow.prefetch", function() {
344 $( this ).find( "a:jqmData(prefetch)" ).each(function() {
345 var $link = $( this ),
346 @@ -1553,8 +1553,8 @@ define( [
349 //set page min-heights to be device specific
350 - $( document ).bind( "pageshow", resetActivePageHeight );
351 - $( window ).bind( "throttledresize", resetActivePageHeight );
352 + $.mobile.$document.bind( "pageshow", resetActivePageHeight );
353 + $.mobile.$window.bind( "throttledresize", resetActivePageHeight );
355 });//navreadyDeferred done callback
357 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.pushstate.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.pushstate.js
358 index e0c73e4..10761d1 100644
359 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.pushstate.js
360 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.pushstate.js
361 @@ -11,14 +11,14 @@ define( [ "jquery", "./jquery.mobile.navigation", "depend!./jquery.hashchange[jq
362 // methods handed off as event handlers
363 var pushStateHandler = {},
364 self = pushStateHandler,
365 - $win = $( window ),
366 + $win = $.mobile.$window,
367 url = $.mobile.path.parseLocation(),
368 mobileinitDeferred = $.Deferred(),
369 domreadyDeferred = $.Deferred();
371 - $( document ).ready( $.proxy( domreadyDeferred, "resolve" ) );
372 + $.mobile.$document.ready( $.proxy( domreadyDeferred, "resolve" ) );
374 - $( document ).one( "mobileinit", $.proxy( mobileinitDeferred, "resolve" ) );
375 + $.mobile.$document.one( "mobileinit", $.proxy( mobileinitDeferred, "resolve" ) );
377 $.extend( pushStateHandler, {
378 // TODO move to a path helper, this is rather common functionality
379 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.nojs.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.nojs.js
380 index 159d1fc..807a319 100644
381 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.nojs.js
382 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.nojs.js
383 @@ -7,7 +7,7 @@ define( [ "jquery" ], function( $ ) {
384 //>>excludeEnd("jqmBuildExclude");
385 (function( $, undefined ) {
387 -$( document ).bind( "pagecreate create", function( e ) {
388 +$.mobile.$document.bind( "pagecreate create", function( e ) {
389 $( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" );
392 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.transition.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.transition.js
393 index cb7c9a7..f8edcee 100644
394 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.transition.js
395 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.transition.js
396 @@ -24,8 +24,8 @@ var createHandler = function( sequential ) {
397 active = $.mobile.urlHistory.getActive(),
398 toScroll = active.lastScroll || $.mobile.defaultHomeScroll,
399 screenHeight = $.mobile.getScreenHeight(),
400 - maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $( window ).width() > $.mobile.maxTransitionWidth,
401 - none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $( window ).scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(),
402 + maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $.mobile.$window.width() > $.mobile.maxTransitionWidth,
403 + none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $.mobile.$window.scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(),
404 toPreClass = " ui-page-pre-in",
405 toggleViewportClass = function() {
406 $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name );
407 @@ -35,7 +35,7 @@ var createHandler = function( sequential ) {
408 // Don't scoll window, when current scroll top(scrollTop()) is already at toScroll,
409 // or when current scroll top is 0 and toScroll is same to defaultHomeScroll
410 // (which means the top position of page). In these case, page scrolling is not needed.
411 - var st = $( window ).scrollTop();
412 + var st = $.mobile.$window.scrollTop();
413 if( st === toScroll || ( $.mobile.defaultHomeScroll === toScroll && st == 0 ) ) {
416 @@ -68,7 +68,7 @@ var createHandler = function( sequential ) {
417 // Set the from page's height and start it transitioning out
418 // Note: setting an explicit height helps eliminate tiling in the transitions
420 - .height( screenHeight + $( window ).scrollTop() )
421 + .height( screenHeight + $.mobile.$window.scrollTop() )
422 .addClass( name + " out" + reverseClass );
425 @@ -130,7 +130,7 @@ var createHandler = function( sequential ) {
427 // In some browsers (iOS5), 3D transitions block the ability to scroll to the desired location during transition
428 // This ensures we jump to that spot after the fact, if we aren't there already.
429 - if ( $( window ).scrollTop() !== toScroll ) {
430 + if ( $.mobile.$window.scrollTop() !== toScroll ) {
434 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js
435 index 25188d8..a98b73e 100644
436 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js
437 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js
438 @@ -38,7 +38,7 @@ var dataPropertyName = "virtualMouseBindings",
439 blockMouseTriggers = false,
440 blockTouchTriggers = false,
441 eventCaptureSupported = "addEventListener" in document,
442 - $document = $( document ),
443 + $document = $.mobile.$document,
445 lastTouchID = 0, threshold;
447 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.zoom.iosorientationfix.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.zoom.iosorientationfix.js
448 index 71ddc8b..61917f7 100644
449 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.zoom.iosorientationfix.js
450 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.zoom.iosorientationfix.js
451 @@ -33,7 +33,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.zoom" ], function(
457 .bind( "orientationchange.iosorientationfix", zoom.enable )
458 .bind( "devicemotion.iosorientationfix", checkTilt );
460 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
461 index d56a24f..41492ca 100644
462 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
463 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
464 @@ -167,7 +167,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
467 //auto self-init widgets
468 -$( document ).bind( "pagecreate create", function( e ) {
469 +$.mobile.$document.bind( "pagecreate create", function( e ) {
470 $.mobile.collapsible.prototype.enhanceWithin( e.target );
473 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
474 index ce66110..4c5a419 100644
475 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
476 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
477 @@ -108,7 +108,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
480 //auto self-init widgets
481 -$( document ).bind( "pagecreate create", function( e ) {
482 +$.mobile.$document.bind( "pagecreate create", function( e ) {
483 $.mobile.collapsibleset.prototype.enhanceWithin( e.target );
486 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js b/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js
487 index e04f557..d7a0795 100644
488 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js
489 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js
490 @@ -102,7 +102,7 @@ $.widget( "mobile.dialog", $.mobile.widget, {
493 //auto self-init widgets
494 -$( document ).delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() {
495 +$.mobile.$document.delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() {
496 $.mobile.dialog.prototype.enhance( this );
499 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/fixedToolbar.js b/libs/js/jquery-mobile-1.2.0/js/widgets/fixedToolbar.js
500 index 9e72b3d..ea9fe60 100644
501 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/fixedToolbar.js
502 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/fixedToolbar.js
503 @@ -133,7 +133,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
505 self.updatePagePadding( thisPage );
506 if ( o.updatePagePadding ) {
507 - $( window ).bind( "throttledresize." + self.widgetName, function() {
508 + $.mobile.$window.bind( "throttledresize." + self.widgetName, function() {
509 self.updatePagePadding( thisPage );
512 @@ -143,7 +143,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
513 $.mobile.zoom.enable( true );
515 if ( o.updatePagePadding ) {
516 - $( window ).unbind( "throttledresize." + self.widgetName );
517 + $.mobile.$window.unbind( "throttledresize." + self.widgetName );
520 if ( o.trackPersistentToolbars ) {
521 @@ -179,7 +179,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
524 _useTransition: function( notransition ) {
525 - var $win = $( window ),
526 + var $win = $.mobile.$window,
528 scroll = $win.scrollTop(),
529 elHeight = $el.height(),
530 @@ -262,7 +262,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
533 //auto self-init widgets
536 .bind( "pagecreate create", function( e ) {
538 // DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element.
539 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js
540 index 78f43a0..7b0141b 100644
541 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js
542 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js
543 @@ -95,7 +95,7 @@ $.widget( "mobile.button", $.mobile.widget, {
544 }).insertBefore( $el );
546 // Bind to doc to remove after submit handling
547 - $( document ).one( "submit", function() {
548 + $.mobile.$document.one( "submit", function() {
549 $buttonPlaceholder.remove();
551 // reset the local var so that the hidden input
552 @@ -146,7 +146,7 @@ $.widget( "mobile.button", $.mobile.widget, {
555 //auto self-init widgets
556 -$( document ).bind( "pagecreate create", function( e ) {
557 +$.mobile.$document.bind( "pagecreate create", function( e ) {
558 $.mobile.button.prototype.enhanceWithin( e.target, true );
561 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/checkboxradio.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/checkboxradio.js
562 index d28cdfb..a9f8f31 100644
563 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/checkboxradio.js
564 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/checkboxradio.js
565 @@ -211,7 +211,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
568 //auto self-init widgets
569 -$( document ).bind( "pagecreate create", function( e ) {
570 +$.mobile.$document.bind( "pagecreate create", function( e ) {
571 $.mobile.checkboxradio.prototype.enhanceWithin( e.target, true );
574 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.custom.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.custom.js
575 index 98d2fe6..85a024f 100644
576 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.custom.js
577 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.custom.js
578 @@ -332,7 +332,7 @@ define( [
582 - $window = $( window ),
583 + $window = $.mobile.$window,
584 selfListParent = self.list.parent(),
585 menuHeight = selfListParent.outerHeight(),
586 menuWidth = selfListParent.outerWidth(),
587 @@ -510,7 +510,7 @@ define( [
590 // issue #3894 - core doesn't trigger events on disabled delegates
591 - $( document ).bind( "selectmenubeforecreate", function( event ) {
592 + $.mobile.$document.bind( "selectmenubeforecreate", function( event ) {
593 var selectmenuWidget = $( event.target ).data( "selectmenu" );
595 if ( !selectmenuWidget.options.nativeMenu &&
596 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js
597 index 3c70fed..a8b0f9f 100644
598 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js
599 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js
600 @@ -252,7 +252,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
603 //auto self-init widgets
604 -$( document ).bind( "pagecreate create", function( e ) {
605 +$.mobile.$document.bind( "pagecreate create", function( e ) {
606 $.mobile.selectmenu.prototype.enhanceWithin( e.target, true );
609 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js
610 index 1bd4adf..c6d4c9b 100644
611 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js
612 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js
613 @@ -178,7 +178,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
617 - this._on( $( document ), { "vmousemove": this._preventDocumentDrag });
618 + this._on( $.mobile.$document, { "vmousemove": this._preventDocumentDrag });
620 // it appears the clicking the up and down buttons in chrome on
621 // range/number inputs doesn't trigger a change until the field is
622 @@ -468,7 +468,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
625 //auto self-init widgets
626 -$( document ).bind( "pagecreate create", function( e ) {
627 +$.mobile.$document.bind( "pagecreate create", function( e ) {
628 $.mobile.slider.prototype.enhanceWithin( e.target, true );
631 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
632 index 05b1b03..075d35d 100644
633 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
634 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
635 @@ -93,13 +93,13 @@ $.widget( "mobile.textinput", $.mobile.widget, {
637 // binding to pagechange here ensures that for pages loaded via
638 // ajax the height is recalculated without user input
639 - this._on( $(document), {"pagechange": "_keyup" });
640 + this._on( $.mobile.$document, {"pagechange": "_keyup" });
642 // Issue 509: the browser is not providing scrollHeight properly until the styles load
643 if ( $.trim( input.val() ) ) {
644 // bind to the window load to make sure the height is calculated based on BOTH
646 - this._on( $(window), {"load": "_keyup"});
647 + this._on( $.mobile.$window, {"load": "_keyup"});
650 if ( input.attr( "disabled" ) ) {
651 @@ -133,7 +133,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
654 //auto self-init widgets
655 -$( document ).bind( "pagecreate create", function( e ) {
656 +$.mobile.$document.bind( "pagecreate create", function( e ) {
657 $.mobile.textinput.prototype.enhanceWithin( e.target, true );
660 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js
661 index 4d947b4..ae123a8 100644
662 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js
663 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js
664 @@ -21,7 +21,7 @@ $.mobile.listview.prototype.options.autodividersSelector = function( elt ) {
668 -$( document ).delegate( "ul,ol", "listviewcreate", function() {
669 +$.mobile.$document.delegate( "ul,ol", "listviewcreate", function() {
671 var list = $( this ),
672 listview = list.data( "listview" );
673 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js
674 index 0774615..0519b9a 100644
675 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js
676 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js
677 @@ -18,7 +18,7 @@ var defaultFilterCallback = function( text, searchValue, item ) {
679 $.mobile.listview.prototype.options.filterCallback = defaultFilterCallback;
681 -$( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function() {
682 +$.mobile.$document.delegate( ":jqmData(role='listview')", "listviewcreate", function() {
684 var list = $( this ),
685 listview = list.data( "listview" );
686 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
687 index ef1e178..e46f842 100644
688 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
689 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
690 @@ -521,7 +521,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
693 //auto self-init widgets
694 -$( document ).bind( "pagecreate create", function( e ) {
695 +$.mobile.$document.bind( "pagecreate create", function( e ) {
696 $.mobile.listview.prototype.enhanceWithin( e.target );
699 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/loader.js b/libs/js/jquery-mobile-1.2.0/js/widgets/loader.js
700 index 6d2f2bc..b028698 100644
701 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/loader.js
702 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/loader.js
703 @@ -38,7 +38,7 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
706 // TODO move loader class down into the widget settings
707 - var loaderClass = "ui-loader", $html = $( "html" ), $window = $( window );
708 + var loaderClass = "ui-loader", $html = $( "html" ), $window = $.mobile.$window;
710 $.widget( "mobile.loader", {
711 // NOTE if the global config settings are defined they will override these
712 @@ -170,8 +170,8 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
713 this.element.removeClass( "ui-loader-fakefix" );
716 - $( window ).unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
717 - $( window ).unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
718 + $.mobile.$window.unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
719 + $.mobile.$window.unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
723 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js b/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js
724 index 65f5869..29c5057 100644
725 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js
726 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js
727 @@ -52,7 +52,7 @@ $.widget( "mobile.navbar", $.mobile.widget, {
730 //auto self-init widgets
731 -$( document ).bind( "pagecreate create", function( e ) {
732 +$.mobile.$document.bind( "pagecreate create", function( e ) {
733 $.mobile.navbar.prototype.enhanceWithin( e.target );
736 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js b/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
737 index 90a298a..e00684c 100644
738 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
739 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
740 @@ -18,10 +18,11 @@ $.mobile.page.prototype.options.contentTheme = null;
741 // which expects .ui-footer top be applied in its gigantic selector
742 // TODO remove the buttonMarkup giant selector and move it to the various modules
743 // on which it depends
744 -$( document ).bind( "pagecreate", function( e ) {
745 +$.mobile.$document.bind( "pagecreate", function( e ) {
746 var $page = $( e.target ),
747 o = $page.data( "page" ).options,
748 - pageRole = $page.jqmData( "role" ),
749 + prefix = "data-"+$.mobile.ns,
750 + pageRole = $page[0].getAttribute( prefix + "role" ) || undefined,
753 $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", $page )
754 @@ -29,8 +30,8 @@ $( document ).bind( "pagecreate", function( e ) {
757 var $this = $( this ),
758 - role = $this.jqmData( "role" ),
759 - theme = $this.jqmData( "theme" ),
760 + role = $this[0].getAttribute( prefix + "role" ) || undefined,
761 + theme = $this[0].getAttribute( prefix + "theme" ) || undefined,
762 contentTheme = theme || o.contentTheme || ( pageRole === "dialog" && pageTheme ),
765 @@ -65,7 +66,7 @@ $( document ).bind( "pagecreate", function( e ) {
766 // Auto-add back btn on pages beyond first view
768 ( role === "footer" || role === "header" ) &&
769 - $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
770 + $page[0].getAttribute( prefix + "url" ) !== $.mobile.path.stripHash( location.hash ) &&
773 if ( o.addBackBtn == "header" ) {
774 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
775 index b9a950e..13cb548 100644
776 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
777 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
778 @@ -28,7 +28,7 @@ define( [ "jquery",
781 function windowCoords() {
782 - var $win = $( window );
783 + var $win = $.mobile.$window;
786 x: $win.scrollLeft(),
787 @@ -192,7 +192,7 @@ define( [ "jquery",
788 _orientationchangeInProgress: false,
792 + src: $.mobile.$window,
794 orientationchange: $.proxy( this, "_handleWindowOrientationchange" ),
795 resize: $.proxy( this, "_handleWindowResize" ),
796 @@ -886,14 +886,14 @@ define( [ "jquery",
799 // TODO move inside _create
800 - $( document ).bind( "pagebeforechange", function( e, data ) {
801 + $.mobile.$document.bind( "pagebeforechange", function( e, data ) {
802 if ( data.options.role === "popup" ) {
803 $.mobile.popup.handleLink( data.options.link );
808 - $( document ).bind( "pagecreate create", function( e ) {
809 + $.mobile.$document.bind( "pagecreate create", function( e ) {
810 $.mobile.popup.prototype.enhanceWithin( e.target, true );