]>
git.immae.eu Git - perso/Immae/Projets/packagist/ludivine-ckeditor-component.git/blob - sources/plugins/iframe/plugin.js
2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
7 CKEDITOR
.plugins
.add( 'iframe', {
8 requires: 'dialog,fakeobjects',
9 // jscs:disable maximumLineLength
10 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%
11 // jscs:enable maximumLineLength
12 icons: 'iframe', // %REMOVE_LINE_CORE%
13 hidpi: true, // %REMOVE_LINE_CORE%
15 CKEDITOR
.addCss( 'img.cke_iframe' +
17 'background-image: url(' + CKEDITOR
.getUrl( this.path
+ 'images/placeholder.png' ) + ');' +
18 'background-position: center center;' +
19 'background-repeat: no-repeat;' +
20 'border: 1px solid #a9a9a9;' +
26 init: function( editor
) {
27 var pluginName
= 'iframe',
28 lang
= editor
.lang
.iframe
,
29 allowed
= 'iframe[align,longdesc,frameborder,height,name,scrolling,src,title,width]';
31 if ( editor
.plugins
.dialogadvtab
)
32 allowed
+= ';iframe' + editor
.plugins
.dialogadvtab
.allowedContent( { id: 1, classes: 1, styles: 1 } );
34 CKEDITOR
.dialog
.add( pluginName
, this.path
+ 'dialogs/iframe.js' );
35 editor
.addCommand( pluginName
, new CKEDITOR
.dialogCommand( pluginName
, {
36 allowedContent: allowed
,
37 requiredContent: 'iframe'
40 editor
.ui
.addButton
&& editor
.ui
.addButton( 'Iframe', {
46 editor
.on( 'doubleclick', function( evt
) {
47 var element
= evt
.data
.element
;
48 if ( element
.is( 'img' ) && element
.data( 'cke-real-element-type' ) == 'iframe' )
49 evt
.data
.dialog
= 'iframe';
52 if ( editor
.addMenuItems
) {
53 editor
.addMenuItems( {
62 // If the "contextmenu" plugin is loaded, register the listeners.
63 if ( editor
.contextMenu
) {
64 editor
.contextMenu
.addListener( function( element
) {
65 if ( element
&& element
.is( 'img' ) && element
.data( 'cke-real-element-type' ) == 'iframe' )
66 return { iframe: CKEDITOR
.TRISTATE_OFF
};
70 afterInit: function( editor
) {
71 var dataProcessor
= editor
.dataProcessor
,
72 dataFilter
= dataProcessor
&& dataProcessor
.dataFilter
;
75 dataFilter
.addRules( {
77 iframe: function( element
) {
78 return editor
.createFakeParserElement( element
, 'cke_iframe', 'iframe', true );