new ckeditor

New ckeditor
This commit is contained in:
Francesco Malagrino
2017-03-26 21:10:58 +02:00
parent 87a8e6920e
commit f9caa9759b
4418 changed files with 209667 additions and 2801 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'af', {
preview: 'Voorbeeld'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'ar', {
preview: 'معاينة الصفحة'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'az', {
preview: 'Öncədən baxılması'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'bg', {
preview: 'Преглед'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'bn', {
preview: 'প্রাকদর্শন'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'bs', {
preview: 'Prikaži'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'ca', {
preview: 'Visualització prèvia'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'cs', {
preview: 'Náhled'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'cy', {
preview: 'Rhagolwg'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'da', {
preview: 'Vis eksempel'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'de-ch', {
preview: 'Vorschau'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'de', {
preview: 'Vorschau'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'el', {
preview: 'Προεπισκόπιση'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'en-au', {
preview: 'Preview'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'en-ca', {
preview: 'Preview'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'en-gb', {
preview: 'Preview'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'en', {
preview: 'Preview'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'eo', {
preview: 'Vidigi Aspekton'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'es', {
preview: 'Vista Previa'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'et', {
preview: 'Eelvaade'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'eu', {
preview: 'Aurrebista'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'fa', {
preview: 'پیشنمایش'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'fi', {
preview: 'Esikatsele'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'fo', {
preview: 'Frumsýning'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'fr-ca', {
preview: 'Prévisualiser'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'fr', {
preview: 'Aperçu'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'gl', {
preview: 'Vista previa'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'gu', {
preview: 'પૂર્વદર્શન'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'he', {
preview: 'תצוגה מקדימה'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'hi', {
preview: 'प्रीव्यू'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'hr', {
preview: 'Pregledaj'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'hu', {
preview: 'Előnézet'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'id', {
preview: 'Pratinjau'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'is', {
preview: 'Forskoða'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'it', {
preview: 'Anteprima'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'ja', {
preview: 'プレビュー'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'ka', {
preview: 'გადახედვა'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'km', {
preview: 'មើល​ជា​មុន'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'ko', {
preview: '미리보기'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'ku', {
preview: 'پێشبینین'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'lt', {
preview: 'Peržiūra'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'lv', {
preview: 'Priekšskatīt'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'mk', {
preview: 'Preview' // MISSING
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'mn', {
preview: 'Уридчлан харах'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'ms', {
preview: 'Prebiu'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'nb', {
preview: 'Forhåndsvis'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'nl', {
preview: 'Voorbeeld'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'no', {
preview: 'Forhåndsvis'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'oc', {
preview: 'Previsualizar'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'pl', {
preview: 'Podgląd'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'pt-br', {
preview: 'Visualizar'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'pt', {
preview: 'Pré-visualizar'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'ro', {
preview: 'Previzualizare'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'ru', {
preview: 'Предварительный просмотр'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'si', {
preview: 'නැවත '
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'sk', {
preview: 'Náhľad'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'sl', {
preview: 'Predogled'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'sq', {
preview: 'Parashiko'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'sr-latn', {
preview: 'Izgled stranice'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'sr', {
preview: 'Изглед странице'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'sv', {
preview: 'Förhandsgranska'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'th', {
preview: 'ดูหน้าเอกสารตัวอย่าง'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'tr', {
preview: 'Ön İzleme'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'tt', {
preview: 'Карап алу'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'ug', {
preview: 'ئالدىن كۆزەت'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'uk', {
preview: 'Попередній перегляд'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'vi', {
preview: 'Xem trước'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'zh-cn', {
preview: '预览'
} );

View File

@@ -0,0 +1,7 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'zh', {
preview: '預覽'
} );

View File

@@ -0,0 +1,145 @@
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
/**
* @fileOverview Preview plugin.
*/
( function() {
var pluginPath;
var previewCmd = { modes: { wysiwyg: 1, source: 1 },
canUndo: false,
readOnly: 1,
exec: function( editor ) {
var sHTML,
config = editor.config,
baseTag = config.baseHref ? '<base href="' + config.baseHref + '"/>' : '',
eventData;
if ( config.fullPage )
sHTML = editor.getData().replace( /<head>/, '$&' + baseTag ).replace( /[^>]*(?=<\/title>)/, '$& &mdash; ' + editor.lang.preview.preview );
else {
var bodyHtml = '<body ',
body = editor.document && editor.document.getBody();
if ( body ) {
if ( body.getAttribute( 'id' ) )
bodyHtml += 'id="' + body.getAttribute( 'id' ) + '" ';
if ( body.getAttribute( 'class' ) )
bodyHtml += 'class="' + body.getAttribute( 'class' ) + '" ';
}
bodyHtml += '>';
sHTML = editor.config.docType + '<html dir="' + editor.config.contentsLangDirection + '">' +
'<head>' +
baseTag +
'<title>' + editor.lang.preview.preview + '</title>' +
CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) +
'</head>' + bodyHtml +
editor.getData() +
'</body></html>';
}
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 ) {}
// (#9907) Allow data manipulation before preview is displayed.
// Also don't open the preview window when event cancelled.
if ( editor.fire( 'contentPreview', eventData = { dataValue: sHTML } ) === false )
return false;
var sOpenUrl = '',
ieLocation;
if ( CKEDITOR.env.ie ) {
window._cke_htmlToLoad = eventData.dataValue;
ieLocation = 'javascript:void( (function(){' + // jshint ignore:line
'document.open();' +
// Support for custom document.domain.
// Strip comments and replace parent with window.opener in the function body.
( '(' + CKEDITOR.tools.fixDomain + ')();' ).replace( /\/\/.*?\n/g, '' ).replace( /parent\./g, 'window.opener.' ) +
'document.write( window.opener._cke_htmlToLoad );' +
'document.close();' +
'window.opener._cke_htmlToLoad = null;' +
'})() )';
// For IE we should use window.location rather than setting url in window.open. (#11146)
sOpenUrl = '';
}
// 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 = eventData.dataValue;
sOpenUrl = CKEDITOR.getUrl( 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 );
// For IE we want to assign whole js stored in ieLocation, but in case of
// popup blocker activation oWindow variable will be null. (#11597)
if ( CKEDITOR.env.ie && oWindow )
oWindow.location = ieLocation;
if ( !CKEDITOR.env.ie && !CKEDITOR.env.gecko ) {
var doc = oWindow.document;
doc.open();
doc.write( eventData.dataValue );
doc.close();
}
return true;
}
};
var pluginName = 'preview';
// Register a plugin named "preview".
CKEDITOR.plugins.add( pluginName, {
// jscs:disable maximumLineLength
lang: 'af,ar,az,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,oc,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE%
// jscs:enable maximumLineLength
icons: 'preview,preview-rtl', // %REMOVE_LINE_CORE%
hidpi: true, // %REMOVE_LINE_CORE%
init: function( editor ) {
// Preview is not used for the inline creator.
if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE )
return;
pluginPath = this.path;
editor.addCommand( pluginName, previewCmd );
editor.ui.addButton && editor.ui.addButton( 'Preview', {
label: editor.lang.preview.preview,
command: pluginName,
toolbar: 'document,40'
} );
}
} );
} )();
/**
* Event fired when executing `preview` command, which allows additional data manipulation.
* With this event, the raw HTML content of the preview window to be displayed can be altered
* or modified.
*
* @event contentPreview
* @member CKEDITOR
* @param {CKEDITOR.editor} editor This editor instance.
* @param data
* @param {String} data.dataValue The data that will go to the preview.
*/

View File

@@ -0,0 +1,13 @@
<script>
// Prevent from DOM clobbering.
if ( typeof window.opener._cke_htmlToLoad == 'string' ) {
var doc = document;
doc.open();
doc.write( window.opener._cke_htmlToLoad );
doc.close();
delete window.opener._cke_htmlToLoad;
}
</script>