X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fpreview%2Fplugin.js;h=da2e1fc1a18b460a264dde8274018d80c89c6791;hp=fd6e633118fb23e90bb16c01629df0f6c8aab87b;hb=6e682412d5cc0dfaedb376482e585bf2989c6863;hpb=2f22c0c38f17e75be5541089076885442aaa2377 diff --git a/_source/plugins/preview/plugin.js b/_source/plugins/preview/plugin.js index fd6e633..da2e1fc 100644 --- a/_source/plugins/preview/plugin.js +++ b/_source/plugins/preview/plugin.js @@ -9,6 +9,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function() { + var pluginPath; + var previewCmd = { modes : { wysiwyg:1, source:1 }, @@ -79,10 +81,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license '})() )'; } + // With Firefox only, we need to open a special preview page, so + // anchors will work properly on it. (#9047) + if ( CKEDITOR.env.gecko ) + { + window._cke_htmlToLoad = sHTML; + sOpenUrl = pluginPath + 'preview.html'; + } + var oWindow = window.open( sOpenUrl, null, 'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + iWidth + ',height=' + iHeight + ',left=' + iLeft ); - if ( !isCustomDomain ) + if ( !isCustomDomain && !CKEDITOR.env.gecko ) { var doc = oWindow.document; doc.open(); @@ -102,6 +112,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { init : function( editor ) { + pluginPath = this.path; + editor.addCommand( pluginName, previewCmd ); editor.ui.addButton( 'Preview', {