From 57a1129bfbcb55384878b285d66901a76d09e7ff Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Thu, 15 Dec 2011 18:09:25 -0800 Subject: [PATCH] Discovered r.js' pragmas use them instead of the hacky solution provided by amd-stripper.js --- Makefile | 50 +++------------- docs/forms/checkboxes/index.html | 16 +++++- docs/forms/slider/index.html | 18 +++++- index.html | 4 +- js/amd-stripper.js | 67 ---------------------- js/app.build.js | 20 +++---- js/jquery.mobile.buttonMarkup.js | 8 ++- js/jquery.mobile.collapsible.js | 6 ++ js/jquery.mobile.collapsibleSet.js | 6 ++ js/jquery.mobile.controlGroup.js | 10 +++- js/jquery.mobile.core.js | 10 +++- js/jquery.mobile.degradeInputs.js | 6 ++ js/jquery.mobile.dialog.js | 6 ++ js/jquery.mobile.event.js | 6 ++ js/jquery.mobile.fieldContain.js | 6 ++ js/jquery.mobile.fixHeaderFooter.js | 6 ++ js/jquery.mobile.fixHeaderFooter.native.js | 6 ++ js/jquery.mobile.forms.button.js | 6 ++ js/jquery.mobile.forms.checkboxradio.js | 6 ++ js/jquery.mobile.forms.select.custom.js | 6 ++ js/jquery.mobile.forms.select.js | 6 ++ js/jquery.mobile.forms.slider.js | 7 ++- js/jquery.mobile.forms.textinput.js | 7 ++- js/jquery.mobile.grid.js | 6 ++ js/jquery.mobile.hashchange.js | 6 +- js/jquery.mobile.init.js | 6 ++ js/jquery.mobile.js | 4 +- js/jquery.mobile.links.js | 7 +++ js/jquery.mobile.listview.filter.js | 6 ++ js/jquery.mobile.listview.js | 6 ++ js/jquery.mobile.media.js | 12 +++- js/jquery.mobile.navbar.js | 6 ++ js/jquery.mobile.navigation.js | 6 ++ js/jquery.mobile.navigation.pushstate.js | 6 ++ js/jquery.mobile.nojs.js | 6 ++ js/jquery.mobile.page.js | 6 ++ js/jquery.mobile.page.sections.js | 6 ++ js/jquery.mobile.support.js | 6 ++ js/jquery.mobile.transition.js | 6 ++ js/jquery.mobile.vmouse.js | 6 ++ js/jquery.mobile.widget.js | 6 ++ js/jquery.ui.widget.js | 6 ++ 42 files changed, 267 insertions(+), 141 deletions(-) delete mode 100644 js/amd-stripper.js diff --git a/Makefile b/Makefile index 6a5cddb0..8765bbaf 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docs/forms/checkboxes/index.html b/docs/forms/checkboxes/index.html index 3bfa103d..cc7abf42 100755 --- a/docs/forms/checkboxes/index.html +++ b/docs/forms/checkboxes/index.html @@ -8,7 +8,21 @@ - + + + diff --git a/docs/forms/slider/index.html b/docs/forms/slider/index.html index 76323685..4aeed421 100644 --- a/docs/forms/slider/index.html +++ b/docs/forms/slider/index.html @@ -1,5 +1,5 @@ - + @@ -8,7 +8,21 @@ - + + diff --git a/index.html b/index.html index a2fb8516..ac4d60ef 100755 --- a/index.html +++ b/index.html @@ -4,11 +4,11 @@ jQuery Mobile: Demos and Documentation - + - +
diff --git a/js/amd-stripper.js b/js/amd-stripper.js deleted file mode 100644 index 8a3decec..00000000 --- a/js/amd-stripper.js +++ /dev/null @@ -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))); \ No newline at end of file diff --git a/js/app.build.js b/js/app.build.js index 0c8b30b5..aac5a137 100644 --- a/js/app.build.js +++ b/js/app.build.js @@ -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/ diff --git a/js/jquery.mobile.buttonMarkup.js b/js/jquery.mobile.buttonMarkup.js index 08b91087..f59b2304 100755 --- a/js/jquery.mobile.buttonMarkup.js +++ b/js/jquery.mobile.buttonMarkup.js @@ -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"); \ No newline at end of file diff --git a/js/jquery.mobile.collapsible.js b/js/jquery.mobile.collapsible.js index 715da734..c41de885 100644 --- a/js/jquery.mobile.collapsible.js +++ b/js/jquery.mobile.collapsible.js @@ -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"); diff --git a/js/jquery.mobile.collapsibleSet.js b/js/jquery.mobile.collapsibleSet.js index 749e0cb7..4e9eae3f 100644 --- a/js/jquery.mobile.collapsibleSet.js +++ b/js/jquery.mobile.collapsibleSet.js @@ -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"); diff --git a/js/jquery.mobile.controlGroup.js b/js/jquery.mobile.controlGroup.js index dc3faa99..9ded3521 100644 --- a/js/jquery.mobile.controlGroup.js +++ b/js/jquery.mobile.controlGroup.js @@ -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 }); }); - -}); \ No newline at end of file + +})(jQuery); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/js/jquery.mobile.core.js b/js/jquery.mobile.core.js index e9bbbc67..f9190c8b 100644 --- a/js/jquery.mobile.core.js +++ b/js/jquery.mobile.core.js @@ -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"); diff --git a/js/jquery.mobile.degradeInputs.js b/js/jquery.mobile.degradeInputs.js index 061a63df..1e22e146 100644 --- a/js/jquery.mobile.degradeInputs.js +++ b/js/jquery.mobile.degradeInputs.js @@ -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"); diff --git a/js/jquery.mobile.dialog.js b/js/jquery.mobile.dialog.js index 256b0a92..45a3deed 100644 --- a/js/jquery.mobile.dialog.js +++ b/js/jquery.mobile.dialog.js @@ -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"); diff --git a/js/jquery.mobile.event.js b/js/jquery.mobile.event.js index 44efe5cd..27a5ec4a 100644 --- a/js/jquery.mobile.event.js +++ b/js/jquery.mobile.event.js @@ -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"); diff --git a/js/jquery.mobile.fieldContain.js b/js/jquery.mobile.fieldContain.js index b03cbea5..f09e05f0 100644 --- a/js/jquery.mobile.fieldContain.js +++ b/js/jquery.mobile.fieldContain.js @@ -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"); diff --git a/js/jquery.mobile.fixHeaderFooter.js b/js/jquery.mobile.fixHeaderFooter.js index 0777cd15..8f8ff090 100644 --- a/js/jquery.mobile.fixHeaderFooter.js +++ b/js/jquery.mobile.fixHeaderFooter.js @@ -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"); diff --git a/js/jquery.mobile.fixHeaderFooter.native.js b/js/jquery.mobile.fixHeaderFooter.native.js index 0443f4c6..4482c11a 100644 --- a/js/jquery.mobile.fixHeaderFooter.native.js +++ b/js/jquery.mobile.fixHeaderFooter.native.js @@ -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"); diff --git a/js/jquery.mobile.forms.button.js b/js/jquery.mobile.forms.button.js index 8304cb33..1fe9ded1 100644 --- a/js/jquery.mobile.forms.button.js +++ b/js/jquery.mobile.forms.button.js @@ -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"); diff --git a/js/jquery.mobile.forms.checkboxradio.js b/js/jquery.mobile.forms.checkboxradio.js index 2fc06d2b..bf9fb177 100644 --- a/js/jquery.mobile.forms.checkboxradio.js +++ b/js/jquery.mobile.forms.checkboxradio.js @@ -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"); diff --git a/js/jquery.mobile.forms.select.custom.js b/js/jquery.mobile.forms.select.custom.js index c1c32a9d..3d1144ca 100644 --- a/js/jquery.mobile.forms.select.custom.js +++ b/js/jquery.mobile.forms.select.custom.js @@ -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"); diff --git a/js/jquery.mobile.forms.select.js b/js/jquery.mobile.forms.select.js index ba295d3e..ef4db069 100644 --- a/js/jquery.mobile.forms.select.js +++ b/js/jquery.mobile.forms.select.js @@ -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"); diff --git a/js/jquery.mobile.forms.slider.js b/js/jquery.mobile.forms.slider.js index 3ecb9abf..239b8462 100644 --- a/js/jquery.mobile.forms.slider.js +++ b/js/jquery.mobile.forms.slider.js @@ -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"); diff --git a/js/jquery.mobile.forms.textinput.js b/js/jquery.mobile.forms.textinput.js index e2483833..60efd1c6 100644 --- a/js/jquery.mobile.forms.textinput.js +++ b/js/jquery.mobile.forms.textinput.js @@ -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"); diff --git a/js/jquery.mobile.grid.js b/js/jquery.mobile.grid.js index c23864d1..3681e715 100644 --- a/js/jquery.mobile.grid.js +++ b/js/jquery.mobile.grid.js @@ -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"); diff --git a/js/jquery.mobile.hashchange.js b/js/jquery.mobile.hashchange.js index f2993944..2676c59e 100644 --- a/js/jquery.mobile.hashchange.js +++ b/js/jquery.mobile.hashchange.js @@ -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); diff --git a/js/jquery.mobile.init.js b/js/jquery.mobile.init.js index a6049cdd..a96d2afe 100644 --- a/js/jquery.mobile.init.js +++ b/js/jquery.mobile.init.js @@ -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"); diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js index 93d0e4d5..784780ac 100644 --- a/js/jquery.mobile.js +++ b/js/jquery.mobile.js @@ -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' ] ); -}); \ No newline at end of file +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/js/jquery.mobile.links.js b/js/jquery.mobile.links.js index b07249f5..d57aac2c 100644 --- a/js/jquery.mobile.links.js +++ b/js/jquery.mobile.links.js @@ -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"); diff --git a/js/jquery.mobile.listview.filter.js b/js/jquery.mobile.listview.filter.js index e58c7e8c..f1052f68 100755 --- a/js/jquery.mobile.listview.filter.js +++ b/js/jquery.mobile.listview.filter.js @@ -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"); diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index c4fa4303..36fefb44 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -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"); diff --git a/js/jquery.mobile.media.js b/js/jquery.mobile.media.js index 09b7efaf..d7155d3e 100644 --- a/js/jquery.mobile.media.js +++ b/js/jquery.mobile.media.js @@ -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"); diff --git a/js/jquery.mobile.navbar.js b/js/jquery.mobile.navbar.js index c70edfd2..7a88cba9 100644 --- a/js/jquery.mobile.navbar.js +++ b/js/jquery.mobile.navbar.js @@ -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"); diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 72e2258a..c16b52d0 100755 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -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"); diff --git a/js/jquery.mobile.navigation.pushstate.js b/js/jquery.mobile.navigation.pushstate.js index acbb4c7f..45084736 100644 --- a/js/jquery.mobile.navigation.pushstate.js +++ b/js/jquery.mobile.navigation.pushstate.js @@ -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"); diff --git a/js/jquery.mobile.nojs.js b/js/jquery.mobile.nojs.js index 9989bf69..0584a038 100644 --- a/js/jquery.mobile.nojs.js +++ b/js/jquery.mobile.nojs.js @@ -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"); diff --git a/js/jquery.mobile.page.js b/js/jquery.mobile.page.js index 2f81d1e7..ace1b53f 100644 --- a/js/jquery.mobile.page.js +++ b/js/jquery.mobile.page.js @@ -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"); diff --git a/js/jquery.mobile.page.sections.js b/js/jquery.mobile.page.sections.js index e33c1f7f..e5f18e65 100644 --- a/js/jquery.mobile.page.sections.js +++ b/js/jquery.mobile.page.sections.js @@ -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"); diff --git a/js/jquery.mobile.support.js b/js/jquery.mobile.support.js index 659bf0dc..b9b9dbd6 100644 --- a/js/jquery.mobile.support.js +++ b/js/jquery.mobile.support.js @@ -2,7 +2,10 @@ * support tests */ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); define( [ "jquery.mobile.media" ], function() { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { var fakeBody = $( "" ).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"); diff --git a/js/jquery.mobile.transition.js b/js/jquery.mobile.transition.js index 4ec6cc69..9019db54 100644 --- a/js/jquery.mobile.transition.js +++ b/js/jquery.mobile.transition.js @@ -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"); diff --git a/js/jquery.mobile.vmouse.js b/js/jquery.mobile.vmouse.js index 1a34e2b0..ef0f367c 100644 --- a/js/jquery.mobile.vmouse.js +++ b/js/jquery.mobile.vmouse.js @@ -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"); diff --git a/js/jquery.mobile.widget.js b/js/jquery.mobile.widget.js index 65b575b4..2c2abefc 100644 --- a/js/jquery.mobile.widget.js +++ b/js/jquery.mobile.widget.js @@ -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"); diff --git a/js/jquery.ui.widget.js b/js/jquery.ui.widget.js index 5977c297..a9a7d2dd 100644 --- a/js/jquery.ui.widget.js +++ b/js/jquery.ui.widget.js @@ -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");