This commit is contained in:
kuaifan 2021-12-22 18:32:44 +08:00
parent fe44c35406
commit d16b846d4e
296 changed files with 101302 additions and 70208 deletions

View File

@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.4.2",
"version": "0.4.11",
"description": "DooTask is task management system.",
"main": "main.js",
"license": "MIT",

View File

@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.4.2",
"version": "0.4.11",
"description": "DooTask is task management system.",
"scripts": {
"start": "./cmd dev",
@ -32,45 +32,45 @@
"url": "git+https://github.com/kuaifan/dootask.git"
},
"devDependencies": {
"axios": "^0.21",
"cross-env": "^7.0.2",
"css-loader": "^5.2.6",
"echarts": "^5.1.1",
"element-ui": "^2.15.2",
"axios": "^0.24.0",
"cross-env": "^7.0.3",
"css-loader": "^6.5.1",
"echarts": "^5.2.2",
"element-ui": "^2.15.6",
"file-loader": "^6.2.0",
"inquirer": "^8.1.1",
"inquirer": "^8.2.0",
"internal-ip": "^6.2.0",
"jquery": "^3.5.1",
"jspdf": "^2.3.1",
"laravel-mix": "^6.0.6",
"jquery": "^3.6.0",
"jspdf": "^2.5.0",
"laravel-mix": "^6.0.39",
"le5le-store": "^1.0.7",
"less-loader": "^10.0.0",
"lodash": "^4.17.19",
"less": "^4.1.2",
"less-loader": "^10.2.0",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"nativefier": "^44.0.4",
"node-sass": "^4.11.0",
"notification-koro1": "^1.1.1",
"postcss": "^8.1.14",
"postcss": "^8.4.5",
"resolve-url-loader": "^4.0.0",
"sass": "^1.34.1",
"sass-loader": "^8.0.2",
"stylus": "^0.54.8",
"stylus-loader": "^3.0.2",
"tinymce": "^5.8.1",
"tui-calendar-hi": "^1.13.0-5",
"view-design-hi": "^4.6.1-11",
"vue": "^2.6.12",
"vue-clipboard2": "^0.3.1",
"vue-emoji-picker": "^1.0.1",
"sass": "^1.45.1",
"sass-loader": "^12.4.0",
"stylus": "^0.56.0",
"stylus-loader": "^6.2.0",
"tinymce": "^5.10.2",
"tui-calendar-hi": "^1.15.1-1",
"view-design-hi": "^4.7.0-1",
"vue": "^2.6.14",
"vue-clipboard2": "^0.3.3",
"vue-emoji-picker": "^1.0.3",
"vue-kityminder-gg": "^1.3.6",
"vue-loader": "^15.9.7",
"vue-resize-observer": "^1.0.37",
"vue-router": "^3.4.2",
"vue-template-compiler": "^2.6.11",
"vue-loader": "^15.9.8",
"vue-resize-observer": "^2.0.16",
"vue-router": "^3.5.3",
"vue-template-compiler": "^2.6.14",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
"webpack": "^5.38.1",
"webpack-cli": "^4.7.0",
"xlsx": "^0.17.0"
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1",
"xlsx": "^0.17.4"
}
}

2
public/css/app.css vendored

File diff suppressed because one or more lines are too long

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[1],{13618:(e,t,i)=>{i.d(t,{Z:()=>o});var n=i(23645),r=i.n(n)()((function(e){return e[1]}));r.push([e.id,".component-only-office[data-v-663611c5]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.component-only-office .placeholder[data-v-663611c5]{flex:1;height:100%;width:100%}",""]);const o=r},72001:(e,t,i)=>{i.r(t),i.d(t,{default:()=>f});var n=i(20629);function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const l={name:"OnlyOffice",props:{id:{type:String,default:function(){return"office_"+Math.round(1e4*Math.random())}},value:{type:[Object,Array],default:function(){return{}}}},data:function(){return{fileName:null,fileType:null,fileUrl:null,docEditor:null}},mounted:function(){},beforeDestroy:function(){null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null)},computed:function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},(0,n.rn)(["userToken","userInfo"])),watch:{value:{handler:function(e){this.fileUrl="http://nginx/api/file/content/?id="+e.id+"&token="+this.userToken,this.fileType=this.getType(e.type),this.fileName=e.name},immediate:!0,deep:!0},fileUrl:{handler:function(e){var t=this;e&&$A.loadScript(this.$store.state.method.apiUrl("../office/web-apps/apps/api/documents/api.js"),(function(){t.loadFile()}))},immediate:!0}},methods:{getType:function(e){switch(e){case"word":return"docx";case"excel":return"xlsx";case"ppt":return"pptx"}return""},loadFile:function(){var e=this;if(this.fileUrl){null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null);var t="zh";switch(this.getLanguage()){case"CN":case"TC":t="zh";break;default:t="en"}var i={document:{fileType:this.fileType,key:this.fileType+"-"+this.value.id,title:this.fileName+"."+this.fileType,url:this.fileUrl},editorConfig:{mode:"edit",lang:t,user:{id:this.userInfo.userid,name:this.userInfo.nickname},customization:{uiTheme:"theme-classic-light"},callbackUrl:"http://nginx/api/file/content/office?id="+this.value.id+"&token="+this.userToken}};this.$nextTick((function(){e.docEditor=new DocsAPI.DocEditor(e.id,i)}))}}}};var c=i(93379),s=i.n(c),a=i(13618),u={insert:"head",singleton:!1};s()(a.Z,u);a.Z.locals;const f=(0,i(51900).Z)(l,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"component-only-office"},[t("div",{staticClass:"placeholder",attrs:{id:this.id}})])}),[],!1,null,"663611c5",null).exports}}]);

File diff suppressed because one or more lines are too long

1
public/js/build/207.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[207],{10915:(e,t,i)=>{i.d(t,{Z:()=>o});var n=i(1519),r=i.n(n)()((function(e){return e[1]}));r.push([e.id,".component-only-office[data-v-663611c5]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.component-only-office .placeholder[data-v-663611c5]{flex:1;height:100%;width:100%}",""]);const o=r},46207:(e,t,i)=>{i.r(t),i.d(t,{default:()=>f});var n=i(20629);function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const l={name:"OnlyOffice",props:{id:{type:String,default:function(){return"office_"+Math.round(1e4*Math.random())}},value:{type:[Object,Array],default:function(){return{}}}},data:function(){return{fileName:null,fileType:null,fileUrl:null,docEditor:null}},mounted:function(){},beforeDestroy:function(){null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null)},computed:function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},(0,n.rn)(["userToken","userInfo"])),watch:{value:{handler:function(e){this.fileUrl="http://nginx/api/file/content/?id="+e.id+"&token="+this.userToken,this.fileType=this.getType(e.type),this.fileName=e.name},immediate:!0,deep:!0},fileUrl:{handler:function(e){var t=this;e&&$A.loadScript(this.$store.state.method.apiUrl("../office/web-apps/apps/api/documents/api.js"),(function(){t.loadFile()}))},immediate:!0}},methods:{getType:function(e){switch(e){case"word":return"docx";case"excel":return"xlsx";case"ppt":return"pptx"}return""},loadFile:function(){var e=this;if(this.fileUrl){null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null);var t="zh";switch(this.getLanguage()){case"CN":case"TC":t="zh";break;default:t="en"}var i={document:{fileType:this.fileType,key:this.fileType+"-"+this.value.id,title:this.fileName+"."+this.fileType,url:this.fileUrl},editorConfig:{mode:"edit",lang:t,user:{id:this.userInfo.userid,name:this.userInfo.nickname},customization:{uiTheme:"theme-classic-light"},callbackUrl:"http://nginx/api/file/content/office?id="+this.value.id+"&token="+this.userToken}};this.$nextTick((function(){e.docEditor=new DocsAPI.DocEditor(e.id,i)}))}}}};var c=i(93379),s=i.n(c),a=i(10915),u={insert:"head",singleton:!1};s()(a.Z,u);a.Z.locals;const f=(0,i(51900).Z)(l,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"component-only-office"},[t("div",{staticClass:"placeholder",attrs:{id:this.id}})])}),[],!1,null,"663611c5",null).exports}}]);

File diff suppressed because one or more lines are too long

2
public/js/build/388.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/build/418.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[418],{35270:(e,t,a)=>{a.d(t,{Z:()=>i});var n=a(1519),s=a.n(n)()((function(e){return e[1]}));s.push([e.id,".page-404[data-v-1f590918]{background-color:#fff;color:#636b6f;font-weight:400;margin:0}.page-404[data-v-1f590918],.page-404 .full-height[data-v-1f590918]{height:100vh}.page-404 .flex-center[data-v-1f590918]{align-items:center;display:flex;justify-content:center}.page-404 .position-ref[data-v-1f590918]{position:relative}.page-404 .code[data-v-1f590918]{border-right:2px solid;font-size:26px;padding:0 15px;text-align:center}.page-404 .message[data-v-1f590918]{font-size:18px;padding:10px;text-align:center}",""]);const i=s},54418:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(93379),s=a.n(n),i=a(35270),l={insert:"head",singleton:!1};s()(i.Z,l);i.Z.locals;const o=(0,a(51900).Z)({},(function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)}),[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"page-404"},[a("div",{staticClass:"flex-center position-ref full-height"},[a("div",{staticClass:"code"},[e._v("404")]),e._v(" "),a("div",{staticClass:"message"},[e._v("Not Found")])])])}],!1,null,"1f590918",null).exports}}]);

1
public/js/build/428.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
public/js/build/461.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -257,7 +257,7 @@
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 2.4.0 Built on 2021-09-14T10:30:30.230Z
* Version 2.5.0 Built on 2021-12-21T09:44:51.866Z
* CommitID 00000000
*
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF

1
public/js/build/483.js vendored Normal file

File diff suppressed because one or more lines are too long

2
public/js/build/53.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
/*!
* TOAST UI Calendar
* @version 1.13.0-1 | Wed Jun 16 2021
* @version 1.15.1 | Wed Dec 22 2021
* @author NHN FE Development Lab <dl_javascript@nhn.com>
* @license MIT
*/
@ -84,6 +84,8 @@
/*! ../common/reqAnimFrame */
/*! ../common/sanitizer */
/*! ../common/timezone */
/*! ../common/vlayout */
@ -302,6 +304,10 @@
/*! ./weekdayInMonth */
/*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */
/*! dompurify */
/*! handlebars-template-loader/runtime */
/*! handlebars/runtime */
@ -424,6 +430,10 @@
!*** ./src/js/view/month/more.js ***!
\***********************************/
/*!************************************!*\
!*** ./src/js/common/sanitizer.js ***!
\************************************/
/*!************************************!*\
!*** ./src/js/factory/calendar.js ***!
\************************************/
@ -616,6 +626,10 @@
!*** ./src/js/view/template/month/month.hbs ***!
\**********************************************/
/*!***********************************************!*\
!*** ./node_modules/dompurify/dist/purify.js ***!
\***********************************************/
/*!***********************************************!*\
!*** ./src/js/handler/daygrid/resizeGuide.js ***!
\***********************************************/

1
public/js/build/545.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
public/js/build/751.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[844],{88064:(e,t,a)=>{a.d(t,{Z:()=>i});var n=a(23645),s=a.n(n)()((function(e){return e[1]}));s.push([e.id,".page-404[data-v-1f590918]{background-color:#fff;color:#636b6f;font-weight:400;margin:0}.page-404[data-v-1f590918],.page-404 .full-height[data-v-1f590918]{height:100vh}.page-404 .flex-center[data-v-1f590918]{align-items:center;display:flex;justify-content:center}.page-404 .position-ref[data-v-1f590918]{position:relative}.page-404 .code[data-v-1f590918]{border-right:2px solid;font-size:26px;padding:0 15px;text-align:center}.page-404 .message[data-v-1f590918]{font-size:18px;padding:10px;text-align:center}",""]);const i=s},53844:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(93379),s=a.n(n),i=a(88064),l={insert:"head",singleton:!1};s()(i.Z,l);i.Z.locals;const o=(0,a(51900).Z)({},(function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)}),[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"page-404"},[a("div",{staticClass:"flex-center position-ref full-height"},[a("div",{staticClass:"code"},[e._v("404")]),e._v(" "),a("div",{staticClass:"message"},[e._v("Not Found")])])])}],!1,null,"1f590918",null).exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[955],{39955:(a,s,t)=>{t.r(s),t.d(s,{default:()=>i});const n={data:function(){return{loadIng:0,name:"Loading",version:"",list:[]}},mounted:function(){this.getAppInfo()},methods:{getAppInfo:function(){var a=this;this.loadIng++,this.$store.dispatch("call",{url:"system/get/appinfo"}).then((function(s){var t=s.data;a.loadIng--,a.name=t.name,a.version=t.version,a.list=t.list})).catch((function(s){var t=s.msg;a.loadIng--,$A.modalError(t)}))}}};const i=(0,t(51900).Z)(n,(function(){var a=this,s=a.$createElement,t=a._self._c||s;return t("div",{staticClass:"page-download"},[t("PageTitle",{attrs:{title:a.$L("下载")}}),a._v(" "),a.loadIng>0?t("div",{staticClass:"download-load"},[t("Loading")],1):a._e(),a._v(" "),t("div",{staticClass:"download-body"},[t("canvas",{staticClass:"orb-canvas-1"}),a._v(" "),t("canvas",{staticClass:"orb-canvas-2"}),a._v(" "),a.name?t("div",{staticClass:"download-name"},[a._v(a._s(a.name))]):a._e(),a._v(" "),a.version?t("div",{staticClass:"download-version"},[a._v("v"+a._s(a.version))]):a._e(),a._v(" "),a.list.length>0?t("ul",{staticClass:"download-list"},a._l(a.list,(function(s,n){return t("li",{key:n},[t("div",{staticClass:"app-icon"},[t("Icon",{attrs:{type:s.icon}})],1),a._v(" "),t("div",{staticClass:"app-name"},[a._v(a._s(s.name))]),a._v(" "),t("div",{staticClass:"app-size"},[a._v(a._s(a.$A.bytesToSize(s.size)))]),a._v(" "),t("div",{staticClass:"app-button"},[t("a",{attrs:{href:s.url,target:"_blank"}},[a._v(a._s(a.$L("立即下载")))])])])})),0):a._e()])],1)}),[],!1,null,null,null).exports}}]);

View File

