Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Moved jsparty/jquery/plugins/effen to sapphire/thirdparty/jquer…

…y-effen

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@93549 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit acf50807e4890eb01c5a1788ec6832437792c0a7 1 parent 65c7894
Ingo Schommer chillu authored sminnee committed
Showing with 31 additions and 0 deletions.
  1. +31 −0 thirdparty/jquery-effen/jquery.fn.js
31 thirdparty/jquery-effen/jquery.fn.js
View
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.