1557492053 1 year ago
parent
commit
b25fe14e37
75 changed files with 11923 additions and 190 deletions
  1. 1 0
      addons/summernote/.addonrc
  2. 48 0
      addons/summernote/Summernote.php
  3. 111 0
      addons/summernote/bootstrap.js
  4. 115 0
      addons/summernote/config.php
  5. 16 0
      addons/summernote/controller/Index.php
  6. 10 0
      addons/summernote/info.ini
  7. 0 1
      addons/ueditor/.addonrc
  8. 0 40
      addons/ueditor/Ueditor.php
  9. 0 63
      addons/ueditor/bootstrap.js
  10. 0 28
      addons/ueditor/config.php
  11. 0 10
      addons/ueditor/info.ini
  12. 1 1
      application/extra/addons.php
  13. 910 0
      public/assets/addons/summernote/css/summernote.css
  14. 12 0
      public/assets/addons/summernote/css/summernote.min.css
  15. BIN
      public/assets/addons/summernote/font/summernote.eot
  16. BIN
      public/assets/addons/summernote/font/summernote.ttf
  17. BIN
      public/assets/addons/summernote/font/summernote.woff
  18. BIN
      public/assets/addons/summernote/font/summernote.woff2
  19. 10229 0
      public/assets/addons/summernote/js/summernote.js
  20. 2 0
      public/assets/addons/summernote/js/summernote.min.js
  21. 184 0
      public/assets/addons/summernote/lang/summernote-zh-CN.js
  22. 2 0
      public/assets/addons/summernote/lang/summernote-zh-CN.min.js
  23. 184 0
      public/assets/addons/summernote/lang/summernote-zh-TW.js
  24. 2 0
      public/assets/addons/summernote/lang/summernote-zh-TW.min.js
  25. BIN
      public/assets/addons/ueditor/themes/ueditor-list/dash.gif
  26. BIN
      public/assets/addons/ueditor/themes/ueditor-list/dot.gif
  27. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-1.gif
  28. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-10.gif
  29. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-11.gif
  30. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-12.gif
  31. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-13.gif
  32. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-14.gif
  33. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-15.gif
  34. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-16.gif
  35. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-17.gif
  36. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-18.gif
  37. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-19.gif
  38. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-2.gif
  39. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-20.gif
  40. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-21.gif
  41. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-22.gif
  42. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-23.gif
  43. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-24.gif
  44. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-25.gif
  45. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-26.gif
  46. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-27.gif
  47. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-28.gif
  48. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-29.gif
  49. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-3.gif
  50. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-30.gif
  51. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-31.gif
  52. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-32.gif
  53. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-33.gif
  54. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-34.gif
  55. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-35.gif
  56. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-36.gif
  57. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-37.gif
  58. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-38.gif
  59. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-39.gif
  60. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-4.gif
  61. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-40.gif
  62. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-41.gif
  63. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-42.gif
  64. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-43.gif
  65. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-44.gif
  66. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-45.gif
  67. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-46.gif
  68. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-47.gif
  69. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-48.gif
  70. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-49.gif
  71. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-5.gif
  72. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-50.gif
  73. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-51.gif
  74. BIN
      public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-52.gif
  75. 96 47
      public/assets/js/addons.js

File diff suppressed because it is too large
+ 1 - 0
addons/summernote/.addonrc


+ 48 - 0
addons/summernote/Summernote.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace addons\summernote;
+
+use think\Addons;
+
+/**
+ * Summernote富文本编辑器
+ */
+class Summernote extends Addons
+{
+
+    /**
+     * 插件安装方法
+     * @return bool
+     */
+    public function install()
+    {
+        return true;
+    }
+
+    /**
+     * 插件卸载方法
+     * @return bool
+     */
+    public function uninstall()
+    {
+        return true;
+    }
+
+    /**
+     * @param $params
+     */
+    public function configInit(&$params)
+    {
+        $config = $this->getConfig();
+        $params['summernote'] = [
+            'classname'        => $config['classname'] ?? '.editor',
+            'height'           => $config['height'] ?? 250,
+            'minHeight'        => $config['minHeight'] ?? 250,
+            'placeholder'      => $config['placeholder'] ?? '',
+            'followingToolbar' => $config['followingToolbar'] ?? 0,
+            'airMode'          => $config['airMode'] ?? 0,
+            'toolbar'          => (array)json_decode($config['toolbar'] ?? '', true),
+        ];
+    }
+
+}

+ 111 - 0
addons/summernote/bootstrap.js

