Skip to content

Instantly share code, notes, and snippets.

@apipkin
Created August 11, 2010 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save apipkin/519370 to your computer and use it in GitHub Desktop.
Save apipkin/519370 to your computer and use it in GitHub Desktop.
YUI.add('gallery-slider-captcha', function(Y){
Y.SliderCaptcha = Y.Base.create('slider-captcha', Y.Widget, [], {
// P U B L I C //
initializer : function() {
// publish release-success event
// publish release-failure event
},
renderUI : function() {
// build message container
// build handle
// append to content box
},
bindUI : function() {
// add dd to handle and constrain to content box
// add opacity change to text while dragging based on percentage to end. 100% - 10%?
// add animation to spring back on release if not at the edge of the container
// add release callback to fire success or failure event
},
// S U G A R //
isHuman : function() {
return this.get('isHuman');
},
// P R O T E C T E D //
_defSuccessReleaseFn : function(e) {
// update text
// set isHuman to true
},
_defFailureReleaseFn : function(e) {
// set isHuman to false
}
}, {
ATTRS : {
form : {},
startText : {},
successText : {},
isHuman : {
value : false
},
submitOnSuccess : {
value : true // should it default to submit?
}
}
});
}, '0.1', {'widget','dd-constrain'});
@jacobfogg
Copy link

Only had about 30 minutes to work on this... will do more tonight, if you havn't already started... You can find my fork here: http://gist.github.com/519956

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment