Created
April 23, 2010 00:03
-
-
Save tivac/376007 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI.add('validation-plugin', function(Y) { | |
function ValidationPlugin(config) { | |
ValidationPlugin.superclass.constructor.apply(this, arguments); | |
} | |
Y.mix(ValidationPlugin, { | |
NAME : "validation", | |
NS : "form", | |
ATTRS : { | |
} | |
}); | |
Y.extend(ValidationPlugin, Y.Plugin.Base, { | |
initializer : function(config) { | |
this.get('host').before('submit', this._validate); | |
this.doBefore('submit', this._validate2); | |
}, | |
_validate : function(e) { | |
e.halt(); | |
console.log("plugin validate .before"); //TODO: REMOVE DEBUGGING CODE | |
}, | |
_validate2 : function(e) { | |
e.halt(); | |
console.log("plugin validate .doBefore"); //TODO: REMOVE DEBUGGING CODE | |
} | |
}); | |
Y.namespace('Plugin').Validation = ValidationPlugin; | |
}, '0.1', { requires : ['plugin', 'node', 'selector-css3', 'event'] }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment