Hello all,
I want to write a dialog that allows the author to sequentially move through elements he/she has created in the wysiwyg area.. Each time they click the 'Find' button the code moves on to the next html element in the wysiwyg area.. The problem is, i dont know how to get a reference to the onClick event so that the function can move to the next element..This is the idea of what i want to achieve (i know its wrong):
Can someone explain to me how i would achieve this functionality?? Thanks
I want to write a dialog that allows the author to sequentially move through elements he/she has created in the wysiwyg area.. Each time they click the 'Find' button the code moves on to the next html element in the wysiwyg area.. The problem is, i dont know how to get a reference to the onClick event so that the function can move to the next element..This is the idea of what i want to achieve (i know its wrong):
{
type : 'button',
align : 'left',
style : 'width:100%',
label : 'Find Next',
isChanged : false,
onClick : function() {
var dialog = this.getDialog();
var editor = getEditor();
var requestedElement = dialog.getValueOf('find', 'findNext');
var documentWrapper = editor.document;
var documentNode = documentWrapper.$;
var elementArray = documentNode.getElementsByTagName(requestedElement);
var i=0;
do{
elementArray[i].setAttribute('style', 'background-color: blue');
elementArray[i].scrollIntoView(true);
i++;
}
while(this.onClick);
}
}Can someone explain to me how i would achieve this functionality?? Thanks
