Ticket #9047: 9047.patch

File 9047.patch, 1.5 KB (added by Frederico Caldeira Knabben, 12 years ago)
  • _source/plugins/preview/plugin.js

     
    99
    1010(function()
    1111{
     12        var pluginPath;
     13
    1214        var previewCmd =
    1315        {
    1416                modes : { wysiwyg:1, source:1 },
     
    7981                                        '})() )';
    8082                        }
    8183
     84                        // With Firefox only, we need to open a special preview page, so
     85                        // anchors will work properly on it. (#9047)
     86                        if ( CKEDITOR.env.gecko )
     87                        {
     88                                window._cke_htmlToLoad = sHTML;
     89                                sOpenUrl = pluginPath + 'preview.html';
     90                        }
     91
    8292                        var oWindow = window.open( sOpenUrl, null, 'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' +
    8393                                iWidth + ',height=' + iHeight + ',left=' + iLeft );
    8494
    85                         if ( !isCustomDomain )
     95                        if ( !isCustomDomain && !CKEDITOR.env.gecko )
    8696                        {
    8797                                var doc = oWindow.document;
    8898                                doc.open();
     
    102112        {
    103113                init : function( editor )
    104114                {
     115                        pluginPath = this.path;
     116
    105117                        editor.addCommand( pluginName, previewCmd );
    106118                        editor.ui.addButton( 'Preview',
    107119                                {
  • _source/plugins/preview/preview.html

     
     1<script>
     2
     3var doc = document;
     4doc.open();
     5doc.write( window.opener._cke_htmlToLoad );
     6doc.close();
     7
     8delete window.opener._cke_htmlToLoad;
     9
     10</script>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy