Changeset 783


Ignore:
Timestamp:
03/15/07 10:06:49 (13 years ago)
Author:
ray
Message:

updated branch

Location:
branches/ray
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/ray/Xinha.css

    r782 r783  
    278278} 
    279279 
    280 .htmlarea .panel { overflow:auto; } 
     280.htmlarea .panel { overflow:hidden; } 
    281281.htmlarea .panels.left  .panel { border-right:none; border-left:none; } 
    282282.htmlarea .panels.left  h1     { border-right:none;  } 
  • branches/ray/XinhaCore.js

    r782 r783  
    13051305      var i_contain = Xinha.makeBtnImg(btn[1]); 
    13061306      var img = i_contain.firstChild; 
     1307      Xinha.freeLater(i_contain); 
     1308      Xinha.freeLater(img); 
     1309       
    13071310      el.appendChild(i_contain); 
    13081311 
     
    15021505  } 
    15031506 
     1507  this._statusBarItems = []; 
     1508   
    15041509  return statusbar; 
    15051510}; 
     
    17541759  var iframe = document.createElement("iframe"); 
    17551760  iframe.src = _editor_url + editor.config.URIs.blank; 
     1761  iframe.id = "XinhaIFrame_" + this._textArea.id; 
    17561762  this._framework.ed_cell.appendChild(iframe); 
    17571763  this._iframe = iframe; 
     
    19581964Xinha.prototype.sizeEditor = function(width, height, includingBars, includingPanels) 
    19591965{ 
    1960  
     1966  if (this._risizing) return; 
     1967  this._risizing = true; 
     1968   
     1969  this.notifyOf('before_resize', {width:width, height:height}); 
    19611970  // We need to set the iframe & textarea to 100% height so that the htmlarea 
    19621971  // isn't "pushed out" when we get it's height, so we can change them later. 
     
    21302139  } 
    21312140  this._iframe.style.height = edcellheight + 'px';   
    2132 //  this._framework.rp_cell.style.height = edcellheight + 'px'; 
    2133 //  this._framework.lp_cell.style.height = edcellheight + 'px'; 
    2134    
    2135   // (re)size the left and right panels so they are equal the editor height 
    2136 //  for(var i = 0; i < this._panels.left.panels.length; i++) 
    2137 //  { 
    2138 //    this._panels.left.panels[i].style.height = this._iframe.style.height; 
    2139 //  } 
    2140    
    2141 //  for(var i = 0; i < this._panels.right.panels.length; i++) 
    2142 //  { 
    2143 //    this._panels.right.panels[i].style.height = this._iframe.style.height; 
    2144 //  }   
    21452141   
    21462142  var edcellwidth = width; 
     
    21592155      
    21602156  this.notifyOf('resize', {width:this._htmlArea.offsetWidth, height:this._htmlArea.offsetHeight}); 
     2157  this._risizing = false; 
     2158}; 
     2159 
     2160Xinha.prototype.addPanel = function(side) 
     2161{ 
     2162  var div = document.createElement('div'); 
     2163  div.side = side; 
     2164  if ( side == 'left' || side == 'right' ) 
     2165  { 
     2166    div.style.width  = this.config.panel_dimensions[side]; 
     2167    if(this._iframe) div.style.height = this._iframe.style.height;      
     2168  } 
     2169  Xinha.addClasses(div, 'panel'); 
     2170  this._panels[side].panels.push(div); 
     2171  this._panels[side].div.appendChild(div); 
     2172 
     2173  this.notifyOf('panel_change', {'action':'add','panel':div}); 
     2174 
     2175  return div; 
     2176}; 
     2177 
     2178 
     2179Xinha.prototype.removePanel = function(panel) 
     2180{ 
     2181  this._panels[panel.side].div.removeChild(panel); 
     2182  var clean = []; 
     2183  for ( var i = 0; i < this._panels[panel.side].panels.length; i++ ) 
     2184  { 
     2185    if ( this._panels[panel.side].panels[i] != panel ) 
     2186    { 
     2187      clean.push(this._panels[panel.side].panels[i]); 
     2188    } 
     2189  } 
     2190  this._panels[panel.side].panels = clean; 
     2191  this.notifyOf('panel_change', {'action':'remove','panel':panel}); 
     2192}; 
     2193 
     2194Xinha.prototype.hidePanel = function(panel) 
     2195{ 
     2196  if ( panel && panel.style.display != 'none' ) 
     2197  { 
     2198    try { var pos = this.scrollPos(this._iframe.contentWindow); } catch(e) { } 
     2199    panel.style.display = 'none'; 
     2200    this.notifyOf('panel_change', {'action':'hide','panel':panel}); 
     2201    try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 
     2202  } 
     2203}; 
     2204 
     2205Xinha.prototype.showPanel = function(panel) 
     2206{ 
     2207  if ( panel && panel.style.display == 'none' ) 
     2208  { 
     2209    try { var pos = this.scrollPos(this._iframe.contentWindow); } catch(e) {} 
     2210    panel.style.display = ''; 
     2211    this.notifyOf('panel_change', {'action':'show','panel':panel}); 
     2212    try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 
     2213  } 
     2214}; 
     2215 
     2216Xinha.prototype.hidePanels = function(sides) 
     2217{ 
     2218  if ( typeof sides == 'undefined' ) 
     2219  { 
     2220    sides = ['left','right','top','bottom']; 
     2221  } 
     2222 
     2223  var reShow = []; 
     2224  for ( var i = 0; i < sides.length;i++ ) 
     2225  { 
     2226    if ( this._panels[sides[i]].on ) 
     2227    { 
     2228      reShow.push(sides[i]); 
     2229      this._panels[sides[i]].on = false; 
     2230    } 
     2231  } 
     2232  this.notifyOf('panel_change', {'action':'multi_hide','sides':sides}); 
     2233}; 
     2234 
     2235Xinha.prototype.showPanels = function(sides) 
     2236{ 
     2237  if ( typeof sides == 'undefined' ) 
     2238  { 
     2239    sides = ['left','right','top','bottom']; 
     2240  } 
     2241 
     2242  var reHide = []; 
     2243  for ( var i = 0; i < sides.length; i++ ) 
     2244  { 
     2245    if ( !this._panels[sides[i]].on ) 
     2246    { 
     2247      reHide.push(sides[i]); 
     2248      this._panels[sides[i]].on = true; 
     2249    } 
     2250  } 
     2251  this.notifyOf('panel_change', {'action':'multi_show','sides':sides}); 
    21612252}; 
    21622253 
     
    32053296    if ( this.config.statusBar && !noStatus ) 
    32063297    { 
     3298      while ( this._statusBarItems.length ) 
     3299      {  
     3300        var item = this._statusBarItems.pop(); 
     3301        Xinha.free(item); 
     3302      } 
     3303 
    32073304      this._statusBarTree.innerHTML = Xinha._lc("Path") + ": "; // clear 
    32083305      for ( var i = ancestors.length; --i >= 0; ) 
     
    32213318        a.el = el; 
    32223319        a.editor = this; 
     3320        this._statusBarItems.push(a); 
    32233321        Xinha.addDom0Event( 
    32243322          a, 
     
    32603358          this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb))); 
    32613359        } 
     3360        Xinha.freeLater(a); 
    32623361      } 
    32633362    } 
  • branches/ray/modules/Dialogs/inline-dialog.js

    r782 r783  
    212212}; 
    213213 
    214 Xinha.Dialog.background = []; 
    215214Xinha.Dialog.prototype.sizeBackground = function() 
    216215{ 
     
    263262  } 
    264263 
    265   this.editor.deactivateEditor(); 
     264  if ( this.modal ) this.editor.deactivateEditor(); 
    266265 
    267266  // unfortunately we have to hide the editor (iframe/caret bug) 
     
    272271    this.editor._iframe.style.visibility   = 'hidden'; 
    273272  } 
     273   
    274274  if (!this.editor._isFullScreen && this.modal) 
    275275  { 
     
    780780  return html; 
    781781} 
    782  
    783  
    784 Xinha.prototype.addPanel = function(side) 
    785 { 
    786   var div = document.createElement('div'); 
    787   div.side = side; 
    788   if ( side == 'left' || side == 'right' ) 
    789   { 
    790     div.style.width  = this.config.panel_dimensions[side]; 
    791     if(this._iframe) div.style.height = this._iframe.style.height;      
    792   } 
    793   Xinha.addClasses(div, 'panel'); 
    794   this._panels[side].panels.push(div); 
    795   this._panels[side].div.appendChild(div); 
    796  
    797   this.notifyOf('panel_change', {'action':'add','panel':div}); 
    798  
    799   return div; 
    800 }; 
    801  
    802  
    803 Xinha.prototype.removePanel = function(panel) 
    804 { 
    805   this._panels[panel.side].div.removeChild(panel); 
    806   var clean = []; 
    807   for ( var i = 0; i < this._panels[panel.side].panels.length; i++ ) 
    808   { 
    809     if ( this._panels[panel.side].panels[i] != panel ) 
    810     { 
    811       clean.push(this._panels[panel.side].panels[i]); 
    812     } 
    813   } 
    814   this._panels[panel.side].panels = clean; 
    815   this.notifyOf('panel_change', {'action':'remove','panel':panel}); 
    816 }; 
    817  
    818 Xinha.prototype.hidePanel = function(panel) 
    819 { 
    820   if ( panel && panel.style.display != 'none' ) 
    821   { 
    822     try { var pos = this.scrollPos(this._iframe.contentWindow); } catch(e) { } 
    823     panel.style.display = 'none'; 
    824     this.notifyOf('panel_change', {'action':'hide','panel':panel}); 
    825     try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 
    826   } 
    827 }; 
    828  
    829 Xinha.prototype.showPanel = function(panel) 
    830 { 
    831   if ( panel && panel.style.display == 'none' ) 
    832   { 
    833     try { var pos = this.scrollPos(this._iframe.contentWindow); } catch(e) { } 
    834         panel.style.display = '';     
    835     this.notifyOf('panel_change', {'action':'show','panel':panel}); 
    836     try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 
    837   } 
    838 }; 
    839  
    840 Xinha.prototype.hidePanels = function(sides) 
    841 { 
    842   if ( typeof sides == 'undefined' ) 
    843   { 
    844     sides = ['left','right','top','bottom']; 
    845   } 
    846  
    847   var reShow = []; 
    848   for ( var i = 0; i < sides.length;i++ ) 
    849   { 
    850     if ( this._panels[sides[i]].on ) 
    851     { 
    852       reShow.push(sides[i]); 
    853       this._panels[sides[i]].on = false; 
    854     } 
    855   } 
    856   this.notifyOf('panel_change', {'action':'multi_hide','sides':sides}); 
    857 }; 
    858  
    859 Xinha.prototype.showPanels = function(sides) 
    860 { 
    861   if ( typeof sides == 'undefined' ) 
    862   { 
    863     sides = ['left','right','top','bottom']; 
    864   } 
    865  
    866   var reHide = []; 
    867   for ( var i = 0; i < sides.length; i++ ) 
    868   { 
    869     if ( !this._panels[sides[i]].on ) 
    870     { 
    871       reHide.push(sides[i]); 
    872       this._panels[sides[i]].on = true; 
    873     } 
    874   } 
    875   this.notifyOf('panel_change', {'action':'multi_show','sides':sides}); 
    876 }; 
    877782 
    878783Xinha.PanelDialog = function(editor, side, html, localizer) 
  • branches/ray/plugins/Stylist/stylist.js

    r762 r783  
    44 */ 
    55 
    6 HTMLArea.Config.prototype.css_style = { }; 
     6Xinha.Config.prototype.css_style = { }; 
    77 
    88/** 
    99 * This method loads an external stylesheet and uses it in the stylist 
    1010 */ 
    11 HTMLArea.Config.prototype.stylistLoadStylesheet = function(url, altnames) 
     11Xinha.Config.prototype.stylistLoadStylesheet = function(url, altnames) 
    1212{ 
    1313  if(!altnames) altnames = { }; 
    14   var newStyles = HTMLArea.ripStylesFromCSSFile(url); 
     14  var newStyles = Xinha.ripStylesFromCSSFile(url); 
    1515  for(var i in newStyles) 
    1616  { 
     
    3030 * This method takes raw style definitions and uses them in the stylist 
    3131 */ 
    32 HTMLArea.Config.prototype.stylistLoadStyles = function(styles, altnames) 
     32Xinha.Config.prototype.stylistLoadStyles = function(styles, altnames) 
    3333{ 
    3434  if(!altnames) altnames = { }; 
    35   var newStyles = HTMLArea.ripStylesFromCSSString(styles); 
     35  var newStyles = Xinha.ripStylesFromCSSString(styles); 
    3636  for(var i in newStyles) 
    3737  { 
     
    5252/** 
    5353 * Fill the stylist panel with styles that may be applied to the current selection.  Styles 
    54  * are supplied in the css_style property of the HTMLArea.Config object, which is in the format 
     54 * are supplied in the css_style property of the Xinha.Config object, which is in the format 
    5555 * { '.className' : 'Description' } 
    5656 * classes that are defined on a specific tag (eg 'a.email_link') are only shown in the panel 
     
    6464 * spans will be added where no single _and_entire_ element is selected 
    6565 */ 
    66 HTMLArea.prototype._fillStylist = function() 
     66Xinha.prototype._fillStylist = function() 
    6767{ 
    6868  if(!this._stylist) return false; 
    69   this._stylist.innerHTML = '<h1>'+HTMLArea._lc('Styles', 'Stylist')+'</h1>'; 
     69  this.plugins.Stylist.instance.main.innerHTML = ''; 
    7070 
    7171  var may_apply = true; 
     
    307307      } 
    308308 
    309       this._stylist.appendChild(anch); 
     309      this.plugins.Stylist.instance.main.appendChild(anch); 
    310310    } 
    311311  } 
     
    317317 * (will add a span if none selected) 
    318318 */ 
    319 HTMLArea.prototype._stylistAddClasses = function(el, tag, classes) 
     319Xinha.prototype._stylistAddClasses = function(el, tag, classes) 
    320320  { 
    321321    if(el == 'new') 
     
    340340        } 
    341341 
    342         HTMLArea.addClasses(new_el, classes); 
     342        Xinha.addClasses(new_el, classes); 
    343343      } 
    344344      else 
    345345      { 
    346         HTMLArea._addClasses(el, classes); 
     346        Xinha._addClasses(el, classes); 
    347347      } 
    348348    } 
     
    351351  }; 
    352352   
    353 HTMLArea.prototype._stylistAddIDs = function(el, tag, ids) 
     353Xinha.prototype._stylistAddIDs = function(el, tag, ids) 
    354354  { 
    355355    if(el == 'new') 
     
    374374        } 
    375375 
    376         HTMLArea.addIDs(new_el, ids); 
     376        Xinha.addIDs(new_el, ids); 
    377377      } 
    378378      else 
    379379      { 
    380         HTMLArea._addIDs(el, ids); 
     380        Xinha._addIDs(el, ids); 
    381381      } 
    382382    } 
     
    388388 * Remove the given classes (space seperated list) from the given elements (array of elements) 
    389389 */ 
    390 HTMLArea.prototype._stylistRemoveClasses = function(classes, from) 
     390Xinha.prototype._stylistRemoveClasses = function(classes, from) 
    391391  { 
    392392    for(var x = 0; x < from.length; x++) 
     
    398398  }; 
    399399   
    400 HTMLArea.prototype._stylistRemoveIDs = function(ids, from) 
     400Xinha.prototype._stylistRemoveIDs = function(ids, from) 
    401401  { 
    402402    for(var x = 0; x < from.length; x++) 
     
    408408  };   
    409409 
    410 HTMLArea.prototype._stylistRemoveClassesFull = function(el, classes) 
     410Xinha.prototype._stylistRemoveClassesFull = function(el, classes) 
    411411{ 
    412412  if(el != null) 
     
    435435      // Revert back to what we were IF the classes are identical 
    436436      var last_el = el._stylist_usedToBe[el._stylist_usedToBe.length - 1]; 
    437       var last_classes = HTMLArea.arrayFilter(last_el.className.trim().split(' '), function(c) { if (c == null || c.trim() == '') { return false;} return true; }); 
     437      var last_classes = Xinha.arrayFilter(last_el.className.trim().split(' '), function(c) { if (c == null || c.trim() == '') { return false;} return true; }); 
    438438 
    439439      if( 
     
    441441        || 
    442442        ( 
    443         HTMLArea.arrayContainsArray(new_thiers, last_classes) 
    444         && HTMLArea.arrayContainsArray(last_classes, new_thiers) 
     443        Xinha.arrayContainsArray(new_thiers, last_classes) 
     444        && Xinha.arrayContainsArray(last_classes, new_thiers) 
    445445        ) 
    446446      ) 
     
    477477}; 
    478478 
    479 HTMLArea.prototype._stylistRemoveIDsFull = function(el, ids) 
     479Xinha.prototype._stylistRemoveIDsFull = function(el, ids) 
    480480{ 
    481481  if(el != null) 
     
    504504      // Revert back to what we were IF the classes are identical 
    505505      var last_el = el._stylist_usedToBe[el._stylist_usedToBe.length - 1]; 
    506       var last_ids = HTMLArea.arrayFilter(last_el.id.trim().split(' '), function(c) { if (c == null || c.trim() == '') { return false;} return true; }); 
     506      var last_ids = Xinha.arrayFilter(last_el.id.trim().split(' '), function(c) { if (c == null || c.trim() == '') { return false;} return true; }); 
    507507 
    508508      if( 
     
    510510        || 
    511511        ( 
    512         HTMLArea.arrayContainsArray(new_thiers, last_ids) 
    513         && HTMLArea.arrayContainsArray(last_ids, new_thiers) 
     512        Xinha.arrayContainsArray(new_thiers, last_ids) 
     513        && Xinha.arrayContainsArray(last_ids, new_thiers) 
    514514        ) 
    515515      ) 
     
    549549 * Change the tag of an element 
    550550 */ 
    551 HTMLArea.prototype.switchElementTag = function(el, tag) 
     551Xinha.prototype.switchElementTag = function(el, tag) 
    552552{ 
    553553  var prnt = el.parentNode; 
    554554  var new_el = this._doc.createElement(tag); 
    555555 
    556   if(HTMLArea.is_ie || el.hasAttribute('id'))    new_el.setAttribute('id', el.getAttribute('id')); 
    557   if(HTMLArea.is_ie || el.hasAttribute('style')) new_el.setAttribute('style', el.getAttribute('style')); 
     556  if(Xinha.is_ie || el.hasAttribute('id'))    new_el.setAttribute('id', el.getAttribute('id')); 
     557  if(Xinha.is_ie || el.hasAttribute('style')) new_el.setAttribute('style', el.getAttribute('style')); 
    558558 
    559559  var childs = el.childNodes; 
     
    570570}; 
    571571 
    572 HTMLArea.prototype._getAncestorsClassNames = function(sel) 
     572Xinha.prototype._getAncestorsClassNames = function(sel) 
    573573{ 
    574574  // Scan upwards to find a block level element that we can change or apply to 
     
    576576  if(prnt == null) 
    577577  { 
    578     prnt = (HTMLArea.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer); 
     578    prnt = (Xinha.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer); 
    579579  } 
    580580 
     
    599599}; 
    600600 
    601 HTMLArea.prototype._ancestorsWithClasses = function(sel, tag, classes) 
     601Xinha.prototype._ancestorsWithClasses = function(sel, tag, classes) 
    602602{ 
    603603  var ancestors = [ ]; 
     
    607607    try 
    608608    { 
    609       prnt = (HTMLArea.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer); 
     609      prnt = (Xinha.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer); 
    610610    } 
    611611    catch(e) 
     
    654654}; 
    655655 
    656 HTMLArea.prototype._ancestorsWithIDs = function(sel, tag, ids) 
     656Xinha.prototype._ancestorsWithIDs = function(sel, tag, ids) 
    657657{ 
    658658  var ancestors = [ ]; 
     
    662662    try 
    663663    { 
    664       prnt = (HTMLArea.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer); 
     664      prnt = (Xinha.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer); 
    665665    } 
    666666    catch(e) 
     
    710710 
    711711 
    712 HTMLArea.ripStylesFromCSSFile = function(URL) 
    713 { 
    714   var css = HTMLArea._geturlcontent(URL); 
    715   return HTMLArea.ripStylesFromCSSString(css); 
    716 }; 
    717  
    718 HTMLArea.ripStylesFromCSSString = function(css) 
     712Xinha.ripStylesFromCSSFile = function(URL) 
     713{ 
     714  var css = Xinha._geturlcontent(URL); 
     715  return Xinha.ripStylesFromCSSString(css); 
     716}; 
     717 
     718Xinha.ripStylesFromCSSString = function(css) 
    719719{ 
    720720  // We are only interested in the selectors, the rules are not important 
     
    746746{ 
    747747  this.editor = editor; 
    748   editor._stylist = null; // This needs to be changes to be Stylist::_stylist sometime 
    749   editor._stylist = editor.addPanel('right'); 
    750   HTMLArea.addClass(editor._stylist, 'stylist'); 
    751  
     748  
    752749  var stylist = this; 
    753   editor.notifyOn('modechange', 
    754                   function(e,args) 
    755                   { 
    756                     switch(args.mode) 
    757                     { 
    758                       case 'text': 
    759                       { 
    760                         editor.hidePanel(editor._stylist); 
    761                         break; 
    762                       } 
    763                       case 'wysiwyg': 
    764                       { 
    765                         editor.showPanel(editor._stylist); 
    766                         break; 
    767                       } 
    768                     } 
    769                   } 
    770                   ); 
     750 
    771751} 
    772752 
     
    786766{ 
    787767  var editor = this.editor; 
    788   if(typeof editor.config.css_style == 'undefined' || HTMLArea.objectProperties(editor.config.css_style).length == 0) 
    789   { 
    790     editor.removePanel(editor._stylist); 
    791     editor._stylist = null; 
    792   } 
    793 }; 
     768  var stylist = this; 
     769  if(typeof editor.config.css_style != 'undefined' && Xinha.objectProperties(editor.config.css_style).length != 0) 
     770  { 
     771    editor._stylist = null; // This needs to be changes to be Stylist::_stylist sometime 
     772    editor._stylist = editor.addPanel('right'); 
     773    Xinha.addClass(editor._stylist, 'stylist'); 
     774 
     775    this.caption = document.createElement("h1"); 
     776    this.caption.innerHTML = Xinha._lc('Styles', 'Stylist'); 
     777    editor._stylist.appendChild(this.caption); 
     778    this.main = document.createElement("div"); 
     779    this.main.style.overflow = "auto"; 
     780    this.main.style.height = this.editor._framework.ed_cell.offsetHeight - this.caption.offsetHeight + 'px'; 
     781 
     782    editor._stylist.appendChild(this.main); 
     783 
     784    Xinha.freeLater(this,"caption"); 
     785    Xinha.freeLater(this,"main"); 
     786 
     787    editor.notifyOn('modechange', 
     788      function(e,args) 
     789      { 
     790        switch(args.mode) 
     791        { 
     792          case 'text': 
     793          { 
     794            editor.hidePanel(editor._stylist); 
     795            break; 
     796          } 
     797          case 'wysiwyg': 
     798          { 
     799            editor.showPanel(editor._stylist); 
     800            break; 
     801          } 
     802        } 
     803      } 
     804    ); 
     805    editor.notifyOn('panel_change', 
     806      function(e,args) 
     807      { 
     808        switch (args.action) 
     809        { 
     810          case 'show': 
     811          var newHeight = stylist.main.offsetHeight - args.panel.offsetHeight; 
     812          stylist.main.style.height = ((newHeight > 0) ?  stylist.main.offsetHeight - args.panel.offsetHeight : 0) + 'px'; 
     813          editor._stylist.style.height = stylist.caption.offsetHeight + "px"; 
     814          editor.sizeEditor(); 
     815          break; 
     816          case 'hide': 
     817          stylist.resize(); 
     818          break; 
     819        } 
     820      } 
     821    ); 
     822    editor.notifyOn('before_resize', 
     823    function() 
     824      { 
     825        editor._stylist.style.height = stylist.caption.offsetHeight + "px"; 
     826      } 
     827    ); 
     828    editor.notifyOn('resize', 
     829      function() 
     830      { 
     831        stylist.resize(); 
     832      } 
     833    ); 
     834  } 
     835 
     836}; 
     837Stylist.prototype.resize = function() 
     838{ 
     839  var editor = this.editor; 
     840  var panelContainer = editor._stylist.parentNode; 
     841 
     842  var newSize = panelContainer.offsetHeight; 
     843  for (var i=0; i < panelContainer.childNodes.length;++i) 
     844  { 
     845    if (panelContainer.childNodes[i]==editor._stylist || !panelContainer.childNodes[i].offsetHeight) 
     846    { 
     847      continue; 
     848    } 
     849    newSize -= panelContainer.childNodes[i].offsetHeight; 
     850  } 
     851  editor._stylist.style.height = newSize-5 + 'px'; 
     852  this.main.style.height = newSize - this.caption.offsetHeight -5 + 'px'; 
     853} 
    794854 
    795855Stylist.prototype.onUpdateToolbar = function() 
Note: See TracChangeset for help on using the changeset viewer.