Permalink
Browse files

Merge branch 'master' into simple-nav-merge

Conflicts:
	js/jquery.mobile.navigation.js
  • Loading branch information...
gabrielschulhof committed Dec 17, 2012
2 parents d42c4f2 + 0e140f9 commit 81a57c852f9129f88e91482929842a96d94fe3f3
Showing with 1,226 additions and 235 deletions.
  1. +2 −2 css/structure/jquery.mobile.fixedToolbar.css
  2. +0 −1 docs/demos/_assets/css/jqm-demos.css
  3. BIN docs/demos/_assets/img/buenosaires.jpg
  4. BIN docs/demos/_assets/img/capetown.jpg
  5. BIN docs/demos/_assets/img/newyork.jpg
  6. BIN docs/demos/_assets/img/paris.jpg
  7. BIN docs/demos/_assets/img/seoul.jpg
  8. BIN docs/demos/_assets/img/sydney.jpg
  9. +86 −105 docs/demos/_assets/js/jqm-demos.js
  10. +22 −22 docs/demos/_demo-template/index.html
  11. +4 −0 docs/demos/_demo-template/source.php
  12. +1 −1 docs/demos/grids/grid-custom.html
  13. +3 −3 docs/demos/grids/grid-stack.html
  14. +6 −6 docs/demos/grids/rwd-basics.html
  15. +2 −0 docs/demos/index.html
  16. +81 −0 docs/demos/listviews/listview-filter-autocomplete.html
  17. +2 −2 docs/demos/redirect/index.html
  18. +16 −23 docs/demos/redirect/redirect.php
  19. +4 −0 docs/demos/redirect/source.php
  20. +129 −0 docs/demos/swipe/buenosaires.html
  21. +129 −0 docs/demos/swipe/capetown.html
  22. +129 −0 docs/demos/swipe/newyork.html
  23. +129 −0 docs/demos/swipe/paris.html
  24. +129 −0 docs/demos/swipe/seoul.html
  25. +48 −49 docs/demos/swipe/swipe-list.html
  26. +156 −0 docs/demos/swipe/swipe-page.html
  27. +129 −0 docs/demos/swipe/sydney.html
  28. +1 −1 docs/tables/reflow-events.html
  29. +1 −1 docs/tables/reflow-methods.html
  30. +1 −1 docs/tables/reflow-options.html
  31. +1 −1 docs/tables/table-column-toggle.html
  32. +3 −3 docs/tables/table-reflow.html
  33. +1 −1 docs/tables/toggle-events.html
  34. +1 −1 docs/tables/toggle-methods.html
  35. +1 −1 docs/tables/toggle-options.html
  36. +1 −1 docs/toolbars/bars-fullscreen.html
  37. +1 −0 js/jquery.mobile.js
  38. +1 −1 js/jquery.mobile.navigation.js
  39. +1 −1 js/widgets/dialog.js
  40. +3 −6 js/widgets/fixedToolbar.js
  41. +1 −1 js/widgets/forms/checkboxradio.js
  42. +1 −1 tests/unit/event/event_core.js
