Issue #2075199 by RobLoach: Update jQuery Once to 1.2.3.

8.0.x
webchick 2013-09-02 13:28:19 -07:00
parent 9436f98c14
commit 6d0a1c5dc0
2 changed files with 21 additions and 8 deletions

View File

@ -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);
}));

View File

@ -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),
),