includes/clientside/tinymce/plugins/fullscreen/editor_plugin_src.js
changeset 476 f26a69c40431
parent 459 31c23016ab62
child 543 dffcbfbc4e59
equal deleted inserted replaced
475:51386f1852b8 476:f26a69c40431
     1 /**
     1 /**
     2  * $Id: editor_plugin_src.js 609 2008-02-18 16:19:27Z spocke $
     2  * $Id: editor_plugin_src.js 636 2008-02-25 13:38:28Z spocke $
     3  *
     3  *
     4  * @author Moxiecode
     4  * @author Moxiecode
     5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
     5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
     6  */
     6  */
     7 
     7 
    21 				if (ed.getParam('fullscreen_is_enabled')) {
    21 				if (ed.getParam('fullscreen_is_enabled')) {
    22 					if (ed.getParam('fullscreen_new_window'))
    22 					if (ed.getParam('fullscreen_new_window'))
    23 						closeFullscreen(); // Call to close in new window
    23 						closeFullscreen(); // Call to close in new window
    24 					else {
    24 					else {
    25 						window.setTimeout(function() {
    25 						window.setTimeout(function() {
       
    26 							tinymce.dom.Event.remove(window, 'resize', t.resizeFunc);
    26 							tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
    27 							tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
    27 							tinyMCE.remove(ed);
    28 							tinyMCE.remove(ed);
    28 							DOM.remove('mce_fullscreen_container');
    29 							DOM.remove('mce_fullscreen_container');
    29 							de.style.overflow = ed.getParam('fullscreen_html_overflow');
    30 							de.style.overflow = ed.getParam('fullscreen_html_overflow');
    30 							DOM.setStyle(document.body, 'overflow', ed.getParam('fullscreen_overflow'));
    31 							DOM.setStyle(document.body, 'overflow', ed.getParam('fullscreen_overflow'));
    34 
    35 
    35 					return;
    36 					return;
    36 				}
    37 				}
    37 
    38 
    38 				if (ed.getParam('fullscreen_new_window')) {
    39 				if (ed.getParam('fullscreen_new_window')) {
    39 					win = window.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
    40 					win = window.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
    40 					try {
    41 					try {
    41 						win.resizeTo(screen.availWidth, screen.availHeight);
    42 						win.resizeTo(screen.availWidth, screen.availHeight);
    42 					} catch (e) {
    43 					} catch (e) {
    43 						// Ignore
    44 						// Ignore
    44 					}
    45 					}
   102 					tinyMCE.add(t.fullscreenEditor);
   103 					tinyMCE.add(t.fullscreenEditor);
   103 
   104 
   104 					t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
   105 					t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
   105 					t.fullscreenElement.update();
   106 					t.fullscreenElement.update();
   106 					//document.body.overflow = 'hidden';
   107 					//document.body.overflow = 'hidden';
       
   108 
       
   109 					t.resizeFunc = tinymce.dom.Event.add(window, 'resize', function() {
       
   110 						var vp = tinymce.DOM.getViewPort();
       
   111 
       
   112 						t.fullscreenEditor.theme.resizeTo(vp.w, vp.h);
       
   113 					});
   107 				}
   114 				}
   108 			});
   115 			});
   109 
   116 
   110 			// Register buttons
   117 			// Register buttons
   111 			ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});
   118 			ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});