]> git.immae.eu Git - perso/Immae/Projets/packagist/piedsjaloux-ckeditor-component.git/blobdiff - sources/plugins/contextmenu/plugin.js
Add oembed
[perso/Immae/Projets/packagist/piedsjaloux-ckeditor-component.git] / sources / plugins / contextmenu / plugin.js
index 09d7f250bf1164d1f16b54ad40dbf4bd45f438e5..4a3bd5f34673faa4b67515fb888b2d203fc5e672 100644 (file)
@@ -1,5 +1,5 @@
 /**\r
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.\r
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\r
  * For licensing, see LICENSE.md or http://ckeditor.com/license\r
  */\r
 \r
@@ -7,10 +7,10 @@ CKEDITOR.plugins.add( 'contextmenu', {
        requires: 'menu',\r
 \r
        // jscs:disable maximumLineLength\r
-       lang: 'af,ar,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,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%\r
+       lang: 'af,ar,az,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,es-mx,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%\r
        // jscs:enable maximumLineLength\r
 \r
-       // Make sure the base class (CKEDITOR.menu) is loaded before it (#3318).\r
+       // Make sure the base class (CKEDITOR.menu) is loaded before it (http://dev.ckeditor.com/ticket/3318).\r
        onLoad: function() {\r
                /**\r
                 * Class replacing the non-configurable native context menu with a configurable CKEditor's equivalent.\r
@@ -51,7 +51,7 @@ CKEDITOR.plugins.add( 'contextmenu', {
                                                var domEvent = event.data,\r
                                                        isCtrlKeyDown =\r
                                                                // Safari on Windows always show 'ctrlKey' as true in 'contextmenu' event,\r
-                                                               // which make this property unreliable. (#4826)\r
+                                                               // which make this property unreliable. (http://dev.ckeditor.com/ticket/4826)\r
                                                                ( CKEDITOR.env.webkit ? holdCtrlKey : ( CKEDITOR.env.mac ? domEvent.$.metaKey : domEvent.$.ctrlKey ) );\r
 \r
                                                if ( nativeContextMenuOnCtrl && isCtrlKeyDown )\r
@@ -60,7 +60,7 @@ CKEDITOR.plugins.add( 'contextmenu', {
                                                // Cancel the browser context menu.\r
                                                domEvent.preventDefault();\r
 \r
-                                               // Fix selection when non-editable element in Webkit/Blink (Mac) (#11306).\r
+                                               // Fix selection when non-editable element in Webkit/Blink (Mac) (http://dev.ckeditor.com/ticket/11306).\r
                                                if ( CKEDITOR.env.mac && CKEDITOR.env.webkit ) {\r
                                                        var editor = this.editor,\r
                                                                contentEditableParent = new CKEDITOR.dom.elementPath( domEvent.getTarget(), editor.editable() ).contains( function( el ) {\r
@@ -83,7 +83,7 @@ CKEDITOR.plugins.add( 'contextmenu', {
                                                CKEDITOR.tools.setTimeout( function() {\r
                                                        this.open( offsetParent, null, offsetX, offsetY );\r
 \r
-                                                       // IE needs a short while to allow selection change before opening menu. (#7908)\r
+                                                       // IE needs a short while to allow selection change before opening menu. (http://dev.ckeditor.com/ticket/7908)\r
                                                }, CKEDITOR.env.ie ? 200 : 0, this );\r
                                        }, this );\r
 \r
@@ -111,10 +111,14 @@ CKEDITOR.plugins.add( 'contextmenu', {
                                 * @param {Number} [offsetY]\r
                                 */\r
                                open: function( offsetParent, corner, offsetX, offsetY ) {\r
+                                       if ( this.editor.config.enableContextMenu === false ) {\r
+                                               return;\r
+                                       }\r
+\r
                                        this.editor.focus();\r
                                        offsetParent = offsetParent || CKEDITOR.document.getDocumentElement();\r
 \r
-                                       // #9362: Force selection check to update commands' states in the new context.\r
+                                       // http://dev.ckeditor.com/ticket/9362: Force selection check to update commands' states in the new context.\r
                                        this.editor.selectionChange( 1 );\r
 \r
                                        this.show( offsetParent, corner, offsetX, offsetY );\r
@@ -157,3 +161,14 @@ CKEDITOR.plugins.add( 'contextmenu', {
  * @cfg {Boolean} [browserContextMenuOnCtrl=true]\r
  * @member CKEDITOR.config\r
  */\r
+\r
+/**\r
+ * Whether to enable the context menu. Regardless of the setting the [Context Menu](http://ckeditor.com/addon/contextmenu)\r
+ * plugin is still loaded.\r
+ *\r
+ *             config.enableContextMenu = false;\r
+ *\r
+ * @since 4.7.0\r
+ * @cfg {Boolean} [enableContextMenu=true]\r
+ * @member CKEDITOR.config\r
+ */\r