@@ -0,0 +1,111 @@
+require.config({
+    paths: {
+        'summernote': '../addons/summernote/lang/summernote-zh-CN.min'
+    },
+    shim: {
+        'summernote': ['../addons/summernote/js/summernote.min', 'css!../addons/summernote/css/summernote.min.css'],
+    }
+});
+require(['form', 'upload'], function (Form, Upload) {
+    var _bindevent = Form.events.bindevent;
+    Form.events.bindevent = function (form) {
+        _bindevent.apply(this, [form]);
+        try {
+            //绑定summernote事件
+            if ($(Config.summernote.classname || '.editor', form).length > 0) {
+                var selectUrl = typeof Config !== 'undefined' && Config.modulename === 'index' ? 'user/attachment' : 'general/attachment/select';
+                require(['summernote'], function () {
+                    var imageButton = function (context) {
+                        var ui = $.summernote.ui;
+                        var button = ui.button({
+                            contents: '<i class="fa fa-file-image-o"/>',
+                            tooltip: __('Choose'),
+                            click: function () {
+                                parent.Fast.api.open(selectUrl + "?element_id=&multiple=true&mimetype=image/", __('Choose'), {
+                                    callback: function (data) {
+                                        var urlArr = data.url.split(/\,/);
+                                        $.each(urlArr, function () {
+                                            var url = Fast.api.cdnurl(this, true);
+                                            context.invoke('editor.insertImage', url);
+                                        });
+                                    }
+                                });
+                                return false;
+                            }
+                        });
+                        return button.render();
+                    };
+                    var attachmentButton = function (context) {
+                        var ui = $.summernote.ui;
+                        var button = ui.button({
+                            contents: '<i class="fa fa-file"/>',
+                            tooltip: __('Choose'),
+                            click: function () {
+                                parent.Fast.api.open(selectUrl + "?element_id=&multiple=true&mimetype=*", __('Choose'), {
+                                    callback: function (data) {
+                                        var urlArr = data.url.split(/\,/);
+                                        $.each(urlArr, function () {
+                                            var url = Fast.api.cdnurl(this, true);
+                                            var node = $("<a href='" + url + "'>" + url + "</a>");
+                                            context.invoke('insertNode', node[0]);
+                                        });
+                                    }
+                                });
+                                return false;
+                            }
+                        });
+                        return button.render();
+                    };
+
+                    $(Config.summernote.classname || '.editor', form).each(function () {
+                        $(this).summernote($.extend(true, {}, {
+                            height: isNaN(Config.summernote.height) ? null : parseInt(Config.summernote.height),
+                            minHeight: parseInt(Config.summernote.minHeight || 250),
+                            toolbar: Config.summernote.toolbar,
+                            followingToolbar: parseInt(Config.summernote.followingToolbar),
+                            placeholder: Config.summernote.placeholder || '',
+                            airMode: parseInt(Config.summernote.airMode) || false,
+                            lang: 'zh-CN',
+                            fontNames: [
+                                'Arial', 'Arial Black', 'Serif', 'Sans', 'Courier',
+                                'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande',
+                                "Open Sans", "Hiragino Sans GB", "Microsoft YaHei",
+                                '微软雅黑', '宋体', '黑体', '仿宋', '楷体', '幼圆',
+                            ],
+                            fontNamesIgnoreCheck: [
+                                "Open Sans", "Microsoft YaHei",
+                                '微软雅黑', '宋体', '黑体', '仿宋', '楷体', '幼圆'
+                            ],
+                            buttons: {
+                                image: imageButton,
+                                attachment: attachmentButton,
+                            },
+                            dialogsInBody: true,
+                            callbacks: {
+                                onChange: function (contents) {
+                                    $(this).val(contents);
+                                    $(this).trigger('change');
+                                },
+                                onInit: function () {
+                                },
+                                onImageUpload: function (files) {
+                                    var that = this;
+                                    //依次上传图片
+                                    for (var i = 0; i < files.length; i++) {
+                                        Upload.api.send(files[i], function (data) {
+                                            var url = Fast.api.cdnurl(data.url, true);
+                                            $(that).summernote("insertImage", url, 'filename');
+                                        });
+                                    }
+                                }
+                            }
+                        }, $(this).data("summernote-options") || {}));
+                    });
+                });
+            }
+        } catch (e) {
+
+        }
+
+    };
+});

+ 115 - 0
addons/summernote/config.php

