Skip to content

Instantly share code, notes, and snippets.

@tivac
Created March 16, 2010 21:47
Show Gist options
  • Save tivac/334569 to your computer and use it in GitHub Desktop.
Save tivac/334569 to your computer and use it in GitHub Desktop.
YUI().use("widget", function(Y) {
function Chiclet(config) {
Chiclet.superclass.constructor.apply(this, arguments);
}
Y.mix(Chiclet, {
NAME : "Chiclet",
ATTRS : {
speed : { value : 200 },
images : []
},
HTML_PARSER : {
images : function(contentBox) {
return Y.all("li img");
}
}
});
Y.extend(Chiclet, Y.Widget, {
initializer : function(config) {
console.log("Initializer"); //TODO: REMOVE DEBUGGING CODE
},
destructor : function() {
console.log("Destructor"); //TODO: REMOVE DEBUGGING CODE
},
renderUI : function() {
console.log("renderUI, build some markup"); //TODO: REMOVE DEBUGGING CODE
console.log(this); //TODO: REMOVE DEBUGGING CODE
console.log(this.get("images")); //TODO: REMOVE DEBUGGING CODE
},
bindUI : function() {
console.log("bindUI"); //TODO: REMOVE DEBUGGING CODE
},
syncUI : function() {
console.log("syncUI"); //TODO: REMOVE DEBUGGING CODE
}
});
var chiclet = new Chiclet({ contentBox: ".chiclet_widget > div" }).render();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment