summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabiano Sant'Ana2013-04-01 13:23:31 (GMT)
committer Fabiano Sant'Ana2013-04-01 13:23:31 (GMT)
commitce57748d1bb922a1313ce2f253e2bb969294f46a (patch)
tree41d34743b65ec694f638de4c91fca3ae2750786a
parentf692ac8c7b765c41098c9fa27e81c439e50fbc2d (diff)
Issue #1846736 by Mark Carver: Remove jQuery CDN setting in favor of using jQuery Update module
-rw-r--r--README.txt2
-rw-r--r--bootstrap.info2
-rw-r--r--includes/theme.inc20
-rw-r--r--js/switch.js7
-rw-r--r--theme-settings.php9
5 files changed, 4 insertions, 36 deletions
diff --git a/README.txt b/README.txt
index 710f13b..30ed6ec 100644
--- a/README.txt
+++ b/README.txt
@@ -3,6 +3,6 @@ Bootstrap theme for Drupal
1. Download the Bootstrap library v2 (http://twitter.github.com/bootstrap/), make sure the resulting folder is named "bootstrap." If you are using the Github master branch, you will need to also find a way to compile the LESS and JS files since this module looks for bootstrap.css and bootstrap.js.
2. Place the bootstrap folder inside the bootstrap theme folder or your subtheme folder: [path_to_themes]/bootstrap/bootstrap/js…
3. Put any plugin files into [path_to_themes]/bootstrap/bootstrap/js/
-4. Make sure you have jQuery 1.7, which is available through the jQuery Update module (http://drupal.org/project/jquery_update/) 7.x-2.x-dev version. You need to make sure the 1.7 version is selected on the configuration page for it to work.
+4. Make sure you have jQuery 1.7, which is available through the jQuery Update module (http://drupal.org/project/jquery_update/) 7.x-2.3 version or higher. You need to make sure the 1.7 version is selected on the configuration page for it to work.
Author: http://drupal.org/node/259843/committers \ No newline at end of file
diff --git a/bootstrap.info b/bootstrap.info
index b293396..68350bc 100644
--- a/bootstrap.info
+++ b/bootstrap.info
@@ -18,12 +18,10 @@ settings[toggle_name] = 0
settings[toggle_search] = 1
settings[cdn_bootstrap] = 0
settings[cdn_bootstrap_version] = 2.3.0
-settings[cdn_jquery] = 0
;Exclude
;javascript
;exclude[js][] = 'modules/contextual/contextual.js'
-;exclude[js][] = 'misc/jquery.js'
;css
;exclude[css][] = 'misc/vertical-tabs.css'
diff --git a/includes/theme.inc b/includes/theme.inc
index 054f30f..36296c5 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -306,25 +306,11 @@ function bootstrap_js_alter(&$js) {
}
$js = array_diff_key($js, $excludes);
- if (theme_get_setting('cdn_jquery')) {
- // Add jQuery and the switch script to the $files array
- $files[] = '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js';
-
- if (theme_get_setting('cdn_bootstrap')) {
- $files[] = '//netdna.bootstrapcdn.com/twitter-bootstrap/'. theme_get_setting('cdn_bootstrap_version') .'/js/bootstrap.min.js';
- }
- else {
- $files[] = $theme_path . '/bootstrap/js/bootstrap.js';
- }
- $files[] = $theme_path . '/js/switch.js';
+ if (theme_get_setting('cdn_bootstrap')) {
+ $files[] = '//netdna.bootstrapcdn.com/twitter-bootstrap/'. theme_get_setting('cdn_bootstrap_version') .'/js/bootstrap.min.js';
}
else {
- if (theme_get_setting('cdn_bootstrap')) {
- $files[] = '//netdna.bootstrapcdn.com/twitter-bootstrap/'. theme_get_setting('cdn_bootstrap_version') .'/js/bootstrap.min.js';
- }
- else {
- $files[] = $theme_path . '/bootstrap/js/bootstrap.js';
- }
+ $files[] = $theme_path . '/bootstrap/js/bootstrap.js';
}
// Rearrange / Add JS
diff --git a/js/switch.js b/js/switch.js
deleted file mode 100644
index 53d1cd8..0000000
--- a/js/switch.js
+++ /dev/null
@@ -1,7 +0,0 @@
-(function($) {
- // put together the name of the new jQuery variable
- var version = $().jquery;
- var versionName = version.replace(/\./g, '');
- // save the new version of jQuery globally and restore Drupal version
- window.jq_bootstrap = jQuery.noConflict(true);
-})(jQuery);
diff --git a/theme-settings.php b/theme-settings.php
index a28ddf6..ca7e012 100644
--- a/theme-settings.php
+++ b/theme-settings.php
@@ -56,14 +56,5 @@ function bootstrap_form_system_theme_settings_alter(&$form, $form_state, $form_i
'#default_value' => theme_get_setting('cdn_bootstrap_version'),
);
- $form['cdn']['cdn_jquery'] = array(
- '#type' => 'checkbox',
- '#title' => t('Use CDN to load in a newer version of jQuery using the no-conflict solution.'),
- '#default_value' => theme_get_setting('cdn_jquery'),
- '#description' => t('Use cdn to host the latest version of jquery and load the newer version using the ') . l('no-conflict', 'http://api.jquery.com/jQuery.noConflict/') . t(' solution.')
- . '<div class="alert alert-error">' .
- ('WARNING: this technique will load 2 versions of jQuery, which is bad for front-end performance and adds an extra whopping 90kb (not gziped) to your download (aka not mobile friendly).
- Also this solution uses CDN and this will make you dependant on a third party who has no obligations towards you concerning uptime and service quality.') . '</div>',
- );
}