@@ -0,0 +1,115 @@
+<?php
+
+return [
+    [
+        'name'    => 'classname',
+        'title'   => '渲染文本框元素',
+        'type'    => 'string',
+        'content' => [],
+        'value'   => '.editor',
+        'rule'    => 'required',
+        'msg'     => '',
+        'tip'     => '用于对指定的元素渲染,一般情况下无需修改',
+        'ok'      => '',
+        'extend'  => '',
+    ],
+    [
+        'name'    => 'height',
+        'title'   => '默认高度',
+        'type'    => 'string',
+        'content' => [],
+        'value'   => '250',
+        'rule'    => 'required',
+        'msg'     => '',
+        'tip'     => '编辑器默认高度,auto表示自适应高度',
+        'ok'      => '',
+        'extend'  => '',
+    ],
+    [
+        'name'    => 'minHeight',
+        'title'   => '默认高度',
+        'type'    => 'number',
+        'content' => [],
+        'value'   => '250',
+        'rule'    => 'required',
+        'msg'     => '',
+        'tip'     => '编辑器最低高度',
+        'ok'      => '',
+        'extend'  => '',
+    ],
+    [
+        'name'    => 'followingToolbar',
+        'title'   => '是否浮动工具栏',
+        'type'    => 'radio',
+        'content' => [
+            1 => '是',
+            0 => '否',
+        ],
+        'value'   => '0',
+        'rule'    => 'required',
+        'msg'     => '',
+        'tip'     => '是否浮动工具栏,通常配置自适应高度时使用',
+        'ok'      => '',
+        'extend'  => '',
+    ],
+    [
+        'name'    => 'airMode',
+        'title'   => '内嵌模式',
+        'type'    => 'radio',
+        'content' => [
+            1 => '是',
+            0 => '否',
+        ],
+        'value'   => '0',
+        'rule'    => 'required',
+        'msg'     => '',
+        'tip'     => '启用内嵌模式后将禁用工具栏',
+        'ok'      => '',
+        'extend'  => '',
+    ],
+    [
+        'name'    => 'toolbar',
+        'title'   => '默认工具栏配置',
+        'type'    => 'text',
+        'content' => [],
+        'value'   => '[' . "\r\n"
+            . '	["style", ["style", "undo", "redo"]],' . "\r\n"
+            . '	["font", ["bold", "underline", "strikethrough", "clear"]],' . "\r\n"
+            . '	["fontname", ["color", "fontname", "fontsize"]],' . "\r\n"
+            . '	["para", ["ul", "ol", "paragraph", "height"]],' . "\r\n"
+            . '	["table", ["table", "hr"]],' . "\r\n"
+            . '	["insert", ["link", "picture", "video"]],' . "\r\n"
+            . '	["select", ["image", "attachment"]],' . "\r\n"
+            . '	["view", ["fullscreen", "codeview", "help"]]' . "\r\n"
+            . ']',
+        'rule'    => 'required',
+        'msg'     => '',
+        'tip'     => '',
+        'ok'      => '',
+        'extend'  => 'rows=10',
+    ],
+    [
+        'name'    => 'placeholder',
+        'title'   => '默认占位文字',
+        'type'    => 'string',
+        'content' => [],
+        'value'   => '',
+        'rule'    => '',
+        'msg'     => '',
+        'tip'     => '',
+        'ok'      => '',
+        'extend'  => '',
+    ],
+    [
+        'name'    => '__tips__',
+        'title'   => '温馨提示',
+        'type'    => 'string',
+        'content' => [],
+        'value'   => '工具栏配置请参考文档:https://summernote.org/deep-dive/',
+        'rule'    => '',
+        'msg'     => '',
+        'tip'     => '',
+        'ok'      => '',
+        'extend'  => '',
+    ],
+];

+ 16 - 0
addons/summernote/controller/Index.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace addons\summernote\controller;
+
+use think\addons\Controller;
+
+class Index extends Controller
+{
+
+    public function index()
+    {
+        $this->error("当前插件暂无前台页面");
+    }
+
+}
+

+ 10 - 0
addons/summernote/info.ini

@@ -0,0 +1,10 @@
+name = summernote
+title = Summernote富文本编辑器
+intro = 一款简单的富文本编辑器
+author = FastAdmin
+website = http://www.fastadmin.net
+version = 1.1.2
+url = /addons/summernote
+state = 1
+license = regular
+licenseto = 10455

File diff suppressed because it is too large
+ 0 - 1
addons/ueditor/.addonrc


+ 0 - 40
addons/ueditor/Ueditor.php

@@ -1,40 +0,0 @@
-<?php
-
-namespace addons\ueditor;
-
-use think\Addons;
-
-/**
- * 百度Ueditor插件
- */
-class Ueditor extends Addons
-{
-
-    /**
-     * 插件安装方法
-     * @return bool
-     */
-    public function install()
-    {
-        return true;
-    }
-
-    /**
-     * 插件卸载方法
-     * @return bool
-     */
-    public function uninstall()
-    {
-        return true;
-    }
-
-    /**
-     * @param $params
-     */
-    public function configInit(&$params)
-    {
-        $config = $this->getConfig();
-        $params['ueditor'] = ['classname' => $config['classname'] ?? '.editor'];
-        $params['ueditor'] = ['baiduMapAk' => $config['baiduMapAk'] ?? ''];
-    }
-}

+ 0 - 63
addons/ueditor/bootstrap.js

