[kupu-dev] getSelectedNode IE
ereteog
ereteog at gmail.com
Sun Nov 19 17:32:34 CET 2006
Hello,
I'm working on wiki based on semantic web technologies,
sweetwiki<http://argentera.inria.fr:8080/wiki/data/Main/MainHome.jsp>,
and we are using kupu as editor.
We have extended it to add some wiki's features.
We have this function, which gets the selected node and perform an action on
it (it replaces the node or adds an attribute depending on the type of the
node) :
function noWikiWord(){
var selectedNode = kupu.getSelectedNode();
if(selectedNode.getAttribute('property') == 'noWikiWord'){
selectedNode.removeAttribute('property');
}else if ( selectedNode.nodeName == 'A'){
var newnode = kupu.getInnerDocument().createElement('span');
newnode.setAttribute('property', 'noWikiWord');
var text = selectedNode.text;
var textnode = kupu.getInnerDocument().createTextNode(text);
newnode.appendChild(textnode);
selectedNode.parentNode.replaceChild(newnode,selectedNode);
}else{
var newnode = kupu.getInnerDocument().createElement('span');
newnode.setAttribute('property', 'noWikiWord');
var selection = kupu.getInnerDocument().getSelection();
var textnode = kupu.getInnerDocument().createTextNode(selection);
newnode.appendChild(textnode);
kupu.insertNodeAtSelection(newnode, 1);
}
}
it works well with firefox but we have a problem wih IE. I've tested and it
appears that it's the function "kupu.getSelectedNode();" which doesn't work
on IE.
I've seen that there is a problem with this function on this discussion:
http://codespeak.net/pipermail/kupu-dev/2005-February/001131.html.
how can I fix it?
--
Guillaume Erétéo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/kupu-dev/attachments/20061119/985d8e2b/attachment.htm
More information about the kupu-dev
mailing list