From a515191afddb3952fa93c6aacf83c73c8024e069 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 29 Oct 2014 06:46:02 +0200 Subject: Customizer: include the minified files only on GitHub pages. --- Gruntfile.js | 1 + 1 file changed, 1 insertion(+) (limited to 'Gruntfile.js') diff --git a/Gruntfile.js b/Gruntfile.js index f1430e026..cbf01ac1f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -138,6 +138,7 @@ module.exports = function (grunt) { dest: 'dist/js/<%= pkg.name %>.min.js' }, customize: { + // NOTE: This src list is duplicated in footer.html; if making changes here, be sure to update the other copy too. src: [ 'docs/assets/js/vendor/less.min.js', 'docs/assets/js/vendor/jszip.min.js', -- cgit v1.2.3 From d10700427805c40497b24d7f4ffdd58a7a83c997 Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Mon, 3 Nov 2014 16:19:40 +0100 Subject: Remove duplicate code from Customizer/Gruntfile by sharing it --- Gruntfile.js | 59 +++++++++++++++++------------------------------------------ 1 file changed, 17 insertions(+), 42 deletions(-) (limited to 'Gruntfile.js') diff --git a/Gruntfile.js b/Gruntfile.js index cbf01ac1f..eba9a55b7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,6 +27,13 @@ module.exports = function (grunt) { }; var generateRawFiles = require('./grunt/bs-raw-files-generator.js'); var generateCommonJSModule = require('./grunt/bs-commonjs-generator.js'); + var configBridge = grunt.file.readJSON('./grunt/configBridge.json', { encoding: 'utf8' }); + + Object.keys(configBridge.paths).forEach(function (key) { + configBridge.paths[key].forEach(function (val, i, arr) { + arr[i] = path.join('./docs/assets', val); + }); + }); // Project configuration. grunt.initConfig({ @@ -38,21 +45,8 @@ module.exports = function (grunt) { ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + ' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' + ' */\n', - // NOTE: This jqueryCheck/jqueryVersionCheck code is duplicated in customizer.js; - // if making changes here, be sure to update the other copy too. - jqueryCheck: [ - 'if (typeof jQuery === \'undefined\') {', - ' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\')', - '}\n' - ].join('\n'), - jqueryVersionCheck: [ - '+function ($) {', - ' var version = $.fn.jquery.split(\' \')[0].split(\'.\')', - ' if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {', - ' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery version 1.9.1 or higher\')', - ' }', - '}(jQuery);\n\n' - ].join('\n'), + jqueryCheck: configBridge.config.jqueryCheck.join('\n'), + jqueryVersionCheck: configBridge.config.jqueryVersionCheck.join('\n'), // Task configuration. clean: { @@ -138,25 +132,11 @@ module.exports = function (grunt) { dest: 'dist/js/<%= pkg.name %>.min.js' }, customize: { - // NOTE: This src list is duplicated in footer.html; if making changes here, be sure to update the other copy too. - src: [ - 'docs/assets/js/vendor/less.min.js', - 'docs/assets/js/vendor/jszip.min.js', - 'docs/assets/js/vendor/uglify.min.js', - 'docs/assets/js/vendor/Blob.js', - 'docs/assets/js/vendor/FileSaver.js', - 'docs/assets/js/raw-files.min.js', - 'docs/assets/js/src/customizer.js' - ], + src: configBridge.paths.customizerJs, dest: 'docs/assets/js/customize.min.js' }, docsJs: { - // NOTE: This src list is duplicated in footer.html; if making changes here, be sure to update the other copy too. - src: [ - 'docs/assets/js/vendor/holder.js', - 'docs/assets/js/vendor/ZeroClipboard.min.js', - 'docs/assets/js/src/application.js' - ], + src: configBridge.paths.docsJs, dest: 'docs/assets/js/docs.min.js' } }, @@ -195,16 +175,7 @@ module.exports = function (grunt) { autoprefixer: { options: { - browsers: [ - 'Android 2.3', - 'Android >= 4', - 'Chrome >= 20', - 'Firefox >= 24', // Firefox 24 is the latest ESR - 'Explorer >= 8', - 'iOS >= 6', - 'Opera >= 12', - 'Safari >= 6' - ] + browsers: configBridge.config.autoprefixerBrowsers }, core: { options: { @@ -312,6 +283,10 @@ module.exports = function (grunt) { docs: { src: 'dist/*/*', dest: 'docs/' + }, + configBridge: { + src: 'grunt/configBridge.json', + dest: 'docs/_data/configBridge.json' } }, @@ -482,7 +457,7 @@ module.exports = function (grunt) { grunt.registerTask('lint-docs-css', ['csslint:docs', 'csslint:examples']); grunt.registerTask('docs-js', ['uglify:docsJs', 'uglify:customize']); grunt.registerTask('lint-docs-js', ['jshint:assets', 'jscs:assets']); - grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-customizer']); + grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'copy:configBridge', 'build-customizer']); // Task for updating the cached npm packages used by the Travis build (which are controlled by test-infra/npm-shrinkwrap.json). // This task should be run and the updated file should be committed whenever Bootstrap's dependencies change. -- cgit v1.2.3 From 30df201abc482c5545bf4995feb957dec98d6d21 Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Wed, 5 Nov 2014 18:35:13 +0100 Subject: Use a Jekyll plugin instead of the `copy:configBridge` grunt task --- Gruntfile.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Gruntfile.js') diff --git a/Gruntfile.js b/Gruntfile.js index eba9a55b7..8d293654e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -283,10 +283,6 @@ module.exports = function (grunt) { docs: { src: 'dist/*/*', dest: 'docs/' - }, - configBridge: { - src: 'grunt/configBridge.json', - dest: 'docs/_data/configBridge.json' } }, @@ -457,7 +453,7 @@ module.exports = function (grunt) { grunt.registerTask('lint-docs-css', ['csslint:docs', 'csslint:examples']); grunt.registerTask('docs-js', ['uglify:docsJs', 'uglify:customize']); grunt.registerTask('lint-docs-js', ['jshint:assets', 'jscs:assets']); - grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'copy:configBridge', 'build-customizer']); + grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-customizer']); // Task for updating the cached npm packages used by the Travis build (which are controlled by test-infra/npm-shrinkwrap.json). // This task should be run and the updated file should be committed whenever Bootstrap's dependencies change. -- cgit v1.2.3 From ff5f9db68ec7c7f89dd353e9d73b9fc1abc15ac7 Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Mon, 10 Nov 2014 20:02:06 +0100 Subject: HTML validation: No longer relax the `X-UA-Compatible` error The validator no longer complains about it unless the value is different from `content=IE=edge`, see https://www.w3.org/Bugs/Public/show_bug.cgi?id=27091 --- Gruntfile.js | 1 - 1 file changed, 1 deletion(-) (limited to 'Gruntfile.js') diff --git a/Gruntfile.js b/Gruntfile.js index 8d293654e..76fbbcbaf 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -321,7 +321,6 @@ module.exports = function (grunt) { failHard: true, reset: true, relaxerror: [ - 'Bad value X-UA-Compatible for attribute http-equiv on element meta.', 'Element img is missing required attribute src.', 'Attribute autocomplete not allowed on element input at this point.', 'Attribute autocomplete not allowed on element button at this point.' -- cgit v1.2.3