@@ -1,63 +0,0 @@
-window.UEDITOR_HOME_URL = Config.__CDN__ + "/assets/addons/ueditor/";
-require.config({
-    paths: {
-        'ueditor.config': '../addons/ueditor/ueditor.config',
-        'ueditor': '../addons/ueditor/ueditor.all.min',
-        'ueditor.zh': '../addons/ueditor/i18n/zh-cn/zh-cn',
-        'zeroclipboard': '../addons/ueditor/third-party/zeroclipboard/ZeroClipboard.min',
-    },
-    shim: {
-        'ueditor': {
-            deps: ['zeroclipboard', 'ueditor.config'],
-            exports: 'UE',
-            init: function (ZeroClipboard) {
-                //导出到全局变量,供ueditor使用
-                window.ZeroClipboard = ZeroClipboard;
-            },
-        },
-        'ueditor.zh': ['ueditor']
-    }
-});
-require(['form', 'upload'], function (Form, Upload) {
-    var _bindevent = Form.events.bindevent;
-    Form.events.bindevent = function (form) {
-        _bindevent.apply(this, [form]);
-        try {
-            //绑定editor事件
-            require(['ueditor', 'ueditor.zh'], function (UE, undefined) {
-                UE.list = [];
-                window.UEDITOR_CONFIG['uploadService'] = function (context, editor) {
-                    return {
-                        Upload: () => { return Upload },
-                        Fast: () => { return Fast },
-                    }
-                };
-                $(Config.ueditor.classname || '.editor', form).each(function () {
-                    var id = $(this).attr("id");
-                    var name = $(this).attr("name");
-                    $(this).removeClass('form-control');
-                    UE.list[id] = UE.getEditor(id, {
-                        allowDivTransToP: false, //阻止div自动转p标签
-                        initialFrameWidth: '100%',
-                        initialFrameHeight: 320,
-                        autoFloatEnabled: false,
-                        baiduMapAk: Config.ueditor.baiduMapAk || '', //百度地图api密钥(ak)
-                        // autoHeightEnabled: true, //自动高度
-                        zIndex: 90,
-                        xssFilterRules: false,
-                        outputXssFilter: false,
-                        inputXssFilter: false,
-                        catchRemoteImageEnable: true,
-                        imageAllowFiles: '',//允许上传的图片格式,编辑器默认[".png", ".jpg", ".jpeg", ".gif", ".bmp"]
-                    });
-                    UE.list[id].addListener("contentChange", function () {
-                        $('#' + id).val(this.getContent());
-                        $('textarea[name="' + name + '"]').val(this.getContent());
-                    })
-                });
-            })
-        } catch (e) {
-            console.log('绑定editor事件', e)
-        }
-    }
-});

+ 0 - 28
addons/ueditor/config.php

@@ -1,28 +0,0 @@
-<?php
-
-return [
-    [
-        'name'    => 'classname',
-        'title'   => '渲染文本框元素',
-        'type'    => 'string',
-        'content' => [],
-        'value'   => '.editor',
-        'rule'    => 'required',
-        'msg'     => '',
-        'tip'     => '用于对指定的元素渲染,一般情况下无需修改',
-        'ok'      => '',
-        'extend'  => '',
-    ],
-    [
-        'name'    => 'baiduMapAk',
-        'title'   => '百度地图ak',
-        'type'    => 'string',
-        'content' => [],
-        'value'   => '',
-        'rule'    => '',
-        'msg'     => '',
-        'tip'     => '需要设置百度地图api密钥(ak),否则地图无法使用',
-        'ok'      => '',
-        'extend'  => '',
-    ],
-];

+ 0 - 10
addons/ueditor/info.ini

@@ -1,10 +0,0 @@
-name = ueditor
-title = 百度ueditor插件
-intro = 基于百度Ueditor的富文本编辑器
-author = chance
-website = http://it-huai.gitee.io/ueditor-api/
-version = 1.0.9
-state = 1
-url = /addons/ueditor
-license = basic
-licenseto = 20762

+ 1 - 1
application/extra/addons.php

@@ -11,7 +11,7 @@ return [
             'fastchat',
         ],
         'config_init' => [
-            'ueditor',
+            'summernote',
         ],
     ],
     'route' => [],

File diff suppressed because it is too large
+ 910 - 0
public/assets/addons/summernote/css/summernote.css


File diff suppressed because it is too large
+ 12 - 0
public/assets/addons/summernote/css/summernote.min.css


BIN
public/assets/addons/summernote/font/summernote.eot


BIN
public/assets/addons/summernote/font/summernote.ttf


BIN
public/assets/addons/summernote/font/summernote.woff


BIN
public/assets/addons/summernote/font/summernote.woff2


File diff suppressed because it is too large
+ 10229 - 0
public/assets/addons/summernote/js/summernote.js


File diff suppressed because it is too large
+ 2 - 0
public/assets/addons/summernote/js/summernote.min.js


+ 184 - 0
public/assets/addons/summernote/lang/summernote-zh-CN.js

