-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjquery.reverse.js
More file actions
35 lines (32 loc) · 843 Bytes
/
jquery.reverse.js
File metadata and controls
35 lines (32 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict';
(function ($, plugin) {
if ($) { // Global jQuery
plugin.fn = (plugin.isStatic ? $ : $.fn)[plugin.name] = plugin.factory($);
}
if (typeof exports !== 'undefined' && plugin.fn) { // CommonJS
if (typeof module !== 'undefined' && module.exports) {
module.exports = plugin.fn;
}
exports[plugin.name] = plugin.fn;
} else if (typeof define === 'function' && define.amd) { // AMD
define(['jquery'], function ($) {
var fn = (plugin.isStatic ? $ : $.fn)[plugin.name] = plugin.factory($);
return fn;
});
} else if (!$) {
/*
jQuery isn't defined and user is
trying to use plugin directly without
CommonJS or AMD support
*/
throw 'jQuery not defined.';
}
})(window.$, {
'name' : 'reverse',
'isStatic' : false,
'factory' : function ($) {
return function () {
return [].reverse;
};
}
});