From 3d0e7cb9a717183b220b8c5f405b47665b2fe75c Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Feb 2017 18:21:30 +0100 Subject: [PATCH] pull ckeditor config out of main.js --- customize.dist/ckeditor-config.js | 19 +++++++++++++++++++ www/pad/main.js | 17 +---------------- 2 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 customize.dist/ckeditor-config.js diff --git a/customize.dist/ckeditor-config.js b/customize.dist/ckeditor-config.js new file mode 100644 index 000000000..96ac36e75 --- /dev/null +++ b/customize.dist/ckeditor-config.js @@ -0,0 +1,19 @@ +CKEDITOR.editorConfig = function( config ) { + var fixThings = false; + // https://dev.ckeditor.com/ticket/10907 + needsBrFiller= fixThings; + needsNbspFiller= fixThings; + + removeButtons= 'Source,Maximize'; + // magicline plugin inserts html crap into the document which is not part of the + // document itself and causes problems when it's sent across the wire and reflected back + removePlugins= 'resize'; + extraPlugins= 'autolink,colorbutton,colordialog,font'; + toolbarGroups= [{"name":"clipboard","groups":["clipboard","undo"]},{"name":"editing","groups":["find","selection"]},{"name":"links"},{"name":"insert"},{"name":"forms"},{"name":"tools"},{"name":"document","groups":["mode","document","doctools"]},{"name":"others"},{"name":"basicstyles","groups":["basicstyles","cleanup"]},{"name":"paragraph","groups":["list","indent","blocks","align","bidi"]},{"name":"styles"},{"name":"colors"}]; + + //skin: 'moono-cryptpad,/pad/themes/moono-cryptpad/' + //skin: 'flat,/pad/themes/flat/' + //skin: 'moono-lisa,/pad/themes/moono-lisa/' + //skin: 'moono-dark,/pad/themes/moono-dark/' + //skin: 'office2013,/pad/themes/office2013/' +; diff --git a/www/pad/main.js b/www/pad/main.js index e073ea27a..50dc159d9 100644 --- a/www/pad/main.js +++ b/www/pad/main.js @@ -98,23 +98,8 @@ define([ secret.keys = secret.key; } - var fixThings = false; - var editor = window.editor = Ckeditor.replace('editor1', { - // https://dev.ckeditor.com/ticket/10907 - needsBrFiller: fixThings, - needsNbspFiller: fixThings, - removeButtons: 'Source,Maximize', - // magicline plugin inserts html crap into the document which is not part of the - // document itself and causes problems when it's sent across the wire and reflected back - removePlugins: 'resize', - extraPlugins: 'autolink,colorbutton,colordialog,font', - toolbarGroups: [{"name":"clipboard","groups":["clipboard","undo"]},{"name":"editing","groups":["find","selection"]},{"name":"links"},{"name":"insert"},{"name":"forms"},{"name":"tools"},{"name":"document","groups":["mode","document","doctools"]},{"name":"others"},{"name":"basicstyles","groups":["basicstyles","cleanup"]},{"name":"paragraph","groups":["list","indent","blocks","align","bidi"]},{"name":"styles"},{"name":"colors"}], - //skin: 'moono-cryptpad,/pad/themes/moono-cryptpad/' - //skin: 'flat,/pad/themes/flat/' - //skin: 'moono-lisa,/pad/themes/moono-lisa/' - //skin: 'moono-dark,/pad/themes/moono-dark/' - //skin: 'office2013,/pad/themes/office2013/' + customConfig: '/customize/ckeditor-config.js', }); editor.on('instanceReady', function (Ckeditor) {