Skip to content

Commit

Permalink
Dev: further fixed ckeditor to be quicker
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Nov 13, 2017
1 parent 04aecec commit d0a70a4
Show file tree
Hide file tree
Showing 8 changed files with 308 additions and 226 deletions.
3 changes: 2 additions & 1 deletion application/config/packages.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@
)
),
'ckeditor' => array(
'devBaseUrl' => 'assets/packages/ckeditor/',
'devBaseUrl' => 'assets/packages/ckeditor',
'basePath' => 'core.ckeditor',
'js' => array(
'ckeditor.js',
'config.js',
),
'depends' => array(
'adminbasics',
Expand Down
3 changes: 1 addition & 2 deletions application/helpers/admin/htmleditor_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ function getInlineEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=n
function(){
if($('#".$fieldname."').length >0){
var $oCKeditorVarName = CKEDITOR.replace('$fieldname', {
customConfig : \"".Yii::app()->getConfig('adminscripts')."ckeditor-config.js\"
,LimeReplacementFieldsType : \"".$fieldtype."\"
LimeReplacementFieldsType : \"".$fieldtype."\"
,LimeReplacementFieldsSID : \"".$surveyID."\"
,LimeReplacementFieldsGID : \"".$gID."\"
,LimeReplacementFieldsQID : \"".$qID."\"
Expand Down
1 change: 0 additions & 1 deletion application/views/admin/htmleditor/pop_editor_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function closeme()
CKEDITOR.on('instanceReady',CKeditor_OnComplete);
var oCKeditor = CKEDITOR.replace( 'MyTextarea' , { height : '350',
width : '98%',
customConfig : "<?php echo Yii::app()->getConfig('adminscripts') . 'ckeditor-config.js'; ?>",
toolbarStartupExpanded : true,
ToolbarCanCollapse : false,
toolbar : '<?php echo $toolbarname; ?>',
Expand Down
150 changes: 83 additions & 67 deletions assets/packages/ckeditor/build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,72 +51,88 @@ var CKBUILDER_CONFIG = {
'tests'
],
plugins : {
'Audio' : 1,
'a11ychecker' : 1,
'a11yhelp' : 1,
'about' : 1,
'ajax' : 1,
'balloonpanel' : 1,
'basicstyles' : 1,
'bidi' : 1,
'blockquote' : 1,
'ckawesome' : 1,
'clipboard' : 1,
'codemirror' : 1,
'colorbutton' : 1,
'colordialog' : 1,
'contextmenu' : 1,
'copyformatting' : 1,
'dialogadvtab' : 1,
'div' : 1,
'elementspath' : 1,
'enterkey' : 1,
'entities' : 1,
'filebrowser' : 1,
'find' : 1,
'flash' : 1,
'floatingspace' : 1,
'font' : 1,
'format' : 1,
'horizontalrule' : 1,
'html5video' : 1,
'htmlwriter' : 1,
'iframe' : 1,
'image' : 1,
'indentblock' : 1,
'indentlist' : 1,
'justify' : 1,
'language' : 1,
'link' : 1,
'list' : 1,
'liststyle' : 1,
'magicline' : 1,
'markdown' : 1,
'maximize' : 1,
'newpage' : 1,
'pagebreak' : 1,
'pastefromword' : 1,
'pastetext' : 1,
'removeformat' : 1,
'resize' : 1,
'save' : 1,
'scayt' : 1,
'selectall' : 1,
'showblocks' : 1,
'showborders' : 1,
'smiley' : 1,
'sourcearea' : 1,
'sourcedialog' : 1,
'specialchar' : 1,
'stylescombo' : 1,
'tab' : 1,
'table' : 1,
'tabletools' : 1,
'toolbar' : 1,
'undo' : 1,
'videodetector' : 1,
'wsc' : 1,
'wysiwygarea' : 1
'a11ychecker': 1,
'dialogui': 1,
'dialog': 1,
'a11yhelp': 1,
'about': 1,
'xml': 1,
'ajax': 1,
'basicstyles': 1,
'bidi': 1,
'blockquote': 1,
'notification': 1,
'button': 1,
'toolbar': 1,
'clipboard': 1,
'codemirror': 1,
'panelbutton': 1,
'panel': 1,
'floatpanel': 1,
'colorbutton': 1,
'colordialog': 1,
'menu': 1,
'contextmenu': 1,
'copyformatting': 1,
'dialogadvtab': 1,
'div': 1,
'elementspath': 1,
'enterkey': 1,
'entities': 1,
'popup': 1,
'filebrowser': 1,
'find': 1,
'fakeobjects': 1,
'flash': 1,
'floatingspace': 1,
'listblock': 1,
'richcombo': 1,
'font': 1,
'format': 1,
'horizontalrule': 1,
'htmlwriter': 1,
'iframe': 1,
'image': 1,
'indent': 1,
'indentblock': 1,
'indentlist': 1,
'justify': 1,
'menubutton': 1,
'language': 1,
'link': 1,
'list': 1,
'liststyle': 1,
'limereplacementfields' : 1,
'magicline': 1,
'maximize': 1,
'newpage': 1,
'pagebreak': 1,
'pastefromword': 1,
'pastetext': 1,
'removeformat': 1,
'resize': 1,
'save': 1,
'scayt': 1,
'selectall': 1,
'showblocks': 1,
'showborders': 1,
'smiley': 1,
'sourcearea': 1,
'sourcedialog': 1,
'specialchar': 1,
'stylescombo': 1,
'tab': 1,
'table': 1,
'tabletools': 1,
'undo': 1,
'videodetector': 1,
'wsc': 1,
'wysiwygarea': 1,
'lineutils': 1,
'widgetselection': 1,
'widget': 1,
'html5video': 1,
'markdown': 1
},
languages : {
'af' : 1,
Expand Down Expand Up @@ -187,4 +203,4 @@ var CKBUILDER_CONFIG = {
'zh' : 1,
'zh-cn' : 1
}
};
};
101 changes: 84 additions & 17 deletions assets/packages/ckeditor/config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,85 @@
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function (a) {

a.plugins = "a11ychecker,dialogui,dialog,a11yhelp,about,xml,ajax,basicstyles,bidi,blockquote,notification,button,toolbar,clipboard,codemirror,panelbutton,panel,floatpanel,colorbutton,colordialog,menu,contextmenu,copyformatting,dialogadvtab,div,elementspath,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,format,horizontalrule,htmlwriter,iframe,image,indent,indentblock,indentlist,justify,menubutton,language,link,list,liststyle,magicline,maximize,newpage,pagebreak,pastefromword,pastetext,removeformat,resize,save,scayt,selectall,showblocks,showborders,smiley,sourcearea,sourcedialog,specialchar,stylescombo,tab,table,tabletools,undo,videodetector,wsc,wysiwygarea,lineutils,widgetselection,widget,html5video,markdown";

a.filebrowserBrowseUrl = CKEDITOR.basePath + "../../../third_party/kcfinder/browse.php?type\x3dfiles";
a.filebrowserImageBrowseUrl = CKEDITOR.basePath + "../../../third_party/kcfinder/browse.php?type\x3dimages";
a.filebrowserFlashBrowseUrl = CKEDITOR.basePath + "../../../third_party/kcfinder/browse.php?type\x3dflash";
a.filebrowserUploadUrl = CKEDITOR.basePath + "../../../third_party/kcfinder/upload.php?type\x3dfiles";
a.filebrowserImageUploadUrl = CKEDITOR.basePath + "../../../third_party/kcfinder/upload.php?type\x3dimages";
a.filebrowserFlashUploadUrl = CKEDITOR.basePath + "../../../third_party/kcfinder/upload.php?type\x3dflash";
a.removeDialogTabs = "link:upload;image:Upload";
a.image_prefillDimensions = !1;
a.image2_prefillDimensions = !1;
a.allowedContent = !0;
a.skin = "bootstrapck";
a.autoParagraph = !1;
a.basicEntities = !1;
a.entities = !1;
a.uiColor = "#f1f1f1";

CKEDITOR.editorConfig = function( config ) {

// %REMOVE_START%
// The configuration options below are needed when running CKEditor from source files.
config.skin = 'bootstrapck';
config.plugins = 'a11ychecker,dialogui,dialog,a11yhelp,about,xml,ajax,basicstyles,bidi,blockquote,notification,button,toolbar,clipboard,codemirror,panelbutton,panel,floatpanel,colorbutton,colordialog,menu,contextmenu,copyformatting,dialogadvtab,div,elementspath,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,format,horizontalrule,htmlwriter,iframe,image,indent,indentblock,indentlist,justify,menubutton,language,link,list,liststyle,magicline,maximize,newpage,pagebreak,pastefromword,pastetext,removeformat,resize,save,scayt,selectall,showblocks,showborders,smiley,sourcearea,sourcedialog,specialchar,stylescombo,tab,table,tabletools,undo,videodetector,wsc,wysiwygarea,lineutils,widgetselection,widget,html5video,markdown';
config.allowedContent = true;
// %REMOVE_END%

// Define changes to default configuration here. For example:
// config.language = 'fr';
//config.uiColor = '#EEF6EF';
};
"rtl" == $("html").attr("dir") && (a.contentsLangDirection = "rtl");
a.toolbar_popup = [
["Save", "Source", "Createlimereplacementfields"],
["Cut", "Copy", "Paste", "PasteText", "PasteFromWord"], "Undo Redo - Find Replace - SelectAll RemoveFormat".split(" "),
"Image VideoDetector Flash Table HorizontalRule Smiley SpecialChar".split(" "), "/", "Bold Italic Underline Strike - Subscript Superscript".split(" "),
"NumberedList BulletedList - Outdent Indent Blockquote CreateDiv".split(" "), ["JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"],
["BidiLtr", "BidiRtl"],
["Link", "Unlink", "Anchor", "Iframe"], "/", ["Styles", "Format", "Font", "FontSize"],
["TextColor", "BGColor"],
["ShowBlocks", "Templates"]
];
a.toolbar_inline = [
["Source", "Createlimereplacementfields"],
["Cut",
"Copy", "Paste", "PasteText", "PasteFromWord"
], "Undo Redo - Find Replace - SelectAll RemoveFormat".split(" "), ["Image", "VideoDetector", "Flash"],
["Table", "HorizontalRule", "Smiley", "SpecialChar"],
["Bold", "Italic", "Underline", "Strike"],
["Subscript", "Superscript"],
["NumberedList", "BulletedList"],
["Outdent", "Indent", "Blockquote", "CreateDiv"],
["JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"],
["BidiLtr", "BidiRtl"],
["ShowBlocks", "Templates"],
["Link", "Unlink"],
["Styles", "Format", "Font", "FontSize"],
["Anchor", "Iframe"],
["TextColor", "BGColor"]
];
a.toolbar_inline2 = [
["Maximize", "Createlimereplacementfields"],
["Bold", "Italic", "Underline"],
["NumberedList", "BulletedList", "-", "Outdent", "Indent"],
["JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"],
["Link", "Unlink", "Image"],
["Source"]
];

a.toolbar = [
["Source", "Createlimereplacementfields"],
["Cut",
"Copy", "Paste", "PasteText", "PasteFromWord"
], "Undo Redo - Find Replace - SelectAll RemoveFormat".split(" "), ["Image", "VideoDetector", "Flash"],
["Table", "HorizontalRule", "Smiley", "SpecialChar"],
["Bold", "Italic", "Underline", "Strike"],
["Subscript", "Superscript"],
["NumberedList", "BulletedList"],
["Outdent", "Indent", "Blockquote", "CreateDiv"],
["JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"],
["BidiLtr", "BidiRtl"],
["ShowBlocks", "Templates"],
["Link", "Unlink"],
["Styles", "Format", "Font", "FontSize"],
["Anchor", "Iframe"],
["TextColor", "BGColor"]
];
a.extraPlugins = "limereplacementfields,codemirror,sourcedialog";
a.removePlugins = 'sourcearea';

};

0 comments on commit d0a70a4

Please sign in to comment.