@@ -34,8 +34,8 @@
.ui-page-footer-fixed {
padding-bottom: 2.6875em;
}
-.ui-page-header-fullscreen .ui-content,
-.ui-page-footer-fullscreen .ui-content {
+.ui-page-header-fullscreen > .ui-content,
+.ui-page-footer-fullscreen > .ui-content {
padding: 0;
}
.ui-fixed-hidden {
@@ -308,7 +308,6 @@ div.jqm-demo-link {
.jqm-demo .ui-collapsible-content::-webkit-scrollbar-track {
background: transparent;
}
-
.jqm-demo .ui-collapsible-content::-webkit-scrollbar-thumb {
background: #435A5F;
border: solid #222;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -65,141 +65,122 @@ if ( location.protocol.substr(0,4) === 'file' ||
}
// View demo source code
+
+function attachPopupHandler( popup, sources ) {
+ popup.one( "popupbeforeposition", function() {
+ var
+ collapsibleSet = popup.find( "[data-role='collapsible-set']" ),
+ collapsible, pre;
+
+ $.each( sources, function( idx, options ) {
+ collapsible = $( "<div data-role='collapsible' data-collapsed='true' data-theme='" + options.theme + "' data-iconpos='right' data-content-theme='a'>" +
+ "<h1>" + options.title + "</h1>" +
+ "<pre class='brush: " + options.brush + ";'></pre>" +
+ "</div>" );
+ pre = collapsible.find( "pre" );
+ pre.append( options.data.replace( /</gmi, '&lt;' ) );
+ collapsible.appendTo( collapsibleSet );
+ SyntaxHighlighter.highlight( {}, pre[ 0 ] );
+ });
+
+ collapsibleSet.find( "[data-role='collapsible']" ).first().attr( "data-collapsed", "false" );
+ popup.trigger( "create" );
+ });
+}
+
+var demoId = 0;
+
+function getHeadSnippet( type, selector ) {
+ if ( selector === "true" ) {
+ selector = "";
+ }
+ return $( "<div></div>" ).append( $( "head" ).find( type + selector ).contents().clone() ).html();
+}
+
$.fn.viewSourceCode = function() {
- var demoId = 0;
-
+
return $( this ).each( function() {
demoId++
var button = $( "<div class='jqm-demo-link'><a href='#jqm-demo-" + demoId + "' data-rel='popup' data-role='button' data-icon='arrow-u' data-mini='true' data-inline='true' data-shadow='false'>View Source</a></div>" ),
popup = $( "<div id='jqm-demo-" + demoId + "' class='jqm-demo' data-role='popup' data-theme='none' data-position-to='window'>" +
"<div data-role='collapsible-set' data-inset='true'></div>" +
"</div>" ),
- collapsibleSet = popup.find( "[data-role='collapsible-set']" ),
- page = $( this ).closest( "[data-role='page']" ),
- php, html, js, css, collapsiblePHP, collapsibleHTML, collapsibleJS, collapsibleCSS;
-
- function appendSource( code, collapsible ){
- var escaped = code.replace( /</gmi, '&lt;' );
-
- collapsible.find( "pre" ).append( escaped );
- collapsible.appendTo( collapsibleSet );
- };
+ self = $( this ),
+ page = self.closest( "[data-role='page']" ),
+ data,
+ sources = [];
- if ( $( this ).is( "[data-demo-html]" ) ) {
- var markupId = $( this ).attr( "data-demo-html" );
+ // Collect source code before it becomes enhanced
- if ( markupId === "true" ) {
- var element = $( this );
- }
- else {
- var element = $( markupId );
+ if ( self.is( "[data-demo-html]" ) ) {
+ if ( self.attr( "data-demo-html" ) === "true" ) {
+ data = self.html();
+ } else {
+ data = $( "<div></div>" ).append( $( self.attr( "data-demo-html" ) ).clone() ).html();
}
-
- html = $( "<div></div>" ).append( element.clone() ).html();
-
- collapsibleHTML = $( "<div data-role='collapsible' data-collapsed='true' data-theme='b' data-iconpos='right' data-content-theme='a'>" +
- "<h1>HTML</h1>" +
- "<pre class='brush: xml;'></pre>" +
- "</div>" );
-
- appendSource( html, collapsibleHTML );
+ sources.push( { title: "HTML", theme: "b", brush: "xml", data: data } );
}
- if ( $( this ).is( "[data-demo-php]" ) ) {
- collapsiblePHP = $( "<div data-role='collapsible' data-collapsed='true' data-theme='g' data-iconpos='right' data-content-theme='a'>" +
- "<h1>PHP</h1>" +
- "<p class='phpStatus'>Loading PHP source ...</p>" +
- "<pre class='brush: php;'></pre>" +
- "</div>" );
-
- var phpSource = $( this ).attr( "data-demo-php" ),
- source = phpSource + ".php?source";
- $.ajax( source )
- .success( function( data ) {
- php = $( data ).text();
- php.replace( /</gmi, '&lt;' );
- collapsiblePHP.find( ".phpStatus" ).remove();
- collapsiblePHP.find( "pre" ).append( php );
+ if ( self.is( "[data-demo-php]" ) ) {
+ $.ajax( self.attr( "data-demo-php" ), { async: false } )
+ .success( function( incoming ) {
+ data = incoming;
})
.error( function() {
- collapsiblePHP.find( "pre" ).remove();
- collapsiblePHP.find( ".phpStatus" ).html( "Failed to retrieve PHP source" );
+ data = "// Failed to retrieve PHP source code";
});
- collapsiblePHP.appendTo( collapsibleSet );
+ sources.push( { title: "PHP", theme: "g", brush: "php", data: data } );
}
- if ( $( this ).is( "[data-demo-js]" ) ) {
- var scriptId = $( this ).attr( "data-demo-js" );
- if ( scriptId === "true" ) {
- scriptId = "";
- }
-
- js = $( "<div></div>" ).append( $( "head" ).find( "script" + scriptId ).contents().clone() ).html();
-
- collapsibleJS = $( "<div data-role='collapsible' data-collapsed='true' data-theme='f' data-iconpos='right' data-content-theme='a'>" +
- "<h1>JS</h1>" +
- "<pre class='brush: js;'></pre>" +
- "</div>" );
-
- appendSource( js, collapsibleJS );
+ if ( self.is( "[data-demo-js]" ) ) {
+ data = getHeadSnippet( "script", self.attr( "data-demo-js" ) );
+ sources.push( { title: "JS", theme: "f", brush: "js", data: data } );
}
- if ( $( this ).is( "[data-demo-css]" ) ) {
- var styleId = $( this ).attr( "data-demo-css" );
- if ( styleId === "true" ) {
- styleId = "";
- }
-
- css = $( "<div></div>" ).append( $( "head" ).find( "style" + styleId ).contents().clone() ).html();
-
- collapsibleCSS = $( "<div data-role='collapsible' data-collapsed='true' data-theme='e' data-iconpos='right' data-content-theme='a'>" +
- "<h1>CSS</h1>" +
- "<pre class='brush: css;'></pre>" +
- "</div>" );
-
- appendSource( css, collapsibleCSS );
+ if ( self.is( "[data-demo-css]" ) ) {
+ data = getHeadSnippet( "style", self.attr( "data-demo-css" ) );
+ sources.push( { title: "CSS", theme: "e", brush: "css", data: data } );
}
- collapsibleSet.find( "[data-role='collapsible']" ).first().attr( "data-collapsed", "false" );
+ attachPopupHandler( popup, sources );
button.insertAfter( this );
popup.appendTo( page );
-
+
});
};
$( document ).on( "pagebeforecreate", "[data-role='page']", function() {
$( this ).find( "[data-demo-html='true'], [data-demo-js], [data-demo-css], [data-demo-php]" ).viewSourceCode();
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.defaults['auto-links'] = false;
- SyntaxHighlighter.all();
});
-$( document ).on( "pageinit", function() {
+$( document ).on( "pageinit", function( e ) {
// prevent page scroll while scrolling source code
- $( ".jqm-demo .ui-collapsible-content" ).on( "mousewheel", function( e, d ) {
- if ( d > 0 && $( this ).scrollTop() == 0 ) {
- e.preventDefault();
- } else if ( d < 0 && $( this ).scrollTop() == $( this ).get(0).scrollHeight - $( this ).innerHeight() ) {
- e.preventDefault();
+ $( document ).on( "mousewheel", ".jqm-demo .ui-collapsible-content", function( event, delta ) {
+ if ( delta > 0 && $( this ).scrollTop() === 0 ) {
+ event.preventDefault();
+ } else if ( delta < 0 && $( this ).scrollTop() === $( this ).get( 0 ).scrollHeight - $( this ).innerHeight() ) {
+ event.preventDefault();
}
});
// reposition when switching between html / js / css
- $( ".jqm-demo .ui-collapsible" ).on( "expand", function() {
+ $( e.target ).delegate( ".jqm-demo .ui-collapsible", "expand", function() {
$( this ).parents( ".jqm-demo" ).trigger( "resize" );
});
$( ".jqm-demo" ).on( "popupbeforeposition", function() {
// max height: screen height - tolerance (2*30px) - 42px for each collapsible heading
var x = $( this ).find( ".ui-collapsible" ).length,
maxHeight = $.mobile.getScreenHeight() - 60 - ( x * 42 );
-
+
$( this ).find( ".ui-collapsible-content" ).css( "max-height", maxHeight + "px" );
-
+
// keep line numbers and code lines in sync
$(".ui-collapsible:not(.ui-collapsible-collapsed) .gutter", this ).find( ".line" ).css( "height", "");
-
+
$(".ui-collapsible:not(.ui-collapsible-collapsed) .code", this ).find( ".line" ).each( function() {
if ( $( this ).height() !== 16 ) {
var height = $( this ).height(),
@@ -222,7 +203,7 @@ $( document ).on( "pageinit", function() {
*
* @version
* 3.0.83 (July 02 2010)
- *
+ *
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
@@ -245,16 +226,16 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
tag = new XRegExp('(&lt;|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)', 'xg').exec(code),
result = []
;
-
- if (match.attributes != null)
+
+ if (match.attributes != null)
{
var attributes,
regex = new XRegExp('(?<name> [\\w:\\-\\.]+)' +
'\\s*=\\s*' +
'(?<value> ".*?"|\'.*?\'|\\w+)',
'xg');
- while ((attributes = regex.exec(code)) != null)
+ while ((attributes = regex.exec(code)) != null)
{
result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
@@ -268,7 +249,7 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
return result;
}
-
+
this.regexList = [
{ regex: new XRegExp('(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
{ regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // <!-- ... -->
@@ -300,7 +281,7 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
;
var r = SyntaxHighlighter.regexLib;
-
+
this.regexList = [
{ regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
{ regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
@@ -309,7 +290,7 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
{ regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
];
-
+
this.forHtmlScript(r.scriptScriptTags);
};
@@ -333,7 +314,7 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
{
return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
};
-
+
function getValuesCSS(str)
{
return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
@@ -370,7 +351,7 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';
var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
-
+
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
@@ -383,9 +364,9 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
{ regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
];
- this.forHtmlScript({
- left: /(&lt;|<)\s*style.*?(&gt;|>)/gi,
- right: /(&lt;|<)\/\s*style\s*(&gt;|>)/gi
+ this.forHtmlScript({
+ left: /(&lt;|<)\s*style.*?(&gt;|>)/gi,
+ right: /(&lt;|<)\/\s*style\s*(&gt;|>)/gi
});
};
@@ -445,7 +426,7 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
'function include include_once global goto if implements interface instanceof namespace new ' +
'old_function or private protected public return require require_once static switch ' +
'throw try use var while xor ';
-
+
var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
this.regexList = [
@@ -480,13 +461,13 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.6
- *
+ *
* Requires: 1.2.2+
*/
(function($) {
var types = ['DOMMouseScroll', 'mousewheel'];
-
+
if ($.event.fixHooks) {
for ( var i=types.length; i; ) {
$.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
@@ -516,7 +497,7 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
mousewheel: function(fn) {
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
},
-
+
unmousewheel: function(fn) {
return this.unbind("mousewheel", fn);
}
@@ -525,7 +506,7 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
event = $.event.fix(orgEvent);
event.type = "mousewheel";
-
+
// Old school scrollwheel delta
if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }
@@ -541,7 +522,7 @@ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
-
+
return ($.event.dispatch || $.event.handle).apply(this, args);
}
})(jQuery);
Oops, something went wrong.

0 comments on commit 81a57c8

Please sign in to comment.