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 --- docs/_includes/footer.html | 20 +++++++------------- docs/assets/js/src/customizer.js | 19 ++++--------------- 2 files changed, 11 insertions(+), 28 deletions(-) (limited to 'docs') diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html index c44cabec8..24dfd26a5 100644 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@ -43,25 +43,19 @@ {% if site.github %} {% else %} - - - + {% for file in site.data.configBridge.paths.docsJs %} + + {% endfor %} {% endif %} {% if page.slug == "customize" %} + {% if site.github %} {% else %} - {% comment %} - This list is repeated in our Gruntfile—update both when making changes. - {% endcomment %} - - - - - - - + {% for file in site.data.configBridge.paths.customizerJs %} + + {% endfor %} {% endif %} {% endif %} diff --git a/docs/assets/js/src/customizer.js b/docs/assets/js/src/customizer.js index 8d9f5f7e0..b2f15dfa0 100644 --- a/docs/assets/js/src/customizer.js +++ b/docs/assets/js/src/customizer.js @@ -6,13 +6,13 @@ * details, see http://creativecommons.org/licenses/by/3.0/. */ -/* global JSZip, less, saveAs, UglifyJS, __js, __less, __fonts */ +/* global JSZip, less, saveAs, UglifyJS, __configBridge, __js, __less, __fonts */ window.onload = function () { // wait for load in a dumb way because B-0 'use strict'; var cw = '/*!\n' + ' * Bootstrap v3.3.0 (http://getbootstrap.com)\n' + - ' * Copyright 2011-2014 Twitter, Inc.\n' + + ' * Copyright 2011-' + new Date().getFullYear() + ' Twitter, Inc.\n' + ' * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' + ' */\n\n' @@ -319,19 +319,8 @@ window.onload = function () { // wait for load in a dumb way because B-0 function generateJS(preamble) { var $checked = $('#plugin-section input:checked') - var jqueryCheck = [ - 'if (typeof jQuery === \'undefined\') {', - ' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\')', - '}\n' - ].join('\n') - var 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') + var jqueryCheck = __configBridge.jqueryCheck.join('\n') + var jqueryVersionCheck = __configBridge.jqueryVersionCheck.join('\n') if (!$checked.length) return false -- cgit v1.2.3