From 6d0a1c5dc061f12cc6db1c059ab0fa23bd1e7778 Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 2 Sep 2013 13:28:19 -0700 Subject: [PATCH] Issue #2075199 by RobLoach: Update jQuery Once to 1.2.3. --- core/assets/vendor/jquery-once/jquery.once.js | 25 ++++++++++++++----- core/modules/system/system.module | 4 +-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/core/assets/vendor/jquery-once/jquery.once.js b/core/assets/vendor/jquery-once/jquery.once.js index 506fb4867f7..5363945b591 100644 --- a/core/assets/vendor/jquery-once/jquery.once.js +++ b/core/assets/vendor/jquery-once/jquery.once.js @@ -1,14 +1,23 @@ - /** - * jQuery Once Plugin v1.2 - * http://plugins.jquery.com/project/once + * jQuery Once Plugin 1.2.3 + * http://plugins.jquery.com/once/ * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ -(function ($) { +(function (factory) { + "use strict"; + if (typeof exports === 'object') { + factory(require('jquery')); + } else if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else { + factory(jQuery); + } +}(function ($) { + "use strict"; var cache = {}, uuid = 0; /** @@ -35,9 +44,11 @@ * logic as $.each(). Returning true will continue to the next matched * element in the set, while returning false will entirely break the * iteration. + * + * @api public */ $.fn.once = function (id, fn) { - if (typeof id != 'string') { + if (typeof id !== 'string') { // Generate a numeric ID if the id passed can't be used as a CSS class. if (!(id in cache)) { cache[id] = ++uuid; @@ -69,6 +80,8 @@ * logic as $.each(). Returning true will continue to the next matched * element in the set, while returning false will entirely break the * iteration. + * + * @api public */ $.fn.removeOnce = function (id, fn) { var name = id + '-processed'; @@ -76,4 +89,4 @@ return $.isFunction(fn) ? elements.each(fn) : elements; }; -})(jQuery); +})); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 94fbd21bc49..b0e87d826e7 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1249,8 +1249,8 @@ function system_library_info() { // jQuery Once. $libraries['jquery.once'] = array( 'title' => 'jQuery Once', - 'website' => 'http://plugins.jquery.com/project/once', - 'version' => '1.2', + 'website' => 'http://plugins.jquery.com/once/', + 'version' => '1.2.3', 'js' => array( 'core/assets/vendor/jquery-once/jquery.once.js' => array('group' => JS_LIBRARY, 'weight' => -19), ),