JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.4
[ckeditor.git] / _source / plugins / preview / plugin.js
index fd6e633..da2e1fc 100644 (file)
@@ -9,6 +9,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
 (function()\r
 {\r
+       var pluginPath;\r
+\r
        var previewCmd =\r
        {\r
                modes : { wysiwyg:1, source:1 },\r
@@ -79,10 +81,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                        '})() )';\r
                        }\r
 \r
+                       // With Firefox only, we need to open a special preview page, so\r
+                       // anchors will work properly on it. (#9047)\r
+                       if ( CKEDITOR.env.gecko )\r
+                       {\r
+                               window._cke_htmlToLoad = sHTML;\r
+                               sOpenUrl = pluginPath + 'preview.html';\r
+                       }\r
+\r
                        var oWindow = window.open( sOpenUrl, null, 'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' +\r
                                iWidth + ',height=' + iHeight + ',left=' + iLeft );\r
 \r
-                       if ( !isCustomDomain )\r
+                       if ( !isCustomDomain && !CKEDITOR.env.gecko )\r
                        {\r
                                var doc = oWindow.document;\r
                                doc.open();\r
@@ -102,6 +112,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
        {\r
                init : function( editor )\r
                {\r
+                       pluginPath = this.path;\r
+\r
                        editor.addCommand( pluginName, previewCmd );\r
                        editor.ui.addButton( 'Preview',\r
                                {\r