Changed source root directory
@@ -0,0 +1 @@
|
||||
div[data-type="tadv/classic-paragraph"].is-selected .block-library-classic__toolbar,div[data-type="tadv/classic-paragraph"].is-typing .block-library-classic__toolbar,div[data-type="tadv/classic-paragraph"] div.mce-toolbar-grp{border-color:rgba(66,88,99,.35)}div[data-type="tadv/classic-paragraph"] .block-library-classic__toolbar:empty{display:none}div[data-type="tadv/classic-paragraph"].is-selected .block-library-classic__toolbar,div[data-type="tadv/classic-paragraph"].is-typing .block-library-classic__toolbar{display:block;z-index:31}
|
||||
@@ -0,0 +1 @@
|
||||
.tadv-mark-icon{background-color:#fff9c0;background-clip:content-box}
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){var e={};function o(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=1)}([,function(t,e,o){"use strict";o.r(e);const r=window.tadvBlockButtons||{},{wp:n}=window,{RichTextToolbarButton:a}=n.blockEditor,{registerFormatType:c,removeFormat:i}=n.richText,{createElement:l}=n.element,{ToolbarButton:u}=n.components,s=r.strRemoveFormatting||"Clear formatting";let m;function d(t){const e=[];return m||(m=r.formats_to_remove?r.formats_to_remove.split(","):["core/bold","core/italic","core/code","core/underline","core/strikethrough","core/text-color","tadv/sup","tadv/sub","tadv/mark","tadv/color-panel","tadv/background-color-panel"]),t.forEach(t=>{t&&t.forEach(t=>{m.indexOf(t.type)>-1&&-1===e.indexOf(t.type)&&e.push(t.type)})}),e}const{wp:f}=window,v=window.tadvBlockButtons||{},{createElement:p,Fragment:h}=f.element,{__:g}=f.i18n,{ToolbarButton:b}=f.components,{RichTextToolbarButton:y,RichTextShortcut:w}=f.blockEditor,{Path:k,SVG:x}=f.components,{registerFormatType:T,getActiveFormat:F,toggleFormat:_,applyFormat:O,removeFormat:B}=f.richText,E=p(x,{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",className:"dashicon tadv-mark-icon"},p(k,{"aria-hidden":"true",role:"img",focusable:"false",width:"20",height:"20",d:"M13.23 15h1.9L11 4H9L5 15h1.88l1.07-3h4.18zm-1.53-4.54H8.51L10 5.6z"})),P=v.strMark;function j(t,e,o){e(_(t,{type:"tadv/mark"})),o&&o()}const{wp:S}=window,{select:C}=S.data,{registerPlugin:M}=S.plugins,N=["tadv/mark","tadv/removeformat"],A={"tadv/mark":function(){T("tadv/mark",{title:P,tagName:"mark",className:null,edit({value:t,onChange:e,onFocus:o,isActive:r}){const n=p(y,{title:P,icon:E,onClick:()=>j(t,e,o),className:"tadv-icon-button-mark",isActive:r,shortcutType:"access",shortcutCharacter:"m"});return p(h,null,p(w,{type:"access",character:"m",onUse:()=>j(t,e)}),n)}})},"tadv/removeformat":function(){c("tadv/removeformat",{title:s,tagName:"u",className:"remove-format",edit:({value:t,onChange:e,onFocus:o,isActive:r})=>l(a,{icon:"editor-removeformatting",title:s,onClick:()=>e(function(t){let e=t.formats;if(!e.length)return t;let o=0,r=e.length;t.end>t.start&&(o=t.start,r=t.end,e=e.slice(o,r));const n=d(e);return n.length?(n.forEach(e=>{t=i(t,e,o,r)}),t):t}(t)),isActive:null})})}};M("tadv-add-toolbar-buttons",{render:()=>(N.forEach(t=>{A.hasOwnProperty(t)&&!function(t){const e=C("core/rich-text").getFormatTypes();let o=!1;return e.forEach(e=>{e.name===t&&(o=!0)}),o}(t)&&A[t].call(null)}),null)})}]);
|
||||
@@ -0,0 +1 @@
|
||||
div[data-type="core/freeform"].is-selected .block-library-classic__toolbar,div[data-type="core/freeform"].is-typing .block-library-classic__toolbar{z-index:31}.block-library-classic__toolbar .mce-btn .mce-txt{font-size:13px;color:#454545}.mce-tinymce-inline .mce-menubar>div,.mce-tinymce-inline .mce-toolbar .mce-btn-group>div{white-space:normal}div.mce-menubar,div.mce-menubar *{box-sizing:border-box}.block-library-classic__toolbar .mce-menubar{padding:1px}.block-library-classic__toolbar .mce-menubar .mce-menubtn button span{font-size:13px}.block-library-classic__toolbar .mce-menubar i.mce-caret{margin-top:.4em}.block-library-classic__toolbar .mce-menubar .mce-flow-layout-item{margin:2px 0}div.mce-menubar.mce-toolbar .mce-btn button{padding:3px 4px 2px}div.mce-menubar{border-color:#e5e5e5;background:#fff;border-width:0 0 1px}div.mce-menubar .mce-menubtn:focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}div.mce-menu-item-sep:hover,div.mce-menu .mce-menu-item-sep{border-bottom:1px solid #ddd;height:0;margin:5px 0}div.mce-menubtn span{margin-right:0;padding-left:3px}div.mce-menu-has-icons i.mce-ico:before{margin-left:0}div.mce-menu-has-icons i.mce-ico{line-height:18px;width:18px;height:18px}.wp-core-ui .mce-menu-item .mce-text{font-size:13px}.block-library-classic__toolbar .mce-menubar .mce-menubtn.mce-active,.block-library-classic__toolbar .mce-menubar .mce-menubtn:focus,.block-library-classic__toolbar .mce-menubar .mce-menubtn:hover{border-color:transparent}.block-library-classic__toolbar .mce-menubar .mce-menubtn.mce-active span,.block-library-classic__toolbar .mce-menubar .mce-menubtn:focus span,.block-library-classic__toolbar .mce-menubar .mce-menubtn:hover span{color:#000}.mce-inline-toolbar-grp div.wp-link-input{margin:2px 4px}.mce-inline-toolbar-grp div.wp-link-input input{padding:4px}div.mce-menu-item.mce-menu-item-preview.mce-active:hover,div.mce-menu .mce-menu-item-normal.mce-active,div.mce-menu .mce-menu-item-preview.mce-active,div.mce-menu .mce-menu-item.mce-selected,div.mce-menu .mce-menu-item:focus,div.mce-menu .mce-menu-item:hover{background:#0073aa;color:#fff}div.mce-menu-item.mce-active .mce-menu-shortcut,div.mce-menu-item.mce-disabled:hover .mce-ico,div.mce-menu-item.mce-disabled:hover .mce-text,div.mce-menu-item.mce-menu-item-preview.mce-active .mce-ico,div.mce-menu-item.mce-menu-item-preview.mce-active .mce-text,div.mce-menu-item:focus .mce-ico,div.mce-menu-item:focus .mce-menu-shortcut,div.mce-menu-item:focus .mce-text,div.mce-menu-item:hover .mce-ico,div.mce-menu-item:hover .mce-menu-shortcut,div.mce-menu-item:hover .mce-text{color:inherit}div.mce-menu .mce-menu-item.mce-disabled{cursor:default}div.mce-menu .mce-menu-item.mce-disabled:hover{background:#ccc}div.mce-inline-toolbar-grp .mce-btn.mce-active:hover button,div.mce-inline-toolbar-grp .mce-btn.mce-active:hover i,div.mce-inline-toolbar-grp .mce-btn.mce-active button,div.mce-inline-toolbar-grp .mce-btn.mce-active i,div.mce-inline-toolbar-grp .mce-btn:hover button,div.mce-inline-toolbar-grp .mce-btn:hover i,div.mce-toolbar-grp .mce-btn.mce-active:hover button,div.mce-toolbar-grp .mce-btn.mce-active:hover i,div.mce-toolbar-grp .mce-btn.mce-active button,div.mce-toolbar-grp .mce-btn.mce-active i,div.mce-toolbar-grp .mce-btn:hover button,div.mce-toolbar-grp .mce-btn:hover i{color:#191e23}div.mce-inline-toolbar-grp .mce-btn i,div.mce-toolbar-grp .mce-btn i{font-style:normal}div.mce-toolbar-grp .mce-btn i.mce-ico{font-size:20px}div.mce-widget.mce-tooltip .mce-tooltip-inner{font-size:13px;opacity:1}.mce-inline-toolbar-grp.mce-panel .mce-toolbar .mce-btn{margin:1px}.mce-inline-toolbar-grp.mce-panel .mce-toolbar .mce-btn button{padding:3px}.wp-block-freeform.block-library-rich-text__tinymce table{width:100%}.components-button.has-icon.tadv-icon-button .dashicon{margin:0}
|
||||
160
html/wp-content/plugins/tinymce-advanced/mce/advlist/plugin.js
Normal file
@@ -0,0 +1,160 @@
|
||||
(function () {
|
||||
var advlist = (function () {
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var applyListFormat = function (editor, listName, styleValue) {
|
||||
var cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList';
|
||||
editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue });
|
||||
};
|
||||
var Actions = { applyListFormat: applyListFormat };
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('ApplyUnorderedListStyle', function (ui, value) {
|
||||
Actions.applyListFormat(editor, 'UL', value['list-style-type']);
|
||||
});
|
||||
editor.addCommand('ApplyOrderedListStyle', function (ui, value) {
|
||||
Actions.applyListFormat(editor, 'OL', value['list-style-type']);
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
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(/[ ,]/) : [];
|
||||
};
|
||||
var getBulletStyles = function (editor) {
|
||||
var styles = editor.getParam('advlist_bullet_styles', 'default,circle,disc,square');
|
||||
return styles ? styles.split(/[ ,]/) : [];
|
||||
};
|
||||
var Settings = {
|
||||
getNumberStyles: getNumberStyles,
|
||||
getBulletStyles: getBulletStyles
|
||||
};
|
||||
|
||||
var isChildOfBody = function (editor, elm) {
|
||||
return editor.$.contains(editor.getBody(), elm);
|
||||
};
|
||||
var isTableCellNode = function (node) {
|
||||
return node && /^(TH|TD)$/.test(node.nodeName);
|
||||
};
|
||||
var isListNode = function (editor) {
|
||||
return function (node) {
|
||||
return node && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node);
|
||||
};
|
||||
};
|
||||
var getSelectedStyleType = function (editor) {
|
||||
var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
|
||||
return editor.dom.getStyle(listElm, 'listStyleType') || '';
|
||||
};
|
||||
var ListUtils = {
|
||||
isTableCellNode: isTableCellNode,
|
||||
isListNode: isListNode,
|
||||
getSelectedStyleType: getSelectedStyleType
|
||||
};
|
||||
|
||||
var styleValueToText = function (styleValue) {
|
||||
return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function (chr) {
|
||||
return chr.toUpperCase();
|
||||
});
|
||||
};
|
||||
var toMenuItems = function (styles) {
|
||||
return global$1.map(styles, function (styleValue) {
|
||||
var text = styleValueToText(styleValue);
|
||||
var data = styleValue === 'default' ? '' : styleValue;
|
||||
return {
|
||||
text: text,
|
||||
data: data
|
||||
};
|
||||
});
|
||||
};
|
||||
var ListStyles = { toMenuItems: toMenuItems };
|
||||
|
||||
var findIndex = function (list, predicate) {
|
||||
for (var index = 0; index < list.length; index++) {
|
||||
var element = list[index];
|
||||
if (predicate(element)) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
var listState = function (editor, listName) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
editor.on('NodeChange', function (e) {
|
||||
var tableCellIndex = findIndex(e.parents, ListUtils.isTableCellNode);
|
||||
var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
|
||||
var lists = global$1.grep(parents, ListUtils.isListNode(editor));
|
||||
ctrl.active(lists.length > 0 && lists[0].nodeName === listName);
|
||||
});
|
||||
};
|
||||
};
|
||||
var updateSelection = function (editor) {
|
||||
return function (e) {
|
||||
var listStyleType = ListUtils.getSelectedStyleType(editor);
|
||||
e.control.items().each(function (ctrl) {
|
||||
ctrl.active(ctrl.settings.data === listStyleType);
|
||||
});
|
||||
};
|
||||
};
|
||||
var addSplitButton = function (editor, id, tooltip, cmd, nodeName, styles) {
|
||||
editor.addButton(id, {
|
||||
active: false,
|
||||
type: 'splitbutton',
|
||||
tooltip: tooltip,
|
||||
menu: ListStyles.toMenuItems(styles),
|
||||
onPostRender: listState(editor, nodeName),
|
||||
onshow: updateSelection(editor),
|
||||
onselect: function (e) {
|
||||
Actions.applyListFormat(editor, nodeName, e.control.settings.data);
|
||||
},
|
||||
onclick: function () {
|
||||
editor.execCommand(cmd);
|
||||
}
|
||||
});
|
||||
};
|
||||
var addButton = function (editor, id, tooltip, cmd, nodeName, styles) {
|
||||
editor.addButton(id, {
|
||||
active: false,
|
||||
type: 'button',
|
||||
tooltip: tooltip,
|
||||
onPostRender: listState(editor, nodeName),
|
||||
onclick: function () {
|
||||
editor.execCommand(cmd);
|
||||
}
|
||||
});
|
||||
};
|
||||
var addControl = function (editor, id, tooltip, cmd, nodeName, styles) {
|
||||
if (styles.length > 0) {
|
||||
addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
|
||||
} else {
|
||||
addButton(editor, id, tooltip, cmd, nodeName);
|
||||
}
|
||||
};
|
||||
var register$1 = function (editor) {
|
||||
addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', Settings.getNumberStyles(editor));
|
||||
addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', Settings.getBulletStyles(editor));
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
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')) {
|
||||
Buttons.register(editor);
|
||||
Commands.register(editor);
|
||||
}
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/advlist/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},o=function(n){n.addCommand("ApplyUnorderedListStyle",function(t,e){s(n,"UL",e["list-style-type"])}),n.addCommand("ApplyOrderedListStyle",function(t,e){s(n,"OL",e["list-style-type"])})},e=function(t){var e=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return e?e.split(/[ ,]/):[]},n=function(t){var e=t.getParam("advlist_bullet_styles","default,circle,disc,square");return e?e.split(/[ ,]/):[]},u=function(t){return t&&/^(TH|TD)$/.test(t.nodeName)},c=function(r){return function(t){return t&&/^(OL|UL|DL)$/.test(t.nodeName)&&(n=t,(e=r).$.contains(e.getBody(),n));var e,n}},d=function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul");return t.dom.getStyle(e,"listStyleType")||""},p=function(t){return a.map(t,function(t){return{text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()}),data:"default"===t?"":t}})},f=function(i,l){return function(t){var o=t.control;i.on("NodeChange",function(t){var e=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}(t.parents,u),n=-1!==e?t.parents.slice(0,e):t.parents,r=a.grep(n,c(i));o.active(0<r.length&&r[0].nodeName===l)})}},m=function(e,t,n,r,o,i){var l;e.addButton(t,{active:!1,type:"splitbutton",tooltip:n,menu:p(i),onPostRender:f(e,o),onshow:(l=e,function(t){var e=d(l);t.control.items().each(function(t){t.active(t.settings.data===e)})}),onselect:function(t){s(e,o,t.control.settings.data)},onclick:function(){e.execCommand(r)}})},r=function(t,e,n,r,o,i){var l,a,s,u,c;0<i.length?m(t,e,n,r,o,i):(a=e,s=n,u=r,c=o,(l=t).addButton(a,{active:!1,type:"button",tooltip:s,onPostRender:f(l,c),onclick:function(){l.execCommand(u)}}))},i=function(t){r(t,"numlist","Numbered list","InsertOrderedList","OL",e(t)),r(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))};t.add("advlist",function(t){var e,n,r;n="lists",r=(e=t).settings.plugins?e.settings.plugins:"",-1!==a.inArray(r.split(/[ ,]/),n)&&(i(t),o(t))})}();
|
||||
118
html/wp-content/plugins/tinymce-advanced/mce/anchor/plugin.js
Normal file
@@ -0,0 +1,118 @@
|
||||
(function () {
|
||||
var anchor = (function () {
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var isValidId = function (id) {
|
||||
return /^[A-Za-z][A-Za-z0-9\-:._]*$/.test(id);
|
||||
};
|
||||
var getId = function (editor) {
|
||||
var selectedNode = editor.selection.getNode();
|
||||
var isAnchor = selectedNode.tagName === 'A' && editor.dom.getAttrib(selectedNode, 'href') === '';
|
||||
return isAnchor ? selectedNode.id || selectedNode.name : '';
|
||||
};
|
||||
var insert = function (editor, id) {
|
||||
var selectedNode = editor.selection.getNode();
|
||||
var isAnchor = selectedNode.tagName === 'A' && editor.dom.getAttrib(selectedNode, 'href') === '';
|
||||
if (isAnchor) {
|
||||
selectedNode.removeAttribute('name');
|
||||
selectedNode.id = id;
|
||||
editor.undoManager.add();
|
||||
} else {
|
||||
editor.focus();
|
||||
editor.selection.collapse(true);
|
||||
editor.execCommand('mceInsertContent', false, editor.dom.createHTML('a', { id: id }));
|
||||
}
|
||||
};
|
||||
var Anchor = {
|
||||
isValidId: isValidId,
|
||||
getId: getId,
|
||||
insert: insert
|
||||
};
|
||||
|
||||
var insertAnchor = function (editor, newId) {
|
||||
if (!Anchor.isValidId(newId)) {
|
||||
editor.windowManager.alert('Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.');
|
||||
return true;
|
||||
} else {
|
||||
Anchor.insert(editor, newId);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
var open = function (editor) {
|
||||
var currentId = Anchor.getId(editor);
|
||||
editor.windowManager.open({
|
||||
title: 'Anchor',
|
||||
body: {
|
||||
type: 'textbox',
|
||||
name: 'id',
|
||||
size: 40,
|
||||
label: 'Id',
|
||||
value: currentId
|
||||
},
|
||||
onsubmit: function (e) {
|
||||
var newId = e.data.id;
|
||||
if (insertAnchor(editor, newId)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
var Dialog = { open: open };
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceAnchor', function () {
|
||||
Dialog.open(editor);
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var isAnchorNode = function (node) {
|
||||
return !node.attr('href') && (node.attr('id') || node.attr('name')) && !node.firstChild;
|
||||
};
|
||||
var setContentEditable = function (state) {
|
||||
return function (nodes) {
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
if (isAnchorNode(nodes[i])) {
|
||||
nodes[i].attr('contenteditable', state);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
var setup = function (editor) {
|
||||
editor.on('PreInit', function () {
|
||||
editor.parser.addNodeFilter('a', setContentEditable('false'));
|
||||
editor.serializer.addNodeFilter('a', setContentEditable(null));
|
||||
});
|
||||
};
|
||||
var FilterContent = { setup: setup };
|
||||
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('anchor', {
|
||||
icon: 'anchor',
|
||||
tooltip: 'Anchor',
|
||||
cmd: 'mceAnchor',
|
||||
stateSelector: 'a:not([href])'
|
||||
});
|
||||
editor.addMenuItem('anchor', {
|
||||
icon: 'anchor',
|
||||
text: 'Anchor',
|
||||
context: 'insert',
|
||||
cmd: 'mceAnchor'
|
||||
});
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('anchor', function (editor) {
|
||||
FilterContent.setup(editor);
|
||||
Commands.register(editor);
|
||||
Buttons.register(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/anchor/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},e=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.id||e.name:""},i=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e,t.undoManager.add()):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},n=function(r){var t=e(r);r.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:t},onsubmit:function(t){var e,n,o=t.data.id;e=r,(a(n=o)?(i(e,n),0):(e.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))&&t.preventDefault()}})},o=function(t){t.addCommand("mceAnchor",function(){n(t)})},r=function(o){return function(t){for(var e=0;e<t.length;e++)(n=t[e]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||t[e].attr("contenteditable",o);var n}},c=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",r("false")),t.serializer.addNodeFilter("a",r(null))})},d=function(t){t.addButton("anchor",{icon:"anchor",tooltip:"Anchor",cmd:"mceAnchor",stateSelector:"a:not([href])"}),t.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",cmd:"mceAnchor"})};t.add("anchor",function(t){c(t),o(t),d(t)})}();
|
||||
94
html/wp-content/plugins/tinymce-advanced/mce/code/plugin.js
Normal file
@@ -0,0 +1,94 @@
|
||||
(function () {
|
||||
var code = (function () {
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var getMinWidth = function (editor) {
|
||||
return editor.getParam('code_dialog_width', 600);
|
||||
};
|
||||
var getMinHeight = function (editor) {
|
||||
return editor.getParam('code_dialog_height', Math.min(global$1.DOM.getViewPort().h - 200, 500));
|
||||
};
|
||||
var Settings = {
|
||||
getMinWidth: getMinWidth,
|
||||
getMinHeight: getMinHeight
|
||||
};
|
||||
|
||||
var setContent = function (editor, html) {
|
||||
editor.focus();
|
||||
editor.undoManager.transact(function () {
|
||||
editor.setContent(html);
|
||||
});
|
||||
editor.selection.setCursorLocation();
|
||||
editor.nodeChanged();
|
||||
};
|
||||
var getContent = function (editor) {
|
||||
return editor.getContent({ source_view: true });
|
||||
};
|
||||
var Content = {
|
||||
setContent: setContent,
|
||||
getContent: getContent
|
||||
};
|
||||
|
||||
var open = function (editor) {
|
||||
var minWidth = Settings.getMinWidth(editor);
|
||||
var minHeight = Settings.getMinHeight(editor);
|
||||
var win = editor.windowManager.open({
|
||||
title: 'Source code',
|
||||
body: {
|
||||
type: 'textbox',
|
||||
name: 'code',
|
||||
multiline: true,
|
||||
minWidth: minWidth,
|
||||
minHeight: minHeight,
|
||||
spellcheck: false,
|
||||
style: 'direction: ltr; text-align: left'
|
||||
},
|
||||
onSubmit: function (e) {
|
||||
Content.setContent(editor, e.data.code);
|
||||
}
|
||||
});
|
||||
win.find('#code').value(Content.getContent(editor));
|
||||
};
|
||||
var Dialog = { open: open };
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceCodeEditor', function () {
|
||||
Dialog.open(editor);
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('code', {
|
||||
icon: 'code',
|
||||
tooltip: 'Source code',
|
||||
onclick: function () {
|
||||
Dialog.open(editor);
|
||||
}
|
||||
});
|
||||
editor.addMenuItem('code', {
|
||||
icon: 'code',
|
||||
text: 'Source code',
|
||||
onclick: function () {
|
||||
Dialog.open(editor);
|
||||
}
|
||||
});
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('code', function (editor) {
|
||||
Commands.register(editor);
|
||||
Buttons.register(editor);
|
||||
return {};
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/code/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(t){return t.getParam("code_dialog_width",600)},i=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},c=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},d=function(t){return t.getContent({source_view:!0})},e=function(n){var t=o(n),e=i(n);n.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:t,minHeight:e,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(t){c(n,t.data.code)}}).find("#code").value(d(n))},u=function(t){t.addCommand("mceCodeEditor",function(){e(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){e(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){e(t)}})};t.add("code",function(t){return u(t),a(t),{}})}();
|
||||
@@ -0,0 +1,168 @@
|
||||
(function () {
|
||||
var contextmenu = (function () {
|
||||
'use strict';
|
||||
|
||||
var Cell = function (initial) {
|
||||
var value = initial;
|
||||
var get = function () {
|
||||
return value;
|
||||
};
|
||||
var set = function (v) {
|
||||
value = v;
|
||||
};
|
||||
var clone = function () {
|
||||
return Cell(get());
|
||||
};
|
||||
return {
|
||||
get: get,
|
||||
set: set,
|
||||
clone: clone
|
||||
};
|
||||
};
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var get = function (visibleState) {
|
||||
var isContextMenuVisible = function () {
|
||||
return visibleState.get();
|
||||
};
|
||||
return { isContextMenuVisible: isContextMenuVisible };
|
||||
};
|
||||
var Api = { get: get };
|
||||
|
||||
var shouldNeverUseNative = function (editor) {
|
||||
return editor.settings.contextmenu_never_use_native;
|
||||
};
|
||||
var getContextMenu = function (editor) {
|
||||
return editor.getParam('contextmenu', 'link openlink image inserttable | cell row column deletetable');
|
||||
};
|
||||
var Settings = {
|
||||
shouldNeverUseNative: shouldNeverUseNative,
|
||||
getContextMenu: getContextMenu
|
||||
};
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var getUiContainer = function (editor) {
|
||||
return global$1.DOM.select(editor.settings.ui_container)[0];
|
||||
};
|
||||
|
||||
var nu = function (x, y) {
|
||||
return {
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
};
|
||||
var transpose = function (pos, dx, dy) {
|
||||
return nu(pos.x + dx, pos.y + dy);
|
||||
};
|
||||
var fromPageXY = function (e) {
|
||||
return nu(e.pageX, e.pageY);
|
||||
};
|
||||
var fromClientXY = function (e) {
|
||||
return nu(e.clientX, e.clientY);
|
||||
};
|
||||
var transposeUiContainer = function (element, pos) {
|
||||
if (element && global$1.DOM.getStyle(element, 'position', true) !== 'static') {
|
||||
var containerPos = global$1.DOM.getPos(element);
|
||||
var dx = containerPos.x - element.scrollLeft;
|
||||
var dy = containerPos.y - element.scrollTop;
|
||||
return transpose(pos, -dx, -dy);
|
||||
} else {
|
||||
return transpose(pos, 0, 0);
|
||||
}
|
||||
};
|
||||
var transposeContentAreaContainer = function (element, pos) {
|
||||
var containerPos = global$1.DOM.getPos(element);
|
||||
return transpose(pos, containerPos.x, containerPos.y);
|
||||
};
|
||||
var getPos = function (editor, e) {
|
||||
if (editor.inline) {
|
||||
return transposeUiContainer(getUiContainer(editor), fromPageXY(e));
|
||||
} else {
|
||||
var iframePos = transposeContentAreaContainer(editor.getContentAreaContainer(), fromClientXY(e));
|
||||
return transposeUiContainer(getUiContainer(editor), iframePos);
|
||||
}
|
||||
};
|
||||
var Coords = { getPos: getPos };
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.ui.Factory');
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var renderMenu = function (editor, visibleState) {
|
||||
var menu, contextmenu;
|
||||
var items = [];
|
||||
contextmenu = Settings.getContextMenu(editor);
|
||||
global$3.each(contextmenu.split(/[ ,]/), function (name) {
|
||||
var item = editor.menuItems[name];
|
||||
if (name === '|') {
|
||||
item = { text: name };
|
||||
}
|
||||
if (item) {
|
||||
item.shortcut = '';
|
||||
items.push(item);
|
||||
}
|
||||
});
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
if (items[i].text === '|') {
|
||||
if (i === 0 || i === items.length - 1) {
|
||||
items.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
menu = global$2.create('menu', {
|
||||
items: items,
|
||||
context: 'contextmenu',
|
||||
classes: 'contextmenu'
|
||||
});
|
||||
menu.uiContainer = getUiContainer(editor);
|
||||
menu.renderTo(getUiContainer(editor));
|
||||
menu.on('hide', function (e) {
|
||||
if (e.control === this) {
|
||||
visibleState.set(false);
|
||||
}
|
||||
});
|
||||
editor.on('remove', function () {
|
||||
menu.remove();
|
||||
menu = null;
|
||||
});
|
||||
return menu;
|
||||
};
|
||||
var show = function (editor, pos, visibleState, menu) {
|
||||
if (menu.get() === null) {
|
||||
menu.set(renderMenu(editor, visibleState));
|
||||
} else {
|
||||
menu.get().show();
|
||||
}
|
||||
menu.get().moveTo(pos.x, pos.y);
|
||||
visibleState.set(true);
|
||||
};
|
||||
var ContextMenu = { show: show };
|
||||
|
||||
var isNativeOverrideKeyEvent = function (editor, e) {
|
||||
return e.ctrlKey && !Settings.shouldNeverUseNative(editor);
|
||||
};
|
||||
var setup = function (editor, visibleState, menu) {
|
||||
editor.on('contextmenu', function (e) {
|
||||
if (isNativeOverrideKeyEvent(editor, e)) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
ContextMenu.show(editor, Coords.getPos(editor, e), visibleState, menu);
|
||||
});
|
||||
};
|
||||
var Bind = { setup: setup };
|
||||
|
||||
global.add('contextmenu', function (editor) {
|
||||
var menu = Cell(null), visibleState = Cell(false);
|
||||
Bind.setup(editor, visibleState, menu);
|
||||
return Api.get(visibleState);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/contextmenu/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";var o=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return o(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return{isContextMenuVisible:function(){return t.get()}}},r=function(t){return t.settings.contextmenu_never_use_native},u=function(t){return t.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")},l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=function(t){return l.DOM.select(t.settings.ui_container)[0]},a=function(t,n){return{x:t,y:n}},f=function(t,n,e){return a(t.x+n,t.y+e)},m=function(t,n){if(t&&"static"!==l.DOM.getStyle(t,"position",!0)){var e=l.DOM.getPos(t),o=e.x-t.scrollLeft,i=e.y-t.scrollTop;return f(n,-o,-i)}return f(n,0,0)},c=function(t,n){if(t.inline)return m(s(t),a((u=n).pageX,u.pageY));var e,o,i,r,u,c=(e=t.getContentAreaContainer(),o=a((r=n).clientX,r.clientY),i=l.DOM.getPos(e),f(o,i.x,i.y));return m(s(t),c)},g=tinymce.util.Tools.resolve("tinymce.ui.Factory"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),y=function(t,n,e,o){null===o.get()?o.set(function(e,n){var t,o,i=[];o=u(e),v.each(o.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"===t&&(n={text:t}),n&&(n.shortcut="",i.push(n))});for(var r=0;r<i.length;r++)"|"===i[r].text&&(0!==r&&r!==i.length-1||i.splice(r,1));return(t=g.create("menu",{items:i,context:"contextmenu",classes:"contextmenu"})).uiContainer=s(e),t.renderTo(s(e)),t.on("hide",function(t){t.control===this&&n.set(!1)}),e.on("remove",function(){t.remove(),t=null}),t}(t,e)):o.get().show(),o.get().moveTo(n.x,n.y),e.set(!0)},x=function(e,o,i){e.on("contextmenu",function(t){var n;n=e,(!t.ctrlKey||r(n))&&(t.preventDefault(),y(e,c(e,t),o,i))})};t.add("contextmenu",function(t){var n=o(null),e=o(!1);return x(t,e,n),i(e)})}();
|
||||
|
After Width: | Height: | Size: 170 B |
|
After Width: | Height: | Size: 172 B |
|
After Width: | Height: | Size: 171 B |
|
After Width: | Height: | Size: 172 B |
|
After Width: | Height: | Size: 498 B |
|
After Width: | Height: | Size: 170 B |
|
After Width: | Height: | Size: 236 B |
|
After Width: | Height: | Size: 176 B |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 174 B |
|
After Width: | Height: | Size: 349 B |
|
After Width: | Height: | Size: 171 B |
|
After Width: | Height: | Size: 176 B |
|
After Width: | Height: | Size: 650 B |
|
After Width: | Height: | Size: 485 B |
|
After Width: | Height: | Size: 171 B |
|
After Width: | Height: | Size: 174 B |
|
After Width: | Height: | Size: 174 B |
|
After Width: | Height: | Size: 238 B |
|
After Width: | Height: | Size: 170 B |
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* plugin.js (edited for WP)
|
||||
*
|
||||
* Copyright, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
/*global tinymce:true */
|
||||
|
||||
tinymce.PluginManager.add('emoticons', function(editor, url) {
|
||||
var emoticons = [{
|
||||
smile: ':-)',
|
||||
razz: ':-P',
|
||||
cool: '8-)',
|
||||
wink: ';-)',
|
||||
biggrin: ':-D'
|
||||
},
|
||||
{
|
||||
twisted: ':twisted:',
|
||||
mrgreen: ':mrgreen:',
|
||||
lol: ':lol:',
|
||||
rolleyes: ':roll:',
|
||||
confused: ':-?'
|
||||
},
|
||||
{
|
||||
cry: ':cry:',
|
||||
surprised: ':-o',
|
||||
evil: ':evil:',
|
||||
neutral: ':-|',
|
||||
redface: ':oops:'
|
||||
},
|
||||
{
|
||||
mad: ':-x',
|
||||
eek: '8-O',
|
||||
sad: ':-(',
|
||||
arrow: ':arrow:',
|
||||
idea: ':idea:'
|
||||
}];
|
||||
|
||||
function getHtml() {
|
||||
var emoticonsHtml;
|
||||
|
||||
emoticonsHtml = '<table role="list" class="mce-grid">';
|
||||
|
||||
tinymce.each(emoticons, function( row ) {
|
||||
emoticonsHtml += '<tr>';
|
||||
|
||||
tinymce.each( row, function( icon, name ) {
|
||||
var emoticonUrl = url + '/img/icon_' + name + '.gif';
|
||||
|
||||
emoticonsHtml += '<td><a href="#" data-mce-alt="' + icon + '" tabindex="-1" ' +
|
||||
'role="option" aria-label="' + icon + '"><img src="' +
|
||||
emoticonUrl + '" style="width: 15px; height: 15px; padding: 3px;" role="presentation" alt="' + icon + '" /></a></td>';
|
||||
});
|
||||
|
||||
emoticonsHtml += '</tr>';
|
||||
});
|
||||
|
||||
emoticonsHtml += '</table>';
|
||||
|
||||
return emoticonsHtml;
|
||||
}
|
||||
|
||||
editor.addButton('emoticons', {
|
||||
type: 'panelbutton',
|
||||
panel: {
|
||||
role: 'application',
|
||||
autohide: true,
|
||||
html: getHtml,
|
||||
onclick: function(e) {
|
||||
var linkElm = editor.dom.getParent( e.target, 'a' );
|
||||
|
||||
if ( linkElm ) {
|
||||
editor.insertContent(
|
||||
' ' + linkElm.getAttribute('data-mce-alt') + ' '
|
||||
);
|
||||
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: 'Emoticons'
|
||||
});
|
||||
});
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/emoticons/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("emoticons",function(a,b){function c(){var a;return a='<table role="list" class="mce-grid">',tinymce.each(d,function(c){a+="<tr>",tinymce.each(c,function(c,d){var e=b+"/img/icon_"+d+".gif";a+='<td><a href="#" data-mce-alt="'+c+'" tabindex="-1" role="option" aria-label="'+c+'"><img src="'+e+'" style="width: 15px; height: 15px; padding: 3px;" role="presentation" alt="'+c+'" /></a></td>'}),a+="</tr>"}),a+="</table>"}var d=[{smile:":-)",razz:":-P",cool:"8-)",wink:";-)",biggrin:":-D"},{twisted:":twisted:",mrgreen:":mrgreen:",lol:":lol:",rolleyes:":roll:",confused:":-?"},{cry:":cry:",surprised:":-o",evil:":evil:",neutral:":-|",redface:":oops:"},{mad:":-x",eek:"8-O",sad:":-(",arrow:":arrow:",idea:":idea:"}];a.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:c,onclick:function(b){var c=a.dom.getParent(b.target,"a");c&&(a.insertContent(" "+c.getAttribute("data-mce-alt")+" "),this.hide())}},tooltip:"Emoticons"})});
|
||||
264
html/wp-content/plugins/tinymce-advanced/mce/importcss/plugin.js
Normal file
@@ -0,0 +1,264 @@
|
||||
(function () {
|
||||
var importcss = (function () {
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var global$1 = 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$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var shouldMergeClasses = function (editor) {
|
||||
return editor.getParam('importcss_merge_classes');
|
||||
};
|
||||
var shouldImportExclusive = function (editor) {
|
||||
return editor.getParam('importcss_exclusive');
|
||||
};
|
||||
var getSelectorConverter = function (editor) {
|
||||
return editor.getParam('importcss_selector_converter');
|
||||
};
|
||||
var getSelectorFilter = function (editor) {
|
||||
return editor.getParam('importcss_selector_filter');
|
||||
};
|
||||
var getCssGroups = function (editor) {
|
||||
return editor.getParam('importcss_groups');
|
||||
};
|
||||
var shouldAppend = function (editor) {
|
||||
return editor.getParam('importcss_append');
|
||||
};
|
||||
var getFileFilter = function (editor) {
|
||||
return editor.getParam('importcss_file_filter');
|
||||
};
|
||||
var Settings = {
|
||||
shouldMergeClasses: shouldMergeClasses,
|
||||
shouldImportExclusive: shouldImportExclusive,
|
||||
getSelectorConverter: getSelectorConverter,
|
||||
getSelectorFilter: getSelectorFilter,
|
||||
getCssGroups: getCssGroups,
|
||||
shouldAppend: shouldAppend,
|
||||
getFileFilter: getFileFilter
|
||||
};
|
||||
|
||||
var removeCacheSuffix = function (url) {
|
||||
var cacheSuffix = global$3.cacheSuffix;
|
||||
if (typeof url === 'string') {
|
||||
url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
|
||||
}
|
||||
return url;
|
||||
};
|
||||
var isSkinContentCss = function (editor, href) {
|
||||
var settings = editor.settings, skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
|
||||
if (skin) {
|
||||
var skinUrl = settings.skin_url ? editor.documentBaseURI.toAbsolute(settings.skin_url) : global$2.baseURL + '/skins/' + skin;
|
||||
return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css';
|
||||
}
|
||||
return false;
|
||||
};
|
||||
var compileFilter = function (filter) {
|
||||
if (typeof filter === 'string') {
|
||||
return function (value) {
|
||||
return value.indexOf(filter) !== -1;
|
||||
};
|
||||
} else if (filter instanceof RegExp) {
|
||||
return function (value) {
|
||||
return filter.test(value);
|
||||
};
|
||||
}
|
||||
return filter;
|
||||
};
|
||||
var getSelectors = function (editor, doc, fileFilter) {
|
||||
var selectors = [], contentCSSUrls = {};
|
||||
function append(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) {
|
||||
append(styleSheet, true);
|
||||
});
|
||||
try {
|
||||
rules = styleSheet.cssRules || styleSheet.rules;
|
||||
} catch (e) {
|
||||
}
|
||||
global$4.each(rules, function (cssRule) {
|
||||
if (cssRule.styleSheet) {
|
||||
append(cssRule.styleSheet, true);
|
||||
} else if (cssRule.selectorText) {
|
||||
global$4.each(cssRule.selectorText.split(','), function (selector) {
|
||||
selectors.push(global$4.trim(selector));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
global$4.each(editor.contentCSS, function (url) {
|
||||
contentCSSUrls[url] = true;
|
||||
});
|
||||
if (!fileFilter) {
|
||||
fileFilter = function (href, imported) {
|
||||
return imported || contentCSSUrls[href];
|
||||
};
|
||||
}
|
||||
try {
|
||||
global$4.each(doc.styleSheets, function (styleSheet) {
|
||||
append(styleSheet);
|
||||
});
|
||||
} catch (e) {
|
||||
}
|
||||
return selectors;
|
||||
};
|
||||
var defaultConvertSelectorToFormat = function (editor, selectorText) {
|
||||
var format;
|
||||
var selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText);
|
||||
if (!selector) {
|
||||
return;
|
||||
}
|
||||
var elementName = selector[1];
|
||||
var classes = selector[2].substr(1).split('.').join(' ');
|
||||
var inlineSelectorElements = global$4.makeMap('a,img');
|
||||
if (selector[1]) {
|
||||
format = { title: selectorText };
|
||||
if (editor.schema.getTextBlockElements()[elementName]) {
|
||||
format.block = elementName;
|
||||
} else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) {
|
||||
format.selector = elementName;
|
||||
} else {
|
||||
format.inline = elementName;
|
||||
}
|
||||
} else if (selector[2]) {
|
||||
format = {
|
||||
inline: 'span',
|
||||
title: selectorText.substr(1),
|
||||
classes: classes
|
||||
};
|
||||
}
|
||||
if (Settings.shouldMergeClasses(editor) !== false) {
|
||||
format.classes = classes;
|
||||
} else {
|
||||
format.attributes = { class: classes };
|
||||
}
|
||||
return format;
|
||||
};
|
||||
var getGroupsBySelector = function (groups, selector) {
|
||||
return global$4.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, {
|
||||
original: group,
|
||||
selectors: {},
|
||||
filter: compileFilter(group.filter),
|
||||
item: {
|
||||
text: group.title,
|
||||
menu: []
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
var isExclusiveMode = function (editor, group) {
|
||||
return group === null || Settings.shouldImportExclusive(editor) !== false;
|
||||
};
|
||||
var isUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) {
|
||||
return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
|
||||
};
|
||||
var markUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) {
|
||||
if (isExclusiveMode(editor, group)) {
|
||||
globallyUniqueSelectors[selector] = true;
|
||||
} else {
|
||||
group.selectors[selector] = true;
|
||||
}
|
||||
};
|
||||
var convertSelectorToFormat = function (editor, plugin, selector, group) {
|
||||
var selectorConverter;
|
||||
if (group && group.selector_converter) {
|
||||
selectorConverter = group.selector_converter;
|
||||
} else if (Settings.getSelectorConverter(editor)) {
|
||||
selectorConverter = Settings.getSelectorConverter(editor);
|
||||
} else {
|
||||
selectorConverter = function () {
|
||||
return defaultConvertSelectorToFormat(editor, selector);
|
||||
};
|
||||
}
|
||||
return selectorConverter.call(plugin, selector, group);
|
||||
};
|
||||
var setup = function (editor) {
|
||||
editor.on('renderFormatsMenu', function (e) {
|
||||
var globallyUniqueSelectors = {};
|
||||
var selectorFilter = compileFilter(Settings.getSelectorFilter(editor)), ctrl = e.control;
|
||||
var groups = compileUserDefinedGroups(Settings.getCssGroups(editor));
|
||||
var processSelector = function (selector, group) {
|
||||
if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) {
|
||||
markUniqueSelector(editor, selector, group, globallyUniqueSelectors);
|
||||
var format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
|
||||
if (format) {
|
||||
var formatName = format.name || global$1.DOM.uniqueId();
|
||||
editor.formatter.register(formatName, format);
|
||||
return global$4.extend({}, ctrl.settings.itemDefaults, {
|
||||
text: format.title,
|
||||
format: formatName
|
||||
});
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
if (!Settings.shouldAppend(editor)) {
|
||||
ctrl.items().remove();
|
||||
}
|
||||
global$4.each(getSelectors(editor, e.doc || editor.getDoc(), compileFilter(Settings.getFileFilter(editor))), function (selector) {
|
||||
if (selector.indexOf('.mce-') === -1) {
|
||||
if (!selectorFilter || selectorFilter(selector)) {
|
||||
var selectorGroups = getGroupsBySelector(groups, selector);
|
||||
if (selectorGroups.length > 0) {
|
||||
global$4.each(selectorGroups, function (group) {
|
||||
var menuItem = processSelector(selector, group);
|
||||
if (menuItem) {
|
||||
group.item.menu.push(menuItem);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var menuItem = processSelector(selector, null);
|
||||
if (menuItem) {
|
||||
ctrl.add(menuItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
global$4.each(groups, function (group) {
|
||||
if (group.item.menu.length > 0) {
|
||||
ctrl.add(group.item);
|
||||
}
|
||||
});
|
||||
e.control.renderNew();
|
||||
});
|
||||
};
|
||||
var ImportCss = {
|
||||
defaultConvertSelectorToFormat: defaultConvertSelectorToFormat,
|
||||
setup: setup
|
||||
};
|
||||
|
||||
var get = function (editor) {
|
||||
var convertSelectorToFormat = function (selectorText) {
|
||||
return ImportCss.defaultConvertSelectorToFormat(editor, selectorText);
|
||||
};
|
||||
return { convertSelectorToFormat: convertSelectorToFormat };
|
||||
};
|
||||
var Api = { get: get };
|
||||
|
||||
global.add('importcss', function (editor) {
|
||||
ImportCss.setup(editor);
|
||||
return Api.get(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/importcss/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),v=tinymce.util.Tools.resolve("tinymce.EditorManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(e){return e.getParam("importcss_merge_classes")},n=function(e){return e.getParam("importcss_exclusive")},_=function(e){return e.getParam("importcss_selector_converter")},r=function(e){return e.getParam("importcss_selector_filter")},i=function(e){return e.getParam("importcss_groups")},u=function(e){return e.getParam("importcss_append")},l=function(e){return e.getParam("importcss_file_filter")},a=function(t){return"string"==typeof t?function(e){return-1!==e.indexOf(t)}:t instanceof RegExp?function(e){return t.test(e)}:t},f=function(f,e,m){var g=[],n={};function p(e,t){var n,r,i,c=e.href;if(r=c,i=h.cacheSuffix,"string"==typeof r&&(r=r.replace("?"+i,"").replace("&"+i,"")),(c=r)&&m(c,t)&&(o=c,u=(s=f).settings,!(l=!1!==u.skin&&(u.skin||"lightgray"))||o!==(u.skin_url?s.documentBaseURI.toAbsolute(u.skin_url):v.baseURL+"/skins/"+l)+"/content"+(s.inline?".inline":"")+".min.css")){var s,o,u,l;y.each(e.imports,function(e){p(e,!0)});try{n=e.cssRules||e.rules}catch(a){}y.each(n,function(e){e.styleSheet?p(e.styleSheet,!0):e.selectorText&&y.each(e.selectorText.split(","),function(e){g.push(y.trim(e))})})}}y.each(f.contentCSS,function(e){n[e]=!0}),m||(m=function(e,t){return t||n[e]});try{y.each(e.styleSheets,function(e){p(e)})}catch(t){}return g},x=function(e,t){var n,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(r){var i=r[1],c=r[2].substr(1).split(".").join(" "),s=y.makeMap("a,img");return r[1]?(n={title:t},e.schema.getTextBlockElements()[i]?n.block=i:e.schema.getBlockElements()[i]||s[i.toLowerCase()]?n.selector=i:n.inline=i):r[2]&&(n={inline:"span",title:t.substr(1),classes:c}),!1!==o(e)?n.classes=c:n.attributes={"class":c},n}},T=function(e,t){return null===t||!1!==n(e)},c=x,t=function(h){h.on("renderFormatsMenu",function(e){var t,p={},c=a(r(h)),v=e.control,s=(t=i(h),y.map(t,function(e){return y.extend({},e,{original:e,selectors:{},filter:a(e.filter),item:{text:e.title,menu:[]}})})),o=function(e,t){if(f=e,g=p,!(T(h,m=t)?f in g:f in m.selectors)){u=e,a=p,T(h,l=t)?a[u]=!0:l.selectors[u]=!0;var n=(c=(i=h).plugins.importcss,s=e,((o=t)&&o.selector_converter?o.selector_converter:_(i)?_(i):function(){return x(i,s)}).call(c,s,o));if(n){var r=n.name||d.DOM.uniqueId();return h.formatter.register(r,n),y.extend({},v.settings.itemDefaults,{text:n.title,format:r})}}var i,c,s,o,u,l,a,f,m,g;return null};u(h)||v.items().remove(),y.each(f(h,e.doc||h.getDoc(),a(l(h))),function(n){if(-1===n.indexOf(".mce-")&&(!c||c(n))){var e=(r=s,i=n,y.grep(r,function(e){return!e.filter||e.filter(i)}));if(0<e.length)y.each(e,function(e){var t=o(n,e);t&&e.item.menu.push(t)});else{var t=o(n,null);t&&v.add(t)}}var r,i}),y.each(s,function(e){0<e.item.menu.length&&v.add(e.item)}),e.control.renderNew()})},s=function(t){return{convertSelectorToFormat:function(e){return c(t,e)}}};e.add("importcss",function(e){return t(e),s(e)})}();
|
||||
@@ -0,0 +1,173 @@
|
||||
(function () {
|
||||
var insertdatetime = (function () {
|
||||
'use strict';
|
||||
|
||||
var Cell = function (initial) {
|
||||
var value = initial;
|
||||
var get = function () {
|
||||
return value;
|
||||
};
|
||||
var set = function (v) {
|
||||
value = v;
|
||||
};
|
||||
var clone = function () {
|
||||
return Cell(get());
|
||||
};
|
||||
return {
|
||||
get: get,
|
||||
set: set,
|
||||
clone: clone
|
||||
};
|
||||
};
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var getDateFormat = function (editor) {
|
||||
return editor.getParam('insertdatetime_dateformat', editor.translate('%Y-%m-%d'));
|
||||
};
|
||||
var getTimeFormat = function (editor) {
|
||||
return editor.getParam('insertdatetime_timeformat', editor.translate('%H:%M:%S'));
|
||||
};
|
||||
var getFormats = function (editor) {
|
||||
return editor.getParam('insertdatetime_formats', [
|
||||
'%H:%M:%S',
|
||||
'%Y-%m-%d',
|
||||
'%I:%M:%S %p',
|
||||
'%D'
|
||||
]);
|
||||
};
|
||||
var getDefaultDateTime = function (editor) {
|
||||
var formats = getFormats(editor);
|
||||
return formats.length > 0 ? formats[0] : getTimeFormat(editor);
|
||||
};
|
||||
var shouldInsertTimeElement = function (editor) {
|
||||
return editor.getParam('insertdatetime_element', false);
|
||||
};
|
||||
var Settings = {
|
||||
getDateFormat: getDateFormat,
|
||||
getTimeFormat: getTimeFormat,
|
||||
getFormats: getFormats,
|
||||
getDefaultDateTime: getDefaultDateTime,
|
||||
shouldInsertTimeElement: shouldInsertTimeElement
|
||||
};
|
||||
|
||||
var daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' ');
|
||||
var daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' ');
|
||||
var monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
|
||||
var monthsLong = 'January February March April May June July August September October November December'.split(' ');
|
||||
var addZeros = function (value, len) {
|
||||
value = '' + value;
|
||||
if (value.length < len) {
|
||||
for (var i = 0; i < len - value.length; i++) {
|
||||
value = '0' + value;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
var getDateTime = function (editor, fmt, date) {
|
||||
date = date || new Date();
|
||||
fmt = fmt.replace('%D', '%m/%d/%Y');
|
||||
fmt = fmt.replace('%r', '%I:%M:%S %p');
|
||||
fmt = fmt.replace('%Y', '' + date.getFullYear());
|
||||
fmt = fmt.replace('%y', '' + date.getYear());
|
||||
fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2));
|
||||
fmt = fmt.replace('%d', addZeros(date.getDate(), 2));
|
||||
fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2));
|
||||
fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2));
|
||||
fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2));
|
||||
fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1));
|
||||
fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM'));
|
||||
fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()]));
|
||||
fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()]));
|
||||
fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()]));
|
||||
fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()]));
|
||||
fmt = fmt.replace('%%', '%');
|
||||
return fmt;
|
||||
};
|
||||
var updateElement = function (editor, timeElm, computerTime, userTime) {
|
||||
var newTimeElm = editor.dom.create('time', { datetime: computerTime }, userTime);
|
||||
timeElm.parentNode.insertBefore(newTimeElm, timeElm);
|
||||
editor.dom.remove(timeElm);
|
||||
editor.selection.select(newTimeElm, true);
|
||||
editor.selection.collapse(false);
|
||||
};
|
||||
var insertDateTime = function (editor, format) {
|
||||
if (Settings.shouldInsertTimeElement(editor)) {
|
||||
var userTime = getDateTime(editor, format);
|
||||
var computerTime = void 0;
|
||||
if (/%[HMSIp]/.test(format)) {
|
||||
computerTime = getDateTime(editor, '%Y-%m-%dT%H:%M');
|
||||
} else {
|
||||
computerTime = getDateTime(editor, '%Y-%m-%d');
|
||||
}
|
||||
var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time');
|
||||
if (timeElm) {
|
||||
updateElement(editor, timeElm, computerTime, userTime);
|
||||
} else {
|
||||
editor.insertContent('<time datetime="' + computerTime + '">' + userTime + '</time>');
|
||||
}
|
||||
} else {
|
||||
editor.insertContent(getDateTime(editor, format));
|
||||
}
|
||||
};
|
||||
var Actions = {
|
||||
insertDateTime: insertDateTime,
|
||||
getDateTime: getDateTime
|
||||
};
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceInsertDate', function () {
|
||||
Actions.insertDateTime(editor, Settings.getDateFormat(editor));
|
||||
});
|
||||
editor.addCommand('mceInsertTime', function () {
|
||||
Actions.insertDateTime(editor, Settings.getTimeFormat(editor));
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var createMenuItems = function (editor, lastFormatState) {
|
||||
var formats = Settings.getFormats(editor);
|
||||
return global$1.map(formats, function (fmt) {
|
||||
return {
|
||||
text: Actions.getDateTime(editor, fmt),
|
||||
onclick: function () {
|
||||
lastFormatState.set(fmt);
|
||||
Actions.insertDateTime(editor, fmt);
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
var register$1 = function (editor, lastFormatState) {
|
||||
var menuItems = createMenuItems(editor, lastFormatState);
|
||||
editor.addButton('insertdatetime', {
|
||||
type: 'splitbutton',
|
||||
title: 'Insert date/time',
|
||||
menu: menuItems,
|
||||
onclick: function () {
|
||||
var lastFormat = lastFormatState.get();
|
||||
Actions.insertDateTime(editor, lastFormat ? lastFormat : Settings.getDefaultDateTime(editor));
|
||||
}
|
||||
});
|
||||
editor.addMenuItem('insertdatetime', {
|
||||
icon: 'date',
|
||||
text: 'Date/time',
|
||||
menu: menuItems,
|
||||
context: 'insert'
|
||||
});
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('insertdatetime', function (editor) {
|
||||
var lastFormatState = Cell(null);
|
||||
Commands.register(editor);
|
||||
Buttons.register(editor, lastFormatState);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/insertdatetime/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";var r=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},a=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},t=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},i=n,o=a,u=function(e){var t=a(e);return 0<t.length?t[0]:n(e)},m=function(e){return e.getParam("insertdatetime_element",!1)},c="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),d="January February March April May June July August September October November December".split(" "),p=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},f=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",p(n.getMonth()+1,2))).replace("%d",p(n.getDate(),2))).replace("%H",""+p(n.getHours(),2))).replace("%M",""+p(n.getMinutes(),2))).replace("%S",""+p(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(d[n.getMonth()]))).replace("%b",""+e.translate(s[n.getMonth()]))).replace("%A",""+e.translate(l[n.getDay()]))).replace("%a",""+e.translate(c[n.getDay()]))).replace("%%","%")},g=function(e,t){if(m(e)){var n=f(e,t),r=void 0;r=/%[HMSIp]/.test(t)?f(e,"%Y-%m-%dT%H:%M"):f(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?(o=a,u=r,c=n,l=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(l,o),i.dom.remove(o),i.selection.select(l,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(f(e,t));var i,o,u,c,l},y=f,M=function(e){e.addCommand("mceInsertDate",function(){g(e,t(e))}),e.addCommand("mceInsertTime",function(){g(e,i(e))})},v=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(t,n){var r,a,e,i=(a=n,e=o(r=t),v.map(e,function(e){return{text:y(r,e),onclick:function(){a.set(e),g(r,e)}}}));t.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",menu:i,onclick:function(){var e=n.get();g(t,e||u(t))}}),t.addMenuItem("insertdatetime",{icon:"date",text:"Date/time",menu:i,context:"insert"})};e.add("insertdatetime",function(e){var t=r(null);M(e),S(e,t)})}();
|
||||
713
html/wp-content/plugins/tinymce-advanced/mce/link/plugin.js
Normal file
@@ -0,0 +1,713 @@
|
||||
(function () {
|
||||
var link = (function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK');
|
||||
|
||||
var assumeExternalTargets = function (editorSettings) {
|
||||
return typeof editorSettings.link_assume_external_targets === 'boolean' ? editorSettings.link_assume_external_targets : false;
|
||||
};
|
||||
var hasContextToolbar = function (editorSettings) {
|
||||
return typeof editorSettings.link_context_toolbar === 'boolean' ? editorSettings.link_context_toolbar : false;
|
||||
};
|
||||
var getLinkList = function (editorSettings) {
|
||||
return editorSettings.link_list;
|
||||
};
|
||||
var hasDefaultLinkTarget = function (editorSettings) {
|
||||
return typeof editorSettings.default_link_target === 'string';
|
||||
};
|
||||
var getDefaultLinkTarget = function (editorSettings) {
|
||||
return editorSettings.default_link_target;
|
||||
};
|
||||
var getTargetList = function (editorSettings) {
|
||||
return editorSettings.target_list;
|
||||
};
|
||||
var setTargetList = function (editor, list) {
|
||||
editor.settings.target_list = list;
|
||||
};
|
||||
var shouldShowTargetList = function (editorSettings) {
|
||||
return getTargetList(editorSettings) !== false;
|
||||
};
|
||||
var getRelList = function (editorSettings) {
|
||||
return editorSettings.rel_list;
|
||||
};
|
||||
var hasRelList = function (editorSettings) {
|
||||
return getRelList(editorSettings) !== undefined;
|
||||
};
|
||||
var getLinkClassList = function (editorSettings) {
|
||||
return editorSettings.link_class_list;
|
||||
};
|
||||
var hasLinkClassList = function (editorSettings) {
|
||||
return getLinkClassList(editorSettings) !== undefined;
|
||||
};
|
||||
var shouldShowLinkTitle = function (editorSettings) {
|
||||
return editorSettings.link_title !== false;
|
||||
};
|
||||
var allowUnsafeLinkTarget = function (editorSettings) {
|
||||
return typeof editorSettings.allow_unsafe_link_target === 'boolean' ? editorSettings.allow_unsafe_link_target : false;
|
||||
};
|
||||
var Settings = {
|
||||
assumeExternalTargets: assumeExternalTargets,
|
||||
hasContextToolbar: hasContextToolbar,
|
||||
getLinkList: getLinkList,
|
||||
hasDefaultLinkTarget: hasDefaultLinkTarget,
|
||||
getDefaultLinkTarget: getDefaultLinkTarget,
|
||||
getTargetList: getTargetList,
|
||||
setTargetList: setTargetList,
|
||||
shouldShowTargetList: shouldShowTargetList,
|
||||
getRelList: getRelList,
|
||||
hasRelList: hasRelList,
|
||||
getLinkClassList: getLinkClassList,
|
||||
hasLinkClassList: hasLinkClassList,
|
||||
shouldShowLinkTitle: shouldShowLinkTitle,
|
||||
allowUnsafeLinkTarget: allowUnsafeLinkTarget
|
||||
};
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
var appendClickRemove = function (link, evt) {
|
||||
domGlobals.document.body.appendChild(link);
|
||||
link.dispatchEvent(evt);
|
||||
domGlobals.document.body.removeChild(link);
|
||||
};
|
||||
var open = function (url) {
|
||||
if (!global$3.ie || global$3.ie > 10) {
|
||||
var link = domGlobals.document.createElement('a');
|
||||
link.target = '_blank';
|
||||
link.href = url;
|
||||
link.rel = 'noreferrer noopener';
|
||||
var evt = domGlobals.document.createEvent('MouseEvents');
|
||||
evt.initMouseEvent('click', true, true, domGlobals.window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
appendClickRemove(link, evt);
|
||||
} else {
|
||||
var win = domGlobals.window.open('', '_blank');
|
||||
if (win) {
|
||||
win.opener = null;
|
||||
var doc = win.document;
|
||||
doc.open();
|
||||
doc.write('<meta http-equiv="refresh" content="0; url=' + global$2.DOM.encode(url) + '">');
|
||||
doc.close();
|
||||
}
|
||||
}
|
||||
};
|
||||
var OpenUrl = { open: open };
|
||||
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var toggleTargetRules = function (rel, isUnsafe) {
|
||||
var rules = ['noopener'];
|
||||
var newRel = rel ? rel.split(/\s+/) : [];
|
||||
var toString = function (rel) {
|
||||
return global$4.trim(rel.sort().join(' '));
|
||||
};
|
||||
var addTargetRules = function (rel) {
|
||||
rel = removeTargetRules(rel);
|
||||
return rel.length ? rel.concat(rules) : rules;
|
||||
};
|
||||
var removeTargetRules = function (rel) {
|
||||
return rel.filter(function (val) {
|
||||
return global$4.inArray(rules, val) === -1;
|
||||
});
|
||||
};
|
||||
newRel = isUnsafe ? addTargetRules(newRel) : removeTargetRules(newRel);
|
||||
return newRel.length ? toString(newRel) : null;
|
||||
};
|
||||
var trimCaretContainers = function (text) {
|
||||
return text.replace(/\uFEFF/g, '');
|
||||
};
|
||||
var getAnchorElement = function (editor, selectedElm) {
|
||||
selectedElm = selectedElm || editor.selection.getNode();
|
||||
if (isImageFigure(selectedElm)) {
|
||||
return editor.dom.select('a[href]', selectedElm)[0];
|
||||
} else {
|
||||
return editor.dom.getParent(selectedElm, 'a[href]');
|
||||
}
|
||||
};
|
||||
var getAnchorText = function (selection, anchorElm) {
|
||||
var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({ format: 'text' });
|
||||
return trimCaretContainers(text);
|
||||
};
|
||||
var isLink = function (elm) {
|
||||
return elm && elm.nodeName === 'A' && elm.href;
|
||||
};
|
||||
var hasLinks = function (elements) {
|
||||
return global$4.grep(elements, isLink).length > 0;
|
||||
};
|
||||
var isOnlyTextSelected = function (html) {
|
||||
if (/</.test(html) && (!/^<a [^>]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') === -1)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var isImageFigure = function (node) {
|
||||
return node && node.nodeName === 'FIGURE' && /\bimage\b/i.test(node.className);
|
||||
};
|
||||
var link = function (editor, attachState) {
|
||||
return function (data) {
|
||||
editor.undoManager.transact(function () {
|
||||
var selectedElm = editor.selection.getNode();
|
||||
var anchorElm = getAnchorElement(editor, selectedElm);
|
||||
var linkAttrs = {
|
||||
href: data.href,
|
||||
target: data.target ? data.target : null,
|
||||
rel: data.rel ? data.rel : null,
|
||||
class: data.class ? data.class : null,
|
||||
title: data.title ? data.title : null
|
||||
};
|
||||
if (!Settings.hasRelList(editor.settings) && Settings.allowUnsafeLinkTarget(editor.settings) === false) {
|
||||
linkAttrs.rel = toggleTargetRules(linkAttrs.rel, linkAttrs.target === '_blank');
|
||||
}
|
||||
if (data.href === attachState.href) {
|
||||
attachState.attach();
|
||||
attachState = {};
|
||||
}
|
||||
if (anchorElm) {
|
||||
editor.focus();
|
||||
if (data.hasOwnProperty('text')) {
|
||||
if ('innerText' in anchorElm) {
|
||||
anchorElm.innerText = data.text;
|
||||
} else {
|
||||
anchorElm.textContent = data.text;
|
||||
}
|
||||
}
|
||||
editor.dom.setAttribs(anchorElm, linkAttrs);
|
||||
editor.selection.select(anchorElm);
|
||||
editor.undoManager.add();
|
||||
} else {
|
||||
if (isImageFigure(selectedElm)) {
|
||||
linkImageFigure(editor, selectedElm, linkAttrs);
|
||||
} else if (data.hasOwnProperty('text')) {
|
||||
editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(data.text)));
|
||||
} else {
|
||||
editor.execCommand('mceInsertLink', false, linkAttrs);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
var unlink = function (editor) {
|
||||
return function () {
|
||||
editor.undoManager.transact(function () {
|
||||
var node = editor.selection.getNode();
|
||||
if (isImageFigure(node)) {
|
||||
unlinkImageFigure(editor, node);
|
||||
} else {
|
||||
editor.execCommand('unlink');
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
var unlinkImageFigure = function (editor, fig) {
|
||||
var a, img;
|
||||
img = editor.dom.select('img', fig)[0];
|
||||
if (img) {
|
||||
a = editor.dom.getParents(img, 'a[href]', fig)[0];
|
||||
if (a) {
|
||||
a.parentNode.insertBefore(img, a);
|
||||
editor.dom.remove(a);
|
||||
}
|
||||
}
|
||||
};
|
||||
var linkImageFigure = function (editor, fig, attrs) {
|
||||
var a, img;
|
||||
img = editor.dom.select('img', fig)[0];
|
||||
if (img) {
|
||||
a = editor.dom.create('a', attrs);
|
||||
img.parentNode.insertBefore(a, img);
|
||||
a.appendChild(img);
|
||||
}
|
||||
};
|
||||
var Utils = {
|
||||
link: link,
|
||||
unlink: unlink,
|
||||
isLink: isLink,
|
||||
hasLinks: hasLinks,
|
||||
isOnlyTextSelected: isOnlyTextSelected,
|
||||
getAnchorElement: getAnchorElement,
|
||||
getAnchorText: getAnchorText,
|
||||
toggleTargetRules: toggleTargetRules
|
||||
};
|
||||
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
||||
|
||||
var global$6 = tinymce.util.Tools.resolve('tinymce.util.XHR');
|
||||
|
||||
var attachState = {};
|
||||
var createLinkList = function (editor, callback) {
|
||||
var linkList = Settings.getLinkList(editor.settings);
|
||||
if (typeof linkList === 'string') {
|
||||
global$6.send({
|
||||
url: linkList,
|
||||
success: function (text) {
|
||||
callback(editor, JSON.parse(text));
|
||||
}
|
||||
});
|
||||
} else if (typeof linkList === 'function') {
|
||||
linkList(function (list) {
|
||||
callback(editor, list);
|
||||
});
|
||||
} else {
|
||||
callback(editor, linkList);
|
||||
}
|
||||
};
|
||||
var buildListItems = function (inputList, itemCallback, startItems) {
|
||||
var appendItems = function (values, output) {
|
||||
output = output || [];
|
||||
global$4.each(values, function (item) {
|
||||
var menuItem = { text: item.text || item.title };
|
||||
if (item.menu) {
|
||||
menuItem.menu = appendItems(item.menu);
|
||||
} else {
|
||||
menuItem.value = item.value;
|
||||
if (itemCallback) {
|
||||
itemCallback(menuItem);
|
||||
}
|
||||
}
|
||||
output.push(menuItem);
|
||||
});
|
||||
return output;
|
||||
};
|
||||
return appendItems(inputList, startItems || []);
|
||||
};
|
||||
var delayedConfirm = function (editor, message, callback) {
|
||||
var rng = editor.selection.getRng();
|
||||
global$5.setEditorTimeout(editor, function () {
|
||||
editor.windowManager.confirm(message, function (state) {
|
||||
editor.selection.setRng(rng);
|
||||
callback(state);
|
||||
});
|
||||
});
|
||||
};
|
||||
var showDialog = function (editor, linkList) {
|
||||
var data = {};
|
||||
var selection = editor.selection;
|
||||
var dom = editor.dom;
|
||||
var anchorElm, initialText;
|
||||
var win, onlyText, textListCtrl, linkListCtrl, relListCtrl, targetListCtrl, classListCtrl, linkTitleCtrl, value;
|
||||
var linkListChangeHandler = function (e) {
|
||||
var textCtrl = win.find('#text');
|
||||
if (!textCtrl.value() || e.lastControl && textCtrl.value() === e.lastControl.text()) {
|
||||
textCtrl.value(e.control.text());
|
||||
}
|
||||
win.find('#href').value(e.control.value());
|
||||
};
|
||||
var buildAnchorListControl = function (url) {
|
||||
var anchorList = [];
|
||||
global$4.each(editor.dom.select('a:not([href])'), function (anchor) {
|
||||
var id = anchor.name || anchor.id;
|
||||
if (id) {
|
||||
anchorList.push({
|
||||
text: id,
|
||||
value: '#' + id,
|
||||
selected: url.indexOf('#' + id) !== -1
|
||||
});
|
||||
}
|
||||
});
|
||||
if (anchorList.length) {
|
||||
anchorList.unshift({
|
||||
text: 'None',
|
||||
value: ''
|
||||
});
|
||||
return {
|
||||
name: 'anchor',
|
||||
type: 'listbox',
|
||||
label: 'Anchors',
|
||||
values: anchorList,
|
||||
onselect: linkListChangeHandler
|
||||
};
|
||||
}
|
||||
};
|
||||
var updateText = function () {
|
||||
if (!initialText && onlyText && !data.text) {
|
||||
this.parent().parent().find('#text')[0].value(this.value());
|
||||
}
|
||||
};
|
||||
var urlChange = function (e) {
|
||||
var meta = e.meta || {};
|
||||
if (linkListCtrl) {
|
||||
linkListCtrl.value(editor.convertURL(this.value(), 'href'));
|
||||
}
|
||||
global$4.each(e.meta, function (value, key) {
|
||||
var inp = win.find('#' + key);
|
||||
if (key === 'text') {
|
||||
if (initialText.length === 0) {
|
||||
inp.value(value);
|
||||
data.text = value;
|
||||
}
|
||||
} else {
|
||||
inp.value(value);
|
||||
}
|
||||
});
|
||||
if (meta.attach) {
|
||||
attachState = {
|
||||
href: this.value(),
|
||||
attach: meta.attach
|
||||
};
|
||||
}
|
||||
if (!meta.text) {
|
||||
updateText.call(this);
|
||||
}
|
||||
};
|
||||
var onBeforeCall = function (e) {
|
||||
e.meta = win.toJSON();
|
||||
};
|
||||
onlyText = Utils.isOnlyTextSelected(selection.getContent());
|
||||
anchorElm = Utils.getAnchorElement(editor);
|
||||
data.text = initialText = Utils.getAnchorText(editor.selection, anchorElm);
|
||||
data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : '';
|
||||
if (anchorElm) {
|
||||
data.target = dom.getAttrib(anchorElm, 'target');
|
||||
} else if (Settings.hasDefaultLinkTarget(editor.settings)) {
|
||||
data.target = Settings.getDefaultLinkTarget(editor.settings);
|
||||
}
|
||||
if (value = dom.getAttrib(anchorElm, 'rel')) {
|
||||
data.rel = value;
|
||||
}
|
||||
if (value = dom.getAttrib(anchorElm, 'class')) {
|
||||
data.class = value;
|
||||
}
|
||||
if (value = dom.getAttrib(anchorElm, 'title')) {
|
||||
data.title = value;
|
||||
}
|
||||
if (onlyText) {
|
||||
textListCtrl = {
|
||||
name: 'text',
|
||||
type: 'textbox',
|
||||
size: 40,
|
||||
label: 'Text to display',
|
||||
onchange: function () {
|
||||
data.text = this.value();
|
||||
}
|
||||
};
|
||||
}
|
||||
if (linkList) {
|
||||
linkListCtrl = {
|
||||
type: 'listbox',
|
||||
label: 'Link list',
|
||||
values: buildListItems(linkList, function (item) {
|
||||
item.value = editor.convertURL(item.value || item.url, 'href');
|
||||
}, [{
|
||||
text: 'None',
|
||||
value: ''
|
||||
}]),
|
||||
onselect: linkListChangeHandler,
|
||||
value: editor.convertURL(data.href, 'href'),
|
||||
onPostRender: function () {
|
||||
linkListCtrl = this;
|
||||
}
|
||||
};
|
||||
}
|
||||
if (Settings.shouldShowTargetList(editor.settings)) {
|
||||
if (Settings.getTargetList(editor.settings) === undefined) {
|
||||
Settings.setTargetList(editor, [
|
||||
{
|
||||
text: 'None',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
text: 'New window',
|
||||
value: '_blank'
|
||||
}
|
||||
]);
|
||||
}
|
||||
targetListCtrl = {
|
||||
name: 'target',
|
||||
type: 'listbox',
|
||||
label: 'Target',
|
||||
values: buildListItems(Settings.getTargetList(editor.settings))
|
||||
};
|
||||
}
|
||||
if (Settings.hasRelList(editor.settings)) {
|
||||
relListCtrl = {
|
||||
name: 'rel',
|
||||
type: 'listbox',
|
||||
label: 'Rel',
|
||||
values: buildListItems(Settings.getRelList(editor.settings), function (item) {
|
||||
if (Settings.allowUnsafeLinkTarget(editor.settings) === false) {
|
||||
item.value = Utils.toggleTargetRules(item.value, data.target === '_blank');
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
if (Settings.hasLinkClassList(editor.settings)) {
|
||||
classListCtrl = {
|
||||
name: 'class',
|
||||
type: 'listbox',
|
||||
label: 'Class',
|
||||
values: buildListItems(Settings.getLinkClassList(editor.settings), function (item) {
|
||||
if (item.value) {
|
||||
item.textStyle = function () {
|
||||
return editor.formatter.getCssText({
|
||||
inline: 'a',
|
||||
classes: [item.value]
|
||||
});
|
||||
};
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
if (Settings.shouldShowLinkTitle(editor.settings)) {
|
||||
linkTitleCtrl = {
|
||||
name: 'title',
|
||||
type: 'textbox',
|
||||
label: 'Title',
|
||||
value: data.title
|
||||
};
|
||||
}
|
||||
win = editor.windowManager.open({
|
||||
title: 'Insert link',
|
||||
data: data,
|
||||
body: [
|
||||
{
|
||||
name: 'href',
|
||||
type: 'filepicker',
|
||||
filetype: 'file',
|
||||
size: 40,
|
||||
autofocus: true,
|
||||
label: 'Url',
|
||||
onchange: urlChange,
|
||||
onkeyup: updateText,
|
||||
onpaste: updateText,
|
||||
onbeforecall: onBeforeCall
|
||||
},
|
||||
textListCtrl,
|
||||
linkTitleCtrl,
|
||||
buildAnchorListControl(data.href),
|
||||
linkListCtrl,
|
||||
relListCtrl,
|
||||
targetListCtrl,
|
||||
classListCtrl
|
||||
],
|
||||
onSubmit: function (e) {
|
||||
var assumeExternalTargets = Settings.assumeExternalTargets(editor.settings);
|
||||
var insertLink = Utils.link(editor, attachState);
|
||||
var removeLink = Utils.unlink(editor);
|
||||
var resultData = global$4.extend({}, data, e.data);
|
||||
var href = resultData.href;
|
||||
if (!href) {
|
||||
removeLink();
|
||||
return;
|
||||
}
|
||||
if (!onlyText || resultData.text === initialText) {
|
||||
delete resultData.text;
|
||||
}
|
||||
if (href.indexOf('@') > 0 && href.indexOf('//') === -1 && href.indexOf('mailto:') === -1) {
|
||||
delayedConfirm(editor, 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?', function (state) {
|
||||
if (state) {
|
||||
resultData.href = 'mailto:' + href;
|
||||
}
|
||||
insertLink(resultData);
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (assumeExternalTargets === true && !/^\w+:/i.test(href) || assumeExternalTargets === false && /^\s*www[\.|\d\.]/i.test(href)) {
|
||||
delayedConfirm(editor, 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', function (state) {
|
||||
if (state) {
|
||||
resultData.href = 'http://' + href;
|
||||
}
|
||||
insertLink(resultData);
|
||||
});
|
||||
return;
|
||||
}
|
||||
insertLink(resultData);
|
||||
}
|
||||
});
|
||||
};
|
||||
var open$1 = function (editor) {
|
||||
createLinkList(editor, showDialog);
|
||||
};
|
||||
var Dialog = { open: open$1 };
|
||||
|
||||
var getLink = function (editor, elm) {
|
||||
return editor.dom.getParent(elm, 'a[href]');
|
||||
};
|
||||
var getSelectedLink = function (editor) {
|
||||
return getLink(editor, editor.selection.getStart());
|
||||
};
|
||||
var getHref = function (elm) {
|
||||
var href = elm.getAttribute('data-mce-href');
|
||||
return href ? href : elm.getAttribute('href');
|
||||
};
|
||||
var isContextMenuVisible = function (editor) {
|
||||
var contextmenu = editor.plugins.contextmenu;
|
||||
return contextmenu ? contextmenu.isContextMenuVisible() : false;
|
||||
};
|
||||
var hasOnlyAltModifier = function (e) {
|
||||
return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;
|
||||
};
|
||||
var gotoLink = function (editor, a) {
|
||||
if (a) {
|
||||
var href = getHref(a);
|
||||
if (/^#/.test(href)) {
|
||||
var targetEl = editor.$(href);
|
||||
if (targetEl.length) {
|
||||
editor.selection.scrollIntoView(targetEl[0], true);
|
||||
}
|
||||
} else {
|
||||
OpenUrl.open(a.href);
|
||||
}
|
||||
}
|
||||
};
|
||||
var openDialog = function (editor) {
|
||||
return function () {
|
||||
Dialog.open(editor);
|
||||
};
|
||||
};
|
||||
var gotoSelectedLink = function (editor) {
|
||||
return function () {
|
||||
gotoLink(editor, getSelectedLink(editor));
|
||||
};
|
||||
};
|
||||
var leftClickedOnAHref = function (editor) {
|
||||
return function (elm) {
|
||||
var sel, rng, node;
|
||||
if (Settings.hasContextToolbar(editor.settings) && !isContextMenuVisible(editor) && Utils.isLink(elm)) {
|
||||
sel = editor.selection;
|
||||
rng = sel.getRng();
|
||||
node = rng.startContainer;
|
||||
if (node.nodeType === 3 && sel.isCollapsed() && rng.startOffset > 0 && rng.startOffset < node.data.length) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
};
|
||||
var setupGotoLinks = function (editor) {
|
||||
editor.on('click', function (e) {
|
||||
var link = getLink(editor, e.target);
|
||||
if (link && global$1.metaKeyPressed(e)) {
|
||||
e.preventDefault();
|
||||
gotoLink(editor, link);
|
||||
}
|
||||
});
|
||||
editor.on('keydown', function (e) {
|
||||
var link = getSelectedLink(editor);
|
||||
if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) {
|
||||
e.preventDefault();
|
||||
gotoLink(editor, link);
|
||||
}
|
||||
});
|
||||
};
|
||||
var toggleActiveState = function (editor) {
|
||||
return function () {
|
||||
var self = this;
|
||||
editor.on('nodechange', function (e) {
|
||||
self.active(!editor.readonly && !!Utils.getAnchorElement(editor, e.element));
|
||||
});
|
||||
};
|
||||
};
|
||||
var toggleViewLinkState = function (editor) {
|
||||
return function () {
|
||||
var self = this;
|
||||
var toggleVisibility = function (e) {
|
||||
if (Utils.hasLinks(e.parents)) {
|
||||
self.show();
|
||||
} else {
|
||||
self.hide();
|
||||
}
|
||||
};
|
||||
if (!Utils.hasLinks(editor.dom.getParents(editor.selection.getStart()))) {
|
||||
self.hide();
|
||||
}
|
||||
editor.on('nodechange', toggleVisibility);
|
||||
self.on('remove', function () {
|
||||
editor.off('nodechange', toggleVisibility);
|
||||
});
|
||||
};
|
||||
};
|
||||
var Actions = {
|
||||
openDialog: openDialog,
|
||||
gotoSelectedLink: gotoSelectedLink,
|
||||
leftClickedOnAHref: leftClickedOnAHref,
|
||||
setupGotoLinks: setupGotoLinks,
|
||||
toggleActiveState: toggleActiveState,
|
||||
toggleViewLinkState: toggleViewLinkState
|
||||
};
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceLink', Actions.openDialog(editor));
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var setup = function (editor) {
|
||||
editor.addShortcut('Meta+K', '', Actions.openDialog(editor));
|
||||
};
|
||||
var Keyboard = { setup: setup };
|
||||
|
||||
var setupButtons = function (editor) {
|
||||
editor.addButton('link', {
|
||||
active: false,
|
||||
icon: 'link',
|
||||
tooltip: 'Insert/edit link',
|
||||
onclick: Actions.openDialog(editor),
|
||||
onpostrender: Actions.toggleActiveState(editor)
|
||||
});
|
||||
editor.addButton('unlink', {
|
||||
active: false,
|
||||
icon: 'unlink',
|
||||
tooltip: 'Remove link',
|
||||
onclick: Utils.unlink(editor),
|
||||
onpostrender: Actions.toggleActiveState(editor)
|
||||
});
|
||||
if (editor.addContextToolbar) {
|
||||
editor.addButton('openlink', {
|
||||
icon: 'newtab',
|
||||
tooltip: 'Open link',
|
||||
onclick: Actions.gotoSelectedLink(editor)
|
||||
});
|
||||
}
|
||||
};
|
||||
var setupMenuItems = function (editor) {
|
||||
editor.addMenuItem('openlink', {
|
||||
text: 'Open link',
|
||||
icon: 'newtab',
|
||||
onclick: Actions.gotoSelectedLink(editor),
|
||||
onPostRender: Actions.toggleViewLinkState(editor),
|
||||
prependToContext: true
|
||||
});
|
||||
editor.addMenuItem('link', {
|
||||
icon: 'link',
|
||||
text: 'Link',
|
||||
shortcut: 'Meta+K',
|
||||
onclick: Actions.openDialog(editor),
|
||||
stateSelector: 'a[href]',
|
||||
context: 'insert',
|
||||
prependToContext: true
|
||||
});
|
||||
editor.addMenuItem('unlink', {
|
||||
icon: 'unlink',
|
||||
text: 'Remove link',
|
||||
onclick: Utils.unlink(editor),
|
||||
stateSelector: 'a[href]'
|
||||
});
|
||||
};
|
||||
var setupContextToolbars = function (editor) {
|
||||
if (editor.addContextToolbar) {
|
||||
editor.addContextToolbar(Actions.leftClickedOnAHref(editor), 'openlink | link unlink');
|
||||
}
|
||||
};
|
||||
var Controls = {
|
||||
setupButtons: setupButtons,
|
||||
setupMenuItems: setupMenuItems,
|
||||
setupContextToolbars: setupContextToolbars
|
||||
};
|
||||
|
||||
global.add('link', function (editor) {
|
||||
Controls.setupButtons(editor);
|
||||
Controls.setupMenuItems(editor);
|
||||
Controls.setupContextToolbars(editor);
|
||||
Actions.setupGotoLinks(editor);
|
||||
Commands.register(editor);
|
||||
Keyboard.setup(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}(window));
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/link/plugin.min.js
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
(function () {
|
||||
var nonbreaking = (function () {
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var stringRepeat = function (string, repeats) {
|
||||
var str = '';
|
||||
for (var index = 0; index < repeats; index++) {
|
||||
str += string;
|
||||
}
|
||||
return str;
|
||||
};
|
||||
var isVisualCharsEnabled = function (editor) {
|
||||
return editor.plugins.visualchars ? editor.plugins.visualchars.isEnabled() : false;
|
||||
};
|
||||
var insertNbsp = function (editor, times) {
|
||||
var nbsp = isVisualCharsEnabled(editor) ? '<span class="mce-nbsp"> </span>' : ' ';
|
||||
editor.insertContent(stringRepeat(nbsp, times));
|
||||
editor.dom.setAttrib(editor.dom.select('span.mce-nbsp'), 'data-mce-bogus', '1');
|
||||
};
|
||||
var Actions = { insertNbsp: insertNbsp };
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceNonBreaking', function () {
|
||||
Actions.insertNbsp(editor, 1);
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK');
|
||||
|
||||
var getKeyboardSpaces = function (editor) {
|
||||
var spaces = editor.getParam('nonbreaking_force_tab', 0);
|
||||
if (typeof spaces === 'boolean') {
|
||||
return spaces === true ? 3 : 0;
|
||||
} else {
|
||||
return spaces;
|
||||
}
|
||||
};
|
||||
var Settings = { getKeyboardSpaces: getKeyboardSpaces };
|
||||
|
||||
var setup = function (editor) {
|
||||
var spaces = Settings.getKeyboardSpaces(editor);
|
||||
if (spaces > 0) {
|
||||
editor.on('keydown', function (e) {
|
||||
if (e.keyCode === global$1.TAB && !e.isDefaultPrevented()) {
|
||||
if (e.shiftKey) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
Actions.insertNbsp(editor, spaces);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var Keyboard = { setup: setup };
|
||||
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('nonbreaking', {
|
||||
title: 'Nonbreaking space',
|
||||
cmd: 'mceNonBreaking'
|
||||
});
|
||||
editor.addMenuItem('nonbreaking', {
|
||||
icon: 'nonbreaking',
|
||||
text: 'Nonbreaking space',
|
||||
cmd: 'mceNonBreaking',
|
||||
context: 'insert'
|
||||
});
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('nonbreaking', function (editor) {
|
||||
Commands.register(editor);
|
||||
Buttons.register(editor);
|
||||
Keyboard.setup(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/nonbreaking/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n,e){var t,i=(t=n).plugins.visualchars&&t.plugins.visualchars.isEnabled()?'<span class="mce-nbsp"> </span>':" ";n.insertContent(function(n,e){for(var t="",i=0;i<e;i++)t+=n;return t}(i,e)),n.dom.setAttrib(n.dom.select("span.mce-nbsp"),"data-mce-bogus","1")},e=function(n){n.addCommand("mceNonBreaking",function(){i(n,1)})},o=tinymce.util.Tools.resolve("tinymce.util.VK"),a=function(n){var e=n.getParam("nonbreaking_force_tab",0);return"boolean"==typeof e?!0===e?3:0:e},t=function(e){var t=a(e);0<t&&e.on("keydown",function(n){if(n.keyCode===o.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),i(e,t)}})},r=function(n){n.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),n.addMenuItem("nonbreaking",{icon:"nonbreaking",text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"})};n.add("nonbreaking",function(n){e(n),r(n),t(n)})}();
|
||||
44
html/wp-content/plugins/tinymce-advanced/mce/print/plugin.js
Normal file
@@ -0,0 +1,44 @@
|
||||
(function () {
|
||||
var print = (function () {
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mcePrint', function () {
|
||||
if (global$1.ie && global$1.ie <= 11) {
|
||||
editor.getDoc().execCommand('print', false, null);
|
||||
} else {
|
||||
editor.getWin().print();
|
||||
}
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('print', {
|
||||
title: 'Print',
|
||||
cmd: 'mcePrint'
|
||||
});
|
||||
editor.addMenuItem('print', {
|
||||
text: 'Print',
|
||||
cmd: 'mcePrint',
|
||||
icon: 'print'
|
||||
});
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('print', function (editor) {
|
||||
Commands.register(editor);
|
||||
Buttons.register(editor);
|
||||
editor.addShortcut('Meta+P', '', 'mcePrint');
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/print/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),i=function(t){t.addCommand("mcePrint",function(){n.ie&&n.ie<=11?t.getDoc().execCommand("print",!1,null):t.getWin().print()})},e=function(t){t.addButton("print",{title:"Print",cmd:"mcePrint"}),t.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print"})};t.add("print",function(t){i(t),e(t),t.addShortcut("Meta+P","","mcePrint")})}();
|
||||
@@ -0,0 +1,601 @@
|
||||
(function () {
|
||||
var searchreplace = (function () {
|
||||
'use strict';
|
||||
|
||||
var Cell = function (initial) {
|
||||
var value = initial;
|
||||
var get = function () {
|
||||
return value;
|
||||
};
|
||||
var set = function (v) {
|
||||
value = v;
|
||||
};
|
||||
var clone = function () {
|
||||
return Cell(get());
|
||||
};
|
||||
return {
|
||||
get: get,
|
||||
set: set,
|
||||
clone: clone
|
||||
};
|
||||
};
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
function isContentEditableFalse(node) {
|
||||
return node && node.nodeType === 1 && node.contentEditable === 'false';
|
||||
}
|
||||
function findAndReplaceDOMText(regex, node, replacementNode, captureGroup, schema) {
|
||||
var m;
|
||||
var matches = [];
|
||||
var text, count = 0, doc;
|
||||
var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
|
||||
doc = node.ownerDocument;
|
||||
blockElementsMap = schema.getBlockElements();
|
||||
hiddenTextElementsMap = schema.getWhiteSpaceElements();
|
||||
shortEndedElementsMap = schema.getShortEndedElements();
|
||||
function getMatchIndexes(m, captureGroup) {
|
||||
captureGroup = captureGroup || 0;
|
||||
if (!m[0]) {
|
||||
throw new Error('findAndReplaceDOMText cannot handle zero-length matches');
|
||||
}
|
||||
var index = m.index;
|
||||
if (captureGroup > 0) {
|
||||
var cg = m[captureGroup];
|
||||
if (!cg) {
|
||||
throw new Error('Invalid capture group');
|
||||
}
|
||||
index += m[0].indexOf(cg);
|
||||
m[0] = cg;
|
||||
}
|
||||
return [
|
||||
index,
|
||||
index + m[0].length,
|
||||
[m[0]]
|
||||
];
|
||||
}
|
||||
function getText(node) {
|
||||
var txt;
|
||||
if (node.nodeType === 3) {
|
||||
return node.data;
|
||||
}
|
||||
if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) {
|
||||
return '';
|
||||
}
|
||||
txt = '';
|
||||
if (isContentEditableFalse(node)) {
|
||||
return '\n';
|
||||
}
|
||||
if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) {
|
||||
txt += '\n';
|
||||
}
|
||||
if (node = node.firstChild) {
|
||||
do {
|
||||
txt += getText(node);
|
||||
} while (node = node.nextSibling);
|
||||
}
|
||||
return txt;
|
||||
}
|
||||
function stepThroughMatches(node, matches, replaceFn) {
|
||||
var startNode, endNode, startNodeIndex, endNodeIndex, innerNodes = [], atIndex = 0, curNode = node, matchLocation = matches.shift(), matchIndex = 0;
|
||||
out:
|
||||
while (true) {
|
||||
if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName] || isContentEditableFalse(curNode)) {
|
||||
atIndex++;
|
||||
}
|
||||
if (curNode.nodeType === 3) {
|
||||
if (!endNode && curNode.length + atIndex >= matchLocation[1]) {
|
||||
endNode = curNode;
|
||||
endNodeIndex = matchLocation[1] - atIndex;
|
||||
} else if (startNode) {
|
||||
innerNodes.push(curNode);
|
||||
}
|
||||
if (!startNode && curNode.length + atIndex > matchLocation[0]) {
|
||||
startNode = curNode;
|
||||
startNodeIndex = matchLocation[0] - atIndex;
|
||||
}
|
||||
atIndex += curNode.length;
|
||||
}
|
||||
if (startNode && endNode) {
|
||||
curNode = replaceFn({
|
||||
startNode: startNode,
|
||||
startNodeIndex: startNodeIndex,
|
||||
endNode: endNode,
|
||||
endNodeIndex: endNodeIndex,
|
||||
innerNodes: innerNodes,
|
||||
match: matchLocation[2],
|
||||
matchIndex: matchIndex
|
||||
});
|
||||
atIndex -= endNode.length - endNodeIndex;
|
||||
startNode = null;
|
||||
endNode = null;
|
||||
innerNodes = [];
|
||||
matchLocation = matches.shift();
|
||||
matchIndex++;
|
||||
if (!matchLocation) {
|
||||
break;
|
||||
}
|
||||
} else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) {
|
||||
if (!isContentEditableFalse(curNode)) {
|
||||
curNode = curNode.firstChild;
|
||||
continue;
|
||||
}
|
||||
} else if (curNode.nextSibling) {
|
||||
curNode = curNode.nextSibling;
|
||||
continue;
|
||||
}
|
||||
while (true) {
|
||||
if (curNode.nextSibling) {
|
||||
curNode = curNode.nextSibling;
|
||||
break;
|
||||
} else if (curNode.parentNode !== node) {
|
||||
curNode = curNode.parentNode;
|
||||
} else {
|
||||
break out;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function genReplacer(nodeName) {
|
||||
var makeReplacementNode;
|
||||
if (typeof nodeName !== 'function') {
|
||||
var stencilNode_1 = nodeName.nodeType ? nodeName : doc.createElement(nodeName);
|
||||
makeReplacementNode = function (fill, matchIndex) {
|
||||
var clone = stencilNode_1.cloneNode(false);
|
||||
clone.setAttribute('data-mce-index', matchIndex);
|
||||
if (fill) {
|
||||
clone.appendChild(doc.createTextNode(fill));
|
||||
}
|
||||
return clone;
|
||||
};
|
||||
} else {
|
||||
makeReplacementNode = nodeName;
|
||||
}
|
||||
return function (range) {
|
||||
var before;
|
||||
var after;
|
||||
var parentNode;
|
||||
var startNode = range.startNode;
|
||||
var endNode = range.endNode;
|
||||
var matchIndex = range.matchIndex;
|
||||
if (startNode === endNode) {
|
||||
var node_1 = startNode;
|
||||
parentNode = node_1.parentNode;
|
||||
if (range.startNodeIndex > 0) {
|
||||
before = doc.createTextNode(node_1.data.substring(0, range.startNodeIndex));
|
||||
parentNode.insertBefore(before, node_1);
|
||||
}
|
||||
var el = makeReplacementNode(range.match[0], matchIndex);
|
||||
parentNode.insertBefore(el, node_1);
|
||||
if (range.endNodeIndex < node_1.length) {
|
||||
after = doc.createTextNode(node_1.data.substring(range.endNodeIndex));
|
||||
parentNode.insertBefore(after, node_1);
|
||||
}
|
||||
node_1.parentNode.removeChild(node_1);
|
||||
return el;
|
||||
}
|
||||
before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
|
||||
after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
|
||||
var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
|
||||
for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
|
||||
var innerNode = range.innerNodes[i];
|
||||
var innerEl = makeReplacementNode(innerNode.data, matchIndex);
|
||||
innerNode.parentNode.replaceChild(innerEl, innerNode);
|
||||
}
|
||||
var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
|
||||
parentNode = startNode.parentNode;
|
||||
parentNode.insertBefore(before, startNode);
|
||||
parentNode.insertBefore(elA, startNode);
|
||||
parentNode.removeChild(startNode);
|
||||
parentNode = endNode.parentNode;
|
||||
parentNode.insertBefore(elB, endNode);
|
||||
parentNode.insertBefore(after, endNode);
|
||||
parentNode.removeChild(endNode);
|
||||
return elB;
|
||||
};
|
||||
}
|
||||
text = getText(node);
|
||||
if (!text) {
|
||||
return;
|
||||
}
|
||||
if (regex.global) {
|
||||
while (m = regex.exec(text)) {
|
||||
matches.push(getMatchIndexes(m, captureGroup));
|
||||
}
|
||||
} else {
|
||||
m = text.match(regex);
|
||||
matches.push(getMatchIndexes(m, captureGroup));
|
||||
}
|
||||
if (matches.length) {
|
||||
count = matches.length;
|
||||
stepThroughMatches(node, matches, genReplacer(replacementNode));
|
||||
}
|
||||
return count;
|
||||
}
|
||||
var FindReplaceText = { findAndReplaceDOMText: findAndReplaceDOMText };
|
||||
|
||||
var getElmIndex = function (elm) {
|
||||
var value = elm.getAttribute('data-mce-index');
|
||||
if (typeof value === 'number') {
|
||||
return '' + value;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
var markAllMatches = function (editor, currentIndexState, regex) {
|
||||
var node, marker;
|
||||
marker = editor.dom.create('span', { 'data-mce-bogus': 1 });
|
||||
marker.className = 'mce-match-marker';
|
||||
node = editor.getBody();
|
||||
done(editor, currentIndexState, false);
|
||||
return FindReplaceText.findAndReplaceDOMText(regex, node, marker, false, editor.schema);
|
||||
};
|
||||
var unwrap = function (node) {
|
||||
var parentNode = node.parentNode;
|
||||
if (node.firstChild) {
|
||||
parentNode.insertBefore(node.firstChild, node);
|
||||
}
|
||||
node.parentNode.removeChild(node);
|
||||
};
|
||||
var findSpansByIndex = function (editor, index) {
|
||||
var nodes;
|
||||
var spans = [];
|
||||
nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
|
||||
if (nodes.length) {
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var nodeIndex = getElmIndex(nodes[i]);
|
||||
if (nodeIndex === null || !nodeIndex.length) {
|
||||
continue;
|
||||
}
|
||||
if (nodeIndex === index.toString()) {
|
||||
spans.push(nodes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return spans;
|
||||
};
|
||||
var moveSelection = function (editor, currentIndexState, forward) {
|
||||
var testIndex = currentIndexState.get();
|
||||
var dom = editor.dom;
|
||||
forward = forward !== false;
|
||||
if (forward) {
|
||||
testIndex++;
|
||||
} else {
|
||||
testIndex--;
|
||||
}
|
||||
dom.removeClass(findSpansByIndex(editor, currentIndexState.get()), 'mce-match-marker-selected');
|
||||
var spans = findSpansByIndex(editor, testIndex);
|
||||
if (spans.length) {
|
||||
dom.addClass(findSpansByIndex(editor, testIndex), 'mce-match-marker-selected');
|
||||
editor.selection.scrollIntoView(spans[0]);
|
||||
return testIndex;
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
var removeNode = function (dom, node) {
|
||||
var parent = node.parentNode;
|
||||
dom.remove(node);
|
||||
if (dom.isEmpty(parent)) {
|
||||
dom.remove(parent);
|
||||
}
|
||||
};
|
||||
var find = function (editor, currentIndexState, text, matchCase, wholeWord) {
|
||||
text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
||||
text = text.replace(/\s/g, '[^\\S\\r\\n]');
|
||||
text = wholeWord ? '\\b' + text + '\\b' : text;
|
||||
var count = markAllMatches(editor, currentIndexState, new RegExp(text, matchCase ? 'g' : 'gi'));
|
||||
if (count) {
|
||||
currentIndexState.set(-1);
|
||||
currentIndexState.set(moveSelection(editor, currentIndexState, true));
|
||||
}
|
||||
return count;
|
||||
};
|
||||
var next = function (editor, currentIndexState) {
|
||||
var index = moveSelection(editor, currentIndexState, true);
|
||||
if (index !== -1) {
|
||||
currentIndexState.set(index);
|
||||
}
|
||||
};
|
||||
var prev = function (editor, currentIndexState) {
|
||||
var index = moveSelection(editor, currentIndexState, false);
|
||||
if (index !== -1) {
|
||||
currentIndexState.set(index);
|
||||
}
|
||||
};
|
||||
var isMatchSpan = function (node) {
|
||||
var matchIndex = getElmIndex(node);
|
||||
return matchIndex !== null && matchIndex.length > 0;
|
||||
};
|
||||
var replace = function (editor, currentIndexState, text, forward, all) {
|
||||
var i, nodes, node, matchIndex, currentMatchIndex, nextIndex = currentIndexState.get(), hasMore;
|
||||
forward = forward !== false;
|
||||
node = editor.getBody();
|
||||
nodes = global$1.grep(global$1.toArray(node.getElementsByTagName('span')), isMatchSpan);
|
||||
for (i = 0; i < nodes.length; i++) {
|
||||
var nodeIndex = getElmIndex(nodes[i]);
|
||||
matchIndex = currentMatchIndex = parseInt(nodeIndex, 10);
|
||||
if (all || matchIndex === currentIndexState.get()) {
|
||||
if (text.length) {
|
||||
nodes[i].firstChild.nodeValue = text;
|
||||
unwrap(nodes[i]);
|
||||
} else {
|
||||
removeNode(editor.dom, nodes[i]);
|
||||
}
|
||||
while (nodes[++i]) {
|
||||
matchIndex = parseInt(getElmIndex(nodes[i]), 10);
|
||||
if (matchIndex === currentMatchIndex) {
|
||||
removeNode(editor.dom, nodes[i]);
|
||||
} else {
|
||||
i--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (forward) {
|
||||
nextIndex--;
|
||||
}
|
||||
} else if (currentMatchIndex > currentIndexState.get()) {
|
||||
nodes[i].setAttribute('data-mce-index', currentMatchIndex - 1);
|
||||
}
|
||||
}
|
||||
currentIndexState.set(nextIndex);
|
||||
if (forward) {
|
||||
hasMore = hasNext(editor, currentIndexState);
|
||||
next(editor, currentIndexState);
|
||||
} else {
|
||||
hasMore = hasPrev(editor, currentIndexState);
|
||||
prev(editor, currentIndexState);
|
||||
}
|
||||
return !all && hasMore;
|
||||
};
|
||||
var done = function (editor, currentIndexState, keepEditorSelection) {
|
||||
var i, nodes, startContainer, endContainer;
|
||||
nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
|
||||
for (i = 0; i < nodes.length; i++) {
|
||||
var nodeIndex = getElmIndex(nodes[i]);
|
||||
if (nodeIndex !== null && nodeIndex.length) {
|
||||
if (nodeIndex === currentIndexState.get().toString()) {
|
||||
if (!startContainer) {
|
||||
startContainer = nodes[i].firstChild;
|
||||
}
|
||||
endContainer = nodes[i].firstChild;
|
||||
}
|
||||
unwrap(nodes[i]);
|
||||
}
|
||||
}
|
||||
if (startContainer && endContainer) {
|
||||
var rng = editor.dom.createRng();
|
||||
rng.setStart(startContainer, 0);
|
||||
rng.setEnd(endContainer, endContainer.data.length);
|
||||
if (keepEditorSelection !== false) {
|
||||
editor.selection.setRng(rng);
|
||||
}
|
||||
return rng;
|
||||
}
|
||||
};
|
||||
var hasNext = function (editor, currentIndexState) {
|
||||
return findSpansByIndex(editor, currentIndexState.get() + 1).length > 0;
|
||||
};
|
||||
var hasPrev = function (editor, currentIndexState) {
|
||||
return findSpansByIndex(editor, currentIndexState.get() - 1).length > 0;
|
||||
};
|
||||
var Actions = {
|
||||
done: done,
|
||||
find: find,
|
||||
next: next,
|
||||
prev: prev,
|
||||
replace: replace,
|
||||
hasNext: hasNext,
|
||||
hasPrev: hasPrev
|
||||
};
|
||||
|
||||
var get = function (editor, currentIndexState) {
|
||||
var done = function (keepEditorSelection) {
|
||||
return Actions.done(editor, currentIndexState, keepEditorSelection);
|
||||
};
|
||||
var find = function (text, matchCase, wholeWord) {
|
||||
return Actions.find(editor, currentIndexState, text, matchCase, wholeWord);
|
||||
};
|
||||
var next = function () {
|
||||
return Actions.next(editor, currentIndexState);
|
||||
};
|
||||
var prev = function () {
|
||||
return Actions.prev(editor, currentIndexState);
|
||||
};
|
||||
var replace = function (text, forward, all) {
|
||||
return Actions.replace(editor, currentIndexState, text, forward, all);
|
||||
};
|
||||
return {
|
||||
done: done,
|
||||
find: find,
|
||||
next: next,
|
||||
prev: prev,
|
||||
replace: replace
|
||||
};
|
||||
};
|
||||
var Api = { get: get };
|
||||
|
||||
var open = function (editor, currentIndexState) {
|
||||
var last = {}, selectedText;
|
||||
editor.undoManager.add();
|
||||
selectedText = global$1.trim(editor.selection.getContent({ format: 'text' }));
|
||||
function updateButtonStates() {
|
||||
win.statusbar.find('#next').disabled(Actions.hasNext(editor, currentIndexState) === false);
|
||||
win.statusbar.find('#prev').disabled(Actions.hasPrev(editor, currentIndexState) === false);
|
||||
}
|
||||
function notFoundAlert() {
|
||||
editor.windowManager.alert('Could not find the specified string.', function () {
|
||||
win.find('#find')[0].focus();
|
||||
});
|
||||
}
|
||||
var win = editor.windowManager.open({
|
||||
layout: 'flex',
|
||||
pack: 'center',
|
||||
align: 'center',
|
||||
onClose: function () {
|
||||
editor.focus();
|
||||
Actions.done(editor, currentIndexState);
|
||||
editor.undoManager.add();
|
||||
},
|
||||
onSubmit: function (e) {
|
||||
var count, caseState, text, wholeWord;
|
||||
e.preventDefault();
|
||||
caseState = win.find('#case').checked();
|
||||
wholeWord = win.find('#words').checked();
|
||||
text = win.find('#find').value();
|
||||
if (!text.length) {
|
||||
Actions.done(editor, currentIndexState, false);
|
||||
win.statusbar.items().slice(1).disabled(true);
|
||||
return;
|
||||
}
|
||||
if (last.text === text && last.caseState === caseState && last.wholeWord === wholeWord) {
|
||||
if (!Actions.hasNext(editor, currentIndexState)) {
|
||||
notFoundAlert();
|
||||
return;
|
||||
}
|
||||
Actions.next(editor, currentIndexState);
|
||||
updateButtonStates();
|
||||
return;
|
||||
}
|
||||
count = Actions.find(editor, currentIndexState, text, caseState, wholeWord);
|
||||
if (!count) {
|
||||
notFoundAlert();
|
||||
}
|
||||
win.statusbar.items().slice(1).disabled(count === 0);
|
||||
updateButtonStates();
|
||||
last = {
|
||||
text: text,
|
||||
caseState: caseState,
|
||||
wholeWord: wholeWord
|
||||
};
|
||||
},
|
||||
buttons: [
|
||||
{
|
||||
text: 'Find',
|
||||
subtype: 'primary',
|
||||
onclick: function () {
|
||||
win.submit();
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Replace',
|
||||
disabled: true,
|
||||
onclick: function () {
|
||||
if (!Actions.replace(editor, currentIndexState, win.find('#replace').value())) {
|
||||
win.statusbar.items().slice(1).disabled(true);
|
||||
currentIndexState.set(-1);
|
||||
last = {};
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Replace all',
|
||||
disabled: true,
|
||||
onclick: function () {
|
||||
Actions.replace(editor, currentIndexState, win.find('#replace').value(), true, true);
|
||||
win.statusbar.items().slice(1).disabled(true);
|
||||
last = {};
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'spacer',
|
||||
flex: 1
|
||||
},
|
||||
{
|
||||
text: 'Prev',
|
||||
name: 'prev',
|
||||
disabled: true,
|
||||
onclick: function () {
|
||||
Actions.prev(editor, currentIndexState);
|
||||
updateButtonStates();
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Next',
|
||||
name: 'next',
|
||||
disabled: true,
|
||||
onclick: function () {
|
||||
Actions.next(editor, currentIndexState);
|
||||
updateButtonStates();
|
||||
}
|
||||
}
|
||||
],
|
||||
title: 'Find and replace',
|
||||
items: {
|
||||
type: 'form',
|
||||
padding: 20,
|
||||
labelGap: 30,
|
||||
spacing: 10,
|
||||
items: [
|
||||
{
|
||||
type: 'textbox',
|
||||
name: 'find',
|
||||
size: 40,
|
||||
label: 'Find',
|
||||
value: selectedText
|
||||
},
|
||||
{
|
||||
type: 'textbox',
|
||||
name: 'replace',
|
||||
size: 40,
|
||||
label: 'Replace with'
|
||||
},
|
||||
{
|
||||
type: 'checkbox',
|
||||
name: 'case',
|
||||
text: 'Match case',
|
||||
label: ' '
|
||||
},
|
||||
{
|
||||
type: 'checkbox',
|
||||
name: 'words',
|
||||
text: 'Whole words',
|
||||
label: ' '
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
};
|
||||
var Dialog = { open: open };
|
||||
|
||||
var register = function (editor, currentIndexState) {
|
||||
editor.addCommand('SearchReplace', function () {
|
||||
Dialog.open(editor, currentIndexState);
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var showDialog = function (editor, currentIndexState) {
|
||||
return function () {
|
||||
Dialog.open(editor, currentIndexState);
|
||||
};
|
||||
};
|
||||
var register$1 = function (editor, currentIndexState) {
|
||||
editor.addMenuItem('searchreplace', {
|
||||
text: 'Find and replace',
|
||||
shortcut: 'Meta+F',
|
||||
onclick: showDialog(editor, currentIndexState),
|
||||
separator: 'before',
|
||||
context: 'edit'
|
||||
});
|
||||
editor.addButton('searchreplace', {
|
||||
tooltip: 'Find and replace',
|
||||
onclick: showDialog(editor, currentIndexState)
|
||||
});
|
||||
editor.shortcuts.add('Meta+F', '', showDialog(editor, currentIndexState));
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('searchreplace', function (editor) {
|
||||
var currentIndexState = Cell(-1);
|
||||
Commands.register(editor, currentIndexState);
|
||||
Buttons.register(editor, currentIndexState);
|
||||
return Api.get(editor, currentIndexState);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/searchreplace/plugin.min.js
vendored
Normal file
9270
html/wp-content/plugins/tinymce-advanced/mce/table/plugin.js
Normal file
1
html/wp-content/plugins/tinymce-advanced/mce/table/plugin.min.js
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
.mce-visualblocks p {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h1 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h2 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h3 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h4 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h5 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h6 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks div:not([data-mce-bogus]) {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks section {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks article {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks blockquote {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks address {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks pre {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks figure {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks hgroup {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks aside {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks figcaption {
|
||||
border: 1px dashed #BBB;
|
||||
}
|
||||
|
||||
.mce-visualblocks ul {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks ol {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks dl {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
(function () {
|
||||
var visualblocks = (function () {
|
||||
'use strict';
|
||||
|
||||
var Cell = function (initial) {
|
||||
var value = initial;
|
||||
var get = function () {
|
||||
return value;
|
||||
};
|
||||
var set = function (v) {
|
||||
value = v;
|
||||
};
|
||||
var clone = function () {
|
||||
return Cell(get());
|
||||
};
|
||||
return {
|
||||
get: get,
|
||||
set: set,
|
||||
clone: clone
|
||||
};
|
||||
};
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var fireVisualBlocks = function (editor, state) {
|
||||
editor.fire('VisualBlocks', { state: state });
|
||||
};
|
||||
var Events = { fireVisualBlocks: fireVisualBlocks };
|
||||
|
||||
var isEnabledByDefault = function (editor) {
|
||||
return editor.getParam('visualblocks_default_state', false);
|
||||
};
|
||||
var getContentCss = function (editor) {
|
||||
return editor.settings.visualblocks_content_css;
|
||||
};
|
||||
var Settings = {
|
||||
isEnabledByDefault: isEnabledByDefault,
|
||||
getContentCss: getContentCss
|
||||
};
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var cssId = global$1.DOM.uniqueId();
|
||||
var load = function (doc, url) {
|
||||
var linkElements = global$2.toArray(doc.getElementsByTagName('link'));
|
||||
var matchingLinkElms = global$2.grep(linkElements, function (head) {
|
||||
return head.id === cssId;
|
||||
});
|
||||
if (matchingLinkElms.length === 0) {
|
||||
var linkElm = global$1.DOM.create('link', {
|
||||
id: cssId,
|
||||
rel: 'stylesheet',
|
||||
href: url
|
||||
});
|
||||
doc.getElementsByTagName('head')[0].appendChild(linkElm);
|
||||
}
|
||||
};
|
||||
var LoadCss = { load: load };
|
||||
|
||||
var toggleVisualBlocks = function (editor, pluginUrl, enabledState) {
|
||||
var dom = editor.dom;
|
||||
var contentCss = Settings.getContentCss(editor);
|
||||
LoadCss.load(editor.getDoc(), contentCss ? contentCss : pluginUrl + '/css/visualblocks.css');
|
||||
dom.toggleClass(editor.getBody(), 'mce-visualblocks');
|
||||
enabledState.set(!enabledState.get());
|
||||
Events.fireVisualBlocks(editor, enabledState.get());
|
||||
};
|
||||
var VisualBlocks = { toggleVisualBlocks: toggleVisualBlocks };
|
||||
|
||||
var register = function (editor, pluginUrl, enabledState) {
|
||||
editor.addCommand('mceVisualBlocks', function () {
|
||||
VisualBlocks.toggleVisualBlocks(editor, pluginUrl, enabledState);
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var setup = function (editor, pluginUrl, enabledState) {
|
||||
editor.on('PreviewFormats AfterPreviewFormats', function (e) {
|
||||
if (enabledState.get()) {
|
||||
editor.dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type === 'afterpreviewformats');
|
||||
}
|
||||
});
|
||||
editor.on('init', function () {
|
||||
if (Settings.isEnabledByDefault(editor)) {
|
||||
VisualBlocks.toggleVisualBlocks(editor, pluginUrl, enabledState);
|
||||
}
|
||||
});
|
||||
editor.on('remove', function () {
|
||||
editor.dom.removeClass(editor.getBody(), 'mce-visualblocks');
|
||||
});
|
||||
};
|
||||
var Bindings = { setup: setup };
|
||||
|
||||
var toggleActiveState = function (editor, enabledState) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
ctrl.active(enabledState.get());
|
||||
editor.on('VisualBlocks', function (e) {
|
||||
ctrl.active(e.state);
|
||||
});
|
||||
};
|
||||
};
|
||||
var register$1 = function (editor, enabledState) {
|
||||
editor.addButton('visualblocks', {
|
||||
active: false,
|
||||
title: 'Show blocks',
|
||||
cmd: 'mceVisualBlocks',
|
||||
onPostRender: toggleActiveState(editor, enabledState)
|
||||
});
|
||||
editor.addMenuItem('visualblocks', {
|
||||
text: 'Show blocks',
|
||||
cmd: 'mceVisualBlocks',
|
||||
onPostRender: toggleActiveState(editor, enabledState),
|
||||
selectable: true,
|
||||
context: 'view',
|
||||
prependToContext: true
|
||||
});
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('visualblocks', function (editor, pluginUrl) {
|
||||
var enabledState = Cell(false);
|
||||
Commands.register(editor, pluginUrl, enabledState);
|
||||
Buttons.register(editor, enabledState);
|
||||
Bindings.setup(editor, pluginUrl, enabledState);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/visualblocks/plugin.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";var o=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return o(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){e.fire("VisualBlocks",{state:t})},s=function(e){return e.getParam("visualblocks_default_state",!1)},c=function(e){return e.settings.visualblocks_content_css},l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=l.DOM.uniqueId(),r=function(e,t){var n=u.toArray(e.getElementsByTagName("link"));if(0===u.grep(n,function(e){return e.id===a}).length){var o=l.DOM.create("link",{id:a,rel:"stylesheet",href:t});e.getElementsByTagName("head")[0].appendChild(o)}},m=function(e,t,n){var o=e.dom,s=c(e);r(e.getDoc(),s||t+"/css/visualblocks.css"),o.toggleClass(e.getBody(),"mce-visualblocks"),n.set(!n.get()),i(e,n.get())},f=function(e,t,n){e.addCommand("mceVisualBlocks",function(){m(e,t,n)})},d=function(t,e,n){t.on("PreviewFormats AfterPreviewFormats",function(e){n.get()&&t.dom.toggleClass(t.getBody(),"mce-visualblocks","afterpreviewformats"===e.type)}),t.on("init",function(){s(t)&&m(t,e,n)}),t.on("remove",function(){t.dom.removeClass(t.getBody(),"mce-visualblocks")})},n=function(n,o){return function(e){var t=e.control;t.active(o.get()),n.on("VisualBlocks",function(e){t.active(e.state)})}},v=function(e,t){e.addButton("visualblocks",{active:!1,title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:n(e,t)}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:n(e,t),selectable:!0,context:"view",prependToContext:!0})};e.add("visualblocks",function(e,t){var n=o(!1);f(e,t,n),v(e,n),d(e,t,n)})}();
|
||||
@@ -0,0 +1,457 @@
|
||||
(function () {
|
||||
var visualchars = (function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
var Cell = function (initial) {
|
||||
var value = initial;
|
||||
var get = function () {
|
||||
return value;
|
||||
};
|
||||
var set = function (v) {
|
||||
value = v;
|
||||
};
|
||||
var clone = function () {
|
||||
return Cell(get());
|
||||
};
|
||||
return {
|
||||
get: get,
|
||||
set: set,
|
||||
clone: clone
|
||||
};
|
||||
};
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var get = function (toggleState) {
|
||||
var isEnabled = function () {
|
||||
return toggleState.get();
|
||||
};
|
||||
return { isEnabled: isEnabled };
|
||||
};
|
||||
var Api = { get: get };
|
||||
|
||||
var fireVisualChars = function (editor, state) {
|
||||
return editor.fire('VisualChars', { state: state });
|
||||
};
|
||||
var Events = { fireVisualChars: fireVisualChars };
|
||||
|
||||
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()')
|
||||
};
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
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 typeOf = function (x) {
|
||||
if (x === null) {
|
||||
return 'null';
|
||||
}
|
||||
var t = typeof x;
|
||||
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
||||
return 'array';
|
||||
}
|
||||
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
||||
return 'string';
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var isType = function (type) {
|
||||
return function (value) {
|
||||
return typeOf(value) === type;
|
||||
};
|
||||
};
|
||||
var isFunction = isType('function');
|
||||
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
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 from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
|
||||
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 ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE;
|
||||
var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE;
|
||||
var COMMENT = domGlobals.Node.COMMENT_NODE;
|
||||
var DOCUMENT = domGlobals.Node.DOCUMENT_NODE;
|
||||
var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE;
|
||||
var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE;
|
||||
var ELEMENT = domGlobals.Node.ELEMENT_NODE;
|
||||
var TEXT = domGlobals.Node.TEXT_NODE;
|
||||
var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE;
|
||||
var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE;
|
||||
var ENTITY = domGlobals.Node.ENTITY_NODE;
|
||||
var NOTATION = domGlobals.Node.NOTATION_NODE;
|
||||
|
||||
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
||||
|
||||
var type = function (element) {
|
||||
return element.dom().nodeType;
|
||||
};
|
||||
var value = function (element) {
|
||||
return element.dom().nodeValue;
|
||||
};
|
||||
var isType$1 = function (t) {
|
||||
return function (element) {
|
||||
return type(element) === t;
|
||||
};
|
||||
};
|
||||
var isText = isType$1(TEXT);
|
||||
|
||||
var charMap = {
|
||||
'\xA0': 'nbsp',
|
||||
'\xAD': 'shy'
|
||||
};
|
||||
var charMapToRegExp = function (charMap, global) {
|
||||
var key, regExp = '';
|
||||
for (key in charMap) {
|
||||
regExp += key;
|
||||
}
|
||||
return new RegExp('[' + regExp + ']', global ? 'g' : '');
|
||||
};
|
||||
var charMapToSelector = function (charMap) {
|
||||
var key, selector = '';
|
||||
for (key in charMap) {
|
||||
if (selector) {
|
||||
selector += ',';
|
||||
}
|
||||
selector += 'span.mce-' + charMap[key];
|
||||
}
|
||||
return selector;
|
||||
};
|
||||
var Data = {
|
||||
charMap: charMap,
|
||||
regExp: charMapToRegExp(charMap),
|
||||
regExpGlobal: charMapToRegExp(charMap, true),
|
||||
selector: charMapToSelector(charMap),
|
||||
charMapToRegExp: charMapToRegExp,
|
||||
charMapToSelector: charMapToSelector
|
||||
};
|
||||
|
||||
var wrapCharWithSpan = function (value) {
|
||||
return '<span data-mce-bogus="1" class="mce-' + Data.charMap[value] + '">' + value + '</span>';
|
||||
};
|
||||
var Html = { wrapCharWithSpan: wrapCharWithSpan };
|
||||
|
||||
var isMatch = function (n) {
|
||||
var value$1 = value(n);
|
||||
return isText(n) && value$1 !== undefined && Data.regExp.test(value$1);
|
||||
};
|
||||
var filterDescendants = function (scope, predicate) {
|
||||
var result = [];
|
||||
var dom = scope.dom();
|
||||
var children = map(dom.childNodes, Element.fromDom);
|
||||
each(children, function (x) {
|
||||
if (predicate(x)) {
|
||||
result = result.concat([x]);
|
||||
}
|
||||
result = result.concat(filterDescendants(x, predicate));
|
||||
});
|
||||
return result;
|
||||
};
|
||||
var findParentElm = function (elm, rootElm) {
|
||||
while (elm.parentNode) {
|
||||
if (elm.parentNode === rootElm) {
|
||||
return elm;
|
||||
}
|
||||
elm = elm.parentNode;
|
||||
}
|
||||
};
|
||||
var replaceWithSpans = function (text) {
|
||||
return text.replace(Data.regExpGlobal, Html.wrapCharWithSpan);
|
||||
};
|
||||
var Nodes = {
|
||||
isMatch: isMatch,
|
||||
filterDescendants: filterDescendants,
|
||||
findParentElm: findParentElm,
|
||||
replaceWithSpans: replaceWithSpans
|
||||
};
|
||||
|
||||
var show = function (editor, rootElm) {
|
||||
var node, div;
|
||||
var nodeList = Nodes.filterDescendants(Element.fromDom(rootElm), Nodes.isMatch);
|
||||
each(nodeList, function (n) {
|
||||
var withSpans = Nodes.replaceWithSpans(editor.dom.encode(value(n)));
|
||||
div = editor.dom.create('div', null, withSpans);
|
||||
while (node = div.lastChild) {
|
||||
editor.dom.insertAfter(node, n.dom());
|
||||
}
|
||||
editor.dom.remove(n.dom());
|
||||
});
|
||||
};
|
||||
var hide = function (editor, body) {
|
||||
var nodeList = editor.dom.select(Data.selector, body);
|
||||
each(nodeList, function (node) {
|
||||
editor.dom.remove(node, 1);
|
||||
});
|
||||
};
|
||||
var toggle = function (editor) {
|
||||
var body = editor.getBody();
|
||||
var bookmark = editor.selection.getBookmark();
|
||||
var parentNode = Nodes.findParentElm(editor.selection.getNode(), body);
|
||||
parentNode = parentNode !== undefined ? parentNode : body;
|
||||
hide(editor, parentNode);
|
||||
show(editor, parentNode);
|
||||
editor.selection.moveToBookmark(bookmark);
|
||||
};
|
||||
var VisualChars = {
|
||||
show: show,
|
||||
hide: hide,
|
||||
toggle: toggle
|
||||
};
|
||||
|
||||
var toggleVisualChars = function (editor, toggleState) {
|
||||
var body = editor.getBody();
|
||||
var selection = editor.selection;
|
||||
var bookmark;
|
||||
toggleState.set(!toggleState.get());
|
||||
Events.fireVisualChars(editor, toggleState.get());
|
||||
bookmark = selection.getBookmark();
|
||||
if (toggleState.get() === true) {
|
||||
VisualChars.show(editor, body);
|
||||
} else {
|
||||
VisualChars.hide(editor, body);
|
||||
}
|
||||
selection.moveToBookmark(bookmark);
|
||||
};
|
||||
var Actions = { toggleVisualChars: toggleVisualChars };
|
||||
|
||||
var register = function (editor, toggleState) {
|
||||
editor.addCommand('mceVisualChars', function () {
|
||||
Actions.toggleVisualChars(editor, toggleState);
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
||||
|
||||
var setup = function (editor, toggleState) {
|
||||
var debouncedToggle = global$1.debounce(function () {
|
||||
VisualChars.toggle(editor);
|
||||
}, 300);
|
||||
if (editor.settings.forced_root_block !== false) {
|
||||
editor.on('keydown', function (e) {
|
||||
if (toggleState.get() === true) {
|
||||
e.keyCode === 13 ? VisualChars.toggle(editor) : debouncedToggle();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var Keyboard = { setup: setup };
|
||||
|
||||
var isEnabledByDefault = function (editor) {
|
||||
return editor.getParam('visualchars_default_state', false);
|
||||
};
|
||||
var Settings = { isEnabledByDefault: isEnabledByDefault };
|
||||
|
||||
var setup$1 = function (editor, toggleState) {
|
||||
editor.on('init', function () {
|
||||
var valueForToggling = !Settings.isEnabledByDefault(editor);
|
||||
toggleState.set(valueForToggling);
|
||||
Actions.toggleVisualChars(editor, toggleState);
|
||||
});
|
||||
};
|
||||
var Bindings = { setup: setup$1 };
|
||||
|
||||
var toggleActiveState = function (editor) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
editor.on('VisualChars', function (e) {
|
||||
ctrl.active(e.state);
|
||||
});
|
||||
};
|
||||
};
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('visualchars', {
|
||||
active: false,
|
||||
title: 'Show invisible characters',
|
||||
cmd: 'mceVisualChars',
|
||||
onPostRender: toggleActiveState(editor)
|
||||
});
|
||||
editor.addMenuItem('visualchars', {
|
||||
text: 'Show invisible characters',
|
||||
cmd: 'mceVisualChars',
|
||||
onPostRender: toggleActiveState(editor),
|
||||
selectable: true,
|
||||
context: 'view',
|
||||
prependToContext: true
|
||||
});
|
||||
};
|
||||
|
||||
global.add('visualchars', function (editor) {
|
||||
var toggleState = Cell(false);
|
||||
Commands.register(editor, toggleState);
|
||||
register$1(editor);
|
||||
Keyboard.setup(editor, toggleState);
|
||||
Bindings.setup(editor, toggleState);
|
||||
return Api.get(toggleState);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
|
||||
}(window));
|
||||
})();
|
||||
1
html/wp-content/plugins/tinymce-advanced/mce/visualchars/plugin.min.js
vendored
Normal file
233
html/wp-content/plugins/tinymce-advanced/mce/wptadv/plugin.js
Normal file
@@ -0,0 +1,233 @@
|
||||
/**
|
||||
* Additional functionality for TinyMCE.
|
||||
* @package advanced-editor-tools
|
||||
*/
|
||||
|
||||
( function( tinymce ) {
|
||||
tinymce.PluginManager.add( 'wptadv', function( editor ) {
|
||||
var noAutop = ( ! editor.settings.wpautop && editor.settings.tadv_noautop );
|
||||
|
||||
function addLineBreaks( html ) {
|
||||
var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre' +
|
||||
'|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section' +
|
||||
'|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
|
||||
|
||||
html = html.replace( new RegExp( '<(?:' + blocklist + ')(?: [^>]*)?>', 'gi' ), '\n$&' );
|
||||
html = html.replace( new RegExp( '</(?:' + blocklist + ')>', 'gi' ), '$&\n' );
|
||||
html = html.replace( /(<br(?: [^>]*)?>)[\r\n\t]*/gi, '$1\n' );
|
||||
html = html.replace( />\n[\r\n\t]+</g, '>\n<' );
|
||||
html = html.replace( /^<li/gm, '\t<li' );
|
||||
html = html.replace( /<td>\u00a0<\/td>/g, '<td> </td>' );
|
||||
|
||||
return tinymce.trim( html );
|
||||
}
|
||||
|
||||
editor.addCommand( 'Tadv_Mark', function() {
|
||||
editor.formatter.toggle('mark');
|
||||
});
|
||||
|
||||
editor.addButton( 'tadv_mark', {
|
||||
icon: 'backcolor',
|
||||
tooltip: 'Mark',
|
||||
cmd: 'Tadv_Mark',
|
||||
stateSelector: 'mark'
|
||||
});
|
||||
|
||||
editor.on( 'init', function() {
|
||||
if ( noAutop ) {
|
||||
editor.on( 'SaveContent', function( event ) {
|
||||
event.content = event.content.replace( /caption\](\s|<br[^>]*>|<p> <\/p>)*\[caption/g, 'caption] [caption' );
|
||||
|
||||
event.content = event.content.replace( /<(object|audio|video)[\s\S]+?<\/\1>/g, function( match ) {
|
||||
return match.replace( /[\r\n\t ]+/g, ' ' );
|
||||
});
|
||||
|
||||
event.content = event.content.replace( /<pre( [^>]*)?>[\s\S]+?<\/pre>/g, function( match ) {
|
||||
match = match.replace( /<br ?\/?>(\r\n|\n)?/g, '\n' );
|
||||
return match.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '\n' );
|
||||
});
|
||||
|
||||
event.content = addLineBreaks( event.content );
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
if ( editor.plugins.searchreplace && ! editor.controlManager.buttons.searchreplace ) {
|
||||
editor.shortcuts.remove( 'meta+f' );
|
||||
}
|
||||
} catch ( er ) {}
|
||||
|
||||
editor.formatter.register({
|
||||
mark: { inline: 'mark' }
|
||||
});
|
||||
});
|
||||
|
||||
editor.on( 'ObjectResizeStart', function( event ) {
|
||||
var element = event.target;
|
||||
var table = editor.$( element );
|
||||
var parentWidth;
|
||||
var tableWidth;
|
||||
var width;
|
||||
|
||||
if ( table.is( 'table' ) ) {
|
||||
if ( element.style.width && element.style.width.indexOf( '%' ) !== -1 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
parentWidth = parseInt( table.parent().css( 'width' ), 10 );
|
||||
tableWidth = parseInt( event.width, 10 );
|
||||
|
||||
if ( parentWidth && tableWidth ) {
|
||||
if ( Math.abs( parentWidth - tableWidth ) < 3 ) {
|
||||
table.css({ width: '100%' });
|
||||
} else {
|
||||
width = Math.round( ( tableWidth / parentWidth ) * 100 );
|
||||
|
||||
if ( width > 10 && width < 200 ) {
|
||||
table.css({ width: width + '%' });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}, true );
|
||||
|
||||
editor.addMenuItem( 'tmaresettablesize', {
|
||||
text: 'Reset table size',
|
||||
cmd: 'tmaResetTableSize',
|
||||
icon: 'dashicon dashicons-image-flip-horizontal',
|
||||
context: 'format',
|
||||
});
|
||||
|
||||
editor.addMenuItem( 'tmaremovetablestyles', {
|
||||
text: 'Remove table styling',
|
||||
cmd: 'tmaRemoveTableStyles',
|
||||
icon: 'dashicon dashicons-editor-table',
|
||||
context: 'format',
|
||||
});
|
||||
|
||||
editor.addButton( 'tmaresettablesize', {
|
||||
title: 'Reset table size',
|
||||
cmd: 'tmaResetTableSize',
|
||||
icon: 'dashicon dashicons-image-flip-horizontal',
|
||||
} );
|
||||
|
||||
editor.addButton( 'tmaremovetablestyles', {
|
||||
title: 'Remove table styling',
|
||||
cmd: 'tmaRemoveTableStyles',
|
||||
icon: 'dashicon dashicons-editor-table',
|
||||
} );
|
||||
|
||||
editor.addCommand( 'tmaRemoveTableStyles', function() {
|
||||
var node = editor.selection.getStart();
|
||||
var table = editor.dom.getParents( node, 'table' );
|
||||
var attr = {
|
||||
style: null,
|
||||
'data-mce-style': null,
|
||||
width: null,
|
||||
height: null,
|
||||
minWidth: null,
|
||||
maxWidth: null,
|
||||
minHeight: null,
|
||||
maxHeight: null,
|
||||
align: null,
|
||||
valign: null,
|
||||
axis: null,
|
||||
'char': null,
|
||||
charoff: null,
|
||||
bgcolor: null,
|
||||
border: null,
|
||||
cellspacing: null,
|
||||
cellpadding: null
|
||||
};
|
||||
|
||||
if ( table ) {
|
||||
editor.$( table ).attr( attr ).find( 'tr, th, td, thead, tbody, tfoot' ).each( function( i, element ) {
|
||||
editor.$( element ).attr( attr );
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
editor.addCommand( 'tmaResetTableSize', function() {
|
||||
var node = editor.selection.getStart();
|
||||
var table = editor.dom.getParents( node, 'table' );
|
||||
|
||||
if ( table ) {
|
||||
removeInlineSizes( null, table );
|
||||
|
||||
editor.$( table ).find( 'tr, th, td, thead, tbody, tfoot' ).each( removeInlineSizes );
|
||||
}
|
||||
} );
|
||||
|
||||
function removeInlineSizes( i, node ) {
|
||||
var element = editor.$( node );
|
||||
|
||||
element.attr( {
|
||||
width: null,
|
||||
height: null,
|
||||
minWidth: null,
|
||||
maxWidth: null,
|
||||
minHeight: null,
|
||||
maxHeight: null
|
||||
} );
|
||||
|
||||
element.css({ width: null, height: null });
|
||||
|
||||
if ( element.is( 'table' ) ) {
|
||||
element.css({ 'border-collapse': 'collapse', width: '100%;' });
|
||||
}
|
||||
|
||||
if ( ! element.attr( 'style' ) ) {
|
||||
element.attr({ style: null, 'data-mce-style': null });
|
||||
} else {
|
||||
element.attr( 'data-mce-style', element.attr( 'style' ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( noAutop ) {
|
||||
editor.on( 'beforeSetContent', function( event ) {
|
||||
var autop;
|
||||
var wp = window.wp;
|
||||
|
||||
if ( ! wp ) {
|
||||
return;
|
||||
}
|
||||
|
||||
autop = wp.editor && wp.editor.autop;
|
||||
|
||||
if ( ! autop ) {
|
||||
autop = wp.oldEditor && wp.oldEditor.autop;
|
||||
}
|
||||
|
||||
if ( event.load && autop && event.content && event.content.indexOf( '\n' ) > -1 && ! /<p>/i.test( event.content ) ) {
|
||||
event.content = autop( event.content );
|
||||
}
|
||||
}, true );
|
||||
|
||||
if ( editor.settings.classic_block_editor ) {
|
||||
editor.on( 'beforeGetContent', function( event ) {
|
||||
if ( event.format === 'raw' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var blocks = tinymce.$( '.block-editor-block-list__block' );
|
||||
|
||||
if ( blocks.length === 1 && blocks.attr( 'data-type' ) === 'core/freeform' ) {
|
||||
// Mark all paragraph tags inside a single freeform block so they are not stripped by the block editor...
|
||||
editor.$( 'p' ).each( function ( i, node ) {
|
||||
if ( ! node.hasAttributes() ) {
|
||||
editor.$( node ).attr( 'data-tadv-p', 'keep' );
|
||||
}
|
||||
} );
|
||||
} else {
|
||||
// Remove the above ugliness...
|
||||
editor.$( 'p[data-tadv-p]' ).removeAttr( 'data-tadv-p' );
|
||||
}
|
||||
}, true );
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
addLineBreaks: addLineBreaks
|
||||
};
|
||||
});
|
||||
}( window.tinymce ));
|
||||
233
html/wp-content/plugins/tinymce-advanced/mce/wptadv/plugin.min.js
vendored
Normal file
@@ -0,0 +1,233 @@
|
||||
/**
|
||||
* Additional functionality for TinyMCE.
|
||||
* @package advanced-editor-tools
|
||||
*/
|
||||
|
||||
( function( tinymce ) {
|
||||
tinymce.PluginManager.add( 'wptadv', function( editor ) {
|
||||
var noAutop = ( ! editor.settings.wpautop && editor.settings.tadv_noautop );
|
||||
|
||||
function addLineBreaks( html ) {
|
||||
var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre' +
|
||||
'|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section' +
|
||||
'|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
|
||||
|
||||
html = html.replace( new RegExp( '<(?:' + blocklist + ')(?: [^>]*)?>', 'gi' ), '\n$&' );
|
||||
html = html.replace( new RegExp( '</(?:' + blocklist + ')>', 'gi' ), '$&\n' );
|
||||
html = html.replace( /(<br(?: [^>]*)?>)[\r\n\t]*/gi, '$1\n' );
|
||||
html = html.replace( />\n[\r\n\t]+</g, '>\n<' );
|
||||
html = html.replace( /^<li/gm, '\t<li' );
|
||||
html = html.replace( /<td>\u00a0<\/td>/g, '<td> </td>' );
|
||||
|
||||
return tinymce.trim( html );
|
||||
}
|
||||
|
||||
editor.addCommand( 'Tadv_Mark', function() {
|
||||
editor.formatter.toggle('mark');
|
||||
});
|
||||
|
||||
editor.addButton( 'tadv_mark', {
|
||||
icon: 'backcolor',
|
||||
tooltip: 'Mark',
|
||||
cmd: 'Tadv_Mark',
|
||||
stateSelector: 'mark'
|
||||
});
|
||||
|
||||
editor.on( 'init', function() {
|
||||
if ( noAutop ) {
|
||||
editor.on( 'SaveContent', function( event ) {
|
||||
event.content = event.content.replace( /caption\](\s|<br[^>]*>|<p> <\/p>)*\[caption/g, 'caption] [caption' );
|
||||
|
||||
event.content = event.content.replace( /<(object|audio|video)[\s\S]+?<\/\1>/g, function( match ) {
|
||||
return match.replace( /[\r\n\t ]+/g, ' ' );
|
||||
});
|
||||
|
||||
event.content = event.content.replace( /<pre( [^>]*)?>[\s\S]+?<\/pre>/g, function( match ) {
|
||||
match = match.replace( /<br ?\/?>(\r\n|\n)?/g, '\n' );
|
||||
return match.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '\n' );
|
||||
});
|
||||
|
||||
event.content = addLineBreaks( event.content );
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
if ( editor.plugins.searchreplace && ! editor.controlManager.buttons.searchreplace ) {
|
||||
editor.shortcuts.remove( 'meta+f' );
|
||||
}
|
||||
} catch ( er ) {}
|
||||
|
||||
editor.formatter.register({
|
||||
mark: { inline: 'mark' }
|
||||
});
|
||||
});
|
||||
|
||||
editor.on( 'ObjectResizeStart', function( event ) {
|
||||
var element = event.target;
|
||||
var table = editor.$( element );
|
||||
var parentWidth;
|
||||
var tableWidth;
|
||||
var width;
|
||||
|
||||
if ( table.is( 'table' ) ) {
|
||||
if ( element.style.width && element.style.width.indexOf( '%' ) !== -1 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
parentWidth = parseInt( table.parent().css( 'width' ), 10 );
|
||||
tableWidth = parseInt( event.width, 10 );
|
||||
|
||||
if ( parentWidth && tableWidth ) {
|
||||
if ( Math.abs( parentWidth - tableWidth ) < 3 ) {
|
||||
table.css({ width: '100%' });
|
||||
} else {
|
||||
width = Math.round( ( tableWidth / parentWidth ) * 100 );
|
||||
|
||||
if ( width > 10 && width < 200 ) {
|
||||
table.css({ width: width + '%' });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}, true );
|
||||
|
||||
editor.addMenuItem( 'tmaresettablesize', {
|
||||
text: 'Reset table size',
|
||||
cmd: 'tmaResetTableSize',
|
||||
icon: 'dashicon dashicons-image-flip-horizontal',
|
||||
context: 'format',
|
||||
});
|
||||
|
||||
editor.addMenuItem( 'tmaremovetablestyles', {
|
||||
text: 'Remove table styling',
|
||||
cmd: 'tmaRemoveTableStyles',
|
||||
icon: 'dashicon dashicons-editor-table',
|
||||
context: 'format',
|
||||
});
|
||||
|
||||
editor.addButton( 'tmaresettablesize', {
|
||||
title: 'Reset table size',
|
||||
cmd: 'tmaResetTableSize',
|
||||
icon: 'dashicon dashicons-image-flip-horizontal',
|
||||
} );
|
||||
|
||||
editor.addButton( 'tmaremovetablestyles', {
|
||||
title: 'Remove table styling',
|
||||
cmd: 'tmaRemoveTableStyles',
|
||||
icon: 'dashicon dashicons-editor-table',
|
||||
} );
|
||||
|
||||
editor.addCommand( 'tmaRemoveTableStyles', function() {
|
||||
var node = editor.selection.getStart();
|
||||
var table = editor.dom.getParents( node, 'table' );
|
||||
var attr = {
|
||||
style: null,
|
||||
'data-mce-style': null,
|
||||
width: null,
|
||||
height: null,
|
||||
minWidth: null,
|
||||
maxWidth: null,
|
||||
minHeight: null,
|
||||
maxHeight: null,
|
||||
align: null,
|
||||
valign: null,
|
||||
axis: null,
|
||||
'char': null,
|
||||
charoff: null,
|
||||
bgcolor: null,
|
||||
border: null,
|
||||
cellspacing: null,
|
||||
cellpadding: null
|
||||
};
|
||||
|
||||
if ( table ) {
|
||||
editor.$( table ).attr( attr ).find( 'tr, th, td, thead, tbody, tfoot' ).each( function( i, element ) {
|
||||
editor.$( element ).attr( attr );
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
editor.addCommand( 'tmaResetTableSize', function() {
|
||||
var node = editor.selection.getStart();
|
||||
var table = editor.dom.getParents( node, 'table' );
|
||||
|
||||
if ( table ) {
|
||||
removeInlineSizes( null, table );
|
||||
|
||||
editor.$( table ).find( 'tr, th, td, thead, tbody, tfoot' ).each( removeInlineSizes );
|
||||
}
|
||||
} );
|
||||
|
||||
function removeInlineSizes( i, node ) {
|
||||
var element = editor.$( node );
|
||||
|
||||
element.attr( {
|
||||
width: null,
|
||||
height: null,
|
||||
minWidth: null,
|
||||
maxWidth: null,
|
||||
minHeight: null,
|
||||
maxHeight: null
|
||||
} );
|
||||
|
||||
element.css({ width: null, height: null });
|
||||
|
||||
if ( element.is( 'table' ) ) {
|
||||
element.css({ 'border-collapse': 'collapse', width: '100%;' });
|
||||
}
|
||||
|
||||
if ( ! element.attr( 'style' ) ) {
|
||||
element.attr({ style: null, 'data-mce-style': null });
|
||||
} else {
|
||||
element.attr( 'data-mce-style', element.attr( 'style' ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( noAutop ) {
|
||||
editor.on( 'beforeSetContent', function( event ) {
|
||||
var autop;
|
||||
var wp = window.wp;
|
||||
|
||||
if ( ! wp ) {
|
||||
return;
|
||||
}
|
||||
|
||||
autop = wp.editor && wp.editor.autop;
|
||||
|
||||
if ( ! autop ) {
|
||||
autop = wp.oldEditor && wp.oldEditor.autop;
|
||||
}
|
||||
|
||||
if ( event.load && autop && event.content && event.content.indexOf( '\n' ) > -1 && ! /<p>/i.test( event.content ) ) {
|
||||
event.content = autop( event.content );
|
||||
}
|
||||
}, true );
|
||||
|
||||
if ( editor.settings.classic_block_editor ) {
|
||||
editor.on( 'beforeGetContent', function( event ) {
|
||||
if ( event.format === 'raw' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var blocks = tinymce.$( '.block-editor-block-list__block' );
|
||||
|
||||
if ( blocks.length === 1 && blocks.attr( 'data-type' ) === 'core/freeform' ) {
|
||||
// Mark all paragraph tags inside a single freeform block so they are not stripped by the block editor...
|
||||
editor.$( 'p' ).each( function ( i, node ) {
|
||||
if ( ! node.hasAttributes() ) {
|
||||
editor.$( node ).attr( 'data-tadv-p', 'keep' );
|
||||
}
|
||||
} );
|
||||
} else {
|
||||
// Remove the above ugliness...
|
||||
editor.$( 'p[data-tadv-p]' ).removeAttr( 'data-tadv-p' );
|
||||
}
|
||||
}, true );
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
addLineBreaks: addLineBreaks
|
||||
};
|
||||
});
|
||||
}( window.tinymce ));
|
||||
1005
html/wp-content/plugins/tinymce-advanced/plugin-assets/tadv.css
Normal file
249
html/wp-content/plugins/tinymce-advanced/plugin-assets/tadv.js
Normal file
@@ -0,0 +1,249 @@
|
||||
/**
|
||||
* Scripts for the settings screen in wp-admin.
|
||||
* @package advanced-editor-tools
|
||||
*/
|
||||
|
||||
jQuery( document ).ready( function( $ ) {
|
||||
var $importElement = $('#tadv-import');
|
||||
var $importError = $('#tadv-import-error');
|
||||
|
||||
function sortClassic() {
|
||||
var container = $('.container');
|
||||
|
||||
if ( container.sortable( 'instance' ) ) {
|
||||
container.sortable( 'destroy' );
|
||||
}
|
||||
|
||||
container.sortable({
|
||||
connectWith: '.container',
|
||||
items: '> li',
|
||||
cursor: 'move',
|
||||
stop: function( event, ui ) {
|
||||
var toolbar_id;
|
||||
|
||||
if ( ui && ( toolbar_id = ui.item.parent().attr('id') ) ) {
|
||||
ui.item.find('input.tadv-button').attr('name', toolbar_id + '[]');
|
||||
}
|
||||
},
|
||||
activate: function( event, ui ) {
|
||||
$(this).parent().addClass( 'highlighted' );
|
||||
},
|
||||
deactivate: function( event, ui ) {
|
||||
$(this).parent().removeClass( 'highlighted' );
|
||||
},
|
||||
revert: 300,
|
||||
opacity: 0.7,
|
||||
placeholder: 'tadv-placeholder',
|
||||
forcePlaceholderSize: true
|
||||
});
|
||||
}
|
||||
|
||||
function sortBlock() {
|
||||
var classicBlock = $( '.container-classic-block' );
|
||||
var block = $( '.container-block' );
|
||||
var blockToolbar = $( '#toolbar_block' );
|
||||
|
||||
if ( classicBlock.sortable( 'instance' ) ) {
|
||||
classicBlock.sortable( 'destroy' );
|
||||
}
|
||||
|
||||
if ( block.sortable( 'instance' ) ) {
|
||||
block.sortable( 'destroy' );
|
||||
}
|
||||
|
||||
if ( blockToolbar.sortable( 'instance' ) ) {
|
||||
blockToolbar.sortable( 'destroy' );
|
||||
}
|
||||
|
||||
classicBlock.sortable({
|
||||
connectWith: '.container-classic-block',
|
||||
items: '> li',
|
||||
cursor: 'move',
|
||||
stop: function( event, ui ) {
|
||||
var toolbar_id = ui.item.parent().attr( 'id' );
|
||||
resetItemName( toolbar_id, ui.item );
|
||||
},
|
||||
activate: function( event, ui ) {
|
||||
$(this).parent().addClass( 'highlighted' );
|
||||
},
|
||||
deactivate: function( event, ui ) {
|
||||
$(this).parent().removeClass( 'highlighted' );
|
||||
},
|
||||
revert: 300,
|
||||
opacity: 0.7,
|
||||
placeholder: 'tadv-placeholder',
|
||||
forcePlaceholderSize: true
|
||||
});
|
||||
|
||||
blockToolbar.sortable({
|
||||
connectWith: '.container-block',
|
||||
items: '> li',
|
||||
cursor: 'move',
|
||||
stop: function( event, ui ) {
|
||||
var toolbar_id = ui.item.parent().attr( 'id' );
|
||||
|
||||
resetItemName( toolbar_id, ui.item );
|
||||
sortBlockToolbar();
|
||||
},
|
||||
activate: function( event, ui ) {
|
||||
$(this).parent().addClass( 'highlighted' );
|
||||
},
|
||||
deactivate: function( event, ui ) {
|
||||
$(this).parent().removeClass( 'highlighted' );
|
||||
},
|
||||
revert: 300,
|
||||
opacity: 0.7,
|
||||
placeholder: 'tadv-placeholder',
|
||||
forcePlaceholderSize: true
|
||||
});
|
||||
|
||||
block.sortable({
|
||||
connectWith: '.container-block, #toolbar_block',
|
||||
items: '> li',
|
||||
cursor: 'move',
|
||||
stop: function( event, ui ) {
|
||||
var toolbar_id = ui.item.parent().attr( 'id' );
|
||||
|
||||
resetItemName( toolbar_id, ui.item );
|
||||
sortBlockToolbar();
|
||||
},
|
||||
activate: function( event, ui ) {
|
||||
$(this).parent().addClass( 'highlighted' );
|
||||
},
|
||||
deactivate: function( event, ui ) {
|
||||
$(this).parent().removeClass( 'highlighted' );
|
||||
},
|
||||
receive: function( event, ui ) {
|
||||
if (
|
||||
$( event.target ).is( '#toolbar_block_side' ) &&
|
||||
( ui.item.is( 'li.core-image' ) || ui.item.is( 'li.core-text-color' ) )
|
||||
) {
|
||||
block.sortable( 'cancel' );
|
||||
}
|
||||
},
|
||||
revert: 300,
|
||||
opacity: 0.7,
|
||||
placeholder: 'tadv-block-placeholder',
|
||||
forcePlaceholderSize: true
|
||||
});
|
||||
}
|
||||
|
||||
function resetItemName( name, item ) {
|
||||
if ( name ) {
|
||||
item.find( 'input[type="hidden"]' ).attr( 'name', name + '[]' );
|
||||
}
|
||||
}
|
||||
|
||||
function sortBlockToolbar() {
|
||||
var container = $( '#toolbar_block' );
|
||||
var items = container.find( 'li' );
|
||||
|
||||
items.sort( function ( a, b ) {
|
||||
var aa = $( a ).find( 'div' ).attr( 'title' );
|
||||
var bb = $( b ).find( 'div' ).attr( 'title' );
|
||||
|
||||
return ( aa > bb ) ? 1 : -1;
|
||||
});
|
||||
|
||||
container.append( items );
|
||||
}
|
||||
|
||||
// Make block editor tab sortable on load
|
||||
sortBlock();
|
||||
|
||||
$( '.settings-toggle.block' ).on( 'focus', function( event ) {
|
||||
$( '.wrap' ).removeClass( 'classic-active' ).addClass( 'block-active' );
|
||||
sortBlock();
|
||||
});
|
||||
|
||||
$( '.settings-toggle.classic' ).on( 'focus', function( event ) {
|
||||
$( '.wrap' ).removeClass( 'block-active' ).addClass( 'classic-active' );
|
||||
sortClassic();
|
||||
});
|
||||
|
||||
$( '#menubar' ).on( 'change', function() {
|
||||
$( '.tadv-mce-menu.tadv-classic-editor' ).toggleClass( 'enabled', $(this).prop('checked') );
|
||||
});
|
||||
|
||||
$( '#menubar_block' ).on( 'change', function() {
|
||||
$( '.tadv-mce-menu.tadv-block-editor' ).toggleClass( 'enabled', $(this).prop('checked') );
|
||||
});
|
||||
|
||||
$( '#tadvadmins' ).on( 'submit', function() {
|
||||
$( 'ul.container' ).each( function( i, node ) {
|
||||
$( node ).find( '.tadv-button' ).attr( 'name', node.id ? node.id + '[]' : '' );
|
||||
});
|
||||
});
|
||||
|
||||
$( 'input[name="selected_text_color"]' ).on( 'change', function() {
|
||||
if ( this.id === 'selected_text_color_yes' ) {
|
||||
$( '.panel-block-text-color' ).removeClass( 'disabled' );
|
||||
} else {
|
||||
$( '.panel-block-text-color' ).addClass( 'disabled' );
|
||||
}
|
||||
} );
|
||||
|
||||
$( 'input[name="selected_text_background_color"]' ).on( 'change', function() {
|
||||
if ( this.id === 'selected_text_background_color_yes' ) {
|
||||
$( '.panel-block-background-color' ).removeClass( 'disabled' );
|
||||
} else {
|
||||
$( '.panel-block-background-color' ).addClass( 'disabled' );
|
||||
}
|
||||
} );
|
||||
|
||||
$( '.tadv-popout-help-toggle, .tadv-popout-help-close' ).on( 'click', function( event ) {
|
||||
$( '.tadv-popout-help' ).toggleClass( 'hidden' );
|
||||
} );
|
||||
|
||||
$('#tadv-export-select').click( function() {
|
||||
$('#tadv-export').focus().select();
|
||||
});
|
||||
|
||||
$importElement.change( function() {
|
||||
$importError.empty();
|
||||
});
|
||||
|
||||
$('#tadv-import-verify').click( function() {
|
||||
var string;
|
||||
|
||||
string = ( $importElement.val() || '' ).replace( /^[^{]*/, '' ).replace( /[^}]*$/, '' );
|
||||
$importElement.val( string );
|
||||
|
||||
try {
|
||||
JSON.parse( string );
|
||||
$importError.text( 'No errors.' );
|
||||
} catch( error ) {
|
||||
$importError.text( error );
|
||||
}
|
||||
});
|
||||
|
||||
function translate( str ) {
|
||||
if ( window.tadvTranslation.hasOwnProperty( str ) ) {
|
||||
return window.tadvTranslation[str];
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
if ( typeof window.tadvTranslation === 'object' ) {
|
||||
$( '.tadvitem' ).each( function( i, element ) {
|
||||
var $element = $( element ),
|
||||
$descr = $element.find( '.descr' ),
|
||||
text = $descr.text();
|
||||
|
||||
if ( text ) {
|
||||
text = translate( text );
|
||||
$descr.text( text );
|
||||
$element.find( '.mce-ico' ).attr( 'title', text );
|
||||
}
|
||||
});
|
||||
|
||||
$( '.tadv-mce-menu .tadv-translate' ).each( function( i, element ) {
|
||||
var $element = $( element ),
|
||||
text = $element.text();
|
||||
|
||||
if ( text ) {
|
||||
$element.text( translate( text ) );
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
322
html/wp-content/plugins/tinymce-advanced/readme.txt
Normal file
@@ -0,0 +1,322 @@
|
||||
=== Advanced Editor Tools ===
|
||||
Contributors: automattic, azaozz
|
||||
Tags: block editor, classic editor, editor, Gutenberg, formatting, tinymce, write
|
||||
Requires at least: 5.9
|
||||
Tested up to: 6.3
|
||||
Stable tag: 5.9.2
|
||||
Requires PHP: 5.6
|
||||
License: GPLv2
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Extends and enhances the block editor (Gutenberg) and the classic editor (TinyMCE).
|
||||
|
||||
== Description ==
|
||||
|
||||
Advanced Editor Tools (previously TinyMCE Advanced) introduces a "Classic Paragraph" block for the block editor (Gutenberg).
|
||||
If you are not quite ready to switch to the block editor, or have plugins that cannot be used there (yet), using the Classic Paragraph block is your best option. It lets you to continue to use the familiar TinyMCE editor for most tasks, and at the same time gives you full access to all blocks and new features in the block editor.
|
||||
|
||||
Version 5.5 continues to improve and enhance the new features introduced in version 5.0 of the plugin. It includes an improved "Clear Formatting" button, several advanced settings for tables, and importing and exporting of the settings to a file.
|
||||
|
||||
If you want to continue to use the previous ("classic") editor in WordPress 5.0 and newer, this plugin has an option to replace the new editor with the previous one. If you prefer to have access to both editors side by side or to allow your users to switch editors, it would be better to install the [Classic Editor plugin](https://wordpress.org/plugins/classic-editor/). Advanced Editor Tools is fully compatible with the classic editor plugin and similar plugins that restore use of the previous WordPress editor.
|
||||
|
||||
As always this plugin will let you add, remove and arrange the buttons that are shown on the Visual Editor toolbar in the Classic Paragraph and Classic blocks in the block editor, and in the classic editor (when enabled by a plugin). There you can configure up to four rows of buttons including Font Sizes, Font Family, text and background colors, tables, etc.
|
||||
|
||||
It includes 15 plugins for [TinyMCE](https://www.tiny.cloud/) that are automatically enabled or disabled depending on the buttons you have chosen.
|
||||
In addition this plugin adds options for keeping the paragraph tags in text mode and importing the CSS classes from the theme's editor-style.css.
|
||||
|
||||
= Some of the features added by this plugin =
|
||||
|
||||
* "Classic Paragraph" block that can be used instead of or together with the standard Paragraph block.
|
||||
* An option to set the Classic Paragraph or Classic block as the default block in the block editor.
|
||||
* Supports converting of most default blocks to classic paragraphs, and from classic paragraphs back to the default blocks.
|
||||
* Support for creating and editing tables in the Classic blocks and the classic editor.
|
||||
* More options when inserting lists in the Classic blocks and the classic editor.
|
||||
* Search and Replace in the Classic blocks and the classic editor.
|
||||
* Ability to set Font Family and Font Sizes in the Classic blocks and the classic editor.
|
||||
* And many others.
|
||||
|
||||
= Privacy =
|
||||
|
||||
Advanced Editor Tools does not collect or store any user related data. It does not set cookies, and it does not connect to any third-party websites. It only uses functionality that is available in [WordPress](https://wordpress.org/), and in the [TinyMCE editor](https://tinymce.com/).
|
||||
|
||||
In that terms Advanced Editor Tools does not affect your website's user privacy in any way.
|
||||
|
||||
== Installation ==
|
||||
|
||||
If manual installation is required, please make sure that the plugin files are in a folder named "tinymce-advanced" (not two nested folders) in the WordPress plugins folder, usually "wp-content/plugins".
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 5.9.2 =
|
||||
* Fixed a typo in the plugin header version string.
|
||||
|
||||
= 5.9.1 =
|
||||
* Fixed a warning in PHP 8.0 and never.
|
||||
|
||||
= 5.9.0 =
|
||||
* Updated for WordPress 5.9 and newer.
|
||||
* Removed the Inline text color and Inline text background color side-panels as this functionality is now available in the block editor.
|
||||
* Removed the side-panel toolbar. The drop-down on the main rich-text toolbar serves the same purpose - to unclutter the toolbar.
|
||||
* Fixed some small bugs and compatibility issues.
|
||||
|
||||
= 5.6.0 =
|
||||
* Updated for WordPress 5.6 and TinyMCE 4.9.11.
|
||||
|
||||
= 5.5.1 =
|
||||
* Renamed the plugin to Advanced Editor Tools to comply with trademark requirements.
|
||||
|
||||
= 5.5.0 =
|
||||
* Updated for WordPress 5.5 and TinyMCE 4.9.10.
|
||||
* Updated/renamed the subscript and superscript buttons as these are now in Gutenberg.
|
||||
* Minor CSS fixes and enhancements.
|
||||
|
||||
= 5.4.0 =
|
||||
* Updated for WordPress 5.4.
|
||||
* Improved "Reset Table Size" to reset all table elements (tr, th, td, thead, tbody, tfoot).
|
||||
* Improved "Remove Table Styling" to remove all current and deprecated styling attributes from all table elements.
|
||||
|
||||
= 5.3.0 =
|
||||
* Updated for WordPress 5.3 and TinyMCE 4.9.6.
|
||||
|
||||
= 5.2.1 =
|
||||
* Updated for WordPress 5.2.1 and TinyMCE 4.9.4.
|
||||
* Fixed resetting of the advanced options on update when all were unselected.
|
||||
* Fixed and improved keepig of paragraph tags in the Classic block.
|
||||
|
||||
= 5.2.0 =
|
||||
* Updated for WordPress 5.2.
|
||||
* Updated the buttons settings for the block editor toolbar. There are a few new limitations there: most buttons are now hidden in a drop-down and the users are not allowed to arrange the buttons.
|
||||
* Added a new advanced settings section for tables. Makes it possible to better configure how tables are edited and whether to disable use of inline CSS styles. Note that disabling inline styles would make the tables non-resizable in the editor.
|
||||
* Removed the option to enable pasting of image sources in some browsers. It was not working correctly.
|
||||
* Added a new option to always keep paragraph tags in the Classic Paragraph and Classic blocks in the block editor.
|
||||
* Updated exporting and importing of the settings. Now settings are exported to a (downloaded) file, and can be restored by uploading a previously exported settings file.
|
||||
* Improved the block editor Clear Formatting button. If some text is selected, it only clears the styling from that text. If no selection, all styling from the paragraph is cleared.
|
||||
|
||||
= 5.0.1 =
|
||||
* Fixed importing of backed-up settings.
|
||||
* Updated the FAQ section in the readme.
|
||||
|
||||
= 5.0.0 =
|
||||
* Added several new buttons to the rich-text toolbar in the block editor.
|
||||
* Added functionality to add, remove and arrange most buttons on the rich-text toolbar in the block editor.
|
||||
* Added alternative location for buttons for the rich-text component. That lets users move buttons that are not used frequently out of the way.
|
||||
* Added settings for selected text color and background color.
|
||||
* Improved fixes and enhancements for the Classic block.
|
||||
* Improved the Classic Paragraph block and added support for converting from most blocks to classic paragraphs, and converting a classic paragraph into separate blocks.
|
||||
|
||||
= 4.8.2 =
|
||||
* Fixes and improvements for 4.8.1.
|
||||
* Added separate option to enable the Classic Paragraph block.
|
||||
* Added converting of most default blocks to classic paragraphs, and from classic paragraphs to default blocks.
|
||||
|
||||
= 4.8.1 =
|
||||
* Updated for WordPress 5.0.
|
||||
* Added Hybrid Mode for the block editor. Includes a Classic Paragraph block that replaces the default Paragraph block.
|
||||
* Added option to replace the block editor with the classic editor.
|
||||
* Added another settings section for configuring the toolbars in the Classic block and the Classic Paragraph block.
|
||||
* Added some CSS fixed for the Classic block.
|
||||
* Fixed (removed) setting of inline CSS for table cells when inserting a table. Inline CSS is still added when a table is resized by dragging.
|
||||
|
||||
= 4.8.0 =
|
||||
* Updated for WordPress 4.9.8 and TinyMCE 4.8.0.
|
||||
|
||||
= 4.7.13 =
|
||||
* Updated the table and anchor plugins to 4.7.13 (2018-05-16). Fixes a bug in the table plugin in Edge.
|
||||
|
||||
= 4.7.11 =
|
||||
* Updated for WordPress 4.9.6 and TinyMCE 4.7.11.
|
||||
|
||||
= 4.6.7 =
|
||||
* Fixed compatibility with Gutenberg freeform block.
|
||||
* Forced refresh of the TinyMCE plugins after activation.
|
||||
* Updated for WordPress 4.9 and TinyMCE 4.6.7.
|
||||
|
||||
= 4.6.3 =
|
||||
* Updated for WordPress 4.8 and TinyMCE 4.6.3.
|
||||
|
||||
= 4.5.6 =
|
||||
* Updated for WordPress 4.7.4 and TinyMCE 4.5.6.
|
||||
* Fixed PHP notice after importing settings.
|
||||
|
||||
= 4.4.3 =
|
||||
* Updated for WordPress 4.7 and TinyMCE 4.4.3.
|
||||
* Fixed missing "Source code" button bug.
|
||||
|
||||
= 4.4.1 =
|
||||
* Updated for WordPress 4.6 and TinyMCE 4.4.1.
|
||||
* Fixed multisite saving bug.
|
||||
* Added new button in the Text editor to add or reset the line breaks. Adds line breaks only between tags. Works only when it detects that line breaks are missing so it doesn't reformat posts with removed paragraphs.
|
||||
|
||||
= 4.3.10.1 =
|
||||
* Fixed adding paragraph tags when loading posts that were saved before turning `wpautop` off.
|
||||
* Disabled the (new) inline toolbar for tables as it was overlapping the table in some cases.
|
||||
|
||||
= 4.3.10 =
|
||||
* Updated for WordPress 4.5.1 and TinyMCE 4.3.10.
|
||||
* Fixed support for adding editor-style.css to themes that don't have it.
|
||||
|
||||
= 4.3.8 =
|
||||
* Updated for WordPress 4.5 and TinyMCE 4.3.8.
|
||||
* Separated standard options and admin options.
|
||||
* Added settings that can disable the plugin for the main editor, other editors in wp-admin or editors on the front-end.
|
||||
* Korean translation by Josh Kim and Greek translation by Stathis Mellios.
|
||||
|
||||
= 4.2.8 =
|
||||
* Updated for WordPress 4.4 and TinyMCE 4.2.8.
|
||||
* Japanese translation by Manabu Miwa.
|
||||
|
||||
= 4.2.5 =
|
||||
* Updated for WordPress 4.3.1 and TinyMCE 4.2.5.
|
||||
* Fixed text domain and plugin headers.
|
||||
|
||||
= 4.2.3.1 =
|
||||
* Fix error with removing the `textpattern` plugin.
|
||||
|
||||
= 4.2.3 =
|
||||
* Updated for WordPress 4.3 and TinyMCE 4.2.3.
|
||||
* Removed the `textpattern` plugin as WordPress 4.3 includes similar functionality by default.
|
||||
* French translation by Nicolas Schneider.
|
||||
|
||||
= 4.1.9 =
|
||||
* Updated for WordPress 4.2 and TinyMCE 4.1.9.
|
||||
* Fixed bugs with showing oEmbed previews when pasting an URL.
|
||||
* Fixed bugs with getting the content from TinyMCE with line breaks.
|
||||
|
||||
= 4.1.7 =
|
||||
* Updated for WordPress 4.1 and TinyMCE 4.1.7.
|
||||
* Fixed bug where consecutive caption shortcodes may be split with an empty paragraph tag.
|
||||
|
||||
= 4.1.1 =
|
||||
* Fix bug with image captions when wpautop is disabled.
|
||||
* Add translation support to the settings page. Button names/descriptions are translated from JS using the existing WordPress translation, so this part of the settings page will be translated by default. The other text still needs separate translation.
|
||||
|
||||
= 4.1 =
|
||||
* Updated for WordPress 4.0 and TinyMCE 4.1.
|
||||
* Add the `textpattern` plugin that supports some of the markdown syntax while typing, [(more info)](http://www.tinymce.com/wiki.php/Configuration:textpattern_patterns).
|
||||
* Add the updated 'table' plugin that supports background and border color.
|
||||
|
||||
= 4.0.2 =
|
||||
* Fix showing of the second, third and forth button rows when the Toolbar Toggle button is not used.
|
||||
* Fix adding the `directionality` plugin when RTL or LTR button is selected.
|
||||
* Show the ''Advanced Options'' to super admins on multisite installs.
|
||||
* Add the `link` plugin including link rel setting. Replaces the Insert/Edit Link dialog when enabled.
|
||||
* Include updated ''table'' plugin that has support for vertical align for cells.
|
||||
|
||||
= 4.0.1 =
|
||||
Fix warnings on pages other than Edit Post. Update the description.
|
||||
|
||||
= 4.0 =
|
||||
Updated for WordPress 3.9 and TinyMCE 4.0. Refreshed the settings screen. Added support for exporting and importing of the settings.
|
||||
|
||||
= 3.5.9.1 =
|
||||
Updated for WordPress 3.8, fixed auto-embedding of single line URLs when not removing paragraph tags.
|
||||
|
||||
= 3.5.9 =
|
||||
Updated for WordPress 3.7 and TinyMCE 3.5.9.
|
||||
|
||||
= 3.5.8 =
|
||||
Updated for WordPress 3.5 and TinyMCE 3.5.8.
|
||||
|
||||
= 3.4.9 =
|
||||
Updated for WordPress 3.4 and TinyMCE 3.4.9.
|
||||
|
||||
= 3.4.5.1 =
|
||||
Fixed a bug preventing TinyMCE from importing CSS classes from editor-style.css.
|
||||
|
||||
= 3.4.5 =
|
||||
Updated for WordPress 3.3 or later and TinyMCE 3.4.5.
|
||||
|
||||
= 3.4.2.1 =
|
||||
Fix the removal of the *media* plugin so it does not require re-saving the settings.
|
||||
|
||||
= 3.4.2 =
|
||||
Compatibility with WordPress 3.2 and TinyMCE 3.4.2, removed the options for support for iframe and HTML 5.0 elements as they are supported by default in WordPress 3.2, removed the *media* plugin as it is included by default.
|
||||
|
||||
= 3.3.9.1 =
|
||||
Added advanced options: stop removing iframes, stop removing HTML 5.0 elements, moved the support for custom editor styles to editor-style.css in the current theme.
|
||||
|
||||
Attention: if you have a customized `tadv-mce.css` file and your theme doesn't have editor-style.css, please download `tadv-mce.css`, rename it to editor-style.css and upload it to your current theme directory. Alternatively you can add there the editor-style.css from the Twenty Ten theme. If your theme has editor-style.css you can add any custom styles there.
|
||||
|
||||
= 3.3.9 =
|
||||
Compatibility with WordPress 3.1 and TinyMCE 3.3.9, improved P and BR tags option.
|
||||
|
||||
= 3.2.7 =
|
||||
Compatibility with WordPress 2.9 and TinyMCE 3.2.7, several minor bug fixes.
|
||||
|
||||
= 3.2.4 =
|
||||
Compatibility with WordPress 2.8 and TinyMCE 3.2.4, minor bug fixes.
|
||||
|
||||
= 3.2 =
|
||||
Compatibility with WordPress 2.7 and TinyMCE 3.2, minor bug fixes.
|
||||
|
||||
= 3.1 =
|
||||
Compatibility with WordPress 2.6 and TinyMCE 3.1, keeps empty paragraphs when disabling the removal of P and BR tags, the buttons for `MCImageManager` and `MCFileManager` can be arranged (if installed).
|
||||
|
||||
= 3.0.1 =
|
||||
Compatibility with WordPress 2.5.1 and TinyMCE 3.0.7, added option to disable the removal of P and BR tags when saving and in the HTML editor (wpautop), added two more buttons to the HTML editor: `wpautop` and undo, fixed the removal of non-default TinyMCE buttons.
|
||||
|
||||
= 3.0 =
|
||||
Support for WordPress 2.5 and TinyMCE 3.0.
|
||||
|
||||
= 2.2 =
|
||||
Deactivate/Uninstall option page, font size drop-down menu and other small changes.
|
||||
|
||||
= 2.1 =
|
||||
Improved language selection, improved compatibility with WordPress 2.3 and TinyMCE 2.1.1.1, option to override some of the imported css classes and other small improvements and bugfixes.
|
||||
|
||||
= 2.0 =
|
||||
Includes an admin page for arranging the TinyMCE toolbar buttons, easy installation, a lot of bugfixes, customized "Smilies" plugin that uses the built-in WordPress smilies, etc. The admin page uses jQuery and jQuery UI that lets you "drag and drop" the TinyMCE buttons to arrange your own toolbars and enables/disables the corresponding plugins depending on the used buttons.
|
||||
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= I see an error like: "Failed to load plugin from url..." =
|
||||
|
||||
These errors are usually caused by the file in question being blocked by some security setting on the server, or (rarely) by caching issues or wrong permissions.
|
||||
|
||||
The first step to debug this is to try to access the file directly in the browser (i.e. copy the URL and paste in the browser and press Enter).
|
||||
|
||||
If you see the file (that’s usually minified JS, so it is all on one line) chances are it was some sort of caching issue that is now resolved. Try using the editor again.
|
||||
|
||||
If you see an HTTP error (like 403 or 500) best would be to contact your web hosting company for help. In some cases deleting and re-installing the plugin may help.
|
||||
|
||||
= Tables look different (inline styles are missing) when I insert a table =
|
||||
|
||||
Please see the new (as of version 5.2.0) advanced settings for tables. It is possible to disable use of inline styles for tables but that would make the table non-resizable in the editor. If the advanced tabs on the table, row, and column dialogs are enabled (default), it will still be possible to enter width and height values which are set as inline styles.
|
||||
|
||||
= No styles are imported in the Formats sub-menu =
|
||||
|
||||
These styles are imported from your current theme editor-style.css file. However some themes do not have this functionality. For these themes Advanced Editor Tools has the option to let you add a customized editor-style.css and import it into the editor.
|
||||
|
||||
= I have just installed this plugin, but it does not do anything =
|
||||
|
||||
Change some buttons on one of the toolbars, save your changes, clear your browser cache, and try again. If that does not work try reloading the Edit page several times while holding down Shift. There may also be a network cache somewhere between you and your host. You may need to wait for a few hours until this cache expires.
|
||||
|
||||
= When I add "Smilies", they do not show in the editor =
|
||||
|
||||
The "Emoticons" button in TinyMCE adds the codes for the smilies. The actual images are added by WordPress when viewing the Post. Make sure the checkbox "Convert emoticons to graphics on display" in "Options - Writing" is checked.
|
||||
|
||||
= The plugin does not add any buttons =
|
||||
|
||||
Make sure the "Disable the visual editor when writing" checkbox under "Users - Your Profile" is **not** checked.
|
||||
|
||||
= I still see the "old" buttons in the editor =
|
||||
|
||||
Re-save the settings or click the "Restore Default Settings" button on the plugin settings page and then set the buttons again and save.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Rich-text toolbar.
|
||||
2. Rich-text toolbar and extra formatting buttons in the Inspector (sidebar).
|
||||
3. Many of the buttons can be moved to the Formatting section in the Inspector.
|
||||
4. Converting the content of the Classic Paragraph block into separate blocks.
|
||||
5. Converting several paragraph blocks into a Classic Paragraph block.
|
||||
6. Settings for the Rich-text toolbar and the optional Formatting section in the Inspector.
|
||||
7. Settings for the toolbars in Classic Paragraph and Classic blocks.
|
||||
8. Additional options.
|
||||
9. Advanced options for tables.
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 5.2.0 =
|
||||
Another large upgrade. Includes advanced options for tables, updated import and export of settings, and further improvements for the block editor.
|
||||
754
html/wp-content/plugins/tinymce-advanced/tadv_admin.php
Normal file
@@ -0,0 +1,754 @@
|
||||
<?php
|
||||
/**
|
||||
* User and admin settings UI.
|
||||
* @package advanced-editor-tools
|
||||
*/
|
||||
|
||||
if ( ! defined( 'TADV_ADMIN_PAGE' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// TODO
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
wp_die( 'Invalid request' );
|
||||
}
|
||||
|
||||
$message = '';
|
||||
$tadv_options_updated = false;
|
||||
$settings = $admin_settings = array();
|
||||
$images_url = plugins_url( 'plugin-assets/images', __FILE__ );
|
||||
$form_action = esc_url( remove_query_arg( array( 'tadv-import-file-complete' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
|
||||
if ( isset( $_POST['tadv-save'] ) ) {
|
||||
check_admin_referer( 'tadv-save-buttons-order' );
|
||||
$this->save_settings();
|
||||
} elseif ( isset( $_POST['tadv-restore-defaults'] ) ) {
|
||||
check_admin_referer( 'tadv-save-buttons-order' );
|
||||
|
||||
// TODO: only for admin || SA
|
||||
$this->admin_settings = $this->get_default_admin_settings();
|
||||
update_option( 'tadv_admin_settings', $this->get_default_admin_settings() );
|
||||
|
||||
// TODO: all users that can have settings
|
||||
$this->user_settings = $this->get_default_user_settings();
|
||||
update_option( 'tadv_settings', $this->get_default_user_settings() );
|
||||
|
||||
$message = '<div class="updated notice notice-success is-dismissible"><p>' . __( 'Default settings restored.', 'tinymce-advanced' ) . '</p></div>';
|
||||
} elseif ( isset( $_POST['tadv-import-settings'] ) ) {
|
||||
check_admin_referer( 'tadv-save-buttons-order' );
|
||||
|
||||
// TODO: all users
|
||||
?>
|
||||
<div class="wrap advanced-editor-tools">
|
||||
<h2><?php _e( 'Advanced Editor Tools Settings Import', 'tinymce-advanced' ); ?></h2>
|
||||
|
||||
<div class="tadv-import-export">
|
||||
<form action="" method="post" enctype="multipart/form-data" class="import-file">
|
||||
<p><?php _e( 'The settings are imported from a previously exported settings file.', 'tinymce-advanced' ); ?></p>
|
||||
<p><input type="file" name="tadv-import"></p>
|
||||
<p><input type="submit" class="button button-primary" name="tadv-import-file" value="<?php _e( 'Import settings', 'tinymce-advanced' ); ?>" /></p>
|
||||
<?php wp_nonce_field( 'tadv-import-settings', 'tadv-import-settings-nonce', false ); ?>
|
||||
</form>
|
||||
<hr>
|
||||
<form action="<?php echo $form_action; ?>" method="post">
|
||||
<p><?php _e( 'Alternatively the settings can be imported from a JSON encoded string. Please paste the exported string in the text area below.', 'tinymce-advanced' ); ?></p>
|
||||
<p><textarea id="tadv-import" name="tadv-import"></textarea></p>
|
||||
<p>
|
||||
<button type="button" class="button" id="tadv-import-verify"><?php _e( 'Verify', 'tinymce-advanced' ); ?></button>
|
||||
<input type="submit" class="button button-primary alignright" name="tadv-import-submit" value="<?php _e( 'Import settings from string', 'tinymce-advanced' ); ?>" />
|
||||
</p>
|
||||
<?php wp_nonce_field( 'tadv-import-settings', 'tadv-import-settings-nonce', false ); ?>
|
||||
<p id="tadv-import-error"></p>
|
||||
</form>
|
||||
<p><a href=""><?php _e( 'Back to Editor Settings', 'tinymce-advanced' ); ?></a></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
return;
|
||||
} elseif ( isset( $_POST['tadv-import-submit'] ) && ! empty( $_POST['tadv-import'] ) && is_string( $_POST['tadv-import'] ) ) {
|
||||
check_admin_referer( 'tadv-import-settings', 'tadv-import-settings-nonce' );
|
||||
|
||||
// TODO: all users that can have settings
|
||||
$import = json_decode( trim( wp_unslash( $_POST['tadv-import'] ) ), true );
|
||||
|
||||
if ( ! is_array( $import ) ) {
|
||||
$message = '<div class="error notice is-dismissible"><p>' . __( 'Importing of settings failed.', 'tinymce-advanced' ) . '</p></div>';
|
||||
} else {
|
||||
$this->save_settings( $import );
|
||||
$message = '<div class="updated notice notice-success is-dismissible"><p>' . __( 'Settings imported successfully.', 'tinymce-advanced' ) . '</p></div>';
|
||||
}
|
||||
} elseif ( isset( $_GET['tadv-import-file-complete'] ) ) {
|
||||
$err = (int) $_GET['tadv-import-file-complete'];
|
||||
|
||||
switch( $err ) {
|
||||
case 1:
|
||||
$message = __( 'Importing of settings failed. Please import a valid settings file.', 'tinymce-advanced' );
|
||||
break;
|
||||
case 2:
|
||||
$message = __( 'Importing of settings failed. The imported file is empty.', 'tinymce-advanced' );
|
||||
break;
|
||||
case 3:
|
||||
$message = __( 'Importing of settings failed. The imported file is invalid.', 'tinymce-advanced' );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( empty( $message ) ) {
|
||||
$message = '<div class="updated notice notice-success is-dismissible"><p>' . __( 'Settings imported successfully.', 'tinymce-advanced' ) . '</p></div>';
|
||||
} else {
|
||||
$message = '<div class="error notice is-dismissible"><p>' . $message . '</p></div>';
|
||||
}
|
||||
}
|
||||
|
||||
$this->load_settings();
|
||||
|
||||
if ( empty( $this->toolbar_1 ) && empty( $this->toolbar_2 ) && empty( $this->toolbar_3 ) && empty( $this->toolbar_4 ) ) {
|
||||
$message = '<div class="error"><p>' . __( 'ERROR: All toolbars are empty. Default settings loaded.', 'tinymce-advanced' ) . '</p></div>';
|
||||
|
||||
$this->admin_settings = $this->get_default_admin_settings();
|
||||
$this->user_settings = $this->get_default_user_settings();
|
||||
$this->load_settings();
|
||||
}
|
||||
|
||||
$all_buttons = $this->get_all_buttons();
|
||||
|
||||
?>
|
||||
<div class="wrap tinymce-advanced block-active<?php if ( is_rtl() ) echo ' mce-rtl'; ?>" id="contain">
|
||||
<h2><?php _e( 'Advanced Editor Tools', 'tinymce-advanced' ); ?></h2>
|
||||
<?php
|
||||
|
||||
// TODO admin || SA
|
||||
$this->warn_if_unsupported();
|
||||
|
||||
if ( isset( $_POST['tadv-save'] ) && empty( $message ) ) {
|
||||
?><div class="updated notice notice-success is-dismissible"><p><?php _e( 'Settings saved.', 'tinymce-advanced' ); ?></p></div><?php
|
||||
} else {
|
||||
echo $message;
|
||||
}
|
||||
|
||||
$dashicons_arrow = is_rtl() ? 'dashicons-arrow-left' : 'dashicons-arrow-right';
|
||||
|
||||
?>
|
||||
<form id="tadvadmin" method="post" action="<?php echo $form_action; ?>">
|
||||
|
||||
<div class="toggle">
|
||||
<p class="tadv-submit tadv-submit-top">
|
||||
<input class="button-primary button-large top-button" type="submit" name="tadv-save" value="<?php _e( 'Save Changes', 'tinymce-advanced' ); ?>" />
|
||||
</p>
|
||||
<h3 class="settings-toggle block" tabindex="0">
|
||||
<span class="dashicons dashicons-arrow-down"></span>
|
||||
<span class="dashicons arrow-open <?php echo $dashicons_arrow; ?>"></span>
|
||||
<?php _e( 'Block Editor (Gutenberg)', 'tinymce-advanced' ); ?>
|
||||
</h3>
|
||||
<h3 class="settings-toggle classic" tabindex="0">
|
||||
<span class="dashicons dashicons-arrow-down"></span>
|
||||
<span class="dashicons arrow-open <?php echo $dashicons_arrow; ?>"></span>
|
||||
<?php _e( 'Classic Editor (TinyMCE)', 'tinymce-advanced' ); ?>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div id="block-editor">
|
||||
<h4><?php _e( 'Additional buttons for the Rich-Text toolbar', 'tinymce-advanced' ); ?></h4>
|
||||
<div class="block-toolbars yes-no-wrap">
|
||||
<div class="yes-no-text">
|
||||
<p>
|
||||
<?php _e( 'The <b>Mark</b> button will wrap the selected text in a plain <mark> HTML element. The appearance would depend on your theme and usually resembles highlighted text.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php _e( 'The <b>Clear formatting</b> button will remove text formatting from the selected text, or from the whole paragraph if there is no selection. This includes femoval of most text styling like bold, italic, underline, background and foreground color, etc.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="yes-no-buttons">
|
||||
<div>
|
||||
<input type="radio" name="richtext_buttons" id="richtext_buttons_yes" value="yes"<?php if ( ! $this->check_user_setting( 'disable_richtext_buttons' ) ) echo ' checked'; ?>>
|
||||
<label for="richtext_buttons_yes"><?php _e( 'Enable', 'tinymce-advanced' ); ?></label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" name="richtext_buttons" id="richtext_buttons_no" value="no"<?php if ( $this->check_user_setting( 'disable_richtext_buttons' ) ) echo ' checked'; ?>>
|
||||
<label for="richtext_buttons_no"><?php _e( 'Disable', 'tinymce-advanced' ); ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 class="classic-blocks-title-h4"><?php _e( 'Toolbars for the Classic Paragraph and Classic blocks', 'tinymce-advanced' ); ?></h4>
|
||||
|
||||
<p>
|
||||
<?php _e( 'The toolbars in the Classic Paragraph and Classic blocks are narrower and show on focus.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'For best results enable the menu and add only essential buttons.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'The buttons will wrap around depending on the width of the toolbar.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="checkbox" name="options[]" id="menubar_block" value="menubar_block" <?php if ( $this->check_user_setting( 'menubar_block' ) ) { echo ' checked'; } ?>>
|
||||
<label for="menubar_block"><?php _e( 'Enable the editor menu (recommended).', 'tinymce-advanced' ); ?></label>
|
||||
</p>
|
||||
|
||||
<div class="tadv-block-editor-toolbars-wrap">
|
||||
<div class="tadv-mce-menu tadv-block-editor mce-container mce-menubar mce-toolbar mce-first mce-stack-layout-item
|
||||
<?php if ( $this->check_user_setting( 'menubar_block' ) ) { echo ' enabled'; } ?>">
|
||||
<div class="mce-container-body mce-flow-layout">
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-first mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">File</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">Edit</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">Insert</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item mce-toolbar-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">View</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">Format</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">Table</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-last mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">Tools</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tadvdropzone tadv-block-editor mce-toolbar">
|
||||
<ul id="toolbar_classic_block" class="container-classic-block">
|
||||
<?php
|
||||
|
||||
$mce_text_buttons = array( 'styleselect', 'formatselect', 'fontselect', 'fontsizeselect' );
|
||||
$all_buttons_block = $all_buttons;
|
||||
|
||||
// Remove the toolbar-toggle
|
||||
unset( $all_buttons_block['wp_adv'] );
|
||||
|
||||
foreach( $this->toolbar_classic_block as $button_id ) {
|
||||
$name = '';
|
||||
|
||||
if ( strpos( $button_id, 'separator' ) !== false || in_array( $button_id, array( 'moveforward', 'movebackward', 'absolute' ) ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $all_buttons_block[ $button_id ] ) ) {
|
||||
$name = $all_buttons_block[ $button_id ];
|
||||
unset( $all_buttons_block[ $button_id ] );
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
?>
|
||||
<li class="tadvmodule" id="<?php echo $button_id; ?>">
|
||||
<?php
|
||||
|
||||
if ( in_array( $button_id, $mce_text_buttons, true ) ) {
|
||||
?>
|
||||
<div class="tadvitem mce-widget mce-btn mce-menubtn mce-fixed-width mce-listbox">
|
||||
<div class="the-button">
|
||||
<span class="descr"><?php echo $name; ?></span>
|
||||
<i class="mce-caret"></i>
|
||||
<input type="hidden" class="tadv-button" name="toolbar_classic_block[]" value="<?php echo $button_id; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="tadvitem">
|
||||
<i class="mce-ico mce-i-<?php echo $button_id; ?>" title="<?php echo $name; ?>"></i>
|
||||
<span class="descr"><?php echo $name; ?></span>
|
||||
<input type="hidden" class="tadv-button" name="toolbar_classic_block[]" value="<?php echo $button_id; ?>" />
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p><?php _e( 'Drop buttons in the toolbars, or drag the buttons to rearrange them.', 'tinymce-advanced' ); ?></p>
|
||||
|
||||
<div class="unuseddiv">
|
||||
<p><strong><?php _e( 'Unused Buttons for the Classic Paragraph and Classic blocks toolbars', 'tinymce-advanced' ); ?></strong></p>
|
||||
<div>
|
||||
<ul id="unused-classic-block" class="unused container-classic-block">
|
||||
<?php
|
||||
|
||||
foreach( $all_buttons_block as $button_id => $name ) {
|
||||
if ( strpos( $button_id, 'separator' ) !== false ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
?>
|
||||
<li class="tadvmodule" id="<?php echo $button_id; ?>">
|
||||
<?php
|
||||
|
||||
if ( in_array( $button_id, $mce_text_buttons, true ) ) {
|
||||
?>
|
||||
<div class="tadvitem mce-widget mce-btn mce-menubtn mce-fixed-width mce-listbox">
|
||||
<div class="the-button">
|
||||
<span class="descr"><?php echo $name; ?></span>
|
||||
<i class="mce-caret"></i>
|
||||
<input type="hidden" class="tadv-button" name="unused-classic-block[]" value="<?php echo $button_id; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="tadvitem">
|
||||
<i class="mce-ico mce-i-<?php echo $button_id; ?>" title="<?php echo $name; ?>"></i>
|
||||
<span class="descr"><?php echo $name; ?></span>
|
||||
<input type="hidden" class="tadv-button" name="unused-classic-block[]" value="<?php echo $button_id; ?>" />
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</div><!-- /highlight -->
|
||||
</div><!-- /unuseddiv -->
|
||||
</div><!-- /block-editor -->
|
||||
|
||||
<div id="classic-editor">
|
||||
<h4><?php _e( 'Toolbars for the Classic Editor', 'tinymce-advanced' ); ?></h4>
|
||||
|
||||
<div class="tadvzones">
|
||||
<p>
|
||||
<input type="checkbox" name="options[]" id="menubar" value="menubar" <?php if ( $this->check_user_setting( 'menubar' ) ) { echo ' checked="checked"'; } ?>>
|
||||
<label for="menubar"><?php _e( 'Enable the editor menu.', 'tinymce-advanced' ); ?></label>
|
||||
</p>
|
||||
|
||||
<div class="tadv-mce-menu tadv-classic-editor mce-container mce-menubar mce-toolbar mce-first mce-stack-layout-item
|
||||
<?php if ( $this->check_user_setting( 'menubar' ) ) { echo ' enabled'; } ?>">
|
||||
<div class="mce-container-body mce-flow-layout">
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-first mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">File</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">Edit</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">Insert</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item mce-toolbar-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">View</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">Format</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">Table</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mce-widget mce-btn mce-menubtn mce-last mce-flow-layout-item">
|
||||
<button type="button">
|
||||
<span class="tadv-translate">Tools</span>
|
||||
<i class="mce-caret"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$all_buttons_classic = $all_buttons;
|
||||
$button_id = '';
|
||||
|
||||
for ( $i = 1; $i < 5; $i++ ) {
|
||||
$toolbar = "toolbar_$i";
|
||||
|
||||
?>
|
||||
<div class="tadvdropzone mce-toolbar">
|
||||
<ul id="toolbar_<?php echo $i; ?>" class="container">
|
||||
<?php
|
||||
|
||||
foreach( $this->$toolbar as $button_id ) {
|
||||
if ( strpos( $button_id, 'separator' ) !== false || in_array( $button_id, array( 'moveforward', 'movebackward', 'absolute' ) ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $all_buttons_classic[ $button_id ] ) ) {
|
||||
$name = $all_buttons_classic[ $button_id ];
|
||||
unset( $all_buttons_classic[ $button_id ] );
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
?>
|
||||
<li class="tadvmodule" id="<?php echo $button_id; ?>">
|
||||
<?php
|
||||
|
||||
if ( in_array( $button_id, $mce_text_buttons, true ) ) {
|
||||
?>
|
||||
<div class="tadvitem mce-widget mce-btn mce-menubtn mce-fixed-width mce-listbox">
|
||||
<div class="the-button">
|
||||
<span class="descr"><?php echo $name; ?></span>
|
||||
<i class="mce-caret"></i>
|
||||
<input type="hidden" class="tadv-button" name="toolbar_<?php echo $i; ?>[]" value="<?php echo $button_id; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="tadvitem">
|
||||
<i class="mce-ico mce-i-<?php echo $button_id; ?>" title="<?php echo $name; ?>"></i>
|
||||
<span class="descr"><?php echo $name; ?></span>
|
||||
<input type="hidden" class="tadv-button" name="toolbar_<?php echo $i; ?>[]" value="<?php echo $button_id; ?>" />
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</ul></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
<p><?php _e( 'Drop buttons in the toolbars, or drag the buttons to rearrange them.', 'tinymce-advanced' ); ?></p>
|
||||
|
||||
<div class="unuseddiv">
|
||||
<h4><?php _e( 'Unused Buttons', 'tinymce-advanced' ); ?></h4>
|
||||
<div>
|
||||
<ul id="unused" class="unused container">
|
||||
<?php
|
||||
|
||||
foreach( $all_buttons_classic as $button_id => $name ) {
|
||||
if ( strpos( $button_id, 'separator' ) !== false ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
?>
|
||||
<li class="tadvmodule" id="<?php echo $button_id; ?>">
|
||||
<?php
|
||||
|
||||
if ( in_array( $button_id, $mce_text_buttons, true ) ) {
|
||||
?>
|
||||
<div class="tadvitem mce-widget mce-btn mce-menubtn mce-fixed-width mce-listbox">
|
||||
<div class="the-button">
|
||||
<span class="descr"><?php echo $name; ?></span>
|
||||
<i class="mce-caret"></i>
|
||||
<input type="hidden" class="tadv-button" name="unused[]" value="<?php echo $button_id; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="tadvitem">
|
||||
<i class="mce-ico mce-i-<?php echo $button_id; ?>" title="<?php echo $name; ?>"></i>
|
||||
<span class="descr"><?php echo $name; ?></span>
|
||||
<input type="hidden" class="tadv-button" name="unused[]" value="<?php echo $button_id; ?>" />
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</div><!-- /highlighted -->
|
||||
</div>
|
||||
</div><!-- /classic-editor -->
|
||||
|
||||
<div class="advanced-options">
|
||||
<h3><?php _e( 'Options', 'tinymce-advanced' ); ?></h3>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" name="options[]" value="merge_toolbars" id="merge_toolbars" <?php if ( $this->check_user_setting( 'merge_toolbars' ) ) echo ' checked'; ?> />
|
||||
<label for="merge_toolbars"><?php _e( 'Append all buttons to the top toolbar in the Classic Paragraph and Classic blocks.', 'tinymce-advanced' ); ?></label>
|
||||
<p><?php _e( 'This affects buttons that are added by other plugins. These buttons will be appended to the top toolbar row instead of forming second, third, and forth rows.', 'tinymce-advanced' ); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" name="options[]" value="advlist" id="advlist" <?php if ( $this->check_user_setting('advlist') ) echo ' checked'; ?> />
|
||||
<label for="advlist"><?php _e( 'List Style Options', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'Enable more list options: upper or lower case letters for ordered lists, disk or square for unordered lists, etc.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" name="options[]" value="contextmenu" id="contextmenu" <?php if ( $this->check_user_setting('contextmenu') ) echo ' checked'; ?> />
|
||||
<label for="contextmenu"><?php _e( 'Context Menu', 'tinymce-advanced' ); ?></label>
|
||||
<p><?php _e( 'Replace the browser context (right-click) menu.', 'tinymce-advanced' ); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" name="options[]" value="advlink" id="advlink" <?php if ( $this->check_user_setting('advlink') ) echo ' checked'; ?> />
|
||||
<label for="advlink"><?php _e( 'Alternative link dialog', 'tinymce-advanced' ); ?></label>
|
||||
<p><?php _e( 'Open the TinyMCE link dialog when using the link button on the toolbar or the link menu item.', 'tinymce-advanced' ); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" name="options[]" value="fontsize_formats" id="fontsize_formats" <?php if ( $this->check_user_setting( 'fontsize_formats' ) ) echo ' checked="checked"'; ?> />
|
||||
<label for="fontsize_formats"><?php _e( 'Font sizes', 'tinymce-advanced' ); ?></label>
|
||||
<p><?php printf( __( 'Replace the size setting available for fonts with: %s.', 'tinymce-advanced' ), $this->fontsize_formats ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if ( ! is_multisite() || current_user_can( 'manage_sites' ) ) {
|
||||
?>
|
||||
<div class="advanced-options">
|
||||
<h3><?php _e( 'Advanced Options', 'tinymce-advanced' ); ?></h3>
|
||||
<div>
|
||||
<input type="checkbox" name="admin_options[]" value="classic_paragraph_block" id="classic_paragraph_block" <?php if ( $this->check_admin_setting( 'classic_paragraph_block' ) ) echo ' checked'; ?> />
|
||||
<label for="classic_paragraph_block"><?php _e( 'Add Classic Paragraph block', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'The Classic Paragraph block includes the familiar TinyMCE editor and is an extended and enhanced Classic block.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'You can add multiple paragraphs, tables, galleries, embed video, set fonts and colors, and generally use everything that is available in the Classic Editor.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'Also, like the Classic block, most existing TinyMCE plugins and add-ons will continue to work.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'This makes the Block Editor more familiar, easier to use, easier to get used to, and more compatible with your existing workflow.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php _e( 'In addition most default blocks can be transformed into classic paragraphs, and a Classic Paragraph can be converted to multiple blocks.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'It can be used everywhere instead of the Paragraph block including in columns, when creating reusable blocks, etc.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" name="admin_options[]" value="hybrid_mode" id="hybrid_mode" <?php if ( $this->check_admin_setting( 'hybrid_mode' ) ) echo ' checked'; ?> />
|
||||
<label for="hybrid_mode"><?php _e( 'Make the Classic Paragraph or Classic block the default block (hybrid mode)', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'The default block is inserted on pressing Enter in the title, or clicking under the last block.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'Selecting this option also adds some improvements and fixes for the Classic block.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<?php
|
||||
|
||||
if ( function_exists( 'is_plugin_active' ) && ! is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
|
||||
|
||||
?>
|
||||
<input type="checkbox" name="admin_options[]" value="replace_block_editor" id="replace_block_editor" <?php if ( $this->check_admin_setting( 'replace_block_editor' ) ) echo ' checked'; ?> />
|
||||
<label for="replace_block_editor"><?php _e( 'Replace the Block Editor with the Classic Editor', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'Selecting this option will restore the previous (“classic”) editor and the previous Edit Post screen.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'It will allow you to use other plugins that enhance that editor, add old-style Meta Boxes, or in some way depend on the previous Edit Post screen.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
|
||||
$text = __( 'If you prefer to use both editors side by side, do not enable this option. It is better to install the %1$sClassic Editor plugin%2$s.', 'tinymce-advanced' );
|
||||
/* translators: URL to (localised) Classic Editor plugin. */
|
||||
$url = __( 'https://wordpress.org/plugins/classic-editor/', 'tinymce-advanced' );
|
||||
printf( $text, '<a href="' . esc_url( $url ) . '">', '</a>' );
|
||||
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" name="admin_options[]" value="no_autop" id="no_autop" <?php if ( $this->check_admin_setting( 'no_autop' ) ) echo ' checked'; ?> />
|
||||
<label for="no_autop"><?php _e( 'Keep paragraph tags in the Classic block and the Classic Editor', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'Stop removing <p> and <br> tags in the Classic Editor and show them in the Text tab.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'This will make it possible to use more advanced coding in the Text tab without the back-end filtering affecting it much.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'However it may behave unexpectedly in rare cases, so test it thoroughly before enabling it permanently.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'Line breaks in the Text tab in the Classic Editor would still affect the output, in particular do not use empty lines, line breaks inside HTML tags or multiple <br> tags.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
$has_editor_style = $this->has_editor_style();
|
||||
$disabled = ' disabled';
|
||||
|
||||
if ( $has_editor_style === false ) {
|
||||
add_editor_style();
|
||||
$has_editor_style = $this->has_editor_style();
|
||||
}
|
||||
|
||||
if ( $has_editor_style ) {
|
||||
$disabled = '';
|
||||
}
|
||||
|
||||
?>
|
||||
<div>
|
||||
<input type="checkbox" name="admin_options[]" value="importcss" id="importcss" <?php if ( ! $disabled && $this->check_admin_setting( 'importcss' ) ) echo ' checked'; echo $disabled; ?> />
|
||||
<label for="importcss"><?php _e( 'Create CSS classes menu', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'Load the CSS classes used in editor-style.css and replace the Formats menu.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
<?php
|
||||
|
||||
if ( $disabled ) {
|
||||
?>
|
||||
<p>
|
||||
<span class="tadv-error"><?php _e( 'Disabled:', 'tinymce-advanced' ); ?></span>
|
||||
<?php _e( 'A stylesheet file named editor-style.css was not added by your theme.', 'tinymce-advanced' ); ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="advanced-table-options">
|
||||
<h4><?php _e( 'Advanced options for tables', 'tinymce-advanced' ); ?></h4>
|
||||
<div>
|
||||
<input type="checkbox" name="admin_options[]" value="table_resize_bars" id="table_resize_bars" <?php if ( $this->check_admin_setting( 'table_resize_bars' ) ) echo ' checked'; ?> />
|
||||
<label for="table_resize_bars"><?php _e( 'Enable resizing of tables, rows, and columns by dragging with the mouse', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'When enabled the whole table, rows, and columns can be resized by dragging but the sizes are set with inline CSS styles.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'This may override some styles that are set by your theme and usually makes the table non-responsive when viewed on a small screen like a smartphone.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'When a row or a column is resized the inline styles are updated on all table rows and cells.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php _e( 'Disabling this option will stop the editor from adding inline CSS styles and will produce cleaner HTML code.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'Then the table, the rows and the cells can be resized by typing the size values in the advanced options tabs.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<span class="dashicons dashicons-info"></span>
|
||||
<?php _e( 'This option does not affect inline styles on tables in existing posts. To reset table size or remove all formatting for the whole table please see the two buttons at the bottom of the Format menu.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" name="admin_options[]" value="table_default_attributes" id="table_default_attributes" <?php if ( $this->check_admin_setting( 'table_default_attributes' ) ) echo ' checked'; ?> />
|
||||
<label for="table_default_attributes"><?php _e( 'When inserting a table set the HTML border attribute to 1', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'This will add a border around the table unless it is overriden by your theme.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" name="admin_options[]" value="table_grid" id="table_grid" <?php if ( $this->check_admin_setting( 'table_grid' ) ) echo ' checked'; ?> />
|
||||
<label for="table_grid"><?php _e( 'When inserting a table show a grid where the number of rows and columns can be selected by dragging with the mouse', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'If the grid is disabled the number of rows and columns can be typed in the Insert Table dialog.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" name="admin_options[]" value="table_tab_navigation" id="table_tab_navigation" <?php if ( $this->check_admin_setting( 'table_tab_navigation' ) ) echo ' checked'; ?> />
|
||||
<label for="table_tab_navigation"><?php _e( 'Jump to the next cell when pressing the tab key while editing a table', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'When disabled, pressing the tab key will jump outside the editor area.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" name="admin_options[]" value="table_advtab" id="table_advtab" <?php if ( $this->check_admin_setting( 'table_advtab' ) ) echo ' checked'; ?> />
|
||||
<label for="table_advtab"><?php _e( 'Show the advanced tabs in the table properties dialogs', 'tinymce-advanced' ); ?></label>
|
||||
<p>
|
||||
<?php _e( 'The advanced tabs allow setting of inline CSS styles on the table, each row, and each cell. They have fields for easier setting of border, border color and background color styles.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<span class="dashicons dashicons-warning"></span>
|
||||
<?php _e( 'To keep the table more responsive please use percentage values when setting widths.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="advanced-options">
|
||||
<h3><?php _e( 'Administration', 'tinymce-advanced' ); ?></h3>
|
||||
<div>
|
||||
<h4><?php _e( 'Settings import and export', 'tinymce-advanced' ); ?></h4>
|
||||
<p>
|
||||
<?php _e( 'The settings are exported as a JSON encoded file.', 'tinymce-advanced' ); ?>
|
||||
<?php _e( 'It is important that the exported file is not edited in any way.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php wp_nonce_field( 'tadv-export-settings', 'tadv-export-settings-nonce', false ); ?>
|
||||
<input type="submit" class="button" name="tadv-export-settings" value="<?php _e( 'Export Settings', 'tinymce-advanced' ); ?>" />
|
||||
<input type="submit" class="button" name="tadv-import-settings" value="<?php _e( 'Import Settings', 'tinymce-advanced' ); ?>" />
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4><?php _e( 'Enable the editor enhancements for:', 'tinymce-advanced' ); ?></h4>
|
||||
<p>
|
||||
<input type="checkbox" id="tadv_enable_1" name="tadv_enable_at[]" value="edit_post_screen" <?php if ( $this->check_admin_setting( 'enable_edit_post_screen' ) ) echo ' checked'; ?> />
|
||||
<label for="tadv_enable_1"><?php _e( 'The Classic Editor (Add New and Edit posts and pages)', 'tinymce-advanced' ); ?></label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" id="tadv_enable_2" name="tadv_enable_at[]" value="rest_of_wpadmin" <?php if ( $this->check_admin_setting( 'enable_rest_of_wpadmin' ) ) echo ' checked'; ?> />
|
||||
<label for="tadv_enable_2"><?php _e( 'Other instances of the Classic (TinyMCE) editor in wp-admin', 'tinymce-advanced' ); ?></label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" id="tadv_enable_3" name="tadv_enable_at[]" value="on_front_end" <?php if ( $this->check_admin_setting( 'enable_on_front_end' ) ) echo ' checked'; ?> />
|
||||
<label for="tadv_enable_3"><?php _e( 'Instances of the Classic editor on the front end of the site', 'tinymce-advanced' ); ?></label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Add a notice that the plugin was renamed.
|
||||
?>
|
||||
<p>
|
||||
<span class="dashicons dashicons-info" style="color: #777;"></span>
|
||||
<?php _e( 'Please note: This plugin was renamed from "TinyMCE Advanced" to "Advanced Editor Tools". The plugin functionality remains the same.', 'tinymce-advanced' ); ?>
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<p class="tadv-submit">
|
||||
<?php wp_nonce_field( 'tadv-save-buttons-order' ); ?>
|
||||
<input class="button" type="submit" name="tadv-restore-defaults" value="<?php _e( 'Restore Default Settings', 'tinymce-advanced' ); ?>" />
|
||||
<input class="button-primary button-large" type="submit" name="tadv-save" value="<?php _e( 'Save Changes', 'tinymce-advanced' ); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<div id="wp-adv-error-message" class="tadv-error">
|
||||
<?php _e( 'The [Toolbar toggle] button shows or hides the second, third, and forth button rows. It will only work when it is in the first row and there are buttons in the second row.', 'tinymce-advanced' ); ?>
|
||||
</div>
|
||||
</div><?php // .wrap.tinymce-advanced end ?>
|
||||
1181
html/wp-content/plugins/tinymce-advanced/tinymce-advanced.php
Normal file
28
html/wp-content/plugins/tinymce-advanced/uninstall.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Clean-up on uninstalling.
|
||||
* @package advanced-editor-tools
|
||||
*/
|
||||
|
||||
if (
|
||||
! defined( 'WP_UNINSTALL_PLUGIN' ) ||
|
||||
! WP_UNINSTALL_PLUGIN ||
|
||||
dirname( WP_UNINSTALL_PLUGIN ) !== dirname( plugin_basename( __FILE__ ) )
|
||||
) {
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
delete_option( 'tadv_settings' );
|
||||
delete_option( 'tadv_admin_settings' );
|
||||
delete_option( 'tadv_version' );
|
||||
|
||||
// Delete old options
|
||||
delete_option('tadv_options');
|
||||
delete_option('tadv_toolbars');
|
||||
delete_option('tadv_plugins');
|
||||
delete_option('tadv_btns1');
|
||||
delete_option('tadv_btns2');
|
||||
delete_option('tadv_btns3');
|
||||
delete_option('tadv_btns4');
|
||||
delete_option('tadv_allbtns');
|
||||