Update of 
/var/cvs/contributions/CMSContainer/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha
In directory 
james.mmbase.org:/tmp/cvs-serv4105/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha

Modified Files:
      Tag: b1_4
        my-htmlarea.js 
Log Message:
CMSC-1090 Content link around an image does not convert to live-link at live 
environment; links can not be changed around an image

Removed code is required for FF when a = editor.getParentElement(); returned a 
non A-tag and text is selected


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha
See also: http://www.mmbase.org/jira/browse/CMSC-1090


Index: my-htmlarea.js
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha/my-htmlarea.js,v
retrieving revision 1.5.6.1
retrieving revision 1.5.6.2
diff -u -b -r1.5.6.1 -r1.5.6.2
--- my-htmlarea.js      4 Dec 2008 11:22:03 -0000       1.5.6.1
+++ my-htmlarea.js      30 Dec 2008 16:07:46 -0000      1.5.6.2
@@ -215,12 +215,26 @@
                 if (!a) {
                         editor._doc.execCommand("createlink", false, 
param.f_href);
                         a = editor.getParentElement();
+                    var sel = editor._getSelection();
+                    var range = editor._createRange(sel);
+                    if (!HTMLArea.is_ie) {
+                           if (a == null || !(/^a$/i.test(a.tagName))) {
+                               a = range.startContainer;
+                               if ( ! ( /^a$/i.test(a.tagName) ) ) {
+                                     a = a.nextSibling;
+                                     if ( a === null ) {
+                                           a = range.startContainer.parentNode;
+                                     }
+                               }
+                           }
+                    }
+                    else {
                         while (a) {
                           if (/^a$/i.test(a.tagName)) break; //Search for the 
enclosing A tag, if found: continue and use it.
                           if (/^body$/i.test(a.tagName)) { a = null; break } 
//Stop searching when Body-tag is found, don't go too deep.
                           a = a.parentNode;
                         }
-                        
+                    }
                 } else a.href = param.f_href.trim();
 
                 a.title = param.f_title.trim();
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to