@@ -0,0 +1,184 @@
+/*!
+ *
+ * Super simple WYSIWYG editor v0.8.20
+ * https://summernote.org
+ *
+ *
+ * Copyright 2013- Alan Hong and contributors
+ * Summernote may be freely distributed under the MIT license.
+ *
+ * Date: 2021-10-14T21:15Z
+ *
+ */
+(function webpackUniversalModuleDefinition(root, factory) {
+	if(typeof exports === 'object' && typeof module === 'object')
+		module.exports = factory();
+	else if(typeof define === 'function' && define.amd)
+		define([], factory);
+	else {
+		var a = factory();
+		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+	}
+})(self, function() {
+return /******/ (() => { // webpackBootstrap
+var __webpack_exports__ = {};
+(function ($) {
+  $.extend($.summernote.lang, {
+    'zh-CN': {
+      font: {
+        bold: '粗体',
+        italic: '斜体',
+        underline: '下划线',
+        clear: '清除格式',
+        height: '行高',
+        name: '字体',
+        strikethrough: '删除线',
+        subscript: '下标',
+        superscript: '上标',
+        size: '字号'
+      },
+      image: {
+        image: '图片',
+        insert: '插入图片',
+        resizeFull: '缩放至 100%',
+        resizeHalf: '缩放至 50%',
+        resizeQuarter: '缩放至 25%',
+        floatLeft: '靠左浮动',
+        floatRight: '靠右浮动',
+        floatNone: '取消浮动',
+        shapeRounded: '形状: 圆角',
+        shapeCircle: '形状: 圆',
+        shapeThumbnail: '形状: 缩略图',
+        shapeNone: '形状: 无',
+        dragImageHere: '将图片拖拽至此处',
+        dropImage: '拖拽图片或文本',
+        selectFromFiles: '从本地上传',
+        maximumFileSize: '文件大小最大值',
+        maximumFileSizeError: '文件大小超出最大值。',
+        url: '图片地址',
+        remove: '移除图片',
+        original: '原始图片'
+      },
+      video: {
+        video: '视频',
+        videoLink: '视频链接',
+        insert: '插入视频',
+        url: '视频地址',
+        providers: '(视频地址)'
+      },
+      link: {
+        link: '链接',
+        insert: '插入链接',
+        unlink: '去除链接',
+        edit: '编辑链接',
+        textToDisplay: '显示文本',
+        url: '链接地址',
+        openInNewWindow: '在新窗口打开'
+      },
+      table: {
+        table: '表格',
+        addRowAbove: '在上方插入行',
+        addRowBelow: '在下方插入行',
+        addColLeft: '在左侧插入列',
+        addColRight: '在右侧插入列',
+        delRow: '删除行',
+        delCol: '删除列',
+        delTable: '删除表格'
+      },
+      hr: {
+        insert: '水平线'
+      },
+      style: {
+        style: '样式',
+        p: '普通',
+        blockquote: '引用',
+        pre: '代码',
+        h1: '标题 1',
+        h2: '标题 2',
+        h3: '标题 3',
+        h4: '标题 4',
+        h5: '标题 5',
+        h6: '标题 6'
+      },
+      lists: {
+        unordered: '无序列表',
+        ordered: '有序列表'
+      },
+      options: {
+        help: '帮助',
+        fullscreen: '全屏',
+        codeview: '源代码'
+      },
+      paragraph: {
+        paragraph: '段落',
+        outdent: '减少缩进',
+        indent: '增加缩进',
+        left: '左对齐',
+        center: '居中对齐',
+        right: '右对齐',
+        justify: '两端对齐'
+      },
+      color: {
+        recent: '最近使用',
+        more: '更多',
+        background: '背景',
+        foreground: '前景',
+        transparent: '透明',
+        setTransparent: '透明',
+        reset: '重置',
+        resetToDefault: '默认'
+      },
+      shortcut: {
+        shortcuts: '快捷键',
+        close: '关闭',
+        textFormatting: '文本格式',
+        action: '动作',
+        paragraphFormatting: '段落格式',
+        documentStyle: '文档样式',
+        extraKeys: '额外按键'
+      },
+      help: {
+        insertParagraph: '插入段落',
+        undo: '撤销',
+        redo: '重做',
+        tab: '增加缩进',
+        untab: '减少缩进',
+        bold: '粗体',
+        italic: '斜体',
+        underline: '下划线',
+        strikethrough: '删除线',
+        removeFormat: '清除格式',
+        justifyLeft: '左对齐',
+        justifyCenter: '居中对齐',
+        justifyRight: '右对齐',
+        justifyFull: '两端对齐',
+        insertUnorderedList: '无序列表',
+        insertOrderedList: '有序列表',
+        outdent: '减少缩进',
+        indent: '增加缩进',
+        formatPara: '设置选中内容样式为 普通',
+        formatH1: '设置选中内容样式为 标题1',
+        formatH2: '设置选中内容样式为 标题2',
+        formatH3: '设置选中内容样式为 标题3',
+        formatH4: '设置选中内容样式为 标题4',
+        formatH5: '设置选中内容样式为 标题5',
+        formatH6: '设置选中内容样式为 标题6',
+        insertHorizontalRule: '插入水平线',
+        'linkDialog.show': '显示链接对话框'
+      },
+      history: {
+        undo: '撤销',
+        redo: '重做'
+      },
+      specialChar: {
+        specialChar: '特殊字符',
+        select: '选取特殊字符'
+      }
+    }
+  });
+})(jQuery);
+/******/ 	return __webpack_exports__;
+/******/ })()
+;
+});
+//# sourceMappingURL=summernote-zh-CN.js.map

