X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpreview%2Fplugin.js;h=3132a45a965ed46e1639088ea8618bcad4ccc3eb;hb=a272c66d841421f8bf933c16535bdcde1c4649fc;hp=a835c194f2a4554ab43134c6a98276080fc64ca2;hpb=e73319a12b56100b29ef456fd74114fe5519e01c;p=ckeditor.git diff --git a/_source/plugins/preview/plugin.js b/_source/plugins/preview/plugin.js index a835c19..3132a45 100644 --- a/_source/plugins/preview/plugin.js +++ b/_source/plugins/preview/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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', {