Discovered r.js' pragmas use them instead of the hacky solution provided by amd-stripper.js

This commit is contained in:
Ghislain Seguin 2011-12-15 18:09:25 -08:00
parent 754cc81115
commit 57a1129bfb
42 changed files with 267 additions and 141 deletions

View file

@ -1,40 +1,3 @@
# The files to include when compiling the JS files
JSFILES = js/jquery.ui.widget.js \
js/jquery.mobile.widget.js \
js/jquery.mobile.media.js \
js/jquery.mobile.support.js \
js/jquery.mobile.vmouse.js \
js/jquery.mobile.event.js \
js/jquery.mobile.hashchange.js \
js/jquery.mobile.page.js \
js/jquery.mobile.core.js \
js/jquery.mobile.navigation.js \
js/jquery.mobile.navigation.pushstate.js \
js/jquery.mobile.transition.js \
js/jquery.mobile.degradeInputs.js \
js/jquery.mobile.dialog.js \
js/jquery.mobile.page.sections.js \
js/jquery.mobile.collapsible.js \
js/jquery.mobile.collapsibleSet.js \
js/jquery.mobile.fieldContain.js \
js/jquery.mobile.grid.js \
js/jquery.mobile.navbar.js \
js/jquery.mobile.listview.js \
js/jquery.mobile.listview.filter.js \
js/jquery.mobile.nojs.js \
js/jquery.mobile.forms.checkboxradio.js \
js/jquery.mobile.forms.button.js \
js/jquery.mobile.forms.slider.js \
js/jquery.mobile.forms.textinput.js \
js/jquery.mobile.forms.select.custom.js \
js/jquery.mobile.forms.select.js \
js/jquery.mobile.buttonMarkup.js \
js/jquery.mobile.controlGroup.js \
js/jquery.mobile.links.js \
js/jquery.mobile.fixHeaderFooter.js \
js/jquery.mobile.fixHeaderFooter.native.js \
js/jquery.mobile.init.js
# The files to include when compiling the CSS files
CSSFILES = css/structure/jquery.mobile.core.css \
css/structure/jquery.mobile.transitions.css \
@ -73,10 +36,6 @@ STRUCTURE = jquery.mobile.structure
deploy: NAME = jquery.mobile-${VER_OFFICIAL}
deploy: STRUCTURE = jquery.mobile.structure-${VER_OFFICIAL}
#Wrapper
WRAP_START = "(function( $$, undefined ) {"
WRAP_END = "}( jQuery ));"
# The CSS theme being used
THEME = default
@ -142,9 +101,14 @@ init:
# Build and minify the JS files
js: init
# Build the JavaScript file
@@node external/r.js -o baseUrl="js" include=jquery.mobile exclude=jquery,order out=${OUTPUT}/${NAME}.tmp.js wrap.start=${WRAP_START} wrap.end=${WRAP_END} optimize=none
@@node external/r.js -o baseUrl="js" \
include=jquery.mobile exclude=jquery,order \
out=${OUTPUT}/${NAME}.tmp.js \
pragmasOnSave.jqmBuildExclude=true \
skipModuleInsertion=true \
optimize=none
@@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${NAME}.js
@@node js/amd-stripper.js ${OUTPUT}/${NAME}.tmp.js ${OUTPUT}/${NAME}.js
@@cat ${OUTPUT}/${NAME}.tmp.js >> ${OUTPUT}/${NAME}.js
@@rm ${OUTPUT}/${NAME}.tmp.js
# ..... and then minify it
@@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.js

View file

@ -8,7 +8,21 @@
<link rel="stylesheet" href="../../_assets/css/jqm-docs.css"/>
<script src="../../../js/jquery.js"></script>
<script src="../../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
<script data-main="../../../js/jquery.mobile.docs" src="../../../external/require.js"></script>
<script src="../../../external/require.js"></script>
<script>
require({
baseUrl: "../../../js"
});
require( [
"jquery.mobile.page.sections",
"jquery.mobile.collapsible",
"jquery.mobile.listview",
"jquery.mobile.forms.checkboxradio",
"jquery.mobile.links" ], function() {
require( [ 'jquery.mobile.controlGroup', "jquery.mobile.init" ] );
});
</script>
</head>
<body>

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html class="ui-mobile-rendering">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -8,7 +8,21 @@
<link rel="stylesheet" href="../../_assets/css/jqm-docs.css"/>
<script src="../../../js/jquery.js"></script>
<script src="../../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
<script data-main="../../../js/jquery.mobile.docs" src="../../../external/require.js"></script>
<script src="../../../external/require.js"></script>
<script>
require({
baseUrl: "../../../js"
});
require( [
"jquery.mobile.page.sections",
"jquery.mobile.fieldContain",
"jquery.mobile.collapsible",
"jquery.mobile.listview",
"jquery.mobile.forms.slider",
"jquery.mobile.links" ], function() {
require( [ 'jquery.mobile.controlGroup', "jquery.mobile.init" ] );
});
</script>
</head>
<body>

