@@ -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- / ( c o l o r \/ j q u e r y .c o l o r - ( \d + \. \d + (?: \. \d + ) ? [ ^ . ] * ) (?: \. ( m i n ) ) ? \. j s ) / ) ,
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+ / ( c o l o r \/ j q u e r y .c o l o r - ( \d + \. \d + (?: \. \d + ) ? [ ^ . ] * ) (?: \. ( m i n ) ) ? \. j s ) / ) ,
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} ) ;
0 commit comments