]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm
Wordpress 3.7
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / fullscreen / fullscreen.htm
index a18f3967864ff1819132681440fcc132da2d222d..9b0fb9aeac2114990cc9a24829254c34ec90191c 100644 (file)
@@ -1,16 +1,16 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
        <title></title>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
        <title></title>
-       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-       <script type="text/javascript" src="../../tiny_mce.js?v=307"></script>
+       <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+       <script type="text/javascript" src="../../tiny_mce.js?ver=359-20131010"></script>
        <script type="text/javascript">
                function patchCallback(settings, key) {
                        if (settings[key])
                                settings[key] = "window.opener." + settings[key];
                }
 
        <script type="text/javascript">
                function patchCallback(settings, key) {
                        if (settings[key])
                                settings[key] = "window.opener." + settings[key];
                }
 
-               var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings;
+               var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;
 
                // Clone array
                for (var n in paSe)
 
                // Clone array
                for (var n in paSe)
                settings['ask'] = false;
                settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
                settings['fullscreen_is_enabled'] = true;
                settings['ask'] = false;
                settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
                settings['fullscreen_is_enabled'] = true;
-               settings['fullscreen_editor_id'] = window.opener.tinyMCE.activeEditor.id;
+               settings['fullscreen_editor_id'] = oeID;
                settings['theme_advanced_resizing'] = false;
                settings['strict_loading_mode'] = true;
 
                settings.save_onsavecallback = function() {
                settings['theme_advanced_resizing'] = false;
                settings['strict_loading_mode'] = true;
 
                settings.save_onsavecallback = function() {
-                       window.opener.tinyMCE.activeEditor.setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
-                       window.opener.tinyMCE.activeEditor.execCommand('mceSave');
+                       moveContent();
+                       window.opener.tinyMCE.get(oeID).execCommand('mceSave');
                        window.close();
                };
 
                        window.close();
                };
 
                }
 
                function moveContent() {
                }
 
                function moveContent() {
-                       window.opener.tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
+                       // find the original editor, execute restore state in it's plugin instance
+                       window.opener.tinyMCE.get(oeID).plugins.fullscreen.saveState(tinyMCE.activeEditor);
+
+                       // prevent moveContent from being called twice - e.g. if the unloadHandler runs after moveContent()
+                       tinymce.dom.Event.remove(window, "beforeunload", unloadHandler);
                }
 
                function closeFullscreen() {
                }
 
                function closeFullscreen() {
-                       moveContent();
+                       // moveContent() will be called by the unload handler
                        window.close();
                }
 
                        window.close();
                }
 
                function render() {
                        var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
 
                function render() {
                        var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
 
-                       e.value = window.opener.tinyMCE.activeEditor.getContent();
-
                        vp = dom.getViewPort();
                        settings.width = vp.w;
                        settings.height = vp.h - 15;
 
                        vp = dom.getViewPort();
                        settings.width = vp.w;
                        settings.height = vp.h - 15;
 
-                       tinymce.dom.Event.add(window, 'resize', function() {
-                               var vp = dom.getViewPort();
+                       settings.oninit = function() {
+                               var ed = tinyMCE.activeEditor;
+                               window.opener.tinyMCE.get(oeID).plugins.fullscreen.loadState(ed);
+
+                               tinymce.dom.Event.add(window, 'resize', function() {
+                                       var vp = dom.getViewPort();
 
 
-                               tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
-                       });
+                                       tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
+                               });
+                       }
 
                        tinyMCE.init(settings);
                }
 
                        tinyMCE.init(settings);
                }
                // Add onunload
                tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
        </script>
                // Add onunload
                tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
        </script>
-       <base target="_self" />
 </head>
 <body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
 <form onsubmit="doParentSubmit();">
 </head>
 <body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
 <form onsubmit="doParentSubmit();">