From 99777cf7f1059439d392d5c73c0f41f1c69d4973 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 16 Apr 2022 12:45:31 +0800 Subject: [PATCH] --- public/static/plugs/ckeditor/ckeditor.js | 4 +- public/static/plugs/ckeditor/config.js | 4 +- .../plugs/ckeditor/plugins/lineheight/LICENSE | 22 +++++ .../ckeditor/plugins/lineheight/README.md | 2 + .../ckeditor/plugins/lineheight/lang/LANG.js | 3 + .../ckeditor/plugins/lineheight/lang/ar.js | 3 + .../ckeditor/plugins/lineheight/lang/de.js | 3 + .../ckeditor/plugins/lineheight/lang/en.js | 3 + .../ckeditor/plugins/lineheight/lang/es.js | 3 + .../ckeditor/plugins/lineheight/lang/fr.js | 3 + .../ckeditor/plugins/lineheight/lang/ko.js | 3 + .../ckeditor/plugins/lineheight/lang/pt.js | 3 + .../ckeditor/plugins/lineheight/plugin.js | 81 +++++++++++++++++++ .../ckeditor/plugins/lineheight/readme.txt | 30 +++++++ 14 files changed, 163 insertions(+), 4 deletions(-) create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/LICENSE create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/README.md create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/lang/LANG.js create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/lang/ar.js create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/lang/de.js create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/lang/en.js create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/lang/es.js create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/lang/fr.js create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/lang/ko.js create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/lang/pt.js create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/plugin.js create mode 100644 public/static/plugs/ckeditor/plugins/lineheight/readme.txt diff --git a/public/static/plugs/ckeditor/ckeditor.js b/public/static/plugs/ckeditor/ckeditor.js index 09b8586b5..72f9f2c6e 100644 --- a/public/static/plugs/ckeditor/ckeditor.js +++ b/public/static/plugs/ckeditor/ckeditor.js @@ -1043,8 +1043,8 @@ m(a,a.addCommand("indent",new b(!0)));m(a,a.addCommand("outdent",new b));a.ui.ad c.getDirection())f.setStartAfter(c),n=new CKEDITOR.dom.walker(f);else{var d=a.config.indentClasses;if(d)for(var g="ltr"==b.data.dir?["_rtl",""]:["","_rtl"],h=0;h(a+=l?1:-1))return;a=Math.min(a,c.length);a=Math.max(a,0);b.$.className=CKEDITOR.tools.ltrim(b.$.className.replace(this.classNameRegex,""));0a)return;a=Math.max(a, -0);a=Math.ceil(a/g)*g;b.setStyle(c,a?a+(d.config.indentUnit||"px"):"");""===b.getAttribute("style")&&b.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,b,"indent_processed",1)}}function m(b,c){return"ltr"==(c||b.getComputedStyle("direction"))?"margin-left":"margin-right"}var h=CKEDITOR.dtd.$listItem,p=CKEDITOR.dtd.$list,k=CKEDITOR.TRISTATE_DISABLED,n=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(b){function c(){a.specificDefinition.apply(this, +b,e){b=this.jobs[b];a.activeFilter.checkFeature(this)?b.state=b.refresh.call(this,a,e):b.state=k;return b.state},getContext:function(a){return a.contains(this.context)}}})();(function(){function f(b,c,a){if(!b.getCustomData("indent_processed")){var d=this.editor,l=this.isIndent;if(c){d=b.$.className.match(this.classNameRegex);a=0;d&&(d=d[1],a=CKEDITOR.tools.indexOf(c,d)+1);if(0>(a+=l?1:-1))return;a=Math.min(a,c.length);a=Math.max(a,0);b.$.className=CKEDITOR.tools.ltrim(b.$.className.replace(this.classNameRegex,""));0a)return;a=Math.max(a, +0);a=Math.ceil(a/g)*g;b.setStyle(c,a?a+(d.config.indentUnit||"em"):"");""===b.getAttribute("style")&&b.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,b,"indent_processed",1)}}function m(b,c){return"ltr"==(c||b.getComputedStyle("direction"))?"text-indent":"text-indent"}var h=CKEDITOR.dtd.$listItem,p=CKEDITOR.dtd.$list,k=CKEDITOR.TRISTATE_DISABLED,n=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(b){function c(){a.specificDefinition.apply(this, arguments);this.allowedContent={"div h1 h2 h3 h4 h5 h6 ol p pre ul":{propertiesOnly:!0,styles:d?null:"margin-left,margin-right",classes:d||null}};this.contentTransformations=[["div: splitMarginShorthand"],["h1: splitMarginShorthand"],["h2: splitMarginShorthand"],["h3: splitMarginShorthand"],["h4: splitMarginShorthand"],["h5: splitMarginShorthand"],["h6: splitMarginShorthand"],["ol: splitMarginShorthand"],["p: splitMarginShorthand"],["pre: splitMarginShorthand"],["ul: splitMarginShorthand"]];this.enterBr&& (this.allowedContent.div=!0);this.requiredContent=(this.enterBr?"div":"p")+(d?"("+d.join(",")+")":"{margin-left}");this.jobs={20:{refresh:function(a,b){var e=b.block||b.blockLimit;if(!e.is(h))var c=e.getAscendant(h),e=c&&b.contains(c)||e;e.is(h)&&(e=e.getParent());if(this.enterBr||this.getContext(b)){if(d){var c=d,e=e.$.className.match(this.classNameRegex),f=this.isIndent,c=e?f?e[1]!=c.slice(-1):!0:f;return c?n:k}return this.isIndent?n:e?CKEDITOR[0>=(parseInt(e.getStyle(m(e)),10)||0)?"TRISTATE_DISABLED": "TRISTATE_OFF"]:k}return k},exec:function(a){var b=a.getSelection(),b=b&&b.getRanges()[0],c;if(c=a.elementPath().contains(p))f.call(this,c,d);else for(b=b.createIterator(),a=a.config.enterMode,b.enforceRealBlocks=!0,b.enlargeBr=a!=CKEDITOR.ENTER_BR;c=b.getNextParagraph(a==CKEDITOR.ENTER_P?"p":"div");)c.isReadOnly()||f.call(this,c,d);return!0}}}}var a=CKEDITOR.plugins.indent,d=b.config.indentClasses;a.registerCommands(b,{indentblock:new c(b,"indentblock",!0),outdentblock:new c(b,"outdentblock")}); diff --git a/public/static/plugs/ckeditor/config.js b/public/static/plugs/ckeditor/config.js index d01a3cf82..a5fe7f412 100644 --- a/public/static/plugs/ckeditor/config.js +++ b/public/static/plugs/ckeditor/config.js @@ -3,13 +3,13 @@ CKEDITOR.editorConfig = function (config) { config.toolbar = [ {name: 'document', items: ['Source']}, {name: 'styles', items: ['Font', 'FontSize']}, - {name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', 'TextColor', 'BGColor', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList']}, + {name: 'basicstyles', items: ['lineheight', 'Indent', 'Outdent', 'Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', 'TextColor', 'BGColor', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList']}, {name: 'element', items: ['Link', 'Unlink', 'Table', 'UploadImage', 'UploadMusic', 'UploadVideo', 'UploadHtml']}, {name: 'tools', items: ['Print', 'Maximize']} ]; config.language = 'zh-cn'; config.format_tags = 'p;h1;h2;h3;pre'; - config.extraPlugins = 'uimage,umusic,uhtml,uvideo'; + config.extraPlugins = 'uimage,umusic,uhtml,uvideo,lineheight'; config.removePlugins = 'easyimage,cloudservices,exportpdf'; config.removeButtons = 'Underline,Subscript,Superscript'; config.removeDialogTabs = 'image:advanced;link:advanced'; diff --git a/public/static/plugs/ckeditor/plugins/lineheight/LICENSE b/public/static/plugs/ckeditor/plugins/lineheight/LICENSE new file mode 100644 index 000000000..78f4754db --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Kamlesh Kushwaha + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/public/static/plugs/ckeditor/plugins/lineheight/README.md b/public/static/plugs/ckeditor/plugins/lineheight/README.md new file mode 100644 index 000000000..a7fdba006 --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/README.md @@ -0,0 +1,2 @@ +# lineheight +Ckeditor lineheight plugin repository diff --git a/public/static/plugs/ckeditor/plugins/lineheight/lang/LANG.js b/public/static/plugs/ckeditor/plugins/lineheight/lang/LANG.js new file mode 100644 index 000000000..66a7c5faf --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/lang/LANG.js @@ -0,0 +1,3 @@ +CKEDITOR.plugins.setLang('lineheight','{LANGUAGE_CODE}', { + title: '{LINE-HEIGHT}' +} ); diff --git a/public/static/plugs/ckeditor/plugins/lineheight/lang/ar.js b/public/static/plugs/ckeditor/plugins/lineheight/lang/ar.js new file mode 100644 index 000000000..be7347b84 --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/lang/ar.js @@ -0,0 +1,3 @@ +CKEDITOR.plugins.setLang('lineheight','ar', { + title: 'خط الطول' +} ); diff --git a/public/static/plugs/ckeditor/plugins/lineheight/lang/de.js b/public/static/plugs/ckeditor/plugins/lineheight/lang/de.js new file mode 100644 index 000000000..4a5ee258a --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/lang/de.js @@ -0,0 +1,3 @@ +CKEDITOR.plugins.setLang('lineheight','de', { + title: 'Zeilenhöhe' +} ); diff --git a/public/static/plugs/ckeditor/plugins/lineheight/lang/en.js b/public/static/plugs/ckeditor/plugins/lineheight/lang/en.js new file mode 100644 index 000000000..1638ea777 --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/lang/en.js @@ -0,0 +1,3 @@ +CKEDITOR.plugins.setLang('lineheight','en', { + title: '行间距' +} ); diff --git a/public/static/plugs/ckeditor/plugins/lineheight/lang/es.js b/public/static/plugs/ckeditor/plugins/lineheight/lang/es.js new file mode 100644 index 000000000..14981768b --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/lang/es.js @@ -0,0 +1,3 @@ +CKEDITOR.plugins.setLang('lineheight','es', { + title: 'Altura de Línea' +} ); diff --git a/public/static/plugs/ckeditor/plugins/lineheight/lang/fr.js b/public/static/plugs/ckeditor/plugins/lineheight/lang/fr.js new file mode 100644 index 000000000..16798893b --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/lang/fr.js @@ -0,0 +1,3 @@ +CKEDITOR.plugins.setLang('lineheight','fr', { + title: 'Hauteur de Ligne' +} ); diff --git a/public/static/plugs/ckeditor/plugins/lineheight/lang/ko.js b/public/static/plugs/ckeditor/plugins/lineheight/lang/ko.js new file mode 100644 index 000000000..782bd8740 --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/lang/ko.js @@ -0,0 +1,3 @@ +CKEDITOR.plugins.setLang('lineheight','ko', { + title: '줄 높이' +} ); diff --git a/public/static/plugs/ckeditor/plugins/lineheight/lang/pt.js b/public/static/plugs/ckeditor/plugins/lineheight/lang/pt.js new file mode 100644 index 000000000..f8ca6e43a --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/lang/pt.js @@ -0,0 +1,3 @@ +CKEDITOR.plugins.setLang('lineheight','af', { + title: 'linha Altura' +} ); diff --git a/public/static/plugs/ckeditor/plugins/lineheight/plugin.js b/public/static/plugs/ckeditor/plugins/lineheight/plugin.js new file mode 100644 index 000000000..464c74781 --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/plugin.js @@ -0,0 +1,81 @@ +( function() { + function addCombo( editor, comboName, styleType, lang, entries, defaultLabel, styleDefinition, order ) { + var config = editor.config,style = new CKEDITOR.style( styleDefinition ); + var names = entries.split( ';' ),values = []; + var styles = {}; + for ( var i = 0; i < names.length; i++ ) { + var parts = names[ i ]; + if ( parts ) { + parts = parts.split( '/' ); + var vars = {},name = names[ i ] = parts[ 0 ]; + vars[ styleType ] = values[ i ] = parts[ 1 ] || name; + styles[ name ] = new CKEDITOR.style( styleDefinition, vars ); + styles[ name ]._.definition.name = name; + } else + names.splice( i--, 1 ); + } + editor.ui.addRichCombo( comboName, { + label: editor.lang.lineheight.title, + title: editor.lang.lineheight.title, + toolbar: 'styles,' + order, + allowedContent: style, + requiredContent: style, + panel: { + css: [ CKEDITOR.skin.getPath( 'editor' ) ].concat( config.contentsCss ), + multiSelect: false, + attributes: { 'aria-label': editor.lang.lineheight.title } + }, + init: function() { + this.startGroup(editor.lang.lineheight.title); + for ( var i = 0; i < names.length; i++ ) { + var name = names[ i ]; + this.add( name, styles[ name ].buildPreview(), name ); + } + }, + onClick: function( value ) { + editor.focus(); + editor.fire( 'saveSnapshot' ); + var style = styles[ value ]; + editor[ this.getValue() == value ? 'removeStyle' : 'applyStyle' ]( style ); + editor.fire( 'saveSnapshot' ); + }, + onRender: function() { + editor.on( 'selectionChange', function( ev ) { + var currentValue = this.getValue(); + var elementPath = ev.data.path,elements = elementPath.elements; + for ( var i = 0, element; i < elements.length; i++ ) { + element = elements[ i ]; + for ( var value in styles ) { + if ( styles[ value ].checkElementMatch( element, true, editor ) ) { + if ( value != currentValue ) + this.setValue( value ); + return; + } + } + } + this.setValue( '', defaultLabel ); + }, this ); + }, + refresh: function() { + if ( !editor.activeFilter.check( style ) ) + this.setState( CKEDITOR.TRISTATE_DISABLED ); + } + } ); + } + CKEDITOR.plugins.add( 'lineheight', { + requires: 'richcombo', + lang: 'ar,de,en,es,fr,ko,pt', + init: function( editor ) { + var config = editor.config; + addCombo( editor, 'lineheight', 'size', editor.lang.lineheight.title, config.line_height, editor.lang.lineheight.title, config.lineHeight_style, 40 ); + } + } ); +} )(); +CKEDITOR.config.line_height = '1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72'; +CKEDITOR.config.lineHeight_style = { + element: 'span', + styles: { 'line-height': '#(size)' }, + overrides: [ { + element: 'line-height', attributes: { 'size': null } + } ] +}; diff --git a/public/static/plugs/ckeditor/plugins/lineheight/readme.txt b/public/static/plugs/ckeditor/plugins/lineheight/readme.txt new file mode 100644 index 000000000..313beca71 --- /dev/null +++ b/public/static/plugs/ckeditor/plugins/lineheight/readme.txt @@ -0,0 +1,30 @@ +lineheight +========== + +CKEDITOR Line-height plugin documentation +---------------------------------------------- + +Installation Notes: + + Adding plugin into the toolbar: + Using CKBuilder is a recommended solution, however, if you have plugins developed by yourself or by third parties, you can add plugins to your local installation manually by following the steps described below: + Extract the plugin .zip archive. + Copy the plugin files to the plugins folder of your CKEditor installation. Each plugin must be placed in a sub-folder that matches its "technical" name. + + For example, the lineheight plugin would be installed into this folder: /plugins/lineheight. + Check and resolve plugin dependencies. If a plugin needs others to work, you will need to add these manually as well. + Enable the plugin. Use the extraPlugins setting to add the plugin to your confiuration: + + config.extraPlugins = 'lineheight'; + +Refer this link for configuring the toolbar: http://docs.ckeditor.com/#!/guide/dev_toolbar + + +Customizing the lineheight values in the dropdown +------------------------------------------------------- +In order to have custom values of line-height instead of the default, you can add following line in the config.js file: + + config.line_height="1em;1.1em;1.2em;1.3em;1.4em;1.5em"; + + Here, "em" is the unit of line-height which you can change to "px","%" or any other allowed unit for line-height. + You can also change the numbers based on your requirements. You can have more range or low range , it all depends on your requirements.