File diff suppressed because it is too large
+ 2 - 0
public/assets/addons/summernote/lang/summernote-zh-CN.min.js


+ 184 - 0
public/assets/addons/summernote/lang/summernote-zh-TW.js

@@ -0,0 +1,184 @@
+/*!
+ *
+ * Super simple WYSIWYG editor v0.8.20
+ * https://summernote.org
+ *
+ *
+ * Copyright 2013- Alan Hong and contributors
+ * Summernote may be freely distributed under the MIT license.
+ *
+ * Date: 2021-10-14T21:15Z
+ *
+ */
+(function webpackUniversalModuleDefinition(root, factory) {
+	if(typeof exports === 'object' && typeof module === 'object')
+		module.exports = factory();
+	else if(typeof define === 'function' && define.amd)
+		define([], factory);
+	else {
+		var a = factory();
+		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+	}
+})(self, function() {
+return /******/ (() => { // webpackBootstrap
+var __webpack_exports__ = {};
+(function ($) {
+  $.extend($.summernote.lang, {
+    'zh-TW': {
+      font: {
+        bold: '粗體',
+        italic: '斜體',
+        underline: '底線',
+        clear: '清除格式',
+        height: '行高',
+        name: '字體',
+        strikethrough: '刪除線',
+        subscript: '下標',
+        superscript: '上標',
+        size: '字號'
+      },
+      image: {
+        image: '圖片',
+        insert: '插入圖片',
+        resizeFull: '縮放至100%',
+        resizeHalf: '縮放至 50%',
+        resizeQuarter: '縮放至 25%',
+        floatLeft: '靠左浮動',
+        floatRight: '靠右浮動',
+        floatNone: '取消浮動',
+        shapeRounded: '形狀: 圓角',
+        shapeCircle: '形狀: 圓',
+        shapeThumbnail: '形狀: 縮略圖',
+        shapeNone: '形狀: 無',
+        dragImageHere: '將圖片拖曳至此處',
+        dropImage: 'Drop image or Text',
+        selectFromFiles: '從本機上傳',
+        maximumFileSize: '文件大小最大值',
+        maximumFileSizeError: '文件大小超出最大值。',
+        url: '圖片網址',
+        remove: '移除圖片',
+        original: 'Original'
+      },
+      video: {
+        video: '影片',
+        videoLink: '影片連結',
+        insert: '插入影片',
+        url: '影片網址',
+        providers: '(影片網址)'
+      },
+      link: {
+        link: '連結',
+        insert: '插入連結',
+        unlink: '取消連結',
+        edit: '編輯連結',
+        textToDisplay: '顯示文字',
+        url: '連結網址',
+        openInNewWindow: '在新視窗開啟'
+      },
+      table: {
+        table: '表格',
+        addRowAbove: '上方插入列',
+        addRowBelow: '下方插入列',
+        addColLeft: '左方插入欄',
+        addColRight: '右方插入欄',
+        delRow: '刪除列',
+        delCol: '刪除欄',
+        delTable: '刪除表格'
+      },
+      hr: {
+        insert: '水平線'
+      },
+      style: {
+        style: '樣式',
+        p: '一般',
+        blockquote: '引用區塊',
+        pre: '程式碼區塊',
+        h1: '標題 1',
+        h2: '標題 2',
+        h3: '標題 3',
+        h4: '標題 4',
+        h5: '標題 5',
+        h6: '標題 6'
+      },
+      lists: {
+        unordered: '項目清單',
+        ordered: '編號清單'
+      },
+      options: {
+        help: '幫助',
+        fullscreen: '全螢幕',
+        codeview: '原始碼'
+      },
+      paragraph: {
+        paragraph: '段落',
+        outdent: '取消縮排',
+        indent: '增加縮排',
+        left: '靠右對齊',
+        center: '靠中對齊',
+        right: '靠右對齊',
+        justify: '左右對齊'
+      },
+      color: {
+        recent: '字型顏色',
+        more: '更多',
+        background: '背景',
+        foreground: '字體',
+        transparent: '透明',
+        setTransparent: '透明',
+        reset: '重設',
+        resetToDefault: '預設'
+      },
+      shortcut: {
+        shortcuts: '快捷鍵',
+        close: '關閉',
+        textFormatting: '文字格式',
+        action: '動作',
+        paragraphFormatting: '段落格式',
+        documentStyle: '文件格式',
+        extraKeys: '額外按鍵'
+      },
+      help: {
+        'insertParagraph': 'Insert Paragraph',
+        'undo': 'Undoes the last command',
+        'redo': 'Redoes the last command',
+        'tab': 'Tab',
+        'untab': 'Untab',
+        'bold': 'Set a bold style',
+        'italic': 'Set a italic style',
+        'underline': 'Set a underline style',
+        'strikethrough': 'Set a strikethrough style',
+        'removeFormat': 'Clean a style',
+        'justifyLeft': 'Set left align',
+        'justifyCenter': 'Set center align',
+        'justifyRight': 'Set right align',
+        'justifyFull': 'Set full align',
+        'insertUnorderedList': 'Toggle unordered list',
+        'insertOrderedList': 'Toggle ordered list',
+        'outdent': 'Outdent on current paragraph',
+        'indent': 'Indent on current paragraph',
+        'formatPara': 'Change current block\'s format as a paragraph(P tag)',
+        'formatH1': 'Change current block\'s format as H1',
+        'formatH2': 'Change current block\'s format as H2',
+        'formatH3': 'Change current block\'s format as H3',
+        'formatH4': 'Change current block\'s format as H4',
+        'formatH5': 'Change current block\'s format as H5',
+        'formatH6': 'Change current block\'s format as H6',
+        'insertHorizontalRule': 'Insert horizontal rule',
+        'linkDialog.show': 'Show Link Dialog'
+      },
+      history: {
+        undo: '復原',
+        redo: '取消復原'
+      },
+      specialChar: {
+        specialChar: 'SPECIAL CHARACTERS',
+        select: 'Select Special characters'
+      }
+    }
+  });
+})(jQuery);
+/******/ 	return __webpack_exports__;
+/******/ })()
+;
+});
+//# sourceMappingURL=summernote-zh-TW.js.map

