Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.x 4.x #2

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
2b454d0
This commit was manufactured as part of Drupal's Great Git Migration to
Sep 9, 2010
383dbea
#1046720: Update to jQuery 1.5 and jQuery UI 1.8.9.
RobLoach Feb 10, 2011
767a376
Needed to return the $libraries.
RobLoach Feb 10, 2011
145b127
Remove .project file.
RobLoach Feb 10, 2011
f365462
Prepare for 7.x-1.0 of the jQuery Update module.
RobLoach Feb 11, 2011
07f60f2
Stripping CVS keywords
Feb 25, 2011
ce28b35
Removing translation directories
Feb 25, 2011
34aed50
#1097084: jQuery 1.5 does not work with ie9. Updated to 1.5.1 which f…
mattfarina Mar 18, 2011
cff9be5
Updating to jQuery UI 1.8.11
mattfarina Mar 18, 2011
c83dd99
Added note that changelog is out of date.
mattfarina Mar 18, 2011
f7692d7
#1064890: Updating jquery.form.js to version 2.67.
mattfarina Mar 18, 2011
dbeede1
Updated info file to latest jquery version.
mattfarina Mar 18, 2011
8a3a09f
Updated jquery, jquery ui, and jquery cookie version numbers.
mattfarina Mar 20, 2011
deb3fe5
#263459: Added jQuery CDN support for both Google and Microsoft.
mattfarina Mar 23, 2011
36754cd
jQuery UI from a CDN as well.
mattfarina Mar 23, 2011
81a8c82
Removed debug code.
mattfarina Mar 23, 2011
c0a3098
Updated so all other libraries, besides system.modules definition are…
mattfarina Mar 24, 2011
fcd7f39
#1106234: Fixed case where pass by reference was happening at functio…
mattfarina Mar 28, 2011
3b12866
Updated to jquery form 2.69 and added full oversion of jquery form al…
mattfarina Apr 12, 2011
ce5b379
Issue #1386294 by aidanlis, alexweber: Initial support for both jQuer…
RobLoach Jan 18, 2012
07db916
Issue #1448490 by Rob Loach | ericduran: Fix states.js to work with j…
RobLoach Mar 7, 2012
5d2a4b2
Issue #1449574 by Digidog, cweagans: Move configuration to admin/conf…
RobLoach Mar 7, 2012
baff5d1
Issue #1546668 by Rob Loach: jQuery 1.8
RobLoach Sep 27, 2012
469fac0
Issue #1524944 by muka, Cottser, paskainos, ericduran, realityloop, h…
ericduran Mar 20, 2013
d32f50d
Issue #1947438 by ericduran: Fixed Update jQuery UI to the latest ver…
ericduran Mar 23, 2013
dbf05b5
Issue #1953774 by OnkelTem: Fixed jquery UI 1.10.2 does not work with…
Apr 5, 2013
41ed6c8
Issue #1956766 by ericduran, joachim: Fixed incorrect hook name in fu…
ericduran Apr 8, 2013
7b66e73
Issue #1954930 by lucascaro, ericduran: Fixed Loads the frontend vers…
ericduran May 1, 2013
dd3d76e
Issue #1974974 by ericduran: Adding ui.tooltip.
ericduran May 1, 2013
5309822
Issue #1448490 by RobLoach, spiderman, nagy.balint, ethanhinson | eri…
RobLoach Sep 25, 2013
57f5eb0
Issue #2102211 by RobLoach: Default to the latest version of jQuery.
ericduran Oct 8, 2013
bd6875d
Issue #2107637 by ericduran: Coding Standard Fixes.
ericduran Oct 8, 2013
6955d3c
Issue #1959740 by Punk_UnDeaD, emattias: Fixed Missing ui.menu CSS an…
ericduran Oct 13, 2013
4043821
Issue #2040991 by peterpoe | SocialNicheGuru: Fixed jquery.effects.co…
Oct 13, 2013
e33325b
Issue #1801388 by David_Rothstein: Fixed When a CDN is used, the jQue…
Oct 13, 2013
5ced7b4
Issue #1901672 by mikeytown2, -enzo-, ericduran, muka: Added Offer la…
ericduran Oct 13, 2013
8154d5b
Updating default version to 1.9
ericduran Oct 13, 2013
65eecb0
Issue #2023789 by ericduran: Added Offer latest jQuery 1.10.x as an o…
ericduran Oct 13, 2013
ce35308
Issue #1909834 by mokitger: Not Deleting all variables when uninstall…
Mar 25, 2014
e5ab706
Issue #1448490 by RobLoach, ezheidtmann, ethanhinson, nagy.balint, sp…
ericduran Mar 25, 2014
c13f6ea
Issue #1548028 by mikeker, jamsilver, volkerk, j0rd, fuerst, jessebea…
ericduran Apr 3, 2014
d84d48b
Issue #2123973 by raphaelhuefner, rkallensee, sylus: Failed to open: …
ericduran Apr 3, 2014
70034f5
Issue #1435498 by junedkazi | klonos: Added a "configure" link next t…
Jun 18, 2014
8f28bdd
Issue #1905634 by angrytoast, Murz, dalin: Fixed Use the HTTPS versio…
Jun 18, 2014
1ad9a08
Issue #2268035 by rsmylski, Sneakyvv: Fixed no case for jquery option…
Jul 22, 2014
ad206aa
Issue #1969244 by berliner, markcarver, mongolito404: Specify jQuery …
markhalliwell Jan 25, 2015
835ce83
Update jQuery to 1.11.2
RobLoach Mar 6, 2015
e1a1d0b
Issue #2466329 by hanoii: Update 1.7 to 1.7.2
Apr 8, 2015
4605442
Issue #2156881 by Sneakyvv, bkonetzny, markcarver, mangy.fox, mmikitk…
RobLoach May 8, 2015
02dc89e
Merge branch 'jquery-migrate' into 7.x-3.x
RobLoach May 8, 2015
3253676
feat(2.1): Add jQuery 2.1.4
RobLoach May 8, 2015
c132951
Issue #1546668 by sergey.semashko, RobLoach: Update to jQuery 1.8.3
RobLoach May 18, 2015
7ee4f15
Issue #2454843 by bobrov1989, RobLoach: Move config form to separate …
RobLoach May 18, 2015
d1d244d
Issue #2454843 by RobLoach: Fix visible state toggle name reference
RobLoach May 22, 2015
55b35a8
Update documentation
RobLoach May 29, 2015
b5e3ab0
Issue #2494283 by mpv, netsliver: Not saving variables
RobLoach May 29, 2015
52c2cf9
Issue #2266303 by olteanu5000, pcho, markcarver, thirdender: Update j…
RobLoach May 29, 2015
d8bba9b
Issue #2534056: Remove unused and NON-MIT/GPL licensed or compatible …
markhalliwell Jul 15, 2015
8fe2eb0
Issue #2507857: Remove 1.9 replacement files
markhalliwell Oct 20, 2015
6f0ccd2
Issue #2744821 by eiriksm, matthiasm11: Add jQuery 1.12
Feb 22, 2017
27fb37d
Issue #2217263 by jcisio, hefox, Tessa Bakker: Safari: jquery-1.10.2.…
Mar 8, 2017
529ce00
Issue #1156860 by alexweber: Offer latest jQuery 1.6.x as an option (…
markhalliwell Mar 8, 2017
8c6c777
Issue #2604976 by xaris.tsimpouris, vchen: Ajax error during file upl…
markhalliwell Mar 8, 2017
31f4bd1
Issue #2858991 by markcarver: Add jQuery Form 4 for jQuery 1.7+
markhalliwell Mar 8, 2017
e88f1e1
Issue #1156860 by alexweber, markcarver: Offer latest jQuery 1.6.x as…
markhalliwell Mar 8, 2017
0d0161f
Issue #2692295 by arsn, amme, markcarver: jQuery Migrate update to la…
markhalliwell Mar 9, 2017
408d737
Issue #2649142 by amme, Rene Bakx, PeterMK85: Add jQuery 2.2 and 3.0
markhalliwell Mar 9, 2017
e8a5855
Issue #2531016 by kreynen, hgoto: User can change the version of JQue…
Mar 17, 2017
2028ddd
Revert "Issue #2858991 by markcarver: Add jQuery Form 4 for jQuery 1.7+"
markhalliwell Mar 28, 2017
2d623f1
Issue #2860158 by markcarver, vinmassaro, BartGysens, sergei_brill: R…
markhalliwell Mar 29, 2017
f01ec08
add support for jquery 3.4
harvyde Apr 25, 2019
587bcab
add support for jquery 3.4
harvyde Apr 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 0 additions & 11 deletions .project

