Changeset 738
- Timestamp:
- 02/15/07 05:12:43 (6 years ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
Xinha.css (modified) (1 diff)
-
XinhaCore.js (modified) (7 diffs)
-
modules/FullScreen/full-screen.js (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Xinha.css
r736 r738 87 87 color: ButtonText; 88 88 font: 11px Tahoma,Verdana,sans-serif; 89 height:16px; 89 90 } 90 91 -
trunk/XinhaCore.js
r734 r738 101 101 // browser identification 102 102 Xinha.agt = navigator.userAgent.toLowerCase(); 103 Xinha.is_ie = ((Xinha.agt.indexOf("msie") != -1) && (Xinha.agt.indexOf("opera") == -1)); 103 Xinha.is_ie = ((Xinha.agt.indexOf("msie") != -1) && (Xinha.agt.indexOf("opera") == -1)); 104 Xinha.ie_version= parseFloat(Xinha.agt.substring(Xinha.agt.indexOf("msie")+5)); 104 105 Xinha.is_opera = (Xinha.agt.indexOf("opera") != -1); 105 106 Xinha.is_mac = (Xinha.agt.indexOf("mac") != -1); … … 423 424 this.colorPickerSaveColors = 20; 424 425 426 // start up the editor in fullscreen mode 427 this.fullScreen = false; 428 429 // you can tell the fullscreen mode to leave certain margins on each side 430 // the value is an array with the values for [top,right,bottom,left] in that order 431 this.fullScreenMargins = [0,0,0,0]; 432 425 433 /** CUSTOMIZING THE TOOLBAR 426 434 * ------------------------- … … 1518 1526 return false; 1519 1527 } 1528 1529 if ( typeof FullScreen == "undefined" ) 1530 { 1531 Xinha.loadPlugin("FullScreen", function() { editor.generate(); }, _editor_url + 'modules/FullScreen/full-screen.js' ); 1532 return false; 1533 } 1520 1534 1521 1535 var toolbar = editor.config.toolbar; … … 1527 1541 { 1528 1542 case "popupeditor": 1529 if ( typeof FullScreen == "undefined" )1530 {1531 Xinha.loadPlugin("FullScreen", function() { editor.generate(); }, _editor_url + 'modules/FullScreen/full-screen.js' );1532 return false;1533 }1534 1543 editor.registerPlugin('FullScreen'); 1535 1544 break; … … 2372 2381 doc.write(html); 2373 2382 doc.close(); 2374 2383 if ( this.config.fullScreen ) 2384 { 2385 this._fullScreen(); 2386 } 2375 2387 this.setEditorEvents(); 2376 2388 }; … … 4327 4339 }; 4328 4340 4329 // FIXME!!! this should return false for IE < 5.54330 4341 Xinha.checkSupportedBrowser = function() 4331 4342 { … … 4342 4353 } 4343 4354 } 4344 return Xinha.is_gecko || Xinha.i s_ie;4355 return Xinha.is_gecko || Xinha.ie_version >= 5.5; 4345 4356 }; 4346 4357 -
trunk/modules/FullScreen/full-screen.js
r736 r738 12 12 { 13 13 e._fullScreen(); 14 if(e._isFullScreen)15 {16 obj.swapImage([_editor_url + cfg.imgURL + 'ed_buttons_main.gif',9,0]);17 }18 else19 {20 obj.swapImage([_editor_url + cfg.imgURL + 'ed_buttons_main.gif',8,0]);21 }22 14 } 23 15 ); … … 40 32 41 33 FullScreen.prototype._lc = function(string) { 42 return HTMLArea._lc(string, {url : _editor_url + 'modules/FullScreen/lang/',context:"FullScreen"});34 return Xinha._lc(string, {url : _editor_url + 'modules/FullScreen/lang/',context:"FullScreen"}); 43 35 }; 44 36 … … 49 41 */ 50 42 51 HTMLArea.prototype._fullScreen = function()43 Xinha.prototype._fullScreen = function() 52 44 { 53 45 var e = this; … … 57 49 e._sizing = true; 58 50 // Width & Height of window 59 var dim = HTMLArea.viewportSize(); 60 61 e.sizeEditor(dim.x + 'px',dim.y + 'px',true,true); 51 var dim = Xinha.viewportSize(); 52 53 var h = dim.y - e.config.fullScreenMargins[0] - e.config.fullScreenMargins[2]; 54 var w = dim.x - e.config.fullScreenMargins[1] - e.config.fullScreenMargins[3]; 55 56 e.sizeEditor(w + 'px', h + 'px',true,true); 62 57 e._sizing = false; 58 if ( e._toolbarObjects.fullscreen ) e._toolbarObjects.fullscreen.swapImage([_editor_url + cfg.imgURL + 'ed_buttons_main.gif',9,0]); 63 59 } 64 60 … … 69 65 e.initSize(); 70 66 e._sizing = false; 67 if ( e._toolbarObjects.fullscreen ) e._toolbarObjects.fullscreen.swapImage([_editor_url + cfg.imgURL + 'ed_buttons_main.gif',8,0]); 71 68 } 72 69 … … 88 85 if(e.target != e._iframe) 89 86 { 90 HTMLArea._addEvent(window, 'resize', sizeItUp);87 Xinha._addEvent(window, 'resize', sizeItUp); 91 88 } 92 89 } … … 94 91 // Gecko has a bug where if you change position/display on a 95 92 // designMode iframe that designMode dies. 96 if( HTMLArea.is_gecko)93 if(Xinha.is_gecko) 97 94 { 98 95 this.deactivateEditor(); … … 103 100 // Unmaximize 104 101 this._htmlArea.style.position = ''; 105 this._htmlArea.style.border = ''; 102 if (!Xinha.is_ie ) this._htmlArea.style.border = ''; 103 106 104 try 107 105 { 108 if( HTMLArea.is_ie)106 if(Xinha.is_ie && document.compatMode == 'CSS1Compat') 109 107 { 110 108 var bod = document.getElementsByTagName('html'); … … 130 128 ancestor._xinha_fullScreenOldPosition = null; 131 129 } 132 130 131 if ( Xinha.ie_version < 7 ) 132 { 133 var selects = document.getElementsByTagName("select"); 134 for ( var i=0;i<selects.length;++i ) 135 { 136 selects[i].style.visibility = 'visible'; 137 } 138 } 133 139 window.scroll(this._unScroll.x, this._unScroll.y); 134 140 } … … 151 157 ancestor.style.position = 'static'; 152 158 } 153 159 // very ugly bug in IE < 7 shows select boxes through elements that are positioned over them 160 if ( Xinha.ie_version < 7 ) 161 { 162 var selects = document.getElementsByTagName("select"); 163 var s, currentEditor; 164 for ( var i=0;i<selects.length;++i ) 165 { 166 s = selects[i]; 167 currentEditor = false; 168 while ( s = s.parentNode ) 169 { 170 if ( s == this._htmlArea ) 171 { 172 currentEditor = true; 173 break; 174 } 175 } 176 if ( !currentEditor && selects[i].style.visibility != 'hidden') 177 { 178 selects[i].style.visibility = 'hidden'; 179 } 180 } 181 } 154 182 // Maximize 155 183 window.scroll(0,0); 156 184 this._htmlArea.style.position = 'absolute'; 157 185 this._htmlArea.style.zIndex = 999; 158 this._htmlArea.style.left = 0;159 this._htmlArea.style.top = 0;160 this._htmlArea.style.border = 'none';186 this._htmlArea.style.left = e.config.fullScreenMargins[3] + 'px'; 187 this._htmlArea.style.top = e.config.fullScreenMargins[0] + 'px'; 188 if ( !Xinha.is_ie ) this._htmlArea.style.border = 'none'; 161 189 this._isFullScreen = true; 162 190 resetScroll(); … … 164 192 try 165 193 { 166 if( HTMLArea.is_ie)194 if(Xinha.is_ie && document.compatMode == 'CSS1Compat') 167 195 { 168 196 var bod = document.getElementsByTagName('html'); … … 182 210 } 183 211 184 if( HTMLArea.is_gecko)212 if(Xinha.is_gecko) 185 213 { 186 214 this.activateEditor();