View file

@ -4,11 +4,11 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile: Demos and Documentation</title>
<link rel="stylesheet" href="css/themes/default/jquery.mobile.theme.css" />
<link rel="stylesheet" href="compiled/jquery.mobile.css" />
<link rel="stylesheet" href="docs/_assets/css/jqm-docs.css" />
<script src="js/jquery.js"></script>
<script src="experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
<script data-main="js/jquery.mobile.docs" src="external/require.js"></script>
<script src="compiled/jquery.mobile.js"></script>
</head>
<body>
<div data-role="page" class="type-home">

View file

@ -1,67 +0,0 @@
/*
* Strips output of AMD builder from define
*
* Usage:
*
* node amd-stripper.js in out
* or
* cat in | node amd-stripper.js > out
*/
(function (console, args, readFileFunc) {
var env, fs,
fileName, content, destFileName,
exists,
readFile = typeof readFileFunc !== 'undefined' ? readFileFunc : null;
if (typeof process !== 'undefined') {
env = 'node';
//Get the fs module via Node's require before it
//gets replaced. Used in require/node.js
fs = require('fs');
path = require('path');
readFile = function (path) {
return fs.readFileSync(path, 'utf8');
};
exists = function (fileName) {
return path.existsSync(fileName);
};
fileName = process.argv[2];
destFileName = process.argv[3];
}
if ( fileName ) {
if ( exists(fileName) ) {
content = readFile( fileName );
} else {
console.log( "Could not find file: " + fileName );
if ( env === 'node') {
process.exit(1);
}
}
} else {
content = fs.readFileSync('/dev/stdin').toString();
}
content = content
.replace(/^define\((:?'[^']+'\s*,\s*)?(:?\[[^\]]*\]\s*,\s*)?[);]*\s*function.*\{/mg, "(function() {") // Get rid of the define wrap header
.replace(/^}\);?\s*\/\*/mg, "}());\n\n/*") // Get rid of the define wrap footer
.replace(/}\);(\s*\/\/ Script:)/g, "}());\n\n$1") // Get rid of the define wrap footer before @Cowboy's plugin
.replace(/}\);?\s*\(function\(.*\)\s*\{\s*require\([^\(]*?\)\s*;\s*\}\);/g, "}());\n") // Get rid of require( [init] ) function
.replace(/}\);?(\s*}\([^\)]*\)\);?)$/, "}());\n$1")
.replace(/\s*\(function\(.*\)\s*\{\s*\}\([^)]*\)\);/g, ""); // Get rid of empty functions
if ( destFileName ) {
fs.writeFileSync(destFileName, content, 'utf-8');
} else {
console.log( content );
}
}((typeof console !== 'undefined' ? console : undefined),
(typeof Packages !== 'undefined' ? Array.prototype.slice.call(arguments, 0) : []),
(typeof readFile !== 'undefined' ? readFile : undefined)));

View file

