Skip to content

Commit 6f18511

Browse files
committed
Make the order of the index page and processing match the order of the menu.
1 parent 26b5d5b commit 6f18511

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

grunt.js

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -187,37 +187,6 @@ grunt.registerTask( "build-index", function() {
187187
});
188188
}
189189

190-
function getColorData() {
191-
var files = grunt.file.expandFiles( "cdn/color/*.js" ),
192-
releases = parseReleases( files,
193-
/(color\/jquery.color-(\d+\.\d+(?:\.\d+)?[^.]*)(?:\.(min))?\.js)/ ),
194-
modes = [ "svg-names", "plus-names" ];
195-
196-
function addTypes( release ) {
197-
release.minified = release.filename.replace( ".js", ".min.js" );
198-
199-
modes.forEach(function( mode ) {
200-
var filename = release.filename.replace( "jquery.color", "jquery.color." + mode ),
201-
minFilename = filename.replace( ".js", ".min.js" );
202-
203-
if ( files.indexOf( "cdn/" + filename ) !== -1 ) {
204-
release[ camelCase( mode ) ] = {
205-
filename: filename,
206-
version: release.version,
207-
minified: minFilename
208-
};
209-
}
210-
});
211-
}
212-
213-
releases.forEach( addTypes );
214-
215-
return {
216-
latestStable: getLatestStable( releases ),
217-
all: releases
218-
};
219-
}
220-
221190
function getMobileData() {
222191
var files = grunt.file.expandFiles( "cdn/mobile/*/*.css" ),
223192
releases = files.map(function( file ) {
@@ -265,6 +234,37 @@ grunt.registerTask( "build-index", function() {
265234
};
266235
}
267236

237+
function getColorData() {
238+
var files = grunt.file.expandFiles( "cdn/color/*.js" ),
239+
releases = parseReleases( files,
240+
/(color\/jquery.color-(\d+\.\d+(?:\.\d+)?[^.]*)(?:\.(min))?\.js)/ ),
241+
modes = [ "svg-names", "plus-names" ];
242+
243+
function addTypes( release ) {
244+
release.minified = release.filename.replace( ".js", ".min.js" );
245+
246+
modes.forEach(function( mode ) {
247+
var filename = release.filename.replace( "jquery.color", "jquery.color." + mode ),
248+
minFilename = filename.replace( ".js", ".min.js" );
249+
250+
if ( files.indexOf( "cdn/" + filename ) !== -1 ) {
251+
release[ camelCase( mode ) ] = {
252+
filename: filename,
253+
version: release.version,
254+
minified: minFilename
255+
};
256+
}
257+
});
258+
}
259+
260+
releases.forEach( addTypes );
261+
262+
return {
263+
latestStable: getLatestStable( releases ),
264+
all: releases
265+
};
266+
}
267+
268268
function getQunitData() {
269269
var files = grunt.file.expandFiles( "cdn/qunit/*.js" ),
270270
releases = parseReleases( files,
@@ -321,8 +321,8 @@ grunt.registerTask( "build-index", function() {
321321

322322
var data = getCoreData();
323323
data.ui = getUiData(),
324-
data.color = getColorData();
325324
data.mobile = getMobileData();
325+
data.color = getColorData();
326326
data.qunit = getQunitData();
327327

328328
grunt.file.write( "dist/wordpress/posts/page/index.html",
@@ -334,12 +334,12 @@ grunt.registerTask( "build-index", function() {
334334
grunt.file.write( "dist/wordpress/posts/page/ui.html",
335335
Handlebars.compile( grunt.file.read( "templates/ui.hbs" ) )( data ) );
336336

337-
grunt.file.write( "dist/wordpress/posts/page/color.html",
338-
Handlebars.compile( grunt.file.read( "templates/color.hbs" ) )( data ) );
339-
340337
grunt.file.write( "dist/wordpress/posts/page/mobile.html",
341338
Handlebars.compile( grunt.file.read( "templates/mobile.hbs" ) )( data ) );
342339

340+
grunt.file.write( "dist/wordpress/posts/page/color.html",
341+
Handlebars.compile( grunt.file.read( "templates/color.hbs" ) )( data ) );
342+
343343
grunt.file.write( "dist/wordpress/posts/page/qunit.html",
344344
Handlebars.compile( grunt.file.read( "templates/qunit.hbs" ) )( data ) );
345345
});

templates/index.hbs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@
4343
{{include "ui-latest"}}
4444
{{/with}}
4545

46-
{{#with color.latestStable}}
47-
<h2>jQuery Color</h2>
48-
<p>
49-
Showing the latest stable release for jQuery Color.
50-
<a href="/color/">See all versions of jQuery Color</a>.
51-
</p>
52-
{{include "color-release"}}
53-
{{/with}}
54-
5546
{{#with mobile.latestStable}}
5647
<h2>jQuery Mobile</h2>
5748
<p>
@@ -63,6 +54,15 @@
6354
</ul>
6455
{{/with}}
6556

57+
{{#with color.latestStable}}
58+
<h2>jQuery Color</h2>
59+
<p>
60+
Showing the latest stable release for jQuery Color.
61+
<a href="/color/">See all versions of jQuery Color</a>.
62+
</p>
63+
{{include "color-release"}}
64+
{{/with}}
65+
6666
<h2>QUnit</h2>
6767
<p>
6868
Showing the latest stable release for QUnit.

0 commit comments

Comments
 (0)