One more issue I ran into and that's getting the onload to fire for IE. Seems to all work OK for FF. Nothing in my popup.onload section ever fires in IE. Here's what I have. Is there something unique I need to take care of with EditLive? Looking on the web there seems to be some issues in general with onload and IE but haven't seen any special code in the various EditLive scripts and JSPs.
function insertXSLTText() {
var base = editlivebaseurl.substring(0,editlivebaseurl.lastIndexOf('/'));
base = base.substring(0,base.lastIndexOf('/'));
var url = base + "/jsp/html/STGXSLTPopup.jsp";
var popup = window.open(url,"Window1", "scrollbars=yes,menubar=no,width=800,height=500,toolbar=no,resizable=yes");
popup.onload = function(){
// HERE NOTHING HAPPENS FOR IE
var okDOM = popup.document.getElementById('copyButton');
var dojoElement = popup.document.getElementById("stiboOut");
// Loop through the children and get the text node
var returnedTextDOM = null;
if (dojoElement.hasChildNodes())
// So, first we check if the object is not empty, if the object has child nodes
{
var children = dojoElement.childNodes;
for (var i = 0; i < children.length; i++)
{
if (children[i].type == "textarea") // TEXT_NODE
{
returnedTextDOM = children[i];
}
};
};
if (okDOM.addEventListener) {
okDOM.addEventListener('click', function (event) {
STGinsertText(returnedTextDOM);
this.removeEventListener('click',arguments.callee,false);
}, false);
} else if (okDOM.attachEvent){
okDOM.attachEvent('click', STGinsertText);
okDOM.attachEvent('click', function (event) {
STGinsertText(returnedTextDOM);
this.detachEvent('click',arguments.callee);
});
}
}
}
function STGinsertText(returnedTextDOM) {
var textValue = returnedTextDOM.value;
eljInstance.InsertHTMLAtCursor(textValue);
}
Dylan Just wrote:
> Is dojo or jquery available in EditLive?
We build EditLive!'s javascript code using plain old javascript so it
doesn't interfere with any javascript toolkits used by our customers. We
have used EditLive! with JQuery before - works fine. No idea about dojo,
but it should be ok and if you encounter any issues we can help out.
Kind regards,
Dylan Just
Software Engineer
www.ephox.com
_______________________________________________
LiveWorks@liveworks.ephox.com
List instructions at
http://liveworks.ephox.com/mailing-list/