123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- diff --git a/node_modules/tinymce/plugins/ax_wordlimit/index.js b/node_modules/tinymce/plugins/ax_wordlimit/index.js
- new file mode 100644
- index 0000000..02edc4d
- --- /dev/null
- +++ b/node_modules/tinymce/plugins/ax_wordlimit/index.js
- @@ -0,0 +1,7 @@
- +// Exports the "ax_wordlimit" plugin for usage with module loaders
- +// Usage:
- +// CommonJS:
- +// require('tinymce/plugins/ax_wordlimit')
- +// ES2015:
- +// import 'tinymce/plugins/ax_wordlimit'
- +require('./plugin.js');
- diff --git a/node_modules/tinymce/plugins/ax_wordlimit/plugin.js b/node_modules/tinymce/plugins/ax_wordlimit/plugin.js
- new file mode 100644
- index 0000000..bd4704d
- --- /dev/null
- +++ b/node_modules/tinymce/plugins/ax_wordlimit/plugin.js
- @@ -0,0 +1,55 @@
- +tinymce.PluginManager.add('ax_wordlimit', function(editor) {
- + var pluginName='字数限制';
- + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
- + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
- + var ax_wordlimit_type = editor.getParam('ax_wordlimit_type', 'letter' );
- + var ax_wordlimit_num = editor.getParam('ax_wordlimit_num', false );
- + var ax_wordlimit_delay = editor.getParam('ax_wordlimit_delay', 500 );
- + var ax_wordlimit_callback = editor.getParam('ax_wordlimit_callback', function(){} );
- + var ax_wordlimit_event = editor.getParam('ax_wordlimit_event', 'SetContent Undo Redo Keyup' );
- + var onsign=1;
- + //统计方法1:计算总字符数
- + var sumLetter = function(){
- + var html = editor.getContent();
- + var re1 = new RegExp("<.+?>","g");
- + var txt = html.replace(re1,'');
- + txt = txt.replace(/\n/g,'');
- + txt = txt.replace(/ /g,' ');
- + var num=txt.length;
- + return {txt:txt,num:num}
- + }
- + var onAct = function(){
- + if(onsign){
- + onsign=0;
- + //此处预留更多统计方法
- + switch(ax_wordlimit_type){
- + case 'letter':
- + default:
- + var res = sumLetter();
- + }
- + if( res.num > ax_wordlimit_num ){
- + ax_wordlimit_callback(editor, res.txt, ax_wordlimit_num);
- + }
- + setTimeout(function(){onsign=1}, ax_wordlimit_delay);
- + }
- +
- + }
- + var setup = function(){
- + if( ax_wordlimit_num>0 ){
- + global$2.setEditorTimeout(editor, function(){
- + var doth = editor.on(ax_wordlimit_event, onAct);
- + }, 300);
- + }
- + };
- +
- + setup();
- +
- + return {
- + getMetadata: function () {
- + return {
- + name: pluginName,
- + url: "http://tinymce.ax-z.cn/more-plugins/ax_wordlimit.php",
- + };
- + }
- + };
- +});
- diff --git a/node_modules/tinymce/plugins/ax_wordlimit/plugin.min.js b/node_modules/tinymce/plugins/ax_wordlimit/plugin.min.js
- new file mode 100644
- index 0000000..143777e
- --- /dev/null
- +++ b/node_modules/tinymce/plugins/ax_wordlimit/plugin.min.js
- @@ -0,0 +1,55 @@
- +tinymce.PluginManager.add('ax_wordlimit', function(editor) {
- + var pluginName='字数限制';
- + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
- + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
- + var ax_wordlimit_type = editor.getParam('ax_wordlimit_type', 'letter' );
- + var ax_wordlimit_num = editor.getParam('ax_wordlimit_num', false );
- + var ax_wordlimit_delay = editor.getParam('ax_wordlimit_delay', 500 );
- + var ax_wordlimit_callback = editor.getParam('ax_wordlimit_callback', function(){} );
- + var ax_wordlimit_event = editor.getParam('ax_wordlimit_event', 'SetContent Undo Redo Keyup' );
- + var onsign=1;
- + //统计方法1:计算总字符数
- + var sumLetter = function(){
- + var html = editor.getContent();
- + var re1 = new RegExp("<.+?>","g");
- + var txt = html.replace(re1,'');
- + txt = txt.replace(/\n/g,'');
- + txt = txt.replace(/ /g,' ');
- + var num=txt.length;
- + return {txt:txt,num:num}
- + }
- + var onAct = function(){
- + if(onsign){
- + onsign=0;
- + //此处预留更多统计方法
- + switch(ax_wordlimit_type){
- + case 'letter':
- + default:
- + var res = sumLetter();
- + }
- + if( res.num > ax_wordlimit_num ){
- + ax_wordlimit_callback(editor, res.txt, ax_wordlimit_num);
- + }
- + setTimeout(function(){onsign=1}, ax_wordlimit_delay);
- + }
- +
- + }
- + var setup = function(){
- + if( ax_wordlimit_num>0 ){
- + global$2.setEditorTimeout(editor, function(){
- + var doth = editor.on(ax_wordlimit_event, onAct);
- + }, 300);
- + }
- + };
- +
- + setup();
- +
- + return {
- + getMetadata: function () {
- + return {
- + name: pluginName,
- + url: "http://tinymce.ax-z.cn/more-plugins/ax_wordlimit.php",
- + };
- + }
- + };
- +});
- diff --git a/node_modules/tinymce/plugins/image/plugin.js b/node_modules/tinymce/plugins/image/plugin.js
- index 1691b27..5255b8c 100644
- --- a/node_modules/tinymce/plugins/image/plugin.js
- +++ b/node_modules/tinymce/plugins/image/plugin.js
- @@ -8,7 +8,6 @@
- */
- (function () {
- 'use strict';
- -
- var global$6 = tinymce.util.Tools.resolve('tinymce.PluginManager');
-
- var __assign = function () {
- @@ -1407,7 +1406,7 @@
- meta: {}
- }
- });
- - api.showTab('general');
- + // api.showTab('general'); 切换 tab 为普通
- changeSrc(helpers, info, state, api);
- };
- blobToDataUri(file).then(function (dataUrl) {
- @@ -1416,6 +1415,8 @@
- helpers.uploadImage(blobInfo).then(function (result) {
- updateSrcAndSwitchTab(result.url);
- finalize();
- + helpers.onSubmit(info)(api); // 上传成功后,触发保存事件
- + updateSrcAndSwitchTab(""); // 保存事件成功后,清空 src
- }).catch(function (err) {
- finalize();
- helpers.alertErr(err);
- diff --git a/node_modules/tinymce/tinymce.js b/node_modules/tinymce/tinymce.js
- index 3955a24..2988ecd 100644
- --- a/node_modules/tinymce/tinymce.js
- +++ b/node_modules/tinymce/tinymce.js
- @@ -810,7 +810,7 @@
- var lTrim = blank(/^\s+/g);
- var rTrim = blank(/\s+$/g);
- var isNotEmpty = function (s) {
- - return s.length > 0;
- + return s?.length > 0;
- };
- var isEmpty$3 = function (s) {
- return !isNotEmpty(s);
|