@ -12,10 +12,13 @@ tinymce.IconManager.add('default', {
'arrow-right': '<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 1.8z" fill-rule="evenodd"/></svg>',
'bold': '<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 01-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" fill-rule="evenodd"/></svg>',
'bookmark': '<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 00-1 1z" fill-rule="nonzero"/></svg>',
'border-width': '<svg width="24" height="24"><path d="M5 14.8h14a1 1 0 010 2H5a1 1 0 010-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 110-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 01-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-2c0-.6.4-1 1-1z" fill-rule="evenodd"/></svg>',
'border-style': '<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',
'border-width': '<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',
'brightness': '<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" fill-rule="evenodd"/></svg>',
'browse': '<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',
'cancel': '<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" fill-rule="nonzero"/></svg>',
'cell-background-color': '<svg width="24" height="24"><path d="M15.7 2l1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 01-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2zM18 12l-4.5-4L9 12h9zM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16z"/></svg>',
'cell-border-color': '<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 01-2-2v-5h2zm8-7V4h6a2 2 0 012 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1l.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="M13 11l-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="M18.4 8l1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 01-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8zm1.6 7l-3-3-3 3h6z"/></g></svg>',
'change-case': '<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 01-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',
'character-count': '<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" fill-rule="evenodd"/></svg>',
'checklist-rtl': '<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',
@ -36,15 +39,20 @@ tinymce.IconManager.add('default', {
'contrast': '<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',
'copy': '<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" fill-rule="nonzero"/></svg>',
'crop': '<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 01-1-1v-2H7V9H5a1 1 0 110-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" fill-rule="evenodd"/></svg>',
'cut-column': '<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 017 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7zm12.3 5h-3v10h3v-10zM8 13.8h-.3l-.4.2a2.8 2.8 0 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.5-.2H8zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zM7 5.8h-.4a1 1 0 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.7 6l-.4-.1H7z"/></svg>',
'cut-row': '<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3h-.3zM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zm8.5-7.1h-11v2h11v-2z"/></svg>',
'cut': '<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.8.5l.4.1h.7l.5-.2z" fill-rule="evenodd"/></svg>',
'document-properties': '<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',
'drag': '<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',
'duplicate-column': '<svg width="24" height="24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',
'duplicate-row': '<svg width="24" height="24"><path d="M22 11v7H6v-7h16zm-2 2H8v3h12v-3zm-1-6v2H4v5H2V7h17z"/></svg>',
'duplicate': '<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',
'edit-block': '<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5zm-2-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5z"/></svg>',
'edit-image': '<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" fill-rule="nonzero"/></svg>',
'embed-page': '<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0119 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-5 4h2.2z" fill-rule="nonzero"/></svg>',
'embed': '<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.8-.4z" fill-rule="nonzero"/></svg>',
'emoji': '<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',
'export': '<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3z"/><path d="M16.4 9.2a1 1 0 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',
'fill': '<svg width="24" height="26"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-2c0-1.3-2-3.5-2-3.5z" fill-rule="nonzero"/></svg>',
'flip-horizontally': '<svg width="24" height="24"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',
'flip-vertically': '<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',
@ -65,6 +73,8 @@ tinymce.IconManager.add('default', {
'insert-time': '<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',
'invert': '<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 5.4c.6 1.2 1 2.4 1 3.6z" fill-rule="evenodd"/></svg>',
'italic': '<svg width="24" height="24"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" fill-rule="evenodd"/></svg>',
'language': '<svg width="24" height="24"><path d="M12 3a9 9 0 110 18 9 9 0 010-18zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 003.2-2.1l-.2-.2a6 6 0 00-1-.6zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 01-2-2.8zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 01-.3-2zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1zm3-1.4l-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 00-1.3-3.5zm-9 0l2 .2V5.5a9 9 0 00-2 2.2zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 00-2-2.3zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 011.9-2.5zm4.4 0l.1.1a10 10 0 011.8 2.4l1.1-.7a7.5 7.5 0 00-3-1.8z"/></svg>',
'line-height': '<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',
'line': '<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" fill-rule="evenodd"/></svg>',
'link': '<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2z" fill-rule="nonzero"/></svg>',
'list-bull-circle': '<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',
@ -95,6 +105,10 @@ tinymce.IconManager.add('default', {
'outdent': '<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"/></svg>',
'page-break': '<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',
'paragraph': '<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',
'paste-column-after': '<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',
'paste-column-before': '<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',
'paste-row-after': '<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',
'paste-row-before': '<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',
'paste-text': '<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" fill-rule="nonzero"/></svg>',
'paste': '<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" fill-rule="nonzero"/></svg>',
'permanent-pen': '<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',
@ -119,16 +133,17 @@ tinymce.IconManager.add('default', {
'selected': '<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-1 0l-7.4 7.3z"/></svg>',
'settings': '<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V8H5a1 1 0 110-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V13H5a1 1 0 010-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V18H5a1 1 0 010-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" fill-rule="evenodd"/></svg>',
'sharpen': '<svg width="24" height="24"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" fill-rule="evenodd"/></svg>',
'sort-asc': '<svg width="24" height="24"><g fill-rule="evenodd"><path d="M4 8h5a1 1 0 110 2H4a1 1 0 110-2zm0 8h8a1 1 0 010 2H4a1 1 0 010-2zm0-4h7a1 1 0 010 2H4a1 1 0 010-2z"/><path fill-rule="nonzero" d="M16 8.4l-2.3 2.3a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L18 8.4V18a1 1 0 01-2 0V8.4z"/></g></svg>',
'sort-dsc': '<svg width="24" height="24"><g fill-rule="evenodd"><path d="M4 16h5a1 1 0 000-2H4a1 1 0 000 2zm0-8h8a1 1 0 000-2H4a1 1 0 100 2zm0 4h7a1 1 0 000-2H4a1 1 0 000 2z"/><path fill-rule="nonzero" d="M16 15.6l-2.3-2.3a1 1 0 00-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 00-1.4-1.4L18 15.6V6a1 1 0 00-2 0v9.6z"/></g></svg>',
'sourcecode': '<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 010-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 00-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',
'spell-check': '<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" fill-rule="evenodd"/></svg>',
'strike-through': '<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 017 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z"/><path d="M5 11h14a1 1 0 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',
'subscript': '<svg width="24" height="24"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 00-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',
'superscript': '<svg width="24" height="24"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" fill-rule="nonzero"/></svg>',
'table-caption': '<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2v-8c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></g></svg>',
'table-cell-classes': '<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8zm-2 2H5v5h6V6z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 012 2v7h-8v-2h6V6h-6V4z" opacity=".2"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3z" opacity=".2"/></g></svg>',
'table-cell-properties': '<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8 0h-6v5h6v-5zm-8-7H5v5h6V6z"/></svg>',
'table-cell-select-all': '<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z" opacity=".2"/></g></svg>',
'table-cell-select-inner': '<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',
'table-classes': '<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v7h-8v7H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8-7h-6v5h6V6zm-8 0H5v5h6V6z"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/></g></svg>',
'table-delete-column': '<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5z"/></svg>',
'table-delete-row': '<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3z"/></svg>',
'table-delete-table': '<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',
@ -138,6 +153,8 @@ tinymce.IconManager.add('default', {
'table-insert-row-after': '<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',
'table-left-header': '<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 9h-4v5h4v-5zm-6 0H9v5h4v-5zm0-7H9v5h4V6zm6 0h-4v5h4V6z"/></svg>',
'table-merge-cells': '<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15.5V18h3v-2.5H5zm14-5h-9V18h9v-7.5zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6zm-8 7.5h3v-3H5v3z"/></svg>',
'table-row-numbering-rtl': '<svg width="24" height="24"><path d="M6 4a2 2 0 00-2 2v13c0 1.1.9 2 2 2h12a2 2 0 002-2V6a2 2 0 00-2-2H6zm0 12h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 11h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 6h8v3H6V6zm11 0c.6 0 1 .4 1 1v1a1 1 0 11-2 0V7c0-.6.4-1 1-1z"/></svg>',
'table-row-numbering': '<svg width="24" height="24"><path d="M18 4a2 2 0 012 2v13a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2h12zm0 12h-8v3h8v-3zM7 16a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8v-3zM7 11a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8V6zM7 6a1 1 0 00-1 1v1a1 1 0 102 0V7c0-.6-.4-1-1-1z"/></svg>',
'table-row-properties': '<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-9h-6v3h6V6zM5 9h6V6H5v3z"/></svg>',
'table-split-cells': '<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2zm-8.5-1H5v3h3v-3zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6z"/></svg>',
'table-top-header': '<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 11H5v3h6v-3zm8 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></svg>',
@ -155,6 +172,7 @@ tinymce.IconManager.add('default', {
'unselected': '<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6z"/></svg>',
'upload': '<svg width="24" height="24"><path d="M18 19v-2a1 1 0 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',
'user': '<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" fill-rule="nonzero"/></svg>',
'vertical-align': '<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 011.2 1.5l-.1.1-4.1 3-4-3a1 1 0 011-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8l4 2.9a1 1 0 01-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 01-1-1v-4l-2 1.3a1 1 0 01-1.2-.1l-.1-.1a1 1 0 01.1-1.3l.1-.1 4.1-3z"/></g></svg>',
'visualblocks': '<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.2-5H15zM5 15v2H3v-2h2zm16 0v2h-2v-2h2zM5 11v2H3v-2h2zm16 0v2h-2v-2h2zM5 7v2H3V7h2zm16 0v2h-2V7h2zM5 3v2H3c0-1.1.9-2 2-2zm8 0v2h-2V3h2zm6 0a2 2 0 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',
'visualchars': '<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z" fill-rule="evenodd"/></svg>',
'warning': '<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',

File diff suppressed because one or more lines are too long

View File

@ -85,6 +85,7 @@ tinymce.addI18n('zh_CN',{
"B": "B",
"Left to right": "\u4ece\u5de6\u5230\u53f3",
"Right to left": "\u4ece\u53f3\u5230\u5de6",
"Emoticons": "\u8868\u60c5",
"Emoticons...": "\u8868\u60c5\u7b26\u53f7...",
"Metadata and Document Properties": "\u5143\u6570\u636e\u548c\u6587\u6863\u5c5e\u6027",
"Title": "\u6807\u9898",
@ -113,7 +114,9 @@ tinymce.addI18n('zh_CN',{
"Handy Shortcuts": "\u5feb\u6377\u952e",
"Horizontal line": "\u6c34\u5e73\u5206\u5272\u7ebf",
"Insert\/edit image": "\u63d2\u5165\/\u7f16\u8f91\u56fe\u7247",
"Image description": "\u56fe\u7247\u63cf\u8ff0",
"Alternative description": "\u66ff\u4ee3\u63cf\u8ff0",
"Accessibility": "\u8f85\u52a9\u529f\u80fd",
"Image is decorative": "\u56fe\u50cf\u662f\u88c5\u9970\u6027\u7684",
"Source": "\u5730\u5740",
"Dimensions": "\u5927\u5c0f",
"Constrain proportions": "\u4fdd\u6301\u7eb5\u6a2a\u6bd4",
@ -147,7 +150,6 @@ tinymce.addI18n('zh_CN',{
"Back": "\u540e\u9000",
"Insert date\/time": "\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4",
"Date\/time": "\u65e5\u671f\/\u65f6\u95f4",
"Insert\/Edit Link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5",
"Insert\/edit link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5",
"Text to display": "\u663e\u793a\u6587\u5b57",
"Url": "\u5730\u5740",
@ -155,12 +157,14 @@ tinymce.addI18n('zh_CN',{
"Current window": "\u5f53\u524d\u7a97\u53e3",
"None": "\u65e0",
"New window": "\u5728\u65b0\u7a97\u53e3\u6253\u5f00",
"Open link": "\u6253\u5f00\u94fe\u63a5",
"Remove link": "\u5220\u9664\u94fe\u63a5",
"Anchors": "\u951a\u70b9",
"Link...": "\u94fe\u63a5...",
"Paste or type a link": "\u7c98\u8d34\u6216\u8f93\u5165\u94fe\u63a5",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u4e3a\u90ae\u4ef6\u5730\u5740\uff0c\u9700\u8981\u52a0\u4e0amailto:\u524d\u7f00\u5417\uff1f",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u5c5e\u4e8e\u5916\u90e8\u94fe\u63a5\uff0c\u9700\u8981\u52a0\u4e0ahttp:\/\/:\u524d\u7f00\u5417\uff1f",
"The URL you entered seems to be an external link. Do you want to add the required https:\/\/ prefix?": "\u60a8\u8f93\u5165\u7684 URL \u4f3c\u4e4e\u662f\u4e00\u4e2a\u5916\u90e8\u94fe\u63a5\u3002\u60a8\u60f3\u6dfb\u52a0\u6240\u9700\u7684 https:\/\/ \u524d\u7f00\u5417\uff1f",
"Link list": "\u94fe\u63a5\u5217\u8868",
"Insert video": "\u63d2\u5165\u89c6\u9891",
"Insert\/edit video": "\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891",
@ -183,11 +187,15 @@ tinymce.addI18n('zh_CN',{
"Replace all": "\u5168\u90e8\u66ff\u6362",
"Previous": "\u4e0a\u4e00\u4e2a",
"Next": "\u4e0b\u4e00\u4e2a",
"Find and Replace": "\u67e5\u627e\u548c\u66ff\u6362",
"Find and replace...": "\u67e5\u627e\u5e76\u66ff\u6362...",
"Could not find the specified string.": "\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.",
"Match case": "\u533a\u5206\u5927\u5c0f\u5199",
"Find whole words only": "\u5168\u5b57\u5339\u914d",
"Spell check": "\u62fc\u5199\u68c0\u67e5",
"Find in selection": "\u5728\u9009\u533a\u4e2d\u67e5\u627e",
"Spellcheck": "\u62fc\u5199\u68c0\u67e5",
"Spellcheck Language": "\u62fc\u5199\u68c0\u67e5\u8bed\u8a00",
"No misspellings found.": "\u6ca1\u6709\u53d1\u73b0\u62fc\u5199\u9519\u8bef",
"Ignore": "\u5ffd\u7565",
"Ignore all": "\u5168\u90e8\u5ffd\u7565",
"Finish": "\u5b8c\u6210",
@ -218,6 +226,7 @@ tinymce.addI18n('zh_CN',{
"Height": "\u9ad8",
"Cell spacing": "\u5355\u5143\u683c\u5916\u95f4\u8ddd",
"Cell padding": "\u5355\u5143\u683c\u5185\u8fb9\u8ddd",
"Caption": "\u6807\u9898",
"Show caption": "\u663e\u793a\u6807\u9898",
"Left": "\u5de6\u5bf9\u9f50",
"Center": "\u5c45\u4e2d",
@ -377,7 +386,21 @@ tinymce.addI18n('zh_CN',{
"formatting": "\u683c\u5f0f\u5316",
"alignment": "\u5bf9\u9f50",
"indentation": "\u7f29\u8fdb",
"permanent pen": "\u8bb0\u53f7\u7b14",
"Font": "\u5b57\u4f53",
"Size": "\u5b57\u53f7",
"More...": "\u66f4\u591a...",
"Select...": "\u9009\u62e9...",
"Preferences": "\u9996\u9009\u9879",
"Yes": "\u662f",
"No": "\u5426",
"Keyboard Navigation": "\u952e\u76d8\u6307\u5f15",
"Version": "\u7248\u672c",
"Code view": "\u4ee3\u7801\u89c6\u56fe",
"Open popup menu for split buttons": "\u6253\u5f00\u5f39\u51fa\u5f0f\u83dc\u5355\uff0c\u7528\u4e8e\u62c6\u5206\u6309\u94ae",
"List Properties": "\u5217\u8868\u5c5e\u6027",
"List properties...": "\u6807\u9898\u5b57\u4f53\u5c5e\u6027",
"Start list at number": "\u4ee5\u6570\u5b57\u5f00\u59cb\u5217\u8868",
"Line height": "\u884c\u9ad8",
"comments": "\u5907\u6ce8",
"Format Painter": "\u683c\u5f0f\u5237",
"Insert\/edit iframe": "\u63d2\u5165\/\u7f16\u8f91\u6846\u67b6",
@ -385,24 +408,46 @@ tinymce.addI18n('zh_CN',{
"lowercase": "\u5c0f\u5199",
"UPPERCASE": "\u5927\u5199",
"Title Case": "\u9996\u5b57\u6bcd\u5927\u5199",
"permanent pen": "\u8bb0\u53f7\u7b14",
"Permanent Pen Properties": "\u6c38\u4e45\u7b14\u5c5e\u6027",
"Permanent pen properties...": "\u6c38\u4e45\u7b14\u5c5e\u6027...",
"Font": "\u5b57\u4f53",
"Size": "\u5b57\u53f7",
"More...": "\u66f4\u591a...",
"Spellcheck Language": "\u62fc\u5199\u68c0\u67e5\u8bed\u8a00",
"Select...": "\u9009\u62e9...",
"Preferences": "\u9996\u9009\u9879",
"Yes": "\u662f",
"No": "\u5426",
"Keyboard Navigation": "\u952e\u76d8\u6307\u5f15",
"Version": "\u7248\u672c",
"case change": "\u6848\u4f8b\u66f4\u6539",
"page embed": "\u9875\u9762\u5d4c\u5165",
"Advanced sort...": "\u9ad8\u7ea7\u6392\u5e8f...",
"Advanced Sort": "\u9ad8\u7ea7\u6392\u5e8f",
"Sort table by column ascending": "\u6309\u5217\u5347\u5e8f\u8868",
"Sort table by column descending": "\u6309\u5217\u964d\u5e8f\u8868",
"Sort": "\u6392\u5e8f",
"Order": "\u6392\u5e8f",
"Sort by": "\u6392\u5e8f\u65b9\u5f0f",
"Ascending": "\u5347\u5e8f",
"Descending": "\u964d\u5e8f",
"Column {0}": "\u5217{0}",
"Row {0}": "\u884c{0}",
"Spellcheck...": "\u62fc\u5199\u68c0\u67e5...",
"Misspelled word": "\u62fc\u5199\u9519\u8bef\u7684\u5355\u8bcd",
"Suggestions": "\u5efa\u8bae",
"Change": "\u66f4\u6539",
"Finding word suggestions": "\u67e5\u627e\u5355\u8bcd\u5efa\u8bae",
"Success": "\u6210\u529f",
"Repair": "\u4fee\u590d",
"Issue {0} of {1}": "\u5171\u8ba1{1}\u95ee\u9898{0}",
"Images must be marked as decorative or have an alternative text description": "\u56fe\u50cf\u5fc5\u987b\u6807\u8bb0\u4e3a\u88c5\u9970\u6027\u6216\u5177\u6709\u66ff\u4ee3\u6587\u672c\u63cf\u8ff0",
"Images must have an alternative text description. Decorative images are not allowed.": "\u56fe\u50cf\u5fc5\u987b\u5177\u6709\u66ff\u4ee3\u6587\u672c\u63cf\u8ff0\u3002\u4e0d\u5141\u8bb8\u4f7f\u7528\u88c5\u9970\u56fe\u50cf\u3002",
"Or provide alternative text:": "\u6216\u63d0\u4f9b\u5907\u9009\u6587\u672c\uff1a",
"Make image decorative:": "\u4f7f\u56fe\u50cf\u88c5\u9970\uff1a",
"ID attribute must be unique": "ID \u5c5e\u6027\u5fc5\u987b\u662f\u552f\u4e00\u7684",
"Make ID unique": "\u4f7f ID \u72ec\u4e00\u65e0\u4e8c",
"Keep this ID and remove all others": "\u4fdd\u7559\u6b64 ID \u5e76\u5220\u9664\u6240\u6709\u5176\u4ed6",
"Remove this ID": "\u5220\u9664\u6b64 ID",
"Remove all IDs": "\u6e05\u9664\u5168\u90e8IDs",
"Checklist": "\u6e05\u5355",
"Anchor": "\u951a\u70b9",
"Special character": "\u7279\u6b8a\u7b26\u53f7",
"Code sample": "\u4ee3\u7801\u793a\u4f8b",
"Color": "\u989c\u8272",
"Emoticons": "\u8868\u60c5",
"Document properties": "\u6587\u6863\u5c5e\u6027",
"Image description": "\u56fe\u7247\u63cf\u8ff0",
"Image": "\u56fe\u7247",
"Insert link": "\u63d2\u5165\u94fe\u63a5",
"Target": "\u6253\u5f00\u65b9\u5f0f",
@ -413,7 +458,5 @@ tinymce.addI18n('zh_CN',{
"Prev": "\u4e0a\u4e00\u4e2a",
"Find and replace": "\u67e5\u627e\u548c\u66ff\u6362",
"Whole words": "\u5168\u5b57\u5339\u914d",
"Spellcheck": "\u62fc\u5199\u68c0\u67e5",
"Caption": "\u6807\u9898",
"Insert template": "\u63d2\u5165\u6a21\u677f"
});

View File

@ -4,21 +4,19 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var applyListFormat = function (editor, listName, styleValue) {
var cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList';
editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue });
};
var register = function (editor) {
var register$1 = function (editor) {
editor.addCommand('ApplyUnorderedListStyle', function (ui, value) {
applyListFormat(editor, 'UL', value['list-style-type']);
});
@ -27,6 +25,8 @@
});
};
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
var getNumberStyles = function (editor) {
var styles = editor.getParam('advlist_number_styles', 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman');
return styles ? styles.split(/[ ,]/) : [];
@ -43,6 +43,9 @@
return value;
};
};
var identity = function (x) {
return x;
};
var never = constant(false);
var always = constant(true);
@ -50,20 +53,14 @@
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var id = identity;
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
@ -80,9 +77,9 @@
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
filter: function () {
return none();
},
toArray: function () {
return [];
},
@ -102,9 +99,6 @@
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
@ -131,14 +125,6 @@
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
@ -146,7 +132,7 @@
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
var Optional = {
some: some,
none: none,
from: from
@ -166,7 +152,7 @@
var getSelectedStyleType = function (editor) {
var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
var style = editor.dom.getStyle(listElm, 'listStyleType');
return Option.from(style);
return Optional.from(style);
};
var findIndex = function (list, predicate) {
@ -186,9 +172,20 @@
var isWithinList = function (editor, e, nodeName) {
var tableCellIndex = findIndex(e.parents, isTableCellNode);
var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
var lists = global$1.grep(parents, isListNode(editor));
var lists = global.grep(parents, isListNode(editor));
return lists.length > 0 && lists[0].nodeName === nodeName;
};
var makeSetupHandler = function (editor, nodeName) {
return function (api) {
var nodeChangeHandler = function (e) {
api.setActive(isWithinList(editor, e, nodeName));
};
editor.on('NodeChange', nodeChangeHandler);
return function () {
return editor.off('NodeChange', nodeChangeHandler);
};
};
};
var addSplitButton = function (editor, id, tooltip, cmd, nodeName, styles) {
editor.ui.registry.addSplitButton(id, {
tooltip: tooltip,
@ -196,7 +193,7 @@
presets: 'listpreview',
columns: 3,
fetch: function (callback) {
var items = global$1.map(styles, function (styleValue) {
var items = global.map(styles, function (styleValue) {
var iconStyle = nodeName === 'OL' ? 'num' : 'bull';
var iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue;
var itemValue = styleValue === 'default' ? '' : styleValue;
@ -222,15 +219,7 @@
return value === listStyle;
}).getOr(false);
},
onSetup: function (api) {
var nodeChangeHandler = function (e) {
api.setActive(isWithinList(editor, e, nodeName));
};
editor.on('NodeChange', nodeChangeHandler);
return function () {
return editor.off('NodeChange', nodeChangeHandler);
};
}
onSetup: makeSetupHandler(editor, nodeName)
});
};
var addButton = function (editor, id, tooltip, cmd, nodeName, _styles) {
@ -238,41 +227,31 @@
active: false,
tooltip: tooltip,
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
onSetup: function (api) {
var nodeChangeHandler = function (e) {
api.setActive(isWithinList(editor, e, nodeName));
};
editor.on('NodeChange', nodeChangeHandler);
return function () {
return editor.off('NodeChange', nodeChangeHandler);
};
},
onSetup: makeSetupHandler(editor, nodeName),
onAction: function () {
return editor.execCommand(cmd);
}
});
};
var addControl = function (editor, id, tooltip, cmd, nodeName, styles) {
if (styles.length > 0) {
if (styles.length > 1) {
addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
} else {
addButton(editor, id, tooltip, cmd, nodeName);
}
};
var register$1 = function (editor) {
var register = function (editor) {
addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', getNumberStyles(editor));
addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', getBulletStyles(editor));
};
function Plugin () {
global.add('advlist', function (editor) {
var hasPlugin = function (editor, plugin) {
var plugins = editor.settings.plugins ? editor.settings.plugins : '';
return global$1.inArray(plugins.split(/[ ,]/), plugin) !== -1;
};
if (hasPlugin(editor, 'lists')) {
register$1(editor);
global$1.add('advlist', function (editor) {
if (editor.hasPlugin('lists')) {
register(editor);
register$1(editor);
} else {
console.error('Please use the Lists plugin together with the Advanced List plugin.');
}
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var n,t,e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},o=function(n){return function(){return n}},u=o(!1),l=o(!0),i=function(){return a},a=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:u,isSome:u,isNone:l,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:e,orThunk:t,map:i,each:function(){},bind:i,exists:u,forall:l,filter:i,equals:n,equals_:n,toArray:function(){return[]},toString:o("none()")}),f=function(e){var n=o(e),t=function(){return i},r=function(n){return n(e)},i={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:l,isNone:u,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return f(n(e))},each:function(n){n(e)},bind:r,exists:r,forall:r,filter:function(n){return n(e)?i:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(u,function(n){return t(e,n)})}};return i},d=function(n){return null===n||n===undefined?a:f(n)},g=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},p=function(r){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&(e=n,(t=r).$.contains(t.getBody(),e));var t,e}},m=function(n,t,e){var r=function(n,t){for(var e=0;e<n.length;e++){if(t(n[e]))return e}return-1}(t.parents,g),i=-1!==r?t.parents.slice(0,r):t.parents,o=s.grep(i,p(n));return 0<o.length&&o[0].nodeName===e},y=function(i,n,t,e,r,o){i.ui.registry.addSplitButton(n,{tooltip:t,icon:"OL"===r?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(n){n(s.map(o,function(n){return{type:"choiceitem",value:"default"===n?"":n,icon:"list-"+("OL"===r?"num":"bull")+"-"+("disc"===n||"decimal"===n?"default":n),text:n.replace(/\-/g," ").replace(/\b\w/g,function(n){return n.toUpperCase()})}}))},onAction:function(){return i.execCommand(e)},onItemAction:function(n,t){c(i,r,t)},select:function(t){var n,e,r;return(e=(n=i).dom.getParent(n.selection.getNode(),"ol,ul"),r=n.dom.getStyle(e,"listStyleType"),d(r)).map(function(n){return t===n}).getOr(!1)},onSetup:function(t){var n=function(n){t.setActive(m(i,n,r))};return i.on("NodeChange",n),function(){return i.off("NodeChange",n)}}})},v=function(n,t,e,r,i,o){var u,l,s,c,a;0<o.length?y(n,t,e,r,i,o):(l=t,s=e,c=r,a=i,(u=n).ui.registry.addToggleButton(l,{active:!1,tooltip:s,icon:"OL"===a?"ordered-list":"unordered-list",onSetup:function(t){var n=function(n){t.setActive(m(u,n,a))};return u.on("NodeChange",n),function(){return u.off("NodeChange",n)}},onAction:function(){return u.execCommand(c)}}))};!function O(){r.add("advlist",function(n){var e,t,r,i,o,u,l;u="lists",l=(o=n).settings.plugins?o.settings.plugins:"",-1!==s.inArray(l.split(/[ ,]/),u)&&(v(t=n,"numlist","Numbered list","InsertOrderedList","OL",(r=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"))?r.split(/[ ,]/):[]),v(t,"bullist","Bullet list","InsertUnorderedList","UL",(i=t.getParam("advlist_bullet_styles","default,circle,square"))?i.split(/[ ,]/):[]),(e=n).addCommand("ApplyUnorderedListStyle",function(n,t){c(e,"UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(n,t){c(e,"OL",t["list-style-type"])}))})}()}();
!function(){"use strict";function f(t,e,n){t.execCommand("UL"===e?"InsertUnorderedList":"InsertOrderedList",!1,!1===n?null:{"list-style-type":n})}function i(t){return function(){return t}}function t(t){return t}function e(){return s}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=i(!1),l=i(!0),s={fold:function(t,e){return t()},isSome:u,isNone:l,getOr:t,getOrThunk:r,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:r,map:e,each:function(){},bind:e,exists:u,forall:l,filter:function(){return s},toArray:function(){return[]},toString:i("none()")};function r(t){return t()}function d(t){return t&&/^(TH|TD)$/.test(t.nodeName)}function m(c,a){return function(s){function t(t){var e,n,r,o,i,u,l;s.setActive((e=c,r=a,i=-1!==(o=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}((n=t).parents,d))?n.parents.slice(0,o):n.parents,0<(u=g.grep(i,(l=e,function(t){return t&&/^(OL|UL|DL)$/.test(t.nodeName)&&(e=t,l.$.contains(l.getBody(),e));var e}))).length&&u[0].nodeName===r))}return c.on("NodeChange",t),function(){return c.off("NodeChange",t)}}}function c(t,e,n,r,o,i){var u,l,s,c,a,d;1<i.length?(c=r,a=o,d=i,(s=t).ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===a?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(g.map(d,function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===a?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()})}}))},onAction:function(){return s.execCommand(c)},onItemAction:function(t,e){f(s,a,e)},select:function(e){var t,n=(t=s).dom.getParent(t.selection.getNode(),"ol,ul"),r=t.dom.getStyle(n,"listStyleType");return p(r).map(function(t){return e===t}).getOr(!1)},onSetup:m(s,a)})):(l=r,(u=t).ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:m(u,o),onAction:function(){return u.execCommand(l)}}))}var a=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},isSome:l,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return a(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:s},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},p=function(t){return null==t?s:a(t)};n.add("advlist",function(t){var n,e,r,o;t.hasPlugin("lists")?(c(e=t,"numlist","Numbered list","InsertOrderedList","OL",(r=e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"))?r.split(/[ ,]/):[]),c(e,"bullist","Bullet list","InsertUnorderedList","UL",(o=e.getParam("advlist_bullet_styles","default,circle,square"))?o.split(/[ ,]/):[]),(n=t).addCommand("ApplyUnorderedListStyle",function(t,e){f(n,"UL",e["list-style-type"])}),n.addCommand("ApplyOrderedListStyle",function(t,e){f(n,"OL",e["list-style-type"])})):console.error("Please use the Lists plugin together with the Advanced List plugin.")})}();

View File

@ -4,34 +4,92 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var isNamedAnchor = function (editor, node) {
return node.tagName === 'A' && editor.dom.getAttrib(node, 'href') === '';
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
var allowHtmlInNamedAnchor = function (editor) {
return editor.getParam('allow_html_in_named_anchor', false, 'boolean');
};
var namedAnchorSelector = 'a:not([href])';
var isEmptyString = function (str) {
return !str;
};
var getIdFromAnchor = function (elm) {
var id = elm.getAttribute('id') || elm.getAttribute('name');
return id || '';
};
var isAnchor = function (elm) {
return elm && elm.nodeName.toLowerCase() === 'a';
};
var isNamedAnchor = function (elm) {
return isAnchor(elm) && !elm.getAttribute('href') && getIdFromAnchor(elm) !== '';
};
var isEmptyNamedAnchor = function (elm) {
return isNamedAnchor(elm) && !elm.firstChild;
};
var removeEmptyNamedAnchorsInSelection = function (editor) {
var dom = editor.dom;
global$1(dom).walk(editor.selection.getRng(), function (nodes) {
global.each(nodes, function (node) {
if (isEmptyNamedAnchor(node)) {
dom.remove(node, false);
}
});
});
};
var isValidId = function (id) {
return /^[A-Za-z][A-Za-z0-9\-:._]*$/.test(id);
};
var getNamedAnchor = function (editor) {
return editor.dom.getParent(editor.selection.getStart(), namedAnchorSelector);
};
var getId = function (editor) {
var selectedNode = editor.selection.getNode();
return isNamedAnchor(editor, selectedNode) ? selectedNode.getAttribute('id') || selectedNode.getAttribute('name') : '';
var anchor = getNamedAnchor(editor);
if (anchor) {
return getIdFromAnchor(anchor);
} else {
return '';
}
};
var createAnchor = function (editor, id) {
editor.undoManager.transact(function () {
if (!allowHtmlInNamedAnchor(editor)) {
editor.selection.collapse(true);
}
if (editor.selection.isCollapsed()) {
editor.insertContent(editor.dom.createHTML('a', { id: id }));
} else {
removeEmptyNamedAnchorsInSelection(editor);
editor.formatter.remove('namedAnchor', null, null, true);
editor.formatter.apply('namedAnchor', { value: id });
editor.addVisual();
}
});
};
var updateAnchor = function (editor, id, anchorElement) {
anchorElement.removeAttribute('name');
anchorElement.id = id;
editor.addVisual();
editor.undoManager.add();
};
var insert = function (editor, id) {
var selectedNode = editor.selection.getNode();
if (isNamedAnchor(editor, selectedNode)) {
selectedNode.removeAttribute('name');
selectedNode.id = id;
editor.undoManager.add();
var anchor = getNamedAnchor(editor);
if (anchor) {
updateAnchor(editor, id, anchor);
} else {
editor.focus();
editor.selection.collapse(true);
editor.insertContent(editor.dom.createHTML('a', { id: id }));
createAnchor(editor, id);
}
editor.focus();
};
var insertAnchor = function (editor, newId) {
@ -79,20 +137,24 @@
});
};
var register = function (editor) {
var register$1 = function (editor) {
editor.addCommand('mceAnchor', function () {
open(editor);
});
};
var isNamedAnchorNode = function (node) {
return !node.attr('href') && (node.attr('id') || node.attr('name')) && !node.firstChild;
return node && isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name'));
};
var isEmptyNamedAnchorNode = function (node) {
return isNamedAnchorNode(node) && !node.firstChild;
};
var setContentEditable = function (state) {
return function (nodes) {
for (var i = 0; i < nodes.length; i++) {
if (isNamedAnchorNode(nodes[i])) {
nodes[i].attr('contenteditable', state);
var node = nodes[i];
if (isEmptyNamedAnchorNode(node)) {
node.attr('contenteditable', state);
}
}
};
@ -104,7 +166,21 @@
});
};
var register$1 = function (editor) {
var registerFormats = function (editor) {
editor.formatter.register('namedAnchor', {
inline: 'a',
selector: namedAnchorSelector,
remove: 'all',
split: true,
deep: true,
attributes: { id: '%value' },
onmatch: function (node, _fmt, _itemName) {
return isNamedAnchor(node);
}
});
};
var register = function (editor) {
editor.ui.registry.addToggleButton('anchor', {
icon: 'bookmark',
tooltip: 'Anchor',
@ -125,10 +201,13 @@
};
function Plugin () {
global.add('anchor', function (editor) {
global$2.add('anchor', function (editor) {
setup(editor);
register(editor);
register$1(editor);
register(editor);
editor.on('PreInit', function () {
registerFormats(editor);
});
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(e,t){return"A"===t.tagName&&""===e.dom.getAttrib(t,"href")},r=function(e,t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(o=t,r=(n=e).selection.getNode(),a(n,r)?(r.removeAttribute("name"),r.id=o,n.undoManager.add()):(n.focus(),n.selection.collapse(!0),n.insertContent(n.dom.createHTML("a",{id:o}))),!0):(e.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1);var n,o,r},i=function(t){var e,n,o=(n=(e=t).selection.getNode(),a(e,n)?n.getAttribute("id")||n.getAttribute("name"):"");t.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:o},onSubmit:function(e){r(t,e.getData().id)&&e.close()}})},c=function(o){return function(e){for(var t=0;t<e.length;t++)(n=e[t]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||e[t].attr("contenteditable",o);var n}};!function t(){e.add("anchor",function(e){var t,n,o;(t=e).on("PreInit",function(){t.parser.addNodeFilter("a",c("false")),t.serializer.addNodeFilter("a",c(null))}),(n=e).addCommand("mceAnchor",function(){i(n)}),(o=e).ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return o.execCommand("mceAnchor")},onSetup:function(e){return o.selection.selectorChangedWithUnbind("a:not([href])",e.setActive).unbind}}),o.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return o.execCommand("mceAnchor")}})})}()}();
!function(){"use strict";function a(e){return e.getAttribute("id")||e.getAttribute("name")||""}function c(e){return e&&"a"===e.nodeName.toLowerCase()&&!e.getAttribute("href")&&""!==a(e)}function d(e){return e.dom.getParent(e.selection.getStart(),l)}function r(e,t){var o,a,n,r,i,l=d(e);l?(n=e,r=t,(i=l).removeAttribute("name"),i.id=r,n.addVisual(),n.undoManager.add()):(a=t,(o=e).undoManager.transact(function(){var e,n;o.getParam("allow_html_in_named_anchor",!1,"boolean")||o.selection.collapse(!0),o.selection.isCollapsed()?o.insertContent(o.dom.createHTML("a",{id:a})):(n=(e=o).dom,u(n).walk(e.selection.getRng(),function(e){s.each(e,function(e){var t;c(t=e)&&!t.firstChild&&n.remove(e,!1)})}),o.formatter.remove("namedAnchor",null,null,!0),o.formatter.apply("namedAnchor",{value:a}),o.addVisual())})),e.focus()}function i(r){return function(e){for(var t,n=0;n<e.length;n++){var o=e[n],a=void 0;!(a=t=o)||a.attr("href")||!a.attr("id")&&!a.attr("name")||t.firstChild||o.attr("contenteditable",r)}}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),s=tinymce.util.Tools.resolve("tinymce.util.Tools"),l="a:not([href])";e.add("anchor",function(e){var t,n,o;(t=e).on("PreInit",function(){t.parser.addNodeFilter("a",i("false")),t.serializer.addNodeFilter("a",i(null))}),(n=e).addCommand("mceAnchor",function(){var o,e,t;t=(e=d(o=n))?a(e):"",o.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(e){var t=o,n=e.getData().id;(/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(n)?(r(t,n),0):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))||e.close()}})}),(o=e).ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return o.execCommand("mceAnchor")},onSetup:function(e){return o.selection.selectorChangedWithUnbind("a:not([href])",e.setActive).unbind}}),o.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return o.execCommand("mceAnchor")}}),e.on("PreInit",function(){e.formatter.register("namedAnchor",{inline:"a",selector:l,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:c})})})}();

View File

@ -4,17 +4,32 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var checkRange = function (str, substr, start) {
return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
};
var contains = function (str, substr) {
return str.indexOf(substr) !== -1;
};
var startsWith = function (str, prefix) {
return checkRange(str, prefix, 0);
};
var global = tinymce.util.Tools.resolve('tinymce.Env');
var link = function () {
return /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
};
var defaultLinkPattern = new RegExp('^' + link().source + '$', 'i');
var getAutoLinkPattern = function (editor) {
return editor.getParam('autolink_pattern', /^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i);
return editor.getParam('autolink_pattern', defaultLinkPattern);
};
var getDefaultLinkTarget = function (editor) {
return editor.getParam('default_link_target', false);
@ -23,23 +38,29 @@
return editor.getParam('link_default_protocol', 'http', 'string');
};
var rangeEqualsDelimiterOrSpace = function (rangeString, delimiter) {
return rangeString === delimiter || rangeString === ' ' || rangeString.charCodeAt(0) === 160;
var rangeEqualsBracketOrSpace = function (rangeString) {
return /^[(\[{ \u00a0]$/.test(rangeString);
};
var handleEclipse = function (editor) {
parseCurrentLine(editor, -1, '(');
var isTextNode = function (node) {
return node.nodeType === 3;
};
var isElement = function (node) {
return node.nodeType === 1;
};
var handleBracket = function (editor) {
return parseCurrentLine(editor, -1);
};
var handleSpacebar = function (editor) {
parseCurrentLine(editor, 0, '');
return parseCurrentLine(editor, 0);
};
var handleEnter = function (editor) {
parseCurrentLine(editor, -1, '');
return parseCurrentLine(editor, -1);
};
var scopeIndex = function (container, index) {
if (index < 0) {
index = 0;
}
if (container.nodeType === 3) {
if (isTextNode(container)) {
var len = container.data.length;
if (index > len) {
index = len;
@ -48,27 +69,33 @@
return index;
};
var setStart = function (rng, container, offset) {
if (container.nodeType !== 1 || container.hasChildNodes()) {
if (!isElement(container) || container.hasChildNodes()) {
rng.setStart(container, scopeIndex(container, offset));
} else {
rng.setStartBefore(container);
}
};
var setEnd = function (rng, container, offset) {
if (container.nodeType !== 1 || container.hasChildNodes()) {
if (!isElement(container) || container.hasChildNodes()) {
rng.setEnd(container, scopeIndex(container, offset));
} else {
rng.setEndAfter(container);
}
};
var parseCurrentLine = function (editor, endOffset, delimiter) {
var rng, end, start, endContainer, bookmark, text, matches, prev, len, rngText;
var hasProtocol = function (url) {
return /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
};
var isPunctuation = function (char) {
return /[?!,.;:]/.test(char);
};
var parseCurrentLine = function (editor, endOffset) {
var end, endContainer, bookmark, text, prev, len, rngText;
var autoLinkPattern = getAutoLinkPattern(editor);
var defaultLinkTarget = getDefaultLinkTarget(editor);
if (editor.selection.getNode().tagName === 'A') {
if (editor.dom.getParent(editor.selection.getNode(), 'a[href]') !== null) {
return;
}
rng = editor.selection.getRng(true).cloneRange();
var rng = editor.selection.getRng().cloneRange();
if (rng.startOffset < 5) {
prev = rng.endContainer.previousSibling;
if (!prev) {
@ -87,11 +114,11 @@
endContainer = prev;
} else {
endContainer = rng.endContainer;
if (endContainer.nodeType !== 3 && endContainer.firstChild) {
while (endContainer.nodeType !== 3 && endContainer.firstChild) {
if (!isTextNode(endContainer) && endContainer.firstChild) {
while (!isTextNode(endContainer) && endContainer.firstChild) {
endContainer = endContainer.firstChild;
}
if (endContainer.nodeType === 3) {
if (isTextNode(endContainer)) {
setStart(rng, endContainer, 0);
setEnd(rng, endContainer, endContainer.nodeValue.length);
}
@ -102,14 +129,14 @@
end = rng.endOffset - 1 - endOffset;
}
}
start = end;
var start = end;
do {
setStart(rng, endContainer, end >= 2 ? end - 2 : 0);
setEnd(rng, endContainer, end >= 1 ? end - 1 : 0);
end -= 1;
rngText = rng.toString();
} while (rngText !== ' ' && rngText !== '' && rngText.charCodeAt(0) !== 160 && end - 2 >= 0 && rngText !== delimiter);
if (rangeEqualsDelimiterOrSpace(rng.toString(), delimiter)) {
} while (!rangeEqualsBracketOrSpace(rngText) && end - 2 >= 0);
if (rangeEqualsBracketOrSpace(rng.toString())) {
setStart(rng, endContainer, end);
setEnd(rng, endContainer, start);
end += 1;
@ -121,21 +148,22 @@
setEnd(rng, endContainer, start);
}
text = rng.toString();
if (text.charAt(text.length - 1) === '.') {
if (isPunctuation(text.charAt(text.length - 1))) {
setEnd(rng, endContainer, start - 1);
}
text = rng.toString().trim();
matches = text.match(autoLinkPattern);
var matches = text.match(autoLinkPattern);
var protocol = getDefaultLinkProtocol(editor);
if (matches) {
if (matches[1] === 'www.') {
matches[1] = protocol + '://www.';
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
matches[1] = 'mailto:' + matches[1];
var url = matches[0];
if (startsWith(url, 'www.')) {
url = protocol + '://' + url;
} else if (contains(url, '@') && !hasProtocol(url)) {
url = 'mailto:' + url;
}
bookmark = editor.selection.getBookmark();
editor.selection.setRng(rng);
editor.execCommand('createlink', false, matches[1] + matches[2]);
editor.execCommand('createlink', false, url);
if (defaultLinkTarget !== false) {
editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget);
}
@ -150,7 +178,7 @@
return handleEnter(editor);
}
});
if (global$1.browser.isIE()) {
if (global.browser.isIE()) {
editor.on('focus', function () {
if (!autoUrlDetectState) {
autoUrlDetectState = true;
@ -163,8 +191,8 @@
return;
}
editor.on('keypress', function (e) {
if (e.keyCode === 41) {
return handleEclipse(editor);
if (e.keyCode === 41 || e.keyCode === 93 || e.keyCode === 125) {
return handleBracket(editor);
}
});
editor.on('keyup', function (e) {
@ -175,7 +203,7 @@
};
function Plugin () {
global.add('autolink', function (editor) {
global$1.add('autolink', function (editor) {
setup(editor);
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.Env"),o=function(e,t){if(t<0&&(t=0),3===e.nodeType){var n=e.data.length;n<t&&(t=n)}return t},y=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)},k=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)},r=function(e,t,n){var i,o,r,a,s,f,l,d,c,g,u=e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),h=e.getParam("default_link_target",!1);if("A"!==e.selection.getNode().tagName){if((i=e.selection.getRng(!0).cloneRange()).startOffset<5){if(!(d=i.endContainer.previousSibling)){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;d=i.endContainer.firstChild.nextSibling}if(c=d.length,y(i,d,c),k(i,d,c),i.endOffset<5)return;o=i.endOffset,a=d}else{if(3!==(a=i.endContainer).nodeType&&a.firstChild){for(;3!==a.nodeType&&a.firstChild;)a=a.firstChild;3===a.nodeType&&(y(i,a,0),k(i,a,a.nodeValue.length))}o=1===i.endOffset?2:i.endOffset-1-t}for(r=o;y(i,a,2<=o?o-2:0),k(i,a,1<=o?o-1:0),--o," "!==(g=i.toString())&&""!==g&&160!==g.charCodeAt(0)&&0<=o-2&&g!==n;);var m;(m=i.toString())===n||" "===m||160===m.charCodeAt(0)?(y(i,a,o),k(i,a,r),o+=1):(0===i.startOffset?y(i,a,0):y(i,a,o),k(i,a,r)),"."===(f=i.toString()).charAt(f.length-1)&&k(i,a,r-1),l=(f=i.toString().trim()).match(u);var C=e.getParam("link_default_protocol","http","string");l&&("www."===l[1]?l[1]=C+"://www.":/@$/.test(l[1])&&!/^mailto:/.test(l[1])&&(l[1]="mailto:"+l[1]),s=e.selection.getBookmark(),e.selection.setRng(i),e.execCommand("createlink",!1,l[1]+l[2]),!1!==h&&e.dom.setAttrib(e.selection.getNode(),"target",h),e.selection.moveToBookmark(s),e.nodeChanged())}},t=function(t){var n;t.on("keydown",function(e){if(13!==e.keyCode);else r(t,-1,"")}),i.browser.isIE()?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){if(41!==e.keyCode);else r(t,-1,"(")}),t.on("keyup",function(e){if(32!==e.keyCode);else r(t,0,"")}))};!function n(){e.add("autolink",function(e){t(e)})}()}();
!function(){"use strict";function k(e){return/^[(\[{ \u00a0]$/.test(e)}function w(e){return 3===e.nodeType}function i(e){return 1===e.nodeType}function o(e,t){var n;return t<0&&(t=0),!w(e)||(n=e.data.length)<t&&(t=n),t}function y(e,t,n){!i(t)||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)}function v(e,t,n){!i(t)||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)}function r(e,t){var n,i,o,r,a,f=e.getParam("autolink_pattern",A),s=e.getParam("default_link_target",!1);if(null===e.dom.getParent(e.selection.getNode(),"a[href]")){var d=e.selection.getRng().cloneRange();if(d.startOffset<5){if(!(r=d.endContainer.previousSibling)){if(!d.endContainer.firstChild||!d.endContainer.firstChild.nextSibling)return;r=d.endContainer.firstChild.nextSibling}if(y(d,r,a=r.length),v(d,r,a),d.endOffset<5)return;n=d.endOffset,i=r}else{if(!w(i=d.endContainer)&&i.firstChild){for(;!w(i)&&i.firstChild;)i=i.firstChild;w(i)&&(y(d,i,0),v(d,i,i.nodeValue.length))}n=1===d.endOffset?2:d.endOffset-1-t}for(var l=n;y(d,i,2<=n?n-2:0),v(d,i,1<=n?n-1:0),--n,!k(d.toString())&&0<=n-2;);k(d.toString())?(y(d,i,n),v(d,i,l),n+=1):(0===d.startOffset?y(d,i,0):y(d,i,n),v(d,i,l)),u=d.toString(),/[?!,.;:]/.test(u.charAt(u.length-1))&&v(d,i,l-1);var u,c,g,h,C=(u=d.toString().trim()).match(f),m=e.getParam("link_default_protocol","http","string");C&&((g=c=C[0]).length>=(h="www.").length&&g.substr(0,0+h.length)===h?c=m+"://"+c:-1===c.indexOf("@")||/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(c)||(c="mailto:"+c),o=e.selection.getBookmark(),e.selection.setRng(d),e.execCommand("createlink",!1,c),!1!==s&&e.dom.setAttrib(e.selection.getNode(),"target",s),e.selection.moveToBookmark(o),e.nodeChanged())}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),A=new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i");e.add("autolink",function(e){var t,n;(t=e).on("keydown",function(e){if(13===e.keyCode)return r(t,-1)}),a.browser.isIE()?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){if(41===e.keyCode||93===e.keyCode||125===e.keyCode)return r(t,-1)}),t.on("keyup",function(e){if(32===e.keyCode)return r(t,0)}))})}();

View File

@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
@ -23,11 +23,16 @@
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var hasOwnProperty = Object.hasOwnProperty;
var has = function (obj, key) {
return hasOwnProperty.call(obj, key);
};
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global = tinymce.util.Tools.resolve('tinymce.util.Delay');
var fireResizeEditor = function (editor) {
return editor.fire('ResizeEditor');
@ -53,7 +58,7 @@
return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
};
var wait = function (editor, oldSize, times, interval, callback) {
global$2.setEditorTimeout(editor, function () {
global.setEditorTimeout(editor, function () {
resize(editor, oldSize);
if (times--) {
wait(editor, oldSize, times, interval, callback);
@ -75,8 +80,15 @@
var value = parseInt(dom.getStyle(elm, name, computed), 10);
return isNaN(value) ? 0 : value;
};
var resize = function (editor, oldSize) {
var deltaSize, resizeHeight, contentHeight;
var shouldScrollIntoView = function (trigger) {
if ((trigger === null || trigger === void 0 ? void 0 : trigger.type.toLowerCase()) === 'setcontent') {
var setContentEvent = trigger;
return setContentEvent.selection === true || setContentEvent.paste === true;
} else {
return false;
}
};
var resize = function (editor, oldSize, trigger) {
var dom = editor.dom;
var doc = editor.getDoc();
if (!doc) {
@ -88,10 +100,10 @@
}
var docEle = doc.documentElement;
var resizeBottomMargin = getAutoResizeBottomMargin(editor);
resizeHeight = getAutoResizeMinHeight(editor);
var resizeHeight = getAutoResizeMinHeight(editor);
var marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true);
var marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true);
contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin;
var contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin;
if (contentHeight < 0) {
contentHeight = 0;
}
@ -109,7 +121,7 @@
toggleScrolling(editor, false);
}
if (resizeHeight !== oldSize.get()) {
deltaSize = resizeHeight - oldSize.get();
var deltaSize = resizeHeight - oldSize.get();
dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px');
oldSize.set(resizeHeight);
fireResizeEditor(editor);
@ -117,11 +129,11 @@
var win = editor.getWin();
win.scrollTo(win.pageXOffset, win.pageYOffset);
}
if (editor.hasFocus()) {
editor.selection.scrollIntoView(editor.selection.getNode());
if (editor.hasFocus() && shouldScrollIntoView(trigger)) {
editor.selection.scrollIntoView();
}
if (global$1.webkit && deltaSize < 0) {
resize(editor, oldSize);
resize(editor, oldSize, trigger);
}
}
};
@ -136,8 +148,8 @@
'min-height': 0
});
});
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function () {
resize(editor, oldSize);
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function (e) {
resize(editor, oldSize, e);
});
if (shouldAutoResizeOnInit(editor)) {
editor.on('init', function () {
@ -155,8 +167,8 @@
};
function Plugin () {
global.add('autoresize', function (editor) {
if (!editor.settings.hasOwnProperty('resize')) {
global$2.add('autoresize', function (editor) {
if (!has(editor.settings, 'resize')) {
editor.settings.resize = false;
}
if (!editor.inline) {

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},s=function(e,t,n,i,o){r.setEditorTimeout(e,function(){b(e,t),n--?s(e,t,n,i,o):o&&o()},i)},y=function(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))},p=function(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o},b=function(e,t){var n,i,o,r=e.dom,a=e.getDoc();if(a)if((s=e).plugins.fullscreen&&s.plugins.fullscreen.isFullscreen())y(e,!0);else{var s,u=a.documentElement,g=e.getParam("autoresize_bottom_margin",50,"number");i=v(e);var l=p(r,u,"margin-top",!0),f=p(r,u,"margin-bottom",!0);(o=u.offsetHeight+l+f+g)<0&&(o=0);var c=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;o+c>v(e)&&(i=o+c);var m=e.getParam("max_height",0,"number");if(m&&m<i?(i=m,y(e,!0)):y(e,!1),i!==t.get()){if(n=i-t.get(),r.setStyle(e.getContainer(),"height",i+"px"),t.set(i),e.fire("ResizeEditor"),h.browser.isSafari()&&h.mac){var d=e.getWin();d.scrollTo(d.pageXOffset,d.pageYOffset)}e.hasFocus()&&e.selection.scrollIntoView(e.selection.getNode()),h.webkit&&n<0&&b(e,t)}}};!function t(){e.add("autoresize",function(e){if(e.settings.hasOwnProperty("resize")||(e.settings.resize=!1),!e.inline){var t=(a=0,{get:function(){return a},set:function(e){a=e}});r=t,(o=e).addCommand("mceAutoResize",function(){b(o,r)}),i=t,(n=e).on("init",function(){var e=n.getParam("autoresize_overflow_padding",1,"number"),t=n.dom;t.setStyles(n.getDoc().documentElement,{height:"auto"}),t.setStyles(n.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),n.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(){b(n,i)}),n.getParam("autoresize_on_init",!0,"boolean")&&n.on("init",function(){s(n,i,20,100,function(){s(n,i,5,1e3)})})}var n,i,o,r,a})}()}();
!function(){"use strict";function y(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")}function p(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))}function v(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o}var l=Object.hasOwnProperty,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),b=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),u=function(e,t,n,i,o){r.setEditorTimeout(e,function(){C(e,t),n--?u(e,t,n,i,o):o&&o()},i)},C=function(e,t,n){var i,o,r,s,a,l,u,g,c,m,f,d=e.dom,h=e.getDoc();h&&(e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()?p(e,!0):(i=h.documentElement,o=e.getParam("autoresize_bottom_margin",50,"number"),r=y(e),s=v(d,i,"margin-top",!0),a=v(d,i,"margin-bottom",!0),(l=(l=i.offsetHeight+s+a+o)<0?0:l)+(u=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight)>y(e)&&(r=l+u),(g=e.getParam("max_height",0,"number"))&&g<r?(r=g,p(e,!0)):p(e,!1),r!==t.get()&&(c=r-t.get(),d.setStyle(e.getContainer(),"height",r+"px"),t.set(r),e.fire("ResizeEditor"),b.browser.isSafari()&&b.mac&&(m=e.getWin()).scrollTo(m.pageXOffset,m.pageYOffset),!e.hasFocus()||"setcontent"!==(null==(f=n)?void 0:f.type.toLowerCase())||!0!==f.selection&&!0!==f.paste||e.selection.scrollIntoView(),b.webkit&&c<0&&C(e,t,n))))};e.add("autoresize",function(e){var t,n,i,o,r,s,a=e.settings;l.call(a,"resize")||(e.settings.resize=!1),e.inline||(s=0,r=t={get:function(){return s},set:function(e){s=e}},(o=e).addCommand("mceAutoResize",function(){C(o,r)}),i=t,(n=e).on("init",function(){var e=n.getParam("autoresize_overflow_padding",1,"number"),t=n.dom;t.setStyles(n.getDoc().documentElement,{height:"auto"}),t.setStyles(n.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),n.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(e){C(n,i,e)}),n.getParam("autoresize_on_init",!0,"boolean")&&n.on("init",function(){u(n,i,20,100,function(){u(n,i,5,1e3)})}))})}();

View File

@ -4,18 +4,25 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function (domGlobals) {
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var eq = function (t) {
return function (a) {
return t === a;
};
};
var isUndefined = eq(undefined);
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage');
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var fireRestoreDraft = function (editor) {
return editor.fire('RestoreDraft');
@ -41,23 +48,31 @@
return editor.getParam('autosave_ask_before_unload', true);
};
var getAutoSavePrefix = function (editor) {
var location = domGlobals.document.location;
var location = document.location;
return editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-').replace(/{path}/g, location.pathname).replace(/{query}/g, location.search).replace(/{hash}/g, location.hash).replace(/{id}/g, editor.id);
};
var shouldRestoreWhenEmpty = function (editor) {
return editor.getParam('autosave_restore_when_empty', false);
};
var getAutoSaveInterval = function (editor) {
return parse(editor.settings.autosave_interval, '30s');
return parse(editor.getParam('autosave_interval'), '30s');
};
var getAutoSaveRetention = function (editor) {
return parse(editor.settings.autosave_retention, '20m');
return parse(editor.getParam('autosave_retention'), '20m');
};
var isEmpty = function (editor, html) {
var forcedRootBlockName = editor.settings.forced_root_block;
html = global$3.trim(typeof html === 'undefined' ? editor.getBody().innerHTML : html);
return html === '' || new RegExp('^<' + forcedRootBlockName + '[^>]*>((\xA0|&nbsp;|[ \t]|<br[^>]*>)+?|)</' + forcedRootBlockName + '>|<br>$', 'i').test(html);
if (isUndefined(html)) {
return editor.dom.isEmpty(editor.getBody());
} else {
var trimmedHtml = global$1.trim(html);
if (trimmedHtml === '') {
return true;
} else {
var fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html');
return editor.dom.isEmpty(fragment);
}
}
};
var hasDraft = function (editor) {
var time = parseInt(global$2.getItem(getAutoSavePrefix(editor) + 'time'), 10) || 0;
@ -95,10 +110,8 @@
};
var startStoreDraft = function (editor) {
var interval = getAutoSaveInterval(editor);
global$1.setInterval(function () {
if (!editor.removed) {
storeDraft(editor);
}
global$3.setEditorInterval(editor, function () {
storeDraft(editor);
}, interval);
};
var restoreLastDraft = function (editor) {
@ -129,12 +142,12 @@
};
};
var global$4 = tinymce.util.Tools.resolve('tinymce.EditorManager');
var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
var setup = function (editor) {
editor.editorManager.on('BeforeUnload', function (e) {
var msg;
global$3.each(global$4.get(), function (editor) {
global$1.each(global.get(), function (editor) {
if (editor.plugins.autosave) {
editor.plugins.autosave.storeDraft();
}
@ -182,7 +195,7 @@
};
function Plugin () {
global.add('autosave', function (editor) {
global$4.add('autosave', function (editor) {
setup(editor);
register(editor);
editor.on('init', function () {
@ -196,4 +209,4 @@
Plugin();
}(window));
}());

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(r){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Delay"),o=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)},u=function(t){var e=r.document.location;return t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},s=function(t,e){var r=t.settings.forced_root_block;return""===(e=a.trim(void 0===e?t.getBody().innerHTML:e))||new RegExp("^<"+r+"[^>]*>((\xa0|&nbsp;|[ \t]|<br[^>]*>)+?|)</"+r+">|<br>$","i").test(e)},f=function(t){var e=parseInt(o.getItem(u(t)+"time"),10)||0;return!((new Date).getTime()-e>i(t.settings.autosave_retention,"20m"))||(c(t,!1),!1)},c=function(t,e){var r=u(t);o.removeItem(r+"draft"),o.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},m=function(t){var e=u(t);!s(t)&&t.isDirty()&&(o.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),o.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))},l=function(t){var e=u(t);f(t)&&(t.setContent(o.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))},v=function(t){var e=i(t.settings.autosave_interval,"30s");n.setInterval(function(){t.removed||m(t)},e)},d=function(t){t.undoManager.transact(function(){l(t),c(t)}),t.focus()},g=tinymce.util.Tools.resolve("tinymce.EditorManager"),y=function(r){return function(t){t.setDisabled(!f(r));var e=function(){return t.setDisabled(!f(r))};return r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}};!function e(){t.add("autosave",function(t){var e,r;return t.editorManager.on("BeforeUnload",function(t){var e;a.each(g.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)}),v(e=t),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){d(e)},onSetup:y(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){d(e)},onSetup:y(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&l(t)}),r=t,{hasDraft:function(){return f(r)},storeDraft:function(){return m(r)},restoreDraft:function(){return l(r)},removeDraft:function(t){return c(r,t)},isEmpty:function(t){return s(r,t)}}})}()}(window);
!function(){"use strict";function o(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)}function n(t){var e=document.location;return t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)}function i(t,e){if(a(e))return t.dom.isEmpty(t.getBody());var r=d.trim(e);if(""===r)return!0;var n=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(n)}function u(t){var e=parseInt(v.getItem(n(t)+"time"),10)||0;return!((new Date).getTime()-e>o(t.getParam("autosave_retention"),"20m")&&(g(t,!1),1))}function s(t){var e=n(t);!i(t)&&t.isDirty()&&(v.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),v.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))}function f(t){var e=n(t);u(t)&&(t.setContent(v.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))}function c(t){t.undoManager.transact(function(){f(t),g(t)}),t.focus()}function m(r){return function(t){function e(){return t.setDisabled(!u(r))}return t.setDisabled(!u(r)),r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return void 0===t},l=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,e){var r=n(t);v.removeItem(r+"draft"),v.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},y=tinymce.util.Tools.resolve("tinymce.EditorManager");t.add("autosave",function(t){var e,r,n,a;return t.editorManager.on("BeforeUnload",function(t){var e;d.each(y.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)}),n=e=t,a=o(n.getParam("autosave_interval"),"30s"),l.setEditorInterval(n,function(){s(n)},a),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){c(e)},onSetup:m(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){c(e)},onSetup:m(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&f(t)}),r=t,{hasDraft:function(){return u(r)},storeDraft:function(){return s(r)},restoreDraft:function(){return f(r)},removeDraft:function(t){return g(r,t)},isEmpty:function(t){return i(r,t)}}})}();

View File

@ -4,17 +4,17 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
var html2bbcode = function (s) {
s = global$1.trim(s);
s = global.trim(s);
var rep = function (re, str) {
s = s.replace(re, str);
};
@ -58,7 +58,7 @@
return s;
};
var bbcode2html = function (s) {
s = global$1.trim(s);
s = global.trim(s);
var rep = function (re, str) {
s = s.replace(re, str);
};
@ -79,7 +79,7 @@
};
function Plugin () {
global.add('bbcode', function (editor) {
global$1.add('bbcode', function (editor) {
editor.on('BeforeSetContent', function (e) {
e.content = bbcode2html(e.content);
});

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/\n/gi,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),t};!function i(){o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=t(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=t(o.content)),o.get&&(o.content=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/<font>(.*?)<\/font>/gi,"$1"),o(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),o(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),o(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),o(/<u>/gi,"[u]"),o(/<blockquote[^>]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/<br \/>/gi,"\n"),o(/<br\/>/gi,"\n"),o(/<br>/gi,"\n"),o(/<p>/gi,""),o(/<\/p>/gi,"\n"),o(/&nbsp;|\u00a0/gi," "),o(/&quot;/gi,'"'),o(/&lt;/gi,"<"),o(/&gt;/gi,">"),o(/&amp;/gi,"&"),t}(o.content))})})}()}();
!function(){"use strict";function i(t){function o(o,e){t=t.replace(o,e)}return t=n.trim(t),o(/\n/gi,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),t}var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Tools");o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=i(o.content)}),o.on("PostProcess",function(o){function e(o,e){t=t.replace(o,e)}var t;o.set&&(o.content=i(o.content)),o.get&&(o.content=(t=o.content,t=n.trim(t),e(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),e(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),e(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),e(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),e(/<font>(.*?)<\/font>/gi,"$1"),e(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),e(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),e(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),e(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),e(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),e(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),e(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),e(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),e(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),e(/<\/(strong|b)>/gi,"[/b]"),e(/<(strong|b)>/gi,"[b]"),e(/<\/(em|i)>/gi,"[/i]"),e(/<(em|i)>/gi,"[i]"),e(/<\/u>/gi,"[/u]"),e(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),e(/<u>/gi,"[u]"),e(/<blockquote[^>]*>/gi,"[quote]"),e(/<\/blockquote>/gi,"[/quote]"),e(/<br \/>/gi,"\n"),e(/<br\/>/gi,"\n"),e(/<br>/gi,"\n"),e(/<p>/gi,""),e(/<\/p>/gi,"\n"),e(/&nbsp;|\u00a0/gi," "),e(/&quot;/gi,'"'),e(/&lt;/gi,"<"),e(/&gt;/gi,">"),e(/&amp;/gi,"&"),t))})})}();

View File

@ -4,12 +4,12 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function (domGlobals) {
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var fireInsertCustomChar = function (editor, chr) {
return editor.fire('insertCustomChar', { chr: chr });
@ -20,14 +20,30 @@
editor.execCommand('mceInsertContent', false, evtChr);
};
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var getCharMap = function (editor) {
return editor.settings.charmap;
var typeOf = function (x) {
var t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
return 'array';
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
return 'string';
} else {
return t;
}
};
var getCharMapAppend = function (editor) {
return editor.settings.charmap_append;
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
};
};
var eq = function (t) {
return function (a) {
return t === a;
};
};
var isArray$1 = isType('array');
var isNull = eq(null);
var noop = function () {
};
@ -36,6 +52,9 @@
return value;
};
};
var identity = function (x) {
return x;
};
var never = constant(false);
var always = constant(true);
@ -43,20 +62,14 @@
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var id = identity;
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
@ -73,9 +86,9 @@
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
filter: function () {
return none();
},
toArray: function () {
return [];
},
@ -95,9 +108,6 @@
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
@ -124,14 +134,6 @@
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
@ -139,31 +141,12 @@
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
var Optional = {
some: some,
none: none,
from: from
};
var typeOf = function (x) {
var t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
return 'array';
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
return 'string';
} else {
return t;
}
};
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
};
};
var isArray = isType('array');
var nativePush = Array.prototype.push;
var map = function (xs, f) {
var len = xs.length;
@ -184,12 +167,12 @@
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
if (pred(x, i)) {
return Option.some(x);
return Optional.some(x);
} else if (until(x, i)) {
break;
}
}
return Option.none();
return Optional.none();
};
var find = function (xs, pred) {
return findUntil(xs, pred, never);
@ -197,7 +180,7 @@
var flatten = function (xs) {
var r = [];
for (var i = 0, len = xs.length; i < len; ++i) {
if (!isArray(xs[i])) {
if (!isArray$1(xs[i])) {
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
}
nativePush.apply(r, xs[i]);
@ -208,7 +191,16 @@
return flatten(map(xs, f));
};
var isArray$1 = global$1.isArray;
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var getCharMap$1 = function (editor) {
return editor.getParam('charmap');
};
var getCharMapAppend = function (editor) {
return editor.getParam('charmap_append');
};
var isArray = global$1.isArray;
var UserDefined = 'User Defined';
var getDefaultCharMap = function () {
return [
@ -1403,12 +1395,12 @@
};
var charmapFilter = function (charmap) {
return global$1.grep(charmap, function (item) {
return isArray$1(item) && item.length === 2;
return isArray(item) && item.length === 2;
});
};
var getCharsFromSetting = function (settingValue) {
if (isArray$1(settingValue)) {
return [].concat(charmapFilter(settingValue));
if (isArray(settingValue)) {
return charmapFilter(settingValue);
}
if (typeof settingValue === 'function') {
return settingValue();
@ -1416,7 +1408,7 @@
return [];
};
var extendCharMap = function (editor, charmap) {
var userCharMap = getCharMap(editor);
var userCharMap = getCharMap$1(editor);
if (userCharMap) {
charmap = [{
name: UserDefined,
@ -1432,14 +1424,14 @@
userDefinedGroup[0].characters = [].concat(userDefinedGroup[0].characters).concat(getCharsFromSetting(userCharMapAppend));
return charmap;
}
return [].concat(charmap).concat({
return charmap.concat({
name: UserDefined,
characters: getCharsFromSetting(userCharMapAppend)
});
}
return charmap;
};
var getCharMap$1 = function (editor) {
var getCharMap = function (editor) {
var groups = extendCharMap(editor, getDefaultCharMap());
return groups.length > 1 ? [{
name: 'All',
@ -1450,14 +1442,14 @@
};
var get = function (editor) {
var getCharMap = function () {
return getCharMap$1(editor);
var getCharMap$1 = function () {
return getCharMap(editor);
};
var insertChar$1 = function (chr) {
insertChar(editor, chr);
};
return {
getCharMap: getCharMap,
getCharMap: getCharMap$1,
insertChar: insertChar$1
};
};
@ -1479,8 +1471,8 @@
var last = function (fn, rate) {
var timer = null;
var cancel = function () {
if (timer !== null) {
domGlobals.clearTimeout(timer);
if (!isNull(timer)) {
clearTimeout(timer);
timer = null;
}
};
@ -1489,12 +1481,10 @@
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (timer !== null) {
domGlobals.clearTimeout(timer);
}
timer = domGlobals.setTimeout(function () {
fn.apply(null, args);
cancel();
timer = setTimeout(function () {
timer = null;
fn.apply(null, args);
}, rate);
};
return {
@ -1648,13 +1638,13 @@
dialogApi.focus(patternName);
};
var register = function (editor, charMap) {
var register$1 = function (editor, charMap) {
editor.addCommand('mceShowCharmap', function () {
open(editor, charMap);
});
};
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Promise');
var global = tinymce.util.Tools.resolve('tinymce.util.Promise');
var init = function (editor, all) {
editor.ui.registry.addAutocompleter('charmap', {
@ -1662,7 +1652,7 @@
columns: 'auto',
minChars: 2,
fetch: function (pattern, _maxResults) {
return new global$2(function (resolve, _reject) {
return new global(function (resolve, _reject) {
resolve(scan(all, pattern));
});
},
@ -1674,7 +1664,7 @@
});
};
var register$1 = function (editor) {
var register = function (editor) {
editor.ui.registry.addButton('charmap', {
icon: 'insert-character',
tooltip: 'Special character',
@ -1692,10 +1682,10 @@
};
function Plugin () {
global.add('charmap', function (editor) {
var charMap = getCharMap$1(editor);
register(editor, charMap);
register$1(editor);
global$2.add('charmap', function (editor) {
var charMap = getCharMap(editor);
register$1(editor, charMap);
register(editor);
init(editor, charMap[0]);
return get(editor);
});
@ -1703,4 +1693,4 @@
Plugin();
}(window));
}());

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
@ -56,33 +56,32 @@
});
};
var register = function (editor) {
var register$1 = function (editor) {
editor.addCommand('mceCodeEditor', function () {
open(editor);
});
};
var register$1 = function (editor) {
var register = function (editor) {
var onAction = function () {
return editor.execCommand('mceCodeEditor');
};
editor.ui.registry.addButton('code', {
icon: 'sourcecode',
tooltip: 'Source code',
onAction: function () {
return open(editor);
}
onAction: onAction
});
editor.ui.registry.addMenuItem('code', {
icon: 'sourcecode',
text: 'Source code',
onAction: function () {
return open(editor);
}
onAction: onAction
});
};
function Plugin () {
global.add('code', function (editor) {
register(editor);
register$1(editor);
register(editor);
return {};
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(o){var e=o.getContent({source_view:!0});o.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){var t,n;t=o,n=e.getData().code,t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged(),e.close()}})};!function t(){e.add("code",function(e){var t,n;return(t=e).addCommand("mceCodeEditor",function(){o(t)}),(n=e).ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return o(n)}}),n.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return o(n)}}),{}})}()}();
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",function(e){var t,o;function n(){return o.execCommand("mceCodeEditor")}return(t=e).addCommand("mceCodeEditor",function(){var n,e;e=(n=t).getContent({source_view:!0}),n.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){var t=n,o=e.getData().code;t.focus(),t.undoManager.transact(function(){t.setContent(o)}),t.selection.setCursorLocation(),t.nodeChanged(),e.close()}})}),(o=e).ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:n}),o.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:n}),{}})}();

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4,19 +4,18 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function (domGlobals) {
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
function Plugin () {
global.add('colorpicker', function () {
domGlobals.console.warn('Color picker plugin is now built in to the core editor, please remove it from your editor configuration');
});
}
Plugin();
}(window));
}());

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",function(){})}();

View File

@ -4,19 +4,18 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function (domGlobals) {
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
function Plugin () {
global.add('contextmenu', function () {
domGlobals.console.warn('Context menu plugin is now built in to the core editor, please remove it from your editor configuration');
});
}
Plugin();
}(window));
}());

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(n){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager");!function e(){o.add("contextmenu",function(){n.console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",function(){})}();

View File

@ -4,46 +4,61 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function (domGlobals) {
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var setDir = function (editor, dir) {
var dom = editor.dom;
var curDir;
var blocks = editor.selection.getSelectedBlocks();
if (blocks.length) {
curDir = dom.getAttrib(blocks[0], 'dir');
global$1.each(blocks, function (block) {
if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) {
dom.setAttrib(block, 'dir', curDir !== dir ? dir : null);
}
});
editor.nodeChanged();
var typeOf = function (x) {
var t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
return 'array';
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
return 'string';
} else {
return t;
}
};
var register = function (editor) {
editor.addCommand('mceDirectionLTR', function () {
setDir(editor, 'ltr');
});
editor.addCommand('mceDirectionRTL', function () {
setDir(editor, 'rtl');
});
var isType$1 = function (type) {
return function (value) {
return typeOf(value) === type;
};
};
var isSimpleType = function (type) {
return function (value) {
return typeof value === type;
};
};
var isString = isType$1('string');
var isBoolean = isSimpleType('boolean');
var isNullable = function (a) {
return a === null || a === undefined;
};
var isNonNullable = function (a) {
return !isNullable(a);
};
var isFunction = isSimpleType('function');
var isNumber = isSimpleType('number');
var noop = function () {
};
var compose1 = function (fbc, fab) {
return function (a) {
return fbc(fab(a));
};
};
var constant = function (value) {
return function () {
return value;
};
};
var identity = function (x) {
return x;
};
var never = constant(false);
var always = constant(true);
@ -51,20 +66,14 @@
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var id = identity;
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
@ -81,9 +90,9 @@
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
filter: function () {
return none();
},
toArray: function () {
return [];
},
@ -103,9 +112,6 @@
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
@ -132,14 +138,6 @@
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
@ -147,29 +145,60 @@
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
var Optional = {
some: some,
none: none,
from: from
};
var map = function (xs, f) {
var len = xs.length;
var r = new Array(len);
for (var i = 0; i < len; i++) {
var x = xs[i];
r[i] = f(x, i);
}
return r;
};
var each = function (xs, f) {
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
f(x, i);
}
};
var filter = function (xs, pred) {
var r = [];
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
if (pred(x, i)) {
r.push(x);
}
}
return r;
};
var DOCUMENT = 9;
var DOCUMENT_FRAGMENT = 11;
var ELEMENT = 1;
var TEXT = 3;
var fromHtml = function (html, scope) {
var doc = scope || domGlobals.document;
var doc = scope || document;
var div = doc.createElement('div');
div.innerHTML = html;
if (!div.hasChildNodes() || div.childNodes.length > 1) {
domGlobals.console.error('HTML does not have a single root node', html);
console.error('HTML does not have a single root node', html);
throw new Error('HTML must have a single root node');
}
return fromDom(div.childNodes[0]);
};
var fromTag = function (tag, scope) {
var doc = scope || domGlobals.document;
var doc = scope || document;
var node = doc.createElement(tag);
return fromDom(node);
};
var fromText = function (text, scope) {
var doc = scope || domGlobals.document;
var doc = scope || document;
var node = doc.createTextNode(text);
return fromDom(node);
};
@ -177,13 +206,12 @@
if (node === null || node === undefined) {
throw new Error('Node cannot be null or undefined');
}
return { dom: constant(node) };
return { dom: node };
};
var fromPoint = function (docElm, x, y) {
var doc = docElm.dom();
return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
};
var Element = {
var SugarElement = {
fromHtml: fromHtml,
fromTag: fromTag,
fromText: fromText,
@ -191,39 +219,132 @@
fromPoint: fromPoint
};
var isSimpleType = function (type) {
return function (value) {
return typeof value === type;
};
};
var isFunction = isSimpleType('function');
var isSupported = function (dom) {
return dom.style !== undefined && isFunction(dom.style.getPropertyValue);
var is = function (element, selector) {
var dom = element.dom;
if (dom.nodeType !== ELEMENT) {
return false;
} else {
var elem = dom;
if (elem.matches !== undefined) {
return elem.matches(selector);
} else if (elem.msMatchesSelector !== undefined) {
return elem.msMatchesSelector(selector);
} else if (elem.webkitMatchesSelector !== undefined) {
return elem.webkitMatchesSelector(selector);
} else if (elem.mozMatchesSelector !== undefined) {
return elem.mozMatchesSelector(selector);
} else {
throw new Error('Browser lacks native selectors');
}
}
};
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
var TEXT = 3;
typeof window !== 'undefined' ? window : Function('return this;')();
var name = function (element) {
var r = element.dom.nodeName;
return r.toLowerCase();
};
var type = function (element) {
return element.dom().nodeType;
return element.dom.nodeType;
};
var isType = function (t) {
return function (element) {
return type(element) === t;
};
};
var isElement = isType(ELEMENT);
var isText = isType(TEXT);
var isDocument = isType(DOCUMENT);
var isDocumentFragment = isType(DOCUMENT_FRAGMENT);
var isTag = function (tag) {
return function (e) {
return isElement(e) && name(e) === tag;
};
};
var owner = function (element) {
return SugarElement.fromDom(element.dom.ownerDocument);
};
var documentOrOwner = function (dos) {
return isDocument(dos) ? dos : owner(dos);
};
var parent = function (element) {
return Optional.from(element.dom.parentNode).map(SugarElement.fromDom);
};
var children$2 = function (element) {
return map(element.dom.childNodes, SugarElement.fromDom);
};
var rawSet = function (dom, key, value) {
if (isString(value) || isBoolean(value) || isNumber(value)) {
dom.setAttribute(key, value + '');
} else {
console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);
throw new Error('Attribute value was not simple');
}
};
var set = function (element, key, value) {
rawSet(element.dom, key, value);
};
var remove = function (element, key) {
element.dom.removeAttribute(key);
};
var isShadowRoot = function (dos) {
return isDocumentFragment(dos) && isNonNullable(dos.dom.host);
};
var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode);
var getRootNode = supported ? function (e) {
return SugarElement.fromDom(e.dom.getRootNode());
} : documentOrOwner;
var getShadowRoot = function (e) {
var r = getRootNode(e);
return isShadowRoot(r) ? Optional.some(r) : Optional.none();
};
var getShadowHost = function (e) {
return SugarElement.fromDom(e.dom.host);
};
var inBody = function (element) {
var dom = isText(element) ? element.dom().parentNode : element.dom();
return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom);
var dom = isText(element) ? element.dom.parentNode : element.dom;
if (dom === undefined || dom === null || dom.ownerDocument === null) {
return false;
}
var doc = dom.ownerDocument;
return getShadowRoot(SugarElement.fromDom(dom)).fold(function () {
return doc.body.contains(dom);
}, compose1(inBody, getShadowHost));
};
var ancestor$1 = function (scope, predicate, isRoot) {
var element = scope.dom;
var stop = isFunction(isRoot) ? isRoot : never;
while (element.parentNode) {
element = element.parentNode;
var el = SugarElement.fromDom(element);
if (predicate(el)) {
return Optional.some(el);
} else if (stop(el)) {
break;
}
}
return Optional.none();
};
var ancestor = function (scope, selector, isRoot) {
return ancestor$1(scope, function (e) {
return is(e, selector);
}, isRoot);
};
var isSupported = function (dom) {
return dom.style !== undefined && isFunction(dom.style.getPropertyValue);
};
var get = function (element, property) {
var dom = element.dom();
var styles = domGlobals.window.getComputedStyle(dom);
var dom = element.dom;
var styles = window.getComputedStyle(dom);
var r = styles.getPropertyValue(property);
return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;
};
@ -235,10 +356,64 @@
return get(element, 'direction') === 'rtl' ? 'rtl' : 'ltr';
};
var children$1 = function (scope, predicate) {
return filter(children$2(scope), predicate);
};
var children = function (scope, selector) {
return children$1(scope, function (e) {
return is(e, selector);
});
};
var getParentElement = function (element) {
return parent(element).filter(isElement);
};
var getNormalizedBlock = function (element, isListItem) {
var normalizedElement = isListItem ? ancestor(element, 'ol,ul') : Optional.some(element);
return normalizedElement.getOr(element);
};
var isListItem = isTag('li');
var setDir = function (editor, dir) {
var selectedBlocks = editor.selection.getSelectedBlocks();
if (selectedBlocks.length > 0) {
each(selectedBlocks, function (block) {
var blockElement = SugarElement.fromDom(block);
var isBlockElementListItem = isListItem(blockElement);
var normalizedBlock = getNormalizedBlock(blockElement, isBlockElementListItem);
var normalizedBlockParent = getParentElement(normalizedBlock);
normalizedBlockParent.each(function (parent) {
var parentDirection = getDirection(parent);
if (parentDirection !== dir) {
set(normalizedBlock, 'dir', dir);
} else if (getDirection(normalizedBlock) !== dir) {
remove(normalizedBlock, 'dir');
}
if (isBlockElementListItem) {
var listItems = children(normalizedBlock, 'li[dir]');
each(listItems, function (listItem) {
return remove(listItem, 'dir');
});
}
});
});
editor.nodeChanged();
}
};
var register$1 = function (editor) {
editor.addCommand('mceDirectionLTR', function () {
setDir(editor, 'ltr');
});
editor.addCommand('mceDirectionRTL', function () {
setDir(editor, 'rtl');
});
};
var getNodeChangeHandler = function (editor, dir) {
return function (api) {
var nodeChangeHandler = function (e) {
var element = Element.fromDom(e.element);
var element = SugarElement.fromDom(e.element);
api.setActive(getDirection(element) === dir);
};
editor.on('NodeChange', nodeChangeHandler);
@ -247,7 +422,7 @@
};
};
};
var register$1 = function (editor) {
var register = function (editor) {
editor.ui.registry.addToggleButton('ltr', {
tooltip: 'Left to right',
icon: 'ltr',
@ -268,11 +443,11 @@
function Plugin () {
global.add('directionality', function (editor) {
register(editor);
register$1(editor);
register(editor);
});
}
Plugin();
}(window));
}());

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4,12 +4,19 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function (domGlobals) {
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$3 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var eq = function (t) {
return function (a) {
return t === a;
};
};
var isNull = eq(null);
var noop = function () {
};
@ -18,6 +25,9 @@
return value;
};
};
var identity = function (x) {
return x;
};
var never = constant(false);
var always = constant(true);
@ -25,20 +35,14 @@
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var id = identity;
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
@ -55,9 +59,9 @@
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
filter: function () {
return none();
},
toArray: function () {
return [];
},
@ -77,9 +81,6 @@
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
@ -106,14 +107,6 @@
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
@ -121,7 +114,7 @@
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
var Optional = {
some: some,
none: none,
from: from
@ -136,7 +129,7 @@
}
return false;
};
var map = function (xs, f) {
var map$1 = function (xs, f) {
var len = xs.length;
var r = new Array(len);
for (var i = 0; i < len; i++) {
@ -145,10 +138,304 @@
}
return r;
};
var each$1 = function (xs, f) {
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
f(x, i);
}
};
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
return {
get: get,
set: set
};
};
var last = function (fn, rate) {
var timer = null;
var cancel = function () {
if (!isNull(timer)) {
clearTimeout(timer);
timer = null;
}
};
var throttle = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
cancel();
timer = setTimeout(function () {
timer = null;
fn.apply(null, args);
}, rate);
};
return {
cancel: cancel,
throttle: throttle
};
};
var insertEmoticon = function (editor, ch) {
editor.insertContent(ch);
};
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var keys = Object.keys;
var hasOwnProperty = Object.hasOwnProperty;
var each = function (obj, f) {
var props = keys(obj);
for (var k = 0, len = props.length; k < len; k++) {
var i = props[k];
var x = obj[i];
f(x, i);
}
};
var map = function (obj, f) {
return tupleMap(obj, function (x, i) {
return {
k: i,
v: f(x, i)
};
});
};
var tupleMap = function (obj, f) {
var r = {};
each(obj, function (x, i) {
var tuple = f(x, i);
r[tuple.k] = tuple.v;
});
return r;
};
var has = function (obj, key) {
return hasOwnProperty.call(obj, key);
};
var shallow = function (old, nu) {
return nu;
};
var baseMerge = function (merger) {
return function () {
var objects = [];
for (var _i = 0; _i < arguments.length; _i++) {
objects[_i] = arguments[_i];
}
if (objects.length === 0) {
throw new Error('Can\'t merge zero objects');
}
var ret = {};
for (var j = 0; j < objects.length; j++) {
var curObject = objects[j];
for (var key in curObject) {
if (has(curObject, key)) {
ret[key] = merger(ret[key], curObject[key]);
}
}
}
return ret;
};
};
var merge = baseMerge(shallow);
var singleton = function (doRevoke) {
var subject = Cell(Optional.none());
var revoke = function () {
return subject.get().each(doRevoke);
};
var clear = function () {
revoke();
subject.set(Optional.none());
};
var isSet = function () {
return subject.get().isSome();
};
var get = function () {
return subject.get();
};
var set = function (s) {
revoke();
subject.set(Optional.some(s));
};
return {
clear: clear,
isSet: isSet,
get: get,
set: set
};
};
var value = function () {
var subject = singleton(noop);
var on = function (f) {
return subject.get().each(f);
};
return __assign(__assign({}, subject), { on: on });
};
var checkRange = function (str, substr, start) {
return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
};
var contains = function (str, substr) {
return str.indexOf(substr) !== -1;
};
var startsWith = function (str, prefix) {
return checkRange(str, prefix, 0);
};
var global$2 = tinymce.util.Tools.resolve('tinymce.Resource');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global = tinymce.util.Tools.resolve('tinymce.util.Promise');
var DEFAULT_ID = 'tinymce.plugins.emoticons';
var getEmoticonDatabase = function (editor) {
return editor.getParam('emoticons_database', 'emojis', 'string');
};
var getEmoticonDatabaseUrl = function (editor, pluginUrl) {
var database = getEmoticonDatabase(editor);
return editor.getParam('emoticons_database_url', pluginUrl + '/js/' + database + editor.suffix + '.js', 'string');
};
var getEmoticonDatabaseId = function (editor) {
return editor.getParam('emoticons_database_id', DEFAULT_ID, 'string');
};
var getAppendedEmoticons = function (editor) {
return editor.getParam('emoticons_append', {}, 'object');
};
var getEmotionsImageUrl = function (editor) {
return editor.getParam('emoticons_images_url', 'https://twemoji.maxcdn.com/v/13.0.1/72x72/', 'string');
};
var ALL_CATEGORY = 'All';
var categoryNameMap = {
symbols: 'Symbols',
people: 'People',
animals_and_nature: 'Animals and Nature',
food_and_drink: 'Food and Drink',
activity: 'Activity',
travel_and_places: 'Travel and Places',
objects: 'Objects',
flags: 'Flags',
user: 'User Defined'
};
var translateCategory = function (categories, name) {
return has(categories, name) ? categories[name] : name;
};
var getUserDefinedEmoticons = function (editor) {
var userDefinedEmoticons = getAppendedEmoticons(editor);
return map(userDefinedEmoticons, function (value) {
return __assign({
keywords: [],
category: 'user'
}, value);
});
};
var initDatabase = function (editor, databaseUrl, databaseId) {
var categories = value();
var all = value();
var emojiImagesUrl = getEmotionsImageUrl(editor);
var getEmoji = function (lib) {
if (startsWith(lib.char, '<img')) {
return lib.char.replace(/src="([^"]+)"/, function (match, url) {
return 'src="' + emojiImagesUrl + url + '"';
});
} else {
return lib.char;
}
};
var processEmojis = function (emojis) {
var cats = {};
var everything = [];
each(emojis, function (lib, title) {
var entry = {
title: title,
keywords: lib.keywords,
char: getEmoji(lib),
category: translateCategory(categoryNameMap, lib.category)
};
var current = cats[entry.category] !== undefined ? cats[entry.category] : [];
cats[entry.category] = current.concat([entry]);
everything.push(entry);
});
categories.set(cats);
all.set(everything);
};
editor.on('init', function () {
global$2.load(databaseId, databaseUrl).then(function (emojis) {
var userEmojis = getUserDefinedEmoticons(editor);
processEmojis(merge(emojis, userEmojis));
}, function (err) {
console.log('Failed to load emoticons: ' + err);
categories.set({});
all.set([]);
});
});
var listCategory = function (category) {
if (category === ALL_CATEGORY) {
return listAll();
}
return categories.get().bind(function (cats) {
return Optional.from(cats[category]);
}).getOr([]);
};
var listAll = function () {
return all.get().getOr([]);
};
var listCategories = function () {
return [ALL_CATEGORY].concat(keys(categories.get().getOr({})));
};
var waitForLoad = function () {
if (hasLoaded()) {
return global.resolve(true);
} else {
return new global(function (resolve, reject) {
var numRetries = 15;
var interval = global$1.setInterval(function () {
if (hasLoaded()) {
global$1.clearInterval(interval);
resolve(true);
} else {
numRetries--;
if (numRetries < 0) {
console.log('Could not load emojis from url: ' + databaseUrl);
global$1.clearInterval(interval);
reject(false);
}
}
}, 100);
});
}
};
var hasLoaded = function () {
return categories.isSet() && all.isSet();
};
return {
listCategories: listCategories,
hasLoaded: hasLoaded,
waitForLoad: waitForLoad,
listAll: listAll,
listCategory: listCategory
};
};
var emojiMatches = function (emoji, lowerCasePattern) {
return contains(emoji.title.toLowerCase(), lowerCasePattern) || exists(emoji.keywords, function (k) {
@ -180,271 +467,18 @@
return matches;
};
var init = function (editor, database) {
editor.ui.registry.addAutocompleter('emoticons', {
ch: ':',
columns: 'auto',
minChars: 2,
fetch: function (pattern, maxResults) {
return database.waitForLoad().then(function () {
var candidates = database.listAll();
return emojisFrom(candidates, pattern, Option.some(maxResults));
});
},
onAction: function (autocompleteApi, rng, value) {
editor.selection.setRng(rng);
editor.insertContent(value);
autocompleteApi.hide();
}
});
};
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
return {
get: get,
set: set
};
};
var last = function (fn, rate) {
var timer = null;
var cancel = function () {
if (timer !== null) {
domGlobals.clearTimeout(timer);
timer = null;
}
};
var throttle = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (timer !== null) {
domGlobals.clearTimeout(timer);
}
timer = domGlobals.setTimeout(function () {
fn.apply(null, args);
timer = null;
}, rate);
};
return {
cancel: cancel,
throttle: throttle
};
};
var insertEmoticon = function (editor, ch) {
editor.insertContent(ch);
};
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var hasOwnProperty = Object.prototype.hasOwnProperty;
var shallow = function (old, nu) {
return nu;
};
var baseMerge = function (merger) {
return function () {
var objects = new Array(arguments.length);
for (var i = 0; i < objects.length; i++) {
objects[i] = arguments[i];
}
if (objects.length === 0) {
throw new Error('Can\'t merge zero objects');
}
var ret = {};
for (var j = 0; j < objects.length; j++) {
var curObject = objects[j];
for (var key in curObject) {
if (hasOwnProperty.call(curObject, key)) {
ret[key] = merger(ret[key], curObject[key]);
}
}
}
return ret;
};
};
var merge = baseMerge(shallow);
var keys = Object.keys;
var hasOwnProperty$1 = Object.hasOwnProperty;
var each = function (obj, f) {
var props = keys(obj);
for (var k = 0, len = props.length; k < len; k++) {
var i = props[k];
var x = obj[i];
f(x, i);
}
};
var map$1 = function (obj, f) {
return tupleMap(obj, function (x, i) {
return {
k: i,
v: f(x, i)
};
});
};
var tupleMap = function (obj, f) {
var r = {};
each(obj, function (x, i) {
var tuple = f(x, i);
r[tuple.k] = tuple.v;
});
return r;
};
var has = function (obj, key) {
return hasOwnProperty$1.call(obj, key);
};
var global$1 = tinymce.util.Tools.resolve('tinymce.Resource');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise');
var DEFAULT_ID = 'tinymce.plugins.emoticons';
var getEmoticonDatabaseUrl = function (editor, pluginUrl) {
return editor.getParam('emoticons_database_url', pluginUrl + '/js/emojis' + editor.suffix + '.js');
};
var getEmoticonDatabaseId = function (editor) {
return editor.getParam('emoticons_database_id', DEFAULT_ID, 'string');
};
var getAppendedEmoticons = function (editor) {
return editor.getParam('emoticons_append', {}, 'object');
};
var ALL_CATEGORY = 'All';
var categoryNameMap = {
symbols: 'Symbols',
people: 'People',
animals_and_nature: 'Animals and Nature',
food_and_drink: 'Food and Drink',
activity: 'Activity',
travel_and_places: 'Travel and Places',
objects: 'Objects',
flags: 'Flags',
user: 'User Defined'
};
var translateCategory = function (categories, name) {
return has(categories, name) ? categories[name] : name;
};
var getUserDefinedEmoticons = function (editor) {
var userDefinedEmoticons = getAppendedEmoticons(editor);
return map$1(userDefinedEmoticons, function (value) {
return __assign({
keywords: [],
category: 'user'
}, value);
});
};
var initDatabase = function (editor, databaseUrl, databaseId) {
var categories = Cell(Option.none());
var all = Cell(Option.none());
var processEmojis = function (emojis) {
var cats = {};
var everything = [];
each(emojis, function (lib, title) {
var entry = {
title: title,
keywords: lib.keywords,
char: lib.char,
category: translateCategory(categoryNameMap, lib.category)
};
var current = cats[entry.category] !== undefined ? cats[entry.category] : [];
cats[entry.category] = current.concat([entry]);
everything.push(entry);
});
categories.set(Option.some(cats));
all.set(Option.some(everything));
};
editor.on('init', function () {
global$1.load(databaseId, databaseUrl).then(function (emojis) {
var userEmojis = getUserDefinedEmoticons(editor);
processEmojis(merge(emojis, userEmojis));
}, function (err) {
domGlobals.console.log('Failed to load emoticons: ' + err);
categories.set(Option.some({}));
all.set(Option.some([]));
});
});
var listCategory = function (category) {
if (category === ALL_CATEGORY) {
return listAll();
}
return categories.get().bind(function (cats) {
return Option.from(cats[category]);
}).getOr([]);
};
var listAll = function () {
return all.get().getOr([]);
};
var listCategories = function () {
return [ALL_CATEGORY].concat(keys(categories.get().getOr({})));
};
var waitForLoad = function () {
if (hasLoaded()) {
return global$3.resolve(true);
} else {
return new global$3(function (resolve, reject) {
var numRetries = 15;
var interval = global$2.setInterval(function () {
if (hasLoaded()) {
global$2.clearInterval(interval);
resolve(true);
} else {
numRetries--;
if (numRetries < 0) {
domGlobals.console.log('Could not load emojis from url: ' + databaseUrl);
global$2.clearInterval(interval);
reject(false);
}
}
}, 100);
});
}
};
var hasLoaded = function () {
return categories.get().isSome() && all.get().isSome();
};
return {
listCategories: listCategories,
hasLoaded: hasLoaded,
waitForLoad: waitForLoad,
listAll: listAll,
listCategory: listCategory
};
};
var patternName = 'pattern';
var open = function (editor, database) {
var initialState = {
pattern: '',
results: emojisFrom(database.listAll(), '', Option.some(300))
results: emojisFrom(database.listAll(), '', Optional.some(300))
};
var currentTab = Cell(ALL_CATEGORY);
var scan = function (dialogApi) {
var dialogData = dialogApi.getData();
var category = currentTab.get();
var candidates = database.listCategory(category);
var results = emojisFrom(candidates, dialogData[patternName], category === ALL_CATEGORY ? Option.some(300) : Option.none());
var results = emojisFrom(candidates, dialogData[patternName], category === ALL_CATEGORY ? Optional.some(300) : Optional.none());
dialogApi.setData({ results: results });
};
var updateFilter = last(function (dialogApi) {
@ -462,7 +496,7 @@
var getInitialState = function () {
var body = {
type: 'tabpanel',
tabs: map(database.listCategories(), function (cat) {
tabs: map$1(database.listCategories(), function (cat) {
return {
title: cat,
name: cat,
@ -533,9 +567,45 @@
}
};
var register = function (editor, database) {
var onAction = function () {
var register$1 = function (editor, database) {
editor.addCommand('mceEmoticons', function () {
return open(editor, database);
});
};
var setup = function (editor) {
editor.on('PreInit', function () {
editor.parser.addAttributeFilter('data-emoticon', function (nodes) {
each$1(nodes, function (node) {
node.attr('data-mce-resize', 'false');
node.attr('data-mce-placeholder', '1');
});
});
});
};
var init = function (editor, database) {
editor.ui.registry.addAutocompleter('emoticons', {
ch: ':',
columns: 'auto',
minChars: 2,
fetch: function (pattern, maxResults) {
return database.waitForLoad().then(function () {
var candidates = database.listAll();
return emojisFrom(candidates, pattern, Optional.some(maxResults));
});
},
onAction: function (autocompleteApi, rng, value) {
editor.selection.setRng(rng);
editor.insertContent(value);
autocompleteApi.hide();
}
});
};
var register = function (editor) {
var onAction = function () {
return editor.execCommand('mceEmoticons');
};
editor.ui.registry.addButton('emoticons', {
tooltip: 'Emoticons',
@ -550,15 +620,17 @@
};
function Plugin () {
global.add('emoticons', function (editor, pluginUrl) {
global$3.add('emoticons', function (editor, pluginUrl) {
var databaseUrl = getEmoticonDatabaseUrl(editor, pluginUrl);
var databaseId = getEmoticonDatabaseId(editor);
var database = initDatabase(editor, databaseUrl, databaseId);
register(editor, database);
register$1(editor, database);
register(editor);
init(editor, database);
setup(editor);
});
}
Plugin();
}(window));
}());

File diff suppressed because one or more lines are too long

View File

@ -4,9 +4,9 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function (domGlobals) {
(function () {
'use strict';
var Cell = function (initial) {
@ -23,7 +23,7 @@
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var __assign = function () {
__assign = Object.assign || function __assign(t) {
@ -38,13 +38,13 @@
return __assign.apply(this, arguments);
};
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$2 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
var global$3 = tinymce.util.Tools.resolve('tinymce.html.Node');
var global$1 = tinymce.util.Tools.resolve('tinymce.html.Node');
var global$4 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
var global = tinymce.util.Tools.resolve('tinymce.html.Serializer');
var shouldHideInSourceView = function (editor) {
return editor.getParam('fullpage_hide_in_source_view');
@ -70,21 +70,24 @@
var getDefaultDocType = function (editor) {
return editor.getParam('fullpage_default_doctype', '<!DOCTYPE html>');
};
var getProtect = function (editor) {
return editor.getParam('protect');
};
var parseHeader = function (head) {
var parseHeader = function (editor, head) {
return global$2({
validate: false,
root_name: '#document'
}).parse(head, { format: 'xhtml' });
}, editor.schema).parse(head, { format: 'xhtml' });
};
var htmlToData = function (editor, head) {
var headerFragment = parseHeader(head);
var headerFragment = parseHeader(editor, head);
var data = {};
var elm, matches;
function getAttr(elm, name) {
var getAttr = function (elm, name) {
var value = elm.attr(name);
return value || '';
}
};
data.fontface = getDefaultFontFamily(editor);
data.fontsize = getDefaultFontSize(editor);
elm = headerFragment.firstChild;
@ -103,7 +106,7 @@
if (elm && elm.firstChild) {
data.title = elm.firstChild.value;
}
global$1.each(headerFragment.getAll('meta'), function (meta) {
global$3.each(headerFragment.getAll('meta'), function (meta) {
var name = meta.attr('name');
var httpEquiv = meta.attr('http-equiv');
var matches;
@ -121,7 +124,7 @@
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
}
data.stylesheets = [];
global$1.each(headerFragment.getAll('link'), function (link) {
global$3.each(headerFragment.getAll('link'), function (link) {
if (link.attr('rel') === 'stylesheet') {
data.stylesheets.push(link.attr('href'));
}
@ -137,23 +140,23 @@
return data;
};
var dataToHtml = function (editor, data, head) {
var headerFragment, headElement, html, elm, value;
var headElement, elm;
var dom = editor.dom;
function setAttr(elm, name, value) {
var setAttr = function (elm, name, value) {
elm.attr(name, value ? value : undefined);
}
function addHeadNode(node) {
};
var addHeadNode = function (node) {
if (headElement.firstChild) {
headElement.insert(node, headElement.firstChild);
} else {
headElement.append(node);
}
}
headerFragment = parseHeader(head);
};
var headerFragment = parseHeader(editor, head);
headElement = headerFragment.getAll('head')[0];
if (!headElement) {
elm = headerFragment.getAll('html')[0];
headElement = new global$3('head', 1);
headElement = new global$1('head', 1);
if (elm.firstChild) {
elm.insert(headElement, elm.firstChild, true);
} else {
@ -162,12 +165,12 @@
}
elm = headerFragment.firstChild;
if (data.xml_pi) {
value = 'version="1.0"';
var value = 'version="1.0"';
if (data.docencoding) {
value += ' encoding="' + data.docencoding + '"';
}
if (elm.type !== 7) {
elm = new global$3('xml', 7);
elm = new global$1('xml', 7);
headerFragment.insert(elm, headerFragment.firstChild, true);
}
elm.value = value;
@ -177,7 +180,7 @@
elm = headerFragment.getAll('#doctype')[0];
if (data.doctype) {
if (!elm) {
elm = new global$3('#doctype', 10);
elm = new global$1('#doctype', 10);
if (data.xml_pi) {
headerFragment.insert(elm, headerFragment.firstChild);
} else {
@ -189,14 +192,14 @@
elm.remove();
}
elm = null;
global$1.each(headerFragment.getAll('meta'), function (meta) {
global$3.each(headerFragment.getAll('meta'), function (meta) {
if (meta.attr('http-equiv') === 'Content-Type') {
elm = meta;
}
});
if (data.docencoding) {
if (!elm) {
elm = new global$3('meta', 1);
elm = new global$1('meta', 1);
elm.attr('http-equiv', 'Content-Type');
elm.shortEnded = true;
addHeadNode(elm);
@ -208,16 +211,16 @@
elm = headerFragment.getAll('title')[0];
if (data.title) {
if (!elm) {
elm = new global$3('title', 1);
elm = new global$1('title', 1);
addHeadNode(elm);
} else {
elm.empty();
}
elm.append(new global$3('#text', 3)).value = data.title;
elm.append(new global$1('#text', 3)).value = data.title;
} else if (elm) {
elm.remove();
}
global$1.each('keywords,description,author,copyright,robots'.split(','), function (name) {
global$3.each('keywords,description,author,copyright,robots'.split(','), function (name) {
var nodes = headerFragment.getAll('meta');
var i, meta;
var value = data[name];
@ -233,7 +236,7 @@
}
}
if (value) {
elm = new global$3('meta', 1);
elm = new global$1('meta', 1);
elm.attr('name', name);
elm.attr('content', value);
elm.shortEnded = true;
@ -241,14 +244,14 @@
}
});
var currentStyleSheetsMap = {};
global$1.each(headerFragment.getAll('link'), function (stylesheet) {
global$3.each(headerFragment.getAll('link'), function (stylesheet) {
if (stylesheet.attr('rel') === 'stylesheet') {
currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet;
}
});
global$1.each(data.stylesheets, function (stylesheet) {
global$3.each(data.stylesheets, function (stylesheet) {
if (!currentStyleSheetsMap[stylesheet]) {
elm = new global$3('link', 1);
elm = new global$1('link', 1);
elm.attr({
rel: 'stylesheet',
text: 'text/css',
@ -259,7 +262,7 @@
}
delete currentStyleSheetsMap[stylesheet];
});
global$1.each(currentStyleSheetsMap, function (stylesheet) {
global$3.each(currentStyleSheetsMap, function (stylesheet) {
stylesheet.remove();
});
elm = headerFragment.getAll('body')[0];
@ -285,7 +288,7 @@
if (!headElement.firstChild) {
headElement.remove();
}
html = global$4({
var html = global({
validate: false,
indent: true,
indent_before: 'head,html,body,meta,title,script,link,style',
@ -359,21 +362,21 @@
initialData: initialData,
onSubmit: function (api) {
var nuData = api.getData();
var headHtml = dataToHtml(editor, global$1.extend(data, nuData), headState.get());
var headHtml = dataToHtml(editor, global$3.extend(data, nuData), headState.get());
headState.set(headHtml);
api.close();
}
});
};
var register = function (editor, headState) {
var register$1 = function (editor, headState) {
editor.addCommand('mceFullPageProperties', function () {
open(editor, headState);
});
};
var protectHtml = function (protect, html) {
global$1.each(protect, function (pattern) {
global$3.each(protect, function (pattern) {
html = html.replace(pattern, function (str) {
return '<!--mce:protected ' + escape(str) + '-->';
});
@ -386,19 +389,19 @@
});
};
var each = global$1.each;
var each = global$3.each;
var low = function (s) {
return s.replace(/<\/?[A-Z]+/g, function (a) {
return a.toLowerCase();
});
};
var handleSetContent = function (editor, headState, footState, evt) {
var startPos, endPos, content, headerFragment, styles = '';
var startPos, endPos, content, styles = '';
var dom = editor.dom;
if (evt.selection) {
return;
}
content = protectHtml(editor.settings.protect, evt.content);
content = protectHtml(getProtect(editor), evt.content);
if (evt.format === 'raw' && headState.get()) {
return;
}
@ -406,7 +409,7 @@
return;
}
if (content.length === 0 && !evt.source_view) {
content = global$1.trim(headState.get()) + '\n' + global$1.trim(content) + '\n' + global$1.trim(footState.get());
content = global$3.trim(headState.get()) + '\n' + global$3.trim(content) + '\n' + global$3.trim(footState.get());
}
content = content.replace(/<(\/?)BODY/gi, '<$1body');
startPos = content.indexOf('<body');
@ -417,13 +420,13 @@
if (endPos === -1) {
endPos = content.length;
}
evt.content = global$1.trim(content.substring(startPos + 1, endPos));
evt.content = global$3.trim(content.substring(startPos + 1, endPos));
footState.set(low(content.substring(endPos)));
} else {
headState.set(getDefaultHeader(editor));
footState.set('\n</body>\n</html>');
}
headerFragment = parseHeader(headState.get());
var headerFragment = parseHeader(editor, headState.get());
each(headerFragment.getAll('style'), function (node) {
if (node.firstChild) {
styles += node.firstChild.value;
@ -443,15 +446,15 @@
var headElm = editor.getDoc().getElementsByTagName('head')[0];
if (styles) {
var styleElm = dom.add(headElm, 'style', { id: 'fullpage_styles' });
styleElm.appendChild(domGlobals.document.createTextNode(styles));
styleElm.appendChild(document.createTextNode(styles));
}
var currentStyleSheetsMap = {};
global$1.each(headElm.getElementsByTagName('link'), function (stylesheet) {
global$3.each(headElm.getElementsByTagName('link'), function (stylesheet) {
if (stylesheet.rel === 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) {
currentStyleSheetsMap[stylesheet.href] = stylesheet;
}
});
global$1.each(headerFragment.getAll('link'), function (stylesheet) {
global$3.each(headerFragment.getAll('link'), function (stylesheet) {
var href = stylesheet.attr('href');
if (!href) {
return true;
@ -466,7 +469,7 @@
}
delete currentStyleSheetsMap[href];
});
global$1.each(currentStyleSheetsMap, function (stylesheet) {
global$3.each(currentStyleSheetsMap, function (stylesheet) {
stylesheet.parentNode.removeChild(stylesheet);
});
};
@ -497,8 +500,8 @@
return header;
};
var handleGetContent = function (editor, head, foot, evt) {
if (!evt.selection && (!evt.source_view || !shouldHideInSourceView(editor))) {
evt.content = unprotectHtml(global$1.trim(head) + '\n' + global$1.trim(evt.content) + '\n' + global$1.trim(foot));
if (evt.format === 'html' && !evt.selection && (!evt.source_view || !shouldHideInSourceView(editor))) {
evt.content = unprotectHtml(global$3.trim(head) + '\n' + global$3.trim(evt.content) + '\n' + global$3.trim(foot));
}
};
var setup = function (editor, headState, footState) {
@ -510,7 +513,7 @@
});
};
var register$1 = function (editor) {
var register = function (editor) {
editor.ui.registry.addButton('fullpage', {
tooltip: 'Metadata and document properties',
icon: 'document-properties',
@ -528,14 +531,14 @@
};
function Plugin () {
global.add('fullpage', function (editor) {
global$4.add('fullpage', function (editor) {
var headState = Cell(''), footState = Cell('');
register(editor, headState);
register$1(editor);
register$1(editor, headState);
register(editor);
setup(editor, headState, footState);
});
}
Plugin();
}(window));
}());

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
@ -23,9 +23,9 @@
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$3 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var get = function (customTabs) {
var get$1 = function (customTabs) {
var addTab = function (spec) {
var currentCustomTabs = customTabs.get();
currentCustomTabs[spec.name] = spec;
@ -34,11 +34,11 @@
return { addTab: addTab };
};
var register = function (editor, dialogOpener) {
var register$1 = function (editor, dialogOpener) {
editor.addCommand('mceHelp', dialogOpener);
};
var register$1 = function (editor, dialogOpener) {
var register = function (editor, dialogOpener) {
editor.ui.registry.addButton('help', {
icon: 'help',
tooltip: 'Help',
@ -72,6 +72,9 @@
return value;
};
};
var identity = function (x) {
return x;
};
var never = constant(false);
var always = constant(true);
@ -79,20 +82,14 @@
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var id = identity;
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
@ -109,9 +106,9 @@
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
filter: function () {
return none();
},
toArray: function () {
return [];
},
@ -131,9 +128,6 @@
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
@ -160,14 +154,6 @@
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
@ -175,7 +161,7 @@
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
var Optional = {
some: some,
none: none,
from: from
@ -211,12 +197,12 @@
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
if (pred(x, i)) {
return Option.some(x);
return Optional.some(x);
} else if (until(x, i)) {
break;
}
}
return Option.none();
return Optional.none();
};
var find = function (xs, pred) {
return findUntil(xs, pred, never);
@ -224,8 +210,8 @@
var keys = Object.keys;
var hasOwnProperty = Object.hasOwnProperty;
var get$1 = function (obj, key) {
return has(obj, key) ? Option.from(obj[key]) : Option.none();
var get = function (obj, key) {
return has(obj, key) ? Optional.from(obj[key]) : Optional.none();
};
var has = function (obj, key) {
return hasOwnProperty.call(obj, key);
@ -243,7 +229,47 @@
};
var getHelpTabs = function (editor) {
return Option.from(editor.getParam('help_tabs'));
return Optional.from(editor.getParam('help_tabs'));
};
var getForcedPlugins = function (editor) {
return editor.getParam('forced_plugins');
};
var description = '<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or &#x2325;F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or &#x2325;F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or &#x2325;F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n <li>the editor resize handle in the footer</li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or &#x2303;F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>';
var tab$3 = function () {
var body = {
type: 'htmlpanel',
presets: 'document',
html: description
};
return {
name: 'keyboardnav',
title: 'Keyboard Navigation',
items: [body]
};
};
var global$2 = tinymce.util.Tools.resolve('tinymce.Env');
var convertText = function (source) {
var mac = {
alt: '&#x2325;',
ctrl: '&#x2303;',
shift: '&#x21E7;',
meta: '&#x2318;',
access: '&#x2303;&#x2325;'
};
var other = {
meta: 'Ctrl ',
access: 'Shift + Alt '
};
var replace = global$2.mac ? mac : other;
var shortcut = source.split('+');
var updated = map(shortcut, function (segment) {
var search = segment.toLowerCase().trim();
return has(replace, search) ? replace[search] : segment;
});
return global$2.mac ? updated.join('').replace(/\s/, '') : updated.join('+');
};
var shortcuts = [
@ -276,27 +302,27 @@
},
{
shortcuts: ['Access + 1'],
action: 'Header 1'
action: 'Heading 1'
},
{
shortcuts: ['Access + 2'],
action: 'Header 2'
action: 'Heading 2'
},
{
shortcuts: ['Access + 3'],
action: 'Header 3'
action: 'Heading 3'
},
{
shortcuts: ['Access + 4'],
action: 'Header 4'
action: 'Heading 4'
},
{
shortcuts: ['Access + 5'],
action: 'Header 5'
action: 'Heading 5'
},
{
shortcuts: ['Access + 6'],
action: 'Header 6'
action: 'Heading 6'
},
{
shortcuts: ['Access + 7'],
@ -352,30 +378,7 @@
}
];
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var convertText = function (source) {
var mac = {
alt: '&#x2325;',
ctrl: '&#x2303;',
shift: '&#x21E7;',
meta: '&#x2318;',
access: '&#x2303;&#x2325;'
};
var other = {
meta: 'Ctrl ',
access: 'Shift + Alt '
};
var replace = global$1.mac ? mac : other;
var shortcut = source.split('+');
var updated = map(shortcut, function (segment) {
var search = segment.toLowerCase().trim();
return has(replace, search) ? replace[search] : segment;
});
return global$1.mac ? updated.join('').replace(/\s/, '') : updated.join('+');
};
var tab = function () {
var tab$2 = function () {
var shortcutList = map(shortcuts, function (shortcut) {
var shortcutText = map(shortcut.shortcuts, convertText).join(' or ');
return [
@ -398,9 +401,9 @@
};
};
var global$2 = tinymce.util.Tools.resolve('tinymce.util.I18n');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.I18n');
var urls = [
var urls = map([
{
key: 'advlist',
name: 'Advanced List'
@ -521,6 +524,10 @@
key: 'print',
name: 'Print'
},
{
key: 'quickbars',
name: 'Quick Toolbars'
},
{
key: 'save',
name: 'Save'
@ -569,96 +576,114 @@
key: 'wordcount',
name: 'Word Count'
},
{
key: 'advcode',
name: 'Advanced Code Editor*'
},
{
key: 'formatpainter',
name: 'Format Painter*'
},
{
key: 'powerpaste',
name: 'PowerPaste*'
},
{
key: 'tinydrive',
name: 'Tiny Drive*'
},
{
key: 'tinymcespellchecker',
name: 'Spell Checker Pro*'
},
{
key: 'a11ychecker',
name: 'Accessibility Checker*'
name: 'Accessibility Checker',
type: 'premium'
},
{
key: 'linkchecker',
name: 'Link Checker*'
},
{
key: 'mentions',
name: 'Mentions*'
},
{
key: 'mediaembed',
name: 'Enhanced Media Embed*'
},
{
key: 'checklist',
name: 'Checklist*'
},
{
key: 'casechange',
name: 'Case Change*'
},
{
key: 'permanentpen',
name: 'Permanent Pen*'
},
{
key: 'pageembed',
name: 'Page Embed*'
},
{
key: 'tinycomments',
name: 'Tiny Comments*'
key: 'advcode',
name: 'Advanced Code Editor',
type: 'premium'
},
{
key: 'advtable',
name: 'Advanced Tables*'
name: 'Advanced Tables',
type: 'premium'
},
{
key: 'autocorrect',
name: 'Autocorrect*'
name: 'Autocorrect',
type: 'premium'
},
{
key: 'casechange',
name: 'Case Change',
type: 'premium'
},
{
key: 'checklist',
name: 'Checklist',
type: 'premium'
},
{
key: 'export',
name: 'Export',
type: 'premium'
},
{
key: 'mediaembed',
name: 'Enhanced Media Embed',
type: 'premium'
},
{
key: 'formatpainter',
name: 'Format Painter',
type: 'premium'
},
{
key: 'linkchecker',
name: 'Link Checker',
type: 'premium'
},
{
key: 'mentions',
name: 'Mentions',
type: 'premium'
},
{
key: 'pageembed',
name: 'Page Embed',
type: 'premium'
},
{
key: 'permanentpen',
name: 'Permanent Pen',
type: 'premium'
},
{
key: 'powerpaste',
name: 'PowerPaste',
type: 'premium'
},
{
key: 'rtc',
name: 'Real-Time Collaboration',
type: 'premium'
},
{
key: 'tinymcespellchecker',
name: 'Spell Checker Pro',
type: 'premium'
},
{
key: 'tinycomments',
name: 'Tiny Comments',
type: 'premium',
slug: 'comments'
},
{
key: 'tinydrive',
name: 'Tiny Drive',
type: 'premium'
}
];
], function (item) {
return __assign(__assign({}, item), {
type: item.type || 'opensource',
slug: item.slug || item.key
});
});
var tab$1 = function (editor) {
var availablePlugins = function () {
var premiumPlugins = [
'Accessibility Checker',
'Advanced Code Editor',
'Advanced Tables',
'Case Change',
'Checklist',
'Tiny Comments',
'Tiny Drive',
'Enhanced Media Embed',
'Format Painter',
'Link Checker',
'Mentions',
'MoxieManager',
'Page Embed',
'Permanent Pen',
'PowerPaste',
'Spell Checker Pro'
];
var premiumPlugins = filter(urls, function (_a) {
var key = _a.key, type = _a.type;
return key !== 'autocorrect' && type === 'premium';
});
var premiumPluginList = map(premiumPlugins, function (plugin) {
return '<li>' + global$2.translate(plugin) + '</li>';
return '<li>' + global$1.translate(plugin.name) + '</li>';
}).join('');
return '<div data-mce-tabstop="1" tabindex="-1">' + '<p><b>' + global$2.translate('Premium plugins:') + '</b></p>' + '<ul>' + premiumPluginList + '<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">' + global$2.translate('Learn more...') + '</a></li>' + '</ul>' + '</div>';
return '<div data-mce-tabstop="1" tabindex="-1">' + '<p><b>' + global$1.translate('Premium plugins:') + '</b></p>' + '<ul>' + premiumPluginList + '<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">' + global$1.translate('Learn more...') + '</a></li>' + '</ul>' + '</div>';
};
var makeLink = function (p) {
return '<a href="' + p.url + '" target="_blank" rel="noopener">' + p.name + '</a>';
@ -670,16 +695,18 @@
var getMetadata = editor.plugins[key].getMetadata;
return typeof getMetadata === 'function' ? makeLink(getMetadata()) : key;
}, function (x) {
var name = x.type === 'premium' ? x.name + '*' : x.name;
return makeLink({
name: x.name,
url: 'https://www.tiny.cloud/docs/plugins/' + x.key
name: name,
url: 'https://www.tiny.cloud/docs/plugins/' + x.type + '/' + x.slug
});
});
};
var getPluginKeys = function (editor) {
var keys$1 = keys(editor.plugins);
return editor.settings.forced_plugins === undefined ? keys$1 : filter(keys$1, function (k) {
return !contains(editor.settings.forced_plugins, k);
var forced_plugins = getForcedPlugins(editor);
return forced_plugins === undefined ? keys$1 : filter(keys$1, function (k) {
return !contains(forced_plugins, k);
});
};
var pluginLister = function (editor) {
@ -689,7 +716,7 @@
});
var count = pluginLis.length;
var pluginsString = pluginLis.join('');
var html = '<p><b>' + global$2.translate([
var html = '<p><b>' + global$1.translate([
'Plugins installed ({0}):',
count
]) + '</b></p>' + '<ul>' + pluginsString + '</ul>';
@ -716,17 +743,17 @@
};
};
var global$3 = tinymce.util.Tools.resolve('tinymce.EditorManager');
var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
var tab$2 = function () {
var tab = function () {
var getVersion = function (major, minor) {
return major.indexOf('@') === 0 ? 'X.X.X' : major + '.' + minor;
};
var version = getVersion(global$3.majorVersion, global$3.minorVersion);
var changeLogLink = '<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE ' + version + '</a>';
var version = getVersion(global.majorVersion, global.minorVersion);
var changeLogLink = '<a href="https://www.tiny.cloud/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE ' + version + '</a>';
var htmlPanel = {
type: 'htmlpanel',
html: '<p>' + global$2.translate([
html: '<p>' + global$1.translate([
'You are using {0}',
changeLogLink
]) + '</p>',
@ -739,20 +766,6 @@
};
};
var description = '<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or &#x2325;F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or &#x2325;F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or &#x2325;F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or &#x2303;F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>';
var tab$3 = function () {
var body = {
type: 'htmlpanel',
presets: 'document',
html: description
};
return {
name: 'keyboardnav',
title: 'Keyboard Navigation',
items: [body]
};
};
var parseHelpTabsSetting = function (tabsFromSettings, tabs) {
var newTabs = {};
var names = map(tabsFromSettings, function (t) {
@ -785,10 +798,10 @@
};
var parseCustomTabs = function (editor, customTabs) {
var _a;
var shortcuts = tab();
var shortcuts = tab$2();
var nav = tab$3();
var plugins = tab$1(editor);
var versions = tab$2();
var versions = tab();
var tabs = __assign((_a = {}, _a[shortcuts.name] = shortcuts, _a[nav.name] = nav, _a[plugins.name] = plugins, _a[versions.name] = versions, _a), customTabs.get());
return getHelpTabs(editor).fold(function () {
return getNamesFromTabs(tabs);
@ -800,7 +813,7 @@
return function () {
var _a = parseCustomTabs(editor, customTabs), tabs = _a.tabs, names = _a.names;
var foundTabs = map(names, function (name) {
return get$1(tabs, name);
return get(tabs, name);
});
var dialogTabs = cat(foundTabs);
var body = {
@ -823,12 +836,12 @@
};
function Plugin () {
global.add('help', function (editor) {
global$3.add('help', function (editor) {
var customTabs = Cell({});
var api = get(customTabs);
var api = get$1(customTabs);
var dialogOpener = init(editor, customTabs);
register$1(editor, dialogOpener);
register(editor, dialogOpener);
register$1(editor, dialogOpener);
editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp');
return api;
});

File diff suppressed because one or more lines are too long

View File

@ -4,40 +4,39 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var register = function (editor) {
var register$1 = function (editor) {
editor.addCommand('InsertHorizontalRule', function () {
editor.execCommand('mceInsertContent', false, '<hr />');
});
};
var register$1 = function (editor) {
var register = function (editor) {
var onAction = function () {
return editor.execCommand('InsertHorizontalRule');
};
editor.ui.registry.addButton('hr', {
icon: 'horizontal-rule',
tooltip: 'Horizontal line',
onAction: function () {
return editor.execCommand('InsertHorizontalRule');
}
onAction: onAction
});
editor.ui.registry.addMenuItem('hr', {
icon: 'horizontal-rule',
text: 'Horizontal line',
onAction: function () {
return editor.execCommand('InsertHorizontalRule');
}
onAction: onAction
});
};
function Plugin () {
global.add('hr', function (editor) {
register(editor);
register$1(editor);
register(editor);
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");!function o(){n.add("hr",function(n){var o,t;(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"<hr />")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}})})}()}();
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",function(n){var o,t;function e(){return t.execCommand("InsertHorizontalRule")}(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"<hr />")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:e}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:e})})}();

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4,20 +4,40 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var typeOf = function (x) {
var t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
return 'array';
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
return 'string';
} else {
return t;
}
};
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
};
};
var isString = isType('string');
var isArray = isType('array');
var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
var shouldMergeClasses = function (editor) {
return editor.getParam('importcss_merge_classes');
@ -40,25 +60,13 @@
var getFileFilter = function (editor) {
return editor.getParam('importcss_file_filter');
};
var typeOf = function (x) {
var t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
return 'array';
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
return 'string';
} else {
return t;
}
var getSkin = function (editor) {
var skin = editor.getParam('skin');
return skin !== false ? skin || 'oxide' : false;
};
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
};
var getSkinUrl = function (editor) {
return editor.getParam('skin_url');
};
var isArray = isType('array');
var nativePush = Array.prototype.push;
var map = function (xs, f) {
@ -116,24 +124,26 @@
};
};
var internalEditorStyle = /^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/;
var removeCacheSuffix = function (url) {
var cacheSuffix = global$3.cacheSuffix;
if (typeof url === 'string') {
var cacheSuffix = global$1.cacheSuffix;
if (isString(url)) {
url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
}
return url;
};
var isSkinContentCss = function (editor, href) {
var settings = editor.settings, skin = settings.skin !== false ? settings.skin || 'oxide' : false;
var skin = getSkin(editor);
if (skin) {
var skinUrl = settings.skin_url ? editor.documentBaseURI.toAbsolute(settings.skin_url) : global$2.baseURL + '/skins/ui/' + skin;
var skinUrlBase = getSkinUrl(editor);
var skinUrl = skinUrlBase ? editor.documentBaseURI.toAbsolute(skinUrlBase) : global$2.baseURL + '/skins/ui/' + skin;
var contentSkinUrlPart = global$2.baseURL + '/skins/content/';
return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css' || href.indexOf(contentSkinUrlPart) !== -1;
}
return false;
};
var compileFilter = function (filter) {
if (typeof filter === 'string') {
if (isString(filter)) {
return function (value) {
return value.indexOf(filter) !== -1;
};
@ -144,32 +154,39 @@
}
return filter;
};
var isCssImportRule = function (rule) {
return rule.styleSheet;
};
var isCssPageRule = function (rule) {
return rule.selectorText;
};
var getSelectors = function (editor, doc, fileFilter) {
var selectors = [], contentCSSUrls = {};
function append(styleSheet, imported) {
var selectors = [];
var contentCSSUrls = {};
var append = function (styleSheet, imported) {
var href = styleSheet.href, rules;
href = removeCacheSuffix(href);
if (!href || !fileFilter(href, imported) || isSkinContentCss(editor, href)) {
return;
}
global$4.each(styleSheet.imports, function (styleSheet) {
global.each(styleSheet.imports, function (styleSheet) {
append(styleSheet, true);
});
try {
rules = styleSheet.cssRules || styleSheet.rules;
} catch (e) {
}
global$4.each(rules, function (cssRule) {
if (cssRule.styleSheet) {
global.each(rules, function (cssRule) {
if (isCssImportRule(cssRule)) {
append(cssRule.styleSheet, true);
} else if (cssRule.selectorText) {
global$4.each(cssRule.selectorText.split(','), function (selector) {
selectors.push(global$4.trim(selector));
} else if (isCssPageRule(cssRule)) {
global.each(cssRule.selectorText.split(','), function (selector) {
selectors.push(global.trim(selector));
});
}
});
}
global$4.each(editor.contentCSS, function (url) {
};
global.each(editor.contentCSS, function (url) {
contentCSSUrls[url] = true;
});
if (!fileFilter) {
@ -178,7 +195,7 @@
};
}
try {
global$4.each(doc.styleSheets, function (styleSheet) {
global.each(doc.styleSheets, function (styleSheet) {
append(styleSheet);
});
} catch (e) {
@ -193,7 +210,7 @@
}
var elementName = selector[1];
var classes = selector[2].substr(1).split('.').join(' ');
var inlineSelectorElements = global$4.makeMap('a,img');
var inlineSelectorElements = global.makeMap('a,img');
if (selector[1]) {
format = { title: selectorText };
if (editor.schema.getTextBlockElements()[elementName]) {
@ -218,20 +235,16 @@
return format;
};
var getGroupsBySelector = function (groups, selector) {
return global$4.grep(groups, function (group) {
return global.grep(groups, function (group) {
return !group.filter || group.filter(selector);
});
};
var compileUserDefinedGroups = function (groups) {
return global$4.map(groups, function (group) {
return global$4.extend({}, group, {
return global.map(groups, function (group) {
return global.extend({}, group, {
original: group,
selectors: {},
filter: compileFilter(group.filter),
item: {
text: group.title,
menu: []
}
filter: compileFilter(group.filter)
});
});
};
@ -262,7 +275,7 @@
return selectorConverter.call(plugin, selector, group);
};
var setup = function (editor) {
editor.on('init', function (_e) {
editor.on('init', function () {
var model = generate();
var globallyUniqueSelectors = {};
var selectorFilter = compileFilter(getSelectorFilter(editor));
@ -272,22 +285,22 @@
markUniqueSelector(editor, selector, group, globallyUniqueSelectors);
var format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
if (format) {
var formatName = format.name || global$1.DOM.uniqueId();
var formatName = format.name || global$3.DOM.uniqueId();
editor.formatter.register(formatName, format);
return global$4.extend({}, {
return {
title: format.title,
format: formatName
});
};
}
}
return null;
};
global$4.each(getSelectors(editor, editor.getDoc(), compileFilter(getFileFilter(editor))), function (selector) {
if (selector.indexOf('.mce-') === -1) {
global.each(getSelectors(editor, editor.getDoc(), compileFilter(getFileFilter(editor))), function (selector) {
if (!internalEditorStyle.test(selector)) {
if (!selectorFilter || selectorFilter(selector)) {
var selectorGroups = getGroupsBySelector(groups, selector);
if (selectorGroups.length > 0) {
global$4.each(selectorGroups, function (group) {
global.each(selectorGroups, function (group) {
var menuItem = processSelector(selector, group);
if (menuItem) {
model.addItemToGroup(group.title, menuItem);
@ -318,7 +331,7 @@
};
function Plugin () {
global.add('importcss', function (editor) {
global$4.add('importcss', function (editor) {
setup(editor);
return get(editor);
});

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var n,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),m=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(t){return t.getParam("importcss_selector_converter")},i=(n="array",function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}),o=Array.prototype.push,l=function(t,e){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!i(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);o.apply(e,t[r])}return e}(function(t,e){for(var r=t.length,n=new Array(r),i=0;i<r;i++){var o=t[i];n[i]=e(o,i)}return n}(t,e))},p=function(e){return"string"==typeof e?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e},_=function(c,t,a){var u=[],r={};function l(t,e){var r,n,i,o=t.href;if(n=o,i=m.cacheSuffix,"string"==typeof n&&(n=n.replace("?"+i,"").replace("&"+i,"")),(o=n)&&a(o,e)&&!function(t,e){var r=t.settings,n=!1!==r.skin&&(r.skin||"oxide");if(n){var i=r.skin_url?t.documentBaseURI.toAbsolute(r.skin_url):f.baseURL+"/skins/ui/"+n,o=f.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(o)}return!1}(c,o)){h.each(t.imports,function(t){l(t,!0)});try{r=t.cssRules||t.rules}catch(s){}h.each(r,function(t){t.styleSheet?l(t.styleSheet,!0):t.selectorText&&h.each(t.selectorText.split(","),function(t){u.push(h.trim(t))})})}}h.each(c.contentCSS,function(t){r[t]=!0}),a=a||function(t,e){return e||r[t]};try{h.each(t.styleSheets,function(t){l(t)})}catch(e){}return u},x=function(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var i=n[1],o=n[2].substr(1).split(".").join(" "),s=h.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[i]?r.block=i:t.schema.getBlockElements()[i]||s[i.toLowerCase()]?r.selector=i:r.inline=i):n[2]&&(r={inline:"span",title:e.substr(1),classes:o}),!1!==t.getParam("importcss_merge_classes")?r.classes=o:r.attributes={"class":o},r}},T=function(t,e){return null===e||!1!==t.getParam("importcss_exclusive")},r=function(y){y.on("init",function(t){var e,r,n,i,o=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return l(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]}).concat(e)}}),v={},s=p(y.getParam("importcss_selector_filter")),c=(i=y.getParam("importcss_groups"),h.map(i,function(t){return h.extend({},t,{original:t,selectors:{},filter:p(t.filter),item:{text:t.title,menu:[]}})})),a=function(t,e){if(f=t,p=v,!(T(y,m=e)?f in p:f in m.selectors)){a=t,l=v,T(y,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(o=(i=y).plugins.importcss,s=t,((c=e)&&c.selector_converter?c.selector_converter:d(i)?d(i):function(){return x(i,s)}).call(o,s,c));if(r){var n=r.name||g.DOM.uniqueId();return y.formatter.register(n,r),h.extend({},{title:r.title,format:n})}}var i,o,s,c,a,u,l,f,m,p;return null};h.each(_(y,y.getDoc(),p(y.getParam("importcss_file_filter"))),function(r){if(-1===r.indexOf(".mce-")&&(!s||s(r))){var t=(n=c,i=r,h.grep(n,function(t){return!t.filter||t.filter(i)}));if(0<t.length)h.each(t,function(t){var e=a(r,t);e&&o.addItemToGroup(t.title,e)});else{var e=a(r,null);e&&o.addItem(e)}}var n,i});var u=o.toFormats();y.fire("addStyleModifications",{items:u,replace:!y.getParam("importcss_append")})})};!function e(){t.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return x(e,t)}};var e})}()}();
!function(){"use strict";function t(n){return function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}}function y(t){return t.getParam("importcss_selector_converter")}function u(e){return l(e)?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e}function h(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var o=n[1],i=n[2].substr(1).split(".").join(" "),c=x.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[o]?r.block=o:t.schema.getBlockElements()[o]||c[o.toLowerCase()]?r.selector=o:r.inline=o):n[2]&&(r={inline:"span",title:e.substr(1),classes:i}),!1!==t.getParam("importcss_merge_classes")?r.classes=i:r.attributes={class:i},r}}function d(t,e){return null===e||!1!==t.getParam("importcss_exclusive")}function r(v){v.on("init",function(){function o(t,e){if(f=t,p=g,!(d(v,m=e)?f in p:f in m.selectors)){a=t,l=g,d(v,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(i=(o=v).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:y(o)?y(o):function(){return h(o,c)}).call(i,c,s));if(r){var n=r.name||_.DOM.uniqueId();return v.formatter.register(n,r),{title:r.title,format:n}}}var o,i,c,s,a,u,l,f,m,p;return null}var e,r,n,t,i=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!f(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);P.apply(e,t[r])}return e}(function(t,e){for(var r=t.length,n=new Array(r),o=0;o<r;o++){var i=t[o];n[o]=e(i,o)}return n}(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]})).concat(e)}}),g={},c=u(v.getParam("importcss_selector_filter")),s=(t=v.getParam("importcss_groups"),x.map(t,function(t){return x.extend({},t,{original:t,selectors:{},filter:u(t.filter)})}));x.each(function(c,t,s){var a=[],r={},u=function(t,e){var r,n,o=n=t.href,i=p.cacheSuffix;if((n=o=l(o)?o.replace("?"+i,"").replace("&"+i,""):o)&&s(n,e)&&!function(t,e){var r,n=!1!==(r=t.getParam("skin"))&&(r||"oxide");if(n){var o=t.getParam("skin_url"),i=o?t.documentBaseURI.toAbsolute(o):m.baseURL+"/skins/ui/"+n,c=m.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(c)}}(c,n)){x.each(t.imports,function(t){u(t,!0)});try{r=t.cssRules||t.rules}catch(t){}x.each(r,function(t){t.styleSheet?u(t.styleSheet,!0):t.selectorText&&x.each(t.selectorText.split(","),function(t){a.push(x.trim(t))})})}};x.each(c.contentCSS,function(t){r[t]=!0}),s=s||function(t,e){return e||r[t]};try{x.each(t.styleSheets,function(t){u(t)})}catch(t){}return a}(v,v.getDoc(),u(v.getParam("importcss_file_filter"))),function(r){var t,e,n;T.test(r)||c&&!c(r)||(n=r,0<(t=x.grep(s,function(t){return!t.filter||t.filter(n)})).length?x.each(t,function(t){var e=o(r,t);e&&i.addItemToGroup(t.title,e)}):(e=o(r,null))&&i.addItem(e))});var a=i.toFormats();v.fire("addStyleModifications",{items:a,replace:!v.getParam("importcss_append")})})}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=t("string"),f=t("array"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=tinymce.util.Tools.resolve("tinymce.EditorManager"),p=tinymce.util.Tools.resolve("tinymce.Env"),x=tinymce.util.Tools.resolve("tinymce.util.Tools"),P=Array.prototype.push,T=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/;e.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return h(e,t)}};var e})}();

View File

@ -4,12 +4,12 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var getDateFormat = function (editor) {
return editor.getParam('insertdatetime_dateformat', editor.translate('%Y-%m-%d'));
@ -47,7 +47,9 @@
return value;
};
var getDateTime = function (editor, fmt, date) {
date = date || new Date();
if (date === void 0) {
date = new Date();
}
fmt = fmt.replace('%D', '%m/%d/%Y');
fmt = fmt.replace('%r', '%I:%M:%S %p');
fmt = fmt.replace('%Y', '' + date.getFullYear());
@ -93,17 +95,15 @@
}
};
var register = function (editor) {
editor.addCommand('mceInsertDate', function () {
insertDateTime(editor, getDateFormat(editor));
var register$1 = function (editor) {
editor.addCommand('mceInsertDate', function (_ui, value) {
insertDateTime(editor, value !== null && value !== void 0 ? value : getDateFormat(editor));
});
editor.addCommand('mceInsertTime', function () {
insertDateTime(editor, getTimeFormat(editor));
editor.addCommand('mceInsertTime', function (_ui, value) {
insertDateTime(editor, value !== null && value !== void 0 ? value : getTimeFormat(editor));
});
};
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var Cell = function (initial) {
var value = initial;
var get = function () {
@ -118,9 +118,14 @@
};
};
var register$1 = function (editor) {
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
var register = function (editor) {
var formats = getFormats(editor);
var defaultFormat = Cell(getDefaultDateTime(editor));
var insertDateTime = function (format) {
return editor.execCommand('mceInsertDate', false, format);
};
editor.ui.registry.addSplitButton('insertdatetime', {
icon: 'insert-time',
tooltip: 'Insert date/time',
@ -128,7 +133,7 @@
return value === defaultFormat.get();
},
fetch: function (done) {
done(global$1.map(formats, function (format) {
done(global.map(formats, function (format) {
return {
type: 'choiceitem',
text: getDateTime(editor, format),
@ -137,24 +142,24 @@
}));
},
onAction: function (_api) {
insertDateTime(editor, defaultFormat.get());
insertDateTime(defaultFormat.get());
},
onItemAction: function (_api, value) {
defaultFormat.set(value);
insertDateTime(editor, value);
insertDateTime(value);
}
});
var makeMenuItemHandler = function (format) {
return function () {
defaultFormat.set(format);
insertDateTime(editor, format);
insertDateTime(format);
};
};
editor.ui.registry.addNestedMenuItem('insertdatetime', {
icon: 'insert-time',
text: 'Date/time',
getSubmenuItems: function () {
return global$1.map(formats, function (format) {
return global.map(formats, function (format) {
return {
type: 'menuitem',
text: getDateTime(editor, format),
@ -166,9 +171,9 @@
};
function Plugin () {
global.add('insertdatetime', function (editor) {
register(editor);
global$1.add('insertdatetime', function (editor) {
register$1(editor);
register(editor);
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},c=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),i="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),o="January February March April May June July August September October November December".split(" "),m=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},s=function(e,t,n){return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",m(n.getMonth()+1,2))).replace("%d",m(n.getDate(),2))).replace("%H",""+m(n.getHours(),2))).replace("%M",""+m(n.getMinutes(),2))).replace("%S",""+m(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(o[n.getMonth()]))).replace("%b",""+e.translate(i[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},l=function(e,t){if(e.getParam("insertdatetime_element",!1)){var n=s(e,t),r=void 0;r=/%[HMSIp]/.test(t)?s(e,"%Y-%m-%dT%H:%M"):s(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?(o=a,u=r,c=n,m=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(m,o),i.dom.remove(o),i.selection.select(m,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(s(e,t));var i,o,u,c,m},t=function(t){t.addCommand("mceInsertDate",function(){var e;l(t,(e=t).getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),t.addCommand("mceInsertTime",function(){l(t,u(t))})},d=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(n){var e,t,r,a,i=c(n),o=(a=c(r=n),e=0<a.length?a[0]:u(r),t=e,{get:function(){return t},set:function(e){t=e}});n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===o.get()},fetch:function(e){e(d.map(i,function(e){return{type:"choiceitem",text:s(n,e),value:e}}))},onAction:function(e){l(n,o.get())},onItemAction:function(e,t){o.set(t),l(n,t)}});n.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return d.map(i,function(e){return{type:"menuitem",text:s(n,e),onAction:(t=e,function(){o.set(t),l(n,t)})};var t})}})};!function p(){e.add("insertdatetime",function(e){t(e),n(e)})}()}();
!function(){"use strict";function l(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))}function s(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])}function r(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function d(e,t,n){return void 0===n&&(n=new Date),(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",r(n.getMonth()+1,2))).replace("%d",r(n.getDate(),2))).replace("%H",""+r(n.getHours(),2))).replace("%M",""+r(n.getMinutes(),2))).replace("%S",""+r(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(i[n.getDay()]))).replace("%a",""+e.translate(a[n.getDay()]))).replace("%%","%")}function p(e,t){var n,r,a,i,o,u;e.getParam("insertdatetime_element",!1)?(n=d(e,t),r=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d"),(a=e.dom.getParent(e.selection.getStart(),"time"))?(o=a,u=(i=e).dom.create("time",{datetime:r},n),o.parentNode.insertBefore(u,o),i.dom.remove(o),i.selection.select(u,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")):e.insertContent(d(e,t))}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),i="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" "),g=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",function(e){var n,r,t,a,i,o,u,c;function m(e){return r.execCommand("mceInsertDate",!1,e)}(n=e).addCommand("mceInsertDate",function(e,t){p(n,null!=t?t:n.getParam("insertdatetime_dateformat",n.translate("%Y-%m-%d")))}),n.addCommand("mceInsertTime",function(e,t){p(n,null!=t?t:l(n))}),u=s(r=e),t=0<(o=s(i=r)).length?o[0]:l(i),a=t,c={get:function(){return a},set:function(e){a=e}},r.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===c.get()},fetch:function(e){e(g.map(u,function(e){return{type:"choiceitem",text:d(r,e),value:e}}))},onAction:function(e){m(c.get())},onItemAction:function(e,t){c.set(t),m(t)}}),r.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return g.map(u,function(e){return{type:"menuitem",text:d(r,e),onAction:(t=e,function(){c.set(t),m(t)})};var t})}})})}();

View File

@ -4,14 +4,14 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
var getFontSizeFormats = function (editor) {
return editor.getParam('fontsize_formats');
@ -33,7 +33,7 @@
};
var overrideFormats = function (editor) {
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table', fontSizes = global$1.explode(getFontSizeStyleValues(editor)), schema = editor.schema;
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table', fontSizes = global.explode(getFontSizeStyleValues(editor)), schema = editor.schema;
editor.formatter.register({
alignleft: {
selector: alignElements,
@ -135,7 +135,7 @@
toggle: false,
attributes: {
size: function (vars) {
return String(global$1.inArray(fontSizes, vars.value) + 1);
return String(global.inArray(fontSizes, vars.value) + 1);
}
}
},
@ -154,13 +154,13 @@
clear_child_styles: true
}
});
global$1.each('b,i,u,strike'.split(','), function (name) {
global.each('b,i,u,strike'.split(','), function (name) {
schema.addValidElements(name + '[*]');
});
if (!schema.getElementRule('font')) {
schema.addValidElements('font[face|size|color|style]');
}
global$1.each(alignElements.split(','), function (name) {
global.each(alignElements.split(','), function (name) {
var rule = schema.getElementRule(name);
if (rule) {
if (!rule.attributes.align) {
@ -189,7 +189,7 @@
};
function Plugin () {
global.add('legacyoutput', function (editor) {
global$1.add('legacyoutput', function (editor) {
setup(editor);
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(s){var e,t,i,a;t=!1,(e=s).settings.inline_styles=t,e.getParam("fontsize_formats")||(i="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",e.settings.fontsize_formats=i),e.getParam("font_formats")||(a="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e.settings.font_formats=a),s.on("PreInit",function(){return e=s,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),a=e.schema,e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(l.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),void l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))});var e,t,i,a})};!function i(){e.add("legacyoutput",function(e){t(e)})}()}();
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("legacyoutput",function(e){var s,t;(t=s=e).settings.inline_styles=!1,t.getParam("fontsize_formats")||(t.settings.fontsize_formats="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t.getParam("font_formats")||(t.settings.font_formats="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),s.on("PreInit",function(){var e=s,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),a=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(l.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}();

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4,12 +4,12 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$9 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var __assign = function () {
__assign = Object.assign || function __assign(t) {
@ -24,6 +24,33 @@
return __assign.apply(this, arguments);
};
var typeOf = function (x) {
var t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
return 'array';
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
return 'string';
} else {
return t;
}
};
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
};
};
var isString = isType('string');
var isObject = isType('object');
var isArray = isType('array');
var isNullable = function (a) {
return a === null || a === undefined;
};
var isNonNullable = function (a) {
return !isNullable(a);
};
var noop = function () {
};
var constant = function (value) {
@ -31,6 +58,9 @@
return value;
};
};
var identity = function (x) {
return x;
};
var never = constant(false);
var always = constant(true);
@ -38,20 +68,14 @@
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var id = identity;
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
@ -68,9 +92,9 @@
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
filter: function () {
return none();
},
toArray: function () {
return [];
},
@ -90,9 +114,6 @@
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
@ -119,14 +140,6 @@
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
@ -134,35 +147,14 @@
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
var Optional = {
some: some,
none: none,
from: from
};
var typeOf = function (x) {
var t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
return 'array';
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
return 'string';
} else {
return t;
}
};
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
};
};
var isString = isType('string');
var isObject = isType('object');
var isArray = isType('array');
var nativePush = Array.prototype.push;
var each = function (xs, f) {
var each$1 = function (xs, f) {
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
f(x, i);
@ -195,7 +187,7 @@
var keys = Object.keys;
var hasOwnProperty = Object.hasOwnProperty;
var each$1 = function (obj, f) {
var each = function (obj, f) {
var props = keys(obj);
for (var k = 0, len = props.length; k < len; k++) {
var i = props[k];
@ -203,8 +195,8 @@
f(x, i);
}
};
var get = function (obj, key) {
return has(obj, key) ? Option.from(obj[key]) : Option.none();
var get$1 = function (obj, key) {
return has(obj, key) ? Optional.from(obj[key]) : Optional.none();
};
var has = function (obj, key) {
return hasOwnProperty.call(obj, key);
@ -238,11 +230,11 @@
return editor.getParam('media_dimensions', true);
};
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$8 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var global$7 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var global$3 = tinymce.util.Tools.resolve('tinymce.html.SaxParser');
var global$6 = tinymce.util.Tools.resolve('tinymce.html.SaxParser');
var getVideoScriptMatch = function (prefixes, src) {
if (prefixes) {
@ -254,26 +246,26 @@
}
};
var DOM = global$2.DOM;
var DOM$1 = global$7.DOM;
var trimPx = function (value) {
return value.replace(/px$/, '');
};
var getEphoxEmbedData = function (attrs) {
var style = attrs.map.style;
var styles = style ? DOM.parseStyle(style) : {};
var styles = style ? DOM$1.parseStyle(style) : {};
return {
type: 'ephox-embed-iri',
source: attrs.map['data-ephox-embed-iri'],
altsource: '',
poster: '',
width: get(styles, 'max-width').map(trimPx).getOr(''),
height: get(styles, 'max-height').map(trimPx).getOr('')
width: get$1(styles, 'max-width').map(trimPx).getOr(''),
height: get$1(styles, 'max-height').map(trimPx).getOr('')
};
};
var htmlToData = function (prefixes, html) {
var isEphoxEmbed = Cell(false);
var data = {};
global$3({
global$6({
validate: false,
allow_conditional_comments: true,
start: function (name, attrs) {
@ -288,7 +280,7 @@
if (!data.type) {
data.type = name;
}
data = global$1.extend(attrs.map, data);
data = global$8.extend(attrs.map, data);
}
if (name === 'script') {
var videoScript = getVideoScriptMatch(prefixes, attrs.map.src);
@ -336,16 +328,16 @@
return mime ? mime : '';
};
var global$4 = tinymce.util.Tools.resolve('tinymce.html.Schema');
var global$5 = tinymce.util.Tools.resolve('tinymce.html.Schema');
var global$5 = tinymce.util.Tools.resolve('tinymce.html.Writer');
var global$4 = tinymce.util.Tools.resolve('tinymce.html.Writer');
var DOM$1 = global$2.DOM;
var DOM = global$7.DOM;
var addPx = function (value) {
return /^[0-9.]+$/.test(value) ? value + 'px' : value;
};
var setAttributes = function (attrs, updatedAttrs) {
each$1(updatedAttrs, function (val, name) {
each(updatedAttrs, function (val, name) {
var value = '' + val;
if (attrs.map[name]) {
var i = attrs.length;
@ -372,21 +364,21 @@
};
var updateEphoxEmbed = function (data, attrs) {
var style = attrs.map.style;
var styleMap = style ? DOM$1.parseStyle(style) : {};
var styleMap = style ? DOM.parseStyle(style) : {};
styleMap['max-width'] = addPx(data.width);
styleMap['max-height'] = addPx(data.height);
setAttributes(attrs, { style: DOM$1.serializeStyle(styleMap) });
setAttributes(attrs, { style: DOM.serializeStyle(styleMap) });
};
var sources = [
'source',
'altsource'
];
var updateHtml = function (html, data, updateAll) {
var writer = global$5();
var writer = global$4();
var isEphoxEmbed = Cell(false);
var sourceCount = 0;
var hasImage;
global$3({
global$6({
validate: false,
allow_conditional_comments: true,
comment: function (text) {
@ -461,7 +453,7 @@
if (data[sources[index]]) {
var attrs = [];
attrs.map = {};
if (sourceCount < index) {
if (sourceCount <= index) {
setAttributes(attrs, {
src: data[sources[index]],
type: data[sources[index] + 'mime']
@ -484,7 +476,7 @@
}
writer.end(name);
}
}, global$4({})).parse(html);
}, global$5({})).parse(html);
return writer.getContent();
};
@ -581,14 +573,14 @@
return pattern.regex.test(url);
});
if (patterns.length > 0) {
return global$1.extend({}, patterns[0], { url: getUrl(patterns[0], url) });
return global$8.extend({}, patterns[0], { url: getUrl(patterns[0], url) });
} else {
return null;
}
};
var getIframeHtml = function (data) {
var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : '';
var allowFullscreen = data.allowfullscreen ? ' allowFullscreen="1"' : '';
return '<iframe src="' + data.source + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>';
};
var getFlashHtml = function (data) {
@ -617,9 +609,9 @@
return '<script src="' + data.source + '"></script>';
};
var dataToHtml = function (editor, dataIn) {
var data = global$1.extend({}, dataIn);
var data = global$8.extend({}, dataIn);
if (!data.source) {
global$1.extend(data, htmlToData(getScripts(editor), data.embed));
global$8.extend(data, htmlToData(getScripts(editor), data.embed));
if (!data.source) {
return '';
}
@ -639,7 +631,7 @@
if (pattern) {
data.source = pattern.url;
data.type = pattern.type;
data.allowFullscreen = pattern.allowFullscreen;
data.allowfullscreen = pattern.allowFullscreen;
data.width = data.width || String(pattern.w);
data.height = data.height || String(pattern.h);
}
@ -656,7 +648,7 @@
var videoTemplateCallback = getVideoTemplateCallback(editor);
data.width = data.width || '300';
data.height = data.height || '150';
global$1.each(data, function (value, key) {
global$8.each(data, function (value, key) {
data[key] = editor.dom.encode('' + value);
});
if (data.type === 'iframe') {
@ -673,11 +665,44 @@
}
};
var global$6 = tinymce.util.Tools.resolve('tinymce.util.Promise');
var isMediaElement = function (element) {
return element.hasAttribute('data-mce-object') || element.hasAttribute('data-ephox-embed-iri');
};
var setup$2 = function (editor) {
editor.on('click keyup touchend', function () {
var selectedNode = editor.selection.getNode();
if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) {
if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) {
selectedNode.setAttribute('data-mce-selected', '2');
}
}
});
editor.on('ObjectSelected', function (e) {
var objectType = e.target.getAttribute('data-mce-object');
if (objectType === 'script') {
e.preventDefault();
}
});
editor.on('ObjectResized', function (e) {
var target = e.target;
if (target.getAttribute('data-mce-object')) {
var html = target.getAttribute('data-mce-html');
if (html) {
html = unescape(html);
target.setAttribute('data-mce-html', escape(updateHtml(html, {
width: String(e.width),
height: String(e.height)
})));
}
}
});
};
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise');
var cache = {};
var embedPromise = function (data, dataToHtml, handler) {
return new global$6(function (res, rej) {
return new global$3(function (res, rej) {
var wrappedResolve = function (response) {
if (response.html) {
cache[data.source] = response;
@ -695,11 +720,9 @@
});
};
var defaultPromise = function (data, dataToHtml) {
return new global$6(function (res) {
res({
html: dataToHtml(data),
url: data.source
});
return global$3.resolve({
html: dataToHtml(data),
url: data.source
});
};
var loadedData = function (editor) {
@ -712,39 +735,39 @@
return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor));
};
var isCached = function (url) {
return cache.hasOwnProperty(url);
return has(cache, url);
};
var extractMeta = function (sourceInput, data) {
return get(data, sourceInput).bind(function (mainData) {
return get(mainData, 'meta');
return get$1(data, sourceInput).bind(function (mainData) {
return get$1(mainData, 'meta');
});
};
var getValue = function (data, metaData, sourceInput) {
return function (prop) {
var _a;
var getFromData = function () {
return get(data, prop);
return get$1(data, prop);
};
var getFromMetaData = function () {
return get(metaData, prop);
return get$1(metaData, prop);
};
var getNonEmptyValue = function (c) {
return get(c, 'value').bind(function (v) {
return v.length > 0 ? Option.some(v) : Option.none();
return get$1(c, 'value').bind(function (v) {
return v.length > 0 ? Optional.some(v) : Optional.none();
});
};
var getFromValueFirst = function () {
return getFromData().bind(function (child) {
return isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(function () {
return Option.from(child);
return Optional.from(child);
});
});
};
var getFromMetaFirst = function () {
return getFromMetaData().orThunk(function () {
return getFromData().bind(function (child) {
return isObject(child) ? getNonEmptyValue(child) : Option.from(child);
return isObject(child) ? getNonEmptyValue(child) : Optional.from(child);
});
});
};
@ -753,13 +776,13 @@
};
var getDimensions = function (data, metaData) {
var dimensions = {};
get(data, 'dimensions').each(function (dims) {
each([
get$1(data, 'dimensions').each(function (dims) {
each$1([
'width',
'height'
], function (prop) {
get(metaData, prop).orThunk(function () {
return get(dims, prop);
get$1(metaData, prop).orThunk(function () {
return get$1(dims, prop);
}).each(function (value) {
return dimensions[prop] = value;
});
@ -774,15 +797,15 @@
};
var wrap = function (data) {
var wrapped = __assign(__assign({}, data), {
source: { value: get(data, 'source').getOr('') },
altsource: { value: get(data, 'altsource').getOr('') },
poster: { value: get(data, 'poster').getOr('') }
source: { value: get$1(data, 'source').getOr('') },
altsource: { value: get$1(data, 'altsource').getOr('') },
poster: { value: get$1(data, 'poster').getOr('') }
});
each([
each$1([
'width',
'height'
], function (prop) {
get(data, prop).each(function (value) {
get$1(data, prop).each(function (value) {
var dimensions = wrapped.dimensions || {};
dimensions[prop] = value;
wrapped.dimensions = dimensions;
@ -802,9 +825,6 @@
var snippetToData = function (editor, embedSnippet) {
return htmlToData(getScripts(editor), embedSnippet);
};
var isMediaElement = function (element) {
return element.getAttribute('data-mce-object') || element.getAttribute('data-ephox-embed-iri');
};
var getEditorData = function (editor) {
var element = editor.selection.getNode();
var snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : '';
@ -824,7 +844,7 @@
};
};
var selectPlaceholder = function (editor, beforeObjects) {
var afterObjects = editor.dom.select('img[data-mce-object]');
var afterObjects = editor.dom.select('*[data-mce-object]');
for (var i = 0; i < beforeObjects.length; i++) {
for (var y = afterObjects.length - 1; y >= 0; y--) {
if (beforeObjects[i] === afterObjects[y]) {
@ -835,7 +855,7 @@
editor.selection.select(afterObjects[0]);
};
var handleInsert = function (editor, html) {
var beforeObjects = editor.dom.select('img[data-mce-object]');
var beforeObjects = editor.dom.select('*[data-mce-object]');
editor.insertContent(html);
selectPlaceholder(editor, beforeObjects);
editor.nodeChanged();
@ -978,41 +998,49 @@
});
};
var get$1 = function (editor) {
var get = function (editor) {
var showDialog$1 = function () {
showDialog(editor);
};
return { showDialog: showDialog$1 };
};
var register = function (editor) {
var register$1 = function (editor) {
var showDialog$1 = function () {
showDialog(editor);
};
editor.addCommand('mceMedia', showDialog$1);
};
var global$7 = tinymce.util.Tools.resolve('tinymce.html.Node');
var global$2 = tinymce.util.Tools.resolve('tinymce.html.Node');
var global$8 = tinymce.util.Tools.resolve('tinymce.Env');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var global = tinymce.util.Tools.resolve('tinymce.html.DomParser');
var sanitize = function (editor, html) {
if (shouldFilterHtml(editor) === false) {
return html;
}
var writer = global$5();
var writer = global$4();
var blocked;
global$3({
global$6({
validate: false,
allow_conditional_comments: false,
comment: function (text) {
writer.comment(text);
if (!blocked) {
writer.comment(text);
}
},
cdata: function (text) {
writer.cdata(text);
if (!blocked) {
writer.cdata(text);
}
},
text: function (text, raw) {
writer.text(text, raw);
if (!blocked) {
writer.text(text, raw);
}
},
start: function (name, attrs, empty) {
blocked = true;
@ -1038,32 +1066,63 @@
}
writer.end(name);
}
}, global$4({})).parse(html);
}, global$5({})).parse(html);
return writer.getContent();
};
var createPlaceholderNode = function (editor, node) {
var placeHolder;
var isLiveEmbedNode = function (node) {
var name = node.name;
placeHolder = new global$7('img', 1);
return name === 'iframe' || name === 'video' || name === 'audio';
};
var getDimension = function (node, styles, dimension, defaultValue) {
if (defaultValue === void 0) {
defaultValue = null;
}
var value = node.attr(dimension);
if (isNonNullable(value)) {
return value;
} else if (!has(styles, dimension)) {
return defaultValue;
} else {
return null;
}
};
var setDimensions = function (node, previewNode, styles) {
var useDefaults = previewNode.name === 'img' || node.name === 'video';
var defaultWidth = useDefaults ? '300' : null;
var fallbackHeight = node.name === 'audio' ? '30' : '150';
var defaultHeight = useDefaults ? fallbackHeight : null;
previewNode.attr({
width: getDimension(node, styles, 'width', defaultWidth),
height: getDimension(node, styles, 'height', defaultHeight)
});
};
var appendNodeContent = function (editor, nodeName, previewNode, html) {
var newNode = global({
forced_root_block: false,
validate: false
}, editor.schema).parse(html, { context: nodeName });
while (newNode.firstChild) {
previewNode.append(newNode.firstChild);
}
};
var createPlaceholderNode = function (editor, node) {
var name = node.name;
var placeHolder = new global$2('img', 1);
placeHolder.shortEnded = true;
retainAttributesAndInnerHtml(editor, node, placeHolder);
setDimensions(node, placeHolder, {});
placeHolder.attr({
'width': node.attr('width') || '300',
'height': node.attr('height') || (name === 'audio' ? '30' : '150'),
'style': node.attr('style'),
'src': global$8.transparentSrc,
'src': global$1.transparentSrc,
'data-mce-object': name,
'class': 'mce-object mce-object-' + name
});
return placeHolder;
};
var createPreviewIframeNode = function (editor, node) {
var previewWrapper;
var previewNode;
var shimNode;
var createPreviewNode = function (editor, node) {
var name = node.name;
previewWrapper = new global$7('span', 1);
var previewWrapper = new global$2('span', 1);
previewWrapper.attr({
'contentEditable': 'false',
'style': node.attr('style'),
@ -1071,33 +1130,49 @@
'class': 'mce-preview-object mce-object-' + name
});
retainAttributesAndInnerHtml(editor, node, previewWrapper);
previewNode = new global$7(name, 1);
var styles = editor.dom.parseStyle(node.attr('style'));
var previewNode = new global$2(name, 1);
setDimensions(node, previewNode, styles);
previewNode.attr({
src: node.attr('src'),
allowfullscreen: node.attr('allowfullscreen'),
style: node.attr('style'),
class: node.attr('class'),
width: node.attr('width'),
height: node.attr('height'),
frameborder: '0'
class: node.attr('class')
});
shimNode = new global$7('span', 1);
if (name === 'iframe') {
previewNode.attr({
allowfullscreen: node.attr('allowfullscreen'),
frameborder: '0'
});
} else {
var attrs = [
'controls',
'crossorigin',
'currentTime',
'loop',
'muted',
'poster',
'preload'
];
each$1(attrs, function (attrName) {
previewNode.attr(attrName, node.attr(attrName));
});
var sanitizedHtml = previewWrapper.attr('data-mce-html');
if (isNonNullable(sanitizedHtml)) {
appendNodeContent(editor, name, previewNode, unescape(sanitizedHtml));
}
}
var shimNode = new global$2('span', 1);
shimNode.attr('class', 'mce-shim');
previewWrapper.append(previewNode);
previewWrapper.append(shimNode);
return previewWrapper;
};
var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) {
var attrName;
var attrValue;
var attribs;
var ai;
var innerHtml;
attribs = sourceNode.attributes;
ai = attribs.length;
var attribs = sourceNode.attributes;
var ai = attribs.length;
while (ai--) {
attrName = attribs[ai].name;
attrValue = attribs[ai].value;
var attrName = attribs[ai].name;
var attrValue = attribs[ai].value;
if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') {
if (attrName === 'data' || attrName === 'src') {
attrValue = editor.convertURL(attrValue, attrName);
@ -1105,7 +1180,7 @@
targetNode.attr('data-mce-p-' + attrName, attrValue);
}
}
innerHtml = sourceNode.firstChild && sourceNode.firstChild.value;
var innerHtml = sourceNode.firstChild && sourceNode.firstChild.value;
if (innerHtml) {
targetNode.attr('data-mce-html', escape(sanitize(editor, innerHtml)));
targetNode.firstChild = null;
@ -1150,9 +1225,9 @@
node.attr('height', videoScript.height.toString());
}
}
if (node.name === 'iframe' && hasLiveEmbeds(editor) && global$8.ceFalse) {
if (isLiveEmbedNode(node) && hasLiveEmbeds(editor) && global$1.ceFalse) {
if (!isWithinEmbedWrapper(node)) {
node.replace(createPreviewIframeNode(editor, node));
node.replace(createPreviewNode(editor, node));
}
} else {
if (!isWithinEmbedWrapper(node)) {
@ -1163,14 +1238,14 @@
};
};
var setup = function (editor) {
var setup$1 = function (editor) {
editor.on('preInit', function () {
var specialElements = editor.schema.getSpecialElements();
global$1.each('video audio iframe object'.split(' '), function (name) {
global$8.each('video audio iframe object'.split(' '), function (name) {
specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
});
var boolAttrs = editor.schema.getBoolAttrs();
global$1.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) {
global$8.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) {
boolAttrs[name] = {};
});
editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', placeHolderConverter(editor));
@ -1190,7 +1265,7 @@
continue;
}
realElmName = node.attr(name);
realElm = new global$7(realElmName, 1);
realElm = new global$2(realElmName, 1);
if (realElmName !== 'audio' && realElmName !== 'script') {
className = node.attr('class');
if (className && className.indexOf('mce-preview-object') !== -1) {
@ -1219,7 +1294,7 @@
}
innerHtml = node.attr('data-mce-html');
if (innerHtml) {
innerNode = new global$7('#text', 3);
innerNode = new global$2('#text', 3);
innerNode.raw = true;
innerNode.value = sanitize(editor, unescape(innerHtml));
realElm.append(innerNode);
@ -1238,7 +1313,7 @@
});
};
var setup$1 = function (editor) {
var setup = function (editor) {
editor.on('ResolveName', function (e) {
var name;
if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) {
@ -1247,72 +1322,35 @@
});
};
var setup$2 = function (editor) {
editor.on('click keyup touchend', function () {
var selectedNode = editor.selection.getNode();
if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) {
if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) {
selectedNode.setAttribute('data-mce-selected', '2');
}
}
});
editor.on('ObjectSelected', function (e) {
var objectType = e.target.getAttribute('data-mce-object');
if (objectType === 'audio' || objectType === 'script') {
e.preventDefault();
}
});
editor.on('ObjectResized', function (e) {
var target = e.target;
var html;
if (target.getAttribute('data-mce-object')) {
html = target.getAttribute('data-mce-html');
if (html) {
html = unescape(html);
target.setAttribute('data-mce-html', escape(updateHtml(html, {
width: String(e.width),
height: String(e.height)
})));
}
}
});
};
var stateSelectorAdapter = function (editor, selector) {
return function (buttonApi) {
return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind;
var register = function (editor) {
var onAction = function () {
return editor.execCommand('mceMedia');
};
};
var register$1 = function (editor) {
editor.ui.registry.addToggleButton('media', {
tooltip: 'Insert/edit media',
icon: 'embed',
onAction: function () {
editor.execCommand('mceMedia');
},
onSetup: stateSelectorAdapter(editor, [
'img[data-mce-object]',
'span[data-mce-object]',
'div[data-ephox-embed-iri]'
])
onAction: onAction,
onSetup: function (buttonApi) {
var selection = editor.selection;
buttonApi.setActive(isMediaElement(selection.getNode()));
return selection.selectorChangedWithUnbind('img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]', buttonApi.setActive).unbind;
}
});
editor.ui.registry.addMenuItem('media', {
icon: 'embed',
text: 'Media...',
onAction: function () {
editor.execCommand('mceMedia');
}
onAction: onAction
});
};
function Plugin () {
global.add('media', function (editor) {
register(editor);
global$9.add('media', function (editor) {
register$1(editor);
setup$1(editor);
register(editor);
setup(editor);
setup$1(editor);
setup$2(editor);
return get$1(editor);
return get(editor);
});
}

File diff suppressed because one or more lines are too long

View File

@ -4,12 +4,12 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var getKeyboardSpaces = function (editor) {
var spaces = editor.getParam('nonbreaking_force_tab', 0);
@ -47,19 +47,19 @@
});
};
var register = function (editor) {
var register$1 = function (editor) {
editor.addCommand('mceNonBreaking', function () {
insertNbsp(editor, 1);
});
};
var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK');
var global = tinymce.util.Tools.resolve('tinymce.util.VK');
var setup = function (editor) {
var spaces = getKeyboardSpaces(editor);
if (spaces > 0) {
editor.on('keydown', function (e) {
if (e.keyCode === global$1.TAB && !e.isDefaultPrevented()) {
if (e.keyCode === global.TAB && !e.isDefaultPrevented()) {
if (e.shiftKey) {
return;
}
@ -71,27 +71,26 @@
}
};
var register$1 = function (editor) {
var register = function (editor) {
var onAction = function () {
return editor.execCommand('mceNonBreaking');
};
editor.ui.registry.addButton('nonbreaking', {
icon: 'non-breaking',
tooltip: 'Nonbreaking space',
onAction: function () {
return editor.execCommand('mceNonBreaking');
}
onAction: onAction
});
editor.ui.registry.addMenuItem('nonbreaking', {
icon: 'non-breaking',
text: 'Nonbreaking space',
onAction: function () {
return editor.execCommand('mceNonBreaking');
}
onAction: onAction
});
};
function Plugin () {
global.add('nonbreaking', function (editor) {
register(editor);
global$1.add('nonbreaking', function (editor) {
register$1(editor);
register(editor);
setup(editor);
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n,e){for(var a="",o=0;o<e;o++)a+=n;return a},r=function(n,e){var a,o=n.getParam("nonbreaking_wrap",!0,"boolean")||n.plugins.visualchars?'<span class="'+((a=n).plugins.visualchars&&a.plugins.visualchars.isEnabled()?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+i("&nbsp;",e)+"</span>":i("&nbsp;",e);n.undoManager.transact(function(){return n.insertContent(o)})},c=tinymce.util.Tools.resolve("tinymce.util.VK");!function e(){n.add("nonbreaking",function(n){var e,a,o,i,t;(e=n).addCommand("mceNonBreaking",function(){r(e,1)}),(a=n).ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:function(){return a.execCommand("mceNonBreaking")}}),a.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:function(){return a.execCommand("mceNonBreaking")}}),0<(t="boolean"==typeof(i=(o=n).getParam("nonbreaking_force_tab",0))?!0===i?3:0:i)&&o.on("keydown",function(n){if(n.keyCode===c.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),r(o,t)}})})}()}();
!function(){"use strict";function o(n,e){for(var a="",o=0;o<e;o++)a+=n;return a}function s(n,e){var a=n.getParam("nonbreaking_wrap",!0,"boolean")||n.plugins.visualchars?'<span class="'+(n.plugins.visualchars&&n.plugins.visualchars.isEnabled()?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+o("&nbsp;",e)+"</span>":o("&nbsp;",e);n.undoManager.transact(function(){return n.insertContent(a)})}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.VK");n.add("nonbreaking",function(n){var e,a,o,t,i;function r(){return a.execCommand("mceNonBreaking")}(e=n).addCommand("mceNonBreaking",function(){s(e,1)}),(a=n).ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:r}),a.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:r}),0<(i="boolean"==typeof(t=(o=n).getParam("nonbreaking_force_tab",0))?!0===t?3:0:t)&&o.on("keydown",function(n){n.keyCode!==c.TAB||n.isDefaultPrevented()||n.shiftKey||(n.preventDefault(),n.stopImmediatePropagation(),s(o,i))})})}();

View File

@ -4,14 +4,14 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
var getNonEditableClass = function (editor) {
return editor.getParam('noneditable_noneditable_class', 'mceNonEditable');
@ -63,10 +63,9 @@
e.content = content;
};
var setup = function (editor) {
var editClass, nonEditClass;
var contentEditableAttrName = 'contenteditable';
editClass = ' ' + global$1.trim(getEditableClass(editor)) + ' ';
nonEditClass = ' ' + global$1.trim(getNonEditableClass(editor)) + ' ';
var editClass = ' ' + global.trim(getEditableClass(editor)) + ' ';
var nonEditClass = ' ' + global.trim(getNonEditableClass(editor)) + ' ';
var hasEditClass = hasClass(editClass);
var hasNonEditClass = hasClass(nonEditClass);
var nonEditableRegExps = getNonEditableRegExps(editor);
@ -108,7 +107,7 @@
};
function Plugin () {
global.add('noneditable', function (editor) {
global$1.add('noneditable', function (editor) {
setup(editor);
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},f=function(n){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(n)}},s=function(i,o,c){return function(t){var n=arguments,e=n[n.length-2],r=0<e?o.charAt(e-1):"";if('"'===r)return t;if(">"===r){var a=o.lastIndexOf("<",e);if(-1!==a)if(-1!==o.substring(a,e).indexOf('contenteditable="false"'))return t}return'<span class="'+c+'" data-mce-content="'+i.dom.encode(n[0])+'">'+i.dom.encode("string"==typeof n[1]?n[1]:n[0])+"</span>"}},n=function(n){var t,e,r="contenteditable";t=" "+l.trim(n.getParam("noneditable_editable_class","mceEditable"))+" ",e=" "+l.trim(u(n))+" ";var a,i=f(t),o=f(e),c=(a=n.getParam("noneditable_regexp",[]))&&a.constructor===RegExp?[a]:a;n.on("PreInit",function(){0<c.length&&n.on("BeforeSetContent",function(t){!function(t,n,e){var r=n.length,a=e.content;if("raw"!==e.format){for(;r--;)a=a.replace(n[r],s(t,a,u(t)));e.content=a}}(n,c,t)}),n.parser.addAttributeFilter("class",function(t){for(var n,e=t.length;e--;)n=t[e],i(n)?n.attr(r,"true"):o(n)&&n.attr(r,"false")}),n.serializer.addAttributeFilter(r,function(t){for(var n,e=t.length;e--;)n=t[e],(i(n)||o(n))&&(0<c.length&&n.attr("data-mce-content")?(n.name="#text",n.type=3,n.raw=!0,n.value=n.attr("data-mce-content")):n.attr(r,null))})})};!function e(){t.add("noneditable",function(t){n(t)})}()}();
!function(){"use strict";function l(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")}function u(e){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(e)}}function e(e){var t,r="contenteditable",n=" "+f.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",a=" "+f.trim(l(e))+" ",i=u(n),o=u(a),c=(t=e.getParam("noneditable_regexp",[]))&&t.constructor===RegExp?[t]:t;e.on("PreInit",function(){0<c.length&&e.on("BeforeSetContent",function(t){!function(t,e,n){var r=e.length,a=n.content;if("raw"!==n.format){for(;r--;)a=a.replace(e[r],function(i,o,c){return function(t){var e=arguments,n=e[e.length-2],r=0<n?o.charAt(n-1):"";if('"'===r)return t;if(">"===r){var a=o.lastIndexOf("<",n);if(-1!==a&&-1!==o.substring(a,n).indexOf('contenteditable="false"'))return t}return'<span class="'+c+'" data-mce-content="'+i.dom.encode(e[0])+'">'+i.dom.encode("string"==typeof e[1]?e[1]:e[0])+"</span>"}}(t,a,l(t)));n.content=a}}(e,c,t)}),e.parser.addAttributeFilter("class",function(t){for(var e,n=t.length;n--;)e=t[n],i(e)?e.attr(r,"true"):o(e)&&e.attr(r,"false")}),e.serializer.addAttributeFilter(r,function(t){for(var e,n=t.length;n--;)e=t[n],(i(e)||o(e))&&(0<c.length&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(r,null))})})}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools");t.add("noneditable",function(t){e(t)})}();

View File

@ -4,14 +4,14 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var global = tinymce.util.Tools.resolve('tinymce.Env');
var getSeparatorHtml = function (editor) {
return editor.getParam('pagebreak_separator', '<!-- pagebreak -->');
@ -20,19 +20,21 @@
return editor.getParam('pagebreak_split_block', false);
};
var getPageBreakClass = function () {
return 'mce-pagebreak';
var pageBreakClass = 'mce-pagebreak';
var getPlaceholderHtml = function (shouldSplitBlock) {
var html = '<img src="' + global.transparentSrc + '" class="' + pageBreakClass + '" data-mce-resize="false" data-mce-placeholder />';
return shouldSplitBlock ? '<p>' + html + '</p>' : html;
};
var getPlaceholderHtml = function () {
return '<img src="' + global$1.transparentSrc + '" class="' + getPageBreakClass() + '" data-mce-resize="false" data-mce-placeholder />';
};
var setup = function (editor) {
var setup$1 = function (editor) {
var separatorHtml = getSeparatorHtml(editor);
var shouldSplitBlock$1 = function () {
return shouldSplitBlock(editor);
};
var pageBreakSeparatorRegExp = new RegExp(separatorHtml.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function (a) {
return '\\' + a;
}), 'gi');
editor.on('BeforeSetContent', function (e) {
e.content = e.content.replace(pageBreakSeparatorRegExp, getPlaceholderHtml());
e.content = e.content.replace(pageBreakSeparatorRegExp, getPlaceholderHtml(shouldSplitBlock$1()));
});
editor.on('PreInit', function () {
editor.serializer.addNodeFilter('img', function (nodes) {
@ -40,9 +42,9 @@
while (i--) {
node = nodes[i];
className = node.attr('class');
if (className && className.indexOf('mce-pagebreak') !== -1) {
if (className && className.indexOf(pageBreakClass) !== -1) {
var parentNode = node.parent;
if (editor.schema.getBlockElements()[parentNode.name] && shouldSplitBlock(editor)) {
if (editor.schema.getBlockElements()[parentNode.name] && shouldSplitBlock$1()) {
parentNode.type = 3;
parentNode.value = separatorHtml;
parentNode.raw = true;
@ -58,47 +60,42 @@
});
};
var register = function (editor) {
var register$1 = function (editor) {
editor.addCommand('mcePageBreak', function () {
if (editor.settings.pagebreak_split_block) {
editor.insertContent('<p>' + getPlaceholderHtml() + '</p>');
} else {
editor.insertContent(getPlaceholderHtml());
}
editor.insertContent(getPlaceholderHtml(shouldSplitBlock(editor)));
});
};
var setup$1 = function (editor) {
var setup = function (editor) {
editor.on('ResolveName', function (e) {
if (e.target.nodeName === 'IMG' && editor.dom.hasClass(e.target, getPageBreakClass())) {
if (e.target.nodeName === 'IMG' && editor.dom.hasClass(e.target, pageBreakClass)) {
e.name = 'pagebreak';
}
});
};
var register$1 = function (editor) {
var register = function (editor) {
var onAction = function () {
return editor.execCommand('mcePageBreak');
};
editor.ui.registry.addButton('pagebreak', {
icon: 'page-break',
tooltip: 'Page break',
onAction: function () {
return editor.execCommand('mcePageBreak');
}
onAction: onAction
});
editor.ui.registry.addMenuItem('pagebreak', {
text: 'Page break',
icon: 'page-break',
onAction: function () {
return editor.execCommand('mcePageBreak');
}
onAction: onAction
});
};
function Plugin () {
global.add('pagebreak', function (editor) {
register(editor);
global$1.add('pagebreak', function (editor) {
register$1(editor);
setup(editor);
register(editor);
setup$1(editor);
setup(editor);
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),c=function(){return"mce-pagebreak"},g=function(){return'<img src="'+a.transparentSrc+'" class="'+c()+'" data-mce-resize="false" data-mce-placeholder />'};!function n(){e.add("pagebreak",function(e){var a,n,o,i,t,r;(a=e).addCommand("mcePageBreak",function(){a.settings.pagebreak_split_block?a.insertContent("<p>"+g()+"</p>"):a.insertContent(g())}),(n=e).ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return n.execCommand("mcePageBreak")}}),n.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return n.execCommand("mcePageBreak")}}),i=(o=e).getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e"),t=new RegExp(i.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),o.on("BeforeSetContent",function(e){e.content=e.content.replace(t,g())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var a,n,t=e.length;t--;)if((n=(a=e[t]).attr("class"))&&-1!==n.indexOf("mce-pagebreak")){var r=a.parent;if(o.schema.getBlockElements()[r.name]&&o.getParam("pagebreak_split_block",!1)){r.type=3,r.value=i,r.raw=!0,a.remove();continue}a.type=3,a.value=i,a.raw=!0}})}),(r=e).on("ResolveName",function(e){"IMG"===e.target.nodeName&&r.dom.hasClass(e.target,c())&&(e.name="pagebreak")})})}()}();
!function(){"use strict";function u(e){return e.getParam("pagebreak_split_block",!1)}function l(e){var a='<img src="'+n.transparentSrc+'" class="'+m+'" data-mce-resize="false" data-mce-placeholder />';return e?"<p>"+a+"</p>":a}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),m="mce-pagebreak";e.add("pagebreak",function(e){var a,n,o,i,t,r;function c(){return n.execCommand("mcePageBreak")}function g(){return u(o)}(a=e).addCommand("mcePageBreak",function(){a.insertContent(l(u(a)))}),(n=e).ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:c}),n.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:c}),i=(o=e).getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e"),t=new RegExp(i.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),o.on("BeforeSetContent",function(e){e.content=e.content.replace(t,l(g()))}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var a,n,t,r=e.length;r--;)(t=(n=e[r]).attr("class"))&&-1!==t.indexOf(m)&&(a=n.parent,o.schema.getBlockElements()[a.name]&&g()?(a.type=3,a.value=i,a.raw=!0,n.remove()):(n.type=3,n.value=i,n.raw=!0))})}),(r=e).on("ResolveName",function(e){"IMG"===e.target.nodeName&&r.dom.hasClass(e.target,m)&&(e.name="pagebreak")})})}();

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4,47 +4,63 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
var getContentStyle = function (editor) {
return editor.getParam('content_style', '');
return editor.getParam('content_style', '', 'string');
};
var shouldUseContentCssCors = function (editor) {
return editor.getParam('content_css_cors', false, 'boolean');
};
var global$2 = tinymce.util.Tools.resolve('tinymce.Env');
var getBodyClassByHash = function (editor) {
var bodyClass = editor.getParam('body_class', '', 'hash');
return bodyClass[editor.id] || '';
};
var getBodyClass = function (editor) {
var bodyClass = editor.getParam('body_class', '', 'string');
if (bodyClass.indexOf('=') === -1) {
return bodyClass;
} else {
return getBodyClassByHash(editor);
}
};
var getBodyIdByHash = function (editor) {
var bodyId = editor.getParam('body_id', '', 'hash');
return bodyId[editor.id] || bodyId;
};
var getBodyId = function (editor) {
var bodyId = editor.getParam('body_id', 'tinymce', 'string');
if (bodyId.indexOf('=') === -1) {
return bodyId;
} else {
return getBodyIdByHash(editor);
}
};
var getPreviewHtml = function (editor) {
var headHtml = '';
var encode = editor.dom.encode;
var contentStyle = getContentStyle(editor);
headHtml += '<base href="' + encode(editor.documentBaseURI.getURI()) + '">';
var cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : '';
global.each(editor.contentCSS, function (url) {
headHtml += '<link type="text/css" rel="stylesheet" href="' + encode(editor.documentBaseURI.toAbsolute(url)) + '"' + cors + '>';
});
if (contentStyle) {
headHtml += '<style type="text/css">' + contentStyle + '</style>';
}
var cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : '';
global$1.each(editor.contentCSS, function (url) {
headHtml += '<link type="text/css" rel="stylesheet" href="' + encode(editor.documentBaseURI.toAbsolute(url)) + '"' + cors + '>';
});
var bodyId = editor.settings.body_id || 'tinymce';
if (bodyId.indexOf('=') !== -1) {
bodyId = editor.getParam('body_id', '', 'hash');
bodyId = bodyId[editor.id] || bodyId;
}
var bodyClass = editor.settings.body_class || '';
if (bodyClass.indexOf('=') !== -1) {
bodyClass = editor.getParam('body_class', '', 'hash');
bodyClass = bodyClass[editor.id] || '';
}
var isMetaKeyPressed = global$2.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey';
var bodyId = getBodyId(editor);
var bodyClass = getBodyClass(editor);
var isMetaKeyPressed = global$1.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey';
var preventClicksOnLinksScript = '<script>' + 'document.addEventListener && document.addEventListener("click", function(e) {' + 'for (var elm = e.target; elm; elm = elm.parentNode) {' + 'if (elm.nodeName === "A" && !(' + isMetaKeyPressed + ')) {' + 'e.preventDefault();' + '}' + '}' + '}, false);' + '</script> ';
var directionality = editor.getBody().dir;
var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
@ -76,33 +92,32 @@
dataApi.focus('close');
};
var register = function (editor) {
var register$1 = function (editor) {
editor.addCommand('mcePreview', function () {
open(editor);
});
};
var register$1 = function (editor) {
var register = function (editor) {
var onAction = function () {
return editor.execCommand('mcePreview');
};
editor.ui.registry.addButton('preview', {
icon: 'preview',
tooltip: 'Preview',
onAction: function () {
return editor.execCommand('mcePreview');
}
onAction: onAction
});
editor.ui.registry.addMenuItem('preview', {
icon: 'preview',
text: 'Preview',
onAction: function () {
return editor.execCommand('mcePreview');
}
onAction: onAction
});
};
function Plugin () {
global.add('preview', function (editor) {
register(editor);
global$2.add('preview', function (editor) {
register$1(editor);
register(editor);
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=tinymce.util.Tools.resolve("tinymce.Env"),i=function(e){var t=function(t){var n="",i=t.dom.encode,e=t.getParam("content_style","");n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>");var o=t.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"";l.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'"'+o+">"});var r=t.settings.body_id||"tinymce";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_id","","hash"))[t.id]||r);var a=t.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=t.getParam("body_class","","hash"))[t.id]||"");var c='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(m.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",s=t.getBody().dir,d=s?' dir="'+i(s)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(r)+'" class="mce-content-body '+i(a)+'"'+d+">"+t.getContent()+c+"</body></html>"}(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")};!function t(){e.add("preview",function(e){var t,n;(t=e).addCommand("mcePreview",function(){i(t)}),(n=e).ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:function(){return n.execCommand("mcePreview")}}),n.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:function(){return n.execCommand("mcePreview")}})})}()}();
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.Env"),w=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("preview",function(e){var n,t;function i(){return t.execCommand("mcePreview")}(n=e).addCommand("mcePreview",function(){var e,t;t=function(t){var n="",i=t.dom.encode,e=t.getParam("content_style","","string");n+='<base href="'+i(t.documentBaseURI.getURI())+'">';var o=t.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"";w.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'"'+o+">"}),e&&(n+='<style type="text/css">'+e+"</style>");var a,r,s,c,d,l,m,y=-1===(c=(a=t).getParam("body_id","tinymce","string")).indexOf("=")?c:(s=(r=a).getParam("body_id","","hash"))[r.id]||s,u=-1===(m=(d=t).getParam("body_class","","string")).indexOf("=")?m:(l=d).getParam("body_class","","hash")[l.id]||"",v='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(f.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",g=t.getBody().dir,p=g?' dir="'+i(g)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(y)+'" class="mce-content-body '+i(u)+'"'+p+">"+t.getContent()+v+"</body></html>"}(e=n),e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")}),(t=e).ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:i}),t.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:i})})}();

View File

@ -4,18 +4,18 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var global = tinymce.util.Tools.resolve('tinymce.Env');
var register = function (editor) {
var register$1 = function (editor) {
editor.addCommand('mcePrint', function () {
if (global$1.browser.isIE()) {
if (global.browser.isIE()) {
editor.getDoc().execCommand('print', false, null);
} else {
editor.getWin().print();
@ -23,27 +23,26 @@
});
};
var register$1 = function (editor) {
var register = function (editor) {
var onAction = function () {
return editor.execCommand('mcePrint');
};
editor.ui.registry.addButton('print', {
icon: 'print',
tooltip: 'Print',
onAction: function () {
return editor.execCommand('mcePrint');
}
onAction: onAction
});
editor.ui.registry.addMenuItem('print', {
text: 'Print...',
icon: 'print',
onAction: function () {
return editor.execCommand('mcePrint');
}
onAction: onAction
});
};
function Plugin () {
global.add('print', function (editor) {
register(editor);
global$1.add('print', function (editor) {
register$1(editor);
register(editor);
editor.addShortcut('Meta+P', '', 'mcePrint');
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env");!function t(){n.add("print",function(n){var t,i;(t=n).addCommand("mcePrint",function(){e.browser.isIE()?t.getDoc().execCommand("print",!1,null):t.getWin().print()}),(i=n).ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return i.execCommand("mcePrint")}}),i.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return i.execCommand("mcePrint")}}),n.addShortcut("Meta+P","","mcePrint")})}()}();
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.Env");n.add("print",function(n){var t,i;function e(){return i.execCommand("mcePrint")}(t=n).addCommand("mcePrint",function(){r.browser.isIE()?t.getDoc().execCommand("print",!1,null):t.getWin().print()}),(i=n).ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:e}),i.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:e}),n.addShortcut("Meta+P","","mcePrint")})}();

View File

@ -4,12 +4,12 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function (domGlobals) {
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$3 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var unique = 0;
var generate = function (prefix) {
@ -21,12 +21,11 @@
};
var createTableHtml = function (cols, rows) {
var x, y, html;
html = '<table data-mce-id="mce" style="width: 100%">';
var html = '<table data-mce-id="mce" style="width: 100%">';
html += '<tbody>';
for (y = 0; y < rows; y++) {
for (var y = 0; y < rows; y++) {
html += '<tr>';
for (x = 0; x < cols; x++) {
for (var x = 0; x < cols; x++) {
html += '<td><br></td>';
}
html += '</tr>';
@ -41,11 +40,10 @@
};
var insertTableHtml = function (editor, cols, rows) {
editor.undoManager.transact(function () {
var tableElm, cellElm;
editor.insertContent(createTableHtml(cols, rows));
tableElm = getInsertedElement(editor);
var tableElm = getInsertedElement(editor);
tableElm.removeAttribute('data-mce-id');
cellElm = editor.dom.select('td,th', tableElm);
var cellElm = editor.dom.select('td,th', tableElm);
editor.selection.setCursorLocation(cellElm[0], 0);
});
};
@ -53,18 +51,17 @@
editor.plugins.table ? editor.plugins.table.insertTable(cols, rows) : insertTableHtml(editor, cols, rows);
};
var insertBlob = function (editor, base64, blob) {
var blobCache, blobInfo;
blobCache = editor.editorUpload.blobCache;
blobInfo = blobCache.create(generate('mceu'), blob, base64);
var blobCache = editor.editorUpload.blobCache;
var blobInfo = blobCache.create(generate('mceu'), blob, base64);
blobCache.add(blobInfo);
editor.insertContent(editor.dom.createHTML('img', { src: blobInfo.blobUri() }));
};
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Promise');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Promise');
var blobToBase64 = function (blob) {
return new global$1(function (resolve) {
var reader = new domGlobals.FileReader();
return new global$2(function (resolve) {
var reader = new FileReader();
reader.onloadend = function () {
resolve(reader.result.split(',')[1]);
};
@ -72,20 +69,20 @@
});
};
var global$2 = tinymce.util.Tools.resolve('tinymce.Env');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global = tinymce.util.Tools.resolve('tinymce.util.Delay');
var pickFile = function (editor) {
return new global$1(function (resolve) {
var fileInput = domGlobals.document.createElement('input');
return new global$2(function (resolve) {
var fileInput = document.createElement('input');
fileInput.type = 'file';
fileInput.accept = 'image/*';
fileInput.style.position = 'fixed';
fileInput.style.left = '0';
fileInput.style.top = '0';
fileInput.style.opacity = '0.001';
domGlobals.document.body.appendChild(fileInput);
document.body.appendChild(fileInput);
var changeHandler = function (e) {
resolve(Array.prototype.slice.call(e.target.files));
};
@ -95,8 +92,8 @@
resolve([]);
fileInput.parentNode.removeChild(fileInput);
};
if (global$2.os.isAndroid() && e.type !== 'remove') {
global$3.setEditorTimeout(editor, cleanup, 0);
if (global$1.os.isAndroid() && e.type !== 'remove') {
global.setEditorTimeout(editor, cleanup, 0);
} else {
cleanup();
}
@ -131,169 +128,6 @@
});
};
var noop = function () {
};
var constant = function (value) {
return function () {
return value;
};
};
var never = constant(false);
var always = constant(true);
var none = function () {
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
getOrThunk: call,
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
},
getOrNull: constant(null),
getOrUndefined: constant(undefined),
or: id,
orThunk: call,
map: none,
each: noop,
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
toArray: function () {
return [];
},
toString: constant('none()')
};
return me;
}();
var some = function (a) {
var constant_a = constant(a);
var self = function () {
return me;
};
var bind = function (f) {
return f(a);
};
var me = {
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
getOrThunk: constant_a,
getOrDie: constant_a,
getOrNull: constant_a,
getOrUndefined: constant_a,
or: self,
orThunk: self,
map: function (f) {
return some(f(a));
},
each: function (f) {
f(a);
},
bind: bind,
exists: bind,
forall: bind,
filter: function (f) {
return f(a) ? me : NONE;
},
toArray: function () {
return [a];
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
};
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
some: some,
none: none,
from: from
};
var fromHtml = function (html, scope) {
var doc = scope || domGlobals.document;
var div = doc.createElement('div');
div.innerHTML = html;
if (!div.hasChildNodes() || div.childNodes.length > 1) {
domGlobals.console.error('HTML does not have a single root node', html);
throw new Error('HTML must have a single root node');
}
return fromDom(div.childNodes[0]);
};
var fromTag = function (tag, scope) {
var doc = scope || domGlobals.document;
var node = doc.createElement(tag);
return fromDom(node);
};
var fromText = function (text, scope) {
var doc = scope || domGlobals.document;
var node = doc.createTextNode(text);
return fromDom(node);
};
var fromDom = function (node) {
if (node === null || node === undefined) {
throw new Error('Node cannot be null or undefined');
}
return { dom: constant(node) };
};
var fromPoint = function (docElm, x, y) {
var doc = docElm.dom();
return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
};
var Element = {
fromHtml: fromHtml,
fromTag: fromTag,
fromText: fromText,
fromDom: fromDom,
fromPoint: fromPoint
};
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
var ELEMENT = 1;
var name = function (element) {
var r = element.dom().nodeName;
return r.toLowerCase();
};
var typeOf = function (x) {
var t = typeof x;
if (x === null) {
@ -328,14 +162,160 @@
var isUndefined = eq(undefined);
var isFunction = isSimpleType('function');
var noop = function () {
};
var constant = function (value) {
return function () {
return value;
};
};
var identity = function (x) {
return x;
};
var never = constant(false);
var always = constant(true);
var none = function () {
return NONE;
};
var NONE = function () {
var call = function (thunk) {
return thunk();
};
var id = identity;
var me = {
fold: function (n, _s) {
return n();
},
isSome: never,
isNone: always,
getOr: id,
getOrThunk: call,
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
},
getOrNull: constant(null),
getOrUndefined: constant(undefined),
or: id,
orThunk: call,
map: none,
each: noop,
bind: none,
exists: never,
forall: always,
filter: function () {
return none();
},
toArray: function () {
return [];
},
toString: constant('none()')
};
return me;
}();
var some = function (a) {
var constant_a = constant(a);
var self = function () {
return me;
};
var bind = function (f) {
return f(a);
};
var me = {
fold: function (n, s) {
return s(a);
},
isSome: always,
isNone: never,
getOr: constant_a,
getOrThunk: constant_a,
getOrDie: constant_a,
getOrNull: constant_a,
getOrUndefined: constant_a,
or: self,
orThunk: self,
map: function (f) {
return some(f(a));
},
each: function (f) {
f(a);
},
bind: bind,
exists: bind,
forall: bind,
filter: function (f) {
return f(a) ? me : NONE;
},
toArray: function () {
return [a];
},
toString: function () {
return 'some(' + a + ')';
}
};
return me;
};
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Optional = {
some: some,
none: none,
from: from
};
function ClosestOrAncestor (is, ancestor, scope, a, isRoot) {
return is(scope, a) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot);
if (is(scope, a)) {
return Optional.some(scope);
} else if (isFunction(isRoot) && isRoot(scope)) {
return Optional.none();
} else {
return ancestor(scope, a, isRoot);
}
}
var ELEMENT$1 = ELEMENT;
var ELEMENT = 1;
var fromHtml = function (html, scope) {
var doc = scope || document;
var div = doc.createElement('div');
div.innerHTML = html;
if (!div.hasChildNodes() || div.childNodes.length > 1) {
console.error('HTML does not have a single root node', html);
throw new Error('HTML must have a single root node');
}
return fromDom(div.childNodes[0]);
};
var fromTag = function (tag, scope) {
var doc = scope || document;
var node = doc.createElement(tag);
return fromDom(node);
};
var fromText = function (text, scope) {
var doc = scope || document;
var node = doc.createTextNode(text);
return fromDom(node);
};
var fromDom = function (node) {
if (node === null || node === undefined) {
throw new Error('Node cannot be null or undefined');
}
return { dom: node };
};
var fromPoint = function (docElm, x, y) {
return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
};
var SugarElement = {
fromHtml: fromHtml,
fromTag: fromTag,
fromText: fromText,
fromDom: fromDom,
fromPoint: fromPoint
};
var is = function (element, selector) {
var dom = element.dom();
if (dom.nodeType !== ELEMENT$1) {
var dom = element.dom;
if (dom.nodeType !== ELEMENT) {
return false;
} else {
var elem = dom;
@ -353,37 +333,44 @@
}
};
var ancestor = function (scope, predicate, isRoot) {
var element = scope.dom();
var stop = isFunction(isRoot) ? isRoot : constant(false);
typeof window !== 'undefined' ? window : Function('return this;')();
var name = function (element) {
var r = element.dom.nodeName;
return r.toLowerCase();
};
var ancestor$1 = function (scope, predicate, isRoot) {
var element = scope.dom;
var stop = isFunction(isRoot) ? isRoot : never;
while (element.parentNode) {
element = element.parentNode;
var el = Element.fromDom(element);
var el = SugarElement.fromDom(element);
if (predicate(el)) {
return Option.some(el);
return Optional.some(el);
} else if (stop(el)) {
break;
}
}
return Option.none();
return Optional.none();
};
var closest = function (scope, predicate, isRoot) {
var closest$1 = function (scope, predicate, isRoot) {
var is = function (s, test) {
return test(s);
};
return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot);
return ClosestOrAncestor(is, ancestor$1, scope, predicate, isRoot);
};
var ancestor$1 = function (scope, selector, isRoot) {
return ancestor(scope, function (e) {
var ancestor = function (scope, selector, isRoot) {
return ancestor$1(scope, function (e) {
return is(e, selector);
}, isRoot);
};
var closest$1 = function (scope, selector, isRoot) {
var closest = function (scope, selector, isRoot) {
var is$1 = function (element, selector) {
return is(element, selector);
};
return ClosestOrAncestor(is$1, ancestor$1, scope, selector, isRoot);
return ClosestOrAncestor(is$1, ancestor, scope, selector, isRoot);
};
var validDefaultOrDie = function (value, predicate) {
@ -423,23 +410,21 @@
return getToolbarItemsOr(editor, 'quickbars_image_toolbar', 'alignleft aligncenter alignright');
};
var addToEditor = function (editor) {
var addToEditor$1 = function (editor) {
var insertToolbarItems = getInsertToolbarItems(editor);
if (insertToolbarItems.trim().length > 0) {
editor.ui.registry.addContextToolbar('quickblock', {
predicate: function (node) {
var sugarNode = Element.fromDom(node);
var sugarNode = SugarElement.fromDom(node);
var textBlockElementsMap = editor.schema.getTextBlockElements();
var isRoot = function (elem) {
return elem.dom() === editor.getBody();
return elem.dom === editor.getBody();
};
return closest$1(sugarNode, 'table', isRoot).fold(function () {
return closest(sugarNode, function (elem) {
return name(elem) in textBlockElementsMap && editor.dom.isEmpty(elem.dom());
return closest(sugarNode, 'table', isRoot).fold(function () {
return closest$1(sugarNode, function (elem) {
return name(elem) in textBlockElementsMap && editor.dom.isEmpty(elem.dom);
}, isRoot).isSome();
}, function () {
return false;
});
}, never);
},
items: insertToolbarItems,
position: 'line',
@ -448,7 +433,7 @@
}
};
var addToEditor$1 = function (editor) {
var addToEditor = function (editor) {
var isEditable = function (node) {
return editor.dom.getContentEditableParent(node) !== 'false';
};
@ -477,13 +462,13 @@
};
function Plugin () {
global.add('quickbars', function (editor) {
global$3.add('quickbars', function (editor) {
setupButtons(editor);
addToEditor(editor);
addToEditor$1(editor);
addToEditor(editor);
});
}
Plugin();
}(window));
}());

File diff suppressed because one or more lines are too long

View File

@ -4,16 +4,16 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
var enableWhenDirty = function (editor) {
return editor.getParam('save_enablewhendirty', true);
@ -32,8 +32,7 @@
});
};
var save = function (editor) {
var formObj;
formObj = global$1.DOM.getParent(editor.id, 'form');
var formObj = global$1.DOM.getParent(editor.id, 'form');
if (enableWhenDirty(editor) && !editor.isDirty()) {
return;
}
@ -58,7 +57,7 @@
}
};
var cancel = function (editor) {
var h = global$2.trim(editor.startContent);
var h = global.trim(editor.startContent);
if (hasOnCancelCallback(editor)) {
editor.execCallback('save_oncancelcallback', editor);
return;
@ -66,7 +65,7 @@
editor.resetContent(h);
};
var register = function (editor) {
var register$1 = function (editor) {
editor.addCommand('mceSave', function () {
save(editor);
});
@ -80,13 +79,14 @@
var handler = function () {
api.setDisabled(enableWhenDirty(editor) && !editor.isDirty());
};
handler();
editor.on('NodeChange dirty', handler);
return function () {
return editor.off('NodeChange dirty', handler);
};
};
};
var register$1 = function (editor) {
var register = function (editor) {
editor.ui.registry.addButton('save', {
icon: 'save',
tooltip: 'Save',
@ -109,9 +109,9 @@
};
function Plugin () {
global.add('save', function (editor) {
register$1(editor);
global$2.add('save', function (editor) {
register(editor);
register$1(editor);
});
}

View File

@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
* Version: 5.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(e){return e.getParam("save_enablewhendirty",!0)},c=function(e,n){e.notificationManager.open({text:n,type:"error"})},t=function(t){t.addCommand("mceSave",function(){!function(e){var n;if(n=o.DOM.getParent(e.id,"form"),!i(e)||e.isDirty()){if(e.save(),e.getParam("save_onsavecallback"))return e.execCallback("save_onsavecallback",e),e.nodeChanged();n?(e.setDirty(!1),n.onsubmit&&!n.onsubmit()||("function"==typeof n.submit?n.submit():c(e,"Error: Form submit field collision.")),e.nodeChanged()):c(e,"Error: No form element found.")}}(t)}),t.addCommand("mceCancel",function(){var e,n;e=t,n=a.trim(e.startContent),e.getParam("save_oncancelcallback")?e.execCallback("save_oncancelcallback",e):e.resetContent(n)})},r=function(t){return function(e){var n=function(){e.setDisabled(i(t)&&!t.isDirty())};return t.on("NodeChange dirty",n),function(){return t.off("NodeChange dirty",n)}}};!function n(){e.add("save",function(e){var n;(n=e).ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:r(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:r(n)}),n.addShortcut("Meta+S","","mceSave"),t(e)})}()}();
!function(){"use strict";function o(e){return e.getParam("save_enablewhendirty",!0)}function a(e,n){e.notificationManager.open({text:n,type:"error"})}function t(t){t.addCommand("mceSave",function(){!function(e){var n=c.DOM.getParent(e.id,"form");if(!o(e)||e.isDirty()){if(e.save(),e.getParam("save_onsavecallback"))return e.execCallback("save_onsavecallback",e),e.nodeChanged();n?(e.setDirty(!1),n.onsubmit&&!n.onsubmit()||("function"==typeof n.submit?n.submit():a(e,"Error: Form submit field collision.")),e.nodeChanged()):a(e,"Error: No form element found.")}}(t)}),t.addCommand("mceCancel",function(){var e=t,n=r.trim(e.startContent);e.getParam("save_oncancelcallback")?e.execCallback("save_oncancelcallback",e):e.resetContent(n)})}function i(t){return function(e){function n(){e.setDisabled(o(t)&&!t.isDirty())}return n(),t.on("NodeChange dirty",n),function(){return t.off("NodeChange dirty",n)}}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),r=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("save",function(e){var n;(n=e).ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:i(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:i(n)}),n.addShortcut("Meta+S","","mceSave"),t(e)})}();

Some files were not shown because too many files have changed in this diff Show More