Compare commits

..

5 Commits

Author SHA1 Message Date
邹景立
ace4b8de9d Update ShopGoodsCate.php 2022-04-17 22:49:53 +08:00
邹景立
8e91a24475 Update ShopGoodsCate.php 2022-04-17 22:48:27 +08:00
Anyon
57d58ea643
!27 编辑器增加行间距设置和首行缩进设置
Merge pull request !27 from 麦客/v6
2022-04-17 14:42:51 +00:00
邹景立
16a169e907 Update SQL02-数据初始化.sql 2022-04-17 22:18:30 +08:00
Administrator
99777cf7f1 2022-04-16 12:45:31 +08:00
16 changed files with 166 additions and 7 deletions

View File

@ -7620,9 +7620,9 @@ VALUES (2, 1, '数据管理', '', '', '#', '', '_self', 0, 1, '2022-03-04 20:34:
INSERT INTO `system_menu`
VALUES (3, 2, '数据统计报表', 'layui-icon layui-icon-theme', 'data/total.portal/index', 'data/total.portal/index', '', '_self', 0, 1, '2022-03-04 20:34:40');
INSERT INTO `system_menu`
VALUES (4, 2, '轮播图片管理', 'layui-icon layui-icon-carousel', 'data/base.config/sliderhome', 'data/base.config/sliderhome', '', '_self', 0, 1, '2022-03-04 20:34:40');
VALUES (4, 2, '轮播图片管理', 'layui-icon layui-icon-carousel', 'data/base.slider/index', 'data/base.slider/index', '', '_self', 0, 1, '2022-03-04 20:34:40');
INSERT INTO `system_menu`
VALUES (5, 2, '页面内容管理', 'layui-icon layui-icon-read', 'data/base.config/pagehome', 'data/base.config/pagehome', '', '_self', 0, 1, '2022-03-04 20:34:40');
VALUES (5, 2, '页面内容管理', 'layui-icon layui-icon-read', 'data/base.pager/index', 'data/base.pager/index', '', '_self', 0, 1, '2022-03-04 20:34:40');
INSERT INTO `system_menu`
VALUES (6, 2, '文章内容管理', 'layui-icon layui-icon-template', 'data/news.item/index', 'data/news.item/index', '', '_self', 0, 1, '2022-03-04 20:34:40');
INSERT INTO `system_menu`

View File

@ -24,7 +24,7 @@ class ShopGoodsCate extends Model
*/
public static function getParentData(int $max, array &$data, array $parent = []): array
{
$items = static::mk()->order('sort desc,id asc')->select()->toArray();
$items = static::mk()->where(['deleted' => 0])->order('sort desc,id asc')->select()->toArray();
$cates = DataExtend::arr2table(empty($parent) ? $items : array_merge([$parent], $items));
if (isset($data['id'])) foreach ($cates as $cate) if ($cate['id'] === $data['id']) $data = $cate;
foreach ($cates as $key => $cate) {

View File

@ -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<d.length;h++)c.hasClass(d[h]+g[0])&&(c.removeClass(d[h]+g[0]),c.addClass(d[h]+g[1]));d=c.getStyle("margin-right");g=c.getStyle("margin-left");d?c.setStyle("margin-left",d):c.removeStyle("margin-left");g?c.setStyle("margin-right",g):c.removeStyle("margin-right")}})}});CKEDITOR.plugins.indent={genericDefinition:function(a){this.isIndent=!!a;
this.startDisabled=!this.isIndent},specificDefinition:function(a,b,e){this.name=b;this.editor=a;this.jobs={};this.enterBr=a.config.enterMode==CKEDITOR.ENTER_BR;this.isIndent=!!e;this.relatedGlobal=e?"indent":"outdent";this.indentKey=e?9:CKEDITOR.SHIFT+9;this.database={}},registerCommands:function(a,b){a.on("pluginsLoaded",function(){for(var a in b)(function(a,b){var e=a.getCommand(b.relatedGlobal),c;for(c in b.jobs)e.on("exec",function(d){d.data.done||(a.fire("lockSnapshot"),b.execJob(a,c)&&(d.data.done=
!0),a.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(b.database))},this,null,c),e.on("refresh",function(d){d.data.states||(d.data.states={});d.data.states[b.name+"@"+c]=b.refreshJob(a,c,d.data.path)},this,null,c);a.addFeature(b)})(this,b[a])})}};CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}};CKEDITOR.plugins.indent.specificDefinition.prototype={execJob:function(a,b){var e=this.jobs[b];if(e.state!=k)return e.exec.call(this,a)},refreshJob:function(a,
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,""));0<a&&b.addClass(c[a-1])}else{c=m(b,a);a=parseInt(b.getStyle(c),10);var g=d.config.indentOffset||40;isNaN(a)&&(a=0);a+=(l?1:-1)*g;if(0>a)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,""));0<a&&b.addClass(c[a-1])}else{c=m(b,a);a=parseInt(b.getStyle(c),10);var g=d.config.indentOffset||2;isNaN(a)&&(a=0);a+=(l?1:-1)*g;if(0>a)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")});

View File

@ -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';

View File

@ -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.

View File

@ -0,0 +1,2 @@
# lineheight
Ckeditor lineheight plugin repository

View File

@ -0,0 +1,3 @@
CKEDITOR.plugins.setLang('lineheight','{LANGUAGE_CODE}', {
title: '{LINE-HEIGHT}'
} );

View File

@ -0,0 +1,3 @@
CKEDITOR.plugins.setLang('lineheight','ar', {
title: 'خط الطول'
} );

View File

@ -0,0 +1,3 @@
CKEDITOR.plugins.setLang('lineheight','de', {
title: 'Zeilenhöhe'
} );

View File

@ -0,0 +1,3 @@
CKEDITOR.plugins.setLang('lineheight','en', {
title: '行间距'
} );

View File

@ -0,0 +1,3 @@
CKEDITOR.plugins.setLang('lineheight','es', {
title: 'Altura de Línea'
} );

View File

@ -0,0 +1,3 @@
CKEDITOR.plugins.setLang('lineheight','fr', {
title: 'Hauteur de Ligne'
} );

View File

@ -0,0 +1,3 @@
CKEDITOR.plugins.setLang('lineheight','ko', {
title: '줄 높이'
} );

View File

@ -0,0 +1,3 @@
CKEDITOR.plugins.setLang('lineheight','af', {
title: 'linha Altura'
} );

View File

@ -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 }
} ]
};

View File

@ -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: <CKEditor 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.