one month passes...
dojo.profile = null;
dojo.require("dojo.profile");
dojo.require("dojo.behavior");
dojo.behavior.add({
"border": function(elem){
with(elem.style){
border = "3px solid blue";
padding = "5px";
margin = "5px";
}
},
"clickSet": {
"onclick": function(evt){
alert("clicked!");
}
},
"topicClickSet": { "onclick": "/foo/bar" },
"addNodesButton": { "onclick": function(evt){
var tNode = document.createElement("div");
tNode.id = "border";
document.body.appendChild(tNode);
tNode.innerHTML = "this should get a border when you hit the re-apply button";
tNode = document.createElement("div");
tNode.id = "clickSet";
document.body.appendChild(tNode);
tNode.innerHTML = "this will become clickable when you hit the re-apply button";
} },
"reApplyButton": { "onclick": { targetObj: dojo.behavior, targetFunc: "apply" } }
});
dojo.event.topic.subscribe("/foo/bar", function(){
alert("event handled via the /foo/bar topic");
});
dojo.event.connect(dojo.behavior, "apply", function(){
dojo.profile.dump(true);
});
this should be given a border
this should cause an alert when you click it
this should be given a border
clicking here should dispatch an alert via a topic
Add More Behavior Nodes
Re-Apply The Behaviors
― Confounded (Confounded), Friday, 7 April 2006 20:09 (twenty years ago)
one year passes...