File diff suppressed because it is too large
+ 2 - 0
public/assets/addons/summernote/lang/summernote-zh-TW.min.js


BIN
public/assets/addons/ueditor/themes/ueditor-list/dash.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/dot.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-1.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-10.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-11.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-12.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-13.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-14.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-15.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-16.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-17.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-18.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-19.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-2.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-20.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-21.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-22.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-23.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-24.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-25.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-26.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-27.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-28.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-29.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-3.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-30.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-31.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-32.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-33.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-34.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-35.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-36.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-37.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-38.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-39.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-4.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-40.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-41.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-42.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-43.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-44.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-45.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-46.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-47.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-48.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-49.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-5.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-50.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-51.gif


BIN
public/assets/addons/ueditor/themes/ueditor-list/list-cn-1-52.gif


+ 96 - 47
public/assets/js/addons.js

@@ -45,24 +45,12 @@ define([], function () {
         });
     }
 }
-window.UEDITOR_HOME_URL = Config.__CDN__ + "/assets/addons/ueditor/";
 require.config({
     paths: {
-        'ueditor.config': '../addons/ueditor/ueditor.config',
-        'ueditor': '../addons/ueditor/ueditor.all.min',
-        'ueditor.zh': '../addons/ueditor/i18n/zh-cn/zh-cn',
-        'zeroclipboard': '../addons/ueditor/third-party/zeroclipboard/ZeroClipboard.min',
+        'summernote': '../addons/summernote/lang/summernote-zh-CN.min'
     },
     shim: {
-        'ueditor': {
-            deps: ['zeroclipboard', 'ueditor.config'],
-            exports: 'UE',
-            init: function (ZeroClipboard) {
-                //导出到全局变量,供ueditor使用
-                window.ZeroClipboard = ZeroClipboard;
-            },
-        },
-        'ueditor.zh': ['ueditor']
+        'summernote': ['../addons/summernote/js/summernote.min', 'css!../addons/summernote/css/summernote.min.css'],
     }
 });
 require(['form', 'upload'], function (Form, Upload) {
@@ -70,42 +58,103 @@ require(['form', 'upload'], function (Form, Upload) {
     Form.events.bindevent = function (form) {
         _bindevent.apply(this, [form]);
         try {
-            //绑定editor事件
-            require(['ueditor', 'ueditor.zh'], function (UE, undefined) {
-                UE.list = [];
-                window.UEDITOR_CONFIG['uploadService'] = function (context, editor) {
-                    return {
-                        Upload: () => { return Upload },
-                        Fast: () => { return Fast },
-                    }
-                };
-                $(Config.ueditor.classname || '.editor', form).each(function () {
-                    var id = $(this).attr("id");
-                    var name = $(this).attr("name");
-                    $(this).removeClass('form-control');
-                    UE.list[id] = UE.getEditor(id, {
-                        allowDivTransToP: false, //阻止div自动转p标签
-                        initialFrameWidth: '100%',
-                        initialFrameHeight: 320,
-                        autoFloatEnabled: false,
-                        baiduMapAk: Config.ueditor.baiduMapAk || '', //百度地图api密钥(ak)
-                        // autoHeightEnabled: true, //自动高度
-                        zIndex: 90,
-                        xssFilterRules: false,
-                        outputXssFilter: false,
-                        inputXssFilter: false,
-                        catchRemoteImageEnable: true,
-                        imageAllowFiles: '',//允许上传的图片格式,编辑器默认[".png", ".jpg", ".jpeg", ".gif", ".bmp"]
+            //绑定summernote事件
+            if ($(Config.summernote.classname || '.editor', form).length > 0) {
+                var selectUrl = typeof Config !== 'undefined' && Config.modulename === 'index' ? 'user/attachment' : 'general/attachment/select';
+                require(['summernote'], function () {
+                    var imageButton = function (context) {
+                        var ui = $.summernote.ui;
+                        var button = ui.button({
+                            contents: '<i class="fa fa-file-image-o"/>',
+                            tooltip: __('Choose'),
+                            click: function () {
+                                parent.Fast.api.open(selectUrl + "?element_id=&multiple=true&mimetype=image/", __('Choose'), {
+                                    callback: function (data) {
+                                        var urlArr = data.url.split(/\,/);
+                                        $.each(urlArr, function () {
+                                            var url = Fast.api.cdnurl(this, true);
+                                            context.invoke('editor.insertImage', url);
+                                        });
+                                    }
+                                });
+                                return false;
+                            }
+                        });
+                        return button.render();
+                    };
+                    var attachmentButton = function (context) {
+                        var ui = $.summernote.ui;
+                        var button = ui.button({
+                            contents: '<i class="fa fa-file"/>',
+                            tooltip: __('Choose'),
+                            click: function () {
+                                parent.Fast.api.open(selectUrl + "?element_id=&multiple=true&mimetype=*", __('Choose'), {
+                                    callback: function (data) {
+                                        var urlArr = data.url.split(/\,/);
+                                        $.each(urlArr, function () {
+                                            var url = Fast.api.cdnurl(this, true);
+                                            var node = $("<a href='" + url + "'>" + url + "</a>");
+                                            context.invoke('insertNode', node[0]);
+                                        });
+                                    }
+                                });
+                                return false;
+                            }
+                        });
+                        return button.render();
+                    };
+
+                    $(Config.summernote.classname || '.editor', form).each(function () {
+                        $(this).summernote($.extend(true, {}, {
+                            height: isNaN(Config.summernote.height) ? null : parseInt(Config.summernote.height),
+                            minHeight: parseInt(Config.summernote.minHeight || 250),
+                            toolbar: Config.summernote.toolbar,
+                            followingToolbar: parseInt(Config.summernote.followingToolbar),
+                            placeholder: Config.summernote.placeholder || '',
+                            airMode: parseInt(Config.summernote.airMode) || false,
+                            lang: 'zh-CN',
+                            fontNames: [
+                                'Arial', 'Arial Black', 'Serif', 'Sans', 'Courier',
+                                'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande',
+                                "Open Sans", "Hiragino Sans GB", "Microsoft YaHei",
+                                '微软雅黑', '宋体', '黑体', '仿宋', '楷体', '幼圆',
+                            ],
+                            fontNamesIgnoreCheck: [
+                                "Open Sans", "Microsoft YaHei",
+                                '微软雅黑', '宋体', '黑体', '仿宋', '楷体', '幼圆'
+                            ],
+                            buttons: {
+                                image: imageButton,
+                                attachment: attachmentButton,
+                            },
+                            dialogsInBody: true,
+                            callbacks: {
+                                onChange: function (contents) {
+                                    $(this).val(contents);
+                                    $(this).trigger('change');
+                                },
+                                onInit: function () {
+                                },
+                                onImageUpload: function (files) {
+                                    var that = this;
+                                    //依次上传图片
+                                    for (var i = 0; i < files.length; i++) {
+                                        Upload.api.send(files[i], function (data) {
+                                            var url = Fast.api.cdnurl(data.url, true);
+                                            $(that).summernote("insertImage", url, 'filename');
+                                        });
+                                    }
+                                }
+                            }
+                        }, $(this).data("summernote-options") || {}));
                     });
-                    UE.list[id].addListener("contentChange", function () {
-                        $('#' + id).val(this.getContent());
-                        $('textarea[name="' + name + '"]').val(this.getContent());
-                    })
                 });
-            })
+            }
         } catch (e) {
-            console.log('绑定editor事件', e)
+
         }
-    }
+
+    };
 });
+
 });