@@ -7,7 +7,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.page", {
$.widget( "ui.page", {
options: {
theme: "a",
domCache: false,
@@ -23,7 +23,7 @@ $.widget( "mobile.page", {
},

_create: function() {
var attrPrefix = "data-" + $.mobile.ns,
var attrPrefix = "data-" + $.ui.ns,
self = this;
// if false is returned by the callbacks do not create the page
if ( this._trigger( "beforecreate" ) === false ) {
@@ -51,7 +51,7 @@ $.widget( "mobile.page", {
});

// enhance the page
$.mobile._enhancer.enhance( this.element[ 0 ] );
$.ui._enhancer.enhance( this.element[ 0 ] );
},

_setOptions: function( o ) {
@@ -60,7 +60,7 @@ $.widget( "mobile.page", {
}

if( o.contentTheme !== undefined ) {
this.element.find( "[data-" + $.mobile.ns + "='content']" ).removeClass( "ui-body-" + this.options.contentTheme )
this.element.find( "[data-" + $.ui.ns + "='content']" ).removeClass( "ui-body-" + this.options.contentTheme )
.addClass( "ui-body-" + o.contentTheme );
}
},
@@ -70,7 +70,7 @@ $.widget( "mobile.page", {
},

removeContainerBackground: function() {
var classes = ( $.mobile.pageContainer.attr( "class" ) || "" ).split( " " ),
var classes = ( $.ui.pageContainer.attr( "class" ) || "" ).split( " " ),
overlayTheme = null,
matches;

@@ -85,13 +85,13 @@ $.widget( "mobile.page", {
}
}

$.mobile.pageContainer.removeClass( "ui-overlay-" + overlayTheme );
$.ui.pageContainer.removeClass( "ui-overlay-" + overlayTheme );
},

// set the page container background to the page theme
setContainerBackground: function( theme ) {
if ( this.options.theme ) {
$.mobile.pageContainer.addClass( "ui-overlay-" + ( theme || this.options.theme ) );
$.ui.pageContainer.addClass( "ui-overlay-" + ( theme || this.options.theme ) );
}
},

@@ -9,7 +9,7 @@ define( [ "jquery", "../jquery.mobile.widget", "./page", "../jquery.mobile.regis
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.panel", {
$.widget( "ui.panel", {
options: {
classes: {
panel: "ui-panel",
@@ -51,7 +51,7 @@ $.widget( "mobile.panel", {
$el = self.element,
page = $el.closest( ":jqmData(role='page')" ),
_getPageTheme = function() {
var $theme = $.data( page[0], "mobile-page" ).options.theme,
var $theme = $.data( page[0], "ui-page" ).options.theme,
$pageThemeClass = "ui-body-" + $theme;
return $pageThemeClass;
},
@@ -165,12 +165,12 @@ $.widget( "mobile.panel", {
_positionPanel: function() {
var self = this,
panelInnerHeight = self._panelInner.outerHeight(),
expand = panelInnerHeight > $.mobile.getScreenHeight();
expand = panelInnerHeight > $.ui.getScreenHeight();

if ( expand || !self.options.positionFixed ) {
if ( expand ) {
self._unfixPanel();
$.mobile.resetActivePageHeight( panelInnerHeight );
$.ui.resetActivePageHeight( panelInnerHeight );
}
self._scrollIntoView( panelInnerHeight );
} else {
@@ -222,9 +222,9 @@ $.widget( "mobile.panel", {
e.preventDefault();
var $link = $( this );
if ( ! $link.hasClass( "ui-link" ) ) {
$link.addClass( $.mobile.activeBtnClass );
$link.addClass( $.ui.activeBtnClass );
self.element.one( "panelopen panelclose", function() {
$link.removeClass( $.mobile.activeBtnClass );
$link.removeClass( $.ui.activeBtnClass );
});
}
self.toggle();
@@ -393,7 +393,7 @@ $.widget( "mobile.panel", {

self._fixPanel();
self._unbindFixListener();
$.mobile.resetActivePageHeight();
$.ui.resetActivePageHeight();

self._page.jqmRemoveData( "panel" );
self._trigger( "close" );
@@ -432,7 +432,7 @@ $.widget( "mobile.panel", {
if ( theme ) {
this._page.removeClass( "ui-body-" + theme ).addClass( this._pageTheme );
}
$.mobile.resetActivePageHeight();
$.ui.resetActivePageHeight();
}
} else if ( this._open ) {
this._wrapper.removeClass( classes.contentWrapOpen );
@@ -465,10 +465,10 @@ $.widget( "mobile.panel", {
}
});

$.mobile.panel.initSelector = ":jqmData(role='panel')";
$.ui.panel.initSelector = ":jqmData(role='panel')";

//auto self-init widgets
$.mobile._enhancer.add( "mobile.panel" );
$.ui._enhancer.add( "ui.panel" );

})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
@@ -12,7 +12,7 @@ function( jQuery ) {

( function( $, undefined ) {

var ieHack = ( $.mobile.browser.oldIE && $.mobile.browser.oldIE <= 8 ),
var ieHack = ( $.ui.browser.oldIE && $.ui.browser.oldIE <= 8 ),
uiTemplate = $(
"<div class='arrow-guide'></div>" +
"<div class='arrow-container" + ( ieHack ? " ie" : "" ) + "'>" +
@@ -34,7 +34,7 @@ function getArrow() {
return { arEls: ct.add( gd ), gd: gd, ct: ct, ar: ar, bg: bg };
}

$.widget( "mobile.popup", $.mobile.popup, {
$.widget( "ui.popup", $.ui.popup, {
options: {
arrow: false,
arrowSides: "t,b,l,r"
@@ -42,7 +42,7 @@ function fitSegmentInsideSegment( winSize, segSize, offset, desired ) {
}

function windowCoords() {
var $win = $.mobile.window;
var $win = $.ui.window;

return {
x: $win.scrollLeft(),
@@ -52,7 +52,7 @@ function windowCoords() {
};
}

$.widget( "mobile.popup", {
$.widget( "ui.popup", {
options: {
wrapperClass: null,
theme: null,
@@ -72,10 +72,10 @@ $.widget( "mobile.popup", {

// NOTE Windows Phone 7 has a scroll position caching issue that
// requires us to disable popup history management by default
// https://github.com/jquery/jquery-mobile/issues/4784
// https://github.com/jquery/jquery-ui/issues/4784
//
// NOTE this option is modified in _create!
history: !$.mobile.browser.oldIE
history: !$.ui.browser.oldIE
},

_eatEventAndClose: function( evt ) {
@@ -98,7 +98,7 @@ $.widget( "mobile.popup", {
},

_handleWindowKeyUp: function( evt ) {
if ( this._isOpen && evt.keyCode === $.mobile.keyCode.ESCAPE ) {
if ( this._isOpen && evt.keyCode === $.ui.keyCode.ESCAPE ) {
return this._eatEventAndClose( evt );
}
},
@@ -212,7 +212,7 @@ $.widget( "mobile.popup", {
// We need to adjust the history option to be false if there's no AJAX nav.
// We can't do it in the option declarations because those are run before
// it is determined whether there shall be AJAX nav.
opts.history = opts.history && $.mobile.ajaxEnabled && $.mobile.hashListeningEnabled;
opts.history = opts.history && $.ui.ajaxEnabled && $.ui.hashListeningEnabled;

// Define instance variables
$.extend( this, {
@@ -248,12 +248,12 @@ $.widget( "mobile.popup", {

// Event handlers
this._on( this._ui.screen, { "vclick": "_eatEventAndClose" } );
this._on( $.mobile.window, {
this._on( $.ui.window, {
orientationchange: $.proxy( this, "_handleWindowOrientationchange" ),
resize: $.proxy( this, "_handleWindowResize" ),
keyup: $.proxy( this, "_handleWindowKeyUp" )
});
this._on( $.mobile.document, { "focusin": "_handleDocumentFocusIn" } );
this._on( $.ui.document, { "focusin": "_handleDocumentFocusIn" } );
},

_enhance: function( elem, myId ) {
@@ -314,7 +314,7 @@ $.widget( "mobile.popup", {
_applyTransition: function( value ) {
this._ui.container.removeClass( this._fallbackTransition );
if ( value && value !== "none" ) {
this._fallbackTransition = $.mobile._maybeDegradeTransition( value );
this._fallbackTransition = $.ui._maybeDegradeTransition( value );
if ( this._fallbackTransition === "none" ) {
this._fallbackTransition = "";
}
@@ -457,7 +457,7 @@ $.widget( "mobile.popup", {
var ret,
rc = clampInfo.rc,
menuSize = clampInfo.menuSize,
// fix for $.mobile.document.height() bug in core 1.7.2.
// fix for $.ui.document.height() bug in core 1.7.2.
docEl = document.documentElement,
docBody = document.body,
docHeight = Math.max( docEl.clientHeight, docBody.scrollHeight, docBody.offsetHeight, docEl.scrollHeight, docEl.offsetHeight );
@@ -658,9 +658,9 @@ $.widget( "mobile.popup", {
if ( this.options.overlayTheme && androidBlacklist ) {
/* TODO: The native browser on Android 4.0.X ("Ice Cream Sandwich") suffers from an issue where the popup overlay appears to be z-indexed above the popup itself when certain other styles exist on the same page -- namely, any element set to `position: fixed` and certain types of input. These issues are reminiscent of previously uncovered bugs in older versions of Android's native browser: https://github.com/scottjehl/Device-Bugs/issues/3
This fix closes the following bugs ( I use "closes" with reluctance, and stress that this issue should be revisited as soon as possible ):
https://github.com/jquery/jquery-mobile/issues/4816
https://github.com/jquery/jquery-mobile/issues/4844
https://github.com/jquery/jquery-mobile/issues/4874
https://github.com/jquery/jquery-ui/issues/4816
https://github.com/jquery/jquery-ui/issues/4844
https://github.com/jquery/jquery-ui/issues/4874
*/

// TODO sort out why this._page isn't working
@@ -696,7 +696,7 @@ $.widget( "mobile.popup", {
container.removeAttr( "tabindex" );

// remove the global mutex for popups
$.mobile.popup.active = undefined;
$.ui.popup.active = undefined;

// Blur elements inside the container, including the container
$( ":focus", container[ 0 ] ).add( container[ 0 ] ).blur();
@@ -732,7 +732,7 @@ $.widget( "mobile.popup", {

_unenhance: function() {
// Put the element back to where the placeholder was and remove the "ui-popup" class
this._setOptions( { theme: $.mobile.popup.prototype.options.theme } );
this._setOptions( { theme: $.ui.popup.prototype.options.theme } );
this.element
// Cannot directly insertAfter() - we need to detach() first, because
// insertAfter() will do nothing if the payload div was not attached
@@ -749,7 +749,7 @@ $.widget( "mobile.popup", {
},

_destroy: function() {
if ( $.mobile.popup.active === this ) {
if ( $.ui.popup.active === this ) {
this.element.one( "popupafterclose", $.proxy( this, "_unenhance" ) );
this.close();
} else {
@@ -777,10 +777,10 @@ $.widget( "mobile.popup", {
} else {
parsedDst = data.toPage.jqmData( "url" );
}
parsedDst = $.mobile.path.parseUrl( parsedDst );
parsedDst = $.ui.path.parseUrl( parsedDst );
toUrl = parsedDst.pathname + parsedDst.search + parsedDst.hash;

if ( this._myUrl !== $.mobile.path.makeUrlAbsolute( toUrl ) ) {
if ( this._myUrl !== $.ui.path.makeUrlAbsolute( toUrl ) ) {
// Going to a different page - close immediately
immediate = true;
} else {
@@ -789,7 +789,7 @@ $.widget( "mobile.popup", {
}

// remove nav bindings
$.mobile.window.off( opts.closeEvents );
$.ui.window.off( opts.closeEvents );
// unbind click handlers added when history is disabled
this.element.undelegate( opts.closeLinkSelector, opts.closeLinkEvents );

@@ -800,7 +800,7 @@ $.widget( "mobile.popup", {
// NOTE the pagebeforechange is bound to catch navigation events that don't
// alter the url (eg, dialogs from popups)
_bindContainerClose: function() {
$.mobile.window
$.ui.window
.on( this.options.closeEvents, $.proxy( this, "_closePopup" ) );
},

@@ -814,13 +814,13 @@ $.widget( "mobile.popup", {
var self = this, opts = this.options, url, hashkey, activePage, currentIsDialog, hasHash, urlHistory;

// make sure open is idempotent
if( $.mobile.popup.active || opts.disabled ) {
if( $.ui.popup.active || opts.disabled ) {
return this;
}

// set the global popup mutex
$.mobile.popup.active = this;
this._scrollTop = $.mobile.window.scrollTop();
$.ui.popup.active = this;
this._scrollTop = $.ui.window.scrollTop();

// if history alteration is disabled close on navigate events
// and leave the url as is
@@ -841,9 +841,9 @@ $.widget( "mobile.popup", {
}

// cache some values for min/readability
urlHistory = $.mobile.urlHistory;
hashkey = $.mobile.dialogHashKey;
activePage = $.mobile.activePage;
urlHistory = $.ui.urlHistory;
hashkey = $.ui.dialogHashKey;
activePage = $.ui.activePage;
currentIsDialog = ( activePage ? activePage.hasClass( "ui-dialog" ) : false );
this._myUrl = url = urlHistory.getActive().url;
hasHash = ( url.indexOf( hashkey ) > -1 ) && !currentIsDialog && ( urlHistory.activeIndex > 0 );
@@ -859,7 +859,7 @@ $.widget( "mobile.popup", {
if ( url.indexOf( hashkey ) === -1 && !currentIsDialog ){
url = url + (url.indexOf( "#" ) > -1 ? hashkey : "#" + hashkey);
} else {
url = $.mobile.path.parseLocation().hash + hashkey;
url = $.ui.path.parseLocation().hash + hashkey;
}

// Tack on an extra hashkey if this is the first page and we've just reconstructed the initial hash
@@ -868,28 +868,28 @@ $.widget( "mobile.popup", {
}

// swallow the the initial navigation event, and bind for the next
$.mobile.window.one( "beforenavigate", function( evt ) {
$.ui.window.one( "beforenavigate", function( evt ) {
evt.preventDefault();
self._open( options );
self._bindContainerClose();
});

this.urlAltered = true;
$.mobile.navigate( url, { role: "dialog" } );
$.ui.navigate( url, { role: "dialog" } );

return this;
},

close: function() {
// make sure close is idempotent
if( $.mobile.popup.active !== this ) {
if( $.ui.popup.active !== this ) {
return this;
}

this._scrollTop = $.mobile.window.scrollTop();
this._scrollTop = $.ui.window.scrollTop();

if( this.options.history && this.urlAltered ) {
$.mobile.back();
$.ui.back();
this.urlAltered = false;
} else {
// simulate the nav bindings having fired
@@ -902,16 +902,16 @@ $.widget( "mobile.popup", {


// TODO this can be moved inside the widget
$.mobile.popup.handleLink = function( $link ) {
$.ui.popup.handleLink = function( $link ) {
var closestPage = $link.closest( ":jqmData(role='page')" ),
path = $.mobile.path,
path = $.ui.path,
scope = ( ( closestPage.length === 0 ) ? $( "body" ) : closestPage ),
// NOTE make sure to get only the hash, ie7 (wp7) returns the absolute href
// in this case ruining the element selection
popup = $( path.hashToSelector( path.parseUrl( $link.attr( "href" ) ).hash ), scope[ 0 ] ),
offset;

if ( popup.data( "mobile-popup" ) ) {
if ( popup.data( "ui-popup" ) ) {
offset = $link.offset();
popup.popup( "open", {
x: offset.left + $link.outerWidth() / 2,
@@ -923,22 +923,22 @@ $.mobile.popup.handleLink = function( $link ) {

//remove after delay
setTimeout( function() {
$link.removeClass( $.mobile.activeBtnClass );
$link.removeClass( $.ui.activeBtnClass );
}, 300 );
};

// TODO move inside _create
$.mobile.document.bind( "pagebeforechange", function( evt, data ) {
$.ui.document.bind( "pagebeforechange", function( evt, data ) {
if ( data.options.role === "popup" ) {
$.mobile.popup.handleLink( data.options.link );
$.ui.popup.handleLink( data.options.link );
evt.preventDefault();
}
});

$.mobile.popup.initSelector = ":jqmData(role='popup')";
$.ui.popup.initSelector = ":jqmData(role='popup')";

//auto self-init widgets
$.mobile._enhancer.add( "mobile.popup" );
$.ui._enhancer.add( "ui.popup" );

})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
@@ -15,13 +15,13 @@ define( [
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.table", $.mobile.table, {
$.widget( "ui.table", $.ui.table, {
options: {
mode: "columntoggle",
columnBtnTheme: null,
columnPopupTheme: null,
columnBtnText: "Columns...",
classes: $.extend( $.mobile.table.prototype.options.classes, {
classes: $.extend( $.ui.table.prototype.options.classes, {
popup: "ui-table-columntoggle-popup",
columnBtn: "ui-table-columntoggle-btn",
priorityPrefix: "ui-table-priority-",
@@ -33,7 +33,7 @@ $.widget( "mobile.table", $.mobile.table, {
var id, $menuButton, $popup, $menu,
$table = this.element,
o = this.options,
ns = $.mobile.ns,
ns = $.ui.ns,
menuInputChange = function(/* e */) {
var checked = this.checked;
$( this ).jqmData( "cells" )
@@ -87,7 +87,7 @@ $.widget( "mobile.table", $.mobile.table, {

// refresh method

this._on( $.mobile.window, { "throttledresize": "refresh" } );
this._on( $.ui.window, { "throttledresize": "refresh" } );

$.extend( this, {
_menu: $menu,
@@ -9,7 +9,7 @@ define( [ "jquery", "../jquery.mobile.widget", "./page", "../jquery.mobile.regis
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.table", {
$.widget( "ui.table", {
options: {
classes: {
table: "ui-table"
@@ -63,10 +63,10 @@ $.widget( "mobile.table", {
}
});

$.mobile.table.initSelector = ":jqmData(role='table')";
$.ui.table.initSelector = ":jqmData(role='table')";

//auto self-init widgets
$.mobile._enhancer.add( "mobile.table" );
$.ui._enhancer.add( "ui.table" );

})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
@@ -9,10 +9,10 @@ define( [ "jquery", "./table" ], function( jQuery ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.table", $.mobile.table, {
$.widget( "ui.table", $.ui.table, {
options: {
mode: "reflow",
classes: $.extend( $.mobile.table.prototype.options.classes, {
classes: $.extend( $.ui.table.prototype.options.classes, {
reflowTable: "ui-table-reflow",
cellLabels: "ui-table-cell-label"
})
@@ -10,7 +10,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core","./jquery

$.ui.tabs.initSelector = ":jqmData(role='tabs'), :jqmData(content='tabs')";

$.mobile._enhancer.add( "ui.tabs" );
$.ui._enhancer.add( "ui.tabs" );

})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
@@ -9,8 +9,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {


$.widget( "mobile.toolbar", {
$.widget( "ui.toolbar", {
options: {
theme: null,
addBackBtn: false,
@@ -24,7 +23,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
page = this.element.closest( ".ui-page" );
if ( page.length === 0 ){
page = false;
this._on( $.mobile.document, {
this._on( $.ui.document, {
"pageshow": "refresh"
});
}
@@ -44,15 +43,15 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
if ( this.options.addBackBtn &&
this.role === "header" &&
$( ".ui-page" ).length > 1 &&
this.page[ 0 ].getAttribute( "data-" + $.mobile.ns + "url" ) !== $.mobile.path.stripHash( location.hash ) &&
this.page[ 0 ].getAttribute( "data-" + $.ui.ns + "url" ) !== $.ui.path.stripHash( location.hash ) &&
!this.leftbtn ) {
this._addBackButton();
} else {
this.element.find( ".ui-toolbar-back-btn" ).remove();
}
}
if ( o.backBtnTheme !== undefined ) {
this.element.find( ".ui-toolbar-back-btn" ).attr( "data-" + $.mobile.ns + "theme", o.backBtnTheme ).buttonMarkup({ theme: o.backBtnTheme });
this.element.find( ".ui-toolbar-back-btn" ).attr( "data-" + $.ui.ns + "theme", o.backBtnTheme ).buttonMarkup({ theme: o.backBtnTheme });
}
if ( o.backBtnText !== undefined ) {
this.element.find( ".ui-toolbar-back-btn .ui-btn-text" ).text( o.backBtnText );
@@ -71,7 +70,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
this._addHeaderButtonClasses();
}
if ( !this.page ) {
$( "[data-"+ $.mobile.ns +"role='page']" ).css({"position":"relative"});
$( "[data-"+ $.ui.ns +"role='page']" ).css({"position":"relative"});
if ( this.role === "footer" ) {
this.element.appendTo( "body" );
}
@@ -81,7 +80,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
},
// Deprecated in 1.4. As from 1.5 data-role="button" has to be present in the markup.
_btnMarkup: function() {
this.element.children( "a" ).attr( "data-" + $.mobile.ns + "role", "button" );
this.element.children( "a" ).attr( "data-" + $.ui.ns + "role", "button" );
this.element.trigger( "create" );
},
_addHeaderButtonClasses: function() {
@@ -95,9 +94,9 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque

},
_addBackButton:function() {
this.backBtn = $( "<a href='javascript:void(0);' class='ui-btn-left ui-toolbar-back-btn' data-" + $.mobile.ns + "rel='back' data-" + $.mobile.ns + "icon='arrow-l'>" + this.options.backBtnText + "</a>" )
this.backBtn = $( "<a href='javascript:void(0);' class='ui-btn-left ui-toolbar-back-btn' data-" + $.ui.ns + "rel='back' data-" + $.ui.ns + "icon='arrow-l'>" + this.options.backBtnText + "</a>" )
// If theme is provided, override default inheritance
.attr( "data-" + $.mobile.ns + "theme", this.options.backBtnTheme || this.options.theme )
.attr( "data-" + $.ui.ns + "theme", this.options.backBtnTheme || this.options.theme )
.prependTo( this.element );
},
_addHeadingClasses: function() {
@@ -110,9 +109,9 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
});
}
});
$.mobile.toolbar.initSelector = ":jqmData(role='footer'), :jqmData(role='header')";
$.ui.toolbar.initSelector = ":jqmData(role='footer'), :jqmData(role='header')";

$.mobile._enhancer.add( "mobile.toolbar" );
$.ui._enhancer.add( "ui.toolbar" );

})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
@@ -2,7 +2,7 @@
* mobile checkboxradio unit tests
*/
(function($){
module( 'jquery.mobile.forms.checkboxradio.js' );
module( 'jquery.ui.forms.checkboxradio.js' );

asyncTest( "radio button labels should update the active button class to last clicked and clear checked", function(){
var $radioBtns = $( '#radio-active-btn-test input' ),
@@ -10,7 +10,7 @@
expect( 5 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#basic-collapsible-test" ) );
$.ui.changePage( $( "#basic-collapsible-test" ) );
},

function() {
@@ -29,7 +29,7 @@
expect( 3 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#basic-collapsible-test" ) );
$.ui.changePage( $( "#basic-collapsible-test" ) );
},

function() {
@@ -49,7 +49,7 @@
var nTests = 2;
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#basic-collapsible-set-test" ) );
$.ui.changePage( $( "#basic-collapsible-set-test" ) );
},

function() {
@@ -74,7 +74,7 @@
var nTests = 0;
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#collapsible-set-with-lonely-collapsible-test" ) );
$.ui.changePage( $( "#collapsible-set-with-lonely-collapsible-test" ) );
},

function() {
@@ -96,7 +96,7 @@
expect( 2 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#basic-collapsible-set-test" ) );
$.ui.changePage( $( "#basic-collapsible-set-test" ) );
},

function() {
@@ -111,7 +111,7 @@
expect( 3 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#basic-collapsible-set-test" ) );
$.ui.changePage( $( "#basic-collapsible-set-test" ) );
},

function() {
@@ -129,13 +129,13 @@
expect( 7 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#collapsible-set-with-dynamic-content" ) );
$.ui.changePage( $( "#collapsible-set-with-dynamic-content" ) );
},

function() {
var set = $( ".ui-page-active" ).find( ".ui-collapsible-set" );
for ( var i = 0; i < 3; i++ ) {
$( '<div data-'+ $.mobile.ns +'role="collapsible"><h3>Collapsible Item ' + i + '</h3></div>' ).appendTo( set );
$( '<div data-'+ $.ui.ns +'role="collapsible"><h3>Collapsible Item ' + i + '</h3></div>' ).appendTo( set );
}
set.collapsibleset( "refresh" );
equal( set.find( ".ui-collapsible" ).length, 3, "The 3 collapsibles should be enhanced" );
@@ -154,13 +154,13 @@
expect( 7 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#collapsible-set-with-static-and-dynamic-content" ) );
$.ui.changePage( $( "#collapsible-set-with-static-and-dynamic-content" ) );
},

function() {
var set = $( ".ui-page-active" ).find( ".ui-collapsible-set" );
for ( var i = 0; i < 2; i++ ) {
$( '<div data-'+ $.mobile.ns +'role="collapsible"><h3>Collapsible Item ' + i + '</h3></div>' ).appendTo( set );
$( '<div data-'+ $.ui.ns +'role="collapsible"><h3>Collapsible Item ' + i + '</h3></div>' ).appendTo( set );
}
set.collapsibleset( "refresh" );
equal( set.find( ".ui-collapsible" ).length, 3, "The 3 collapsibles should be enhanced" );
@@ -179,11 +179,11 @@
expect( 1 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#collapsible-set-with-last-collapsible-expanded" ) );
$.ui.changePage( $( "#collapsible-set-with-last-collapsible-expanded" ) );
},

function() {
var collapsibles = $.mobile.activePage.find( ".ui-collapsible" );
var collapsibles = $.ui.activePage.find( ".ui-collapsible" );
ok( collapsibles.last().hasClass( "ui-last-child" ), "Content of last collapsible should have class ui-last-child");
start();
}
@@ -194,11 +194,11 @@
expect( 3 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#collapsible-set-with-legends" ) );
$.ui.changePage( $( "#collapsible-set-with-legends" ) );
},

function() {
var collapsibles = $.mobile.activePage.find( ".ui-collapsible-heading" );
var collapsibles = $.ui.activePage.find( ".ui-collapsible-heading" );
ok( !collapsibles.eq(0).is( ".ui-first-child" ), "First collapsible should NOT have class ui-last-child");
ok( !collapsibles.eq(1).is( ".ui-last-child,.ui-first-child" ), "Middle collapsible should NOT have class ui-first-child or ui-last-child");
ok( !collapsibles.eq(2).is( ".ui-first-child" ), "Last collapsible should NOT have class ui-first-child");
@@ -213,11 +213,11 @@
expect( 6 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#collapsible-with-custom-icons" ) );
$.ui.changePage( $( "#collapsible-with-custom-icons" ) );
},

function() {
var collapsibles = $.mobile.activePage.find( ".ui-collapsible" );
var collapsibles = $.ui.activePage.find( ".ui-collapsible" );
ok( collapsibles.eq(0).find( ".ui-btn" ).hasClass( "ui-icon-plus" ), "Heading of first collapsible should have class ui-icon-plus");
ok( collapsibles.eq(1).find( ".ui-btn" ).hasClass( "ui-icon-minus" ), "Heading of second collapsible should have class ui-icon-minus");
ok( collapsibles.eq(2).find( ".ui-btn" ).hasClass( "ui-icon-arrow-r" ), "Heading of third collapsible should have class ui-icon-arrow-r");
@@ -237,11 +237,11 @@
expect( 6 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#collapsible-set-with-custom-icons" ) );
$.ui.changePage( $( "#collapsible-set-with-custom-icons" ) );
},

function() {
var collapsibles = $.mobile.activePage.find( ".ui-collapsible" );
var collapsibles = $.ui.activePage.find( ".ui-collapsible" );
ok( collapsibles.eq(0).find( ".ui-btn" ).hasClass( "ui-icon-plus" ), "Heading of first collapsible should have class ui-icon-plus");
ok( collapsibles.eq(1).find( ".ui-btn" ).hasClass( "ui-icon-minus" ), "Heading of second collapsible should have class ui-icon-minus");
ok( collapsibles.eq(2).find( ".ui-btn" ).hasClass( "ui-icon-arrow-r" ), "Heading of third collapsible should have class ui-icon-arrow-r");
@@ -259,11 +259,11 @@
expect( 6 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#collapsible-with-theming" ) );
$.ui.changePage( $( "#collapsible-with-theming" ) );
},

function() {
var collapsibles = $.mobile.activePage.find( ".ui-collapsible" );
var collapsibles = $.ui.activePage.find( ".ui-collapsible" );
ok( collapsibles.eq(0).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-a" ), "Heading of first collapsible should have class ui-btn-a");
ok( !collapsibles.eq(0).find( ".ui-collapsible-content" ).hasClass( "ui-btn-a" ), "Content of first collapsible should NOT have class ui-btn-a");
ok( collapsibles.eq(1).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-b" ), "Heading of second collapsible should have class ui-btn-b");
@@ -280,11 +280,11 @@
expect( 13 );
$.testHelper.pageSequence([
function(){
$.mobile.changePage( $( "#collapsible-set-with-theming" ) );
$.ui.changePage( $( "#collapsible-set-with-theming" ) );
},

function() {
var collapsibles = $.mobile.activePage.find( ".ui-collapsible" );
var collapsibles = $.ui.activePage.find( ".ui-collapsible" );

ok( collapsibles.eq(0).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-a" ), "Heading of first collapsible should have class ui-btn-a" );
ok( !collapsibles.eq(0).find( ".ui-collapsible-content" ).is( ".ui-body-a,.ui-body-b,.ui-body-c" ), "Content of first collapsible should NOT have class ui-body-[a,b,c]" );
@@ -3,7 +3,7 @@
*/

(function($){
var libName = "jquery.mobile.core",
var libName = "jquery.ui.core",
scrollTimeout = 20, // TODO expose timing as an attribute
scrollStartEnabledTimeout = 150;

@@ -20,7 +20,7 @@
var scrollUp = function( pos ){
$(window).scrollTop(1000);
ok($(window).scrollTop() > 0, $(window).scrollTop());
$.mobile.silentScroll(pos);
$.ui.silentScroll(pos);
};

asyncTest( "silent scroll scrolls the page to the top by default", function(){
@@ -3,18 +3,18 @@
*/

(function($){
module('jquery.mobile.degradeInputs.js');
module('jquery.ui.degradeInputs.js');

asyncTest('should degrade input type to a different type, as specified in page options', function(){
var degradeInputs = $.mobile.page.prototype.options.degradeInputs;
var degradeInputs = $.ui.page.prototype.options.degradeInputs;

expect( degradeInputs.length );

// NOTE the initial page is already enhanced (or expected to be) so we load the dialog to enhance it
// and _expect_ that the default page will remain "unreaped". This will break if that assumption changes
$.testHelper.pageSequence([
function() {
$.mobile.changePage( "#dialog" );
$.ui.changePage( "#dialog" );
},

function() {
@@ -9,12 +9,12 @@
},

function() {
ok( $.mobile.activePage.attr( "id" ) === "basicDialog", "Basic dialog has opened" );
$( "a", $.mobile.activePage[ 0 ] ).click();
ok( $.ui.activePage.attr( "id" ) === "basicDialog", "Basic dialog has opened" );
$( "a", $.ui.activePage[ 0 ] ).click();
},

function() {
ok( $.mobile.activePage.attr( "id" ) === "basicTestPage", "Active page is original page" );
ok( $.ui.activePage.attr( "id" ) === "basicTestPage", "Active page is original page" );
start();
}
]);
@@ -2,12 +2,12 @@
* mobile dialog unit tests
*/
(function($) {
var home = $.mobile.path.parseUrl(location.pathname).directory,
var home = $.ui.path.parseUrl(location.pathname).directory,
homeWithSearch = home + location.search;

module( "jquery.mobile.dialog.js", {
setup: function() {
$.mobile.page.prototype.options.contentTheme = "d";
$.ui.page.prototype.options.contentTheme = "d";
$.testHelper.navReset( homeWithSearch );
}
});
@@ -77,11 +77,11 @@

$.testHelper.pageSequence([
function() {
$.mobile.changePage( $( "#mypage" ) );
$.ui.changePage( $( "#mypage" ) );
},

function() {
$.mobile.changePage( $( "#doubleCloseTestPage" ) );
$.ui.changePage( $( "#doubleCloseTestPage" ) );
},

function() {
@@ -111,7 +111,7 @@

$.testHelper.pageSequence([
function() {
$.mobile.changePage( $( "#mypage" ) );
$.ui.changePage( $( "#mypage" ) );
},

function() {
@@ -124,9 +124,9 @@

// Assert dialog theme inheritance (issue 1375):
ok( dialog.hasClass( "ui-page-theme-a" ), "Expected explicit theme ui-page-theme-a" );
ok( $.mobile.pageContainer.hasClass( "ui-overlay-a" ), "Expected default overlay theme ui-overlay-a" );
ok( $.ui.pageContainer.hasClass( "ui-overlay-a" ), "Expected default overlay theme ui-overlay-a" );
ok( dialog.find( ":jqmData(role=header)" ).hasClass( "ui-bar-inherit" ), "Expected header to inherit from dialog" );
ok( dialog.find( ":jqmData(role=content)" ).hasClass( "ui-body-" + $.mobile.page.prototype.options.contentTheme ), "Expect content to inherit from $.mobile.page.prototype.options.contentTheme" );
ok( dialog.find( ":jqmData(role=content)" ).hasClass( "ui-body-" + $.ui.page.prototype.options.contentTheme ), "Expect content to inherit from $.ui.page.prototype.options.contentTheme" );
ok( dialog.find( ":jqmData(role=footer)" ).hasClass( "ui-bar-inherit" ), "Expected footer to inherit from dialog" );

start();
@@ -136,13 +136,13 @@

asyncTest( "dialog element with data-theme", function() {
// Reset fallback theme for content
$.mobile.page.prototype.options.contentTheme = null;
$.ui.page.prototype.options.contentTheme = null;

expect(6);

$.testHelper.pageSequence([
function() {
$.mobile.changePage( $( "#mypage" ) );
$.ui.changePage( $( "#mypage" ) );
},

function() {
@@ -155,8 +155,8 @@

// Assert dialog theme inheritance (issue 1375):
ok( dialog.hasClass( "ui-page-theme-e" ), "Expected explicit theme ui-page-theme-e" );
ok( !$.mobile.pageContainer.hasClass( "ui-overlay-b" ), "Expected no overlay theme ui-overlay-b" );
ok( $.mobile.pageContainer.hasClass( "ui-overlay-a" ), "Expected default overlay theme ui-overlay-a" );
ok( !$.ui.pageContainer.hasClass( "ui-overlay-b" ), "Expected no overlay theme ui-overlay-b" );
ok( $.ui.pageContainer.hasClass( "ui-overlay-a" ), "Expected default overlay theme ui-overlay-a" );
ok( dialog.find( ":jqmData(role=header)" ).hasClass( "ui-bar-inherit" ), "Expected header to inherit from dialog" );
ok( dialog.find( ":jqmData(role=content)" ).hasClass( "ui-body-e" ), "Expect content to inherit from data-theme" );
ok( dialog.find( ":jqmData(role=footer)" ).hasClass( "ui-bar-inherit" ), "Expected footer to inherit from dialog" );
@@ -171,7 +171,7 @@

$.testHelper.pageSequence([
function() {
$.mobile.changePage( $( "#mypage" ) );
$.ui.changePage( $( "#mypage" ) );
},

function() {
@@ -183,9 +183,9 @@
var dialog = $( "#dialog-c" );
// Assert dialog theme inheritance (issue 1375):
ok( dialog.hasClass( "ui-page-theme-e" ), "Expected explicit theme ui-page-theme-e" );
ok( $.mobile.pageContainer.hasClass( "ui-overlay-b" ), "Expected explicit overlay theme ui-overlay-b" );
ok( $.ui.pageContainer.hasClass( "ui-overlay-b" ), "Expected explicit overlay theme ui-overlay-b" );
ok( dialog.find( ":jqmData(role=header)" ).hasClass( "ui-bar-inherit" ), "Expected header to inherit from dialog" );
ok( dialog.find( ":jqmData(role=content)" ).hasClass( "ui-body-" + $.mobile.page.prototype.options.contentTheme ), "Expect content to inherit from $.mobile.page.prototype.options.contentTheme" );
ok( dialog.find( ":jqmData(role=content)" ).hasClass( "ui-body-" + $.ui.page.prototype.options.contentTheme ), "Expect content to inherit from $.ui.page.prototype.options.contentTheme" );
ok( dialog.find( ":jqmData(role=footer)" ).hasClass( "ui-bar-inherit" ), "Expected footer to inherit from dialog" );

start();
@@ -201,7 +201,7 @@

$.testHelper.pageSequence([
function() {
$.mobile.changePage( "#mypage" );
$.ui.changePage( "#mypage" );
},

function() {
@@ -210,13 +210,13 @@
},

function() {
pageTheme = "ui-overlay-" + $.mobile.activePage.dialog( "option", "overlayTheme" );
pageTheme = "ui-overlay-" + $.ui.activePage.dialog( "option", "overlayTheme" );

$.mobile.pageContainer.removeClass( pageTheme );
$.ui.pageContainer.removeClass( pageTheme );

$.mobile.activePage
$.ui.activePage
.bind( "pagebeforeshow", function(){
ok( $.mobile.pageContainer.hasClass( pageTheme ), "Page container has the same theme as the dialog overlayTheme on pagebeforeshow" );
ok( $.ui.pageContainer.hasClass( pageTheme ), "Page container has the same theme as the dialog overlayTheme on pagebeforeshow" );
start();
}).trigger( "pagebeforeshow" );
}
@@ -4,7 +4,7 @@
(function($) {
module( "jquery.mobile.dialog.js", {
setup: function() {
$.mobile.page.prototype.options.contentTheme = "d";
$.ui.page.prototype.options.contentTheme = "d";
}
});

@@ -15,11 +15,11 @@

$.testHelper.pageSequence([
function() {
$.mobile.changePage( $( "#mypage" ) );
$.ui.changePage( $( "#mypage" ) );
},

function() {
activePage = $.mobile.activePage;
activePage = $.ui.activePage;
//bring up the dialog
$( "#dialog-no-hash-link" ).click();
},
@@ -34,7 +34,7 @@

function() {
ok( !$( "#dialog-no-hash" ).is( ":visible" ), "dialog disappeared" );
ok( $.mobile.activePage[0] === activePage[0], "active page has been restored" );
ok( $.ui.activePage[0] === activePage[0], "active page has been restored" );
start();
}
]);
@@ -10,7 +10,7 @@
<script>
$(document).bind('mobileinit',function(){
// Expect content to inherit this theme when not explicitly set
$.mobile.page.prototype.options.contentTheme = "d";
$.ui.page.prototype.options.contentTheme = "d";
});
</script>
<script src="../../jquery.setNameSpace.js"></script>
@@ -9,9 +9,9 @@
<script src="../../../js/jquery.tag.inserter.js"></script>
<script>
$(document).bind('mobileinit',function(){
$.mobile.changePage.defaults.changeHash = false;
$.mobile.hashListeningEnabled = false;
$.mobile.pushStateEnabled = false;
$.ui.changePage.defaults.changeHash = false;
$.ui.hashListeningEnabled = false;
$.ui.pushStateEnabled = false;
});
</script>
<script src="../../jquery.setNameSpace.js"></script>
@@ -12,7 +12,7 @@
window.scrollTo(0,0);
}

module("jquery.mobile.toolbar.js", {setup: function() {
module("jquery.ui.toolbar.js", {setup: function() {
var startTimeout;

// swallow the inital page change
@@ -165,7 +165,7 @@

$.testHelper.sequence([
function(){
$.mobile.changePage( "#fullscreen-test-a" );
$.ui.changePage( "#fullscreen-test-a" );
},

function(){
@@ -193,7 +193,7 @@
$.testHelper.pageSequence([
function(){
ok( nextpageheader.length && nextpagefooter.length, "next page has fixed header and fixed footer" );
$.mobile.changePage( "#persist-test-a" );
$.ui.changePage( "#persist-test-a" );
},

function(){
@@ -202,12 +202,12 @@
ok( nextpageheader.parent( ".ui-mobile-viewport" ).length, "fixed header and footer are now a child of page container" );
});

$.mobile.changePage( "#persist-test-b" );
$.ui.changePage( "#persist-test-b" );
},

function() {
ok( nextpageheader.parent( ".ui-page" ).length, "fixed header and footer are now a child of page again" );
$.mobile.changePage( "#default" );
$.ui.changePage( "#default" );
},

start
@@ -225,21 +225,21 @@
$.testHelper.pageSequence([
function(){
ok( nextpageheader.length, "next page has fixed header and fixed footer" );
$.mobile.changePage( "#persist-test-c" );
$.ui.changePage( "#persist-test-c" );
},

function(){
$( "#persist-test-d" )
.one( "pagebeforeshow", function(){
deepEqual( nextpageheader.parent()[0], $.mobile.pageContainer[0], "fixed header is now a child of page container" );
deepEqual( nextpageheader.parent()[0], $.ui.pageContainer[0], "fixed header is now a child of page container" );
});

$.mobile.changePage( "#persist-test-d" );
$.ui.changePage( "#persist-test-d" );
},

function() {
deepEqual( nextpageheader.parent()[0], $.mobile.activePage[0], "fixed header is now a child of page again" );
$.mobile.changePage( "#default" );
deepEqual( nextpageheader.parent()[0], $.ui.activePage[0], "fixed header is now a child of page again" );
$.ui.changePage( "#default" );
},

start
@@ -257,21 +257,21 @@
$.testHelper.pageSequence([
function(){
ok( nextpagefooter.length, "next page has fixed footer and fixed footer" );
$.mobile.changePage( "#persist-test-e" );
$.ui.changePage( "#persist-test-e" );
},

function(){
$( "#persist-test-f" )
.one( "pagebeforeshow", function(){
deepEqual( nextpagefooter.parent()[0], $.mobile.pageContainer[0], "fixed footer is now a child of page container" );
deepEqual( nextpagefooter.parent()[0], $.ui.pageContainer[0], "fixed footer is now a child of page container" );
});

$.mobile.changePage( "#persist-test-f" );
$.ui.changePage( "#persist-test-f" );
},

function() {
deepEqual( nextpagefooter.parent()[0], $.mobile.activePage[0], "fixed footer is now a child of page again" );
$.mobile.changePage( "#default" );
deepEqual( nextpagefooter.parent()[0], $.ui.activePage[0], "fixed footer is now a child of page again" );
$.ui.changePage( "#default" );
},

start
@@ -281,12 +281,12 @@
var asyncTestFooterAndHeader = function( pageSelector, visible ) {
$.testHelper.pageSequence([
function() {
$.mobile.changePage( pageSelector );
$.ui.changePage( pageSelector );
},

function() {
var $footer = $.mobile.activePage.find( ".ui-footer" ),
$header = $.mobile.activePage.find( ".ui-header" ),
var $footer = $.ui.activePage.find( ".ui-footer" ),
$header = $.ui.activePage.find( ".ui-header" ),
hiddenStr = visible ? "hidden" : "visible";

equal( $footer.length, 1, "there should be one footer" );
@@ -295,7 +295,7 @@
equal( !$footer.hasClass( "ui-fixed-hidden" ), visible, "the footer should be " + hiddenStr );
equal( !$header.hasClass( "ui-fixed-hidden" ), visible, "the header should be " + hiddenStr );

$.mobile.changePage( "#default" );
$.ui.changePage( "#default" );
},

start

Large diffs are not rendered by default.

@@ -6,6 +6,6 @@ $.testHelper.delayStart();
test( "loading a url that refs an embedded page with a query param works", function() {
ok( location.href.indexOf( "?test-query-param-hash=true" ) >= -1, "query param present in url" );
ok( location.hash.indexOf( "loaded" ) >= -1, "the hash is targeted at the page to be loaded" );
ok( $.mobile.activePage.attr( "id" ), "loaded", "the correct page is loaded" );
ok( $.ui.activePage.attr( "id" ), "loaded", "the correct page is loaded" );
});
})( jQuery );
@@ -2,13 +2,13 @@
$.testHelper.setPushState();

(function( $ ) {
var url = $.mobile.path.parseLocation(),
var url = $.ui.path.parseLocation(),
home = url.pathname + url.search;

module( "navigate", {
setup: function() {
$.mobile.navigate.history.stack = [];
$.mobile.navigate.history.activeIndex = 0;
$.ui.navigate.history.stack = [];
$.ui.navigate.history.activeIndex = 0;
},

teardown: function() {
@@ -19,17 +19,17 @@ $.testHelper.setPushState();
});

if( location.hash !== "#reset" ) {
$.mobile.navigate( "#reset" );
$.ui.navigate( "#reset" );
} else {
$.mobile.navigate( "#seriously-reset" );
$.ui.navigate( "#seriously-reset" );
}
}
});

test( "navigation changes the url", function() {
ok( location.hash.indexOf( "foo" ) == -1, "the hash is clean" );

$.mobile.navigate( "#foo" );
$.ui.navigate( "#foo" );

equal( location.hash, "#foo", "the hash has been altered" );
});
@@ -39,11 +39,11 @@ $.testHelper.setPushState();
var destination = home + "#foo";

ok( location.hash.indexOf( "foo" ) == -1, "the hash is clean" );
ok( $.mobile.path.isPath(destination), "the destination is a path" );
ok( $.ui.path.isPath(destination), "the destination is a path" );

$.mobile.navigate( destination );
$.ui.navigate( destination );

equal( $.mobile.path.parseLocation().pathname, url.pathname, "the resulting url has the same pathname as the original test url" );
equal( $.ui.path.parseLocation().pathname, url.pathname, "the resulting url has the same pathname as the original test url" );
equal( location.hash, "#foo", "the hash has been altered" );
});
}
@@ -55,11 +55,11 @@ $.testHelper.setPushState();

$.testHelper.eventSequence( "navigate", [
function( timedOut, data ) {
$.mobile.navigate( "#foo", { foo: "bar" });
$.ui.navigate( "#foo", { foo: "bar" });
},

function( timedOut, data ) {
$.mobile.navigate( "#bar", { baz: "bak" });
$.ui.navigate( "#bar", { baz: "bak" });
},

function( timedOut, data ) {
@@ -86,31 +86,31 @@ $.testHelper.setPushState();

$.testHelper.eventSequence( "navigate", [
function() {
$.mobile.navigate( "#foo" );
$.ui.navigate( "#foo" );
},

function() {
$.mobile.navigate( "#bar" );
$.ui.navigate( "#bar" );
},

function() {
$.mobile.navigate( "#baz" );
$.ui.navigate( "#baz" );
},

function() {
equal( $.mobile.navigate.history.activeIndex, 2, "after n navigation events the active index is correct" );
equal( $.ui.navigate.history.activeIndex, 2, "after n navigation events the active index is correct" );
window.history.back();
},

function( timedOut, data ) {
equal( $.mobile.navigate.history.activeIndex, 1, "after n navigation events, and a back, the active index is correct" );
equal( $.ui.navigate.history.activeIndex, 1, "after n navigation events, and a back, the active index is correct" );
equal( data.state.direction, "back", "the direction should be back and not forward" );
window.history.back();
},

function( timedOut, data ) {
equal( $.mobile.navigate.history.stack.length, 3, "the history stack hasn't been truncated" );
equal( $.mobile.navigate.history.activeIndex, 0, "the active history entry is the first" );
equal( $.ui.navigate.history.stack.length, 3, "the history stack hasn't been truncated" );
equal( $.ui.navigate.history.activeIndex, 0, "the active history entry is the first" );
equal( data.state.direction, "back", "the direction should be back and not forward" );
start();
}
@@ -122,16 +122,16 @@ $.testHelper.setPushState();

$.testHelper.eventSequence( "navigate", [
function() {
$.mobile.navigate( "#bar" );
$.ui.navigate( "#bar" );
},

function() {
location.hash = "#foo";
},

function() {
equal($.mobile.navigate.history.stack.length, 2, "there are two entries in the history stack" );
equal($.mobile.navigate.history.getActive().hash, "#foo", "the url for the active history entry matches the hash" );
equal($.ui.navigate.history.stack.length, 2, "there are two entries in the history stack" );
equal($.ui.navigate.history.getActive().hash, "#foo", "the url for the active history entry matches the hash" );
start();
}
]);
@@ -146,14 +146,14 @@ $.testHelper.setPushState();
},

function() {
equal($.mobile.navigate.history.stack.length, 1, "there is one entry in the history stack" );
equal($.mobile.navigate.history.getActive().hash, "#foo", "the url for the active history entry matches the hash" );
equal($.ui.navigate.history.stack.length, 1, "there is one entry in the history stack" );
equal($.ui.navigate.history.getActive().hash, "#foo", "the url for the active history entry matches the hash" );
location.hash = "#foo";
},

function( timedOut ) {
equal($.mobile.navigate.history.stack.length, 1, "there is one entry in the history stack" );
equal($.mobile.navigate.history.getActive().hash, "#foo", "the url for the active history entry matches the hash" );
equal($.ui.navigate.history.stack.length, 1, "there is one entry in the history stack" );
equal($.ui.navigate.history.getActive().hash, "#foo", "the url for the active history entry matches the hash" );
ok( timedOut, "there was no navigation event from setting the same hash" );
start();
}
@@ -162,35 +162,35 @@ $.testHelper.setPushState();

if( $.support.pushState ) {
test( "squash is working properly", function() {
var path = $.mobile.path, loc;
$.mobile.navigate.navigator.squash( url.pathname + url.search + "#test-hash" );
var path = $.ui.path, loc;
$.ui.navigate.navigator.squash( url.pathname + url.search + "#test-hash" );

$.mobile.navigate.navigator.squash("#foo/bar");
$.ui.navigate.navigator.squash("#foo/bar");
loc = path.parseLocation();
equal( loc.pathname, url.directory + "foo/bar", "foo/bar has been squashed onto the url" );

$.mobile.navigate.navigator.squash("bar/baz");
$.ui.navigate.navigator.squash("bar/baz");
loc = path.parseLocation();
equal( loc.pathname, url.directory + "foo/bar/baz", "foo/bar has been squashed onto the url" );

$.mobile.navigate.navigator.squash("#foo");
$.ui.navigate.navigator.squash("#foo");
loc = path.parseLocation();
equal( loc.hash, "#foo", "foo is now the hash" );
equal( loc.search, url.search, "the search is preserved" );

// Make sure that the search delimiter is dictated by the squashed value
$.mobile.navigate.navigator.squash("#foo/bar" + location.search.replace( "&", ";" ));
$.ui.navigate.navigator.squash("#foo/bar" + location.search.replace( "&", ";" ));
loc = path.parseLocation();
ok( loc.search.indexOf( "&" ) === -1, "the amp has been replaced" );

$.mobile.navigate.navigator.squash( url.pathname + url.search );
$.ui.navigate.navigator.squash( url.pathname + url.search );
});


test( "navigating with an absolute url matching the current url save for the hash should transplant the hash", function() {
var loc = $.mobile.path.parseLocation();
var loc = $.ui.path.parseLocation();

$.mobile.navigate( loc.hrefNoHash + loc.hash + "foo" );
$.ui.navigate( loc.hrefNoHash + loc.hash + "foo" );
equal( location.hash, loc.hash + "foo", "the hash is set properly" );
});
}
@@ -10,7 +10,7 @@
<script>
$(document).bind('mobileinit',function(){
// Expect content to inherit this theme when not explicitly set
$.mobile.page.prototype.options.contentTheme = "d";
$.ui.page.prototype.options.contentTheme = "d";
});
</script>
<script src="../../../jquery.setNameSpace.js"></script>
@@ -4,27 +4,27 @@
asyncTest( "Sequence start(#page1) -> #page3 -> #page1 -> #page2 <- Back", function() {
$.testHelper.pageSequence([
function() {
deepEqual( $.mobile.activePage.attr( "id" ), "page1", "Initially #page1 is active" );
$.mobile.activePage.find( "a[href='#page3']" ).click();
deepEqual( $.ui.activePage.attr( "id" ), "page1", "Initially #page1 is active" );
$.ui.activePage.find( "a[href='#page3']" ).click();
},

function() {
deepEqual( $.mobile.activePage.attr( "id" ), "page3", "#page3 is active after start(#page1) -> #page3" );
$.mobile.activePage.find( "a[href='#page1']" ).click();
deepEqual( $.ui.activePage.attr( "id" ), "page3", "#page3 is active after start(#page1) -> #page3" );
$.ui.activePage.find( "a[href='#page1']" ).click();
},

function() {
deepEqual( $.mobile.activePage.attr( "id" ), "page1", "#page1 is active after #page3 -> #page1" );
$.mobile.activePage.find( "a[href='#page2']" ).click();
deepEqual( $.ui.activePage.attr( "id" ), "page1", "#page1 is active after #page3 -> #page1" );
$.ui.activePage.find( "a[href='#page2']" ).click();
},

function() {
deepEqual( $.mobile.activePage.attr( "id" ), "page2", "#page2 is active after #page1 -> #page2" );
$.mobile.back();
deepEqual( $.ui.activePage.attr( "id" ), "page2", "#page2 is active after #page1 -> #page2" );
$.ui.back();
},

function() {
deepEqual( $.mobile.activePage.attr( "id" ), "page1", "#page1 is active after #page2 <- Back" );
deepEqual( $.ui.activePage.attr( "id" ), "page1", "#page1 is active after #page2 <- Back" );
start();
}
]);
@@ -2,16 +2,16 @@
* mobile navigation base tag unit tests
*/
(function($){
var baseDir = $.mobile.path.parseUrl($("base").attr("href")).directory,
contentDir = $.mobile.path.makePathAbsolute("../content/", baseDir),
var baseDir = $.ui.path.parseUrl($("base").attr("href")).directory,
contentDir = $.ui.path.makePathAbsolute("../content/", baseDir),
home = location.pathname + location.search,
baseTagEnabled = $.mobile.dynamicBaseTagEnabled,
baseTagEnabled = $.ui.dynamicBaseTagEnabled,
baseTagSupported = $.support.dynamicBaseTag;

module('jquery.mobile.navigation.js - base tag', {
module('jquery.ui.navigation.js - base tag', {
setup: function(){
$.mobile.navigate.history.stack = [];
$.mobile.navigate.history.activeIndex = 0;
$.ui.navigate.history.stack = [];
$.ui.navigate.history.activeIndex = 0;
$.testHelper.navReset( home );
}
});
@@ -90,7 +90,7 @@
});

// Try calling changePage() directly with a relative path.
$.mobile.changePage("base-page-1.html");
$.ui.changePage("base-page-1.html");
},

function(){
@@ -101,7 +101,7 @@
});

// Try calling changePage() directly with a relative path.
$.mobile.changePage("../content/content-page-1.html");
$.ui.changePage("../content/content-page-1.html");
},

function(){
@@ -112,7 +112,7 @@
});

// Try calling changePage() with an id
$.mobile.changePage("content-page-2.html");
$.ui.changePage("content-page-2.html");
},

function(){
@@ -135,7 +135,7 @@
});

// Try calling changePage() with an id
$.mobile.changePage("internal-page-1");
$.ui.changePage("internal-page-1");
},

function(){
@@ -206,7 +206,7 @@
var testBaseTagAlteration = function( assertions ) {
$.testHelper.pageSequence([
function(){
$.mobile.changePage( "../../base-change.html" );
$.ui.changePage( "../../base-change.html" );
},

function(){
@@ -223,20 +223,20 @@

asyncTest( "disabling base tag changes should prevent base href value changes", function() {
var baseHref = $( "base" ).attr( "href" );
$.mobile.dynamicBaseEnabled = false;
$.ui.dynamicBaseEnabled = false;

testBaseTagAlteration(function() {
if ( $.support.dynamicBaseTag ) {
equal( baseHref, $( "base" ).attr( "href" ), "the base href value should be unchanged" );
} else {
equal( $.mobile.activePage.find( "#base-change-link" ).attr( "href" ), "foo", "the link href's remain unchanged" );
equal( $.ui.activePage.find( "#base-change-link" ).attr( "href" ), "foo", "the link href's remain unchanged" );
}
});
});

asyncTest( "enabling base tag changes should enable base href value changes", function() {
var baseHref = $( "base" ).attr( "href" );
$.mobile.dynamicBaseEnabled = true;
$.ui.dynamicBaseEnabled = true;
$.support.dynamicBaseTag = true;

testBaseTagAlteration(function() {
@@ -245,21 +245,21 @@
});

asyncTest( "enabling base tag changes when a dynamic base isn't supported should alter links", function() {
$.mobile.dynamicBaseEnabled = true;
$.ui.dynamicBaseEnabled = true;
$.support.dynamicBaseTag = false;

testBaseTagAlteration(function() {
var linkHref = $.mobile.activePage.find( "#base-change-link" ).attr( "href" );
var linkHref = $.ui.activePage.find( "#base-change-link" ).attr( "href" );

if ( $.support.pushState ) {
equal( linkHref,
$.mobile.path.get( location.href ) + "foo",
$.ui.path.get( location.href ) + "foo",
"the link's href is changed" );
} else {
// compare the pathname of the links href with the directory of the current
// location + foo
equal( $.mobile.path.parseUrl( linkHref ).pathname,
$.mobile.path.parseUrl( location.href ).directory + "foo",
equal( $.ui.path.parseUrl( linkHref ).pathname,
$.ui.path.parseUrl( location.href ).directory + "foo",
"the link's href is changed" );
}
});

Large diffs are not rendered by default.

@@ -2,7 +2,7 @@
* mobile navigation path unit tests
*/
(function($){
var url = $.mobile.path.parseUrl( location.href ),
var url = $.ui.path.parseUrl( location.href ),
home = location.href.replace( url.domain, "" );

var testPageLoad = function(testPageAnchorSelector, expectedTextValue){
@@ -16,7 +16,7 @@

// navigate to the linked page
function(){
var page = $.mobile.activePage;
var page = $.ui.activePage;

// check that the reset page isn't still open
equal("", page.find(".reset-value").text());
@@ -27,7 +27,7 @@

// verify that the page has changed and the expected text value is present
function(){
deepEqual($.mobile.activePage.find(".test-value").text(), expectedTextValue);
deepEqual($.ui.activePage.find(".test-value").text(), expectedTextValue);
start();
}
]);
@@ -5,7 +5,7 @@
var perspective,
transitioning = "ui-mobile-viewport-transitioning",
animationCompleteFn = $.fn.animationComplete,
defaultMaxTrans = $.mobile.maxTransitionWidth,
defaultMaxTrans = $.ui.maxTransitionWidth,

//TODO centralize class names?
transitionTypes = "in out fade slide flip reverse pop",
@@ -21,11 +21,11 @@
},

disableMaxTransWidth = function(){
$.mobile.maxTransitionWidth = false;
$.ui.maxTransitionWidth = false;
},

enableMaxTransWidth = function(){
$.mobile.maxTransitionWidth = defaultMaxTrans;
$.ui.maxTransitionWidth = defaultMaxTrans;
},

//animationComplete callback queue
@@ -48,8 +48,8 @@

//wipe all urls
clearUrlHistory = function(){
$.mobile.urlHistory.stack = [];
$.mobile.urlHistory.activeIndex = 0;
$.ui.urlHistory.stack = [];
$.ui.urlHistory.activeIndex = 0;
};


@@ -59,7 +59,7 @@
perspective = "viewport-flip";
}

module('jquery.mobile.navigation.js', {
module('jquery.ui.navigation.js', {
setup: function(){


@@ -110,7 +110,7 @@

$.testHelper.pageSequence([
function() {
$.mobile.changePage("#foo");
$.ui.changePage("#foo");
},

function() {
@@ -128,7 +128,7 @@
expect(1);
$.testHelper.pageSequence([
function() {
$.mobile.changePage("#baz");
$.ui.changePage("#baz");
},

function() {
@@ -173,8 +173,8 @@
var firstPage = $("#foo"),
secondPage = $("#bar");

$.mobile.changePage(firstPage);
$.mobile.changePage(secondPage);
$.ui.changePage(firstPage);
$.ui.changePage(secondPage);

onToComplete(function(){
ok(isTransitioningIn(firstPage), "first page begins transition");
@@ -214,7 +214,7 @@
function testTransitionMaxWidth( val, expected ){
expect( 1 );

$.mobile.maxTransitionWidth = val;
$.ui.maxTransitionWidth = val;

var transitionOccurred = false;

@@ -228,7 +228,7 @@
start();
}, 5000);

$.mobile.changePage( $(".ui-page:not(.ui-page-active)").first() );
$.ui.changePage( $(".ui-page:not(.ui-page-active)").first() );

}

@@ -10,7 +10,7 @@
<script>
$(document).bind('mobileinit',function(){
// Expect content to inherit this theme when not explicitly set
$.mobile.page.prototype.options.contentTheme = "d";
$.ui.page.prototype.options.contentTheme = "d";
});
</script>
<script src="../../../jquery.setNameSpace.js"></script>
@@ -5,7 +5,7 @@
<script src="../../../../js/"></script>
<script>
(function($) {
var l = $.mobile.path.parseLocation();
var l = $.ui.path.parseLocation();

// Redirect to sequence/index.html in the same directory as this file
location.href = l.protocol + "//" + l.host + l.directory + "index.html" + l.search + "#&ui-state=dialog";
@@ -5,7 +5,7 @@
<script src="../../../../js/"></script>
<script>
(function($) {
var l = $.mobile.path.parseLocation();
var l = $.ui.path.parseLocation();

// Redirect to sequence-tests.html in the same directory as this file
location.href = l.protocol + "//" + l.host + l.directory + "sequence-redirect.html" + l.search + "#" + l.directory + "index.html" + "&ui-state=dialog";
@@ -10,7 +10,7 @@
<script>
$(document).bind('mobileinit',function(){
// Expect content to inherit this theme when not explicitly set
$.mobile.page.prototype.options.contentTheme = "d";
$.ui.page.prototype.options.contentTheme = "d";
});
</script>
<script src="../../../jquery.setNameSpace.js"></script>

Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
( function( $, undefined ) {
module( "jquery.mobile.page" );
module( "jquery.ui.page" );

asyncTest( "Entity in page title", function() {
$.testHelper.pageSequence([
@@ -8,7 +8,7 @@
},

function() {
deepEqual( $.mobile.activePage.attr( "id" ), "title-test", "Title test page is active" );
deepEqual( $.ui.activePage.attr( "id" ), "title-test", "Title test page is active" );
deepEqual( document.title.length > 0, true, "Document title is not empty" );
deepEqual( !!document.title.match(/&([a-zA-Z]+|#([0-9]+|[xX][0-9a-fA-F]+));/), false, "Document title contains no character references" );
},
@@ -3,7 +3,7 @@
*/
(function($){

var urlObject = $.mobile.path.parseLocation(),
var urlObject = $.ui.path.parseLocation(),
home = urlObject.pathname + urlObject.search,
opensAndCloses = function( eventNs, popupId, linkSelector, contentSelector ) {
var $popup = $( document.getElementById( popupId ) ),
@@ -13,9 +13,9 @@

$.testHelper.detailedEventCascade([
function() {
deepEqual( $.mobile.getAttribute( link, "aria-haspopup" ), true, popupId + ": 'aria-haspopup' attribute is set to true on link that opens the popup" );
deepEqual( $.mobile.getAttribute( link, "aria-owns" ), popupId, popupId + ": 'aria-owns' attribute is set to the ID of the owned popup ('test-popup')" );
deepEqual( $.mobile.getAttribute( link, "aria-expanded" ), false, popupId + ": 'aria-expanded' attribute is set to false when the popup is not open" );
deepEqual( $.ui.getAttribute( link, "aria-haspopup" ), true, popupId + ": 'aria-haspopup' attribute is set to true on link that opens the popup" );
deepEqual( $.ui.getAttribute( link, "aria-owns" ), popupId, popupId + ": 'aria-owns' attribute is set to the ID of the owned popup ('test-popup')" );
deepEqual( $.ui.getAttribute( link, "aria-expanded" ), false, popupId + ": 'aria-expanded' attribute is set to false when the popup is not open" );
$popup.popup( "open" );
},

@@ -27,7 +27,7 @@
function( result ) {
var theOffset = $( contentSelector ).offset();

deepEqual( $.mobile.getAttribute( link, "aria-expanded" ), true, popupId + ": 'aria-expanded' attribute is set to true when the popup is open" );
deepEqual( $.ui.getAttribute( link, "aria-expanded" ), true, popupId + ": 'aria-expanded' attribute is set to true when the popup is open" );
ok( !$popup.parent().prev().hasClass( "ui-screen-hidden" ), popupId + ": Open popup screen is not hidden" );
ok( $popup.attr( "class" ).match( /( |^)ui-body-([a-z]|inherit)( |$)/ ), popupId + ": Open popup has a valid theme" );
ok( theOffset.left >= 15 && theOffset.top >= 30, popupId + ": Open popup top left coord is at least (15, 30)" );
@@ -46,7 +46,7 @@
},

function( result) {
deepEqual( $.mobile.getAttribute( link, "aria-expanded" ), false, "'aria-expanded' attribute is set to false when the popup is not open" );
deepEqual( $.ui.getAttribute( link, "aria-expanded" ), false, "'aria-expanded' attribute is set to false when the popup is not open" );
ok( !$popup.parent().hasClass( "in" ), "Closed popup container does not have class 'in'" );
ok( $popup.parent().prev().hasClass( "ui-screen-hidden" ), "Closed popup screen is hidden" );
ok( !$popup.parent().hasClass( "ui-popup-active" ), "Open popup dos not have the 'ui-popup-active' class" );
@@ -57,10 +57,10 @@
]);
};

module( "jquery.mobile.popup.js", {
module( "jquery.ui.popup.js", {
setup: function() {
$.mobile.navigate.history.stack = [];
$.mobile.navigate.history.activeIndex = 0;
$.ui.navigate.history.stack = [];
$.ui.navigate.history.activeIndex = 0;
$.testHelper.navReset( home );
}
});
@@ -72,10 +72,10 @@
$( "#go-to-another-page" ).click();
},
{
pagechange: { src: $.mobile.pageContainer, event: "pagechange" + eventNs + "1" }
pagechange: { src: $.ui.pageContainer, event: "pagechange" + eventNs + "1" }
},
function() {
deepEqual( $.mobile.activePage.attr( "id" ), "another-page", "Reached another page" );
deepEqual( $.ui.activePage.attr( "id" ), "another-page", "Reached another page" );
$( "#open-back-twice-test-popup" ).click();
},
{
@@ -92,15 +92,15 @@
function( result ) {
deepEqual( result.popupafterclose.timedOut, false, "popupafterclose event did arrive" );
deepEqual( result.pagechange.timedOut, true, "pagechange event did not arrive" );
deepEqual( $.mobile.activePage.attr( "id" ), "another-page", "Back to another page" );
$.mobile.back();
deepEqual( $.ui.activePage.attr( "id" ), "another-page", "Back to another page" );
$.ui.back();
},
{
pagechange: { src: $( document ), event: "pagechange" + eventNs + "4" }
},
function( result ) {
deepEqual( result.pagechange.timedOut, false, "pagechange event did arrive" );
deepEqual( $.mobile.activePage.attr( "id" ), "start-page", "Back to start page" );
deepEqual( $.ui.activePage.attr( "id" ), "start-page", "Back to start page" );
start();
}
]);
@@ -176,7 +176,7 @@
asyncTest( "Popup interacts correctly with hashchange", function() {
var baseUrl, activeIndex, $popup = $( "#test-popup" );

if( !$popup.data( "mobile-popup" ).options.history ) {
if( !$popup.data( "ui-popup" ).options.history ) {
expect( 1 );
ok( true, "hash change disabled" );
start();
@@ -188,7 +188,7 @@
$.testHelper.detailedEventCascade([
function() {
baseUrl = decodeURIComponent( location.href );
activeIndex = $.mobile.urlHistory.activeIndex;
activeIndex = $.ui.urlHistory.activeIndex;
$popup.popup( "open" );
},

@@ -199,8 +199,8 @@

function( result ) {
ok( !result.hashchange.timedOut, "Opening a popup from a non-dialogHashKey location causes a hashchange event" );
equal( decodeURIComponent( location.href ), baseUrl + ( ( baseUrl.indexOf( "#" ) > -1 ) ? "" : "#" ) + $.mobile.dialogHashKey, "location.href has been updated correctly" );
ok( $.mobile.urlHistory.activeIndex === activeIndex + 1, "$.mobile.urlHistory has been advanced correctly" );
equal( decodeURIComponent( location.href ), baseUrl + ( ( baseUrl.indexOf( "#" ) > -1 ) ? "" : "#" ) + $.ui.dialogHashKey, "location.href has been updated correctly" );
ok( $.ui.urlHistory.activeIndex === activeIndex + 1, "$.ui.urlHistory has been advanced correctly" );
$( "#test-popup" ).popup( "close" );
},

@@ -210,7 +210,7 @@

function( result ) {
ok( decodeURIComponent( location.href ) === baseUrl, "location.href has been restored after the popup" );
ok( $.mobile.urlHistory.activeIndex === activeIndex, "$.mobile.urlHistory has been restored correctly" );
ok( $.ui.urlHistory.activeIndex === activeIndex, "$.ui.urlHistory has been restored correctly" );
},

{ timeout: { length: 500 } },
@@ -221,12 +221,12 @@
// This test assumes that the popup opens into a state that does not include dialogHashKey.
// This should be the case if the previous test has cleaned up correctly.
asyncTest( "Opening another page from the popup leaves no trace of the popup in history", function() {
var initialActive = $.extend( {}, {}, $.mobile.urlHistory.getActive()),
initialHRef = $.mobile.path.parseUrl( decodeURIComponent( location.href ) ),
var initialActive = $.extend( {}, {}, $.ui.urlHistory.getActive()),
initialHRef = $.ui.path.parseUrl( decodeURIComponent( location.href ) ),
initialBase = initialHRef.protocol + initialHRef.doubleSlash + initialHRef.authority + initialHRef.directory,
$popup = $( "#test-popup" );

if( !$popup.data( "mobile-popup" ).options.history ) {
if( !$popup.data( "ui-popup" ).options.history ) {
expect( 1 )
ok( true, "hash change disabled" );
start();
@@ -255,7 +255,7 @@
},

function( result ) {
var hRef = $.mobile.path.parseUrl( decodeURIComponent( location.href ) );
var hRef = $.ui.path.parseUrl( decodeURIComponent( location.href ) );
ok( !result.closed.timedOut, "Popup closed" );
ok( !result.hashchange.timedOut, "hashchange did occur" );
ok( decodeURIComponent( location.href ) === initialBase + hRef.filename, "New location is exactly the previous location (up to and including path) and the new filename" );
@@ -264,11 +264,11 @@

{
hashchange: { src: $( window ), event: $.event.special.navigate.originalEventName + ".anotherPageStep3" },
pagechange: { src: $.mobile.pageContainer, event: "pagechange.anotherPageStep3" }
pagechange: { src: $.ui.pageContainer, event: "pagechange.anotherPageStep3" }
},

function( result ) {
var active = $.mobile.urlHistory.getActive(),
var active = $.ui.urlHistory.getActive(),
identical = true;

$.each( initialActive, function( key, value ) {
@@ -289,8 +289,8 @@


ok( decodeURIComponent( location.href ) === initialHRef.href, "Going back once places the browser on the initial page" );
ok( identical, "Going back returns $.mobile.urlHistory to its initial value" );
ok( $.mobile.urlHistory.activeIndex === $.mobile.urlHistory.stack.length - 3, "Going back leaves exactly two entries ahead in $.mobile.urlHistory" );
ok( identical, "Going back returns $.ui.urlHistory to its initial value" );
ok( $.ui.urlHistory.activeIndex === $.ui.urlHistory.stack.length - 3, "Going back leaves exactly two entries ahead in $.ui.urlHistory" );
},

{ timeout: { length: 500 } },
@@ -334,7 +334,7 @@
});

asyncTest( "Popup doesn't alter the url when the history option is disabled", function() {
var $popup = $( "#test-history-popup" ), hash = $.mobile.path.parseLocation().hash;
var $popup = $( "#test-history-popup" ), hash = $.ui.path.parseLocation().hash;

$.testHelper.detailedEventCascade([
function() {
@@ -346,7 +346,7 @@
},

function( result ) {
equal( hash, $.mobile.path.parseLocation().hash, "the hash remains the same" );
equal( hash, $.ui.path.parseLocation().hash, "the hash remains the same" );
ok( $popup.is( ":visible" ), "popup is indeed visible" );
$popup.popup( "close" );
},
@@ -376,7 +376,7 @@

function() {
ok( $popup.is( ":visible" ), "popup is indeed visible" );
$.mobile.changePage( "#no-popups" );
$.ui.changePage( "#no-popups" );
},

{
@@ -404,7 +404,7 @@

expect( 3 );

ok( !$popup.data( "mobile-popup" )._isOpen, "popup is initially closed" );
ok( !$popup.data( "ui-popup" )._isOpen, "popup is initially closed" );

$.testHelper.detailedEventCascade([
function() {
@@ -416,7 +416,7 @@
},

function() {
ok( $popup.data( "mobile-popup" )._isOpen, "popup is opened with open method" );
ok( $popup.data( "ui-popup" )._isOpen, "popup is opened with open method" );
$popup.find( "a" ).click();
},

@@ -425,7 +425,7 @@
},

function() {
ok( !$popup.data( "mobile-popup" )._isOpen, "popup is closed on link click" );
ok( !$popup.data( "ui-popup" )._isOpen, "popup is closed on link click" );
},

{ timeout: { length: 500 } },
@@ -488,7 +488,7 @@

function( results ) {
ok( results.popupafterclose.timedOut, "The popup has not emitted a 'popupafterclose' event" );
$.mobile.back();
$.ui.back();
},

{
@@ -1,4 +1,4 @@
$(document).bind("mobileinit", function() {
$.mobile.page.prototype.options.keepNative = "select.should-be-native";
$.ui.page.prototype.options.keepNative = "select.should-be-native";
});

@@ -17,18 +17,18 @@
resetHash,

function(){
$.mobile.changePage( "cached.html" );
$.ui.changePage( "cached.html" );
},

function(){
ok( $.mobile.activePage.is("#dialog-select-parent-cache-test"), "cached page appears" );
ok( $.ui.activePage.is("#dialog-select-parent-cache-test"), "cached page appears" );
selectButton = $( "#cached-page-select" ).siblings( 'a' );
selectButton.click();
},

function(){
ok( $.mobile.activePage.hasClass('ui-dialog'), "the dialog came up" );
var option = $.mobile.activePage.find( "li a" ).not(":contains('" + selectButton.text() + "')").last();
ok( $.ui.activePage.hasClass('ui-dialog'), "the dialog came up" );
var option = $.ui.activePage.find( "li a" ).not(":contains('" + selectButton.text() + "')").last();
value = $.trim(option.text());
option.click();
},
@@ -50,19 +50,19 @@
resetHash,

function(){
$.mobile.changePage( "cached.html" );
$.ui.changePage( "cached.html" );
},

function(){
selectButton = $.mobile.activePage.find( "#cached-page-select" ).siblings( 'a' );
parentPageId = $.mobile.activePage.attr( 'id' );
selectButton = $.ui.activePage.find( "#cached-page-select" ).siblings( 'a' );
parentPageId = $.ui.activePage.attr( 'id' );
deepEqual( $("#" + parentPageId).length, 1, "establish the parent page exists" );
selectButton.click();
},

function(){
deepEqual( $( "#" + parentPageId).length, 1, "make sure parent page is still there after opening the dialog" );
$.mobile.activePage.find( "li a" ).last().click();
$.ui.activePage.find( "li a" ).last().click();
},

start
@@ -76,21 +76,21 @@
resetHash,

function(){
$.mobile.changePage( "cached-dom-cache-true.html" );
$.ui.changePage( "cached-dom-cache-true.html" );
},

function(){
$.mobile.activePage.find( "#domcache-page-select" ).siblings( 'a' ).click();
$.ui.activePage.find( "#domcache-page-select" ).siblings( 'a' ).click();
},

function(){
ok( $.mobile.activePage.hasClass('ui-dialog'), "the dialog came up" );
$.mobile.activePage.find( "li a" ).last().click();
ok( $.ui.activePage.hasClass('ui-dialog'), "the dialog came up" );
$.ui.activePage.find( "li a" ).last().click();
},

function(){
ok( $.mobile.activePage.is( "#dialog-select-parent-domcache-test" ), "the dialog closed" );
$.mobile.changePage( $( "#default" ) );
ok( $.ui.activePage.is( "#dialog-select-parent-domcache-test" ), "the dialog closed" );
$.ui.changePage( $( "#default" ) );
},

function(){
@@ -106,21 +106,21 @@
resetHash,

function(){
$.mobile.changePage( "uncached-dom-cached-false.html" );
$.ui.changePage( "uncached-dom-cached-false.html" );
},

function(){
// for performance reason we don't initially create the menu dialog now
deepEqual( $(":jqmData(role='dialog')").length, dialogCount);

// manually trigger dialog opening
$( "#domcache-uncached-page-select" ).data( 'mobile-selectmenu' ).open();
$( "#domcache-uncached-page-select" ).data( 'ui-selectmenu' ).open();
},

function(){
// check if dialog was successfully created
deepEqual( $(":jqmData(role='dialog')").length, dialogCount + 1 );
$( "#domcache-uncached-page-select" ).data( 'mobile-selectmenu' ).close();
$( "#domcache-uncached-page-select" ).data( 'ui-selectmenu' ).close();
},

function(){
@@ -3,9 +3,9 @@
*/

(function($){
var libName = "jquery.mobile.forms.select",
originalDefaultDialogTrans = $.mobile.defaultDialogTransition,
originalDefTransitionHandler = $.mobile.defaultTransitionHandler,
var libName = "jquery.ui.forms.select",
originalDefaultDialogTrans = $.ui.defaultDialogTransition,
originalDefTransitionHandler = $.ui.defaultTransitionHandler,
originalGetEncodedText = $.fn.getEncodedText,
resetHash, closeDialog;

@@ -14,7 +14,7 @@
};

closeDialog = function(timeout){
$.mobile.activePage.find("li a").first().click();
$.ui.activePage.find("li a").first().click();
};

// Check if two chunks of DOM are identical
@@ -68,18 +68,18 @@
return false;
};

var homeWithSearch = $.mobile.path.parseUrl(location.pathname).pathname + location.search;
var homeWithSearch = $.ui.path.parseUrl(location.pathname).pathname + location.search;

module(libName, {
setup: function() {
$.mobile.navigate.history.stack = [];
$.mobile.navigate.history.activeIndex = 0;
$.ui.navigate.history.stack = [];
$.ui.navigate.history.activeIndex = 0;
$.testHelper.navReset( homeWithSearch );
},

teardown: function(){
$.mobile.defaultDialogTransition = originalDefaultDialogTrans;
$.mobile.defaultTransitionHandler = originalDefTransitionHandler;
$.ui.defaultDialogTransition = originalDefaultDialogTrans;
$.ui.defaultTransitionHandler = originalDefTransitionHandler;

$.fn.getEncodedText = originalGetEncodedText;
window.encodedValueIsDefined = undefined;
@@ -149,11 +149,11 @@
select = $("#select-choice-many-container-1 a");

//set to something else
$.mobile.defaultTransitionHandler = $.testHelper.decorate({
fn: $.mobile.defaultTransitionHandler,
$.ui.defaultTransitionHandler = $.testHelper.decorate({
fn: $.ui.defaultTransitionHandler,

before: function(name){
deepEqual(name, $.mobile.defaultDialogTransition);
deepEqual(name, $.ui.defaultDialogTransition);
}
});

@@ -212,10 +212,10 @@

module("Non native menus", {
setup: function() {
$.mobile.selectmenu.prototype.options.nativeMenu = false;
$.ui.selectmenu.prototype.options.nativeMenu = false;
},
teardown: function() {
$.mobile.selectmenu.prototype.options.nativeMenu = true;
$.ui.selectmenu.prototype.options.nativeMenu = true;
}
});

@@ -305,7 +305,7 @@

function(){
var firstMenuChoice = $("#select-choice-few\\.dotTest-menu li:first a");
ok( firstMenuChoice.hasClass( $.mobile.activeBtnClass ),
ok( firstMenuChoice.hasClass( $.ui.activeBtnClass ),
"default menu choice has the active button class" );

$("#select-choice-few\\.dotTest-menu a:last").click();
@@ -318,7 +318,7 @@

function(){
var lastMenuChoice = $("#select-choice-few\\.dotTest-menu li:last a");
ok( lastMenuChoice.hasClass( $.mobile.activeBtnClass ),
ok( lastMenuChoice.hasClass( $.ui.activeBtnClass ),
"previously selected item has the active button class" );

// close the dialog
@@ -368,7 +368,7 @@

// issue #2547
test( "custom select list item links have encoded option text values", function() {
$( "#encoded-option" ).data( 'mobile-selectmenu' )._buildList();
$( "#encoded-option" ).data( 'ui-selectmenu' )._buildList();
deepEqual(window.encodedValueIsDefined, undefined);
});

@@ -388,7 +388,7 @@
},

function() {
deepEqual($.mobile.activePage.find( ".ui-title" ).text(), $label.text());
deepEqual($.ui.activePage.find( ".ui-title" ).text(), $label.text());
window.history.back();
},

@@ -407,26 +407,26 @@
$button.click();
},

{ pagechange: { src: $.mobile.pageContainer, event: "pagechange.dialogSizeSelectTitleMod1" } },
{ pagechange: { src: $.ui.pageContainer, event: "pagechange.dialogSizeSelectTitleMod1" } },

function() {
deepEqual($.mobile.activePage.find( ".ui-title" ).text(), $label.text());
deepEqual($.ui.activePage.find( ".ui-title" ).text(), $label.text());
window.history.back();
},

{ pagechange: { src: $.mobile.pageContainer, event: "pagechange.dialogSizeSelectTitleMod2" } },
{ pagechange: { src: $.ui.pageContainer, event: "pagechange.dialogSizeSelectTitleMod2" } },

start
]);
});

asyncTest( "destroying a select menu leaves no traces", function() {
$.testHelper.pageSequence( [
function() { $.mobile.changePage( "#destroyTest" ); },
function() { $.ui.changePage( "#destroyTest" ); },
// Check if two chunks of DOM are identical
function() {
var unenhancedSelect = $(
"<select data-" + ( $.mobile.ns || "" ) + "native-menu='true'>" +
"<select data-" + ( $.ui.ns || "" ) + "native-menu='true'>" +
"<option>Title</option>" +
"<option value='option1'>Option 1</option>" +
"<option value='option2'>Option 2</option>" +
@@ -441,7 +441,7 @@
deepEqual( $( "#destroyTest" ).children().length, 0, "After adding, enhancing, destroying, and removing the select menu, the page is empty" );
ok( domEqual( unenhancedSelect, unenhancedSelectClone ), "DOM for select after enhancement/destruction is equal to DOM for unenhanced select" );
},
function() { $.mobile.back(); },
function() { $.ui.back(); },

start
]);
@@ -454,18 +454,18 @@
prefix = ".destroyingASelectMenuLeavesNoTraces",
id = "select-" + Math.round( Math.random() * 1177 ),
unenhancedSelect = $(
"<select id='" + id + "' data-" + ( $.mobile.ns || "" ) + "native-menu='false'>" +
"<select id='" + id + "' data-" + ( $.ui.ns || "" ) + "native-menu='false'>" +
"<option>Title</option>" +
"<option value='option1'>Option 1</option>" +
"<option value='option2'>Option 2</option>" +
"</select>");
$.testHelper.detailedEventCascade( [
function() {
$.mobile.changePage( "#destroyTest" );
$.ui.changePage( "#destroyTest" );
},

{
pagechange: { src: $.mobile.pageContainer, event: "pagechange" + prefix + "0" }
pagechange: { src: $.ui.pageContainer, event: "pagechange" + prefix + "0" }
},

function() {
@@ -477,7 +477,7 @@
},

{
popupafteropen: { src: $.mobile.document, event: "popupafteropen" + prefix + "1" }
popupafteropen: { src: $.ui.document, event: "popupafteropen" + prefix + "1" }
},

function( result ) {
@@ -486,7 +486,7 @@
},

{
popupafterclose: { src: $.mobile.document, event: "popupafterclose" + prefix + "2" }
popupafterclose: { src: $.ui.document, event: "popupafterclose" + prefix + "2" }
},

function( result ) {
@@ -512,16 +512,16 @@
},

{
pagechange: { src: $.mobile.pageContainer, event: "pagechange" + prefix + "3" }
pagechange: { src: $.ui.pageContainer, event: "pagechange" + prefix + "3" }
},

function() {
// Close the dialog
$.mobile.activePage.find( "a:first" ).click();
$.ui.activePage.find( "a:first" ).click();
},

{
pagechange: { src: $.mobile.pageContainer, event: "pagechange" + prefix + "4" }
pagechange: { src: $.ui.pageContainer, event: "pagechange" + prefix + "4" }
},

function() {
@@ -531,11 +531,11 @@
deepEqual( $( "#destroyTest" ).children().length, 0, "After adding, enhancing, opening, destroying, and removing the dialog-sized select menu, the page is empty" );
ok( domEqual( unenhancedSelect, unenhancedSelectClone ), "DOM for select after enhancement/destruction is equal to DOM for unenhanced select" );
deepEqual( $( "#" + id + "-dialog" ).length, 0, "After adding, enhancing, opening, destroying, and removing the dialog-sized select menu, no dialog page is left behind" );
$.mobile.back();
$.ui.back();
},

{
pagechange: { src: $.mobile.pageContainer, event: "pagechange" + prefix + "5" }
pagechange: { src: $.ui.pageContainer, event: "pagechange" + prefix + "5" }
},

start
@@ -3,10 +3,10 @@
*/

(function($){
var libName = "jquery.mobile.forms.select";
var libName = "jquery.ui.forms.select";

$(document).bind('mobileinit', function(){
$.mobile.selectmenu.prototype.options.nativeMenu = false;
$.ui.selectmenu.prototype.options.nativeMenu = false;
});

module(libName,{
@@ -3,7 +3,7 @@
*/

(function($){
module("jquery.mobile.forms.select native");
module("jquery.ui.forms.select native");

test( "native menu selections alter the button text", function(){
var select = $( "#native-select-choice-few" ), setAndCheck;
@@ -30,17 +30,17 @@

asyncTest( "The preventFocusZoom option is working as expected", function() {

var zoomoptiondefault = $.mobile.selectmenu.prototype.options.preventFocusZoom;
$.mobile.selectmenu.prototype.options.preventFocusZoom = true;
var zoomoptiondefault = $.ui.selectmenu.prototype.options.preventFocusZoom;
$.ui.selectmenu.prototype.options.preventFocusZoom = true;

$(document)
.one("vmousedown.test", function(){
ok( $.mobile.zoom.enabled === false, "zoom is disabled on vmousedown" );
ok( $.ui.zoom.enabled === false, "zoom is disabled on vmousedown" );
})
.one("mouseup.test", function(){
setTimeout(function() { // This empty setTimeout is to match the work-around for the issue reported in https://github.com/jquery/jquery-mobile/issues/5041
ok( $.mobile.zoom.enabled === true, "zoom is enabled on mouseup" );
$.mobile.selectmenu.prototype.options.preventFocusZoom = zoomoptiondefault;
ok( $.ui.zoom.enabled === true, "zoom is enabled on mouseup" );
$.ui.selectmenu.prototype.options.preventFocusZoom = zoomoptiondefault;
$(document).unbind(".test");
$( "#select-choice-native" ).selectmenu( "option", "preventFocusZoom", zoomoptiondefault );
start();
@@ -56,16 +56,16 @@

asyncTest( "The preventFocusZoom option does not manipulate zoom when it is false", function() {

var zoomstate = $.mobile.zoom.enabled,
zoomoptiondefault = $.mobile.selectmenu.prototype.options.preventFocusZoom;
var zoomstate = $.ui.zoom.enabled,
zoomoptiondefault = $.ui.selectmenu.prototype.options.preventFocusZoom;


$(document)
.one("vmousedown.test", function(){
ok( $.mobile.zoom.enabled === zoomstate, "zoom is unaffected on vmousedown" );
ok( $.ui.zoom.enabled === zoomstate, "zoom is unaffected on vmousedown" );
})
.one("mouseup.test", function(){
ok( $.mobile.zoom.enabled === zoomstate, "zoom is unaffected on mouseup" );
ok( $.ui.zoom.enabled === zoomstate, "zoom is unaffected on mouseup" );
$(document).unbind(".test");
$( "#select-choice-native" ).selectmenu( "option", "preventFocusZoom", zoomoptiondefault );
start();
@@ -1,4 +1,4 @@
//set namespace for unit test markp
jQuery( document ).bind( "mobileinit", function(){
jQuery.mobile.ns = "nstest-";
jQuery.ui.ns = "nstest-";
});
@@ -52,8 +52,8 @@
setPushState: function() {
if( $.support.pushState && location.search.indexOf( "push-state" ) >= 0 ) {
$.support.pushState = false;
$.mobile.window.unbind( "popstate.navigate" );
$.mobile.window.unbind( "popstate.hashchange" );
$.ui.window.unbind( "popstate.navigate" );
$.ui.window.unbind( "popstate.hashchange" );
$.event.special.navigate.bound = false;
$.event.special.navigate.setup();
}
@@ -62,7 +62,7 @@
setPageTransition: function() {
if( location.search.indexOf( "transition=none" ) >= 0 ) {
$( document ).bind( 'mobileinit', function() {
$.mobile.defaultPageTransition = "none";
$.ui.defaultPageTransition = "none";
});
}
},
@@ -212,7 +212,7 @@
}, 2000);

// bind the recursive call to the event
( self.eventTarget || $.mobile.pageContainer ).one(event, function( event, data ) {
( self.eventTarget || $.ui.pageContainer ).one(event, function( event, data ) {
clearTimeout( warnTimer );

// Let the current stack unwind before we fire off the next item in the sequence.
@@ -373,7 +373,7 @@
},

assertUrlLocation: function( args ) {
var parts = $.mobile.path.parseUrl( location.href ),
var parts = $.ui.path.parseUrl( location.href ),
pathnameOnward = location.href.replace( parts.domain, "" );

if( $.support.pushState ) {
@@ -2,7 +2,7 @@
* mobile buttonMarkup tests
*/
(function($){
module("jquery.mobile.buttonMarkup.js");
module("jquery.ui.buttonMarkup.js");

test( "control group buttons should respect theme-related data attributes", function(){
var group = $("#control-group-content");
@@ -2,7 +2,7 @@
* mobile button unit tests
*/
(function($){
$.mobile.page.prototype.options.keepNative = "button.should-be-native";
$.ui.page.prototype.options.keepNative = "button.should-be-native";

test( "button elements in the keepNative set shouldn't be enhanced", function() {
deepEqual( $("button.should-be-native").siblings("div.ui-slider").length, 0 );
@@ -2,7 +2,7 @@
* mobile checkboxradio unit tests
*/
(function($){
module( 'jquery.mobile.forms.checkboxradio.js' );
module( 'jquery.ui.forms.checkboxradio.js' );

test( "widget can be disabled and enabled", function(){
var input = $( "#checkbox-1" ),
@@ -72,7 +72,7 @@
ok( $("#enhancetest").trigger("create").find(".ui-checkbox").length, "enhancements applied" );
});

$.mobile.page.prototype.options.keepNative = "input.should-be-native";
$.ui.page.prototype.options.keepNative = "input.should-be-native";

// not testing the positive case here since's it's obviously tested elsewhere
test( "checkboxradio elements in the keepNative set shouldn't be enhanced", function() {
@@ -132,7 +132,7 @@ $.testHelper.delayStart();
var $unenhancedFieldSet = $( "#unenhanced-fieldset" ),
$enhancedFieldSet = $( "#enhanced-fieldset" );

$.mobile.ignoreContentEnabled = true;
$.ui.ignoreContentEnabled = true;

// attempt to enhance the controlgroup
$unenhancedFieldSet.parent().trigger("create");
@@ -146,7 +146,7 @@ $.testHelper.delayStart();
deepEqual( $enhancedFieldSet.length, 1, "the fieldset test fixtures exist" );
ok( $enhancedFieldSet.is(".ui-controlgroup"), "there is a control group" );

$.mobile.ignoreContentEnabled = false;
$.ui.ignoreContentEnabled = false;
});

test( "calling .controlgroup() again is the same as calling .controlgroup( 'refresh' )", function() {
@@ -6,14 +6,14 @@
var libName = "jquery.mobile.core",
setGradeA = function(value, version) {
$.support.mediaquery = value;
$.mobile.browser.ie = version;
$.ui.browser.ie = version;
},
extendFn = $.extend,
ns = $.mobile.ns;
ns = $.ui.ns;

module(libName, {
setup: function(){
$.mobile.ns = ns;
$.ui.ns = ns;

// NOTE reset for gradeA tests
$('html').removeClass('ui-mobile');
@@ -35,7 +35,7 @@
},

function() {
ok(!$.mobile.gradeA());
ok(!$.ui.gradeA());
},

function() {
@@ -44,7 +44,7 @@
},

function() {
ok($.mobile.gradeA());
ok($.ui.gradeA());
start();
}
]);
@@ -53,41 +53,41 @@

function clearNSNormalizeDictionary()
{
var dict = $.mobile.nsNormalizeDict;
var dict = $.ui.nsNormalizeDict;
for ( var prop in dict ) {
delete dict[ prop ];
}
}

test( "$.mobile.nsNormalize works properly with namespace defined (test default)", function(){
test( "$.ui.nsNormalize works properly with namespace defined (test default)", function(){
// Start with a fresh namespace property cache, just in case
// the previous test mucked with namespaces.
clearNSNormalizeDictionary();

equal($.mobile.nsNormalize("foo"), "nstestFoo", "appends ns and initcaps");
equal($.mobile.nsNormalize("fooBar"), "nstestFooBar", "leaves capped strings intact");
equal($.mobile.nsNormalize("foo-bar"), "nstestFooBar", "changes dashed strings");
equal($.mobile.nsNormalize("foo-bar-bak"), "nstestFooBarBak", "changes multiple dashed strings");
equal($.ui.nsNormalize("foo"), "nstestFoo", "appends ns and initcaps");
equal($.ui.nsNormalize("fooBar"), "nstestFooBar", "leaves capped strings intact");
equal($.ui.nsNormalize("foo-bar"), "nstestFooBar", "changes dashed strings");
equal($.ui.nsNormalize("foo-bar-bak"), "nstestFooBarBak", "changes multiple dashed strings");

// Reset the namespace property cache for the next test.
clearNSNormalizeDictionary();
});

test( "$.mobile.nsNormalize works properly with an empty namespace", function(){
var realNs = $.mobile.ns;
test( "$.ui.nsNormalize works properly with an empty namespace", function(){
var realNs = $.ui.ns;

$.mobile.ns = "";
$.ui.ns = "";

// Start with a fresh namespace property cache, just in case
// the previous test mucked with namespaces.
clearNSNormalizeDictionary();

equal($.mobile.nsNormalize("foo"), "foo", "leaves uncapped and undashed");
equal($.mobile.nsNormalize("fooBar"), "fooBar", "leaves capped strings intact");
equal($.mobile.nsNormalize("foo-bar"), "fooBar", "changes dashed strings");
equal($.mobile.nsNormalize("foo-bar-bak"), "fooBarBak", "changes multiple dashed strings");
equal($.ui.nsNormalize("foo"), "foo", "leaves uncapped and undashed");
equal($.ui.nsNormalize("fooBar"), "fooBar", "leaves capped strings intact");
equal($.ui.nsNormalize("foo-bar"), "fooBar", "changes dashed strings");
equal($.ui.nsNormalize("foo-bar-bak"), "fooBarBak", "changes multiple dashed strings");

$.mobile.ns = realNs;
$.ui.ns = realNs;

// Reset the namespace property cache for the next test.
clearNSNormalizeDictionary();
@@ -101,7 +101,7 @@

deepEqual( $("body").jqmData("foo"), true, "getting data returns the right value" );

deepEqual( $("body").data($.mobile.nsNormalize("foo")), true, "data was set using namespace" );
deepEqual( $("body").data($.ui.nsNormalize("foo")), true, "data was set using namespace" );

deepEqual( $("body").jqmData("foo", undefined), true, "getting data still returns the value if there's an undefined second arg" );

@@ -127,7 +127,7 @@

deepEqual( $.jqmData(document.body, "foo"), true, "getting data returns the right value" );

deepEqual( $.data(document.body, $.mobile.nsNormalize("foo")), true, "data was set using namespace" );
deepEqual( $.data(document.body, $.ui.nsNormalize("foo")), true, "data was set using namespace" );

deepEqual( $.jqmData(document.body, "foo", undefined), true, "getting data still returns the value if there's an undefined second arg" );

@@ -165,19 +165,19 @@
test( "closestPageData returns the parent's page data", function() {
var pageChild = $( "#page-child" );

$( "#parent-page" ).data( "mobile-page", { foo: "bar" } );
deepEqual( $.mobile.closestPageData( pageChild ).foo, "bar" );
$( "#parent-page" ).data( "ui-page", { foo: "bar" } );
deepEqual( $.ui.closestPageData( pageChild ).foo, "bar" );
});

test( "closestPageData returns the parent dialog's page data", function() {
var dialogChild = $( "#dialog-child" );

$( "#parent-dialog" ).data( "mobile-page", { foo: "bar" } );
deepEqual( $.mobile.closestPageData(dialogChild).foo, "bar" );
$( "#parent-dialog" ).data( "ui-page", { foo: "bar" } );
deepEqual( $.ui.closestPageData(dialogChild).foo, "bar" );
});

test( "test that $.fn.jqmHijackable works", function() {
$.mobile.ignoreContentEnabled = true;
$.ui.ignoreContentEnabled = true;

deepEqual( $( "#hijacked-link" ).jqmHijackable().length, 1,
"a link without any association to data-ajax=false should be included");
@@ -188,6 +188,6 @@
deepEqual( $( "#unhijacked-link-by-attr" ).jqmHijackable().length, 0,
"a link with data-ajax=false should be excluded");

$.mobile.ignoreContentEnabled = false;
$.ui.ignoreContentEnabled = false;
});
})(jQuery);
@@ -3,7 +3,7 @@
*/

(function($){
module('jquery.mobile.degradeInputs.js');
module('jquery.ui.degradeInputs.js');

test('keepNative elements should not be degraded', function() {
deepEqual($('input#not-to-be-degraded').attr("type"), "range");
@@ -5,6 +5,6 @@
test( "When the page loads, any dialogs in the page should be initialized", function() {
expect( 1 );

ok( $( "#foo-dialog" ).is( ".ui-dialog" ), "When a dialog is the first element in a page, it is created as a dialog widget." );
ok( $( "#foo-dialog" ).is( ".mobile-dialog" ), "When a dialog is the first element in a page, it is created as a dialog widget." );
});
})( jQuery );
@@ -10,7 +10,7 @@
<script>
$(document).bind('mobileinit',function(){
// Expect content to inherit this theme when not explicitly set
$.mobile.page.prototype.options.contentTheme = "d";
$.ui.page.prototype.options.contentTheme = "d";
});
</script>
<script src="../../jquery.setNameSpace.js"></script>
@@ -3,7 +3,7 @@
*/

(function($){
var libName = "jquery.mobile.events.js",
var libName = "jquery.ui.events.js",
components = [ "events/touch.js", "events/throttledresize.js", "events/orientationchange.js" ],
absFn = Math.abs,
originalEventFn = $.Event.prototype.originalEvent,
@@ -28,7 +28,7 @@
// the collections existence in non touch enabled test browsers
$.Event.prototype.touches = [{pageX: 1, pageY: 1 }];

$($.mobile.pageContainer).unbind( "throttledresize" );
$($.ui.pageContainer).unbind( "throttledresize" );
}
});

@@ -132,7 +132,7 @@

var forceTouchSupport = function(){
document.ontouchend = function() {};
$.testHelper.reloadLib( "jquery.mobile.support.touch.js" );
$.testHelper.reloadLib( "jquery.ui.support.touch.js" );
$.each( components, function( index, value ) { $.testHelper.reloadLib( value ); });

//mock originalEvent information
@@ -519,7 +519,7 @@
}
]);

$.mobile.pageContainer
$.ui.pageContainer
.trigger( "resize" )
.trigger( "resize" )
.trigger( "resize" );
@@ -2,7 +2,7 @@
* mobile dialog unit tests
*/
(function($){
module('jquery.mobile.fieldContain.js');
module('jquery.ui.fieldContain.js');

test( "Field container will create when inside a container that receives a 'create' event", function(){
ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-field-contain").length, "did not have enhancements applied" );
@@ -12,14 +12,14 @@
test( "field containers inside ignore container should not be enhanced", function() {
var $ignored = $( "#ignored-fieldcontain" ), $enhanced = $( "#enhanced-fieldcontain" );

$.mobile.ignoreContentEnabled = true;
$.ui.ignoreContentEnabled = true;

$( "#ignore-container-tests" ).trigger( "create" );

deepEqual( $ignored.attr( "class" ), undefined, "ignored div does not have field contain class" );
ok( $enhanced.hasClass( "ui-field-contain" ), "enhanced div has field contain class" );

$.mobile.ignoreContentEnabled = false;
$.ui.ignoreContentEnabled = false;

});
})(jQuery);
@@ -2,7 +2,7 @@
* mobile Fixed Toolbar unit tests
*/
(function($){
module('jquery.mobile.toolbar.js');
module('jquery.ui.toolbar.js');

test( "Fixed Header Structural Classes are applied correctly", function(){
//footer
@@ -21,40 +21,40 @@
});

test( "User zooming is disabled when the header is visible and disablePageZoom is true", function(){
$.mobile.zoom.enable();
var defaultZoom = $.mobile.toolbar.prototype.options.disablePageZoom;
$.ui.zoom.enable();
var defaultZoom = $.ui.toolbar.prototype.options.disablePageZoom;
$( ".ui-page-active .ui-header-fixed" ).toolbar("option", "disablePageZoom", true );

$( ".ui-page-active" ).trigger( "pagebeforeshow" );
ok( !$.mobile.zoom.enabled, "Viewport scaling is disabled before page show." );
ok( !$.ui.zoom.enabled, "Viewport scaling is disabled before page show." );
$( ".ui-page-active .ui-header-fixed" ).toolbar("option", "disablePageZoom", defaultZoom );
$.mobile.zoom.enable();
$.ui.zoom.enable();
});

test( "Meta viewport content is restored to previous state, and zooming renabled, after pagebeforehide", function(){
$.mobile.zoom.enable( true );
var defaultZoom = $.mobile.toolbar.prototype.options.disablePageZoom;
$.ui.zoom.enable( true );
var defaultZoom = $.ui.toolbar.prototype.options.disablePageZoom;
$( ".ui-page-active .ui-header-fixed" ).toolbar("option", "disablePageZoom", true );

$( ".ui-page-active" ).trigger( "pagebeforeshow" );
ok( !$.mobile.zoom.enabled, "Viewport scaling is disabled before page show." );
ok( !$.ui.zoom.enabled, "Viewport scaling is disabled before page show." );
$( ".ui-page-active" ).trigger( "pagebeforehide" );
ok( $.mobile.zoom.enabled, "Viewport scaling is enabled." );
ok( $.ui.zoom.enabled, "Viewport scaling is enabled." );
$( ".ui-page-active .ui-header-fixed" ).toolbar("option", "disablePageZoom", defaultZoom );
$.mobile.zoom.enable( true );
$.ui.zoom.enable( true );
});

test( "User zooming is not disabled when the header is visible and disablePageZoom is false", function(){
$.mobile.zoom.enable( true );
var defaultZoom = $.mobile.toolbar.prototype.options.disablePageZoom;
$.ui.zoom.enable( true );
var defaultZoom = $.ui.toolbar.prototype.options.disablePageZoom;
$( ".ui-page :jqmData(position='fixed')" ).toolbar( "option", "disablePageZoom", false );

$( ".ui-page-active" ).trigger( "pagebeforeshow" );

ok( $.mobile.zoom.enabled, "Viewport scaling is not disabled before page show." );
ok( $.ui.zoom.enabled, "Viewport scaling is not disabled before page show." );

$( ".ui-page :jqmData(position='fixed')" ).toolbar( "option", "disablePageZoom", defaultZoom );

$.mobile.zoom.enable( true );
$.ui.zoom.enable( true );
});
})(jQuery);