Changeset 964 for branches


Ignore:
Timestamp:
02/04/08 17:45:53 (12 years ago)
Author:
ray
Message:

copied changes to 0.95 branch

Location:
branches/0.95_stable
Files:
1 deleted
15 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/0.95_stable/XinhaCore.js

    r955 r964  
    139139*/ 
    140140Xinha.is_khtml  = (Xinha.agt.indexOf("khtml") != -1); 
     141/** Browser is WebKit 
     142@type string  
     143*/ 
     144Xinha.is_webkit  = (Xinha.agt.indexOf("applewebkit") != -1); 
    141145/** Browser is Safari 
    142146@type string  
     
    155159*/ 
    156160Xinha.is_win_ie = (Xinha.is_ie && !Xinha.is_mac); 
    157 /** Browserengine is Gecko (Mozilla) 
     161/** Browserengine is Gecko (Mozilla), applies also to Safari 
    158162@type string  
    159163*/ 
    160 Xinha.is_gecko  = (navigator.product == "Gecko" && !Xinha.is_safari); // Safari lies! 
     164Xinha.is_gecko  = (navigator.product == "Gecko"); 
     165Xinha.is_real_gecko = (navigator.product == "Gecko" && !Xinha.is_webkit); 
    161166/** File is opened locally opened ("file://" protocol) 
    162167 * @type string 
     
    20372042    editor._browserSpecificPlugin = editor.registerPlugin('InternetExplorer'); 
    20382043  } 
    2039   else 
     2044  else if (Xinha.is_webkit) 
     2045  { 
     2046    url = _editor_url + 'modules/WebKit/WebKit.js'; 
     2047    if ( !Xinha.loadPlugins(["WebKit"], function() { editor.generate(); }, url ) ) 
     2048    {             
     2049   
     2050      return false; 
     2051    } 
     2052    editor._browserSpecificPlugin = editor.registerPlugin('WebKit'); 
     2053  } 
     2054  else if (Xinha.is_gecko) 
    20402055  { 
    20412056    url = _editor_url + 'modules/Gecko/Gecko.js'; 
     
    28562871    } catch (ex) {} 
    28572872  } 
    2858   else if ( !Xinha.is_gecko && this._doc.body.contentEditable !== false ) 
     2873  else if ( !Xinha.is_designMode && this._doc.body.contentEditable !== false ) 
    28592874  { 
    28602875    this._doc.body.contentEditable = false; 
     
    44274442     editor._doc.execCommand('useCSS', false, false); // useCSS deprecated & replaced by styleWithCSS  
    44284443     editor._doc.execCommand('styleWithCSS', false, true);  
    4429       
     4444 
    44304445    } catch (ex) {} 
    44314446  } 
     
    50895104Xinha._object = null; 
    50905105 
     5106/** Arrays are identified as "object" in typeof calls. Adding this tag to the Array prototype allows to distinguish between the two 
     5107 */ 
     5108Array.prototype.isArray = true; 
     5109/** RegExps are identified as "object" in typeof calls. Adding this tag to the RegExp prototype allows to distinguish between the two 
     5110 */ 
     5111RegExp.prototype.isRegExp = true; 
    50915112/** function that returns a clone of the given object 
    50925113 *   
     
    51015122    return null; 
    51025123  } 
    5103  
    5104   var newObj = {}; 
    5105  
    5106   // check for array objects 
    5107   if ( obj.constructor.toString().match( /\s*function Array\(/ ) ) 
    5108   { 
    5109     newObj = obj.constructor(); 
    5110   } 
     5124  var newObj = (obj.isArray ) ? [] : {}; 
    51115125 
    51125126  // check for function and RegExp objects (as usual, IE is fucked up) 
    5113   if ( obj.constructor.toString().match( /\s*function Function\(/ ) ) 
     5127  if ( obj.constructor.toString().match( /\s*function Function\(/ ) || typeof obj == 'function' ) 
    51145128  { 
    51155129    newObj = obj; // just copy reference to it 
    51165130  } 
    5117   else if (  obj.constructor.toString().match( /\s*function RegExp\(/ ) ) 
     5131  else if (  obj.isRegExp ) 
    51185132  { 
    51195133    newObj = eval( obj.toString() ); //see no way without eval 
     
    57915805    + ".htmtableborders, .htmtableborders td, .htmtableborders th {border : 1px dashed lightgrey ! important;}\n" 
    57925806    + "html, body { border: 0px; } \n" 
    5793     + "body { background-color: #ffffff; } \n"  
     5807    + "body { background-color: #ffffff; } \n" 
     5808        + "img, hr { cursor: default } \n"   
    57945809    +"</style>\n"; 
    57955810     
     
    60906105// Unless somebody already has, make a little function to debug things 
    60916106 
    6092 if ( typeof dump == 'undefined' ) 
    6093 { 
    6094   function dump(o) 
     6107if (typeof dumpValues == 'undefined')  
     6108{ 
     6109  function dumpValues(o) 
    60956110  { 
    60966111    var s = ''; 
    6097     for ( var prop in o ) 
    6098     { 
    6099                  s += prop + ' = ' + o[prop] + '\n'; 
    6100           } 
    6101     var x = window.open("", "debugger"); 
    6102     x.document.write('<pre>' + s + '</pre>'); 
    6103   } 
    6104     } 
     6112    for (var prop in o)  
     6113    { 
     6114      if (window.console && typeof window.console.log == 'function')  
     6115      { 
     6116        if (typeof console.firebug != 'undefined')  
     6117          console.log(o); 
     6118        else  
     6119          console.log(prop + ' = ' + o[prop] + '\n'); 
     6120      } 
     6121      else  
     6122        s += prop + ' = ' + o[prop] + '\n'; 
     6123    } 
     6124    if (s)  
     6125    { 
     6126      var x = window.open("", "debugger"); 
     6127      x.document.write('<pre>' + s + '</pre>'); 
     6128    } 
     6129  } 
     6130} 
    61056131if ( !Array.prototype.contains ) 
    61066132{ 
     
    70577083  try 
    70587084  {     
    7059     if (typeof XMLHttpRequest == "function") 
     7085    if (typeof XMLHttpRequest != "undefined" && typeof XMLHttpRequest.constructor == 'function' ) // Safari's XMLHttpRequest is typeof object 
    70607086    { 
    70617087          return new XMLHttpRequest(); 
  • branches/0.95_stable/XinhaLoader.js

    r955 r964  
    88Xinha.is_opera  = (Xinha.agt.indexOf("opera") != -1); 
    99Xinha.is_khtml  = (Xinha.agt.indexOf("khtml") != -1); 
     10Xinha.is_webkit  = (Xinha.agt.indexOf("applewebkit") != -1); 
    1011Xinha.is_safari  = (Xinha.agt.indexOf("safari") != -1); 
    1112Xinha.opera_version = navigator.appVersion.substring(0, navigator.appVersion.indexOf(" "))*1; 
     
    1617Xinha.isRunLocally = document.URL.toLowerCase().search(/^file:/) != -1; 
    1718Xinha.is_designMode = (typeof document.designMode != 'undefined' && !Xinha.is_ie); // IE has designMode, but we're not using it 
    18 Xinha.isSupportedBrowser = Xinha.is_gecko || (Xinha.is_opera && Xinha.opera_version >= 9.1) || Xinha.ie_version >= 5.5; 
     19Xinha.isSupportedBrowser = Xinha.is_gecko || (Xinha.is_opera && Xinha.opera_version >= 9.1) || Xinha.ie_version >= 5.5 || Xinha.is_safari; 
    1920 
    2021Xinha.loadPlugins = function(plugins, callbackIfNotReady) 
  • branches/0.95_stable/examples/Newbie.html

    r917 r964  
    1818<form action=""> 
    1919<div> 
    20 <textarea id="myTextArea" name="myTextArea" rows="10" cols="50" style="width: 100%"></textarea> 
     20<textarea id="myTextArea" name="myTextArea" rows="25" cols="50" style="width: 100%"></textarea> 
    2121</div> 
    2222</form> 
  • branches/0.95_stable/examples/testbed.html

    r897 r964  
    153153        &lt;/style&gt; 
    154154      &lt;/head&gt; 
    155       &lt;body&gt; 
    156       &lt;img src="http://xinha.python-hosting.com/trac/logo.jpg" usemap="#m1"&gt; 
     155      &lt;body&gt;&lt;span style="color:purple"&gt; 
     156      &lt;img src="../images/xinha_logo.gif" usemap="#m1"&gt; 
    157157      &lt;map name="m1"&gt; 
    158158      &lt;area shape="rect" coords="137,101,255,124" href="http://www.mydomain.com"&gt; 
     
    163163        Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis 
    164164        velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique 
    165         ante elementum turpis. Aliquam nisl. Nulla posuere neque non 
    166         tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis 
     165        ante elementum turpis.  &lt;span style="color:green">Aliquam &lt;/span> nisl. Nulla posuere neque non 
     166        tellus. Morbi vel nibh. &lt;font face="Arial">&lt;font color="#009933">Cum  sociis natoque&lt;/font>&lt;/font&gt; penatibus et magnis dis 
    167167        parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi. 
    168168        Curabitur pharetra bibendum lectus. 
     
    170170 
    171171      &lt;ul&gt; 
    172         &lt;li&gt; Phasellus et massa sed diam viverra semper.  &lt;/li&gt; 
     172        &lt;li style="color:green"&gt; Phasellus et massa sed diam viverra semper.  &lt;/li&gt; 
    173173        &lt;li&gt; Mauris tincidunt felis in odio.              &lt;/li&gt; 
    174174        &lt;li&gt; Nulla placerat nunc ut pede.                 &lt;/li&gt; 
     
    177177        &lt;li&gt; Nunc sit amet metus in tortor semper mattis. &lt;/li&gt; 
    178178      &lt;/ul&gt; 
    179       &lt;/body&gt; 
     179      &lt;/span&gt;&lt;/body&gt; 
    180180      &lt;/html&gt; 
    181181    </textarea> 
  • branches/0.95_stable/modules/FullScreen/full-screen.js

    r738 r964  
    186186    this._htmlArea.style.left     = e.config.fullScreenMargins[3] + 'px'; 
    187187    this._htmlArea.style.top      = e.config.fullScreenMargins[0] + 'px'; 
    188     if ( !Xinha.is_ie ) this._htmlArea.style.border   = 'none'; 
     188    if ( !Xinha.is_ie && !Xinha.is_webkit ) this._htmlArea.style.border   = 'none'; 
    189189    this._isFullScreen = true; 
    190190    resetScroll(); 
  • branches/0.95_stable/modules/Gecko/Gecko.js

    r955 r964  
    189189/*  This is now handled by a plugin   
    190190    case 13: // ENTER 
    191       if( !ev.shiftKey && editor.config.mozParaHandler == 'dirty' ) 
    192       { 
    193         this.dom_checkInsertP(); 
    194         Xinha._stopEvent(ev); 
    195       } 
     191 
    196192    break;*/ 
    197193 
     
    370366      return true; // Indicate paste is done, stop command being issued to browser by Xinha.prototype.execCommand 
    371367    } 
     368    break; 
     369    case 'removeformat': 
     370      var editor = this.editor; 
     371      var sel = editor.getSelection(); 
     372      var selSave = editor.saveSelection(sel); 
     373      var range = editor.createRange(sel); 
     374 
     375      var els = editor._doc.body.getElementsByTagName('*'); 
     376 
     377      var start = ( range.startContainer.nodeType == 1 ) ? range.startContainer : range.startContainer.parentNode; 
     378      var i, el; 
     379      if (sel.isCollapsed) range.selectNodeContents(editor._doc.body); 
     380       
     381      for (i=0; i<els.length;i++) 
     382      { 
     383        el = els[i]; 
     384        if ( range.isPointInRange(el, 0) || (els[i] == start && range.startOffset == 0)) 
     385        { 
     386          el.removeAttribute('style'); 
     387        } 
     388      } 
     389      this.editor._doc.execCommand(cmdID, UI, param); 
     390      editor.restoreSelection(selSave); 
     391      return true; 
     392    break; 
    372393  } 
    373394   
     
    620641{ 
    621642  var sel = this.getSelection(); 
     643  if (sel.isCollapsed) return ''; 
    622644  var range = this.createRange(sel); 
    623645  return Xinha.getHTML(range.cloneContents(), false, this); 
     
    710732      var after = ta.value.substring( index, ta.value.length ); 
    711733 
    712       if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, and inside the body) 
     734      if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, entities, and inside the body) 
    713735      { 
    714736        var tagEnd = after.indexOf(">") + 1; 
     
    716738      } 
    717739      else ta.value = before + cc + after; 
     740      ta.value = ta.value.replace(new RegExp ('(&[^'+cc+']*?)('+cc+')([^'+cc+']*?;)'), "$1$3$2"); 
    718741      ta.value = ta.value.replace(new RegExp ('(<script[^>]*>[^'+cc+']*?)('+cc+')([^'+cc+']*?<\/script>)'), "$1$3$2"); 
    719742      ta.value = ta.value.replace(new RegExp ('^([^'+cc+']*)('+cc+')([^'+cc+']*<body[^>]*>)(.*?)'), "$1$3$2$4"); 
  • branches/0.95_stable/modules/GetHtml/DOMwalk.js

    r943 r964  
    147147          } 
    148148          var name = a.nodeName.toLowerCase(); 
    149           if ( /_moz_editor_bogus_node/.test(name) ) 
     149          if ( /_moz_editor_bogus_node/.test(name) || ( name == 'class' && a.nodeValue == 'webkit-block-placeholder') ) 
    150150          { 
    151151            html = ""; 
     
    181181            { 
    182182              value = a.nodeValue; 
     183                          if (name == 'class') 
     184                          { 
     185                                value = value.replace(/Apple-style-span/,''); 
     186                                if (!value) continue; 
     187                          } 
    183188              // IE seems not willing to return the original values - it converts to absolute 
    184189              // links using a.nodeValue, a.value, a.stringValue, root.getAttribute("href") 
  • branches/0.95_stable/modules/GetHtml/TransformInnerHTML.js

    r919 r964  
    3434 
    3535Xinha.RegExpCache = [ 
    36 /*00*/  new RegExp().compile(/<\s*\/?([^\s\/>]+)[\s*\/>]/gi),//lowercase tags 
    37 /*01*/  new RegExp().compile(/(\s+)_moz[^=>]*=[^\s>]*/gi),//strip _moz attributes 
    38 /*02*/  new RegExp().compile(/\s*=\s*(([^'"][^>\s]*)([>\s])|"([^"]+)"|'([^']+)')/g),// find attributes 
    39 /*03*/  new RegExp().compile(/\/>/g),//strip singlet terminators 
    40 /*04*/  new RegExp().compile(/<(br|hr|img|input|link|meta|param|embed|area)((\s*\S*="[^"]*")*)>/g),//terminate singlet tags 
    41 /*05*/  new RegExp().compile(/(<\w+\s+(\w*="[^"]*"\s+)*)(checked|compact|declare|defer|disabled|ismap|multiple|no(href|resize|shade|wrap)|readonly|selected)([\s>])/gi),//expand singlet attributes 
    42 /*06*/  new RegExp().compile(/(="[^']*)'([^'"]*")/),//check quote nesting 
    43 /*07*/  new RegExp().compile(/&(?=(?!(#[0-9]{2,5};|[a-zA-Z0-9]{2,6};|#x[0-9a-fA-F]{2,4};))[^<]*>)/g),//expand query ampersands not in html entities 
    44 /*08*/  new RegExp().compile(/<\s+/g),//strip tagstart whitespace 
    45 /*09*/  new RegExp().compile(/\s+(\/)?>/g),//trim whitespace 
    46 /*10*/  new RegExp().compile(/\s{2,}/g),//trim extra whitespace 
    47 /*11*/  new RegExp().compile(/\s+([^=\s]+)((="[^"]+")|([\s>]))/g),// lowercase attribute names 
    48 /*12*/  new RegExp().compile(/\s+contenteditable(=[^>\s\/]*)?/gi),//strip contenteditable 
    49 /*13*/  new RegExp().compile(/((href|src)=")([^\s]*)"/g), //find href and src for stripBaseHref() 
    50 /*14*/  new RegExp().compile(/<\/?(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|br|hr|img|embed|param|pre|script|html|head|body|meta|link|title|area|input|form|textarea|select|option)[^>]*>/g), 
    51 /*15*/  new RegExp().compile(/<\/(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g),//blocklevel closing tag 
    52 /*16*/  new RegExp().compile(/<(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g),//blocklevel opening tag 
    53 /*17*/  new RegExp().compile(/<(td|th|li|option|br|hr|embed|param|pre|meta|link|title|area|input|textarea)[^>]*>/g),//singlet tag or output on 1 line 
    54 /*18*/  new RegExp().compile(/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g),//find content NOT inside pre and script tags 
    55 /*19*/  new RegExp().compile(/(<pre[^>]*>)([\s\S])*?(<\/pre>)/g),//find content inside pre tags 
    56 /*20*/  new RegExp().compile(/(^|<!--[\s\S]*?-->)([\s\S]*?)(?=<!--[\s\S]*?-->|$)/g),//find content NOT inside comments 
    57 /*21*/  new RegExp().compile(/\S*=""/g), //find empty attributes 
    58 /*22*/  new RegExp().compile(/<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<\/?\w[^>]*>/g), //find all tags, including comments and php 
    59 /*23*/  new RegExp().compile(/(^|<\/script>)[\s\S]*?(<script[^>]*>|$)/g) //find content NOT inside script tags 
     36/*00*/  /<\s*\/?([^\s\/>]+)[\s*\/>]/gi,//lowercase tags 
     37/*01*/  /(\s+)_moz[^=>]*=[^\s>]*/gi,//strip _moz attributes 
     38/*02*/  /\s*=\s*(([^'"][^>\s]*)([>\s])|"([^"]+)"|'([^']+)')/g,// find attributes 
     39/*03*/  /\/>/g,//strip singlet terminators 
     40/*04*/  /<(br|hr|img|input|link|meta|param|embed|area)((\s*\S*="[^"]*")*)>/g,//terminate singlet tags 
     41/*05*/  /(<\w+\s+(\w*="[^"]*"\s+)*)(checked|compact|declare|defer|disabled|ismap|multiple|no(href|resize|shade|wrap)|readonly|selected)([\s>])/gi,//expand singlet attributes 
     42/*06*/  /(="[^']*)'([^'"]*")/,//check quote nesting 
     43/*07*/  /&(?=(?!(#[0-9]{2,5};|[a-zA-Z0-9]{2,6};|#x[0-9a-fA-F]{2,4};))[^<]*>)/g,//expand query ampersands not in html entities 
     44/*08*/  /<\s+/g,//strip tagstart whitespace 
     45/*09*/  /\s+(\/)?>/g,//trim whitespace 
     46/*10*/  /\s{2,}/g,//trim extra whitespace 
     47/*11*/  /\s+([^=\s]+)((="[^"]+")|([\s>]))/g,// lowercase attribute names 
     48/*12*/  /\s+contenteditable(=[^>\s\/]*)?/gi,//strip contenteditable 
     49/*13*/  /((href|src)=")([^\s]*)"/g, //find href and src for stripBaseHref() 
     50/*14*/  /<\/?(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|br|hr|img|embed|param|pre|script|html|head|body|meta|link|title|area|input|form|textarea|select|option)[^>]*>/g, 
     51/*15*/  /<\/(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g,//blocklevel closing tag 
     52/*16*/  /<(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g,//blocklevel opening tag 
     53/*17*/  /<(td|th|li|option|br|hr|embed|param|pre|meta|link|title|area|input|textarea)[^>]*>/g,//singlet tag or output on 1 line 
     54/*18*/  /(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g,//find content NOT inside pre and script tags 
     55/*19*/  /(<pre[^>]*>)([\s\S])*?(<\/pre>)/g,//find content inside pre tags 
     56/*20*/  /(^|<!--[\s\S]*?-->)([\s\S]*?)(?=<!--[\s\S]*?-->|$)/g,//find content NOT inside comments 
     57/*21*/  /\S*=""/g, //find empty attributes 
     58/*22*/  /<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<\/?\w[^>]*>/g, //find all tags, including comments and php 
     59/*23*/  /(^|<\/script>)[\s\S]*?(<script[^>]*>|$)/g //find content NOT inside script tags 
    6060]; 
    61  
     61// compile for performance; WebKit doesn't support this 
     62if (typeof RegExp.prototype.compile == 'function') { 
     63        for (var i=0; i<Xinha.RegExpCache.length;i++ ) { 
     64                Xinha.RegExpCache[i] = new RegExp().compile(Xinha.RegExpCache[i]); 
     65        } 
     66} 
    6267/**  
    6368  * Cleans HTML into wellformed xhtml 
  • branches/0.95_stable/modules/InternetExplorer/InternetExplorer.js

    r943 r964  
    164164    // #645 IE only saves the initial content of the iframe, so we create a temporary iframe with the current editor contents 
    165165    case 'saveas': 
    166     { 
    167166        var doc = null; 
    168167        var editor = this.editor; 
     
    248247        document.body.removeChild(iframe); 
    249248      return true; 
    250     } 
     249    break; 
     250    case 'removeformat': 
     251      var editor = this.editor; 
     252      var sel = editor.getSelection(); 
     253      var selSave = editor.saveSelection(sel); 
     254 
     255      var i, el, els; 
     256 
     257      function clean (el) 
     258      { 
     259        if (el.nodeType != 1) return; 
     260        el.removeAttribute('style'); 
     261        for (var j=0; j<el.childNodes.length;j++) 
     262        { 
     263          clean(el.childNodes[j]); 
     264        } 
     265        if ( (el.tagName.toLowerCase() == 'span' && !el.attributes.length ) || el.tagName.toLowerCase() == 'font') 
     266        { 
     267          el.outerHTML = el.innerHTML; 
     268        } 
     269      } 
     270      if ( editor.selectionEmpty(sel) ) 
     271      { 
     272        els = editor._doc.body.childNodes; 
     273        for (i = 0; i < els.length; i++)  
     274        { 
     275          el = els[i]; 
     276          if (el.nodeType != 1) continue; 
     277          if (el.tagName.toLowerCase() == 'span') 
     278          { 
     279            newNode = editor.convertNode(el, 'div'); 
     280            el.parentNode.replaceChild(newNode, el); 
     281            el = newNode; 
     282          } 
     283          clean(el); 
     284        } 
     285      }  
     286      editor._doc.execCommand(cmdID, UI, param); 
     287 
     288      editor.restoreSelection(selSave); 
     289      return true; 
     290    break; 
    251291  } 
    252292   
     
    393433Xinha.prototype.saveSelection = function() 
    394434{ 
    395   return this.createRange(this._getSelection()) 
     435  return this.createRange(this.getSelection()) 
    396436} 
    397437/**  
     
    455495{ 
    456496  var sel = this.getSelection(); 
     497  if (this.selectionEmpty) return ''; 
    457498  var range = this.createRange(sel); 
    458499   
     
    488529Xinha.prototype.createRange = function(sel) 
    489530{ 
     531  if (!sel) sel = this.getSelection(); 
    490532  return sel.createRange(); 
    491533}; 
     
    542584    var after  = ta.value.substring( index + cc.length , ta.value.length ); 
    543585     
    544     if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, and inside the body) 
     586    if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, entities, and inside the body) 
    545587    { 
    546588      var tagEnd = after.indexOf(">") + 1; 
     
    548590    } 
    549591    else ta.value = before + cc + after; 
     592    ta.value = ta.value.replace(new RegExp ('(&[^'+cc+']*?)('+cc+')([^'+cc+']*?;)'), "$1$3$2"); 
    550593    ta.value = ta.value.replace(new RegExp ('(<script[^>]*>[^'+cc+']*?)('+cc+')([^'+cc+']*?<\/script>)'), "$1$3$2"); 
    551594    ta.value = ta.value.replace(new RegExp ('^([^'+cc+']*)('+cc+')([^'+cc+']*<body[^>]*>)(.*?)'), "$1$3$2$4"); 
  • branches/0.95_stable/plugins/ExtendedFileManager/assets/manager.css

    r937 r964  
    1010.dirs { padding: 1em;   } 
    1111 
    12 .imageFrame { overflow-x:hidden; width: 100%; height: 145px; margin:0px; background-color: #fff;} 
     12.imageFrame { overflow-x:hidden; width: 100%; height: 155px; margin:0px; background-color: #fff;} 
    1313.smallWidth{ width: 4em; } 
    1414.largelWidth{ width: 30em; } 
  • branches/0.95_stable/plugins/ExtendedFileManager/assets/manager.js

    r955 r964  
    5656         
    5757        var w = 650; 
    58         var h = 200; 
     58        var h = 600; 
    5959         
    6060        window.resizeTo(w,h); 
     
    235235                } 
    236236        }; 
    237         imgManager.location.replace( iframeUrl ); 
     237        imgManager.location.replace(iframeUrl); 
    238238 
    239239    if (manager_mode == 'image' && typeof Xinha.colorPicker != "undefined" && document.getElementById('f_backgroundColor') && document.getElementById('f_backgroundColor').type == 'text') { 
     
    250250      new Xinha.colorPicker.InputBinding(document.getElementById('f_borderColor'),pickerConfig); 
    251251    } 
    252         setTimeout(function() { addEvent(window, 'resize', resize); }, 500); 
     252        setTimeout(function() { resize();addEvent(window, 'resize', resize); }, 500); 
    253253} 
    254254 
  • branches/0.95_stable/plugins/ExtendedFileManager/manager.php

    r937 r964  
    104104                echo 'var manager_mode="image";'; 
    105105        } 
     106        //IE doesn't like a relative URL when changing a window's location 
     107        $iframe_url = str_replace( array("backend.php","manager.php"), "", $_SERVER["PHP_SELF"] ) . $IMConfig['backend_url']; 
    106108        ?> 
    107109         
    108         var iframeUrl = '<?php print $IMConfig['backend_url']; ?>__function=images&mode=<?php echo $insertMode;?>&viewtype=<?php echo $IMConfig['view_type'] ?>'; 
     110        var iframeUrl = '<?php print $iframe_url ?>__function=images&mode=<?php echo $insertMode;?>&viewtype=<?php echo $IMConfig['view_type'] ?>'; 
    109111 
    110112/* ]]> */ 
  • branches/0.95_stable/plugins/SmartReplace/smart-replace.js

    r752 r964  
    107107        var editor = this.editor; 
    108108        var charCode =  Xinha.is_ie ? ev.keyCode : ev.charCode; 
    109          
     109 
    110110        var key = String.fromCharCode(charCode); 
    111111 
     
    138138                 
    139139        var sel = editor.getSelection(); 
    140          
     140 
    141141        if (Xinha.is_ie) 
    142142        { 
     
    161161        else 
    162162        { 
    163                 if (!sel.isCollapsed) 
     163                var r = editor.createRange(sel); 
     164 
     165                if (!r.collapsed) 
    164166                { 
    165167                        editor.insertNodeAtSelection(document.createTextNode('')); 
    166168                } 
    167                 if (sel.anchorOffset > 0) sel.extend(sel.anchorNode,sel.anchorOffset-1); 
     169                if (r.startOffset > 0) r.setStart(r.startContainer, r.startOffset -1); 
     170 
    168171                 
    169                 if(sel.toString().match(/\S/)) 
    170                 { 
    171                         sel.collapse(sel.anchorNode,sel.anchorOffset); 
     172                if(r.toString().match(/[^\s\xA0]/)) 
     173                { 
     174                        r.collapse(false); 
    172175                        editor.insertNodeAtSelection(document.createTextNode(closing)); 
    173176                } 
    174177                else 
    175178                { 
    176                         sel.collapse(sel.anchorNode,sel.anchorOffset); 
    177                         editor.insertNodeAtSelection(document.createTextNode(opening)); 
    178                 } 
     179                        r.deleteContents(); 
     180                        editor.insertNodeAtSelection(document.createTextNode(' '+opening));                              
     181                } 
     182                editor.getSelection().collapseToEnd(); 
    179183        } 
    180184} 
     
    184188        var editor = this.editor; 
    185189        var sel = this.editor.getSelection(); 
     190        var r = this.editor.createRange(sel); 
     191         
    186192        if (Xinha.is_ie) 
    187193        { 
    188                 var r = this.editor.createRange(sel); 
    189194                r.moveStart('character', -2); 
    190195                 
     
    196201        else 
    197202        { 
    198                 sel.extend(sel.anchorNode,sel.anchorOffset-2); 
    199                 if(sel.toString().match(/^-/)) 
    200                 { 
     203                if (r.startOffset > 1) r.setStart(r.startContainer, r.startOffset -2); 
     204 
     205                if(r.toString().match(/^ -/)) 
     206                { 
     207                        r.deleteContents(); 
    201208                        this.editor.insertNodeAtSelection(document.createTextNode(' '+String.fromCharCode(8211))); 
    202209                } 
    203                 sel.collapse(sel.anchorNode,sel.anchorOffset); 
     210                editor.getSelection().collapseToEnd(); 
    204211        } 
    205212} 
  • branches/0.95_stable/release-notes.txt

    r950 r964  
    77Xinha 0.95 (due soon) 
    88Bugs Fixed 
     9 * fixed #1040 htmlRemoveTags doesn't work in IE  
     10 * fixed #645 IE Save as function only saves the original html  
     11 * fixed #1136 FF3 Linux select boxes in toolbar are too small  
    912 * fixed #1100 Extended File Manager - Error after opening window 
    1013 * fixed #1103 [TransformInnerHTML] IE breaks singlet attributes starting with "no" 
     
    2326 * fixed #1015 Mozilla shows scrollbars on click in Stylist  
    2427 * #918 removed mozParaHandler dirty as it had been broken for a long time 
     28 * fixed #1015 Mozilla shows scrollbars on click in Stylist  
     29 * fixed #1148 HTML entities break when cursor is inside when switching from HTML to WYSIWYG  
    2530  
    2631Enhancements 
     32 * #1143  add Safari support 
     33 * #1138 added API functions Xinha.getEditor(), Xinha.prototype.getPluginInstance(), Xinha.addOnloadHandler()  
     34 * #1137 [Equation] FF3 fixes & improved way of avoiding formula changes in editor 
     35 * #1150 synchronize "Remove Format" between browsers 
    2736 * added plugin PreserveScripts for enhanced editing of pages containing PHP and/or JavaScript () 
    2837 * Loading message facelift 
     
    3645 * #442 removed alert "Your Document is not well formed..." 
    3746 * #1119 disabled Firefox 2 spell check when ContextMenu is enabled  
     47 * added a plugin "GenericPlugin" as a democase for plugin event handlers 
    3848 
    3949I18n 
  • branches/0.95_stable/skins/silva/skin.css

    r880 r964  
    7676  border-right: none; 
    7777  width: 1px; 
    78   height: 18px; 
     78  height: 11px; 
    7979  padding: 0px; 
    8080} 
Note: See TracChangeset for help on using the changeset viewer.