From b35b65d0b3689f7999be998411e632046548af6e Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 7 Aug 2013 23:06:29 -0700 Subject: [PATCH] first prototype of new customizer --- Gruntfile.js | 24 + _layouts/customize.html | 6 +- assets/js/application.js | 82 --- assets/js/jszip.js | 1425 ++++++++++++++++++++++++++++++++++++++ assets/js/less.js | 9 + assets/js/uglify.js | 14 + customize.html | 140 +++- 7 files changed, 1611 insertions(+), 89 deletions(-) create mode 100644 assets/js/jszip.js create mode 100644 assets/js/less.js create mode 100644 assets/js/uglify.js diff --git a/Gruntfile.js b/Gruntfile.js index de6db2f3c5..3bf6cdc64c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -34,6 +34,7 @@ module.exports = function(grunt) { src: ['js/tests/unit/*.js'] } }, + concat: { options: { banner: '<%= banner %><%= jqueryCheck %>', @@ -57,6 +58,7 @@ module.exports = function(grunt) { dest: 'dist/js/<%= pkg.name %>.js' } }, + uglify: { options: { banner: '<%= banner %>' @@ -90,6 +92,7 @@ module.exports = function(grunt) { }, files: ['js/tests/*.html'] }, + connect: { server: { options: { @@ -141,4 +144,25 @@ module.exports = function(grunt) { // Default task. grunt.registerTask('default', ['test', 'dist']); + + // task for building customizer + grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () { + var fs = require('fs') + + function getFiles(type) { + var files = {} + fs.readdirSync(type) + .filter(function (path) { + return new RegExp('\\.' + type + '$').test(path) + }) + .forEach(function (path) { + return files[path] = fs.readFileSync(type + '/' + path, 'utf8') + }) + return 'var __' + type + ' = ' + JSON.stringify(files) + '\n' + } + + var customize = fs.readFileSync('customize.html', 'utf-8') + var files = '\n + + + + + \ No newline at end of file -- 2.47.2