Showing with 40 additions and 23 deletions.
  1. +1 −1 Gruntfile.js
  2. +12 −11 app/src/download.js
  3. +4 −3 app/src/model.js
  4. +4 −4 lib/builder.js
  5. +1 −1 lib/cache.js
  6. +3 −0 lib/themeroller.js
  7. +2 −2 package.json
  8. +1 −0 template/download/index.html
  9. +8 −0 template/download/service_status.html
  10. +1 −1 template/zip/index.html
  11. +3 −0 themeroller.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" ]
}
}
@@ -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 ) );
@@ -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, {
@@ -464,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;
@@ -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;
@@ -21,8 +21,8 @@ cacheCron = function() {
});

logger.log( cache.name + " Cleanup:", count );
cacheCronTimeout = setTimeout( cacheCron, cacheExpiresTime );
});
cacheCronTimeout = setTimeout( cacheCron, cacheExpiresTime );
};

Cache = function( name ) {
@@ -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 ) {
@@ -1,6 +1,6 @@
{
"name": "download.jqueryui.com",
"version": "1.10.3-4",
"version": "1.10.3-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",
@@ -10,6 +10,7 @@
<a class="download-link" href="/download/all">All jQuery UI Downloads</a>
</p>
<form action="{{host}}/download" method="POST">
<div id="service-status"></div>
<div class="download-builder-header version-area">
<h2>Version</h2>
{{#each jqueryUis}}
@@ -0,0 +1,8 @@
<div class="download-builder-header ui-widget">
<div style="padding: 1em;" class="ui-state-error ui-corner-all">
<h2 style="margin-bottom: 0.5em;">Service unavailable</h2>
<p>{{status}} {{statusText}}</p>
<pre style="margin-bottom: 1em;">{{{responseText}}}</pre>
<p><a href="https://github.com/jquery/download.jqueryui.com/issues">Check or report issues here</a></p>
</div>
</div>
@@ -154,7 +154,7 @@
<h1>Welcome to jQuery UI!</h1>

<div class="ui-widget">
<p>This page demonstrates the widgets you downloaded using the theme you selected in the download builder. We've included and linked to minified versions of <a href="js/{{jquery}}">jQuery</a>, your personalized copy of <a href="js/jquery-ui-{{ui.version}}.custom.min.js">jQuery UI (js/jquery-ui-{{ui.version}}.custom.min.js)</a>, and <a href="css/{{theme}}/jquery-ui-{{ui.version}}.custom.min.css">css/{{theme}}/jquery-ui-{{ui.version}}.custom.min.css</a> which imports the entire jQuery UI CSS Framework. You can choose to link a subset of the CSS Framework depending on your needs. </p>
<p>This page demonstrates the widgets you downloaded using the theme you selected in the download builder. We've included and linked to minified versions of <a href="js/{{jqueryCore}}">jQuery</a>, your personalized copy of <a href="js/jquery-ui-{{ui.version}}.custom.min.js">jQuery UI (js/jquery-ui-{{ui.version}}.custom.min.js)</a>, and <a href="css/{{theme}}/jquery-ui-{{ui.version}}.custom.min.css">css/{{theme}}/jquery-ui-{{ui.version}}.custom.min.css</a> which imports the entire jQuery UI CSS Framework. You can choose to link a subset of the CSS Framework depending on your needs. </p>
<p>You've downloaded components and a theme that are compatible with jQuery 1.6+. Please make sure you are using jQuery 1.6+ in your production environment.</p>
</div>

@@ -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
});