diff options
author | Heinrich Fenkart <hnrch02@gmail.com> | 2014-10-22 22:52:15 +0400 |
---|---|---|
committer | Heinrich Fenkart <hnrch02@gmail.com> | 2014-10-23 07:57:15 +0400 |
commit | 1604af041b238c90d52f851c7601204e25fca2be (patch) | |
tree | ac00e7a4e526127e42e6d75462408783b9ce53b2 /docs/assets/js/src/customizer.js | |
parent | 57e4b587828e79962dabe97e9e8ce3c231d7a820 (diff) |
Add jQuery version check to existing jQuery presence check
Fixes #14809.
Closes #14825.
Diffstat (limited to 'docs/assets/js/src/customizer.js')
-rw-r--r-- | docs/assets/js/src/customizer.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/docs/assets/js/src/customizer.js b/docs/assets/js/src/customizer.js index 3af093c9ae..c1c7d7971e 100644 --- a/docs/assets/js/src/customizer.js +++ b/docs/assets/js/src/customizer.js @@ -319,7 +319,19 @@ 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\n' + 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') if (!$checked.length) return false @@ -329,7 +341,7 @@ window.onload = function () { // wait for load in a dumb way because B-0 .join('\n') preamble = cw + preamble - js = jqueryCheck + js + js = jqueryCheck + jqueryVersionCheck + js return { 'bootstrap.js': preamble + js, |