From c87237141316c3cdf3522c450d2658ebb4642560 Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Wed, 4 Sep 2013 09:33:16 -0300
Subject: [PATCH 01/22] Update handlebars to 1.0.12
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index d13fdf76..0ecc6c45 100644
--- a/package.json
+++ b/package.json
@@ -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",
From 91e130dcca1d9bc1416c881c99ce0ea4032b0b00 Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Wed, 4 Sep 2013 09:33:59 -0300
Subject: [PATCH 02/22] Fix build of jquery.ui.theme.min.css
---
lib/builder.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/builder.js b/lib/builder.js
index 5190b0cd..62b6d20b 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 ) ) {
@@ -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;
From cbafa0802f4537093205590b1c965cbefd119953 Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Wed, 4 Sep 2013 09:55:22 -0300
Subject: [PATCH 03/22] Fix variable name s/jquery/jqueryCore/g
---
template/zip/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/template/zip/index.html b/template/zip/index.html
index 3a4dd675..9b10f581 100644
--- a/template/zip/index.html
+++ b/template/zip/index.html
@@ -154,7 +154,7 @@
Welcome to jQuery UI!
From 8b86c93f484c4c9ee24bcf5915ce5406920f8156 Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Wed, 4 Sep 2013 13:19:59 -0300
Subject: [PATCH 04/22] 1.10.3-5
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 0ecc6c45..d99cf76e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "download.jqueryui.com",
- "version": "1.10.3-4",
+ "version": "1.10.3-5",
"dependencies": {
"archiver": "0.4.1",
"async": "0.1.22",
From d98b59ca08087595efec5dbbd912364c43504439 Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Thu, 10 Oct 2013 08:34:00 -0300
Subject: [PATCH 05/22] Throw error when vars.zThemeParams is used to
instantiate a new theme
---
lib/themeroller.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/themeroller.js b/lib/themeroller.js
index 0102e524..89ec8bc7 100644
--- a/lib/themeroller.js
+++ b/lib/themeroller.js
@@ -97,6 +97,9 @@ function ThemeRoller( options ) {
delete vars.name;
delete vars.scope;
}
+ if ( 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 ) {
From 1633bad5c4255370b1e5f7db7c68d5a7ccfe8db4 Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Thu, 10 Oct 2013 10:38:21 -0300
Subject: [PATCH 06/22] Model's on("change") must be executed before user's
on("change"). So, triggering a new event called change:before for that
purpose.
- Due to the non deterministic execution order of events, download#themeUrl()
failed to prevent zThemeParams to be sent together with unzipped params.
Because, the deferred themeParamsUnzipping had no effect if this.on("change")
was executed after user's model.on("change"). This issue caused #160, and
#168. This issue has been fixed by fixing the execution order of the events:
[change:before, change];
---
app/src/model.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/src/model.js b/app/src/model.js
index 9a278759..a6434aad 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, {
@@ -381,7 +382,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, {
From 081b3df6f4b97d97ee2ce367f78d3644c45f2221 Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Thu, 10 Oct 2013 11:02:18 -0300
Subject: [PATCH 07/22] Don't send zThemeParams param when requesting
/themeroller/parsetheme.css
---
app/src/model.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/model.js b/app/src/model.js
index a6434aad..ff5abfae 100644
--- a/app/src/model.js
+++ b/app/src/model.js
@@ -465,7 +465,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;
From b735552862e64073a2c5aa6901d83e67ff52edae Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Thu, 10 Oct 2013 11:03:57 -0300
Subject: [PATCH 08/22] Ignore zThemeParams on GET /themeroller
---
themeroller.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/themeroller.js b/themeroller.js
index 071fa831..7d81f36e 100644
--- a/themeroller.js
+++ b/themeroller.js
@@ -42,6 +42,9 @@ var Frontend = function( args ) {
Frontend.prototype = {
index: function( vars, options ) {
+ if ( vars && "zThemeParams" in vars ) {
+ delete vars.zThemeParams;
+ }
var theme = new ThemeRoller({
vars: vars
});
From f505dc64a67625e5b7376c656607fef9225449d8 Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Thu, 10 Oct 2013 16:36:56 -0300
Subject: [PATCH 09/22] Schedule a new cache cleanup at the end of cacheCron
(not at the end of each cache cleanup)
---
lib/cache.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 ) {
From 99cdee5e24e337ea2aed2f9a3e4c02a0afa41d8a Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Thu, 10 Oct 2013 16:50:38 -0300
Subject: [PATCH 10/22] 1.10.3-6
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index d99cf76e..f79d2871 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "download.jqueryui.com",
- "version": "1.10.3-5",
+ "version": "1.10.3-6",
"dependencies": {
"archiver": "0.4.1",
"async": "0.1.22",
From aeead7081466ade08c4f2197637b2156ffab93df Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Thu, 10 Oct 2013 16:59:53 -0300
Subject: [PATCH 11/22] Minor fix "Throw error when vars.zThemeParams is used
to instantiate a new theme"
---
lib/themeroller.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/themeroller.js b/lib/themeroller.js
index 89ec8bc7..21a7a536 100644
--- a/lib/themeroller.js
+++ b/lib/themeroller.js
@@ -97,7 +97,7 @@ function ThemeRoller( options ) {
delete vars.name;
delete vars.scope;
}
- if ( vars.zThemeParams ) {
+ 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 ) {
From a84ff881a4c85dab63d5f65af7df560c3cdff301 Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Thu, 10 Oct 2013 17:42:07 -0300
Subject: [PATCH 12/22] 1.10.3-7
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index f79d2871..507cde04 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "download.jqueryui.com",
- "version": "1.10.3-6",
+ "version": "1.10.3-7",
"dependencies": {
"archiver": "0.4.1",
"async": "0.1.22",
From 39fdabf1d17aac54eb448f7a56e976cc19f7737b Mon Sep 17 00:00:00 2001
From: Rafael Xavier de Souza
Date: Thu, 10 Oct 2013 15:40:54 -0300
Subject: [PATCH 13/22] Show service status on download page
---
Gruntfile.js | 2 +-
app/src/download.js | 23 ++++++++++++-----------
template/download/index.html | 1 +
template/download/service_status.html | 8 ++++++++
4 files changed, 22 insertions(+), 12 deletions(-)
create mode 100644 template/download/service_status.html
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/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