Add inserthtml ckeditor plugin see BT#12059

pull/2487/head
jmontoyaa 8 years ago
parent 8a97b51b4a
commit 7e001fce4c
  1. 38
      main/inc/lib/javascript/ckeditor/plugins/inserthtml/dialogs/inserthtml.js
  2. BIN
      main/inc/lib/javascript/ckeditor/plugins/inserthtml/inserthtml.png
  3. 30
      main/inc/lib/javascript/ckeditor/plugins/inserthtml/plugin.js
  4. 49
      main/inc/lib/javascript/ckeditor/plugins/inserthtml/readme.txt
  5. 2
      main/inc/lib/javascript/ckeditor/skins/bootstrapck/dialog.css
  6. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php
  7. 4
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Documents.php

@ -0,0 +1,38 @@
/*********************************************************************************************************/
/**
* inserthtml plugin for CKEditor 4.x (Author: gpickin ; email: gpickin@gmail.com)
* version: 2.0
* Released: On 2015-03-10
* Download: http://www.github.com/gpickin/ckeditor-inserthtml
*
*
* Modified from original: inserthtml plugin for CKEditor 3.x (Author: Lajox ; Email: lajox@19www.com)
* mod-version: 1.0
* mod-Released: On 2009-12-11
* mod-Download: http://code.google.com/p/lajox
*/
/*********************************************************************************************************/
CKEDITOR.dialog.add('inserthtmlDialog',function(editor){
return{
title:'Insert HTML',
minWidth:380,
minHeight:220,
contents:[
{ id:'info',
label:'HTML',
elements:[
{ type:'textarea',
id:'insertcode_area',
label:''
}
]
}
],
onOk: function() {
var sInsert=this.getValueOf('info','insertcode_area');
if ( sInsert.length > 0 )
editor.insertHtml(sInsert);
}
};
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

@ -0,0 +1,30 @@
/*********************************************************************************************************/
/**
* inserthtml plugin for CKEditor 4.x (Author: gpickin ; email: gpickin@gmail.com)
* version: 2.0
* Released: On 2015-03-10
* Download: http://www.github.com/gpickin/ckeditor-inserthtml
*
*
* Modified from original: inserthtml plugin for CKEditor 3.x (Author: Lajox ; Email: lajox@19www.com)
* mod-version: 1.0
* mod-Released: On 2009-12-11
* mod-Download: http://code.google.com/p/lajox
*/
/*********************************************************************************************************/
(function() {
CKEDITOR.plugins.add('inserthtml',
{
init: function( editor ) {
editor.addCommand( 'inserthtml', new CKEDITOR.dialogCommand( 'inserthtmlDialog' ) );
editor.ui.addButton( 'inserthtml', {
label: 'Insert HTML',
command: 'inserthtml',
toolbar: 'insert',
icon : this.path + 'inserthtml.png'
});
CKEDITOR.dialog.add( 'inserthtmlDialog', this.path + 'dialogs/inserthtml.js' );
}
});
})();

@ -0,0 +1,49 @@
/*********************************************************************************************************/
/**
* inserthtml plugin for CKEditor 4.x (Author: gpickin ; email: gpickin@gmail.com)
* version: 2.0
* Released: On 2015-03-10
* Download: http://www.github.com/gpickin/ckeditor-inserthtml
*
*
* Modified from original: inserthtml plugin for CKEditor 3.x (Author: Lajox ; Email: lajox@19www.com)
* mod-version: 1.0
* mod-Released: On 2009-12-11
* mod-Download: http://code.google.com/p/lajox
*/
/*********************************************************************************************************/
/**************************************************************************************************************
inserthtml plugin for CKEditor 4.x
--Insert Html Code Plugin
Plugin Description: CKEditor 4.0+ Insert Html Code Plugin 2.0
***************************************************************************************************************/
/**************Help Begin***************/
1. Upload inserthtml folder to ckeditor/plugins/
2. Configured in the ckeditor/config.js :
Add to config.toolbar a value 'inserthtml'
e.g.
config.toolbar =
[
[ 'Source', '-', 'Bold', 'Italic', 'inserthtml' ]
];
3. Again Configured in the ckeditor/config.js ,
Expand the extra plugin 'inserthtml' such as:
config.extraPlugins='myplugin1,myplugin2,inserthtml';
4. Language Features Removed due to compatibility issues
/**************Help End***************/

File diff suppressed because one or more lines are too long

@ -59,6 +59,7 @@ class Basic extends Toolbar
'widget',
'wikilink',
'wordcount',
'inserthtml',
'xml',
);
@ -173,6 +174,7 @@ class Basic extends Toolbar
);*/
$config['skin'] = 'bootstrapck,' . api_get_path(WEB_LIBRARY_JS_PATH) . 'ckeditor/skins/bootstrapck/';
//$config['skin'] = 'moono';
if (isset($this->config)) {
$this->config = array_merge($config, $this->config);

@ -54,7 +54,7 @@ class Documents extends Basic
{
return [
['Maximize', 'PasteFromWord', '-', 'Undo', 'Redo'],
['Link', 'Unlink', 'Anchor', 'Glossary'],
['Link', 'Unlink', 'Anchor', 'inserthtml', 'Glossary'],
[
'Image',
'Video',
@ -94,7 +94,7 @@ class Documents extends Basic
protected function getMinimizedToolbar()
{
return [
['Save', 'NewPage', 'Templates', '-', 'PasteFromWord'],
['Save', 'NewPage', 'Templates', '-', 'PasteFromWord', 'inserthtml'],
['Undo', 'Redo'],
[
'Link',

Loading…
Cancel
Save