diff --git a/thirdparty/jquery-effen/jquery.fn.js b/thirdparty/jquery-effen/jquery.fn.js new file mode 100644 index 000000000..c4203d1e9 --- /dev/null +++ b/thirdparty/jquery-effen/jquery.fn.js @@ -0,0 +1,31 @@ +(function($) { + $.fn.fn = function() { + var self = this; + var extension = arguments[0], name = arguments[0]; + if (typeof name == "string") { + return apply(self, name, $.makeArray(arguments).slice(1, arguments.length)); + } else { + $.each(extension, function(key, value) { + define(self, key, value); + }); + return self; + } + } + function define(self, name, fn) { + self.data(namespacedName(name), fn); + }; + function apply(self, name, args) { + var result; + self.each(function(i, item) { + var fn = $(item).data(namespacedName(name)); + if (fn) + result = fn.apply(item, args); + else + throw(name + " is not defined"); + }); + return result; + }; + function namespacedName(name) { + return 'fn.' + name; + } +})(jQuery); \ No newline at end of file