diff --git a/README.txt b/README.txt index 30ed6ec5c2d7546099963fc0ec518496a23f30c2..d1a65a44bd1f1dfba775e214c0d2808fecc563d0 100644 --- a/README.txt +++ b/README.txt @@ -1,8 +1,6 @@ -Bootstrap theme for Drupal +Bootstrap - A base 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.3 version or higher. You need to make sure the 1.7 version is selected on the configuration page for it to work. +1. Bootstrap requires a minimum jQuery version of 1.7 to function properly. You can download and enable the ![jQuery Update](http://drupal.org/project/jquery_update/) module, 7.x-2.3 version or higher. Navigate to the configuration page and ensure that the minimum version selected is 1.7. +2. By default, this base theme enables and uses a CDN for loading the Bootstrap library. If you disable this CDN, you will need to use an alternative solution for adding the necessary CSS and JS files from the Bootstrap library. This can be in the form creating a sub-theme or using a utility module. Author: http://drupal.org/node/259843/committers \ No newline at end of file diff --git a/bootstrap.info b/bootstrap.info index 68350bc6548f5d2633e209403647a8515e9e54a1..487f8098feba4bed77b470cdcdc2f03b5eabd102 100644 --- a/bootstrap.info +++ b/bootstrap.info @@ -10,14 +10,12 @@ regions[sidebar_first] = 'Primary' regions[sidebar_second] = 'Secondary' regions[footer] = 'Footer' -stylesheets[all][] = bootstrap/css/bootstrap.css -stylesheets[all][] = bootstrap/css/bootstrap-responsive.css stylesheets[all][] = css/style.css settings[toggle_name] = 0 settings[toggle_search] = 1 -settings[cdn_bootstrap] = 0 -settings[cdn_bootstrap_version] = 2.3.0 +settings[cdn_bootstrap] = 1 +settings[cdn_bootstrap_version] = 2.3.1 ;Exclude ;javascript diff --git a/includes/theme.inc b/includes/theme.inc index 36296c57d775487402ccf9cbd5b0c28115e2ed5d..1e15888600e3cf8bebcc31a535b8abd3d921a617 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -267,16 +267,10 @@ function bootstrap_status_messages($variables) { * Implements hook_css_alter(). */ function bootstrap_css_alter(&$css) { - $theme_path = drupal_get_path('theme', 'bootstrap'); - + // Load excluded CSS files from theme. $excludes = _bootstrap_alter(bootstrap_theme_get_info('exclude'), 'css'); - + // Add the Bootstrap CDN CSS files. if (theme_get_setting('cdn_bootstrap')){ - //first add the existing bootstrap css to the exclude - $excludes[$theme_path . '/bootstrap/css/bootstrap.css'] = FALSE; - $excludes[$theme_path . '/bootstrap/css/bootstrap-responsive.css'] = FALSE ; - - //and then add the cdn css $cdn_url = '//netdna.bootstrapcdn.com/twitter-bootstrap/'. theme_get_setting('cdn_bootstrap_version') .'/css/bootstrap-combined.min.css'; $css[$cdn_url]['data'] = $cdn_url; $css[$cdn_url]['type'] = 'external'; @@ -294,24 +288,20 @@ function bootstrap_css_alter(&$css) { * Implements hook_js_alter(). */ function bootstrap_js_alter(&$js) { - $theme_path = drupal_get_path('theme', 'bootstrap'); $files = array(); + // Load excluded JS files from theme. $excludes = _bootstrap_alter(bootstrap_theme_get_info('exclude'), 'js'); - + // If bootstrap_ui available, we should not add js from theme info file. if (module_exists('bootstrap_ui')) { libraries_load('bootstrap', 'minified'); - $excludes[drupal_get_path('theme', 'bootstrap') . '/bootstrap/js/bootstrap.js'] = array(); } $js = array_diff_key($js, $excludes); 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'; - } // Rearrange / Add JS $group = -50; diff --git a/theme-settings.php b/theme-settings.php index ca7e0120e6f467b5158e8ecdc0f31e662da37cb2..6740eea03b4a61bb772a8fbd33117428c2cd1558 100644 --- a/theme-settings.php +++ b/theme-settings.php @@ -46,6 +46,7 @@ function bootstrap_form_system_theme_settings_alter(&$form, $form_state, $form_i '#type' => 'select', '#title' => t('Bootstrap version'), '#options' => array( + '2.3.1' => 'v2.3.1', '2.3.0' => 'v2.3.0', '2.2.2' => 'v2.2.2', '2.2.1' => 'v2.2.1',