X-Git-Url: https://scm.cri.ensmp.fr/git/ckeditor.git/blobdiff_plain/e11f66eb655db8339a2d9b197b89f6c3b26099e1..579f65bc95a773bc6f8da75f6849ea49f365368b:/skins/ckeditor/_source/plugins/preview/plugin.js diff --git a/skins/ckeditor/_source/plugins/preview/plugin.js b/skins/ckeditor/_source/plugins/preview/plugin.js deleted file mode 100644 index a31ebfa..0000000 --- a/skins/ckeditor/_source/plugins/preview/plugin.js +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -/** - * @file Preview plugin. - */ - -(function() -{ - var previewCmd = - { - modes : { wysiwyg:1, source:1 }, - canUndo : false, - readOnly : 1, - exec : function( editor ) - { - var sHTML, - config = editor.config, - baseTag = config.baseHref ? '' : '', - isCustomDomain = CKEDITOR.env.isCustomDomain(); - - if ( config.fullPage ) - { - sHTML = editor.getData() - .replace( //, '$&' + baseTag ) - .replace( /[^>]*(?=<\/title>)/, '$& — ' + editor.lang.preview ); - } - else - { - var bodyHtml = '' + - '' + - baseTag + - '' + editor.lang.preview + '' + - CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) + - '' + bodyHtml + - editor.getData() + - ''; - } - - var iWidth = 640, // 800 * 0.8, - iHeight = 420, // 600 * 0.7, - iLeft = 80; // (800 - 0.8 * 800) /2 = 800 * 0.1. - try - { - var screen = window.screen; - iWidth = Math.round( screen.width * 0.8 ); - iHeight = Math.round( screen.height * 0.7 ); - iLeft = Math.round( screen.width * 0.1 ); - } - catch ( e ){} - - var sOpenUrl = ''; - if ( isCustomDomain ) - { - window._cke_htmlToLoad = sHTML; - sOpenUrl = 'javascript:void( (function(){' + - 'document.open();' + - 'document.domain="' + document.domain + '";' + - 'document.write( window.opener._cke_htmlToLoad );' + - 'document.close();' + - 'window.opener._cke_htmlToLoad = null;' + - '})() )'; - } - - 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 ) - { - oWindow.document.open(); - oWindow.document.write( sHTML ); - oWindow.document.close(); - } - } - }; - - var pluginName = 'preview'; - - // Register a plugin named "preview". - CKEDITOR.plugins.add( pluginName, - { - init : function( editor ) - { - editor.addCommand( pluginName, previewCmd ); - editor.ui.addButton( 'Preview', - { - label : editor.lang.preview, - command : pluginName - }); - } - }); -})();