includes/clientside/tinymce/plugins/fullscreen/fullscreen.htm
changeset 588 20484deb89cd
parent 476 f26a69c40431
child 1193 e3b94bd055dc
equal deleted inserted replaced
587:705ed7162315 588:20484deb89cd
     8 		function patchCallback(settings, key) {
     8 		function patchCallback(settings, key) {
     9 			if (settings[key])
     9 			if (settings[key])
    10 				settings[key] = "window.opener." + settings[key];
    10 				settings[key] = "window.opener." + settings[key];
    11 		}
    11 		}
    12 
    12 
    13 		var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings;
    13 		var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;
    14 
    14 
    15 		// Clone array
    15 		// Clone array
    16 		for (var n in paSe)
    16 		for (var n in paSe)
    17 			settings[n] = paSe[n];
    17 			settings[n] = paSe[n];
    18 
    18 
    39 		settings['elements'] = 'fullscreenarea';
    39 		settings['elements'] = 'fullscreenarea';
    40 		settings['add_unload_trigger'] = false;
    40 		settings['add_unload_trigger'] = false;
    41 		settings['ask'] = false;
    41 		settings['ask'] = false;
    42 		settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
    42 		settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
    43 		settings['fullscreen_is_enabled'] = true;
    43 		settings['fullscreen_is_enabled'] = true;
    44 		settings['fullscreen_editor_id'] = window.opener.tinyMCE.activeEditor.id;
    44 		settings['fullscreen_editor_id'] = oeID;
    45 		settings['theme_advanced_resizing'] = false;
    45 		settings['theme_advanced_resizing'] = false;
    46 		settings['strict_loading_mode'] = true;
    46 		settings['strict_loading_mode'] = true;
    47 
    47 
    48 		settings.save_onsavecallback = function() {
    48 		settings.save_onsavecallback = function() {
    49 			window.opener.tinyMCE.activeEditor.setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
    49 			window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
    50 			window.opener.tinyMCE.activeEditor.execCommand('mceSave');
    50 			window.opener.tinyMCE.get(oeID).execCommand('mceSave');
    51 			window.close();
    51 			window.close();
    52 		};
    52 		};
    53 
    53 
    54 		function unloadHandler(e) {
    54 		function unloadHandler(e) {
    55 			moveContent();
    55 			moveContent();
    56 		}
    56 		}
    57 
    57 
    58 		function moveContent() {
    58 		function moveContent() {
    59 			window.opener.tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
    59 			window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
    60 		}
    60 		}
    61 
    61 
    62 		function closeFullscreen() {
    62 		function closeFullscreen() {
    63 			moveContent();
    63 			moveContent();
    64 			window.close();
    64 			window.close();
    76 		}
    76 		}
    77 
    77 
    78 		function render() {
    78 		function render() {
    79 			var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
    79 			var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
    80 
    80 
    81 			e.value = window.opener.tinyMCE.activeEditor.getContent();
    81 			e.value = window.opener.tinyMCE.get(oeID).getContent();
    82 
    82 
    83 			vp = dom.getViewPort();
    83 			vp = dom.getViewPort();
    84 			settings.width = vp.w;
    84 			settings.width = vp.w;
    85 			settings.height = vp.h - 15;
    85 			settings.height = vp.h - 15;
    86 
    86