From: Woosung Sohn Date: Thu, 7 Feb 2013 07:08:30 +0000 (+0900) Subject: JQM: performance tuning X-Git-Tag: accepted/tizen_2.1/20130425.023924~7^2~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6fc2867518b943e63eef14fc1232cf2896967a71;p=framework%2Fweb%2Fweb-ui-fw.git JQM: performance tuning This patch contains 3 jQM patch files. Each jQM patch modifies jQM as follows : - 0029 : This jQM patch removes unneccessary jQuery() function calls and replaces jqmData() to getAttribute(). - 0030 : This jQM patch replaces getAttribute() mentioned above to getAttrFixed() which is a wrapper function of getAttribute() with handling return value. - 0031 : This jQM patch enhances performance of the widget self-init method. Change-Id: Ib91d8722fcd75cca1637b61dde05d9635e152a52 --- diff --git a/libs/patch/0029-JQM-performance-tuning.patch b/libs/patch/0029-JQM-performance-tuning.patch new file mode 100644 index 0000000..163c109 --- /dev/null +++ b/libs/patch/0029-JQM-performance-tuning.patch @@ -0,0 +1,816 @@ +From 77d1c8c71a7bc71b807e2fe1e0eca3b286bcb04b Mon Sep 17 00:00:00 2001 +From: Minkyeong Kim +Date: Wed, 30 Jan 2013 19:11:23 +0900 +Subject: [PATCH] JQM performance tuning + +--- + .../js/events/orientationchange.js | 8 +++--- + libs/js/jquery-mobile-1.2.0/js/events/touch.js | 4 +- + .../js/jquery.mobile.buttonMarkup.js | 23 ++++++++++--------- + .../jquery-mobile-1.2.0/js/jquery.mobile.core.js | 8 +++++- + .../js/jquery.mobile.degradeInputs.js | 2 +- + .../js/jquery.mobile.fieldContain.js | 2 +- + .../jquery-mobile-1.2.0/js/jquery.mobile.init.js | 12 +++++----- + .../jquery-mobile-1.2.0/js/jquery.mobile.links.js | 2 +- + .../jquery-mobile-1.2.0/js/jquery.mobile.media.js | 2 +- + .../js/jquery.mobile.navigation.js | 14 ++++++------ + .../js/jquery.mobile.navigation.pushstate.js | 6 ++-- + .../jquery-mobile-1.2.0/js/jquery.mobile.nojs.js | 2 +- + .../js/jquery.mobile.transition.js | 10 ++++---- + .../jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js | 2 +- + .../js/jquery.mobile.zoom.iosorientationfix.js | 2 +- + .../jquery-mobile-1.2.0/js/widgets/collapsible.js | 2 +- + .../js/widgets/collapsibleSet.js | 2 +- + libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js | 2 +- + .../jquery-mobile-1.2.0/js/widgets/fixedToolbar.js | 8 +++--- + .../jquery-mobile-1.2.0/js/widgets/forms/button.js | 4 +- + .../js/widgets/forms/checkboxradio.js | 2 +- + .../js/widgets/forms/select.custom.js | 4 +- + .../jquery-mobile-1.2.0/js/widgets/forms/select.js | 2 +- + .../jquery-mobile-1.2.0/js/widgets/forms/slider.js | 4 +- + .../js/widgets/forms/textinput.js | 6 ++-- + .../js/widgets/listview.autodividers.js | 2 +- + .../js/widgets/listview.filter.js | 2 +- + libs/js/jquery-mobile-1.2.0/js/widgets/listview.js | 2 +- + libs/js/jquery-mobile-1.2.0/js/widgets/loader.js | 6 ++-- + libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js | 2 +- + .../js/widgets/page.sections.js | 11 +++++---- + libs/js/jquery-mobile-1.2.0/js/widgets/popup.js | 8 +++--- + 32 files changed, 87 insertions(+), 81 deletions(-) + +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 +index 95674f3..de903c8 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/events/orientationchange.js ++++ b/libs/js/jquery-mobile-1.2.0/js/events/orientationchange.js +@@ -7,7 +7,7 @@ define( [ "jquery", "../jquery.mobile.support.orientation", "./throttledresize" + //>>excludeEnd("jqmBuildExclude"); + + (function( $, window ) { +- var win = $( window ), ++ var win = $.mobile.$window, + event_name = "orientationchange", + special_event, + get_orientation, +@@ -44,8 +44,8 @@ define( [ "jquery", "../jquery.mobile.support.orientation", "./throttledresize" + // developer console. The actual threshold value is somewhat arbitrary, we just + // need to make sure it is large enough to exclude the developer console case. + +- var ww = window.innerWidth || $( window ).width(), +- wh = window.innerHeight || $( window ).height(), ++ var ww = window.innerWidth || $.mobile.$window.width(), ++ wh = window.innerHeight || $.mobile.$window.height(), + landscape_threshold = 50; + + initial_orientation_is_landscape = ww > wh && ( ww - wh ) > landscape_threshold; +@@ -151,4 +151,4 @@ define( [ "jquery", "../jquery.mobile.support.orientation", "./throttledresize" + + //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); + }); +-//>>excludeEnd("jqmBuildExclude"); +\ No newline at end of file ++//>>excludeEnd("jqmBuildExclude"); +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 +index 6083faf..9e616cc 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/events/touch.js ++++ b/libs/js/jquery-mobile-1.2.0/js/events/touch.js +@@ -103,7 +103,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch" + + $this.unbind( "vclick", clickHandler ) + .unbind( "vmouseup", clearTapTimer ); +- $( document ).unbind( "vmousecancel", clearTapHandlers ); ++ $.mobile.$document.unbind( "vmousecancel", clearTapHandlers ); + } + + function clickHandler( event ) { +@@ -118,7 +118,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch" + + $this.bind( "vmouseup", clearTapTimer ) + .bind( "vclick", clickHandler ); +- $( document ).bind( "vmousecancel", clearTapHandlers ); ++ $.mobile.$document.bind( "vmousecancel", clearTapHandlers ); + + timer = setTimeout( function() { + triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) ); +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 +index cd95245..b0b1f19 100644 +--- 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 +@@ -11,6 +11,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.vmouse" ], function + + $.fn.buttonMarkup = function( options ) { + var $workingSet = this, ++ prefix = "data-" + $.mobile.ns, + mapToDataAttr = function( key, value ) { + e.setAttribute( "data-" + $.mobile.ns + key, value ); + el.jqmData( key, value ); +@@ -22,14 +23,14 @@ $.fn.buttonMarkup = function( options ) { + var el = $workingSet.eq( i ), + e = el[ 0 ], + o = $.extend( {}, $.fn.buttonMarkup.defaults, { +- icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ), +- iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ), +- theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ), +- inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ), +- shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ), +- corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ), +- iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" ), +- mini: options.mini !== undefined ? options.mini : el.jqmData( "mini" ) ++ icon: options.icon !== undefined ? options.icon : ( e.getAttribute( prefix + "icon" ) || undefined ), ++ iconpos: options.iconpos !== undefined ? options.iconpos : ( e.getAttribute( prefix + "iconpos" ) || undefined ), ++ theme: options.theme !== undefined ? options.theme : e.getAttribute( prefix + "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ), ++ inline: options.inline !== undefined ? options.inline : /^true$/i.test( e.getAttribute( prefix + "inline" ) ), ++ shadow: options.shadow !== undefined ? options.shadow : !/^false$/i.test( e.getAttribute( prefix + "shadow" ) ), ++ corners: options.corners !== undefined ? options.corners : !/^false$/i.test( e.getAttribute( prefix + "corners" ) ), ++ iconshadow: options.iconshadow !== undefined ? options.iconshadow : !/^false$/i.test( e.getAttribute( prefix + "iconshadow" ) ), ++ mini: options.mini !== undefined ? options.mini : /^true$/i.test( e.getAttribute( prefix + "mini" ) ) + }, options ), + + // Classes Defined +@@ -44,7 +45,7 @@ $.fn.buttonMarkup = function( options ) { + + $.each( o, mapToDataAttr ); + +- if ( el.jqmData( "rel" ) === "popup" && el.attr( "href" ) ) { ++ if ( e.getAttribute( prefix + "rel" ) === "popup" && el.attr( "href" ) ) { + e.setAttribute( "aria-haspopup", true ); + e.setAttribute( "aria-owns", e.getAttribute( "href" ) ); + } +@@ -249,7 +250,7 @@ function closestEnabledButton( element ) { + var attachEvents = function() { + var hoverDelay = $.mobile.buttonMarkup.hoverDelay, hov, foc; + +- $( document ).bind( { ++ $.mobile.$document.bind( { + "vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart touchend touchcancel": function( event ) { + var theme, + $btn = $( closestEnabledButton( event.target ) ), +@@ -303,7 +304,7 @@ var attachEvents = function() { + + //links in bars, or those with data-role become buttons + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + + $( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target ) + .jqmEnhanceable() +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 +index 4e8ebfe..873293c 100644 +--- 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 +@@ -84,6 +84,10 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) { + hoverDelay: 200 + }, + ++ // define the window and the document objects ++ $window: $( window ), ++ $document: $( document ), ++ + // TODO might be useful upstream in jquery itself ? + keyCode: { + ALT: 18, +@@ -131,7 +135,7 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) { + + setTimeout( function() { + window.scrollTo( 0, ypos ); +- $( document ).trigger( "silentscroll", { x: 0, y: ypos }); ++ $.mobile.$document.trigger( "silentscroll", { x: 0, y: ypos }); + }, 20 ); + + setTimeout( function() { +@@ -237,7 +241,7 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) { + getScreenHeight: function() { + // Native innerHeight returns more accurate value for this across platforms, + // jQuery version is here as a normalized fallback for platforms like Symbian +- return window.innerHeight || $( window ).height(); ++ return window.innerHeight || $.mobile.$window.height(); + } + }, $.mobile ); + +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 +index 28abc52..6951e17 100644 +--- 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 +@@ -26,7 +26,7 @@ $.mobile.page.prototype.options.degradeInputs = { + + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + + var page = $.mobile.closestPageData( $( e.target ) ), options; + +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 +index daf66e7..c7fd931 100644 +--- 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 +@@ -19,7 +19,7 @@ $.fn.fieldcontain = function( options ) { + }; + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $( ":jqmData(role='fieldcontain')", e.target ).jqmEnhanceable().fieldcontain(); + }); + +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 +index 52f6434..d31ddf0 100644 +--- 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 +@@ -10,7 +10,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery + (function( $, window, undefined ) { + var $html = $( "html" ), + $head = $( "head" ), +- $window = $( window ); ++ $window = $.mobile.$window; + + //remove initial build class (only present on first pageshow) + function hideRenderingClass() { +@@ -70,7 +70,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery + var $this = $( this ); + + // unless the data url is already set set it to the pathname +- if ( !$this.jqmData( "url" ) ) { ++ if ( !$this[0].getAttribute( "data-" + $.mobile.ns + "url" ) ) { + $this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) || location.pathname + location.search ); + } + }); +@@ -79,7 +79,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery + $.mobile.firstPage = $pages.first(); + + // define page container +- $.mobile.pageContainer = $pages.first().parent().addClass( "ui-mobile-viewport" ); ++ $.mobile.pageContainer = $.mobile.firstPage.parent().addClass( "ui-mobile-viewport" ); + + // alert listeners that the pagecontainer has been determined for binding + // to events triggered on it +@@ -127,13 +127,13 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery + // if defaultHomeScroll hasn't been set yet, see if scrollTop is 1 + // it should be 1 in most browsers, but android treats 1 as 0 (for hiding addr bar) + // so if it's 1, use 0 from now on +- $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $( window ).scrollTop() === 1 ) ? 0 : 1; ++ $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $.mobile.$window.scrollTop() === 1 ) ? 0 : 1; + + + // TODO: Implement a proper registration mechanism with dependency handling in order to not have exceptions like the one below + //auto self-init widgets for those widgets that have a soft dependency on others + if ( $.fn.controlgroup ) { +- $( document ).bind( "pagecreate create", function( e ) { ++ $.mobile.$document.bind( "pagecreate create", function( e ) { + $( ":jqmData(role='controlgroup')", e.target ) + .jqmEnhanceable() + .controlgroup({ excludeInvisible: false }); +@@ -154,7 +154,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery + // by adding the 'ui-disabled' class to them. Using a JavaScript workaround for those browser. + // https://github.com/jquery/jquery-mobile/issues/3558 + +- $( document ).delegate( ".ui-disabled", "vclick", ++ $.mobile.$document.delegate( ".ui-disabled", "vclick", + function( e ) { + e.preventDefault(); + e.stopImmediatePropagation(); +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 +index a3bfdba..4145d30 100644 +--- 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 +@@ -8,7 +8,7 @@ define( [ "jquery" ], function( $ ) { + //>>excludeEnd("jqmBuildExclude"); + (function( $, undefined ) { + +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + + //links within content areas, tests included with page + $( e.target ) +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 +index 73b6802..2068ca5 100644 +--- 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 +@@ -8,7 +8,7 @@ define( [ "jquery", "./jquery.mobile.core" ], function( $ ) { + //>>excludeEnd("jqmBuildExclude"); + (function( $, undefined ) { + +-var $window = $( window ), ++var $window = $.mobile.$window, + $html = $( "html" ); + + /* $.mobile.media method: pass a CSS media type or query and get a bool return +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 +index 9048789..203557a 100644 +--- 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 +@@ -15,7 +15,7 @@ define( [ + (function( $, undefined ) { + + //define vars for interal use +- var $window = $( window ), ++ var $window = $.mobile.$window, + $html = $( 'html' ), + $head = $( 'head' ), + +@@ -1256,7 +1256,7 @@ define( [ + $.mobile.navreadyDeferred = $.Deferred(); + $.mobile.navreadyDeferred.done(function() { + //bind to form submit events, handle with Ajax +- $( document ).delegate( "form", "submit", function( event ) { ++ $.mobile.$document.delegate( "form", "submit", function( event ) { + var $this = $( this ); + + if ( !$.mobile.ajaxEnabled || +@@ -1309,7 +1309,7 @@ define( [ + }); + + //add active state on vclick +- $( document ).bind( "vclick", function( event ) { ++ $.mobile.$document.bind( "vclick", function( event ) { + // if this isn't a left click we don't care. Its important to note + // that when the virtual event is generated it will create the which attr + if ( event.which > 1 || !$.mobile.linkBindingEnabled ) { +@@ -1335,7 +1335,7 @@ define( [ + }); + + // click routing - direct to HTTP or Ajax, accordingly +- $( document ).bind( "click", function( event ) { ++ $.mobile.$document.bind( "click", function( event ) { + if ( !$.mobile.linkBindingEnabled ) { + return; + } +@@ -1433,7 +1433,7 @@ define( [ + }); + + //prefetch pages when anchors with data-prefetch are encountered +- $( document ).delegate( ".ui-page", "pageshow.prefetch", function() { ++ $.mobile.$document.delegate( ".ui-page", "pageshow.prefetch", function() { + var urls = []; + $( this ).find( "a:jqmData(prefetch)" ).each(function() { + var $link = $( this ), +@@ -1553,8 +1553,8 @@ define( [ + }); + + //set page min-heights to be device specific +- $( document ).bind( "pageshow", resetActivePageHeight ); +- $( window ).bind( "throttledresize", resetActivePageHeight ); ++ $.mobile.$document.bind( "pageshow", resetActivePageHeight ); ++ $.mobile.$window.bind( "throttledresize", resetActivePageHeight ); + + });//navreadyDeferred done callback + +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 +index e0c73e4..10761d1 100644 +--- 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 +@@ -11,14 +11,14 @@ define( [ "jquery", "./jquery.mobile.navigation", "depend!./jquery.hashchange[jq + // methods handed off as event handlers + var pushStateHandler = {}, + self = pushStateHandler, +- $win = $( window ), ++ $win = $.mobile.$window, + url = $.mobile.path.parseLocation(), + mobileinitDeferred = $.Deferred(), + domreadyDeferred = $.Deferred(); + +- $( document ).ready( $.proxy( domreadyDeferred, "resolve" ) ); ++ $.mobile.$document.ready( $.proxy( domreadyDeferred, "resolve" ) ); + +- $( document ).one( "mobileinit", $.proxy( mobileinitDeferred, "resolve" ) ); ++ $.mobile.$document.one( "mobileinit", $.proxy( mobileinitDeferred, "resolve" ) ); + + $.extend( pushStateHandler, { + // TODO move to a path helper, this is rather common functionality +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 +index 159d1fc..807a319 100644 +--- 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 +@@ -7,7 +7,7 @@ define( [ "jquery" ], function( $ ) { + //>>excludeEnd("jqmBuildExclude"); + (function( $, undefined ) { + +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" ); + + }); +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 +index cb7c9a7..f8edcee 100644 +--- 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 +@@ -24,8 +24,8 @@ var createHandler = function( sequential ) { + active = $.mobile.urlHistory.getActive(), + toScroll = active.lastScroll || $.mobile.defaultHomeScroll, + screenHeight = $.mobile.getScreenHeight(), +- maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $( window ).width() > $.mobile.maxTransitionWidth, +- none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $( window ).scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(), ++ maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $.mobile.$window.width() > $.mobile.maxTransitionWidth, ++ none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $.mobile.$window.scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(), + toPreClass = " ui-page-pre-in", + toggleViewportClass = function() { + $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name ); +@@ -35,7 +35,7 @@ var createHandler = function( sequential ) { + // Don't scoll window, when current scroll top(scrollTop()) is already at toScroll, + // or when current scroll top is 0 and toScroll is same to defaultHomeScroll + // (which means the top position of page). In these case, page scrolling is not needed. +- var st = $( window ).scrollTop(); ++ var st = $.mobile.$window.scrollTop(); + if( st === toScroll || ( $.mobile.defaultHomeScroll === toScroll && st == 0 ) ) { + return; + } +@@ -68,7 +68,7 @@ var createHandler = function( sequential ) { + // Set the from page's height and start it transitioning out + // Note: setting an explicit height helps eliminate tiling in the transitions + $from +- .height( screenHeight + $( window ).scrollTop() ) ++ .height( screenHeight + $.mobile.$window.scrollTop() ) + .addClass( name + " out" + reverseClass ); + }, + +@@ -130,7 +130,7 @@ var createHandler = function( sequential ) { + + // In some browsers (iOS5), 3D transitions block the ability to scroll to the desired location during transition + // This ensures we jump to that spot after the fact, if we aren't there already. +- if ( $( window ).scrollTop() !== toScroll ) { ++ if ( $.mobile.$window.scrollTop() !== toScroll ) { + scrollPage(); + } + +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 +index 25188d8..a98b73e 100644 +--- 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 +@@ -38,7 +38,7 @@ var dataPropertyName = "virtualMouseBindings", + blockMouseTriggers = false, + blockTouchTriggers = false, + eventCaptureSupported = "addEventListener" in document, +- $document = $( document ), ++ $document = $.mobile.$document, + nextTouchID = 1, + lastTouchID = 0, threshold; + +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 +index 71ddc8b..61917f7 100644 +--- 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 +@@ -33,7 +33,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.zoom" ], function( + } + } + +- $( window ) ++ $.mobile.$window + .bind( "orientationchange.iosorientationfix", zoom.enable ) + .bind( "devicemotion.iosorientationfix", checkTilt ); + +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 +index d56a24f..41492ca 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js +@@ -167,7 +167,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { + }); + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.collapsible.prototype.enhanceWithin( e.target ); + }); + +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 +index ce66110..4c5a419 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js +@@ -108,7 +108,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, { + }); + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.collapsibleset.prototype.enhanceWithin( e.target ); + }); + +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 +index e04f557..d7a0795 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js +@@ -102,7 +102,7 @@ $.widget( "mobile.dialog", $.mobile.widget, { + }); + + //auto self-init widgets +-$( document ).delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() { ++$.mobile.$document.delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() { + $.mobile.dialog.prototype.enhance( this ); + }); + +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 +index 9e72b3d..ea9fe60 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/fixedToolbar.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/fixedToolbar.js +@@ -133,7 +133,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque + var thisPage = this; + self.updatePagePadding( thisPage ); + if ( o.updatePagePadding ) { +- $( window ).bind( "throttledresize." + self.widgetName, function() { ++ $.mobile.$window.bind( "throttledresize." + self.widgetName, function() { + self.updatePagePadding( thisPage ); + }); + } +@@ -143,7 +143,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque + $.mobile.zoom.enable( true ); + } + if ( o.updatePagePadding ) { +- $( window ).unbind( "throttledresize." + self.widgetName ); ++ $.mobile.$window.unbind( "throttledresize." + self.widgetName ); + } + + if ( o.trackPersistentToolbars ) { +@@ -179,7 +179,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque + }, + + _useTransition: function( notransition ) { +- var $win = $( window ), ++ var $win = $.mobile.$window, + $el = this.element, + scroll = $win.scrollTop(), + elHeight = $el.height(), +@@ -262,7 +262,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque + }); + + //auto self-init widgets +- $( document ) ++ $.mobile.$document + .bind( "pagecreate create", function( e ) { + + // DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element. +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 +index 78f43a0..7b0141b 100644 +--- 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 +@@ -95,7 +95,7 @@ $.widget( "mobile.button", $.mobile.widget, { + }).insertBefore( $el ); + + // Bind to doc to remove after submit handling +- $( document ).one( "submit", function() { ++ $.mobile.$document.one( "submit", function() { + $buttonPlaceholder.remove(); + + // reset the local var so that the hidden input +@@ -146,7 +146,7 @@ $.widget( "mobile.button", $.mobile.widget, { + }); + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.button.prototype.enhanceWithin( e.target, true ); + }); + +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 +index d28cdfb..a9f8f31 100644 +--- 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 +@@ -211,7 +211,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { + }); + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.checkboxradio.prototype.enhanceWithin( e.target, true ); + }); + +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 +index 98d2fe6..85a024f 100644 +--- 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 +@@ -332,7 +332,7 @@ define( [ + } + + var self = this, +- $window = $( window ), ++ $window = $.mobile.$window, + selfListParent = self.list.parent(), + menuHeight = selfListParent.outerHeight(), + menuWidth = selfListParent.outerWidth(), +@@ -510,7 +510,7 @@ define( [ + }; + + // issue #3894 - core doesn't trigger events on disabled delegates +- $( document ).bind( "selectmenubeforecreate", function( event ) { ++ $.mobile.$document.bind( "selectmenubeforecreate", function( event ) { + var selectmenuWidget = $( event.target ).data( "selectmenu" ); + + if ( !selectmenuWidget.options.nativeMenu && +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 +index 3c70fed..a8b0f9f 100644 +--- 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 +@@ -252,7 +252,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, { + }); + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.selectmenu.prototype.enhanceWithin( e.target, true ); + }); + })( jQuery ); +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 +index 1bd4adf..c6d4c9b 100644 +--- 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 +@@ -178,7 +178,7 @@ $.widget( "mobile.slider", $.mobile.widget, { + } + } + +- this._on( $( document ), { "vmousemove": this._preventDocumentDrag }); ++ this._on( $.mobile.$document, { "vmousemove": this._preventDocumentDrag }); + + // it appears the clicking the up and down buttons in chrome on + // range/number inputs doesn't trigger a change until the field is +@@ -468,7 +468,7 @@ $.widget( "mobile.slider", $.mobile.widget, { + }); + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.slider.prototype.enhanceWithin( e.target, true ); + }); + +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 +index 05b1b03..075d35d 100644 +--- 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 +@@ -93,13 +93,13 @@ $.widget( "mobile.textinput", $.mobile.widget, { + + // binding to pagechange here ensures that for pages loaded via + // ajax the height is recalculated without user input +- this._on( $(document), {"pagechange": "_keyup" }); ++ this._on( $.mobile.$document, {"pagechange": "_keyup" }); + + // Issue 509: the browser is not providing scrollHeight properly until the styles load + if ( $.trim( input.val() ) ) { + // bind to the window load to make sure the height is calculated based on BOTH + // the DOM and CSS +- this._on( $(window), {"load": "_keyup"}); ++ this._on( $.mobile.$window, {"load": "_keyup"}); + } + } + if ( input.attr( "disabled" ) ) { +@@ -133,7 +133,7 @@ $.widget( "mobile.textinput", $.mobile.widget, { + }); + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.textinput.prototype.enhanceWithin( e.target, true ); + }); + +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 +index 4d947b4..ae123a8 100644 +--- 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 +@@ -21,7 +21,7 @@ $.mobile.listview.prototype.options.autodividersSelector = function( elt ) { + return text; + }; + +-$( document ).delegate( "ul,ol", "listviewcreate", function() { ++$.mobile.$document.delegate( "ul,ol", "listviewcreate", function() { + + var list = $( this ), + listview = list.data( "listview" ); +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 +index 0774615..0519b9a 100644 +--- 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 +@@ -18,7 +18,7 @@ var defaultFilterCallback = function( text, searchValue, item ) { + + $.mobile.listview.prototype.options.filterCallback = defaultFilterCallback; + +-$( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function() { ++$.mobile.$document.delegate( ":jqmData(role='listview')", "listviewcreate", function() { + + var list = $( this ), + listview = list.data( "listview" ); +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 +index ef1e178..e46f842 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js +@@ -521,7 +521,7 @@ $.widget( "mobile.listview", $.mobile.widget, { + }); + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.listview.prototype.enhanceWithin( e.target ); + }); + +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 +index 6d2f2bc..b028698 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/loader.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/loader.js +@@ -38,7 +38,7 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi + }); + + // TODO move loader class down into the widget settings +- var loaderClass = "ui-loader", $html = $( "html" ), $window = $( window ); ++ var loaderClass = "ui-loader", $html = $( "html" ), $window = $.mobile.$window; + + $.widget( "mobile.loader", { + // NOTE if the global config settings are defined they will override these +@@ -170,8 +170,8 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi + this.element.removeClass( "ui-loader-fakefix" ); + } + +- $( window ).unbind( "scroll", $.proxy( this.fakeFixLoader, this) ); +- $( window ).unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) ); ++ $.mobile.$window.unbind( "scroll", $.proxy( this.fakeFixLoader, this) ); ++ $.mobile.$window.unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) ); + } + }); + +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 +index 65f5869..29c5057 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js +@@ -52,7 +52,7 @@ $.widget( "mobile.navbar", $.mobile.widget, { + }); + + //auto self-init widgets +-$( document ).bind( "pagecreate create", function( e ) { ++$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.navbar.prototype.enhanceWithin( e.target ); + }); + +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 +index 90a298a..e00684c 100644 +--- 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 +@@ -18,10 +18,11 @@ $.mobile.page.prototype.options.contentTheme = null; + // which expects .ui-footer top be applied in its gigantic selector + // TODO remove the buttonMarkup giant selector and move it to the various modules + // on which it depends +-$( document ).bind( "pagecreate", function( e ) { ++$.mobile.$document.bind( "pagecreate", function( e ) { + var $page = $( e.target ), + o = $page.data( "page" ).options, +- pageRole = $page.jqmData( "role" ), ++ prefix = "data-"+$.mobile.ns, ++ pageRole = $page[0].getAttribute( prefix + "role" ) || undefined, + pageTheme = o.theme; + + $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", $page ) +@@ -29,8 +30,8 @@ $( document ).bind( "pagecreate", function( e ) { + .each(function() { + + var $this = $( this ), +- role = $this.jqmData( "role" ), +- theme = $this.jqmData( "theme" ), ++ role = $this[0].getAttribute( prefix + "role" ) || undefined, ++ theme = $this[0].getAttribute( prefix + "theme" ) || undefined, + contentTheme = theme || o.contentTheme || ( pageRole === "dialog" && pageTheme ), + $headeranchors, + leftbtn, +@@ -65,7 +66,7 @@ $( document ).bind( "pagecreate", function( e ) { + // Auto-add back btn on pages beyond first view + if ( o.addBackBtn && + ( role === "footer" || role === "header" ) && +- $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) && ++ $page[0].getAttribute( prefix + "url" ) !== $.mobile.path.stripHash( location.hash ) && + !leftbtn ) { + + if ( o.addBackBtn == "header" ) { +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 +index b9a950e..13cb548 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js +@@ -28,7 +28,7 @@ define( [ "jquery", + } + + function windowCoords() { +- var $win = $( window ); ++ var $win = $.mobile.$window; + + return { + x: $win.scrollLeft(), +@@ -192,7 +192,7 @@ define( [ "jquery", + _orientationchangeInProgress: false, + _globalHandlers: [ + { +- src: $( window ), ++ src: $.mobile.$window, + handler: { + orientationchange: $.proxy( this, "_handleWindowOrientationchange" ), + resize: $.proxy( this, "_handleWindowResize" ), +@@ -886,14 +886,14 @@ define( [ "jquery", + }; + + // TODO move inside _create +- $( document ).bind( "pagebeforechange", function( e, data ) { ++ $.mobile.$document.bind( "pagebeforechange", function( e, data ) { + if ( data.options.role === "popup" ) { + $.mobile.popup.handleLink( data.options.link ); + e.preventDefault(); + } + }); + +- $( document ).bind( "pagecreate create", function( e ) { ++ $.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.popup.prototype.enhanceWithin( e.target, true ); + }); + +-- +1.7.5.4 + + diff --git a/libs/patch/0030-JQM-performance-tuning-remove-jqmData.patch b/libs/patch/0030-JQM-performance-tuning-remove-jqmData.patch new file mode 100644 index 0000000..436349b --- /dev/null +++ b/libs/patch/0030-JQM-performance-tuning-remove-jqmData.patch @@ -0,0 +1,428 @@ +From c5e658e96ae2b60731934f6cc0cb8cdf1e515698 Mon Sep 17 00:00:00 2001 +From: Minkyeong Kim +Date: Fri, 1 Feb 2013 14:15:11 +0900 +Subject: [PATCH] [JQM] performance tuning : remove jqmData + +--- + .../js/jquery.mobile.buttonMarkup.js | 26 +++++++++++--------- + .../js/jquery.mobile.controlGroup.js | 4 +-- + .../jquery-mobile-1.2.0/js/jquery.mobile.core.js | 8 ++++++ + .../js/jquery.mobile.navigation.js | 12 ++++----- + .../jquery-mobile-1.2.0/js/widgets/collapsible.js | 26 ++++++++++---------- + .../js/widgets/collapsibleSet.js | 6 ++--- + libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js | 2 +- + .../jquery-mobile-1.2.0/js/widgets/forms/button.js | 4 +-- + .../jquery-mobile-1.2.0/js/widgets/forms/select.js | 6 ++--- + .../jquery-mobile-1.2.0/js/widgets/forms/slider.js | 6 ++--- + .../js/widgets/forms/textinput.js | 2 +- + .../js/widgets/listview.filter.js | 2 +- + libs/js/jquery-mobile-1.2.0/js/widgets/listview.js | 22 ++++++++--------- + libs/js/jquery-mobile-1.2.0/js/widgets/popup.js | 4 +-- + 14 files changed, 70 insertions(+), 60 deletions(-) + +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 +index 4d07961..7c17ba6 100644 +--- 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 +@@ -23,14 +23,14 @@ $.fn.buttonMarkup = function( options ) { + var el = $workingSet.eq( i ), + e = el[ 0 ], + o = $.extend( {}, $.fn.buttonMarkup.defaults, { +- icon: options.icon !== undefined ? options.icon : ( e.getAttribute( prefix + "icon" ) || undefined ), +- iconpos: options.iconpos !== undefined ? options.iconpos : ( e.getAttribute( prefix + "iconpos" ) || undefined ), +- theme: options.theme !== undefined ? options.theme : e.getAttribute( prefix + "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ), +- inline: options.inline !== undefined ? options.inline : /^true$/i.test( e.getAttribute( prefix + "inline" ) ), +- shadow: options.shadow !== undefined ? options.shadow : !/^false$/i.test( e.getAttribute( prefix + "shadow" ) ), +- corners: options.corners !== undefined ? options.corners : !/^false$/i.test( e.getAttribute( prefix + "corners" ) ), +- iconshadow: options.iconshadow !== undefined ? options.iconshadow : !/^false$/i.test( e.getAttribute( prefix + "iconshadow" ) ), +- mini: options.mini !== undefined ? options.mini : /^true$/i.test( e.getAttribute( prefix + "mini" ) ) ++ icon: options.icon !== undefined ? options.icon : $.mobile.getAttrFixed( e, prefix + "icon" ), ++ iconpos: options.iconpos !== undefined ? options.iconpos : $.mobile.getAttrFixed( e, prefix + "iconpos" ), ++ theme: options.theme !== undefined ? options.theme : $.mobile.getAttrFixed( e, prefix + "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ), ++ inline: options.inline !== undefined ? options.inline : $.mobile.getAttrFixed( e, prefix + "inline" ), ++ shadow: options.shadow !== undefined ? options.shadow : $.mobile.getAttrFixed( e, prefix + "shadow" ), ++ corners: options.corners !== undefined ? options.corners : $.mobile.getAttrFixed( e, prefix + "corners" ), ++ iconshadow: options.iconshadow !== undefined ? options.iconshadow : $.mobile.getAttrFixed( e, prefix + "iconshadow" ), ++ mini: options.mini !== undefined ? options.mini : $.mobile.getAttrFixed( e, prefix + "mini" ) + }, options ), + + // Classes Defined +@@ -43,9 +43,11 @@ $.fn.buttonMarkup = function( options ) { + buttonIcon, + buttonElements; + +- $.each( o, mapToDataAttr ); ++ for ( key in o ) { ++ e.setAttribute ( prefix + key, o[ key ]) ++ } + +- if ( e.getAttribute( prefix + "rel" ) === "popup" && el.attr( "href" ) ) { ++ if ( $.mobile.getAttrFixed( e, prefix + "rel" ) === "popup" && el.attr( "href" ) ) { + e.setAttribute( "aria-haspopup", true ); + e.setAttribute( "aria-owns", e.getAttribute( "href" ) ); + } +@@ -82,12 +84,12 @@ $.fn.buttonMarkup = function( options ) { + buttonClass += o.corners ? " ui-btn-corner-all" : ""; + + // To distinguish real buttons +- if( el.jqmData("role") == "button" || e.tagName == "BUTTON" || e.tagName == "DIV" ){ ++ if( $.mobile.getAttrFixed( e, prefix + "role" ) == "button" || e.tagName == "BUTTON" || e.tagName == "DIV" ){ + buttonClass += " ui-btn-box-" + o.theme; + } + + /* TIZEN style markup */ +- buttonStyle = el.jqmData("style"); ++ buttonStyle = $.mobile.getAttrFixed( e, prefix + "style" ); + + if ( buttonStyle == "circle" && !($(el).text().length > 0) ) { + /* style : no text, Icon only */ +diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.controlGroup.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.controlGroup.js +index 9e72818..06c5312 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.controlGroup.js ++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.controlGroup.js +@@ -20,10 +20,10 @@ $.fn.controlgroup = function( options ) { + return this.each(function() { + var $el = $( this ), + o = $.extend({ +- direction: $el.jqmData( "type" ) || "vertical", ++ direction: $.mobile.getAttrFixed( $el[0], "data-"+ $.mobile.ns + "type" ) || "vertical", + shadow: false, + excludeInvisible: true, +- mini: $el.jqmData( "mini" ) ++ mini: $.mobile.getAttrFixed( $el[0], "data-"+ $.mobile.ns + "mini" ) + }, options ), + grouplegend = $el.children( "legend" ), + groupheading = $el.children( ".ui-controlgroup-label" ), +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 +index 873293c..f8c3a2d 100644 +--- 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 +@@ -88,6 +88,14 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) { + $window: $( window ), + $document: $( document ), + ++ getAttrFixed : function( e, key ) { ++ var value = e.getAttribute( key ); ++ ++ return value === "true" ? true : ++ value === "false" ? false : ++ value === null ? undefined : value; ++ }, ++ + // TODO might be useful upstream in jquery itself ? + keyCode: { + ALT: 18, +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 +index 203557a..0a727b4 100644 +--- 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 +@@ -1050,7 +1050,7 @@ define( [ + activeIsInitialPage = urlHistory.activeIndex === 0, + historyDir = 0, + pageTitle = document.title, +- isDialog = settings.role === "dialog" || toPage.jqmData( "role" ) === "dialog"; ++ isDialog = settings.role === "dialog" || $.mobile.getAttrFixed( toPage [0], "data-" + $.mobile.ns + "role" ) === "dialog"; + + // By default, we prevent changePage requests when the fromPage and toPage + // are the same element, but folks that generate content manually/dynamically +@@ -1300,8 +1300,8 @@ define( [ + { + type: type && type.length && type.toLowerCase() || "get", + data: $this.serialize(), +- transition: $this.jqmData( "transition" ), +- reverse: $this.jqmData( "direction" ) === "reverse", ++ transition: $.mobile.getAttrFixed( $this [0], "data-" + $.mobile.ns + "transition" ), ++ reverse: $.mobile.getAttrFixed( $this [0], "data-" + $.mobile.ns + "direction" ) === "reverse", + reloadPage: true + } + ); +@@ -1420,10 +1420,10 @@ define( [ + } + + //use ajax +- var transition = $link.jqmData( "transition" ), +- reverse = $link.jqmData( "direction" ) === "reverse" || ++ var transition = $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "transition" ), ++ reverse = $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "direction" ) === "reverse" || + // deprecated - remove by 1.0 +- $link.jqmData( "back" ), ++ $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "back" ), + + //this may need to be more specific as we use data-rel more + role = $link.attr( "data-" + $.mobile.ns + "rel" ) || undefined; +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 +index 41492ca..ad1ca3b 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js +@@ -27,8 +27,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, { + o = this.options, + collapsible = $el.addClass( "ui-collapsible" ), + collapsibleHeading = $el.children( o.heading ).first(), +- collapsedIcon = $el.jqmData( "collapsed-icon" ) || o.collapsedIcon, +- expandedIcon = $el.jqmData( "expanded-icon" ) || o.expandedIcon, ++ collapsedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "collapsed-icon" ) || o.collapsedIcon, ++ expandedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "expanded-icon" ) || o.expandedIcon, + collapsibleContent = collapsible.wrapInner( "
" ).children( ".ui-collapsible-content" ), + collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" ); + +@@ -42,34 +42,34 @@ $.widget( "mobile.collapsible", $.mobile.widget, { + if ( collapsibleSet.length ) { + // Inherit the theme from collapsible-set + if ( !o.theme ) { +- o.theme = collapsibleSet.jqmData( "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "c" ); ++ o.theme = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "c" ); + } + // Inherit the content-theme from collapsible-set + if ( !o.contentTheme ) { +- o.contentTheme = collapsibleSet.jqmData( "content-theme" ); ++ o.contentTheme = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "content-theme" ); + } + + // Get the preference for collapsed icon in the set + if ( !o.collapsedIcon ) { +- o.collapsedIcon = collapsibleSet.jqmData( "collapsed-icon" ); ++ o.collapsedIcon = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "collapsed-icon" ); + } + // Get the preference for expanded icon in the set + if ( !o.expandedIcon ) { +- o.expandedIcon = collapsibleSet.jqmData( "expanded-icon" ); ++ o.expandedIcon = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "expanded-icon" ); + } + // Gets the preference icon position in the set + if ( !o.iconPos ) { +- o.iconPos = collapsibleSet.jqmData( "iconpos" ); ++ o.iconPos = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "iconpos" ); + } + // Inherit the preference for inset from collapsible-set or set the default value to ensure equalty within a set +- if ( collapsibleSet.jqmData( "inset" ) !== undefined ) { +- o.inset = collapsibleSet.jqmData( "inset" ); ++ if ( $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "inset" ) !== undefined ) { ++ o.inset = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "inset" ); + } else { + o.inset = true; + } + // Gets the preference for mini in the set + if ( !o.mini ) { +- o.mini = collapsibleSet.jqmData( "mini" ); ++ o.mini = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "mini" ); + } + } else { + // get inherited theme if not a set and no theme has been set +@@ -84,8 +84,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, { + + collapsibleContent.addClass( ( o.contentTheme ) ? ( "ui-body-" + o.contentTheme ) : ""); + +- collapsedIcon = $el.jqmData( "collapsed-icon" ) || o.collapsedIcon || "plus"; +- expandedIcon = $el.jqmData( "expanded-icon" ) || o.expandedIcon || "minus"; ++ collapsedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "collapsed-icon" ) || o.collapsedIcon || "plus"; ++ expandedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "expanded-icon" ) || o.expandedIcon || "minus"; + + collapsibleHeading + //drop heading in before content +@@ -99,7 +99,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { + .buttonMarkup({ + shadow: false, + corners: false, +- iconpos: $el.jqmData( "iconpos" ) || o.iconPos || "left", ++ iconpos: $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "iconpos" ) || o.iconPos || "left", + icon: collapsedIcon, + mini: o.mini, + theme: o.theme +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 +index 4c5a419..ebc762d 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js +@@ -23,11 +23,11 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, { + } + // Inherit the content-theme from collapsible-set + if ( !o.contentTheme ) { +- o.contentTheme = $el.jqmData( "content-theme" ); ++ o.contentTheme = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "content-theme" ); + } + +- if ( $el.jqmData( "inset" ) !== undefined ) { +- o.inset = $el.jqmData( "inset" ); ++ if ( $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inset" ) !== undefined ) { ++ o.inset = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inset" ); + } + o.inset = o.inset !== undefined ? o.inset : true; + +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 +index d7a0795..9e390ef 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js +@@ -59,7 +59,7 @@ $.widget( "mobile.dialog", $.mobile.widget, { + var $target = $( event.target ).closest( event.type === "vclick" ? "a" : "form" ), + active; + +- if ( $target.length && !$target.jqmData( "transition" ) ) { ++ if ( $target.length && !$.mobile.getAttrFixed( $target[0], "data-" + $.mobile.ns + "transition" ) ) { + + active = $.mobile.urlHistory.getActive() || {}; + +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 +index 7b0141b..fe6d81c 100644 +--- 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 +@@ -25,8 +25,8 @@ $.widget( "mobile.button", $.mobile.widget, { + o = this.options, + type, + name, +- inline = o.inline || $el.jqmData( "inline" ), +- mini = o.mini || $el.jqmData( "mini" ), ++ inline = o.inline || $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inline" ), ++ mini = o.mini || $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "mini" ), + classes = "", + $buttonPlaceholder; + +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 +index a8b0f9f..9c78a90 100644 +--- 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 +@@ -89,9 +89,9 @@ $.widget( "mobile.selectmenu", $.mobile.widget, { + + options = this.options, + +- inline = options.inline || this.select.jqmData( "inline" ), +- mini = options.mini || this.select.jqmData( "mini" ), +- iconpos = options.icon ? ( options.iconpos || this.select.jqmData( "iconpos" ) ) : false, ++ inline = options.inline || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "inline" ), ++ mini = options.mini || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "mini" ), ++ iconpos = options.icon ? ( options.iconpos || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "iconpos" ) ) : false, + + // IE throws an exception at options.item() function when + // there is no selected item +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 +index c6d4c9b..6729af7 100644 +--- 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 +@@ -55,9 +55,9 @@ $.widget( "mobile.slider", $.mobile.widget, { + + step = window.parseFloat( control.attr( "step" ) || 1 ), + +- inlineClass = ( this.options.inline || control.jqmData( "inline" ) === true ) ? " ui-slider-inline" : "", ++ inlineClass = ( this.options.inline || $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "inline" ) === true ) ? " ui-slider-inline" : "", + +- miniClass = ( this.options.mini || control.jqmData( "mini" ) ) ? " ui-slider-mini" : "", ++ miniClass = ( this.options.mini || $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "min" ) ) ? " ui-slider-mini" : "", + + + domHandle = document.createElement( 'a' ), +@@ -65,7 +65,7 @@ $.widget( "mobile.slider", $.mobile.widget, { + domSlider = document.createElement( 'div' ), + slider = $( domSlider ), + +- valuebg = control.jqmData( "highlight" ) !== false && cType !== "select" ? (function() { ++ valuebg = $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "highlight" ) !== false && cType !== "select" ? (function() { + var bg = document.createElement('div'); + bg.className = 'ui-slider-bg ' + $.mobile.activeBtnClass + ' ui-btn-corner-all'; + return $( bg ).prependTo( slider ); +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 +index 075d35d..9a7765e 100644 +--- 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 +@@ -25,7 +25,7 @@ $.widget( "mobile.textinput", $.mobile.widget, { + o = this.options, + theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ), + themeclass = " ui-body-" + theme, +- mini = input.jqmData( "mini" ) === true, ++ mini = $.mobile.getAttrFixed( input[0], "data-" + $.mobile.ns + "mini" ) === true, + miniclass = mini ? " ui-mini" : "", + focusedEl, clearbtn; + +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 +index 0519b9a..b1ed1e4 100644 +--- 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 +@@ -69,7 +69,7 @@ $.mobile.$document.delegate( ":jqmData(role='listview')", "listviewcreate", func + + for ( var i = listItems.length - 1; i >= 0; i-- ) { + item = $( listItems[ i ] ); +- itemtext = item.jqmData( "filtertext" ) || item.text(); ++ itemtext = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "filtertext" ) || item.text(); + + if ( item.is( "li:jqmData(role=list-divider)" ) ) { + +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 +index e46f842..e0d68f7 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js +@@ -188,9 +188,9 @@ $.widget( "mobile.listview", $.mobile.widget, { + var o = this.options, + $list = this.element, + self = this, +- dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme, +- listsplittheme = $list.jqmData( "splittheme" ), +- listspliticon = $list.jqmData( "spliticon" ), ++ dividertheme = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "dividertheme" ) || o.dividerTheme, ++ listsplittheme = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "splittheme" ), ++ listspliticon = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "spliticon" ), + li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ), + ol = !!$.nodeName( $list[ 0 ], "ol" ), + jsCount = !$.support.cssPseudoElement, +@@ -227,12 +227,12 @@ $.widget( "mobile.listview", $.mobile.widget, { + + // If we're creating the element, we update it regardless + if ( create || !item.hasClass( "ui-li" ) ) { +- itemTheme = item.jqmData( "theme" ) || o.theme; ++ itemTheme = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "theme" ) || o.theme; + a = this._getChildrenByTagName( item[ 0 ], "a", "A" ); +- var isDivider = ( item.jqmData( "role" ) === "list-divider" ); ++ var isDivider = ( $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "role" ) === "list-divider" ); + + if ( a.length && !isDivider ) { +- icon = item.jqmData( "icon" ); ++ icon = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "icon" ); + + /* Remove auto populated right-arrow button. */ + if ( icon === undefined ) { +@@ -258,8 +258,8 @@ $.widget( "mobile.listview", $.mobile.widget, { + itemClass += " ui-li-has-alt"; + + last = a.last(); +- splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme; +- linkIcon = last.jqmData( "icon" ); ++ splittheme = listsplittheme || $.mobile.getAttrFixed( last[0], "data-" + $.mobile.ns + "theme" ) || o.splitTheme; ++ linkIcon = $.mobile.getAttrFixed( last[0], "data-" + $.mobile.ns + "icon" ); + + last.appendTo( item ) + .attr( "title", last.getEncodedText() ) +@@ -351,7 +351,7 @@ $.widget( "mobile.listview", $.mobile.widget, { + + .find( ".ui-li-count" ).each(function() { + $( this ).closest( "li" ).addClass( "ui-li-has-count" ); +- }).addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" ); ++ }).addClass( "ui-btn-up-" + ( $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" ); + + // The idea here is to look at the first image in the list item + // itself, and any .ui-link-inherit element it may contain, so we +@@ -412,8 +412,8 @@ $.widget( "mobile.listview", $.mobile.widget, { + nodeEls = nodeElsFull.length ? nodeElsFull : $( "" + $.trim(parent.contents()[ 0 ].nodeValue) + "" ), + title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text + id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId, +- theme = list.jqmData( "theme" ) || o.theme, +- countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme, ++ theme = $.mobile.getAttrFixed( list[0], "data-" + $.mobile.ns + "theme" ) || o.theme, ++ countTheme = $.mobile.getAttrFixed( list[0], "data-" + $.mobile.ns + "counttheme" ) || $.mobile.getAttrFixed( parentList[0], "data-" + $.mobile.ns + "counttheme" ) || o.countTheme, + newPage, anchor; + + //define hasSubPages for use in later removal +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 +index 13cb548..35d1933 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js +@@ -873,8 +873,8 @@ define( [ "jquery", + popup.popup( "open", { + x: offset.left + $link.outerWidth() / 2, + y: offset.top + $link.outerHeight() / 2, +- transition: $link.jqmData( "transition" ), +- positionTo: $link.jqmData( "position-to" ), ++ transition: $.mobile.getAttrFixed( $link[0], "data-" + $.mobile.ns + "transition" ), ++ positionTo: $.mobile.getAttrFixed( $link[0], "data-" + $.mobile.ns + "position-to" ), + link: $link + }); + } +-- +1.7.9.5 + + diff --git a/libs/patch/0031-JQM-performance-tuning-change-self-init-method-for-j.patch b/libs/patch/0031-JQM-performance-tuning-change-self-init-method-for-j.patch new file mode 100644 index 0000000..515b4f4 --- /dev/null +++ b/libs/patch/0031-JQM-performance-tuning-change-self-init-method-for-j.patch @@ -0,0 +1,135 @@ +From 18454b17fb19e4fa24b151ad377e43252ecf552f Mon Sep 17 00:00:00 2001 +From: Minkyeong Kim +Date: Fri, 1 Feb 2013 15:04:58 +0900 +Subject: [PATCH] [JQM] performance tuning : change self-init method for jQM + performance + +--- + .../jquery-mobile-1.2.0/js/jquery.mobile.core.js | 38 ++++++++++++++++++++ + .../jquery-mobile-1.2.0/js/widgets/collapsible.js | 6 ++-- + .../js/widgets/collapsibleSet.js | 6 ++-- + libs/js/jquery-mobile-1.2.0/js/widgets/listview.js | 6 ++-- + libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js | 6 ++-- + 5 files changed, 46 insertions(+), 16 deletions(-) + +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 +index f8c3a2d..d8a4b42 100644 +--- 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 +@@ -345,6 +345,44 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) { + $.find.matchesSelector = function( node, expr ) { + return $.find( expr, null, null, [ node ] ).length > 0; + }; ++ ++ $.extend({ ++ creatorDict: {}, ++ ++ delegateSelfInitWithSingleSelector: function( target, useKeepNative ) { ++ if ( typeof target !== 'function' ) { ++ return false; ++ } ++ var selector = target.prototype.options.initSelector; ++ var selectorRE = /:jqmData\(role='[A-z\-]+'\)$/; ++ if ( selectorRE.test(selector) ) { ++ var firstIdx = selector.indexOf( "'" ) + 1; ++ var lastIdx = selector.lastIndexOf( "'" ); ++ var key = selector.substring( firstIdx, lastIdx ); ++ if ( !$.creatorDict.hasOwnProperty( key ) ) { ++ $.creatorDict[key] = {}; ++ $.creatorDict[key].target = target; ++ if ( useKeepNative === true ) { ++ $.creatorDict[key].useKeepNative = useKeepNative; ++ } ++ return true; ++ } ++ } ++ return false; ++ } ++ }); ++ ++ //auto self-init widgets ++ $( document ).bind( "pagecreate create", function( e ) { ++ var selector = "*[data-" + $.mobile.ns + "role]"; ++ $( selector, e.target ).each( function () { ++ dataRoleValue = this.getAttribute( "data-role" ); ++ matchedObj = $.creatorDict[dataRoleValue]; ++ if ( matchedObj ) { ++ matchedObj.target.prototype.enhance( this, matchedObj.useKeepNative ); ++ } ++ }); ++ }); + })( jQuery, this ); + //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); + }); +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 +index ad1ca3b..26dbb61 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js +@@ -166,10 +166,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, { + } + }); + +-//auto self-init widgets +-$.mobile.$document.bind( "pagecreate create", function( e ) { +- $.mobile.collapsible.prototype.enhanceWithin( e.target ); +-}); ++//delegate auto self-init widgets ++$.delegateSelfInitWithSingleSelector( $.mobile.collapsible ); + + })( jQuery ); + //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +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 +index ebc762d..43975e8 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js +@@ -107,10 +107,8 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, { + } + }); + +-//auto self-init widgets +-$.mobile.$document.bind( "pagecreate create", function( e ) { +- $.mobile.collapsibleset.prototype.enhanceWithin( e.target ); +-}); ++//delegate auto self-init widgets ++$.delegateSelfInitWithSingleSelector( $.mobile.collapsibleset ); + + })( jQuery ); + //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +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 +index e0d68f7..58a2d04 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js +@@ -520,10 +520,8 @@ $.widget( "mobile.listview", $.mobile.widget, { + } + }); + +-//auto self-init widgets +-$.mobile.$document.bind( "pagecreate create", function( e ) { +- $.mobile.listview.prototype.enhanceWithin( e.target ); +-}); ++//delegate auto self-init widgets ++$.delegateSelfInitWithSingleSelector( $.mobile.listview ); + + })( jQuery ); + //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +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 +index 29c5057..0b52a06 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js +@@ -51,10 +51,8 @@ $.widget( "mobile.navbar", $.mobile.widget, { + } + }); + +-//auto self-init widgets +-$.mobile.$document.bind( "pagecreate create", function( e ) { +- $.mobile.navbar.prototype.enhanceWithin( e.target ); +-}); ++//delegate auto self-init widgets ++$.delegateSelfInitWithSingleSelector( $.mobile.navbar ); + + })( jQuery ); + //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +-- +1.7.9.5 + +