From 5f250f06a1725b57cdefa30f58b139b6d059ccc2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Fri, 4 Apr 2014 18:18:45 +0200 Subject: [PATCH] =?utf8?q?Migration=20vers=20version=204=C2=A0:=20restaura?= =?utf8?q?tion=20des=20outils.=20Prise=20en=20charge=20de=20'allowedConten?= =?utf8?q?t',=20'requiredContent'=20pour=20plugin=20plinn=5Fimage.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- skins/ckeditor/config.js | 41 +++++++++++++++++--- skins/ckeditor/plugins/plinn_image/plugin.js | 10 ++++- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/skins/ckeditor/config.js b/skins/ckeditor/config.js index ea4ff0d..8fbf6ae 100644 --- a/skins/ckeditor/config.js +++ b/skins/ckeditor/config.js @@ -1,10 +1,39 @@ -/** - * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.html or http://ckeditor.com/license - */ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ -CKEDITOR.editorConfig = function( config ) { +CKEDITOR.editorConfig = function( config ) +{ // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; -}; + + // toolbar + config.toolbar = [ + { name: 'styles', items : [ 'Styles', 'Format', 'Font', 'FontSize' ] }, + { name: 'colors', items : [ 'TextColor', 'BGColor' ] }, + { name: 'document', items : [ 'Maximize', 'ShowBlocks', 'Source'] }, + { name: 'editing', items : [ 'Find','Replace', '-', 'SelectAll'] }, + { name: 'clipboard', items : [ 'PasteFromWord', '-', 'Undo', 'Redo' ] }, + '/', + { name: 'basicstyles', items : [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, + { name: 'paragraph', items : [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] }, + { name: 'links', items : [ 'Link', 'Unlink', 'Anchor' ] }, + { name: 'insert', items : [ 'PlinnImage', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak'] }, + ]; + + // context menu + config.menu_groups = 'tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash' + + config.height = '500px'; + config.contentsCss = CKEDITOR.basePath + 'global_plinn_style_editor.css'; + + config.filebrowserBrowseUrl = CKEDITOR.basePath + 'filemanager/browser/mac_finder/browser.html?Connector=connectors/plinn/connector'; + CKEDITOR.config.filebrowserImageBrowseUrl = CKEDITOR.basePath + 'filemanager/browser/mac_finder/browser.html?Type=Image&Connector=connectors/plinn/connector'; + config.filebrowserWindowHeight = 600; + config.filebrowserWindowWidth = 801; + config.attachmentBrowserConnectorUrl = CKEDITOR.basePath + 'plugins/plinn_image/connectors/plinn/connector'; + config.imageMaxDefaultDimension = 500 ; // image inserted will be cropped at this size. + config.extraPlugins = 'plinn_image'; +}; \ No newline at end of file diff --git a/skins/ckeditor/plugins/plinn_image/plugin.js b/skins/ckeditor/plugins/plinn_image/plugin.js index ffb96fe..7e343ce 100644 --- a/skins/ckeditor/plugins/plinn_image/plugin.js +++ b/skins/ckeditor/plugins/plinn_image/plugin.js @@ -59,10 +59,15 @@ CKEDITOR.plugins.add( 'plinn_image', ); }); var pluginPath = this.path; + var allowed = 'img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}'; + var required = 'img[alt,src]'; var command = editor.addCommand('plinn_image', { - exec : function(editor){openPlinnImageDialog(pluginPath, editor);} - }); + exec : function(editor){openPlinnImageDialog(pluginPath, editor);}, + allowedContent: allowed, + requiredContent: required + } + ); editor.ui.addButton('PlinnImage', { @@ -71,6 +76,7 @@ CKEDITOR.plugins.add( 'plinn_image', command : 'plinn_image' }); } + }); })(); -- 2.20.1