Commit eb56c269 authored by webchick's avatar webchick
Browse files

#273161: Remove compression settings; use jQuery Update instead.

parent 7f18fd07
...@@ -24,13 +24,11 @@ define('JQUERY_UI_PATH', drupal_get_path('module', 'jquery_ui') . '/jquery.ui'); ...@@ -24,13 +24,11 @@ define('JQUERY_UI_PATH', drupal_get_path('module', 'jquery_ui') . '/jquery.ui');
* @param $files * @param $files
* An array of what additional files (other than UI core) should be loaded * An array of what additional files (other than UI core) should be loaded
* on the page, or a string with a single file name. * on the page, or a string with a single file name.
* @param $type
* Compression type: leave empty to use admin setting.
* Possible values: 'minified', 'packed', 'none'
*/ */
function jquery_ui_add($files = array(), $type = NULL) { function jquery_ui_add($files = array()) {
static $loaded_files, $ui_core, $effects_core; static $loaded_files, $ui_core, $effects_core;
$jquery_ui_path = JQUERY_UI_PATH . '/ui'; $jquery_ui_path = JQUERY_UI_PATH . '/ui';
$compression = variable_get('jquery_update_compression_type', 'mini');
// Convert file to an array if it's not one already, to compensate for // Convert file to an array if it's not one already, to compensate for
// lazy developers. ;) // lazy developers. ;)
...@@ -38,12 +36,6 @@ function jquery_ui_add($files = array(), $type = NULL) { ...@@ -38,12 +36,6 @@ function jquery_ui_add($files = array(), $type = NULL) {
$files = array($files); $files = array($files);
} }
// If a type wasn't specified, then default to whatever was specified in the
// settings page.
if (is_null($type)) {
$type = variable_get('jquery_ui_compression_type', 'minified');
}
// If core hasn't been added yet, add it. // If core hasn't been added yet, add it.
if (!isset($ui_core)) { if (!isset($ui_core)) {
$ui_core = TRUE; $ui_core = TRUE;
...@@ -60,14 +52,14 @@ function jquery_ui_add($files = array(), $type = NULL) { ...@@ -60,14 +52,14 @@ function jquery_ui_add($files = array(), $type = NULL) {
// Load other files. // Load other files.
if (!isset($loaded_files[$file])) { if (!isset($loaded_files[$file])) {
switch ($type) { switch ($compression) {
case 'none': case 'none':
$file_path = "$file.js"; $file_path = "$file.js";
break; break;
case 'packed': case 'pack':
$file_path = "packed/$file.packed.js"; $file_path = "packed/$file.packed.js";
break; break;
case 'minified': case 'mini':
default: default:
$file_path = "minified/$file.min.js"; $file_path = "minified/$file.min.js";
break; break;
...@@ -79,36 +71,6 @@ function jquery_ui_add($files = array(), $type = NULL) { ...@@ -79,36 +71,6 @@ function jquery_ui_add($files = array(), $type = NULL) {
} }
} }
/**
* Implementation of hook_menu().
*/
function jquery_ui_menu() {
$items['admin/settings/jquery_ui'] = array(
'title' => 'jQuery UI',
'description' => 'Configure settings for jQuery UI module.',
'page callback' => 'drupal_get_form',
'page arguments' => array('jquery_ui_admin_settings'),
'access arguments' => array('access site configuration'),
);
return $items;
}
/**
* Admin settings form.
*/
function jquery_ui_admin_settings() {
$form['jquery_ui_compression_type'] = array(
'#type' => 'radios',
'#title' => t('jQuery UI compression type'),
'#options' => drupal_map_assoc(array('packed', 'minified', 'none')),
'#default_value' => variable_get('jquery_ui_compression_type', 'minified'),
'#description' => t("Type of compression to use. 'Packed' uses Dean Edward's packer to make the file size as small as possible, but may require more browser processing. 'Minified' takes out all comments, whitespace, etc. to reduce the file size to a lesser degree, maintaining performance. 'None' leaves the full source intact."),
);
return system_settings_form($form);
}
/** /**
* Return the version of jQuery UI installed. * Return the version of jQuery UI installed.
*/ */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment