knguyen     2004/12/13 12:00:01 CET

  Modified files:        (Branch: JAHIA-4-0-BRANCH)
    src/views/jsp/jahia/htmleditors/htmlarea-3.0-rc1 htmlarea.js 
  Log:
  - with IE, there is an exception when selecting a table and deleting it.
  
  Revision  Changes    Path
  1.1.2.2   +18 -12    
jahia/src/views/jsp/jahia/htmleditors/htmlarea-3.0-rc1/htmlarea.js
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/src/views/jsp/jahia/htmleditors/htmlarea-3.0-rc1/htmlarea.js.diff?r1=1.1.2.1&r2=1.1.2.2&f=h
  
  
  
  Index: htmlarea.js
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/src/views/jsp/jahia/htmleditors/htmlarea-3.0-rc1/Attic/htmlarea.js,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- htmlarea.js       9 Dec 2004 14:42:46 -0000       1.1.2.1
  +++ htmlarea.js       13 Dec 2004 11:00:00 -0000      1.1.2.2
  @@ -8,7 +8,7 @@
   // Version 3.0 developed by Mihai Bazon.
   //   http://dynarch.com/mishoo/
   //
  -// $Id: htmlarea.js,v 1.1.2.1 2004/12/09 14:42:46 knguyen Exp $
  +// $Id: htmlarea.js,v 1.1.2.2 2004/12/13 11:00:00 knguyen Exp $
   
   if (typeof _editor_url == "string") {
        // Leave exactly one backslash at the end of _editor_url
  @@ -1977,19 +1977,25 @@
   HTMLArea.prototype.ie_checkBackspace = function() {
        var sel = this._getSelection();
        var range = this._createRange(sel);
  -     var r2 = range.duplicate();
  -     r2.moveStart("character", -1);
  -     var a = r2.parentElement();
  -     if (a != range.parentElement() &&
  -         /^a$/i.test(a.tagName)) {
  -             r2.collapse(true);
  -             r2.moveEnd("character", 1);
  -             r2.pasteHTML('');
  -             r2.select();
  -             return true;
  -     }
  +     // the following throws an error in M$IE, if a table is selected        
  +     try {   
  +             var r2 = range.duplicate();
  +             r2.moveStart("character", -1);
  +             var a = r2.parentElement();
  +             if (a != range.parentElement() &&
  +                 /^a$/i.test(a.tagName)) {
  +                     r2.collapse(true);
  +                     r2.moveEnd("character", 1);
  +                     r2.pasteHTML('');
  +                     r2.select();
  +                     return true;
  +             }
  +     } catch (e) {           
  +             // do nothing   
  +     }               
   };
   
  +
   HTMLArea.prototype.dom_checkBackspace = function() {
        var self = this;
        setTimeout(function() {
  

Reply via email to