Make WordPress Core


Ignore:
Timestamp:
10/10/2013 09:49:23 PM (13 years ago)
Author:
azaozz
Message:

Upgrade TinyMCE to 3.5.9. Fix the css for the original 'fullscreen' plugin (not enabled by default).
Fixes #25561, fixes #25281.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm

    r23090 r25761  
    44        <title></title>
    55        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    6         <script type="text/javascript" src="../../tiny_mce.js?ver=358-20121205"></script>
     6        <script type="text/javascript" src="../../tiny_mce.js?ver=359-20131010"></script>
    77        <script type="text/javascript">
    88                function patchCallback(settings, key) {
    … …  
    4747
    4848                settings.save_onsavecallback = function() {
    49                         window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
     49                        moveContent();
    5050                        window.opener.tinyMCE.get(oeID).execCommand('mceSave');
    5151                        window.close();
    … …  
    5757
    5858                function moveContent() {
    59                         window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
     59                        // find the original editor, execute restore state in it's plugin instance
     60                        window.opener.tinyMCE.get(oeID).plugins.fullscreen.saveState(tinyMCE.activeEditor);
     61
     62                        // prevent moveContent from being called twice - e.g. if the unloadHandler runs after moveContent()
     63                        tinymce.dom.Event.remove(window, "beforeunload", unloadHandler);
    6064                }
    6165
    6266                function closeFullscreen() {
    63                         moveContent();
     67                        // moveContent() will be called by the unload handler
    6468                        window.close();
    6569                }
    … …  
    7983                        var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
    8084
    81                         e.value = window.opener.tinyMCE.get(oeID).getContent();
    82 
    8385                        vp = dom.getViewPort();
    8486                        settings.width = vp.w;
    8587                        settings.height = vp.h - 15;
    8688
    87                         tinymce.dom.Event.add(window, 'resize', function() {
    88                                 var vp = dom.getViewPort();
     89                        settings.oninit = function() {
     90                                var ed = tinyMCE.activeEditor;
     91                                window.opener.tinyMCE.get(oeID).plugins.fullscreen.loadState(ed);
    8992
    90                                 tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
    91                         });
     93                                tinymce.dom.Event.add(window, 'resize', function() {
     94                                        var vp = dom.getViewPort();
     95
     96                                        tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
     97                                });
     98                        }
    9299
    93100                        tinyMCE.init(settings);
Note: See TracChangeset for help on using the changeset viewer.