@ -1,21 +1,17 @@
({
appDir: "..",
baseUrl: "js/",
dir: "../dist",
baseUrl: "js",
dir: "../compiled",
//optimize: "none",
modules: [
{
name: "jquery.mobile",
//include: [ "almond" ],
exclude: [ "jquery", "order" ]
}
],
wrap: {
start: "(function() {",
end: '\nif ( typeof define === "function" && define.amd ) {\ndefine( "jquery.mobile", [], function () { return jQuery.mobile; } );\n}\n}());'
start: "(function( \$, undefined ) {",
end: '}( jQuery ));'
},
pragmas: {
jqmExclude: true
},
dirExclusionRegExp: /^build|^compiled|^external|^tests/

View file

@ -2,7 +2,10 @@
* "buttons" plugin - for making button-like links
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core", "jquery.mobile.vmouse" ], function() {
//>>excludeEnd("jqmBuildExclude");
( function( $, undefined ) {
$.fn.buttonMarkup = function( options ) {
options = options || {};
@ -23,7 +26,6 @@ $.fn.buttonMarkup = function( options ) {
innerClass = "ui-btn-inner",
textClass = "ui-btn-text",
buttonClass, iconClass,
// Button inner markup
buttonInner = document.createElement( o.wrapperEls ),
buttonText = document.createElement( o.wrapperEls ),
@ -184,4 +186,8 @@ $( document ).bind( "pagecreate create", function( e ){
.buttonMarkup();
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "collapsible" plugin
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.widget" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.widget( "mobile.collapsible", $.mobile.widget, {
options: {
@ -115,4 +118,7 @@ $( document ).bind( "pagecreate create", function( e ){
$( $.mobile.collapsible.prototype.options.initSelector, e.target ).collapsible();
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "collapsibleset" plugin
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.widget", "jquery.mobile.collapsible" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.widget( "mobile.collapsibleset", $.mobile.widget, {
options: {
@ -79,4 +82,7 @@ $( document ).bind( "pagecreate create", function( e ){
$( $.mobile.collapsibleset.prototype.options.initSelector, e.target ).collapsibleset();
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "controlgroup" plugin - corner-rounding for groups of buttons, checks, radios, etc
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.buttonMarkup" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.fn.controlgroup = function( options ) {
@ -49,5 +52,8 @@ $.fn.controlgroup = function( options ) {
$( document ).bind( "pagecreate create", function( e ){
$( ":jqmData(role='controlgroup')", e.target ).controlgroup({ excludeInvisible: false });
});
});
})(jQuery);
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,12 +2,15 @@
* "core" - The base file for jQm
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define(function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, window, undefined ) {
var nsNormalizeDict = {};
// jQuery.mobile configurable options
$.extend( { mobile: {
$.extend( $.mobile, {
// Namespace used framework-wide for data-attrs. Default is no namespace
ns: "",
@ -158,7 +161,7 @@ define(function() {
return ltr || defaultTheme || "a";
}
}});
});
// Mobile version of data and removeData and hasData methods
// ensures all data is set and retrieved using jQuery Mobile's data namespace
@ -233,5 +236,8 @@ define(function() {
$.find.matchesSelector = function( node, expr ) {
return $.find( expr, null, null, [ node ] ).length > 0;
};
})( jQuery, this );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "degradeInputs" plugin - degrades inputs to another type after custom enhancements are made.
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.page" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.mobile.page.prototype.options.degradeInputs = {
color: false,
@ -51,4 +54,7 @@ $( document ).bind( "pagecreate create", function( e ){
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "dialog" plugin.
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.widget" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, window, undefined ) {
$.widget( "mobile.dialog", $.mobile.widget, {
options: {
@ -70,4 +73,7 @@ $( document ).delegate( $.mobile.dialog.prototype.options.initSelector, "pagecre
$( this ).dialog();
});
})( jQuery, this );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "events" plugin - Handles events
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core", "jquery.mobile.support", "jquery.mobile.vmouse" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, window, undefined ) {
// add new event shortcuts
$.each( ( "touchstart touchmove touchend orientationchange throttledresize " +
@ -315,4 +318,7 @@ $.each({
};
});
})( jQuery, this );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "fieldcontain" plugin - simple class additions to make form row separators
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define(function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.fn.fieldcontain = function( options ) {
return this.addClass( "ui-field-contain ui-body ui-br" );
@ -13,4 +16,7 @@ $( document ).bind( "pagecreate create", function( e ){
$( ":jqmData(role='fieldcontain')", e.target ).fieldcontain();
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "fixHeaderFooter" plugin - on-demand positioning for headers,footers
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core", "jquery.mobile.vmouse" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
var slideDownClass = "ui-header-fixed ui-fixed-inline fade",
slideUpClass = "ui-footer-fixed ui-fixed-inline fade",
@ -372,4 +375,7 @@ $( document ).bind( "pagecreate create", function( event ) {
}
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "fixHeaderFooter" native plugin - Behavior for "fixed" headers,footers, and scrolling inner content
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
// Enable touch overflow scrolling when it's natively supported
$.mobile.touchOverflowEnabled = false;
@ -57,4 +60,7 @@ $( document ).bind( "pagecreate", function( event ) {
}
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "button" plugin - links that proxy to native input/buttons
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.widget", "jquery.mobile.buttonMarkup" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.widget( "mobile.button", $.mobile.widget, {
options: {
@ -98,4 +101,7 @@ $( document ).bind( "pagecreate create", function( e ){
$.mobile.button.prototype.enhanceWithin( e.target );
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "checkboxradio" plugin
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core", "jquery.mobile.widget" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.widget( "mobile.checkboxradio", $.mobile.widget, {
options: {
@ -193,4 +196,7 @@ $( document ).bind( "pagecreate create", function( e ){
$.mobile.checkboxradio.prototype.enhanceWithin( e.target );
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* custom "selectmenu" plugin
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core", "jquery.mobile.forms.select" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
var extendSelect = function( widget ){
var select = widget.select,
@ -490,4 +493,7 @@ define( [ "jquery.mobile.core", "jquery.mobile.forms.select" ], function() {
extendSelect( selectmenuWidget );
}
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "selectmenu" plugin
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core", "jquery.mobile.widget" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.widget( "mobile.selectmenu", $.mobile.widget, {
options: {
@ -202,4 +205,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
$( document ).bind( "pagecreate create", function( e ){
$.mobile.selectmenu.prototype.enhanceWithin( e.target );
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -1,8 +1,10 @@
/*
* "slider" plugin
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core", "jquery.mobile.widget", "jquery.mobile.forms.textInput" ], function() {
//>>excludeEnd("jqmBuildExclude");
( function( $, undefined ) {
$.widget( "mobile.slider", $.mobile.widget, {
options: {
@ -361,4 +363,7 @@ $( document ).bind( "pagecreate create", function( e ){
$.mobile.slider.prototype.enhanceWithin( e.target );
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -1,8 +1,10 @@
/*
* "textinput" plugin for text inputs, textareas
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core", "jquery.mobile.widget", "jquery.mobile.degradeInputs" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.widget( "mobile.textinput", $.mobile.widget, {
options: {
@ -125,4 +127,7 @@ $( document ).bind( "pagecreate create", function( e ){
$.mobile.textinput.prototype.enhanceWithin( e.target );
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* plugin for creating CSS grids
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define(function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.fn.grid = function( options ) {
return this.each(function() {
@ -47,4 +50,7 @@ $.fn.grid = function( options ) {
}
});
};
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -76,9 +76,9 @@
// extra awesomeness that BBQ provides. This plugin will be included as
// part of jQuery BBQ, but also be available separately.
define(function(){
(function($,window,undefined){
'$:nomunge'; // Used by YUI compressor.
// Reused string.
var str_hashchange = 'hashchange',
@ -378,4 +378,4 @@ define(function(){
return self;
})();
});
})(jQuery,this);

View file

@ -2,7 +2,10 @@
* "init" - Initialize the framework
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core", "jquery.mobile.navigation", "jquery.mobile.navigation.pushState" ], function() {
//>>excludeEnd("jqmBuildExclude");
( function( $, window, undefined ) {
var $html = $( "html" ),
$head = $( "head" ),
$window = $( window );
@ -140,4 +143,7 @@ define( [ "jquery.mobile.core", "jquery.mobile.navigation", "jquery.mobile.navig
// hide iOS browser chrome on load
$window.load( $.mobile.silentScroll );
});
}( jQuery, this ));
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -1,3 +1,4 @@
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define([
'jquery.ui.widget',
'jquery.mobile.widget',
@ -35,4 +36,5 @@ define([
'jquery.mobile.fixHeaderFooter.native'
], function() {
require( [ 'jquery.mobile.init' ] );
});
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "links" plugin - simple class additions for links
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$( document ).bind( "pagecreate create", function( e ){
@ -14,4 +17,8 @@ $( document ).bind( "pagecreate create", function( e ){
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "listview" filter extension
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.listview" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.mobile.listview.prototype.options.filter = false;
$.mobile.listview.prototype.options.filterPlaceholder = "Filter items...";
@ -109,4 +112,7 @@ $( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function(
.insertBefore( list );
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "listview" plugin
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.widget" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
//Keeps track of the number of lists per page UID
//This allows support for multiple nested list in the same page
@ -396,4 +399,7 @@ $( document ).bind( "pagecreate create", function( e ){
$( $.mobile.listview.prototype.options.initSelector, e.target ).listview();
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* a workaround for window.matchMedia
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
var $window = $( window ),
$html = $( "html" );
@ -10,9 +13,9 @@ var $window = $( window ),
/* $.mobile.media method: pass a CSS media type or query and get a bool return
note: this feature relies on actual media query support for media queries, though types will work most anywhere
examples:
$.mobile.media('screen') //>> tests for screen media type
$.mobile.media('screen and (min-width: 480px)') //>> tests for screen media type with window width > 480px
$.mobile.media('@media screen and (-webkit-min-device-pixel-ratio: 2)') //>> tests for webkit 2x pixel ratio (iPhone 4)
$.mobile.media('screen') // tests for screen media type
$.mobile.media('screen and (min-width: 480px)') // tests for screen media type with window width > 480px
$.mobile.media('@media screen and (-webkit-min-device-pixel-ratio: 2)') // tests for webkit 2x pixel ratio (iPhone 4)
*/
$.mobile.media = (function() {
// TODO: use window.matchMedia once at least one UA implements it
@ -42,4 +45,7 @@ $.mobile.media = (function() {
};
})();
})(jQuery);
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "navbar" plugin
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.widget" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.widget( "mobile.navbar", $.mobile.widget, {
options: {
@ -47,4 +50,7 @@ $( document ).bind( "pagecreate create", function( e ){
$( $.mobile.navbar.prototype.options.initSelector, e.target ).navbar();
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* core utilities for auto ajax navigation, base tag mgmt,
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core", "jquery.mobile.hashchange", "jquery.mobile.event", "jquery.mobile.page" ], function() {
//>>excludeEnd("jqmBuildExclude");
( function( $, undefined ) {
//define vars for interal use
var $window = $( window ),
@ -1494,4 +1497,7 @@ define( [ "jquery.mobile.core", "jquery.mobile.hashchange", "jquery.mobile.event
};//_registerInternalEvents callback
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* history.pushState support, layered on top of hashchange
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.navigation" ], function() {
//>>excludeEnd("jqmBuildExclude");
( function( $, window ) {
// For now, let's Monkeypatch this onto the end of $.mobile._registerInternalEvents
// Scope self to pushStateHandler so we can reference it sanely within the
// methods handed off as event handlers
@ -131,4 +134,7 @@ define( [ "jquery.mobile.navigation" ], function() {
pushStateHandler.init();
}
});
})( jQuery, this );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,11 +2,17 @@
* "nojs" plugin - class to make elements hidden to A grade browsers
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define(function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$( document ).bind( "pagecreate create", function( e ){
$( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" );
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "page" plugin
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.widget" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.widget( "mobile.page", $.mobile.widget, {
options: {
@ -31,4 +34,7 @@ $.widget( "mobile.page", $.mobile.widget, {
return options.keepNativeDefault;
}
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* This plugin handles theming and layout of headers, footers, and content areas
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.page", "jquery.mobile.core" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.mobile.page.prototype.options.backBtnText = "Back";
$.mobile.page.prototype.options.addBackBtn = false;
@ -84,4 +87,7 @@ $( document ).delegate( ":jqmData(role='page'), :jqmData(role='dialog')", "pagec
});
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* support tests
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.media" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
var fakeBody = $( "<body>" ).prependTo( "html" ),
fbCSS = fakeBody[ 0 ].style,
@ -117,4 +120,7 @@ if ( !$.support.boxShadow ) {
$( "html" ).addClass( "ui-mobile-nosupport-boxshadow" );
}
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* "transitions" plugin - Page change tranistions
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.mobile.core" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, window, undefined ) {
function css3TransitionHandler( name, reverse, $to, $from ) {
@ -42,4 +45,7 @@ if ( $.mobile.defaultTransitionHandler === $.mobile.noneTransitionHandler ) {
$.mobile.defaultTransitionHandler = css3TransitionHandler;
}
})( jQuery, this );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -17,7 +17,10 @@
// The current version exposes the following virtual events to jQuery bind methods:
// "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel"
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define(function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, window, document, undefined ) {
var dataPropertyName = "virtualMouseBindings",
touchTargetPropertyName = "virtualTouchID",
@ -492,4 +495,7 @@ if ( eventCaptureSupported ) {
}
}, true);
}
})( jQuery, window, document );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -2,7 +2,10 @@
* widget factory extentions for mobile
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define( [ "jquery.ui.widget" ], function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.widget( "mobile.widget", {
// decorate the parent _createWidget to trigger `widgetinit` for users
@ -46,4 +49,7 @@ $.widget( "mobile.widget", {
}
});
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

View file

@ -8,7 +8,10 @@
* http://docs.jquery.com/UI/Widget
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
define(function() {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
// jQuery 1.4+
if ( $.cleanData ) {
@ -260,4 +263,7 @@ $.Widget.prototype = {
}
};
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");