Changeset 796


Ignore:
Timestamp:
03/23/07 20:31:32 (12 years ago)
Author:
ray
Message:

updated branch

Location:
branches/ray
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/ray/XinhaCore.js

    r791 r796  
    41794179  html = html.replace(/<(\/?)strike(\s|>|\/)/ig, "<$1del$2"); 
    41804180   
    4181   // replace window.open to that any clicks won't open a popup in designMode 
    4182   html = html.replace("onclick=\"try{if(document.designMode &amp;&amp; document.designMode == 'on') return false;}catch(e){} window.open(", "onclick=\"window.open("); 
     4181  // remove disabling of inline event handle inside Xinha iframe 
     4182  html = html.replace(/(<[^>]*onclick=['"])if\(window\.top &amp;&amp; window\.top\.Xinha\)\{return false\}/gi,'$1'); 
     4183  html = html.replace(/(<[^>]*onmouseover=['"])if\(window\.top &amp;&amp; window\.top\.Xinha\)\{return false\}/gi,'$1'); 
     4184  html = html.replace(/(<[^>]*onmouseout=['"])if\(window\.top &amp;&amp; window\.top\.Xinha\)\{return false\}/gi,'$1'); 
     4185  html = html.replace(/(<[^>]*onmousedown=['"])if\(window\.top &amp;&amp; window\.top\.Xinha\)\{return false\}/gi,'$1'); 
     4186  html = html.replace(/(<[^>]*onmouseup=['"])if\(window\.top &amp;&amp; window\.top\.Xinha\)\{return false\}/gi,'$1'); 
    41834187 
    41844188  // Figure out what our server name is, and how it's referenced 
     
    42314235  html = html.replace(/<(\/?)del(\s|>|\/)/ig, "<$1strike$2"); 
    42324236 
    4233   // replace window.open to that any clicks won't open a popup in designMode 
    4234   html = html.replace("onclick=\"window.open(", "onclick=\"try{if(document.designMode &amp;&amp; document.designMode == 'on') return false;}catch(e){} window.open("); 
    4235  
     4237  // disable inline event handle inside Xinha iframe 
     4238  html = html.replace(/(<[^>]*onclick=["'])/gi,'$1if(window.top &amp;&amp; window.top.Xinha){return false}'); 
     4239  html = html.replace(/(<[^>]*onmouseover=["'])/gi,'$1if(window.top &amp;&amp; window.top.Xinha){return false}'); 
     4240  html = html.replace(/(<[^>]*onmouseout=["'])/gi,'$1if(window.top &amp;&amp; window.top.Xinha){return false}'); 
     4241  html = html.replace(/(<[^>]*onmouseodown=["'])/gi,'$1if(window.top &amp;&amp; window.top.Xinha){return false}'); 
     4242  html = html.replace(/(<[^>]*onmouseup=["'])/gi,'$1if(window.top &amp;&amp; window.top.Xinha){return false}'); 
     4243   
    42364244  html = this.inwardSpecialReplacements(html); 
    42374245 
     
    53775385 */ 
    53785386  
    5379 Xinha._loadback = function(Url, Callback, Scope, Bonus) 
     5387Xinha._loadback = function(url, callback, scope, bonus) 
    53805388 
    5381   var T = !Xinha.is_ie ? "onload" : 'onreadystatechange'; 
    5382   var S = document.createElement("script"); 
    5383   S.type = "text/javascript"; 
    5384   S.src = Url; 
    5385   S.id = Url; 
    5386   if ( Callback ) 
    5387   { 
    5388     S[T] = function() 
     5389  if ( document.getElementById(url) ) 
     5390  { 
     5391    return true; 
     5392  } 
     5393  var t = !Xinha.is_ie ? "onload" : 'onreadystatechange'; 
     5394  var s = document.createElement("script"); 
     5395  s.type = "text/javascript"; 
     5396  s.src = url; 
     5397  s.id = url; 
     5398  if ( callback ) 
     5399  { 
     5400    s[t] = function() 
    53895401    {       
    53905402      if ( Xinha.is_ie && ( ! ( /loaded|complete/.test(window.event.srcElement.readyState) ) ) ) 
     
    53935405      } 
    53945406       
    5395       Callback.call(Scope ? Scope : this, Bonus); 
    5396       S[T] = null; 
     5407      callback.call(scope ? scope : this, bonus); 
     5408      s[t] = null; 
    53975409    }; 
    53985410  } 
    5399   document.getElementsByTagName("head")[0].appendChild(S); 
     5411  document.getElementsByTagName("head")[0].appendChild(s); 
     5412  return false; 
    54005413}; 
    54015414 
  • branches/ray/examples/testbed.html

    r791 r796  
    3030    // in this example we do a little regular expression to find the absolute path. 
    3131    _editor_url  = document.location.href.replace(/examples\/.*/, '') 
    32     _editor_lang = "de";      // And the language we need to use in the editor. 
     32    _editor_lang = "en";      // And the language we need to use in the editor. 
    3333  </script> 
    3434 
     
    6363       [ 
    6464         'CharacterMap',  
    65         // 'Linker', 
    66         // 'Stylist', 
    67         // 'SmartReplace' 
     65        'Linker', 
     66        'Stylist', 
     67        'SmartReplace' 
    6868       ]; 
    6969             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :) 
     
    8585       xinha_config = xinha_config ? xinha_config : new Xinha.Config(); 
    8686    
    87        // xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); 
     87        xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); 
    8888          
    8989      //xinha_config.CharacterMap.mode = 'panel'; 
     
    148148<body> 
    149149 
    150   <form action="test_dest.php" id="editors_here" onsubmit="alert(this.myTextArea.value);"> 
    151 <input type="checkbox" name="hallo" /> 
    152 <select> 
    153 <option>Test</option> 
    154 </select> 
     150  <form action="" id="editors_here" onsubmit="alert(this.myTextArea.value);"> 
    155151<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 
    156152  <textarea id="myTextArea" name="myTextArea" style="width:100%;height:300px;"> 
    157153    <table cellspacing="1" cellpadding="1" border="1" style="width: 100%;"><tbody><tr><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td></tr><tr><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td></tr></tbody></table><br /></textarea> 
    158154 
    159     <input type="submit" /> <input type="reset" /><input type="checkbox" name="hallo" /> 
    160 <select> 
    161 <option>Test</option> 
    162 </select> 
    163   <textarea name="myTextArea" style="width:100%;height:320px;"> 
    164     <table cellspacing="1" cellpadding="1" border="1" style="width: 100%;"><tbody><tr><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td></tr><tr><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td><td style="width: 25%;">&nbsp;</td></tr></tbody></table><br /></textarea> 
    165  
    166     <input type="submit" /> <input type="reset" /> 
     155<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 
    167156  </form> 
    168157  <script language="javascript"> 
  • branches/ray/modules/ColorPicker/ColorPicker.js

    r791 r796  
    366366        if (e.style.position == 'fixed')  
    367367        { 
    368           this.table.style.position = 'absolute'; 
     368          this.table.style.position = 'fixed'; 
    369369        } 
    370370        top += e.offsetTop; 
  • branches/ray/modules/Gecko/Gecko.js

    r782 r796  
    528528}; 
    529529 
    530  
     530/**  
     531 * Returns a range object to be stored  
     532 * and later restored with Xinha.prototype.restoreSelection() 
     533 *  
     534 * @returns Range 
     535 */ 
     536Xinha.prototype.saveSelection = function() 
     537{ 
     538  return this.createRange(this.getSelection()).cloneRange(); 
     539} 
     540/**  
     541 * Restores a selection previously stored 
     542 * @param savedSelection Range object as returned by Xinha.prototype.restoreSelection() 
     543 */ 
     544Xinha.prototype.restoreSelection = function(savedSelection) 
     545{ 
     546  var sel = this.getSelection(); 
     547  sel.removeAllRanges(); 
     548  sel.addRange(savedSelection); 
     549} 
    531550/** 
    532551 * Selects the contents of the given node.  If the node is a "control" type element, (image, form input, table) 
     
    758777  return d; 
    759778}; 
    760  
    761 Xinha.prototype.saveSelection = function() 
    762 { 
    763   return this.createRange(this.getSelection()).cloneRange(); 
    764 } 
    765 Xinha.prototype.restoreSelection = function(savedSelection) 
    766 { 
    767   var sel = this.getSelection(); 
    768   sel.removeAllRanges(); 
    769   sel.addRange(savedSelection); 
    770 } 
  • branches/ray/modules/InternetExplorer/InternetExplorer.js

    r782 r796  
    279279}; 
    280280 
     281/**  
     282 * Returns a range object to be stored  
     283 * and later restored with Xinha.prototype.restoreSelection() 
     284 *  
     285 * @returns Range 
     286 */ 
     287Xinha.prototype.saveSelection = function() 
     288{ 
     289  return this.createRange(this._getSelection()) 
     290} 
     291/**  
     292 * Restores a selection previously stored 
     293 * @param savedSelection Range object as returned by Xinha.prototype.restoreSelection() 
     294 */ 
     295Xinha.prototype.restoreSelection = function(savedSelection) 
     296{ 
     297  savedSelection.select(); 
     298} 
    281299/** 
    282300 * Selects the contents of the given node.  If the node is a "control" type element, (image, form input, table) 
     
    469487  return (doc.compatMode == "CSS1Compat") ? '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">' : ''; 
    470488}; 
    471  
    472 Xinha.prototype.saveSelection = function() 
    473 { 
    474   return this.createRange(this._getSelection()) 
    475 } 
    476 Xinha.prototype.restoreSelection = function(savedSelection) 
    477 { 
    478   savedSelection.select(); 
    479 } 
  • branches/ray/plugins/ExtendedFileManager/assets/EditorContent.js

    r761 r796  
    482482function setMarker(nx,ny,nw,nh) 
    483483{ 
     484    if (isNaN(nx)) nx = 0;  
     485    if (isNaN(ny)) ny = 0;  
     486    if (isNaN(nw)) nw = 0;  
     487    if (isNaN(nh)) nh = 0;  
     488 
    484489    if (ant == null) 
    485490        ant = MM_findObj("ant"); 
  • branches/ray/plugins/ImageManager/assets/EditorContent.js

    r761 r796  
    488488function setMarker(nx,ny,nw,nh)  
    489489{ 
     490    if (isNaN(nx)) nx = 0; 
     491    if (isNaN(ny)) ny = 0; 
     492    if (isNaN(nw)) nw = 0; 
     493    if (isNaN(nh)) nh = 0; 
     494   
    490495    if (ant == null) 
    491         ant = MM_findObj("ant"); 
     496      ant = MM_findObj("ant"); 
    492497 
    493498    if (canvas == null) 
  • branches/ray/plugins/Stylist/stylist.js

    r791 r796  
    713713Xinha.ripStylesFromCSSFile = function(URL) 
    714714{ 
     715  Xinha.setLoadingMessage('Loading Styles'); 
    715716  var css = Xinha._geturlcontent(URL); 
    716717  return Xinha.ripStylesFromCSSString(css); 
     
    782783  this.dialog = new Xinha.Dialog(editor, html, 'Stylist',{width:200},{modal:false,closable:false}); 
    783784        Xinha._addClass( this.dialog.rootElem, 'Stylist' ); 
    784         //this.dialog.attachToPanel('right'); 
     785        this.dialog.attachToPanel('right'); 
    785786  this.dialog.show(); 
    786787   
Note: See TracChangeset for help on using the changeset viewer.