d.mixin(this, params);
// check if we have a valid rotator
var r = this.rotator;
if(r){
// remove all of the controller's child nodes just in case
while(node.firstChild){
node.removeChild(node.firstChild);
}
var ul = this._domNode = d.create("ul", null, node),
icon = " " + _dojoxRotator + "Icon",
// helper function for creating a button
cb = function(/*string*/label, /*string*/css, /*array*/action){
d.create("li", {
className: css,
innerHTML: '
' + label + '',
onclick: function(/*event*/e){
d.stopEvent(e);
if(r){
r.control.apply(r, action);
}
}
}, ul);
};
// build out the commands
d.forEach(this.commands.split(','), function(b, i){
switch(b){
case "prev":
cb("Prev", _dojoxRotator + "Prev" + icon, ["prev"]);
break;
case "play/pause":
cb("Play", _play + icon, ["play"]);
cb("Pause", _pause + icon, ["pause"]);
break;
case "info":
this._info = d.create("li", {
className: _dojoxRotator + "Info",
innerHTML: this._buildInfo(r)
}, ul);
break;
case "next":
cb("Next", _dojoxRotator + "Next" + icon, ["next"]);
break;
case "#":
case "titles":
for(var j=0; j
cb(
/*label*/ b == '#' ? j+1 : r.panes[j].title || "Tab " + (j+1),
/*css*/ (b == '#' ? _number : _tab) + ' ' + (j == r.idx ? _selected : "") + ' ' + _dojoxRotator + "Pane" + j,
/*action*/ ["go", j]
);
}
break;
}
}, this);
// add the first/last classes for styling
d.query("li:first-child", ul).addClass(_dojoxRotator + "First");
d.query("li:last-child", ul).addClass(_dojoxRotator + "Last");
// set the initial state of the play/pause toggle button
this._togglePlay();
this._con = d.connect(r, "onUpdate", this, "_onUpdate");
}