Changeset 168
- Timestamp:
- 05/18/05 16:14:40 (8 years ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
htmlarea.css (modified) (1 diff)
-
htmlarea.js (modified) (10 diffs)
-
plugins/FullScreen/full-screen.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htmlarea.css
r166 r168 70 70 .htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; } 71 71 72 .htmlarea iframe 73 { 74 border: 1px solid;72 .htmlarea iframe, .htmlarea textarea 73 { 74 border: none; /*1px solid;*/ 75 75 } 76 76 -
trunk/htmlarea.js
r167 r168 190 190 // _must_ be pixel widths if you wish to have config.sizeIncludesPanels = false 191 191 // if you have sizeIncludesPanels true, they can be any valid CSS measurement. 192 // 193 // If you are using Xinha in a "Standards Mode" page (using doctype switching) 194 // then you must use pixel heights for the top and bottom panels, otherwise 195 // it won't work correctly. Also remember that you MUST have the "px" appended 196 // to pixel lengths or it won't work either! 192 197 this.panel_dimensions = 193 198 { … … 1246 1251 fw.table.cellPadding="0"; 1247 1252 fw.table.cellSpacing="0"; 1253 1248 1254 fw.tb_row.style.verticalAlign = 'top'; 1249 1255 fw.tp_row.style.verticalAlign = 'top'; … … 1450 1456 1451 1457 this.sizeEditor(width, height, this.config.sizeIncludesBars, this.config.sizeIncludesPanels); 1452 HTMLArea._addEvent(window, 'resize', function() { editor.sizeEditor() }); 1458 1459 // The resize handler is to allow for heights specified as percentages. 1460 // This has been disabled in compatmode because IE seems to throw a resize 1461 // event up to the window even when you change the dimensions of elements 1462 // on the page rather than the window itself. Which can lead to 1463 // huge amounts of resize events, and possibly getting into infinite loops 1464 // of resize events. 1465 // 1466 // % widths are fine without the event because they are passed through to 1467 // the browser as percentages so it's up to the browser to resize those. 1468 if(!document.compatMode || document.compatMode == 'BackCompat') 1469 { 1470 HTMLArea._addEvent(window, 'resize', function() { editor.sizeEditor(); }); 1471 } 1472 1453 1473 this.notifyOn('panel_change',function(){editor.sizeEditor();}); 1454 1474 } … … 1463 1483 HTMLArea.prototype.sizeEditor = function(width, height, includingBars, includingPanels) 1464 1484 { 1485 1465 1486 if(includingBars != null) this._htmlArea.sizeIncludesToolbars = includingBars; 1466 1487 if(includingPanels != null) this._htmlArea.sizeIncludesPanels = includingPanels; … … 1512 1533 } 1513 1534 1535 // We need to set the iframe & textarea to 100% height so that the htmlarea 1536 // isn't "pushed out" when we get it's height, so we can change them later. 1537 if(this._iframe.style.height != '100%') this._iframe.style.height = '100%'; 1538 if(this._textArea.style.height != '100%') this._textArea.style.height = '100%'; 1539 1514 1540 // At this point we have this._htmlArea.style.width & this._htmlArea.style.height 1515 1541 // which are the size for the OUTER editor area, including toolbars and panels 1516 1542 // now we size the INNER area and position stuff in the right places. 1517 1518 1543 width = this._htmlArea.offsetWidth; 1519 1544 height = this._htmlArea.offsetHeight; … … 1646 1671 this._framework.tb_cell.style.height = this._toolBar.offsetHeight + 'px'; 1647 1672 this._framework.sb_cell.style.height = this._statusBar.offsetHeight + 'px'; 1648 this._iframe.style.height = '100%'; 1673 1674 // Compatability Mode (both IE and Moz), because table cell heights are 1675 // ignored in compatability mode (at least in IE, moz works, but 1676 // I don't think it should so we'll do this for moz too incase it changes) 1677 // we have to set an explicit pixel height on the iframe so as the table 1678 // cell surrounding it takes the available height. 1679 // This means that the panel heights for top & bottom MUST be pixel heights 1680 // if you are using Xinha in a standards mode page. 1681 if( document.compatMode && document.compatMode != 'BackCompat') 1682 { 1683 var edcellheight = height - this._toolBar.offsetHeight - this._statusBar.offsetHeight; 1684 if(this._framework.tp_row.childNodes.length) 1685 { 1686 edcellheight -= parseInt(this.config.panel_dimensions.top); 1687 } 1688 1689 if(this._framework.bp_row.childNodes.length) 1690 { 1691 edcellheight -= parseInt(this.config.panel_dimensions.bottom); 1692 } 1693 this._iframe.style.height = (edcellheight - this._toolBar.offsetHeight - this._statusBar.offsetHeight) + 'px'; 1694 } 1695 else 1696 { 1697 this._iframe.style.height = '100%'; 1698 } 1649 1699 this._iframe.style.width = '100%'; 1650 1700 1651 this._textArea.style.height = '100%';1652 this._textArea.style.width = '100%';1701 this._textArea.style.height = this._iframe.style.height; 1702 this._textArea.style.width = this._iframe.style.width; 1653 1703 1654 1704 this.notifyOf('resize', {width:this._htmlArea.offsetWidth, height:this._htmlArea.offsetHeight}); … … 1795 1845 } catch (e) {} 1796 1846 } 1797 else if(!HTMLArea.is_gecko )1847 else if(!HTMLArea.is_gecko && this._doc.body.contentEditable != true) 1798 1848 { 1799 1849 this._doc.body.contentEditable = true; … … 1818 1868 try {this._doc.designMode = 'off';} catch (e) {} 1819 1869 } 1820 else if(!HTMLArea.is_gecko )1870 else if(!HTMLArea.is_gecko && this._doc.body.contentEditable != false) 1821 1871 { 1822 1872 this._doc.body.contentEditable = false; … … 2891 2941 if(! sel.isCollapsed) 2892 2942 { 2893 if(sel.anchorNode.nodeType == 1) 2943 if(sel.anchorNode.childNodes.length > sel.anchorOffset && sel.anchorNode.childNodes[sel.anchorOffset].nodeType == 1) 2944 { 2945 return sel.anchorNode.childNodes[sel.anchorOffset]; 2946 } 2947 else if(sel.anchorNode.nodeType == 1) 2894 2948 { 2895 2949 return sel.anchorNode; 2950 } 2951 else 2952 { 2953 return sel.anchorNode.parentNode; 2896 2954 } 2897 2955 } … … 3731 3789 editor.updateToolbar(); 3732 3790 editor._timerToolbar = null; 3733 }, 100);3791 }, 250); 3734 3792 }; 3735 3793 -
trunk/plugins/FullScreen/full-screen.js
r166 r168 58 58 // Width & Height of window 59 59 var x,y; 60 if ( self.innerHeight) // all except Explorer60 if (window.innerHeight) // all except Explorer 61 61 { 62 x = self.innerWidth;63 y = self.innerHeight;62 x = window.innerWidth; 63 y = window.innerHeight; 64 64 } 65 65 else if (document.documentElement && document.documentElement.clientHeight) … … 75 75 } 76 76 77 e.sizeEditor(x,y,true,true); 78 /* 79 if(!e._revertFullScreen) e._revertFullScreen = e.getInnerSize(); 80 width = x; 81 height = y - e._toolbar.offsetHeight - (e._statusBar ? e._statusBar.offsetHeight : 0); 82 e.setInnerSize(width,height); 83 84 // IE in standards mode needs us to set the width of the tool & status bar, 85 // I have NO idea why 86 if(HTMLArea.is_ie && document.documentElement && document.documentElement.clientHeight) 87 { 88 e._toolbar.style.width = (width - 12) + 'px'; 89 if(e._statusBar) 90 { 91 e._statusBar.style.width = (width - 12) + 'px'; 92 } 93 } 94 */ 77 e.sizeEditor(x + 'px',y + 'px',true,true); 95 78 e._sizing = false; 96 79 } … … 101 84 e._sizing = true; 102 85 e.initSize(); 103 /*104 e.setInnerSize(e._revertFullScreen.width, e._revertFullScreen.height);105 if(HTMLArea.is_ie && document.documentElement && document.documentElement.clientHeight)106 {107 e._toolbar.style.width = '';108 if(e._statusBar)109 {110 e._statusBar.style.width = '';111 }112 }113 e._revertFullScreen = null;114 */115 86 e._sizing = false; 116 87 }
