| Newsgroups |
gmane.editors.bitflux.cvs |
| Message-ID |
<[email protected]> |
Author: chregu
Date: Sat Sep 3 13:29:39 2005
New Revision: 1374
Modified:
trunk/js/bxeFunctions.js
trunk/mozile/eDOMXHTML.js
trunk/mozile/mozCE.js
Log:
addd bxe_insertLinkExtern for inserting links from external like popups
Modified: trunk/js/bxeFunctions.js
==============================================================================
--- trunk/js/bxeFunctions.js (original)
+++ trunk/js/bxeFunctions.js Sat Sep 3 13:29:39 2005
@@ -1685,6 +1685,13 @@
sel.anchorNode.updateXMLNode();
}
+function bxe_InsertLinkExtern(href,title) {
+ var sel = window.getSelection();
+ sel.linkText(href,title);
+ sel.anchorNode.parentNode.updateXMLNode(true);
+ sel.focusNode.parentNode.updateXMLNode(true);
+}
+
function bxe_InsertLink(e) {
Modified: trunk/mozile/eDOMXHTML.js
==============================================================================
--- trunk/mozile/eDOMXHTML.js (original)
+++ trunk/mozile/eDOMXHTML.js Sat Sep 3 13:29:39 2005
@@ -521,7 +521,7 @@
/**
* Apply a link to a selection of text
*/
-Range.prototype.linkText = function(hrefValue)
+Range.prototype.linkText = function(hrefValue,titleValue)
{
// if collapsed then return - works for inline style or block: make editor do work
if(this.collapsed)
@@ -578,7 +578,10 @@
}
textNodes[i] = textContainer.firstChild;
- textContainer.setAttribute("href", hrefValue);
+ textContainer.setAttribute("href", hrefValue);
+ if (titleValue) {
+ textContainer.setAttribute("title", titleValue);
+ }
}
// normalize A elements [may be a waste - why not normalizeElements at the node level?]
@@ -639,6 +642,7 @@
{
textContainer = textContainer.parentNode.replaceChildOnly(textContainer, "span");
textContainer.removeAttribute("href");
+ textContainer.removeAttribute("title");
}
// else remove the A!
else
Modified: trunk/mozile/mozCE.js
==============================================================================
--- trunk/mozile/mozCE.js (original)
+++ trunk/mozile/mozCE.js Sat Sep 3 13:29:39 2005
@@ -280,7 +280,7 @@
this.selectEditableRange(cssr);
}
-Selection.prototype.linkText = function(href)
+Selection.prototype.linkText = function(href,title)
{
@@ -289,7 +289,7 @@
if(!cssr)
return;
- cssr.linkText(href);
+ cssr.linkText(href,title);
this.selectEditableRange(cssr);
}
--
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs