Skip to content

Commit 4102df9

Browse files
committed
Merge branch 'master' of https://github.com/jquery/jquery-mobile
2 parents da2b8ba + 64a5786 commit 4102df9

File tree

7 files changed

+100
-87
lines changed

7 files changed

+100
-87
lines changed

docs/_assets/css/jqm-docs.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ p.intro strong {
8989
background-image: -webkit-gradient(linear,left top,left bottom,
9090
color-stop(0, #74b042),
9191
color-stop(1, #56A00E));
92-
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#81a8ce', EndColorStr='#5e87b0')";
92+
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#74b042', EndColorStr='#56A00E')";
9393
}
9494
.ui-bar-f,
9595
.ui-bar-f .ui-link-inherit {

docs/content/content-collapsible-set.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h2>Collapsible set markup</h2>
4040
&lt;p&gt;I&#x27;m the collapsible set content for section B.&lt;/p&gt;
4141
&lt;/div&gt;
4242

43-
&lt;div&gt;
43+
&lt;/div&gt;
4444
</code></pre>
4545

4646

docs/pages/docs-pages.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ <h2>Mobile page structure</h2>
3535
&lt;html&gt;
3636
&lt;head&gt;
3737
&lt;title&gt;Page Title&lt;/title&gt;
38+
39+
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
40+
3841
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css&quot; /&gt;
3942
&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-1.6.1.min.js&quot;&gt;&lt;/script&gt;
4043
&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js&quot;&gt;&lt;/script&gt;
@@ -46,6 +49,8 @@ <h2>Mobile page structure</h2>
4649
&lt;/body&gt;
4750
&lt;/html&gt;
4851
</code></pre>
52+
53+
<p>Note that you should also include a meta <code>viewport</code> tag in the <code>head</code> to specify how the browser should display your page zoom level and dimensions. If this isn't set, many mobile browsers will use a "virtual" page width around 900 pixels to make it work well with exisitng desktop sites but the screens may look zoomed out and too wide. By setting the <code>content=&quot;width=device-width, initial-scale=1</code> in the code example above, the width will be set to the pixel width of the device screen. These settings do not disable the user's ability to zoom the pages which is nice from an accessibility perspective. There is a minor issue in iOS that doesn't properly set the width when changing orientations with these viewport settings, but this will hopefully be fixed a a future release. You can set other viewport values to disable zooming if required since this is part of your page content, not the library. </p>
4954

5055
<p>Inside the <code>&lt;body&gt;</code> tag, each view or "page" on the mobile device is identified with an element (usually a <code>div</code>) with the <code> data-role="page"</code> attribute:</p>
5156

@@ -77,6 +82,9 @@ <h2>Complete single page template</h2>
7782
&lt;html&gt;
7883
&lt;head&gt;
7984
&lt;title&gt;Page Title&lt;/title&gt;
85+
86+
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
87+
8088
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css&quot; /&gt;
8189
&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-1.6.1.min.js&quot;&gt;&lt;/script&gt;
8290
&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js&quot;&gt;&lt;/script&gt;

js/jquery.mobile.buttonMarkup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ $.fn.buttonMarkup = function( options ) {
4040

4141
iconClass = "ui-icon " + o.icon;
4242

43-
if ( o.shadow ) {
43+
if ( o.iconshadow ) {
4444
iconClass += " ui-icon-shadow";
4545
}
4646
}

js/jquery.mobile.navigation.js

Lines changed: 87 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -612,16 +612,19 @@
612612
$.mobile.showPageLoadingMsg();
613613
}
614614

615-
// Load the new page.
616-
$.ajax({
617-
url: fileUrl,
618-
type: settings.type,
619-
data: settings.data,
620-
dataType: "html",
621-
success: function( html ) {
622-
//pre-parse html to check for a data-url,
623-
//use it as the new fileUrl, base path, etc
624-
var all = $( "<div></div>" ),
615+
if ( !( $.mobile.allowCrossDomainPages || path.isSameDomain( documentUrl, absUrl ) ) ) {
616+
deferred.reject( absUrl, options );
617+
} else {
618+
// Load the new page.
619+
$.ajax({
620+
url: fileUrl,
621+
type: settings.type,
622+
data: settings.data,
623+
dataType: "html",
624+
success: function( html ) {
625+
//pre-parse html to check for a data-url,
626+
//use it as the new fileUrl, base path, etc
627+
var all = $( "<div></div>" ),
625628

626629
//page title regexp
627630
newPageTitle = html.match( /<title[^>]*>([^<]*)/ ) && RegExp.$1,
@@ -631,90 +634,91 @@
631634
dataUrlRegex = new RegExp( "\\bdata-" + $.mobile.ns + "url=[\"']?([^\"'>]*)[\"']?" );
632635

633636

634-
// data-url must be provided for the base tag so resource requests can be directed to the
635-
// correct url. loading into a temprorary element makes these requests immediately
636-
if( pageElemRegex.test( html )
637-
&& RegExp.$1
638-
&& dataUrlRegex.test( RegExp.$1 )
639-
&& RegExp.$1 ) {
640-
url = fileUrl = path.getFilePath( RegExp.$1 );
641-
}
637+
// data-url must be provided for the base tag so resource requests can be directed to the
638+
// correct url. loading into a temprorary element makes these requests immediately
639+
if( pageElemRegex.test( html )
640+
&& RegExp.$1
641+
&& dataUrlRegex.test( RegExp.$1 )
642+
&& RegExp.$1 ) {
643+
url = fileUrl = path.getFilePath( RegExp.$1 );
644+
}
642645

643-
if ( base ) {
644-
base.set( fileUrl );
645-
}
646+
if ( base ) {
647+
base.set( fileUrl );
648+
}
646649

647-
//workaround to allow scripts to execute when included in page divs
648-
all.get( 0 ).innerHTML = html;
649-
page = all.find( ":jqmData(role='page'), :jqmData(role='dialog')" ).first();
650+
//workaround to allow scripts to execute when included in page divs
651+
all.get( 0 ).innerHTML = html;
652+
page = all.find( ":jqmData(role='page'), :jqmData(role='dialog')" ).first();
650653

651-
if ( newPageTitle && !page.jqmData( "title" ) ) {
652-
page.jqmData( "title", newPageTitle );
653-
}
654+
if ( newPageTitle && !page.jqmData( "title" ) ) {
655+
page.jqmData( "title", newPageTitle );
656+
}
654657

655-
//rewrite src and href attrs to use a base url
656-
if( !$.support.dynamicBaseTag ) {
657-
var newPath = path.get( fileUrl );
658-
page.find( "[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]" ).each(function() {
659-
var thisAttr = $( this ).is( '[href]' ) ? 'href' :
660-
$(this).is('[src]') ? 'src' : 'action',
661-
thisUrl = $( this ).attr( thisAttr );
662-
663-
// XXX_jblas: We need to fix this so that it removes the document
664-
// base URL, and then prepends with the new page URL.
665-
//if full path exists and is same, chop it - helps IE out
666-
thisUrl = thisUrl.replace( location.protocol + '//' + location.host + location.pathname, '' );
667-
668-
if( !/^(\w+:|#|\/)/.test( thisUrl ) ) {
669-
$( this ).attr( thisAttr, newPath + thisUrl );
670-
}
671-
});
672-
}
658+
//rewrite src and href attrs to use a base url
659+
if( !$.support.dynamicBaseTag ) {
660+
var newPath = path.get( fileUrl );
661+
page.find( "[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]" ).each(function() {
662+
var thisAttr = $( this ).is( '[href]' ) ? 'href' :
663+
$(this).is('[src]') ? 'src' : 'action',
664+
thisUrl = $( this ).attr( thisAttr );
665+
666+
// XXX_jblas: We need to fix this so that it removes the document
667+
// base URL, and then prepends with the new page URL.
668+
//if full path exists and is same, chop it - helps IE out
669+
thisUrl = thisUrl.replace( location.protocol + '//' + location.host + location.pathname, '' );
670+
671+
if( !/^(\w+:|#|\/)/.test( thisUrl ) ) {
672+
$( this ).attr( thisAttr, newPath + thisUrl );
673+
}
674+
});
675+
}
673676

674-
//append to page and enhance
675-
page
676-
.attr( "data-" + $.mobile.ns + "url", path.convertUrlToDataUrl( fileUrl ) )
677-
.appendTo( settings.pageContainer );
677+
//append to page and enhance
678+
page
679+
.attr( "data-" + $.mobile.ns + "url", path.convertUrlToDataUrl( fileUrl ) )
680+
.appendTo( settings.pageContainer );
678681

679-
enhancePage( page, settings.role );
682+
enhancePage( page, settings.role );
680683

681-
// Enhancing the page may result in new dialogs/sub pages being inserted
682-
// into the DOM. If the original absUrl refers to a sub-page, that is the
683-
// real page we are interested in.
684-
if ( absUrl.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ) {
685-
page = settings.pageContainer.children( ":jqmData(url='" + dataUrl + "')" );
686-
}
684+
// Enhancing the page may result in new dialogs/sub pages being inserted
685+
// into the DOM. If the original absUrl refers to a sub-page, that is the
686+
// real page we are interested in.
687+
if ( absUrl.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ) {
688+
page = settings.pageContainer.children( ":jqmData(url='" + dataUrl + "')" );
689+
}
687690

688-
// Remove loading message.
689-
if ( settings.showLoadMsg ) {
690-
$.mobile.hidePageLoadingMsg();
691-
}
691+
// Remove loading message.
692+
if ( settings.showLoadMsg ) {
693+
$.mobile.hidePageLoadingMsg();
694+
}
692695

693-
deferred.resolve( absUrl, options, page, dupCachedPage );
694-
},
695-
error: function() {
696-
//set base back to current path
697-
if( base ) {
698-
base.set( path.get() );
699-
}
696+
deferred.resolve( absUrl, options, page, dupCachedPage );
697+
},
698+
error: function() {
699+
//set base back to current path
700+
if( base ) {
701+
base.set( path.get() );
702+
}
700703

701-
// Remove loading message.
702-
if ( settings.showLoadMsg ) {
703-
$.mobile.hidePageLoadingMsg();
704-
705-
//show error message
706-
$( "<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h1>"+ $.mobile.pageLoadErrorMessage +"</h1></div>" )
707-
.css({ "display": "block", "opacity": 0.96, "top": $window.scrollTop() + 100 })
708-
.appendTo( settings.pageContainer )
709-
.delay( 800 )
710-
.fadeOut( 400, function() {
711-
$( this ).remove();
712-
});
713-
}
704+
// Remove loading message.
705+
if ( settings.showLoadMsg ) {
706+
$.mobile.hidePageLoadingMsg();
707+
708+
//show error message
709+
$( "<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h1>"+ $.mobile.pageLoadErrorMessage +"</h1></div>" )
710+
.css({ "display": "block", "opacity": 0.96, "top": $window.scrollTop() + 100 })
711+
.appendTo( settings.pageContainer )
712+
.delay( 800 )
713+
.fadeOut( 400, function() {
714+
$( this ).remove();
715+
});
716+
}
714717

715-
deferred.reject( absUrl, options );
716-
}
717-
});
718+
deferred.reject( absUrl, options );
719+
}
720+
});
721+
}
718722

719723
return deferred.promise();
720724
};

themes/default/jquery.mobile.theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
color: #444;
309309
text-shadow: 0 1px 1px #f6f6f6;
310310
background-image: -moz-linear-gradient(top,
311-
#fefefe,
311+
#fdfdfd,
312312
#eeeeee);
313313
background-image: -webkit-gradient(linear,left top,left bottom,
314314
color-stop(0, #fdfdfd),

themes/default/jquery.mobile.transitions.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
-webkit-animation-name: spin;
99
-webkit-animation-duration: 1s;
1010
-webkit-animation-iteration-count: infinite;
11+
-webkit-animation-timing-function: linear;
1112
}
1213
@-webkit-keyframes spin {
1314
from {-webkit-transform: rotate(0deg);}

0 commit comments

Comments
 (0)