This file was deleted.

7 changes: 0 additions & 7 deletions CHANGELOG.txt

This file was deleted.

22 changes: 5 additions & 17 deletions README.txt → README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
// $Id$

CONTENTS OF THIS FILE
---------------------

* Introduction
* Installation
* Credits


INTRODUCTION
------------
# jQuery Update Drupal Module

jQuery Update module upgrades Drupal's stable version of jQuery in order to
support the most current jQuery version available.
Expand All @@ -21,18 +10,17 @@ support the most recent version, so this module ensures that your Drupal
installation can run the most up-to-date jQuery plug-ins.


INSTALLATION
------------
## Installation

1. Copy the jquery_update directory to your sites/SITENAME/modules directory.

2. Enable the module at Administer >> Site building >> Modules.


CREDITS
-------
## Credits

* Matt Farina (mfer)
* Jeff Robbins (jjeff)
* Angela Byron (webchick)
* Addison Berry (add1sun)
* Rob Loach
* Rob Loach (RobLoach)
209 changes: 209 additions & 0 deletions jquery_update.admin.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
<?php

/**
* @file
* Provides the administration settings for jQuery Update.
*/

/**
* Admin settings menu callback.
*
* @see jquery_update_menu()
*/
function jquery_update_settings_form() {
// Vertical Tabs.
$form['jquery_update'] = array(
'#type' => 'vertical_tabs',
'#weight' => 99,
);

// Provide the form item to choose which jQuery version to use.
$default_version = variable_get('jquery_update_jquery_version', '1.10');
$version_options = jquery_update_get_version_options(FALSE);
$form['jquery_update_jquery_version'] = array(
'#type' => 'select',
'#title' => t('Default jQuery version'),
'#options' => $version_options,
'#default_value' => $default_version,
'#description' => t('Select which version of jQuery to use on the site.'),
);

// Theme-specific override version
$themes = list_themes();
$theme_default = variable_get('theme_default', FALSE);
$admin_theme = variable_get('admin_theme', FALSE);
$header = array(t('Theme'), t('jQuery version'), t('Operations'));
$rows = array();
// Go through all themes.
foreach ($themes as $theme_key => $theme) {
// Skip disabled themes, but only if they are not configured as admin
// theme. This is an inconsistency in drupal core, that you can select a
// disabled theme as admin theme.
if (!$theme->status && $theme_key !== $admin_theme) {
continue;
}

// Retrieve the version jQuery for this theme.
$theme_version = theme_get_setting('jquery_update_jquery_version', $theme_key);

// Replace or modify the version name to be displayed.
if (empty($theme_version)) {
$theme_version = t('Site Default');
}
elseif (in_array($theme_version, array_keys($version_options))) {
$theme_version = $version_options[$theme_version];
}
else {
$theme_version .= ' (' . t('unknown version') . ')';
}

// Provide additional information for default and admin themes.
$theme_name = $theme->info['name'];
if ($theme_key === $theme_default && ($theme_key === $admin_theme || empty($admin_theme))) {
$theme_name .= ' (' . t('default/admin theme') . ')';
}
elseif ($theme_key === $theme_default) {
$theme_name .= ' (' . t('default theme') . ')';
}
elseif ($theme_key === $admin_theme) {
$theme_name .= ' (' . t('admin theme') . ')';
}

// Construct the table row.
$rows[] = array(
$theme_name,
$theme_version,
l(t('Configure'), 'admin/appearance/settings/' . $theme_key, array(
'attributes' => array(
'class' => array(
'module-link',
'module-link-configure',
),
),
'query' => drupal_get_destination(),
'fragment' => 'edit-jquery-update',
)),
);
}

$form['themes'] = array(
'#type' => 'fieldset',
'#title' => t('Theme Overrides'),
'#description' => t('You can override the default jQuery version above on each themes settings page. This is useful for administrative based themes.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#tree' => FALSE,
'#weight' => -2,
'#group' => 'jquery_update',
);
$form['themes']['overrides'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
);


$form['performance'] = array(
'#type' => 'fieldset',
'#title' => t('Performance'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#tree' => FALSE,
'#weight' => -1,
'#group' => 'jquery_update',
'#description' => t('Modify how jQuery is loaded to increase download and render performance.')
);

$form['performance']['jquery_update_compression_type'] = array(
'#type' => 'radios',
'#title' => t('jQuery compression level'),
'#options' => array(
'min' => t('Production (minified)'),
'none' => t('Development (uncompressed)'),
),
// Do not show this field if jQuery version is default
'#states' => array(
'invisible' => array(
':input[name=jquery_update_jquery_version]' => array('value' => "default"),
),
),
'#default_value' => variable_get('jquery_update_compression_type', 'min'),
);
$form['performance']['jquery_update_jquery_cdn'] = array(
'#type' => 'select',
'#title' => t('jQuery and jQuery UI CDN'),
'#options' => array(
'none' => t('None'),
'google' => t('Google'),
'microsoft' => t('Microsoft'),
'jquery' => t('jQuery'),
),
// Do not show this field if jQuery version is default
'#states' => array(
'invisible' => array(
':input[name=jquery_update_jquery_version]' => array('value' => "default"),
),
),
'#default_value' => variable_get('jquery_update_jquery_cdn', 'none'),
'#description' => t('Use jQuery and jQuery UI from a CDN. If the CDN is not available the local version of jQuery and jQuery UI will be used.'),
);

$form['jquery_migrate'] = array(
'#type' => 'fieldset',
'#title' => t('jQuery Migrate'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#tree' => FALSE,
'#group' => 'jquery_update',
'#description' => t('<a href="!url">jQuery Migrate</a> can be used to detect and restore APIs or features that have been deprecated in jQuery and removed as of version 1.9 or higher.', array(
'!url' => 'http://github.com/jquery/jquery-migrate/#readme',
)),
);

$form['jquery_migrate']['jquery_update_jquery_migrate_enable'] = array(
'#type' => 'checkbox',
'#title' => t('Enable jQuery Migrate Plugin'),
'#default_value' => variable_get('jquery_update_jquery_migrate_enable', FALSE),
'#description' => t('Even if jQuery Migrate is enabled, it will not be loaded if the current page\'s jQuery version is lower than 1.9.'),
);

$jquery_migrate_states = array(
'visible' => array(
':input[name="jquery_migrate[jquery_update_jquery_migrate_enable]"]' => array('checked' => TRUE),
),
);
$form['jquery_migrate']['jquery_update_jquery_migrate_cdn'] = array(
'#type' => 'select',
'#title' => t('jQuery Migrate CDN'),
'#options' => array(
'none' => t('None'),
'jquery' => t('jQuery'),
),
'#default_value' => variable_get('jquery_update_jquery_migrate_cdn', 'none'),
'#description' => t('Load the jQuery Migrate plugin using a CDN. If the CDN is not available the local module version of the plugin will be used instead.'),
'#states' => $jquery_migrate_states,
);

$jquery_migrate_api_url = 'https://github.com/jquery/jquery-migrate/#migrate-plugin-api';
$form['jquery_migrate']['jquery_update_jquery_migrate_warnings'] = array(
'#type' => 'checkbox',
'#title' => t('Console warnings'),
'#default_value' => variable_get('jquery_update_jquery_migrate_warnings', FALSE),
'#description' => t('Toggle the <a href="!url">generation of console warnings</a> when using the debug version of jQuery Migrate.', array(
'!url' => $jquery_migrate_api_url,
)),
'#states' => $jquery_migrate_states,
);

$form['jquery_migrate']['jquery_update_jquery_migrate_trace'] = array(
'#type' => 'checkbox',
'#title' => t('Console trace'),
'#default_value' => variable_get('jquery_update_jquery_migrate_trace', FALSE),
'#description' => t('Toggle the <a href="!url">generation of console trace messages</a> when using the debug version of jQuery Migrate.', array(
'!url' => $jquery_migrate_api_url,
)),
'#states' => $jquery_migrate_states,
);

return system_settings_form($form);
}
7 changes: 3 additions & 4 deletions jquery_update.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
; $Id$
name = jQuery Update
description = Updates jQuery to jQuery 1.4.2 and jQuery UI 1.8.4.
description = Update jQuery and jQuery UI to a more recent version.
package = User interface
core = 7.x
files[] = jquery_update.module
files[] = jquery_update.install

configure = admin/config/development/jquery_update
69 changes: 63 additions & 6 deletions jquery_update.install
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?php
// $Id$

/**
* @file
* Install file for jQuery Update.
*/

/**
* Implementation of hook_requirements().
* Implements hook_requirements().
*/
function jquery_update_requirements($phase) {
$requirements = array();
Expand All @@ -19,27 +18,85 @@ function jquery_update_requirements($phase) {
$requirements['jquery_update'] = array(
'title' => $t('jQuery Update'),
'severity' => REQUIREMENT_OK,
'value' => t('jQuery %jquery and jQuery UI %ui', array('%jquery' => $jquery['version'], '%ui' => $ui['version'])),
'value' => t('jQuery %jquery (<a href="@link">configure</a>) and jQuery UI %ui', array('%jquery' => $jquery['version'], '%ui' => $ui['version'], '@link' => url('admin/config/development/jquery_update'))),
);
}

return $requirements;
}

/**
* Implementation of hook_uninstall().
* Helper function for setting a theme jQuery version during install or update.
*
* @param string $theme_key
* The machine name of the theme to set.
* @param string $version
* The MAJOR.MINOR jQuery version to set.
*/
function _jquery_update_set_theme_version($theme_key, $version) {
// Retrieve the cached theme settings.
theme_get_setting('jquery_update_jquery_version', $theme_key);
$theme_settings = drupal_static('theme_get_setting', array());

// Set the jQuery version.
$theme_settings[$theme_key]['jquery_update_jquery_version'] = $version;
variable_set('theme_' . $theme_key . '_settings', $theme_settings[$theme_key]);
}

/**
* Implements hook_install().
*/
function jquery_update_install() {
// Use core's default jQuery version for the "seven" admin theme.
_jquery_update_set_theme_version('seven', 'default');
}

/**
* Implements hook_uninstall().
*/
function jquery_update_uninstall() {
variable_del('jquery_update_compression_type');
variable_del('jquery_update_jquery_version');
variable_del('jquery_update_jquery_cdn');
}

/**
* The packed version of jQuery is no longer distributed. If that is the chosen
* version update to minified.
* Update from Drupal 6.
*/
function jquery_update_update_7000() {
if (variable_get('jquery_update_compression_type', 'min') == 'pack') {
variable_set('jquery_update_compression_type', 'min');
}
variable_del('jquery_update_replace');

// Restore the default version of jQuery.
variable_del('jquery_update_jquery_version');
}

/**
* Convert jquery_update_jquery_admin_version to an admin theme setting.
*/
function jquery_update_update_7001() {
// Detect if the previous feature of the "admin version" variable is set.
// @see https://www.drupal.org/node/1969244
$admin_theme = variable_get('admin_theme', FALSE);
$admin_version = variable_get('jquery_update_jquery_admin_version', 'default');

// Ensure that if "seven" is set as the admin theme and no "admin version"
// is present, the version used on the admin theme is the "default" core
// provides to ensure major compatibility with contrib modules.
if (!$admin_version && $admin_theme === 'seven') {
$admin_version = 'default';
}
// Skip this update if the "admin version" was never set and the admin theme
// is not set as "seven".
elseif (!$admin_version) {
return;
}

// Continue setting the admin theme jQuery version.
_jquery_update_set_theme_version($admin_theme, $admin_version);

// Remove the admin version variable.
variable_del('jquery_update_jquery_admin_version');
}
Loading