diff --git a/Gruntfile.js b/Gruntfile.js index e5ff40ef..8acc9295 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -23,7 +23,7 @@ grunt.initConfig({ }, compile: { files: { - "app/src/template/download.js": [ "template/download/components.html", "template/download/theme.html" ], + "app/src/template/download.js": [ "template/download/components.html", "template/download/service_status.html", "template/download/theme.html" ], "app/src/template/themeroller.js": [ "template/themeroller/rollyourown.html", "template/themeroller/_rollyourown_group_corner.html", "template/themeroller/_rollyourown_group_default.html", "template/themeroller/_rollyourown_group_dropshadow.html", "template/themeroller/_rollyourown_group_font.html", "template/themeroller/_rollyourown_group_modaloverlay.html" ] } } diff --git a/app/src/download.js b/app/src/download.js index d69a9da3..899b8c90 100644 --- a/app/src/download.js +++ b/app/src/download.js @@ -35,12 +35,21 @@ }); } + function renderServiceStatus( xhr ) { + var element = $( JST[ "service_status.html" ]({ + status: xhr.status, + statusText: xhr.statusText, + responseText: xhr.responseText + })); + $( "#service-status" ).html( element ); + } + function themeFetch() { var dfd = $.Deferred(); model.themeUrl(function( url ) { $.ajax( url, { dataType: "jsonp" - }).done( dfd.resolve ).fail( dfd.fail ); + }).done( dfd.resolve ).fail( dfd.reject ); }); return dfd; } @@ -314,11 +323,7 @@ model.unsetOrderedComponents(); componentsFetch().done(function( components ) { initComponents( components ); - }).fail(function() { - if ( console && console.log ) { - console.log( "Failed loading components section", arguments ); - } - }); + }).fail( renderServiceStatus ); componentsLoad = $.Deferred(); } } @@ -406,10 +411,6 @@ }); themesLoad.resolve(); - }).fail(function() { - if ( console && console.log ) { - console.log( "Failed loading theme section", arguments ); - } - }); + }).fail( renderServiceStatus ); }( jQuery, Hash, JST, Model ) ); diff --git a/app/src/model.js b/app/src/model.js index 9a278759..bfd0b0aa 100644 --- a/app/src/model.js +++ b/app/src/model.js @@ -143,6 +143,7 @@ } }); if ( changed ) { + this.emitter.trigger( "change:before", [ changedAttributes, createdAttributes ] ); this.emitter.trigger( "change", [ changedAttributes, createdAttributes ] ); } return this; @@ -207,7 +208,7 @@ this.host = obj.host; this.orderedComponentsDfd = $.Deferred(); this.themeParamsUnzipping = $.Deferred().resolve(); - this.on( "change", $.proxy( this._change, this ) ); + this.on( "change:before", $.proxy( this._change, this ) ); }; $.extend( DownloadBuilderModel.prototype, Model.prototype, { @@ -230,6 +231,9 @@ this.themeParamsUnzipping = $.Deferred(); delete changed.zThemeParams; unzip( this.get( "zThemeParams" ), function( unzipped ) { + // Make sure there's no zThemeParams attribute in unzipped object, due to former bug #171 fixed by 1633bad. + delete unzipped.zThemeParams; + delete self.attributes.zThemeParams; self.set.call( self, { themeParams: QueryString.encode( unzipped ) @@ -381,7 +385,7 @@ Model.call( this ); this.baseVars = obj.baseVars; this.host = obj.host; - this.on( "change", $.proxy( this._change, this ) ); + this.on( "change:before", $.proxy( this._change, this ) ); }; $.extend( ThemeRollerModel.prototype, Model.prototype, { @@ -464,7 +468,7 @@ }, parsethemeUrl: function() { - var attributes = omit( this.attributes, [ "downloadParams" ] ), + var attributes = omit( this.attributes, [ "downloadParams", "zThemeParams" ] ), downloadParams = ( "downloadParams" in this.attributes ? QueryString.decode( this.attributes.downloadParams ) : {} ); if ( downloadParams.version ) { attributes.version = downloadParams.version; diff --git a/config.json b/config.json index 67c93c5c..42c5ee4a 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "jqueryUi": { "stable": { - "version": "1.10.3", + "version": "1.10.4", "dependsOn": "jQuery1.6+" }, "legacy": { diff --git a/lib/builder.js b/lib/builder.js index 5190b0cd..1f791d16 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -59,10 +59,6 @@ function Builder( jqueryUi, components, options ) { this.baseThemeFiles = files.baseThemeFiles; this.baseThemeMinFiles = files.baseThemeFiles.filter( selected ).map( min ); - this.baseThemeMinFiles.push({ - path: "themes/base/jquery.ui.theme.min.css", - data: banner( jqueryUi.pkg, null, { minify: true } ) + this.baseCssMin - }); this.baseThemeExceptThemeOrImages = files.baseThemeFiles.filter(function( file ) { if ( (/jquery.ui.theme|jquery-ui|images/).test( file.path ) ) { @@ -90,7 +86,7 @@ function Builder( jqueryUi, components, options ) { }); this.bundleI18nMin = Files({ path: "jquery-ui-i18n.min.js", - data: banner( jqueryUi.pkg, files.i18nFiles.map( path.basename ), { minify: true }) + stripBanner( files.min( this.bundleI18n[ 0 ] ) ) + data: banner( jqueryUi.pkg, files.i18nFiles.paths().map( path.basename ), { minify: true }) + stripBanner( files.min( this.bundleI18n[ 0 ] ) ) }); } else { this.i18nFiles = this.i18nMinFiles = this.bundleI18n = this.bundleI18nMin = Files(); @@ -131,6 +127,10 @@ function Builder( jqueryUi, components, options ) { baseCss = util.scope( baseCss, options.scope ); baseCssMin = util.scope( baseCssMin, options.scope ); } + this.baseThemeMinFiles.push({ + path: "themes/base/jquery.ui.theme.min.css", + data: banner( jqueryUi.pkg, null, { minify: true } ) + baseCssMin + }); _bundleCss = function( base, theme, options ) { var bundleCss = base, fileNames = cssComponentFileNames; diff --git a/lib/cache.js b/lib/cache.js index 7a72eabe..f858f1c8 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -21,8 +21,8 @@ cacheCron = function() { }); logger.log( cache.name + " Cleanup:", count ); - cacheCronTimeout = setTimeout( cacheCron, cacheExpiresTime ); }); + cacheCronTimeout = setTimeout( cacheCron, cacheExpiresTime ); }; Cache = function( name ) { diff --git a/lib/themeroller.js b/lib/themeroller.js index 0102e524..21a7a536 100644 --- a/lib/themeroller.js +++ b/lib/themeroller.js @@ -97,6 +97,9 @@ function ThemeRoller( options ) { delete vars.name; delete vars.scope; } + if ( vars && vars.zThemeParams ) { + throw new Error( "vars.zThemeParams unsupported at the moment. Unzipped vars only. (or need to make ThemeRoller async)" ); + } if ( options.jqueryUi instanceof JqueryUi ) { this.jqueryUi = options.jqueryUi; } else if ( options.version ) { diff --git a/package.json b/package.json index d13fdf76..729cb618 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "download.jqueryui.com", - "version": "1.10.3-4", + "version": "1.10.8", "dependencies": { "archiver": "0.4.1", "async": "0.1.22", @@ -14,7 +14,7 @@ "grunt-contrib-handlebars": "0.5.7", "grunt-contrib-jshint": "0.2.0", "grunt-contrib-uglify": "0.2.0", - "handlebars": "1.0.10", + "handlebars": "1.0.12", "lzma": "1.2.1", "optimist": "0.3.4", "rimraf": "2.0.2", diff --git a/template/download/index.html b/template/download/index.html index 3e028357..9668cc88 100644 --- a/template/download/index.html +++ b/template/download/index.html @@ -10,6 +10,7 @@ All jQuery UI Downloads