This commit is contained in:
2026-04-07 14:50:23 +09:00
commit b4e485502b
4778 changed files with 2017091 additions and 0 deletions

View File

@@ -0,0 +1,580 @@
! function() {
var e = {},
t = function(t) {
for (var n = e[t], i = n.deps, o = n.defn, a = i.length, s = new Array(a), l = 0; l < a; ++l) s[l] = r(i[l]);
var c = o.apply(null, s);
if (void 0 === c) throw "module [" + t + "] returned undefined";
n.instance = c
},
n = function(t, n, r) {
if ("string" != typeof t) throw "module id must be a string";
if (void 0 === n) throw "no dependencies for " + t;
if (void 0 === r) throw "no definition function for " + t;
e[t] = {
deps: n,
defn: r,
instance: void 0
}
},
r = function(n) {
var r = e[n];
if (void 0 === r) throw "module [" + n + "] was undefined";
return void 0 === r.instance && t(n), r.instance
},
i = function(e, t) {
for (var n = e.length, i = new Array(n), o = 0; o < n; ++o) i.push(r(e[o]));
t.apply(null, t)
},
o = {};
o.bolt = {
module: {
api: {
define: n,
require: i,
demand: r
}
}
};
var a = n,
s = function(e, t) {
a(e, [], function() {
return t
})
};
s("1", tinymce.Env), s("2", tinymce.EditorManager), s("3", tinymce.ThemeManager), s("8", tinymce.util.Tools), s("9", tinymce.ui.Factory), s("a", tinymce.DOM), a("b", ["8", "9"], function(e, t) {
var n = "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
r = function(n, r, i) {
var o, a = [];
if (r) return e.each(r.split(/[ ,]/), function(e) {
var r, s = function() {
var t = n.selection;
e.settings.stateSelector && t.selectorChanged(e.settings.stateSelector, function(t) {
e.active(t)
}, !0), e.settings.disabledStateSelector && t.selectorChanged(e.settings.disabledStateSelector, function(t) {
e.disabled(t)
})
};
"|" == e ? o = null : t.has(e) ? (e = {
type: e,
size: i
}, a.push(e), o = null) : (o || (o = {
type: "buttongroup",
items: []
}, a.push(o)), n.buttons[e] && (r = e, e = n.buttons[r], "function" == typeof e && (e = e()), e.type = e.type || "button", e.size = i, e = t.create(e), o.items.push(e), n.initialized ? s() : n.on("init", s)))
}), {
type: "toolbar",
layout: "flow",
items: a
}
},
i = function(t, i) {
var o = [],
a = t.settings,
s = function(e) {
if (e) return o.push(r(t, e, i)), !0
};
if (e.isArray(a.toolbar)) {
if (0 === a.toolbar.length) return;
e.each(a.toolbar, function(e, t) {
a["toolbar" + (t + 1)] = e
}), delete a.toolbar
}
for (var l = 1; l < 10 && s(a["toolbar" + l]); l++);
if (o.length || a.toolbar === !1 || s(a.toolbar || n), o.length) return {
type: "panel",
layout: "stack",
classes: "toolbar-grp",
ariaRoot: !0,
ariaRemember: !0,
items: o
}
};
return {
createToolbar: r,
createToolbars: i
}
}), a("c", ["8"], function(e) {
var t = {
file: {
title: "File",
items: "newdocument"
},
edit: {
title: "Edit",
items: "undo redo | cut copy paste pastetext | selectall"
},
insert: {
title: "Insert",
items: "|"
},
view: {
title: "View",
items: "visualaid |"
},
format: {
title: "Format",
items: "bold italic underline strikethrough superscript subscript | formats | removeformat"
},
table: {
title: "Table"
},
tools: {
title: "Tools"
}
},
n = function(e, t) {
var n;
return "|" == t ? {
text: "|"
} : n = e[t]
},
r = function(r, i, o) {
var a, s, l, c, u;
if (u = e.makeMap((i.removed_menuitems || "").split(/[ ,]/)), i.menu ? (s = i.menu[o], c = !0) : s = t[o], s) {
a = {
text: s.title
}, l = [], e.each((s.items || "").split(/[ ,]/), function(e) {
var t = n(r, e);
t && !u[e] && l.push(n(r, e))
}), c || e.each(r, function(e) {
e.context == o && ("before" == e.separator && l.push({
text: "|"
}), e.prependToContext ? l.unshift(e) : l.push(e), "after" == e.separator && l.push({
text: "|"
}))
});
for (var d = 0; d < l.length; d++) "|" == l[d].text && (0 !== d && d != l.length - 1 || l.splice(d, 1));
if (a.menu = l, !a.menu.length) return null
}
return a
},
i = function(e) {
var n, i = [],
o = e.settings,
a = [];
if (o.menu)
for (n in o.menu) a.push(n);
else
for (n in t) a.push(n);
for (var s = "string" == typeof o.menubar ? o.menubar.split(/[ ,]/) : a, l = 0; l < s.length; l++) {
var c = s[l];
c = r(e.menuItems, e.settings, c), c && i.push(c)
}
return i
};
return {
createMenuButtons: i
}
}), s("j", tinymce.util.Delay), s("k", tinymce.geom.Rect), a("d", ["a", "8", "j", "b", "9", "k"], function(e, t, n, r, i, o) {
var a = function(e) {
return {
left: e.x,
top: e.y,
width: e.w,
height: e.h,
right: e.x + e.w,
bottom: e.y + e.h
}
},
s = function(e) {
t.each(e.contextToolbars, function(e) {
e.panel && e.panel.hide()
})
},
l = function(e, t) {
e.moveTo(t.left, t.top)
},
c = function(e, n, r) {
n = n ? n.substr(0, 2) : "", t.each({
t: "down",
b: "up"
}, function(t, i) {
e.classes.toggle("arrow-" + t, r(i, n.substr(0, 1)))
}), t.each({
l: "left",
r: "right"
}, function(t, i) {
e.classes.toggle("arrow-" + t, r(i, n.substr(1, 1)))
})
},
u = function(e, t, n, r, i, o) {
return o = a({
x: t,
y: n,
w: o.w,
h: o.h
}), e && (o = e({
elementRect: a(r),
contentAreaRect: a(i),
panelRect: o
})), o
},
d = function(a) {
var d, f = a.settings,
h = function() {
return a.contextToolbars || []
},
p = function(t) {
var n, r, i;
return n = e.getPos(a.getContentAreaContainer()), r = a.dom.getRect(t), i = a.dom.getRoot(), "BODY" === i.nodeName && (r.x -= i.ownerDocument.documentElement.scrollLeft || i.scrollLeft, r.y -= i.ownerDocument.documentElement.scrollTop || i.scrollTop), r.x += n.x, r.y += n.y, r
},
m = function(t, n) {
var r, i, d, h, m, g, v, y, b = f.inline_toolbar_position_handler;
if (!a.removed) {
if (!t || !t.toolbar.panel) return void s(a);
v = ["bc-tc", "tc-bc", "tl-bl", "bl-tl", "tr-br", "br-tr"], m = t.toolbar.panel, n && m.show(), d = p(t.element), i = e.getRect(m.getEl()), h = e.getRect(a.getContentAreaContainer() || a.getBody()), y = 25, "inline" !== e.getStyle(t.element, "display", !0) && (d.w = t.element.clientWidth, d.h = t.element.clientHeight), a.inline || (h.w = a.getDoc().documentElement.offsetWidth), a.selection.controlSelection.isResizable(t.element) && d.w < y && (d = o.inflate(d, 0, 8)), r = o.findBestRelativePosition(i, d, h, v), d = o.clamp(d, h), r ? (g = o.relativePosition(i, d, r), l(m, u(b, g.x, g.y, d, h, i))) : (h.h += i.h, d = o.intersect(h, d), d ? (r = o.findBestRelativePosition(i, d, h, ["bc-tc", "bl-tl", "br-tr"]), r ? (g = o.relativePosition(i, d, r), l(m, u(b, g.x, g.y, d, h, i))) : l(m, u(b, d.x, d.y, d, h, i))) : m.hide()), c(m, r, function(e, t) {
return e === t
})
}
},
g = function(e) {
return function() {
var t = function() {
a.selection && m(C(a.selection.getNode()), e)
};
n.requestAnimationFrame(t)
}
},
v = function() {
d || (d = a.selection.getScrollContainer() || a.getWin(), e.bind(d, "scroll", g(!0)), a.on("remove", function() {
e.unbind(d, "scroll")
}))
},
y = function(e) {
var t;
return e.toolbar.panel ? (e.toolbar.panel.show(), void m(e)) : (v(), t = i.create({
type: "floatpanel",
role: "dialog",
classes: "tinymce tinymce-inline arrow",
ariaLabel: "Inline toolbar",
layout: "flex",
direction: "column",
align: "stretch",
autohide: !1,
autofix: !0,
fixed: !0,
border: 1,
items: r.createToolbar(a, e.toolbar.items),
oncancel: function() {
a.focus()
}
}), e.toolbar.panel = t, t.renderTo(document.body).reflow(), void m(e))
},
b = function() {
t.each(h(), function(e) {
e.panel && e.panel.hide()
})
},
C = function(e) {
var t, n, r, i = h();
for (r = a.$(e).parents().add(e), t = r.length - 1; t >= 0; t--)
for (n = i.length - 1; n >= 0; n--)
if (i[n].predicate(r[t])) return {
toolbar: i[n],
element: r[t]
};
return null
};
a.on("click keyup setContent ObjectResized", function(e) {
("setcontent" !== e.type || e.selection) && n.setEditorTimeout(a, function() {
var e;
e = C(a.selection.getNode()), e ? (b(), y(e)) : b()
})
}), a.on("blur hide contextmenu", b), a.on("ObjectResizeStart", function() {
var e = C(a.selection.getNode());
e && e.toolbar.panel && e.toolbar.panel.hide()
}), a.on("ResizeEditor ResizeWindow", g(!0)), a.on("nodeChange", g(!1)), a.on("remove", function() {
t.each(h(), function(e) {
e.panel && e.panel.remove()
}), a.contextToolbars = {}
}), a.shortcuts.add("ctrl+shift+e > ctrl+shift+p", "", function() {
var e = C(a.selection.getNode());
e && e.toolbar.panel && e.toolbar.panel.items()[0].focus()
})
};
return {
addContextualToolbars: d
}
}), a("e", [], function() {
var e = function(e, t) {
return function() {
var n = e.find(t)[0];
n && n.focus(!0)
}
},
t = function(t, n) {
t.shortcuts.add("Alt+F9", "", e(n, "menubar")), t.shortcuts.add("Alt+F10,F10", "", e(n, "toolbar")), t.shortcuts.add("Alt+F11", "", e(n, "elementpath")), n.on("cancel", function() {
t.focus()
})
};
return {
addKeys: t
}
}), a("f", ["8", "9", "1"], function(e, t, n) {
var r = function(e) {
return {
element: function() {
return e
}
}
},
i = function(e, t, n) {
var i = e.settings[n];
i && i(r(t.getEl("body")))
},
o = function(t, n, r) {
e.each(r, function(e) {
var r = n.items().filter("#" + e.name)[0];
r && r.visible() && e.name !== t && (i(e, r, "onhide"), r.visible(!1))
})
},
a = function(e) {
e.items().each(function(e) {
e.active(!1)
})
},
s = function(t, n) {
return e.grep(t, function(e) {
return e.name === n
})[0]
},
l = function(e, n, r) {
return function(l) {
var c = l.control,
u = c.parents().filter("panel")[0],
d = u.find("#" + n)[0],
f = s(r, n);
o(n, u, r), a(c.parent()), d && d.visible() ? (i(f, d, "onhide"), d.hide(), c.active(!1)) : (d ? (d.show(), i(f, d, "onshow")) : (d = t.create({
type: "container",
name: n,
layout: "stack",
classes: "sidebar-panel",
html: ""
}), u.prepend(d), i(f, d, "onrender"), i(f, d, "onshow")), c.active(!0)), e.fire("ResizeEditor")
}
},
c = function() {
return !n.ie || n.ie >= 11
},
u = function(e) {
return !(!c() || !e.sidebars) && e.sidebars.length > 0
},
d = function(t) {
var n = e.map(t.sidebars, function(e) {
var n = e.settings;
return {
type: "button",
icon: n.icon,
image: n.image,
tooltip: n.tooltip,
onclick: l(t, e.name, t.sidebars)
}
});
return {
type: "panel",
name: "sidebar",
layout: "stack",
classes: "sidebar",
items: [{
type: "toolbar",
layout: "stack",
classes: "sidebar-toolbar",
items: n
}]
}
};
return {
hasSidebar: u,
createSidebar: d
}
}), a("g", [], function() {
var e = function(e) {
return function() {
e.initialized ? e.fire("SkinLoaded") : e.on("init", function() {
e.fire("SkinLoaded")
})
}
};
return {
fireSkinLoaded: e
}
}), a("6", ["a"], function(e) {
var t = function(e) {
return {
width: e.clientWidth,
height: e.clientHeight
}
},
n = function(n, r, i) {
var o, a, s, l, c = n.settings;
o = n.getContainer(), a = n.getContentAreaContainer().firstChild, s = t(o), l = t(a), null !== r && (r = Math.max(c.min_width || 100, r), r = Math.min(c.max_width || 65535, r), e.setStyle(o, "width", r + (s.width - l.width)), e.setStyle(a, "width", r)), i = Math.max(c.min_height || 100, i), i = Math.min(c.max_height || 65535, i), e.setStyle(a, "height", i), n.fire("ResizeEditor")
},
r = function(e, t, r) {
var i = e.getContentAreaContainer();
n(e, i.clientWidth + t, i.clientHeight + r)
};
return {
resizeTo: n,
resizeBy: r
}
}), a("4", ["8", "9", "a", "b", "c", "d", "e", "f", "g", "6"], function(e, t, n, r, i, o, a, s, l, c) {
var u = function(e) {
return function(t) {
e.find("*").disabled("readonly" === t.mode)
}
},
d = function(e) {
return {
type: "panel",
name: "iframe",
layout: "stack",
classes: "edit-area",
border: e,
html: ""
}
},
f = function(e) {
return {
type: "panel",
layout: "stack",
classes: "edit-aria-container",
border: "1 0 0 0",
items: [d("0"), s.createSidebar(e)]
}
},
h = function(e, h, p) {
var m, g, v, y = e.settings;
return p.skinUiCss && n.styleSheetLoader.load(p.skinUiCss, l.fireSkinLoaded(e)), m = h.panel = t.create({
type: "panel",
role: "application",
classes: "tinymce",
style: "visibility: hidden",
layout: "stack",
border: 1,
items: [y.menubar === !1 ? null : {
type: "menubar",
border: "0 0 1 0",
items: i.createMenuButtons(e)
}, r.createToolbars(e, y.toolbar_items_size), s.hasSidebar(e) ? f(e) : d("1 0 0 0")]
}), y.resize !== !1 && (g = {
type: "resizehandle",
direction: y.resize,
onResizeStart: function() {
var t = e.getContentAreaContainer().firstChild;
v = {
width: t.clientWidth,
height: t.clientHeight
}
},
onResize: function(t) {
"both" === y.resize ? c.resizeTo(e, v.width + t.deltaX, v.height + t.deltaY) : c.resizeTo(e, null, v.height + t.deltaY)
}
}), y.statusbar !== !1 && m.add({
type: "panel",
name: "statusbar",
classes: "statusbar",
layout: "flow",
border: "1 0 0 0",
ariaRoot: !0,
items: [{
type: "elementpath",
editor: e
}, g]
}), e.fire("BeforeRenderUI"), e.on("SwitchMode", u(m)), m.renderBefore(p.targetNode).reflow(), y.readonly && e.setMode("readonly"), y.width && n.setStyle(m.getEl(), "width", y.width), e.on("remove", function() {
m.remove(), m = null
}), a.addKeys(e, m), o.addContextualToolbars(e), {
iframeContainer: m.find("#iframe")[0].getEl(),
editorContainer: m.getEl()
}
};
return {
render: h
}
}), s("h", tinymce.ui.FloatPanel), a("5", ["8", "9", "a", "h", "b", "c", "d", "e", "g"], function(e, t, n, r, i, o, a, s, l) {
var c = function(e, c, u) {
var d, f, h = e.settings;
h.fixed_toolbar_container && (f = n.select(h.fixed_toolbar_container)[0]);
var p = function() {
if (d && d.moveRel && d.visible() && !d._fixed) {
var t = e.selection.getScrollContainer(),
r = e.getBody(),
i = 0,
o = 0;
if (t) {
var a = n.getPos(r),
s = n.getPos(t);
i = Math.max(0, s.x - a.x), o = Math.max(0, s.y - a.y)
}
d.fixed(!1).moveRel(r, e.rtl ? ["tr-br", "br-tr"] : ["tl-bl", "bl-tl", "tr-br"]).moveBy(i, o)
}
},
m = function() {
d && (d.show(), p(), n.addClass(e.getBody(), "mce-edit-focus"))
},
g = function() {
d && (d.hide(), r.hideAll(), n.removeClass(e.getBody(), "mce-edit-focus"))
},
v = function() {
return d ? void(d.visible() || m()) : (d = c.panel = t.create({
type: f ? "panel" : "floatpanel",
role: "application",
classes: "tinymce tinymce-inline",
layout: "flex",
direction: "column",
align: "stretch",
autohide: !1,
autofix: !0,
fixed: !!f,
border: 1,
items: [h.menubar === !1 ? null : {
type: "menubar",
border: "0 0 1 0",
items: o.createMenuButtons(e)
}, i.createToolbars(e, h.toolbar_items_size)]
}), e.fire("BeforeRenderUI"), d.renderTo(f || document.body).reflow(), s.addKeys(e, d), m(), a.addContextualToolbars(e), e.on("nodeChange", p), e.on("activate", m), e.on("deactivate", g), void e.nodeChanged())
};
return h.content_editable = !0, e.on("focus", function() {
u.skinUiCss ? n.styleSheetLoader.load(u.skinUiCss, v, v) : v()
}), e.on("blur hide", g), e.on("remove", function() {
d && (d.remove(), d = null)
}), u.skinUiCss && n.styleSheetLoader.load(u.skinUiCss, l.fireSkinLoaded(e)), {}
};
return {
render: c
}
}), s("i", tinymce.ui.Throbber), a("7", ["i"], function(e) {
var t = function(t, n) {
var r;
t.on("ProgressState", function(t) {
r = r || new e(n.panel.getEl("body")), t.state ? r.show(t.time) : r.hide()
})
};
return {
setup: t
}
}), a("0", ["1", "2", "3", "4", "5", "6", "7"], function(e, t, n, r, i, o, a) {
var s = function(n, o, s) {
var l = n.settings,
c = l.skin !== !1 && (l.skin || "lightgray");
if (c) {
var u = l.skin_url;
u = u ? n.documentBaseURI.toAbsolute(u) : t.baseURL + "/skins/" + c, e.documentMode <= 7 ? s.skinUiCss = u + "/skin.ie7.min.css" : s.skinUiCss = u + "/skin.min.css", n.contentCSS.push(u + "/content" + (n.inline ? ".inline" : "") + ".min.css")
}
return a.setup(n, o), l.inline ? i.render(n, o, s) : r.render(n, o, s)
};
return n.add("modern", function(e) {
return {
renderUI: function(t) {
return s(e, this, t)
},
resizeTo: function(t, n) {
return o.resizeTo(e, t, n)
},
resizeBy: function(t, n) {
return o.resizeBy(e, t, n)
}
}
}),
function() {}
}), r("0")()
}();

View File

@@ -0,0 +1,87 @@
tinymce.PluginManager.add("advlist", function(e) {
function t(t) {
return e.$.contains(e.getBody(), t)
}
function n(e) {
return e && /^(OL|UL|DL)$/.test(e.nodeName) && t(e)
}
function r(e, t) {
var n = [];
return tinymce.each(t.split(/[ ,]/), function(e) {
n.push({
text: e.replace(/\-/g, " ").replace(/\b\w/g, function(e) {
return e.toUpperCase()
}),
data: "default" == e ? "" : e
})
}), n
}
function i(t, n) {
e.undoManager.transact(function() {
var r, i = e.dom,
o = e.selection;
if (r = i.getParent(o.getNode(), "ol,ul"), !r || r.nodeName != t || n === !1) {
var a = {
"list-style-type": n ? n : ""
};
e.execCommand("UL" == t ? "InsertUnorderedList" : "InsertOrderedList", !1, a)
}
r = i.getParent(o.getNode(), "ol,ul"), r && tinymce.util.Tools.each(i.select("ol,ul", r).concat([r]), function(e) {
e.nodeName !== t && n !== !1 && (e = i.rename(e, t)), i.setStyle(e, "listStyleType", n ? n : null), e.removeAttribute("data-mce-style")
}), e.focus()
})
}
function o(t) {
var n = e.dom.getStyle(e.dom.getParent(e.selection.getNode(), "ol,ul"), "listStyleType") || "";
t.control.items().each(function(e) {
e.active(e.settings.data === n)
})
}
var a, s, l = function(e, t) {
var n = e.settings.plugins ? e.settings.plugins : "";
return tinymce.util.Tools.inArray(n.split(/[ ,]/), t) !== -1
};
a = r("OL", e.getParam("advlist_number_styles", "default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")), s = r("UL", e.getParam("advlist_bullet_styles", "default,circle,disc,square"));
var c = function(t) {
return function() {
var r = this;
e.on("NodeChange", function(e) {
var i = tinymce.util.Tools.grep(e.parents, n);
r.active(i.length > 0 && i[0].nodeName === t)
})
}
};
l(e, "lists") && (e.addCommand("ApplyUnorderedListStyle", function(e, t) {
i("UL", t["list-style-type"])
}), e.addCommand("ApplyOrderedListStyle", function(e, t) {
i("OL", t["list-style-type"])
}), e.addButton("numlist", {
type: "splitbutton",
tooltip: "Numbered list",
menu: a,
onPostRender: c("OL"),
onshow: o,
onselect: function(e) {
i("OL", e.control.settings.data)
},
onclick: function() {
i("OL", !1)
}
}), e.addButton("bullist", {
type: "splitbutton",
tooltip: "Bullet list",
onPostRender: c("UL"),
menu: s,
onshow: o,
onselect: function(e) {
i("UL", e.control.settings.data)
},
onclick: function() {
i("UL", !1)
}
}))
});

View File

@@ -0,0 +1,44 @@
tinymce.PluginManager.add("anchor", function(e) {
var t = function(e) {
return !e.attr("href") && (e.attr("id") || e.attr("name")) && !e.firstChild
},
n = function(e) {
return function(n) {
for (var r = 0; r < n.length; r++) t(n[r]) && n[r].attr("contenteditable", e)
}
},
r = function() {
var t = e.selection.getNode(),
n = "A" == t.tagName && "" === e.dom.getAttrib(t, "href"),
r = "";
n && (r = t.id || t.name || ""), e.windowManager.open({
title: "Anchor",
body: {
type: "textbox",
name: "id",
size: 40,
label: "Id",
value: r
},
onsubmit: function(r) {
var i = r.data.id;
n ? (t.removeAttribute("name"), t.id = i) : (e.selection.collapse(!0), e.execCommand("mceInsertContent", !1, e.dom.createHTML("a", {
id: i
})))
}
})
};
tinymce.Env.ceFalse && e.on("PreInit", function() {
e.parser.addNodeFilter("a", n("false")), e.serializer.addNodeFilter("a", n(null))
}), e.addCommand("mceAnchor", r), e.addButton("anchor", {
icon: "anchor",
tooltip: "Anchor",
onclick: r,
stateSelector: "a:not([href])"
}), e.addMenuItem("anchor", {
icon: "anchor",
text: "Anchor",
context: "insert",
onclick: r
})
});

View File

@@ -0,0 +1,66 @@
tinymce.PluginManager.add("autolink", function(e) {
function t(e) {
i(e, -1, "(", !0)
}
function n(e) {
i(e, 0, "", !0)
}
function r(e) {
i(e, -1, "", !1)
}
function i(e, t, n) {
function r(e, t) {
if (t < 0 && (t = 0), 3 == e.nodeType) {
var n = e.data.length;
t > n && (t = n)
}
return t
}
function i(e, t) {
1 != e.nodeType || e.hasChildNodes() ? s.setStart(e, r(e, t)) : s.setStartBefore(e)
}
function o(e, t) {
1 != e.nodeType || e.hasChildNodes() ? s.setEnd(e, r(e, t)) : s.setEndAfter(e)
}
var s, l, c, u, d, f, h, p, m, g;
if ("A" != e.selection.getNode().tagName) {
if (s = e.selection.getRng(!0).cloneRange(), s.startOffset < 5) {
if (p = s.endContainer.previousSibling, !p) {
if (!s.endContainer.firstChild || !s.endContainer.firstChild.nextSibling) return;
p = s.endContainer.firstChild.nextSibling
}
if (m = p.length, i(p, m), o(p, m), s.endOffset < 5) return;
l = s.endOffset, u = p
} else {
if (u = s.endContainer, 3 != u.nodeType && u.firstChild) {
for (; 3 != u.nodeType && u.firstChild;) u = u.firstChild;
3 == u.nodeType && (i(u, 0), o(u, u.nodeValue.length))
}
l = 1 == s.endOffset ? 2 : s.endOffset - 1 - t
}
c = l;
do i(u, l >= 2 ? l - 2 : 0), o(u, l >= 1 ? l - 1 : 0), l -= 1, g = s.toString(); while (" " != g && "" !== g && 160 != g.charCodeAt(0) && l - 2 >= 0 && g != n);
s.toString() == n || 160 == s.toString().charCodeAt(0) ? (i(u, l), o(u, c), l += 1) : 0 === s.startOffset ? (i(u, 0), o(u, c)) : (i(u, l), o(u, c)), f = s.toString(), "." == f.charAt(f.length - 1) && o(u, c - 1), f = s.toString(), h = f.match(a), h && ("www." == h[1] ? h[1] = "http://www." : /@$/.test(h[1]) && !/^mailto:/.test(h[1]) && (h[1] = "mailto:" + h[1]), d = e.selection.getBookmark(), e.selection.setRng(s), e.execCommand("createlink", !1, h[1] + h[2]), e.settings.default_link_target && e.dom.setAttrib(e.selection.getNode(), "target", e.settings.default_link_target), e.selection.moveToBookmark(d), e.nodeChanged())
}
}
var o, a = /^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i;
return e.settings.autolink_pattern && (a = e.settings.autolink_pattern), e.on("keydown", function(t) {
if (13 == t.keyCode) return r(e)
}), tinymce.Env.ie ? void e.on("focus", function() {
if (!o) {
o = !0;
try {
e.execCommand("AutoUrlDetect", !1, !0)
} catch (e) {}
}
}) : (e.on("keypress", function(n) {
if (41 == n.keyCode) return t(e)
}), void e.on("keyup", function(t) {
if (32 == t.keyCode) return n(e)
}))
});

View File

@@ -0,0 +1,382 @@
tinymce.PluginManager.add("charmap", function(e) {
function t() {
return [
["160", "no-break space"],
["173", "soft hyphen"],
["34", "quotation mark"],
["162", "cent sign"],
["8364", "euro sign"],
["163", "pound sign"],
["165", "yen sign"],
["169", "copyright sign"],
["174", "registered sign"],
["8482", "trade mark sign"],
["8240", "per mille sign"],
["181", "micro sign"],
["183", "middle dot"],
["8226", "bullet"],
["8230", "three dot leader"],
["8242", "minutes / feet"],
["8243", "seconds / inches"],
["167", "section sign"],
["182", "paragraph sign"],
["223", "sharp s / ess-zed"],
["8249", "single left-pointing angle quotation mark"],
["8250", "single right-pointing angle quotation mark"],
["171", "left pointing guillemet"],
["187", "right pointing guillemet"],
["8216", "left single quotation mark"],
["8217", "right single quotation mark"],
["8220", "left double quotation mark"],
["8221", "right double quotation mark"],
["8218", "single low-9 quotation mark"],
["8222", "double low-9 quotation mark"],
["60", "less-than sign"],
["62", "greater-than sign"],
["8804", "less-than or equal to"],
["8805", "greater-than or equal to"],
["8211", "en dash"],
["8212", "em dash"],
["175", "macron"],
["8254", "overline"],
["164", "currency sign"],
["166", "broken bar"],
["168", "diaeresis"],
["161", "inverted exclamation mark"],
["191", "turned question mark"],
["710", "circumflex accent"],
["732", "small tilde"],
["176", "degree sign"],
["8722", "minus sign"],
["177", "plus-minus sign"],
["247", "division sign"],
["8260", "fraction slash"],
["215", "multiplication sign"],
["185", "superscript one"],
["178", "superscript two"],
["179", "superscript three"],
["188", "fraction one quarter"],
["189", "fraction one half"],
["190", "fraction three quarters"],
["402", "function / florin"],
["8747", "integral"],
["8721", "n-ary sumation"],
["8734", "infinity"],
["8730", "square root"],
["8764", "similar to"],
["8773", "approximately equal to"],
["8776", "almost equal to"],
["8800", "not equal to"],
["8801", "identical to"],
["8712", "element of"],
["8713", "not an element of"],
["8715", "contains as member"],
["8719", "n-ary product"],
["8743", "logical and"],
["8744", "logical or"],
["172", "not sign"],
["8745", "intersection"],
["8746", "union"],
["8706", "partial differential"],
["8704", "for all"],
["8707", "there exists"],
["8709", "diameter"],
["8711", "backward difference"],
["8727", "asterisk operator"],
["8733", "proportional to"],
["8736", "angle"],
["180", "acute accent"],
["184", "cedilla"],
["170", "feminine ordinal indicator"],
["186", "masculine ordinal indicator"],
["8224", "dagger"],
["8225", "double dagger"],
["192", "A - grave"],
["193", "A - acute"],
["194", "A - circumflex"],
["195", "A - tilde"],
["196", "A - diaeresis"],
["197", "A - ring above"],
["256", "A - macron"],
["198", "ligature AE"],
["199", "C - cedilla"],
["200", "E - grave"],
["201", "E - acute"],
["202", "E - circumflex"],
["203", "E - diaeresis"],
["274", "E - macron"],
["204", "I - grave"],
["205", "I - acute"],
["206", "I - circumflex"],
["207", "I - diaeresis"],
["298", "I - macron"],
["208", "ETH"],
["209", "N - tilde"],
["210", "O - grave"],
["211", "O - acute"],
["212", "O - circumflex"],
["213", "O - tilde"],
["214", "O - diaeresis"],
["216", "O - slash"],
["332", "O - macron"],
["338", "ligature OE"],
["352", "S - caron"],
["217", "U - grave"],
["218", "U - acute"],
["219", "U - circumflex"],
["220", "U - diaeresis"],
["362", "U - macron"],
["221", "Y - acute"],
["376", "Y - diaeresis"],
["562", "Y - macron"],
["222", "THORN"],
["224", "a - grave"],
["225", "a - acute"],
["226", "a - circumflex"],
["227", "a - tilde"],
["228", "a - diaeresis"],
["229", "a - ring above"],
["257", "a - macron"],
["230", "ligature ae"],
["231", "c - cedilla"],
["232", "e - grave"],
["233", "e - acute"],
["234", "e - circumflex"],
["235", "e - diaeresis"],
["275", "e - macron"],
["236", "i - grave"],
["237", "i - acute"],
["238", "i - circumflex"],
["239", "i - diaeresis"],
["299", "i - macron"],
["240", "eth"],
["241", "n - tilde"],
["242", "o - grave"],
["243", "o - acute"],
["244", "o - circumflex"],
["245", "o - tilde"],
["246", "o - diaeresis"],
["248", "o slash"],
["333", "o macron"],
["339", "ligature oe"],
["353", "s - caron"],
["249", "u - grave"],
["250", "u - acute"],
["251", "u - circumflex"],
["252", "u - diaeresis"],
["363", "u - macron"],
["253", "y - acute"],
["254", "thorn"],
["255", "y - diaeresis"],
["563", "y - macron"],
["913", "Alpha"],
["914", "Beta"],
["915", "Gamma"],
["916", "Delta"],
["917", "Epsilon"],
["918", "Zeta"],
["919", "Eta"],
["920", "Theta"],
["921", "Iota"],
["922", "Kappa"],
["923", "Lambda"],
["924", "Mu"],
["925", "Nu"],
["926", "Xi"],
["927", "Omicron"],
["928", "Pi"],
["929", "Rho"],
["931", "Sigma"],
["932", "Tau"],
["933", "Upsilon"],
["934", "Phi"],
["935", "Chi"],
["936", "Psi"],
["937", "Omega"],
["945", "alpha"],
["946", "beta"],
["947", "gamma"],
["948", "delta"],
["949", "epsilon"],
["950", "zeta"],
["951", "eta"],
["952", "theta"],
["953", "iota"],
["954", "kappa"],
["955", "lambda"],
["956", "mu"],
["957", "nu"],
["958", "xi"],
["959", "omicron"],
["960", "pi"],
["961", "rho"],
["962", "final sigma"],
["963", "sigma"],
["964", "tau"],
["965", "upsilon"],
["966", "phi"],
["967", "chi"],
["968", "psi"],
["969", "omega"],
["8501", "alef symbol"],
["982", "pi symbol"],
["8476", "real part symbol"],
["978", "upsilon - hook symbol"],
["8472", "Weierstrass p"],
["8465", "imaginary part"],
["8592", "leftwards arrow"],
["8593", "upwards arrow"],
["8594", "rightwards arrow"],
["8595", "downwards arrow"],
["8596", "left right arrow"],
["8629", "carriage return"],
["8656", "leftwards double arrow"],
["8657", "upwards double arrow"],
["8658", "rightwards double arrow"],
["8659", "downwards double arrow"],
["8660", "left right double arrow"],
["8756", "therefore"],
["8834", "subset of"],
["8835", "superset of"],
["8836", "not a subset of"],
["8838", "subset of or equal to"],
["8839", "superset of or equal to"],
["8853", "circled plus"],
["8855", "circled times"],
["8869", "perpendicular"],
["8901", "dot operator"],
["8968", "left ceiling"],
["8969", "right ceiling"],
["8970", "left floor"],
["8971", "right floor"],
["9001", "left-pointing angle bracket"],
["9002", "right-pointing angle bracket"],
["9674", "lozenge"],
["9824", "black spade suit"],
["9827", "black club suit"],
["9829", "black heart suit"],
["9830", "black diamond suit"],
["8194", "en space"],
["8195", "em space"],
["8201", "thin space"],
["8204", "zero width non-joiner"],
["8205", "zero width joiner"],
["8206", "left-to-right mark"],
["8207", "right-to-left mark"]
]
}
function n(e) {
return tinymce.util.Tools.grep(e, function(e) {
return l(e) && 2 == e.length
})
}
function r(e) {
return l(e) ? [].concat(n(e)) : "function" == typeof e ? e() : []
}
function i(t) {
var n = e.settings;
return n.charmap && (t = r(n.charmap)), n.charmap_append ? [].concat(t).concat(r(n.charmap_append)) : t
}
function o() {
return i(t())
}
function a(t) {
e.fire("insertCustomChar", {
chr: t
}).chr, e.execCommand("mceInsertContent", !1, t)
}
function s() {
function t(e) {
for (; e;) {
if ("TD" == e.nodeName) return e;
e = e.parentNode
}
}
var n, r, i, s;
n = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
var l = o(),
c = Math.min(l.length, 25),
u = Math.ceil(l.length / c);
for (i = 0; i < u; i++) {
for (n += "<tr>", r = 0; r < c; r++) {
var d = i * c + r;
if (d < l.length) {
var f = l[d],
h = f ? String.fromCharCode(parseInt(f[0], 10)) : "&nbsp;";
n += '<td title="' + f[1] + '"><div tabindex="-1" title="' + f[1] + '" role="button" data-chr="' + h + '">' + h + "</div></td>"
} else n += "<td />"
}
n += "</tr>"
}
n += "</tbody></table>";
var p = {
type: "container",
html: n,
onclick: function(e) {
var n = e.target;
/^(TD|DIV)$/.test(n.nodeName) && t(n).firstChild && (a(n.getAttribute("data-chr")), e.ctrlKey || s.close())
},
onmouseover: function(e) {
var n = t(e.target);
n && n.firstChild ? (s.find("#preview").text(n.firstChild.firstChild.data), s.find("#previewTitle").text(n.title)) : (s.find("#preview").text(" "), s.find("#previewTitle").text(" "))
}
};
s = e.windowManager.open({
title: "Special character",
spacing: 10,
padding: 10,
items: [p, {
type: "container",
layout: "flex",
direction: "column",
align: "center",
spacing: 5,
minWidth: 160,
minHeight: 160,
items: [{
type: "label",
name: "preview",
text: " ",
style: "font-size: 40px; text-align: center",
border: 1,
minWidth: 140,
minHeight: 80
}, {
type: "label",
name: "previewTitle",
text: " ",
style: "text-align: center",
border: 1,
minWidth: 140,
minHeight: 80
}]
}],
buttons: [{
text: "Close",
onclick: function() {
s.close()
}
}]
})
}
var l = tinymce.util.Tools.isArray;
return e.addCommand("mceShowCharmap", s), e.addButton("charmap", {
icon: "charmap",
tooltip: "Special character",
cmd: "mceShowCharmap"
}), e.addMenuItem("charmap", {
icon: "charmap",
text: "Special character",
cmd: "mceShowCharmap",
context: "insert"
}), {
getCharMap: o,
insertChar: a
}
});

View File

@@ -0,0 +1,34 @@
tinymce.PluginManager.add("code", function(e) {
function t() {
var t = e.windowManager.open({
title: "Source code",
body: {
type: "textbox",
name: "code",
multiline: !0,
minWidth: e.getParam("code_dialog_width", 600),
minHeight: e.getParam("code_dialog_height", Math.min(tinymce.DOM.getViewPort().h - 200, 500)),
spellcheck: !1,
style: "direction: ltr; text-align: left"
},
onSubmit: function(t) {
e.focus(), e.undoManager.transact(function() {
e.setContent(t.data.code)
}), e.selection.setCursorLocation(), e.nodeChanged()
}
});
t.find("#code").value(e.getContent({
source_view: !0
}))
}
e.addCommand("mceCodeEditor", t), e.addButton("code", {
icon: "code",
tooltip: "Source code",
onclick: t
}), e.addMenuItem("code", {
icon: "code",
text: "Source code",
context: "tools",
onclick: t
})
});

View File

@@ -0,0 +1,143 @@
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

View File

@@ -0,0 +1,692 @@
! function(e, t) {
"use strict";
function n(e, t) {
for (var n, r = [], o = 0; o < e.length; ++o) {
if (n = a[e[o]] || i(e[o]), !n) throw "module definition dependecy not found: " + e[o];
r.push(n)
}
t.apply(null, r)
}
function r(e, r, i) {
if ("string" != typeof e) throw "invalid module definition, module id must be defined and be a string";
if (r === t) throw "invalid module definition, dependencies must be specified";
if (i === t) throw "invalid module definition, definition function must be specified";
n(r, function() {
a[e] = i.apply(null, arguments)
})
}
function i(t) {
for (var n = e, r = t.split(/[.\/]/), i = 0; i < r.length; ++i) {
if (!n[r[i]]) return;
n = n[r[i]]
}
return n
}
function o(n) {
var r, i, o, s, l;
for (r = 0; r < n.length; r++) {
i = e, o = n[r], s = o.split(/[.\/]/);
for (var c = 0; c < s.length - 1; ++c) i[s[c]] === t && (i[s[c]] = {}), i = i[s[c]];
i[s[s.length - 1]] = a[o]
}
if (e.AMDLC_TESTS) {
l = e.privateModules || {};
for (o in a) l[o] = a[o];
for (r = 0; r < n.length; r++) delete l[n[r]];
e.privateModules = l
}
}
var a = {};
r("tinymce/codesampleplugin/Prism", [], function() {
var e = {},
t = "undefined" != typeof e ? e : "undefined" != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope ? self : {},
n = function() {
var e = /\blang(?:uage)?-(?!\*)(\w+)\b/i,
n = t.Prism = {
util: {
encode: function(e) {
return e instanceof r ? new r(e.type, n.util.encode(e.content), e.alias) : "Array" === n.util.type(e) ? e.map(n.util.encode) : e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ")
},
type: function(e) {
return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]
},
clone: function(e) {
var t = n.util.type(e);
switch (t) {
case "Object":
var r = {};
for (var i in e) e.hasOwnProperty(i) && (r[i] = n.util.clone(e[i]));
return r;
case "Array":
return e.map && e.map(function(e) {
return n.util.clone(e)
})
}
return e
}
},
languages: {
extend: function(e, t) {
var r = n.util.clone(n.languages[e]);
for (var i in t) r[i] = t[i];
return r
},
insertBefore: function(e, t, r, i) {
i = i || n.languages;
var o = i[e];
if (2 == arguments.length) {
r = arguments[1];
for (var a in r) r.hasOwnProperty(a) && (o[a] = r[a]);
return o
}
var s = {};
for (var l in o)
if (o.hasOwnProperty(l)) {
if (l == t)
for (var a in r) r.hasOwnProperty(a) && (s[a] = r[a]);
s[l] = o[l]
}
return n.languages.DFS(n.languages, function(t, n) {
n === i[e] && t != e && (this[t] = s)
}), i[e] = s
},
DFS: function(e, t, r) {
for (var i in e) e.hasOwnProperty(i) && (t.call(e, i, e[i], r || i), "Object" === n.util.type(e[i]) ? n.languages.DFS(e[i], t) : "Array" === n.util.type(e[i]) && n.languages.DFS(e[i], t, i))
}
},
plugins: {},
highlightAll: function(e, t) {
for (var r, i = document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'), o = 0; r = i[o++];) n.highlightElement(r, e === !0, t)
},
highlightElement: function(r, i, o) {
for (var a, s, l = r; l && !e.test(l.className);) l = l.parentNode;
l && (a = (l.className.match(e) || [, ""])[1], s = n.languages[a]), r.className = r.className.replace(e, "").replace(/\s+/g, " ") + " language-" + a, l = r.parentNode, /pre/i.test(l.nodeName) && (l.className = l.className.replace(e, "").replace(/\s+/g, " ") + " language-" + a);
var c = r.textContent,
u = {
element: r,
language: a,
grammar: s,
code: c
};
if (!c || !s) return void n.hooks.run("complete", u);
if (n.hooks.run("before-highlight", u), i && t.Worker) {
var d = new Worker(n.filename);
d.onmessage = function(e) {
u.highlightedCode = e.data, n.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, o && o.call(u.element), n.hooks.run("after-highlight", u), n.hooks.run("complete", u)
}, d.postMessage(JSON.stringify({
language: u.language,
code: u.code,
immediateClose: !0
}))
} else u.highlightedCode = n.highlight(u.code, u.grammar, u.language), n.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, o && o.call(r), n.hooks.run("after-highlight", u), n.hooks.run("complete", u)
},
highlight: function(e, t, i) {
var o = n.tokenize(e, t);
return r.stringify(n.util.encode(o), i)
},
tokenize: function(e, t, r) {
var i = n.Token,
o = [e],
a = t.rest;
if (a) {
for (var s in a) t[s] = a[s];
delete t.rest
}
e: for (var s in t)
if (t.hasOwnProperty(s) && t[s]) {
var l = t[s];
l = "Array" === n.util.type(l) ? l : [l];
for (var c = 0; c < l.length; ++c) {
var u = l[c],
d = u.inside,
f = !!u.lookbehind,
h = 0,
p = u.alias;
u = u.pattern || u;
for (var m = 0; m < o.length; m++) {
var g = o[m];
if (o.length > e.length) break e;
if (!(g instanceof i)) {
u.lastIndex = 0;
var v = u.exec(g);
if (v) {
f && (h = v[1].length);
var y = v.index - 1 + h,
v = v[0].slice(h),
b = v.length,
C = y + b,
x = g.slice(0, y + 1),
w = g.slice(C + 1),
E = [m, 1];
x && E.push(x);
var N = new i(s, d ? n.tokenize(v, d) : v, p);
E.push(N), w && E.push(w), Array.prototype.splice.apply(o, E)
}
}
}
}
}
return o
},
hooks: {
all: {},
add: function(e, t) {
var r = n.hooks.all;
r[e] = r[e] || [], r[e].push(t)
},
run: function(e, t) {
var r = n.hooks.all[e];
if (r && r.length)
for (var i, o = 0; i = r[o++];) i(t)
}
}
},
r = n.Token = function(e, t, n) {
this.type = e, this.content = t, this.alias = n
};
if (r.stringify = function(e, t, i) {
if ("string" == typeof e) return e;
if ("Array" === n.util.type(e)) return e.map(function(n) {
return r.stringify(n, t, e)
}).join("");
var o = {
type: e.type,
content: r.stringify(e.content, t, i),
tag: "span",
classes: ["token", e.type],
attributes: {},
language: t,
parent: i
};
if ("comment" == o.type && (o.attributes.spellcheck = "true"), e.alias) {
var a = "Array" === n.util.type(e.alias) ? e.alias : [e.alias];
Array.prototype.push.apply(o.classes, a)
}
n.hooks.run("wrap", o);
var s = "";
for (var l in o.attributes) s += (s ? " " : "") + l + '="' + (o.attributes[l] || "") + '"';
return "<" + o.tag + ' class="' + o.classes.join(" ") + '" ' + s + ">" + o.content + "</" + o.tag + ">"
}, !t.document) return t.addEventListener ? (t.addEventListener("message", function(e) {
var r = JSON.parse(e.data),
i = r.language,
o = r.code,
a = r.immediateClose;
t.postMessage(n.highlight(o, n.languages[i], i)), a && t.close()
}, !1), t.Prism) : t.Prism
}();
return "undefined" != typeof module && module.exports && (module.exports = n), "undefined" != typeof global && (global.Prism = n), n.languages.markup = {
comment: /<!--[\w\W]*?-->/,
prolog: /<\?[\w\W]+?\?>/,
doctype: /<!DOCTYPE[\w\W]+?>/,
cdata: /<!\[CDATA\[[\w\W]*?]]>/i,
tag: {
pattern: /<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,
inside: {
tag: {
pattern: /^<\/?[^\s>\/]+/i,
inside: {
punctuation: /^<\/?/,
namespace: /^[^\s>\/:]+:/
}
},
"attr-value": {
pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,
inside: {
punctuation: /[=>"']/
}
},
punctuation: /\/?>/,
"attr-name": {
pattern: /[^\s>\/]+/,
inside: {
namespace: /^[^\s>\/:]+:/
}
}
}
},
entity: /&#?[\da-z]{1,8};/i
}, n.hooks.add("wrap", function(e) {
"entity" === e.type && (e.attributes.title = e.content.replace(/&amp;/, "&"))
}), n.languages.xml = n.languages.markup, n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.css = {
comment: /\/\*[\w\W]*?\*\//,
atrule: {
pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i,
inside: {
rule: /@[\w-]+/
}
},
url: /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
selector: /[^\{\}\s][^\{\};]*?(?=\s*\{)/,
string: /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,
property: /(\b|\B)[\w-]+(?=\s*:)/i,
important: /\B!important\b/i,
function: /[-a-z0-9]+(?=\()/i,
punctuation: /[(){};:]/
}, n.languages.css.atrule.inside.rest = n.util.clone(n.languages.css), n.languages.markup && (n.languages.insertBefore("markup", "tag", {
style: {
pattern: /<style[\w\W]*?>[\w\W]*?<\/style>/i,
inside: {
tag: {
pattern: /<style[\w\W]*?>|<\/style>/i,
inside: n.languages.markup.tag.inside
},
rest: n.languages.css
},
alias: "language-css"
}
}), n.languages.insertBefore("inside", "attr-value", {
"style-attr": {
pattern: /\s*style=("|').*?\1/i,
inside: {
"attr-name": {
pattern: /^\s*style/i,
inside: n.languages.markup.tag.inside
},
punctuation: /^\s*=\s*['"]|['"]\s*$/,
"attr-value": {
pattern: /.+/i,
inside: n.languages.css
}
},
alias: "language-css"
}
}, n.languages.markup.tag)), n.languages.clike = {
comment: [{
pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
lookbehind: !0
}, {
pattern: /(^|[^\\:])\/\/.*/,
lookbehind: !0
}],
string: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
"class-name": {
pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,
lookbehind: !0,
inside: {
punctuation: /(\.|\\)/
}
},
keyword: /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
boolean: /\b(true|false)\b/,
function: /[a-z0-9_]+(?=\()/i,
number: /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,
operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
punctuation: /[{}[\];(),.:]/
}, n.languages.javascript = n.languages.extend("clike", {
keyword: /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,
number: /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,
function: /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i
}), n.languages.insertBefore("javascript", "keyword", {
regex: {
pattern: /(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,
lookbehind: !0
}
}), n.languages.insertBefore("javascript", "class-name", {
"template-string": {
pattern: /`(?:\\`|\\?[^`])*`/,
inside: {
interpolation: {
pattern: /\$\{[^}]+\}/,
inside: {
"interpolation-punctuation": {
pattern: /^\$\{|\}$/,
alias: "punctuation"
},
rest: n.languages.javascript
}
},
string: /[\s\S]+/
}
}
}), n.languages.markup && n.languages.insertBefore("markup", "tag", {
script: {
pattern: /<script[\w\W]*?>[\w\W]*?<\/script>/i,
inside: {
tag: {
pattern: /<script[\w\W]*?>|<\/script>/i,
inside: n.languages.markup.tag.inside
},
rest: n.languages.javascript
},
alias: "language-javascript"
}
}), n.languages.js = n.languages.javascript, n.languages.c = n.languages.extend("clike", {
keyword: /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
operator: /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
number: /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i
}), n.languages.insertBefore("c", "string", {
macro: {
pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,
lookbehind: !0,
alias: "property",
inside: {
string: {
pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,
lookbehind: !0
}
}
}
}), delete n.languages.c["class-name"], delete n.languages.c.boolean, n.languages.csharp = n.languages.extend("clike", {
keyword: /\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,
string: [/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/, /("|')(\\?.)*?\1/],
number: /\b-?(0x[\da-f]+|\d*\.?\d+)\b/i
}), n.languages.insertBefore("csharp", "keyword", {
preprocessor: {
pattern: /(^\s*)#.*/m,
lookbehind: !0
}
}), n.languages.cpp = n.languages.extend("c", {
keyword: /\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,
boolean: /\b(true|false)\b/,
operator: /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/
}), n.languages.insertBefore("cpp", "keyword", {
"class-name": {
pattern: /(class\s+)[a-z0-9_]+/i,
lookbehind: !0
}
}), n.languages.java = n.languages.extend("clike", {
keyword: /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,
number: /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,
operator: {
pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,
lookbehind: !0
}
}), n.languages.php = n.languages.extend("clike", {
keyword: /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,
constant: /\b[A-Z0-9_]{2,}\b/,
comment: {
pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,
lookbehind: !0
}
}), n.languages.insertBefore("php", "class-name", {
"shell-comment": {
pattern: /(^|[^\\])#.*/,
lookbehind: !0,
alias: "comment"
}
}), n.languages.insertBefore("php", "keyword", {
delimiter: /\?>|<\?(?:php)?/i,
variable: /\$\w+\b/i,
package: {
pattern: /(\\|namespace\s+|use\s+)[\w\\]+/,
lookbehind: !0,
inside: {
punctuation: /\\/
}
}
}), n.languages.insertBefore("php", "operator", {
property: {
pattern: /(->)[\w]+/,
lookbehind: !0
}
}), n.languages.markup && (n.hooks.add("before-highlight", function(e) {
"php" === e.language && (e.tokenStack = [], e.backupCode = e.code, e.code = e.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi, function(t) {
return e.tokenStack.push(t), "{{{PHP" + e.tokenStack.length + "}}}"
}))
}), n.hooks.add("before-insert", function(e) {
"php" === e.language && (e.code = e.backupCode, delete e.backupCode)
}), n.hooks.add("after-highlight", function(e) {
if ("php" === e.language) {
for (var t, r = 0; t = e.tokenStack[r]; r++) e.highlightedCode = e.highlightedCode.replace("{{{PHP" + (r + 1) + "}}}", n.highlight(t, e.grammar, "php").replace(/\$/g, "$$$$"));
e.element.innerHTML = e.highlightedCode
}
}), n.hooks.add("wrap", function(e) {
"php" === e.language && "markup" === e.type && (e.content = e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g, '<span class="token php">$1</span>'))
}), n.languages.insertBefore("php", "comment", {
markup: {
pattern: /<[^?]\/?(.*?)>/,
inside: n.languages.markup
},
php: /\{\{\{PHP[0-9]+\}\}\}/
})), n.languages.python = {
comment: {
pattern: /(^|[^\\])#.*/,
lookbehind: !0
},
string: /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,
function: {
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,
lookbehind: !0
},
"class-name": {
pattern: /(\bclass\s+)[a-z0-9_]+/i,
lookbehind: !0
},
keyword: /\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,
boolean: /\b(?:True|False)\b/,
number: /\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,
operator: /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,
punctuation: /[{}[\];(),.:]/
},
function(e) {
e.languages.ruby = e.languages.extend("clike", {
comment: /#(?!\{[^\r\n]*?\}).*/,
keyword: /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/
});
var t = {
pattern: /#\{[^}]+\}/,
inside: {
delimiter: {
pattern: /^#\{|\}$/,
alias: "tag"
},
rest: e.util.clone(e.languages.ruby)
}
};
e.languages.insertBefore("ruby", "keyword", {
regex: [{
pattern: /%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,
inside: {
interpolation: t
}
}, {
pattern: /%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,
inside: {
interpolation: t
}
}, {
pattern: /%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,
inside: {
interpolation: t
}
}, {
pattern: /%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,
inside: {
interpolation: t
}
}, {
pattern: /%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,
inside: {
interpolation: t
}
}, {
pattern: /(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,
lookbehind: !0
}],
variable: /[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,
symbol: /:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/
}), e.languages.insertBefore("ruby", "number", {
builtin: /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
constant: /\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/
}), e.languages.ruby.string = [{
pattern: /%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,
inside: {
interpolation: t
}
}, {
pattern: /%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,
inside: {
interpolation: t
}
}, {
pattern: /%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,
inside: {
interpolation: t
}
}, {
pattern: /%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,
inside: {
interpolation: t
}
}, {
pattern: /%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,
inside: {
interpolation: t
}
}, {
pattern: /("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,
inside: {
interpolation: t
}
}]
}(n), n
}), r("tinymce/codesampleplugin/Utils", [], function() {
function e(e) {
return e && "PRE" == e.nodeName && e.className.indexOf("language-") !== -1
}
function t(e) {
return function(t, n) {
return e(n)
}
}
return {
isCodeSample: e,
trimArg: t
}
}), r("tinymce/codesampleplugin/Dialog", ["tinymce/dom/DOMUtils", "tinymce/codesampleplugin/Utils", "tinymce/codesampleplugin/Prism"], function(e, t, n) {
function r(e) {
var t = [{
text: "HTML/XML",
value: "markup"
}, {
text: "JavaScript",
value: "javascript"
}, {
text: "CSS",
value: "css"
}, {
text: "PHP",
value: "php"
}, {
text: "Ruby",
value: "ruby"
}, {
text: "Python",
value: "python"
}, {
text: "Java",
value: "java"
}, {
text: "C",
value: "c"
}, {
text: "C#",
value: "csharp"
}, {
text: "C++",
value: "cpp"
}],
n = e.settings.codesample_languages;
return n ? n : t
}
function i(e, t, r) {
e.undoManager.transact(function() {
var i = o(e);
r = l.encode(r), i ? (e.dom.setAttrib(i, "class", "language-" + t), i.innerHTML = r, n.highlightElement(i), e.selection.select(i)) : (e.insertContent('<pre id="__new" class="language-' + t + '">' + r + "</pre>"), e.selection.select(e.$("#__new").removeAttr("id")[0]))
})
}
function o(e) {
var n = e.selection.getNode();
return t.isCodeSample(n) ? n : null
}
function a(e) {
var t = o(e);
return t ? t.textContent : ""
}
function s(e) {
var t, n = o(e);
return n ? (t = n.className.match(/language-(\w+)/), t ? t[1] : "") : ""
}
var l = e.DOM;
return {
open: function(e) {
e.windowManager.open({
title: "Insert/Edit code sample",
minWidth: Math.min(l.getViewPort().w, e.getParam("codesample_dialog_width", 800)),
minHeight: Math.min(l.getViewPort().h, e.getParam("codesample_dialog_height", 650)),
layout: "flex",
direction: "column",
align: "stretch",
body: [{
type: "listbox",
name: "language",
label: "Language",
maxWidth: 200,
value: s(e),
values: r(e)
}, {
type: "textbox",
name: "code",
multiline: !0,
spellcheck: !1,
ariaLabel: "Code view",
flex: 1,
style: "direction: ltr; text-align: left",
classes: "monospace",
value: a(e),
autofocus: !0
}],
onSubmit: function(t) {
i(e, t.data.language, t.data.code)
}
})
}
}
}), r("tinymce/codesampleplugin/Plugin", ["tinymce/Env", "tinymce/PluginManager", "tinymce/codesampleplugin/Prism", "tinymce/codesampleplugin/Dialog", "tinymce/codesampleplugin/Utils"], function(e, t, n, r, i) {
var o, a = i.trimArg;
t.add("codesample", function(t, s) {
function l() {
var e, n = t.settings.codesample_content_css;
t.inline && o || !t.inline && c || (t.inline ? o = !0 : c = !0, n !== !1 && (e = t.dom.create("link", {
rel: "stylesheet",
href: n ? n : s + "/css/prism.css"
}), t.getDoc().getElementsByTagName("head")[0].appendChild(e)))
}
var c, u = t.$;
e.ceFalse && (t.on("PreProcess", function(e) {
u("pre[contenteditable=false]", e.node).filter(a(i.isCodeSample)).each(function(e, t) {
var n = u(t),
r = t.textContent;
n.attr("class", u.trim(n.attr("class"))), n.removeAttr("contentEditable"), n.empty().append(u("<code></code>").each(function() {
this.textContent = r
}))
})
}), t.on("SetContent", function() {
var e = u("pre").filter(a(i.isCodeSample)).filter(function(e, t) {
return "false" !== t.contentEditable
});
e.length && t.undoManager.transact(function() {
e.each(function(e, r) {
u(r).find("br").each(function(e, n) {
n.parentNode.replaceChild(t.getDoc().createTextNode("\n"), n)
}), r.contentEditable = !1, r.innerHTML = t.dom.encode(r.textContent), n.highlightElement(r), r.className = u.trim(r.className)
})
})
}), t.addCommand("codesample", function() {
t.selection.isCollapsed() ? r.open(t) : t.formatter.toggle("code")
}), t.addButton("codesample", {
cmd: "codesample",
title: "Insert/Edit code sample"
}), t.on("init", l))
})
}), o(["tinymce/codesampleplugin/Prism", "tinymce/codesampleplugin/Utils", "tinymce/codesampleplugin/Dialog", "tinymce/codesampleplugin/Plugin"])
}(this);

View File

@@ -0,0 +1,80 @@
tinymce.PluginManager.add("colorpicker", function(e) {
function t(t, n) {
function r(e) {
var t = new tinymce.util.Color(e),
n = t.toRgb();
o.fromJSON({
r: n.r,
g: n.g,
b: n.b,
hex: t.toHex().substr(1)
}), i(t.toHex())
}
function i(e) {
o.find("#preview")[0].getEl().style.background = e
}
var o = e.windowManager.open({
title: "Color",
items: {
type: "container",
layout: "flex",
direction: "row",
align: "stretch",
padding: 5,
spacing: 10,
items: [{
type: "colorpicker",
value: n,
onchange: function() {
var e = this.rgb();
o && (o.find("#r").value(e.r), o.find("#g").value(e.g), o.find("#b").value(e.b), o.find("#hex").value(this.value().substr(1)), i(this.value()))
}
}, {
type: "form",
padding: 0,
labelGap: 5,
defaults: {
type: "textbox",
size: 7,
value: "0",
flex: 1,
spellcheck: !1,
onchange: function() {
var e, t, n = o.find("colorpicker")[0];
return e = this.name(), t = this.value(), "hex" == e ? (t = "#" + t, r(t), void n.value(t)) : (t = {
r: o.find("#r").value(),
g: o.find("#g").value(),
b: o.find("#b").value()
}, n.value(t), void r(t))
}
},
items: [{
name: "r",
label: "R",
autofocus: 1
}, {
name: "g",
label: "G"
}, {
name: "b",
label: "B"
}, {
name: "hex",
label: "#",
value: "000000"
}, {
name: "preview",
type: "container",
border: 1
}]
}]
},
onSubmit: function() {
t("#" + this.toJSON().hex)
}
});
r(n)
}
e.settings.color_picker_callback || (e.settings.color_picker_callback = t)
});

View File

@@ -0,0 +1,48 @@
tinymce.PluginManager.add("contextmenu", function(e) {
var t, n, r = e.settings.contextmenu_never_use_native,
i = function(e) {
return e.ctrlKey && !r
},
o = function() {
return tinymce.Env.mac && tinymce.Env.webkit
},
a = function() {
return n === !0
};
return e.on("mousedown", function(t) {
o() && 2 === t.button && !i(t) && e.selection.isCollapsed() && e.once("contextmenu", function(t) {
e.selection.placeCaretAt(t.clientX, t.clientY)
})
}), e.on("contextmenu", function(r) {
var o;
if (!i(r)) {
if (r.preventDefault(), o = e.settings.contextmenu || "link openlink image inserttable | cell row column deletetable", t) t.show();
else {
var a = [];
tinymce.each(o.split(/[ ,]/), function(t) {
var n = e.menuItems[t];
"|" == t && (n = {
text: t
}), n && (n.shortcut = "", a.push(n))
});
for (var s = 0; s < a.length; s++) "|" == a[s].text && (0 !== s && s != a.length - 1 || a.splice(s, 1));
t = new tinymce.ui.Menu({
items: a,
context: "contextmenu",
classes: "contextmenu"
}).renderTo(), t.on("hide", function(e) {
e.control === this && (n = !1)
}), e.on("remove", function() {
t.remove(), t = null
})
}
var l = {
x: r.pageX,
y: r.pageY
};
e.inline || (l = tinymce.DOM.getPos(e.getContentAreaContainer()), l.x += r.clientX, l.y += r.clientY), t.moveTo(l.x, l.y), n = !0
}
}), {
isContextMenuVisible: a
}
});

View File

@@ -0,0 +1,29 @@
tinymce.PluginManager.add("directionality", function(e) {
function t(t) {
var n, r = e.dom,
i = e.selection.getSelectedBlocks();
i.length && (n = r.getAttrib(i[0], "dir"), tinymce.each(i, function(e) {
r.getParent(e.parentNode, "*[dir='" + t + "']", r.getRoot()) || (n != t ? r.setAttrib(e, "dir", t) : r.setAttrib(e, "dir", null))
}), e.nodeChanged())
}
function n(e) {
var t = [];
return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "), function(n) {
t.push(n + "[dir=" + e + "]")
}), t.join(",")
}
e.addCommand("mceDirectionLTR", function() {
t("ltr")
}), e.addCommand("mceDirectionRTL", function() {
t("rtl")
}), e.addButton("ltr", {
title: "Left to right",
cmd: "mceDirectionLTR",
stateSelector: n("ltr")
}), e.addButton("rtl", {
title: "Right to left",
cmd: "mceDirectionRTL",
stateSelector: n("rtl")
})
});

View File

@@ -0,0 +1,30 @@
tinymce.PluginManager.add("emoticons", function(e, t) {
function n() {
var e;
return e = '<table role="list" class="mce-grid">', tinymce.each(r, function(n) {
e += "<tr>", tinymce.each(n, function(n) {
var r = t + "/img/smiley-" + n + ".gif";
e += '<td><a href="#" data-mce-url="' + r + '" data-mce-alt="' + n + '" tabindex="-1" role="option" aria-label="' + n + '"><img src="' + r + '" style="width: 18px; height: 18px" role="presentation" /></a></td>'
}), e += "</tr>"
}), e += "</table>"
}
var r = [
["cool", "cry", "embarassed", "foot-in-mouth"],
["frown", "innocent", "kiss", "laughing"],
["money-mouth", "sealed", "smile", "surprised"],
["tongue-out", "undecided", "wink", "yell"]
];
e.addButton("emoticons", {
type: "panelbutton",
panel: {
role: "application",
autohide: !0,
html: n,
onclick: function(t) {
var n = e.dom.getParent(t.target, "a");
n && (e.insertContent('<img src="' + n.getAttribute("data-mce-url") + '" alt="' + n.getAttribute("data-mce-alt") + '" />'), this.hide())
}
},
tooltip: "Emoticons"
})
});

View File

@@ -0,0 +1,69 @@
tinymce.PluginManager.add("fullscreen", function(e) {
function t() {
var e, t, n = window,
r = document,
i = r.body;
return i.offsetWidth && (e = i.offsetWidth, t = i.offsetHeight), n.innerWidth && n.innerHeight && (e = n.innerWidth, t = n.innerHeight), {
w: e,
h: t
}
}
function n() {
var e = tinymce.DOM.getViewPort();
return {
x: e.x,
y: e.y
}
}
function r(e) {
scrollTo(e.x, e.y)
}
function i() {
function i() {
f.setStyle(m, "height", t().h - (p.clientHeight - m.clientHeight))
}
var h, p, m, g, v = document.body,
y = document.documentElement;
d = !d, p = e.getContainer(), h = p.style, m = e.getContentAreaContainer().firstChild, g = m.style, d ? (u = n(), o = g.width, a = g.height, g.width = g.height = "100%", l = h.width, c = h.height, h.width = h.height = "", f.addClass(v, "mce-fullscreen"), f.addClass(y, "mce-fullscreen"), f.addClass(p, "mce-fullscreen"), f.bind(window, "resize", i), i(), s = i) : (g.width = o, g.height = a, l && (h.width = l), c && (h.height = c), f.removeClass(v, "mce-fullscreen"), f.removeClass(y, "mce-fullscreen"), f.removeClass(p, "mce-fullscreen"), f.unbind(window, "resize", s), r(u)), e.fire("FullscreenStateChanged", {
state: d
})
}
var o, a, s, l, c, u, d = !1,
f = tinymce.DOM;
if (!e.settings.inline) return e.on("init", function() {
e.addShortcut("Ctrl+Shift+F", "", i)
}), e.on("remove", function() {
s && f.unbind(window, "resize", s)
}), e.addCommand("mceFullScreen", i), e.addMenuItem("fullscreen", {
text: "Fullscreen",
shortcut: "Ctrl+Shift+F",
selectable: !0,
onClick: function() {
i(), e.focus()
},
onPostRender: function() {
var t = this;
e.on("FullscreenStateChanged", function(e) {
t.active(e.state)
})
},
context: "view"
}), e.addButton("fullscreen", {
tooltip: "Fullscreen",
shortcut: "Ctrl+Shift+F",
onClick: i,
onPostRender: function() {
var t = this;
e.on("FullscreenStateChanged", function(e) {
t.active(e.state)
})
}
}), {
isFullscreen: function() {
return d
}
}
});

View File

@@ -0,0 +1,14 @@
tinymce.PluginManager.add("hr", function(e) {
e.addCommand("InsertHorizontalRule", function() {
e.execCommand("mceInsertContent", !1, "<hr />")
}), e.addButton("hr", {
icon: "hr",
tooltip: "Horizontal line",
cmd: "InsertHorizontalRule"
}), e.addMenuItem("hr", {
icon: "hr",
text: "Horizontal line",
cmd: "InsertHorizontalRule",
context: "insert"
})
});

View File

@@ -0,0 +1,313 @@
tinymce.PluginManager.add("image", function(e) {
function t(e, t) {
function n(e, n) {
r.parentNode && r.parentNode.removeChild(r), t({
width: e,
height: n
})
}
var r = document.createElement("img");
r.onload = function() {
n(Math.max(r.width, r.clientWidth), Math.max(r.height, r.clientHeight))
}, r.onerror = function() {
n()
};
var i = r.style;
i.visibility = "hidden", i.position = "fixed", i.bottom = i.left = 0, i.width = i.height = "auto", document.body.appendChild(r), r.src = e
}
function n(e, t, n) {
function r(e, n) {
return n = n || [], tinymce.each(e, function(e) {
var i = {
text: e.text || e.title
};
e.menu ? i.menu = r(e.menu) : (i.value = e.value, t(i)), n.push(i)
}), n
}
return r(e, n || [])
}
function r(t) {
return function() {
var n = e.settings.image_list;
"string" == typeof n ? tinymce.util.XHR.send({
url: n,
success: function(e) {
t(tinymce.util.JSON.parse(e))
}
}) : "function" == typeof n ? n(t) : t(n)
}
}
function i(r) {
function i() {
var e, t, n, r;
e = f.find("#width")[0], t = f.find("#height")[0], e && t && (n = e.value(), r = t.value(), f.find("#constrain")[0].checked() && m && g && n && r && (m != n ? (r = Math.round(n / m * r), isNaN(r) || t.value(r)) : (n = Math.round(r / g * n), isNaN(n) || e.value(n))), m = n, g = r)
}
function o() {
function t(t) {
function n() {
t.onload = t.onerror = null, e.selection && (e.selection.select(t), e.nodeChanged())
}
t.onload = function() {
b.width || b.height || !x || C.setAttribs(t, {
width: t.clientWidth,
height: t.clientHeight
}), n()
}, t.onerror = n
}
var n, r;
u(), i(), b = tinymce.extend(b, f.toJSON()), b.alt || (b.alt = ""), b.title || (b.title = ""), "" === b.width && (b.width = null), "" === b.height && (b.height = null), b.style || (b.style = null), b = {
src: b.src,
alt: b.alt,
title: b.title,
width: b.width,
height: b.height,
style: b.style,
caption: b.caption,
class: b.class
}, e.undoManager.transact(function() {
function i(t) {
return e.schema.getTextBlockElements()[t.nodeName]
}
if (!b.src) return void(h && (C.remove(h), e.focus(), e.nodeChanged()));
if ("" === b.title && (b.title = null), h ? C.setAttribs(h, b) : (b.id = "__mcenew", e.focus(), e.selection.setContent(C.createHTML("img", b)), h = C.get("__mcenew"), C.setAttrib(h, "id", null)), e.editorUpload.uploadImagesAuto(), b.caption === !1 && C.is(h.parentNode, "figure.image") && (n = h.parentNode, C.insertAfter(h, n), C.remove(n)), b.caption !== !0) t(h);
else if (!C.is(h.parentNode, "figure.image")) {
r = h, h = h.cloneNode(!0), n = C.create("figure", {
class: "image"
}), n.appendChild(h), n.appendChild(C.create("figcaption", {
contentEditable: !0
}, "Caption")), n.contentEditable = !1;
var o = C.getParent(r, i);
o ? C.split(o, r, n) : C.replace(n, r), e.selection.select(n)
}
})
}
function a(e) {
return e && (e = e.replace(/px$/, "")), e
}
function s(n) {
var r, i, o, a = n.meta || {};
v && v.value(e.convertURL(this.value(), "src")), tinymce.each(a, function(e, t) {
f.find("#" + t).value(e)
}), a.width || a.height || (r = e.convertURL(this.value(), "src"), i = e.settings.image_prepend_url, o = new RegExp("^(?:[a-z]+:)?//", "i"), i && !o.test(r) && r.substring(0, i.length) !== i && (r = i + r), this.value(r), t(e.documentBaseURI.toAbsolute(this.value()), function(e) {
e.width && e.height && x && (m = e.width, g = e.height, f.find("#width").value(m), f.find("#height").value(g))
}))
}
function l(e) {
e.meta = f.toJSON()
}
function c(e) {
if (e.margin) {
var t = e.margin.split(" ");
switch (t.length) {
case 1:
e["margin-top"] = e["margin-top"] || t[0], e["margin-right"] = e["margin-right"] || t[0], e["margin-bottom"] = e["margin-bottom"] || t[0], e["margin-left"] = e["margin-left"] || t[0];
break;
case 2:
e["margin-top"] = e["margin-top"] || t[0], e["margin-right"] = e["margin-right"] || t[1], e["margin-bottom"] = e["margin-bottom"] || t[0], e["margin-left"] = e["margin-left"] || t[1];
break;
case 3:
e["margin-top"] = e["margin-top"] || t[0], e["margin-right"] = e["margin-right"] || t[1], e["margin-bottom"] = e["margin-bottom"] || t[2], e["margin-left"] = e["margin-left"] || t[1];
break;
case 4:
e["margin-top"] = e["margin-top"] || t[0], e["margin-right"] = e["margin-right"] || t[1], e["margin-bottom"] = e["margin-bottom"] || t[2], e["margin-left"] = e["margin-left"] || t[3]
}
delete e.margin
}
return e
}
function u() {
function t(e) {
return e.length > 0 && /^[0-9]+$/.test(e) && (e += "px"), e
}
if (e.settings.image_advtab) {
var n = f.toJSON(),
r = C.parseStyle(n.style);
r = c(r), n.vspace && (r["margin-top"] = r["margin-bottom"] = t(n.vspace)), n.hspace && (r["margin-left"] = r["margin-right"] = t(n.hspace)), n.border && (r["border-width"] = t(n.border)), f.find("#style").value(C.serializeStyle(C.parseStyle(C.serializeStyle(r))))
}
}
function d() {
if (e.settings.image_advtab) {
var t = f.toJSON(),
n = C.parseStyle(t.style);
f.find("#vspace").value(""), f.find("#hspace").value(""), n = c(n), (n["margin-top"] && n["margin-bottom"] || n["margin-right"] && n["margin-left"]) && (n["margin-top"] === n["margin-bottom"] ? f.find("#vspace").value(a(n["margin-top"])) : f.find("#vspace").value(""), n["margin-right"] === n["margin-left"] ? f.find("#hspace").value(a(n["margin-right"])) : f.find("#hspace").value("")), n["border-width"] && f.find("#border").value(a(n["border-width"])), f.find("#style").value(C.serializeStyle(C.parseStyle(C.serializeStyle(n))))
}
}
var f, h, p, m, g, v, y, b = {},
C = e.dom,
x = e.settings.image_dimensions !== !1;
h = e.selection.getNode(), p = C.getParent(h, "figure.image"), p && (h = C.select("img", p)[0]), h && ("IMG" != h.nodeName || h.getAttribute("data-mce-object") || h.getAttribute("data-mce-placeholder")) && (h = null), h && (m = C.getAttrib(h, "width"), g = C.getAttrib(h, "height"), b = {
src: C.getAttrib(h, "src"),
alt: C.getAttrib(h, "alt"),
title: C.getAttrib(h, "title"),
class: C.getAttrib(h, "class"),
width: m,
height: g,
caption: !!p
}), r && (v = {
type: "listbox",
label: "Image list",
values: n(r, function(t) {
t.value = e.convertURL(t.value || t.url, "src")
}, [{
text: "None",
value: ""
}]),
value: b.src && e.convertURL(b.src, "src"),
onselect: function(e) {
var t = f.find("#alt");
(!t.value() || e.lastControl && t.value() == e.lastControl.text()) && t.value(e.control.text()), f.find("#src").value(e.control.value()).fire("change")
},
onPostRender: function() {
v = this
}
}), e.settings.image_class_list && (y = {
name: "class",
type: "listbox",
label: "Class",
values: n(e.settings.image_class_list, function(t) {
t.value && (t.textStyle = function() {
return e.formatter.getCssText({
inline: "img",
classes: [t.value]
})
})
})
});
var w = [{
name: "src",
type: "filepicker",
filetype: "image",
label: "Source",
autofocus: !0,
onchange: s,
onbeforecall: l
}, v];
e.settings.image_description !== !1 && w.push({
name: "alt",
type: "textbox",
label: "Image description"
}), e.settings.image_title && w.push({
name: "title",
type: "textbox",
label: "Image Title"
}), x && w.push({
type: "container",
label: "Dimensions",
layout: "flex",
direction: "row",
align: "center",
spacing: 5,
items: [{
name: "width",
type: "textbox",
maxLength: 5,
size: 3,
onchange: i,
ariaLabel: "Width"
}, {
type: "label",
text: "x"
}, {
name: "height",
type: "textbox",
maxLength: 5,
size: 3,
onchange: i,
ariaLabel: "Height"
}, {
name: "constrain",
type: "checkbox",
checked: !0,
text: "Constrain proportions"
}]
}), w.push(y), e.settings.image_caption && tinymce.Env.ceFalse && w.push({
name: "caption",
type: "checkbox",
label: "Caption"
}), e.settings.image_advtab ? (h && (h.style.marginLeft && h.style.marginRight && h.style.marginLeft === h.style.marginRight && (b.hspace = a(h.style.marginLeft)), h.style.marginTop && h.style.marginBottom && h.style.marginTop === h.style.marginBottom && (b.vspace = a(h.style.marginTop)), h.style.borderWidth && (b.border = a(h.style.borderWidth)), b.style = e.dom.serializeStyle(e.dom.parseStyle(e.dom.getAttrib(h, "style")))), f = e.windowManager.open({
title: "Insert/edit image",
data: b,
bodyType: "tabpanel",
body: [{
title: "General",
type: "form",
items: w
}, {
title: "Advanced",
type: "form",
pack: "start",
items: [{
label: "Style",
name: "style",
type: "textbox",
onchange: d
}, {
type: "form",
layout: "grid",
packV: "start",
columns: 2,
padding: 0,
alignH: ["left", "right"],
defaults: {
type: "textbox",
maxWidth: 50,
onchange: u
},
items: [{
label: "Vertical space",
name: "vspace"
}, {
label: "Horizontal space",
name: "hspace"
}, {
label: "Border",
name: "border"
}]
}]
}],
onSubmit: o
})) : f = e.windowManager.open({
title: "Insert/edit image",
data: b,
body: w,
onSubmit: o
})
}
e.on("preInit", function() {
function t(e) {
var t = e.attr("class");
return t && /\bimage\b/.test(t)
}
function n(e) {
return function(n) {
function r(t) {
t.attr("contenteditable", e ? "true" : null)
}
for (var i, o = n.length; o--;) i = n[o], t(i) && (i.attr("contenteditable", e ? "false" : null), tinymce.each(i.getAll("figcaption"), r))
}
}
e.parser.addNodeFilter("figure", n(!0)), e.serializer.addNodeFilter("figure", n(!1))
}), e.addButton("image", {
icon: "image",
tooltip: "Insert/edit image",
onclick: r(i),
stateSelector: "img:not([data-mce-object],[data-mce-placeholder]),figure.image"
}), e.addMenuItem("image", {
icon: "image",
text: "Image",
onclick: r(i),
context: "insert",
prependToContext: !0
}), e.addCommand("mceImage", r(i))
});

View File

@@ -0,0 +1,50 @@
tinymce.PluginManager.add("insertdatetime", function(e) {
function t(t, n) {
function r(e, t) {
if (e = "" + e, e.length < t)
for (var n = 0; n < t - e.length; n++) e = "0" + e;
return e
}
return n = n || new Date, t = t.replace("%D", "%m/%d/%Y"), t = t.replace("%r", "%I:%M:%S %p"), t = t.replace("%Y", "" + n.getFullYear()), t = t.replace("%y", "" + n.getYear()), t = t.replace("%m", r(n.getMonth() + 1, 2)), t = t.replace("%d", r(n.getDate(), 2)), t = t.replace("%H", "" + r(n.getHours(), 2)), t = t.replace("%M", "" + r(n.getMinutes(), 2)), t = t.replace("%S", "" + r(n.getSeconds(), 2)), t = t.replace("%I", "" + ((n.getHours() + 11) % 12 + 1)), t = t.replace("%p", "" + (n.getHours() < 12 ? "AM" : "PM")), t = t.replace("%B", "" + e.translate(l[n.getMonth()])), t = t.replace("%b", "" + e.translate(s[n.getMonth()])), t = t.replace("%A", "" + e.translate(a[n.getDay()])), t = t.replace("%a", "" + e.translate(o[n.getDay()])), t = t.replace("%%", "%")
}
function n(n) {
var r = t(n);
if (e.settings.insertdatetime_element) {
var i;
i = t(/%[HMSIp]/.test(n) ? "%Y-%m-%dT%H:%M" : "%Y-%m-%d"), r = '<time datetime="' + i + '">' + r + "</time>";
var o = e.dom.getParent(e.selection.getStart(), "time");
if (o) return void e.dom.setOuterHTML(o, r)
}
e.insertContent(r)
}
var r, i, o = "Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),
a = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),
s = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
l = "January February March April May June July August September October November December".split(" "),
c = [];
e.addCommand("mceInsertDate", function() {
n(e.getParam("insertdatetime_dateformat", e.translate("%Y-%m-%d")))
}), e.addCommand("mceInsertTime", function() {
n(e.getParam("insertdatetime_timeformat", e.translate("%H:%M:%S")))
}), e.addButton("insertdatetime", {
type: "splitbutton",
title: "Insert date/time",
onclick: function() {
n(r || i)
},
menu: c
}), tinymce.each(e.settings.insertdatetime_formats || ["%H:%M:%S", "%Y-%m-%d", "%I:%M:%S %p", "%D"], function(e) {
i || (i = e), c.push({
text: t(e),
onclick: function() {
r = e, n(e)
}
})
}), e.addMenuItem("insertdatetime", {
icon: "date",
text: "Date/time",
menu: c,
context: "insert"
})
});

View File

@@ -0,0 +1,314 @@
tinymce.PluginManager.add("link", function(e) {
function t(e) {
return e && "A" === e.nodeName && e.href
}
function n(e) {
return tinymce.util.Tools.grep(e, t).length > 0
}
function r(t) {
return e.dom.getParent(t, "a[href]")
}
function i() {
return r(e.selection.getStart())
}
function o(e) {
var t = e.getAttribute("data-mce-href");
return t ? t : e.getAttribute("href")
}
function a() {
var t = e.plugins.contextmenu;
return !!t && t.isContextMenuVisible()
}
function s(n) {
var r, i, o;
return !!(e.settings.link_context_toolbar && !a() && t(n) && (r = e.selection, i = r.getRng(), o = i.startContainer, 3 == o.nodeType && r.isCollapsed() && i.startOffset > 0 && i.startOffset < o.data.length))
}
function l(e) {
if (!tinymce.Env.ie || tinymce.Env.ie > 10) {
var t = document.createElement("a");
t.target = "_blank", t.href = e, t.rel = "noreferrer noopener";
var n = document.createEvent("MouseEvents");
n.initMouseEvent("click", !0, !0, window, !0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), t.dispatchEvent(n)
} else {
var r = window.open("", "_blank");
if (r) {
r.opener = null;
var i = r.document;
i.open(), i.write('<meta http-equiv="refresh" content="0; url=' + tinymce.DOM.encode(e) + '">'), i.close()
}
}
}
function c(t) {
if (t) {
var n = o(t);
if (/^#/.test(n)) {
var r = e.$(n);
r.length && e.selection.scrollIntoView(r[0], !0)
} else l(t.href)
}
}
function u() {
c(i())
}
function d() {
var t = this,
r = function(e) {
n(e.parents) ? t.show() : t.hide()
};
n(e.dom.getParents(e.selection.getStart())) || t.hide(), e.on("nodechange", r), t.on("remove", function() {
e.off("nodechange", r)
})
}
function f(t) {
return function() {
var n = e.settings.link_list;
"string" == typeof n ? tinymce.util.XHR.send({
url: n,
success: function(e) {
t(tinymce.util.JSON.parse(e))
}
}) : "function" == typeof n ? n(t) : t(n)
}
}
function h(e, t, n) {
function r(e, n) {
return n = n || [], tinymce.each(e, function(e) {
var i = {
text: e.text || e.title
};
e.menu ? i.menu = r(e.menu) : (i.value = e.value, t && t(i)), n.push(i)
}), n
}
return r(e, n || [])
}
function p(t) {
function n(e) {
var t = d.find("#text");
(!t.value() || e.lastControl && t.value() == e.lastControl.text()) && t.value(e.control.text()), d.find("#href").value(e.control.value())
}
function r(t) {
var r = [];
if (tinymce.each(e.dom.select("a:not([href])"), function(e) {
var n = e.name || e.id;
n && r.push({
text: n,
value: "#" + n,
selected: t.indexOf("#" + n) != -1
})
}), r.length) return r.unshift({
text: "None",
value: ""
}), {
name: "anchor",
type: "listbox",
label: "Anchors",
values: r,
onselect: n
}
}
function i() {
!u && 0 === w.text.length && f && this.parent().parent().find("#text")[0].value(this.value())
}
function o(t) {
var n = t.meta || {};
g && g.value(e.convertURL(this.value(), "href")), tinymce.each(t.meta, function(e, t) {
var n = d.find("#" + t);
"text" === t ? 0 === u.length && (n.value(e), w.text = e) : n.value(e)
}), n.attach && (m = {
href: this.value(),
attach: n.attach
}), n.text || i.call(this)
}
function a(e) {
var t = E.getContent();
if (/</.test(t) && (!/^<a [^>]+>[^<]+<\/a>$/.test(t) || t.indexOf("href=") == -1)) return !1;
if (e) {
var n, r = e.childNodes;
if (0 === r.length) return !1;
for (n = r.length - 1; n >= 0; n--)
if (3 != r[n].nodeType) return !1
}
return !0
}
function s(e) {
e.meta = d.toJSON()
}
var l, c, u, d, f, p, g, v, y, b, C, x, w = {},
E = e.selection,
N = e.dom;
l = E.getNode(), c = N.getParent(l, "a[href]"), f = a(), w.text = u = c ? c.innerText || c.textContent : E.getContent({
format: "text"
}), w.href = c ? N.getAttrib(c, "href") : "", c ? w.target = N.getAttrib(c, "target") : e.settings.default_link_target && (w.target = e.settings.default_link_target), (x = N.getAttrib(c, "rel")) && (w.rel = x), (x = N.getAttrib(c, "class")) && (w.class = x), (x = N.getAttrib(c, "title")) && (w.title = x), f && (p = {
name: "text",
type: "textbox",
size: 40,
label: "Text to display",
onchange: function() {
w.text = this.value()
}
}), t && (g = {
type: "listbox",
label: "Link list",
values: h(t, function(t) {
t.value = e.convertURL(t.value || t.url, "href")
}, [{
text: "None",
value: ""
}]),
onselect: n,
value: e.convertURL(w.href, "href"),
onPostRender: function() {
g = this
}
}), e.settings.target_list !== !1 && (e.settings.target_list || (e.settings.target_list = [{
text: "None",
value: ""
}, {
text: "New window",
value: "_blank"
}]), y = {
name: "target",
type: "listbox",
label: "Target",
values: h(e.settings.target_list)
}), e.settings.rel_list && (v = {
name: "rel",
type: "listbox",
label: "Rel",
values: h(e.settings.rel_list)
}), e.settings.link_class_list && (b = {
name: "class",
type: "listbox",
label: "Class",
values: h(e.settings.link_class_list, function(t) {
t.value && (t.textStyle = function() {
return e.formatter.getCssText({
inline: "a",
classes: [t.value]
})
})
})
}), e.settings.link_title !== !1 && (C = {
name: "title",
type: "textbox",
label: "Title",
value: w.title
}), d = e.windowManager.open({
title: "Insert link",
data: w,
body: [{
name: "href",
type: "filepicker",
filetype: "file",
size: 40,
autofocus: !0,
label: "Url",
onchange: o,
onkeyup: i,
onbeforecall: s
}, p, C, r(w.href), g, v, y, b],
onSubmit: function(t) {
function n(t, n) {
var r = e.selection.getRng();
tinymce.util.Delay.setEditorTimeout(e, function() {
e.windowManager.confirm(t, function(t) {
e.selection.setRng(r), n(t)
})
})
}
function r(e, t) {
function n(e) {
return e = r(e), e ? [e, i].join(" ") : i
}
function r(e) {
var t = new RegExp("(" + i.replace(" ", "|") + ")", "g");
return e && (e = tinymce.trim(e.replace(t, ""))), e ? e : null
}
var i = "noopener noreferrer";
return t ? n(e) : r(e)
}
function i() {
var t = {
href: a,
target: w.target ? w.target : null,
rel: w.rel ? w.rel : null,
class: w.class ? w.class : null,
title: w.title ? w.title : null
};
e.settings.allow_unsafe_link_target || (t.rel = r(t.rel, "_blank" == t.target)), a === m.href && (m.attach(), m = {}), c ? (e.focus(), f && w.text != u && ("innerText" in c ? c.innerText = w.text : c.textContent = w.text), N.setAttribs(c, t), E.select(c), e.undoManager.add()) : f ? e.insertContent(N.createHTML("a", t, N.encode(w.text))) : e.execCommand("mceInsertLink", !1, t)
}
function o() {
e.undoManager.transact(i)
}
var a;
return w = tinymce.extend(w, t.data), (a = w.href) ? a.indexOf("@") > 0 && a.indexOf("//") == -1 && a.indexOf("mailto:") == -1 ? void n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?", function(e) {
e && (a = "mailto:" + a), o()
}) : e.settings.link_assume_external_targets && !/^\w+:/i.test(a) || !e.settings.link_assume_external_targets && /^\s*www[\.|\d\.]/i.test(a) ? void n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?", function(e) {
e && (a = "http://" + a), o()
}) : void o() : void e.execCommand("unlink")
}
})
}
var m = {},
g = function(e) {
return e.altKey === !0 && e.shiftKey === !1 && e.ctrlKey === !1 && e.metaKey === !1
};
e.addButton("link", {
icon: "link",
tooltip: "Insert/edit link",
shortcut: "Meta+K",
onclick: f(p),
stateSelector: "a[href]"
}), e.addButton("unlink", {
icon: "unlink",
tooltip: "Remove link",
cmd: "unlink",
stateSelector: "a[href]"
}), e.addContextToolbar && (e.addButton("openlink", {
icon: "newtab",
tooltip: "Open link",
onclick: u
}), e.addContextToolbar(s, "openlink | link unlink")), e.addShortcut("Meta+K", "", f(p)), e.addCommand("mceLink", f(p)), e.on("click", function(e) {
var t = r(e.target);
t && tinymce.util.VK.metaKeyPressed(e) && (e.preventDefault(), c(t))
}), e.on("keydown", function(e) {
var t = i();
t && 13 === e.keyCode && g(e) && (e.preventDefault(), c(t))
}), this.showDialog = p, e.addMenuItem("openlink", {
text: "Open link",
icon: "newtab",
onclick: u,
onPostRender: d,
prependToContext: !0
}), e.addMenuItem("link", {
icon: "link",
text: "Link",
shortcut: "Meta+K",
onclick: f(p),
stateSelector: "a[href]",
context: "insert",
prependToContext: !0
})
});

View File

@@ -0,0 +1,375 @@
tinymce.PluginManager.add("lists", function(e) {
function t(t) {
return e.$.contains(e.getBody(), t)
}
function n(e) {
return e && "BR" == e.nodeName
}
function r(e) {
return e && /^(OL|UL|DL)$/.test(e.nodeName) && t(e)
}
function i(e) {
return e && /^(LI|DT|DD)$/.test(e.nodeName)
}
function o(e) {
return e.parentNode.firstChild == e
}
function a(e) {
return e.parentNode.lastChild == e
}
function s(t) {
return t && !!e.schema.getTextBlockElements()[t.nodeName]
}
function l(t) {
return t === e.getBody()
}
function c(e) {
return e && 3 === e.nodeType
}
function u(e, t) {
var n = tinymce.dom.RangeUtils.getNode(e, t);
if (i(e) && c(n)) {
var r = t >= e.childNodes.length ? n.data.length : 0;
return {
container: n,
offset: r
}
}
return {
container: e,
offset: t
}
}
function d(e) {
var t = e.cloneRange(),
n = u(e.startContainer, e.startOffset);
t.setStart(n.container, n.offset);
var r = u(e.endContainer, e.endOffset);
return t.setEnd(r.container, r.offset), t
}
var f = this;
e.on("init", function() {
function c(e, t) {
var n = L.isEmpty(e);
return !(t && L.select("span[data-mce-type=bookmark]").length > 0) && n
}
function u(e) {
function t(t) {
var r, i, o;
i = e[t ? "startContainer" : "endContainer"], o = e[t ? "startOffset" : "endOffset"], 1 == i.nodeType && (r = L.create("span", {
"data-mce-type": "bookmark"
}), i.hasChildNodes() ? (o = Math.min(o, i.childNodes.length - 1), t ? i.insertBefore(r, i.childNodes[o]) : L.insertAfter(r, i.childNodes[o])) : i.appendChild(r), i = r, o = 0), n[t ? "startContainer" : "endContainer"] = i, n[t ? "startOffset" : "endOffset"] = o
}
var n = {};
return t(!0), e.collapsed || t(), n
}
function h(e) {
function t(t) {
function n(e) {
for (var t = e.parentNode.firstChild, n = 0; t;) {
if (t == e) return n;
1 == t.nodeType && "bookmark" == t.getAttribute("data-mce-type") || n++, t = t.nextSibling
}
return -1
}
var r, i, o;
r = o = e[t ? "startContainer" : "endContainer"], i = e[t ? "startOffset" : "endOffset"], r && (1 == r.nodeType && (i = n(r), r = r.parentNode, L.remove(o)), e[t ? "startContainer" : "endContainer"] = r, e[t ? "startOffset" : "endOffset"] = i)
}
t(!0), t();
var n = L.createRng();
n.setStart(e.startContainer, e.startOffset), e.endContainer && n.setEnd(e.endContainer, e.endOffset), M.setRng(d(n))
}
function p(t, n) {
var r, i, o, a = L.createFragment(),
s = e.schema.getBlockElements();
if (e.settings.forced_root_block && (n = n || e.settings.forced_root_block), n && (i = L.create(n), i.tagName === e.settings.forced_root_block && L.setAttribs(i, e.settings.forced_root_block_attrs), a.appendChild(i)), t)
for (; r = t.firstChild;) {
var l = r.nodeName;
o || "SPAN" == l && "bookmark" == r.getAttribute("data-mce-type") || (o = !0), s[l] ? (a.appendChild(r), i = null) : n ? (i || (i = L.create(n), a.appendChild(i)), i.appendChild(r)) : a.appendChild(r)
}
return e.settings.forced_root_block ? o || tinymce.Env.ie && !(tinymce.Env.ie > 10) || i.appendChild(L.create("br", {
"data-mce-bogus": "1"
})) : a.appendChild(L.create("br")), a
}
function m() {
return tinymce.grep(M.getSelectedBlocks(), function(e) {
return i(e)
})
}
function g(e, t, n) {
function r(e) {
tinymce.each(a, function(n) {
e.parentNode.insertBefore(n, t.parentNode)
}), L.remove(e)
}
var i, o, a, s;
for (a = L.select('span[data-mce-type="bookmark"]', e), n = n || p(t), i = L.createRng(), i.setStartAfter(t), i.setEndAfter(e), o = i.extractContents(), s = o.firstChild; s; s = s.firstChild)
if ("LI" == s.nodeName && L.isEmpty(s)) {
L.remove(s);
break
}
L.isEmpty(o) || L.insertAfter(o, e), L.insertAfter(n, e), c(t.parentNode) && r(t.parentNode), L.remove(t), c(e) && L.remove(e)
}
function v(e) {
var t, n;
if (t = e.nextSibling, t && r(t) && t.nodeName == e.nodeName && P(e, t)) {
for (; n = t.firstChild;) e.appendChild(n);
L.remove(t)
}
if (t = e.previousSibling, t && r(t) && t.nodeName == e.nodeName && P(e, t)) {
for (; n = t.lastChild;) e.insertBefore(n, e.firstChild);
L.remove(t)
}
}
function y(e) {
tinymce.each(tinymce.grep(L.select("ol,ul", e)), b)
}
function b(e) {
var t, n = e.parentNode;
"LI" == n.nodeName && n.firstChild == e && (t = n.previousSibling, t && "LI" == t.nodeName ? (t.appendChild(e), c(n) && L.remove(n)) : L.setStyle(n, "listStyleType", "none")), r(n) && (t = n.previousSibling, t && "LI" == t.nodeName && t.appendChild(e))
}
function C(e) {
function t(e) {
c(e) && L.remove(e)
}
var n, i = e.parentNode,
s = i.parentNode;
return !!l(i) || ("DD" == e.nodeName ? (L.rename(e, "DT"), !0) : o(e) && a(e) ? ("LI" == s.nodeName ? (L.insertAfter(e, s), t(s), L.remove(i)) : r(s) ? L.remove(i, !0) : (s.insertBefore(p(e), i), L.remove(i)), !0) : o(e) ? ("LI" == s.nodeName ? (L.insertAfter(e, s), e.appendChild(i), t(s)) : r(s) ? s.insertBefore(e, i) : (s.insertBefore(p(e), i), L.remove(e)), !0) : a(e) ? ("LI" == s.nodeName ? L.insertAfter(e, s) : r(s) ? L.insertAfter(e, i) : (L.insertAfter(p(e), i), L.remove(e)), !0) : ("LI" == s.nodeName ? (i = s, n = p(e, "LI")) : n = r(s) ? p(e, "LI") : p(e), g(i, e, n), y(i.parentNode), !0))
}
function x(e) {
function t(t, n) {
var i;
if (r(t)) {
for (; i = e.lastChild.firstChild;) n.appendChild(i);
L.remove(t)
}
}
var n, i, o;
return "DT" == e.nodeName ? (L.rename(e, "DD"), !0) : (n = e.previousSibling, n && r(n) ? (n.appendChild(e), !0) : n && "LI" == n.nodeName && r(n.lastChild) ? (n.lastChild.appendChild(e), t(e.lastChild, n.lastChild), !0) : (n = e.nextSibling, n && r(n) ? (n.insertBefore(e, n.firstChild), !0) : (n = e.previousSibling, !(!n || "LI" != n.nodeName) && (i = L.create(e.parentNode.nodeName), o = L.getStyle(e.parentNode, "listStyleType"), o && L.setStyle(i, "listStyleType", o), n.appendChild(i), i.appendChild(e), t(e.lastChild, i), !0))))
}
function w() {
var t = m();
if (t.length) {
for (var n = u(M.getRng(!0)), r = 0; r < t.length && (x(t[r]) || 0 !== r); r++);
return h(n), e.nodeChanged(), !0
}
}
function E() {
var t = m();
if (t.length) {
var n, r, i = u(M.getRng(!0)),
o = e.getBody();
for (n = t.length; n--;)
for (var a = t[n].parentNode; a && a != o;) {
for (r = t.length; r--;)
if (t[r] === a) {
t.splice(n, 1);
break
}
a = a.parentNode
}
for (n = 0; n < t.length && (C(t[n]) || 0 !== n); n++);
return h(i), e.nodeChanged(), !0
}
}
function N(t, i) {
function o() {
function t(e) {
var t, n;
for (t = l[e ? "startContainer" : "endContainer"], n = l[e ? "startOffset" : "endOffset"], 1 == t.nodeType && (t = t.childNodes[Math.min(n, t.childNodes.length - 1)] || t); t.parentNode != o;) {
if (s(t)) return t;
if (/^(TD|TH)$/.test(t.parentNode.nodeName)) return t;
t = t.parentNode
}
return t
}
for (var r, i = [], o = e.getBody(), a = t(!0), c = t(), u = [], d = a; d && (u.push(d), d != c); d = d.nextSibling);
return tinymce.each(u, function(e) {
if (s(e)) return i.push(e), void(r = null);
if (L.isBlock(e) || n(e)) return n(e) && L.remove(e), void(r = null);
var t = e.nextSibling;
return tinymce.dom.BookmarkManager.isBookmarkNode(e) && (s(t) || !t && e.parentNode == o) ? void(r = null) : (r || (r = L.create("p"), e.parentNode.insertBefore(r, e), i.push(r)), void r.appendChild(e))
}), i
}
var a, l = M.getRng(!0),
c = "LI";
"false" !== L.getContentEditable(M.getNode()) && (t = t.toUpperCase(), "DL" == t && (c = "DT"), a = u(l), tinymce.each(o(), function(e) {
var n, o, a = function(e) {
var t = L.getStyle(e, "list-style-type"),
n = i ? i["list-style-type"] : "";
return n = null === n ? "" : n, t === n
};
o = e.previousSibling, o && r(o) && o.nodeName == t && a(o) ? (n = o, e = L.rename(e, c), o.appendChild(e)) : (n = L.create(t), e.parentNode.insertBefore(n, e), n.appendChild(e), e = L.rename(e, c)), O(n, i), v(n)
}), h(a))
}
function _() {
var t = u(M.getRng(!0)),
n = e.getBody(),
i = m(),
o = tinymce.util.Tools.grep(i, function(e) {
return c(e)
});
i = tinymce.util.Tools.grep(i, function(e) {
return !c(e)
}), tinymce.each(o, function(e) {
if (c(e)) return void C(e)
}), tinymce.each(i, function(e) {
var t, i;
if (!l(e.parentNode)) {
for (t = e; t && t != n; t = t.parentNode) r(t) && (i = t);
g(i, e), y(i.parentNode)
}
}), h(t)
}
function S(e, t) {
var n = L.getParent(M.getStart(), "OL,UL,DL");
if (!l(n))
if (n)
if (n.nodeName == e) _(e);
else {
var r = u(M.getRng(!0));
O(n, t), v(L.rename(n, e)), h(r)
}
else N(e, t)
}
function k(t) {
return function() {
var n = L.getParent(e.selection.getStart(), "UL,OL,DL");
return n && n.nodeName == t
}
}
function T(e) {
return !!n(e) && !(!L.isBlock(e.nextSibling) || n(e.previousSibling))
}
function R(t, n) {
var r, i, o = t.startContainer,
a = t.startOffset;
if (3 == o.nodeType && (n ? a < o.data.length : a > 0)) return o;
for (r = e.schema.getNonEmptyElements(), 1 == o.nodeType && (o = tinymce.dom.RangeUtils.getNode(o, a)), i = new tinymce.dom.TreeWalker(o, e.getBody()), n && T(o) && i.next(); o = i[n ? "next" : "prev2"]();) {
if ("LI" == o.nodeName && !o.hasChildNodes()) return o;
if (r[o.nodeName]) return o;
if (3 == o.nodeType && o.data.length > 0) return o
}
}
function A(e, i) {
var o, a, s = e.parentNode;
if (t(e) && t(i)) {
if (r(i.lastChild) && (a = i.lastChild), s == i.lastChild && n(s.previousSibling) && L.remove(s.previousSibling), o = i.lastChild, o && n(o) && e.hasChildNodes() && L.remove(o), c(i, !0) && L.$(i).empty(), !c(e, !0))
for (; o = e.firstChild;) i.appendChild(o);
a && i.appendChild(a), L.remove(e), c(s) && !l(s) && L.remove(s)
}
}
function B(e) {
var t, n, r, i = L.getParent(M.getStart(), "LI");
if (i) {
if (t = i.parentNode, l(t) && L.isEmpty(t)) return !0;
if (n = d(M.getRng(!0)), r = L.getParent(R(n, e), "LI"), r && r != i) {
var o = u(n);
return e ? A(r, i) : A(i, r), h(o), !0
}
if (!r && !e && _(t.nodeName)) return !0
}
}
function D() {
var t = e.dom.getParent(e.selection.getStart(), "LI,DT,DD");
return !!(t || m().length > 0) && (e.undoManager.transact(function() {
e.execCommand("Delete"), y(e.getBody())
}), !0)
}
var L = e.dom,
M = e.selection,
P = function(t, n) {
var r = e.dom.getStyle(t, "list-style-type", !0),
i = e.dom.getStyle(n, "list-style-type", !0);
return r === i
},
O = function(e, t) {
L.setStyle(e, "list-style-type", t ? t["list-style-type"] : null)
};
f.backspaceDelete = function(e) {
return M.isCollapsed() ? B(e) : D()
}, e.on("BeforeExecCommand", function(t) {
var n, r = t.command.toLowerCase();
if ("indent" == r ? w() && (n = !0) : "outdent" == r && E() && (n = !0), n) return e.fire("ExecCommand", {
command: t.command
}), t.preventDefault(), !0
}), e.addCommand("InsertUnorderedList", function(e, t) {
S("UL", t)
}), e.addCommand("InsertOrderedList", function(e, t) {
S("OL", t)
}), e.addCommand("InsertDefinitionList", function(e, t) {
S("DL", t)
}), e.addQueryStateHandler("InsertUnorderedList", k("UL")), e.addQueryStateHandler("InsertOrderedList", k("OL")), e.addQueryStateHandler("InsertDefinitionList", k("DL")), e.on("keydown", function(t) {
9 != t.keyCode || tinymce.util.VK.metaKeyPressed(t) || e.dom.getParent(e.selection.getStart(), "LI,DT,DD") && (t.preventDefault(), t.shiftKey ? E() : w())
})
});
var h = function(t) {
return function() {
var n = this;
e.on("NodeChange", function(e) {
var i = tinymce.util.Tools.grep(e.parents, r);
n.active(i.length > 0 && i[0].nodeName === t)
})
}
},
p = function(e, t) {
var n = e.settings.plugins ? e.settings.plugins : "";
return tinymce.util.Tools.inArray(n.split(/[ ,]/), t) !== -1
};
p(e, "advlist") || (e.addButton("numlist", {
title: "Numbered list",
cmd: "InsertOrderedList",
onPostRender: h("OL")
}), e.addButton("bullist", {
title: "Bullet list",
cmd: "InsertUnorderedList",
onPostRender: h("UL")
})), e.addButton("indent", {
icon: "indent",
title: "Increase indent",
cmd: "Indent",
onPostRender: function() {
var t = this;
e.on("nodechange", function() {
for (var n = e.selection.getSelectedBlocks(), r = !1, i = 0, a = n.length; !r && i < a; i++) {
var s = n[i].nodeName;
r = "LI" == s && o(n[i]) || "UL" == s || "OL" == s || "DD" == s
}
t.disabled(r)
})
}
}), e.on("keydown", function(e) {
e.keyCode == tinymce.util.VK.BACKSPACE ? f.backspaceDelete() && e.preventDefault() : e.keyCode == tinymce.util.VK.DELETE && f.backspaceDelete(!0) && e.preventDefault()
})
});

View File

@@ -0,0 +1,624 @@
! function() {
var e = {},
t = function(t) {
for (var n = e[t], i = n.deps, o = n.defn, a = i.length, s = new Array(a), l = 0; l < a; ++l) s[l] = r(i[l]);
var c = o.apply(null, s);
if (void 0 === c) throw "module [" + t + "] returned undefined";
n.instance = c
},
n = function(t, n, r) {
if ("string" != typeof t) throw "module id must be a string";
if (void 0 === n) throw "no dependencies for " + t;
if (void 0 === r) throw "no definition function for " + t;
e[t] = {
deps: n,
defn: r,
instance: void 0
}
},
r = function(n) {
var r = e[n];
if (void 0 === r) throw "module [" + n + "] was undefined";
return void 0 === r.instance && t(n), r.instance
},
i = function(e, t) {
for (var n = e.length, i = new Array(n), o = 0; o < n; ++o) i.push(r(e[o]));
t.apply(null, t)
},
o = {};
o.bolt = {
module: {
api: {
define: n,
require: i,
demand: r
}
}
};
var a = n,
s = function(e, t) {
a(e, [], function() {
return t
})
};
s("1", tinymce.PluginManager), s("6", tinymce.util.Delay), s("c", tinymce.util.Tools), s("9", tinymce.html.SaxParser), s("a", tinymce.html.Schema), a("e", [], function() {
var e = function(e, t) {
if (e)
for (var n = 0; n < e.length; n++)
if (t.indexOf(e[n].filter) !== -1) return e[n]
};
return {
getVideoScriptMatch: e
}
}), a("7", ["c", "9", "a", "e"], function(e, t, n, r) {
var i = function(n, i) {
var o = {};
return new t({
validate: !1,
allow_conditional_comments: !0,
special: "script,noscript",
start: function(t, i) {
o.source1 || "param" !== t || (o.source1 = i.map.movie);
var a = i.map["data-ephox-embed-iri"];
if (a && (o.type = "ephox-embed-iri", o.source1 = a), "iframe" !== t && "object" !== t && "embed" !== t && "video" !== t && "audio" !== t || (o.type || (o.type = t), o = e.extend(i.map, o)), "script" === t) {
var s = r.getVideoScriptMatch(n, i.map.src);
if (!s) return;
o = {
type: "script",
source1: i.map.src,
width: s.width,
height: s.height
}
}
"source" === t && (o.source1 ? o.source2 || (o.source2 = i.map.src) : o.source1 = i.map.src), "img" !== t || o.poster || (o.poster = i.map.src)
}
}).parse(i), o.source1 = o.source1 || o.src || o.data, o.source2 = o.source2 || "", o.poster = o.poster || "", "ephox-embed-iri" === o.type ? e.extend({}, {
type: o.type,
source1: o.source1,
source2: "",
poster: "",
width: o.width,
height: o.height
}) : o
};
return {
htmlToData: i
}
}), s("8", tinymce.html.Writer), a("4", ["8", "9", "a"], function(e, t, n) {
var r = function(e, t) {
var n, r, i, o;
for (n in t)
if (i = "" + t[n], e.map[n])
for (r = e.length; r--;) o = e[r], o.name === n && (i ? (e.map[n] = i, o.value = i) : (delete e.map[n], e.splice(r, 1)));
else i && (e.push({
name: n,
value: i
}), e.map[n] = i)
},
i = function(i, o, a) {
var s, l = new e,
c = 0;
return new t({
validate: !1,
allow_conditional_comments: !0,
special: "script,noscript",
comment: function(e) {
l.comment(e)
},
cdata: function(e) {
l.cdata(e)
},
text: function(e, t) {
l.text(e, t)
},
start: function(e, t, n) {
switch (e) {
case "video":
case "object":
case "embed":
case "img":
case "iframe":
r(t, {
width: o.width,
height: o.height
})
}
if (a) switch (e) {
case "video":
r(t, {
poster: o.poster,
src: ""
}), o.source2 && r(t, {
src: ""
});
break;
case "iframe":
r(t, {
src: o.source1
});
break;
case "source":
if (c++, c <= 2 && (r(t, {
src: o["source" + c],
type: o["source" + c + "mime"]
}), !o["source" + c])) return;
break;
case "img":
if (!o.poster) return;
s = !0
}
l.start(e, t, n)
},
end: function(e) {
if ("video" === e && a)
for (var t = 1; t <= 2; t++)
if (o["source" + t]) {
var n = [];
n.map = {}, c < t && (r(n, {
src: o["source" + t],
type: o["source" + t + "mime"]
}), l.start("source", n, !0))
}
if (o.poster && "object" === e && a && !s) {
var i = [];
i.map = {}, r(i, {
src: o.poster,
width: o.width,
height: o.height
}), l.start("img", i, !0)
}
l.end(e)
}
}, new n({})).parse(i), l.getContent()
};
return {
updateHtml: i
}
}), a("i", [], function() {
var e = function(e) {
var t = {
mp3: "audio/mpeg",
wav: "audio/wav",
mp4: "video/mp4",
webm: "video/webm",
ogg: "video/ogg",
swf: "application/x-shockwave-flash"
},
n = e.toLowerCase().split(".").pop(),
r = t[n];
return r ? r : ""
};
return {
guess: e
}
}), a("j", [], function() {
var e = [{
regex: /youtu\.be\/([\w\-.]+)/,
type: "iframe",
w: 560,
h: 314,
url: "//www.youtube.com/embed/$1",
allowFullscreen: !0
}, {
regex: /youtube\.com(.+)v=([^&]+)/,
type: "iframe",
w: 560,
h: 314,
url: "//www.youtube.com/embed/$2",
allowFullscreen: !0
}, {
regex: /youtube.com\/embed\/([a-z0-9\-_]+(?:\?.+)?)/i,
type: "iframe",
w: 560,
h: 314,
url: "//www.youtube.com/embed/$1",
allowFullscreen: !0
}, {
regex: /vimeo\.com\/([0-9]+)/,
type: "iframe",
w: 425,
h: 350,
url: "//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",
allowfullscreen: !0
}, {
regex: /vimeo\.com\/(.*)\/([0-9]+)/,
type: "iframe",
w: 425,
h: 350,
url: "//player.vimeo.com/video/$2?title=0&amp;byline=0",
allowfullscreen: !0
}, {
regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,
type: "iframe",
w: 425,
h: 350,
url: '//maps.google.com/maps/ms?msid=$2&output=embed"',
allowFullscreen: !1
}, {
regex: /dailymotion\.com\/video\/([^_]+)/,
type: "iframe",
w: 480,
h: 270,
url: "//www.dailymotion.com/embed/video/$1",
allowFullscreen: !0
}];
return {
urlPatterns: e
}
}), a("g", ["i", "7", "j", "e", "4", "c"], function(e, t, n, r, i, o) {
var a = function(a, s) {
var l = "",
c = o.extend({}, s);
if (!c.source1 && (o.extend(c, t.htmlToData(a.settings.media_scripts, c.embed)), !c.source1)) return "";
if (c.source2 || (c.source2 = ""), c.poster || (c.poster = ""), c.source1 = a.convertURL(c.source1, "source"), c.source2 = a.convertURL(c.source2, "source"), c.source1mime = e.guess(c.source1), c.source2mime = e.guess(c.source2), c.poster = a.convertURL(c.poster, "poster"), o.each(n.urlPatterns, function(e) {
var t, n, r = e.regex.exec(c.source1);
if (r) {
for (n = e.url, t = 0; r[t]; t++) n = n.replace("$" + t, function() {
return r[t]
});
c.source1 = n, c.type = e.type, c.allowFullscreen = e.allowFullscreen, c.width = c.width || e.w, c.height = c.height || e.h
}
}), c.embed) l = i.updateHtml(c.embed, c, !0);
else {
var u = r.getVideoScriptMatch(a.settings.media_scripts, c.source1);
if (u && (c.type = "script", c.width = u.width, c.height = u.height), c.width = c.width || 300, c.height = c.height || 150, o.each(c, function(e, t) {
c[t] = a.dom.encode(e)
}), "iframe" === c.type) {
var d = c.allowFullscreen ? ' allowFullscreen="1"' : "";
l += '<iframe src="' + c.source1 + '" width="' + c.width + '" height="' + c.height + '"' + d + "></iframe>"
} else "application/x-shockwave-flash" === c.source1mime ? (l += '<object data="' + c.source1 + '" width="' + c.width + '" height="' + c.height + '" type="application/x-shockwave-flash">', c.poster && (l += '<img src="' + c.poster + '" width="' + c.width + '" height="' + c.height + '" />'), l += "</object>") : c.source1mime.indexOf("audio") !== -1 ? a.settings.audio_template_callback ? l = a.settings.audio_template_callback(c) : l += '<audio controls="controls" src="' + c.source1 + '">' + (c.source2 ? '\n<source src="' + c.source2 + '"' + (c.source2mime ? ' type="' + c.source2mime + '"' : "") + " />\n" : "") + "</audio>" : "script" === c.type ? l += '<script src="' + c.source1 + '"></script>' : l = a.settings.video_template_callback ? a.settings.video_template_callback(c) : '<video width="' + c.width + '" height="' + c.height + '"' + (c.poster ? ' poster="' + c.poster + '"' : "") + ' controls="controls">\n<source src="' + c.source1 + '"' + (c.source1mime ? ' type="' + c.source1mime + '"' : "") + " />\n" + (c.source2 ? '<source src="' + c.source2 + '"' + (c.source2mime ? ' type="' + c.source2mime + '"' : "") + " />\n" : "") + "</video>"
}
return l
};
return {
dataToHtml: a
}
}), s("h", tinymce.util.Promise), a("b", ["g", "h"], function(e, t) {
var n = function(e, n, r) {
var i = {};
return new t(function(t, o) {
var a = function(r) {
return r.html && (i[e.source1] = r), t({
url: e.source1,
html: r.html ? r.html : n(e)
})
};
i[e.source1] ? a(i[e.source1]) : r({
url: e.source1
}, a, o)
})
},
r = function(e, n) {
return new t(function(t) {
t({
html: n(e),
url: e.source1
})
})
},
i = function(t) {
return function(n) {
return e.dataToHtml(t, n)
}
},
o = function(e, t) {
var o = e.settings.media_url_resolver;
return o ? n(t, i(e), o) : r(t, i(e))
};
return {
getEmbedHtml: o
}
}), s("d", tinymce.Env), a("2", ["6", "7", "4", "b", "c", "d"], function(e, t, n, r, i, o) {
var a = o.ie && o.ie <= 8 ? "onChange" : "onInput",
s = function(e) {
return function(t) {
var n = t && t.msg ? "Media embed handler error: " + t.msg : "Media embed handler threw unknown error.";
e.notificationManager.open({
type: "error",
text: n
})
}
},
l = function(e) {
var n = e.selection.getNode(),
r = n.getAttribute("data-ephox-embed-iri");
return r ? {
source1: r,
"data-ephox-embed-iri": r
} : n.getAttribute("data-mce-object") ? t.htmlToData(e.settings.media_scripts, e.serializer.serialize(n, {
selection: !0
})) : {}
},
c = function(e) {
var t = e.selection.getNode();
if (t.getAttribute("data-mce-object")) return e.selection.getContent()
},
u = function(e, n) {
return function(r) {
var o = r.html;
e.find("#embed").value(o);
var a = i.extend(t.htmlToData(n.settings.media_scripts, o), {
source1: r.url
});
e.fromJSON(a), h(e)
}
},
d = function(e, t) {
var n, r, i = e.dom.select("img[data-mce-object]");
for (n = 0; n < t.length; n++)
for (r = i.length - 1; r >= 0; r--) t[n] === i[r] && i.splice(r, 1);
e.selection.select(i[0])
},
f = function(e) {
return function() {
var t = this.toJSON();
r.getEmbedHtml(e, t).then(function(n) {
var r = e.dom.select("img[data-mce-object]"),
i = t.embed ? t.embed : n.html;
e.insertContent(i), d(e, r), e.nodeChanged()
}).catch(s(e))
}
},
h = function(e) {
var t = e.find("#width")[0],
n = e.find("#height")[0];
t && n && (t.state.set("oldVal", t.value()), n.state.set("oldVal", n.value()))
},
p = function(e, t) {
i.each(t, function(t, n) {
e.find("#" + n).value(t)
})
},
m = function(e) {
var o, d, m = [{
name: "source1",
type: "filepicker",
filetype: "media",
size: 40,
autofocus: !0,
label: "Source",
onpaste: function() {
setTimeout(function() {
r.getEmbedHtml(e, o.toJSON()).then(u(o, e)).catch(s(e))
}, 1)
},
onchange: function(t) {
r.getEmbedHtml(e, o.toJSON()).then(u(o, e)).catch(s(e)), p(o, t.meta)
},
onbeforecall: function(e) {
e.meta = o.toJSON()
}
}],
g = function(e) {
var t = o.find("#width")[0],
r = o.find("#height")[0],
i = t.state.get("oldVal"),
a = r.state.get("oldVal"),
s = t.value(),
l = r.value();
o.find("#constrain")[0].checked() && i && a && s && l && (e.control.name() === t.name() ? (l = Math.round(s / i * l), isNaN(l) || r.value(l)) : (s = Math.round(l / a * s), isNaN(s) || t.value(s))), d = o.toJSON(), o.find("#embed").value(n.updateHtml(d.embed, d)), h(o)
};
e.settings.media_alt_source !== !1 && m.push({
name: "source2",
type: "filepicker",
filetype: "media",
size: 40,
label: "Alternative source"
}), e.settings.media_poster !== !1 && m.push({
name: "poster",
type: "filepicker",
filetype: "image",
size: 40,
label: "Poster"
}), e.settings.media_dimensions !== !1 && m.push({
type: "container",
label: "Dimensions",
layout: "flex",
align: "center",
spacing: 5,
items: [{
name: "width",
type: "textbox",
maxLength: 5,
size: 3,
onchange: g,
ariaLabel: "Width"
}, {
type: "label",
text: "x"
}, {
name: "height",
type: "textbox",
maxLength: 5,
size: 3,
onchange: g,
ariaLabel: "Height"
}, {
name: "constrain",
type: "checkbox",
checked: !0,
text: "Constrain proportions"
}]
}), d = l(e);
var v = {
id: "mcemediasource",
type: "textbox",
flex: 1,
name: "embed",
value: c(e),
multiline: !0,
label: "Source"
},
y = function() {
d = i.extend({}, t.htmlToData(e.settings.media_scripts, this.value())), this.parent().parent().fromJSON(d)
};
v[a] = y, o = e.windowManager.open({
title: "Insert/edit video",
data: d,
bodyType: "tabpanel",
body: [{
title: "General",
type: "form",
items: m
}, {
title: "Embed",
type: "container",
layout: "flex",
direction: "column",
align: "stretch",
padding: 10,
spacing: 10,
items: [{
type: "label",
text: "Paste your embed code below:",
forId: "mcemediasource"
}, v]
}],
onSubmit: f(e)
}), h(o)
};
return {
showDialog: m
}
}), a("3", ["c", "8", "9", "a"], function(e, t, n, r) {
var i = function(e, i) {
if (e.settings.media_filter_html === !1) return i;
var o, a = new t;
return new n({
validate: !1,
allow_conditional_comments: !1,
special: "script,noscript",
comment: function(e) {
a.comment(e)
},
cdata: function(e) {
a.cdata(e)
},
text: function(e, t) {
a.text(e, t)
},
start: function(t, n, r) {
if (o = !0, "script" !== t && "noscript" !== t) {
for (var i = 0; i < n.length; i++) {
if (0 === n[i].name.indexOf("on")) return;
"style" === n[i].name && (n[i].value = e.dom.serializeStyle(e.dom.parseStyle(n[i].value), t))
}
a.start(t, n, r), o = !1
}
},
end: function(e) {
o || a.end(e)
}
}, new r({})).parse(i), a.getContent()
};
return {
sanitize: i
}
}), s("f", tinymce.html.Node), a("5", ["3", "e", "f", "d"], function(e, t, n, r) {
var i = function(e, t) {
var i, o = t.name;
return i = new n("img", 1), i.shortEnded = !0, a(e, t, i), i.attr({
width: t.attr("width") || "300",
height: t.attr("height") || ("audio" === o ? "30" : "150"),
style: t.attr("style"),
src: r.transparentSrc,
"data-mce-object": o,
class: "mce-object mce-object-" + o
}), i
},
o = function(e, t) {
var r, i, o, s = t.name;
return r = new n("span", 1), r.attr({
contentEditable: "false",
style: t.attr("style"),
"data-mce-object": s,
class: "mce-preview-object mce-object-" + s
}), a(e, t, r), i = new n(s, 1), i.attr({
src: t.attr("src"),
allowfullscreen: t.attr("allowfullscreen"),
width: t.attr("width") || "300",
height: t.attr("height") || ("audio" === s ? "30" : "150"),
frameborder: "0"
}), o = new n("span", 1), o.attr("class", "mce-shim"), r.append(i), r.append(o), r
},
a = function(t, n, r) {
var i, o, a, s, l;
for (a = n.attributes, s = a.length; s--;) i = a[s].name, o = a[s].value, "width" !== i && "height" !== i && "style" !== i && ("data" !== i && "src" !== i || (o = t.convertURL(o, i)), r.attr("data-mce-p-" + i, o));
l = n.firstChild && n.firstChild.value, l && (r.attr("data-mce-html", escape(e.sanitize(t, l))), r.firstChild = null)
},
s = function(e) {
return function(n) {
for (var a, s, l, c = n.length; c--;) a = n[c], a.parent && (a.parent.attr("data-mce-object") || ("script" !== a.name || (l = t.getVideoScriptMatch(e.settings.media_scripts, a.attr("src")))) && (l && (l.width && a.attr("width", l.width.toString()), l.height && a.attr("height", l.height.toString())), s = "iframe" === a.name && e.settings.media_live_embeds !== !1 && r.ceFalse ? o(e, a) : i(e, a), a.replace(s)))
}
};
return {
createPreviewNode: o,
createPlaceholderNode: i,
placeHolderConverter: s
}
}), a("0", ["1", "2", "3", "4", "5"], function(e, t, n, r, i) {
var o = function(e) {
e.on("ResolveName", function(e) {
var t;
1 === e.target.nodeType && (t = e.target.getAttribute("data-mce-object")) && (e.name = t)
}), e.on("preInit", function() {
var t = e.schema.getSpecialElements();
tinymce.each("video audio iframe object".split(" "), function(e) {
t[e] = new RegExp("</" + e + "[^>]*>", "gi")
});
var r = e.schema.getBoolAttrs();
tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "), function(e) {
r[e] = {}
}), e.parser.addNodeFilter("iframe,video,audio,object,embed,script", i.placeHolderConverter(e)), e.serializer.addAttributeFilter("data-mce-object", function(t, r) {
for (var i, o, a, s, l, c, u, d, f = t.length; f--;)
if (i = t[f], i.parent) {
for (u = i.attr(r), o = new tinymce.html.Node(u, 1), "audio" !== u && "script" !== u && (d = i.attr("class"), d && d.indexOf("mce-preview-object") !== -1 ? o.attr({
width: i.firstChild.attr("width"),
height: i.firstChild.attr("height")
}) : o.attr({
width: i.attr("width"),
height: i.attr("height")
})), o.attr({
style: i.attr("style")
}), s = i.attributes, a = s.length; a--;) {
var h = s[a].name;
0 === h.indexOf("data-mce-p-") && o.attr(h.substr(11), s[a].value)
}
"script" === u && o.attr("type", "text/javascript"), l = i.attr("data-mce-html"), l && (c = new tinymce.html.Node("#text", 3), c.raw = !0, c.value = n.sanitize(e, unescape(l)), o.append(c)), i.replace(o)
}
})
}), e.on("click keyup", function() {
var t = e.selection.getNode();
t && e.dom.hasClass(t, "mce-preview-object") && e.dom.getAttrib(t, "data-mce-selected") && t.setAttribute("data-mce-selected", "2")
}), e.on("ObjectSelected", function(e) {
var t = e.target.getAttribute("data-mce-object");
"audio" !== t && "script" !== t || e.preventDefault()
}), e.on("objectResized", function(e) {
var t, n = e.target;
n.getAttribute("data-mce-object") && (t = n.getAttribute("data-mce-html"), t && (t = unescape(t), n.setAttribute("data-mce-html", escape(r.updateHtml(t, {
width: e.width,
height: e.height
})))))
}), this.showDialog = function() {
t.showDialog(e)
}, e.addButton("media", {
tooltip: "Insert/edit video",
onclick: this.showDialog,
stateSelector: ["img[data-mce-object]", "span[data-mce-object]", "div[data-ephox-embed-iri]"]
}), e.addMenuItem("media", {
icon: "media",
text: "Media",
onclick: this.showDialog,
context: "insert",
prependToContext: !0
}), e.on("setContent", function() {
e.$("span.mce-preview-object").each(function(t, n) {
var r = e.$(n);
0 === r.find("span.mce-shim", n).length && r.append('<span class="mce-shim"></span>')
})
}), e.addCommand("mceMedia", this.showDialog)
};
return e.add("media", o),
function() {}
}), r("0")()
}();

View File

@@ -0,0 +1,22 @@
tinymce.PluginManager.add("nonbreaking", function(e) {
var t = e.getParam("nonbreaking_force_tab");
if (e.addCommand("mceNonBreaking", function() {
e.insertContent(e.plugins.visualchars && e.plugins.visualchars.state ? '<span class="mce-nbsp">&nbsp;</span>' : "&nbsp;"), e.dom.setAttrib(e.dom.select("span.mce-nbsp"), "data-mce-bogus", "1")
}), e.addButton("nonbreaking", {
title: "Nonbreaking space",
cmd: "mceNonBreaking"
}), e.addMenuItem("nonbreaking", {
text: "Nonbreaking space",
cmd: "mceNonBreaking",
context: "insert"
}), t) {
var n = +t > 1 ? +t : 3;
e.on("keydown", function(t) {
if (9 == t.keyCode) {
if (t.shiftKey) return;
t.preventDefault();
for (var r = 0; r < n; r++) e.execCommand("mceNonBreaking")
}
})
}
});

View File

@@ -0,0 +1,37 @@
tinymce.PluginManager.add("pagebreak", function(e) {
var t = "mce-pagebreak",
n = e.getParam("pagebreak_separator", "<!-- pagebreak -->"),
r = new RegExp(n.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(e) {
return "\\" + e
}), "gi"),
i = '<img src="' + tinymce.Env.transparentSrc + '" class="' + t + '" data-mce-resize="false" data-mce-placeholder />';
e.addCommand("mcePageBreak", function() {
e.settings.pagebreak_split_block ? e.insertContent("<p>" + i + "</p>") : e.insertContent(i)
}), e.addButton("pagebreak", {
title: "Page break",
cmd: "mcePageBreak"
}), e.addMenuItem("pagebreak", {
text: "Page break",
icon: "pagebreak",
cmd: "mcePageBreak",
context: "insert"
}), e.on("ResolveName", function(n) {
"IMG" == n.target.nodeName && e.dom.hasClass(n.target, t) && (n.name = "pagebreak")
}), e.on("click", function(n) {
n = n.target, "IMG" === n.nodeName && e.dom.hasClass(n, t) && e.selection.select(n)
}), e.on("BeforeSetContent", function(e) {
e.content = e.content.replace(r, i)
}), e.on("PreInit", function() {
e.serializer.addNodeFilter("img", function(t) {
for (var r, i, o = t.length; o--;)
if (r = t[o], i = r.attr("class"), i && i.indexOf("mce-pagebreak") !== -1) {
var a = r.parent;
if (e.schema.getBlockElements()[a.name] && e.settings.pagebreak_split_block) {
a.type = 3, a.value = n, a.raw = !0, r.remove();
continue
}
r.type = 3, r.value = n, r.raw = !0
}
})
})
});

View File

@@ -0,0 +1,631 @@
! function(e, t) {
"use strict";
function n(e, t) {
for (var n, r = [], o = 0; o < e.length; ++o) {
if (n = a[e[o]] || i(e[o]), !n) throw "module definition dependecy not found: " + e[o];
r.push(n)
}
t.apply(null, r)
}
function r(e, r, i) {
if ("string" != typeof e) throw "invalid module definition, module id must be defined and be a string";
if (r === t) throw "invalid module definition, dependencies must be specified";
if (i === t) throw "invalid module definition, definition function must be specified";
n(r, function() {
a[e] = i.apply(null, arguments)
})
}
function i(t) {
for (var n = e, r = t.split(/[.\/]/), i = 0; i < r.length; ++i) {
if (!n[r[i]]) return;
n = n[r[i]]
}
return n
}
function o(n) {
var r, i, o, s, l;
for (r = 0; r < n.length; r++) {
i = e, o = n[r], s = o.split(/[.\/]/);
for (var c = 0; c < s.length - 1; ++c) i[s[c]] === t && (i[s[c]] = {}), i = i[s[c]];
i[s[s.length - 1]] = a[o]
}
if (e.AMDLC_TESTS) {
l = e.privateModules || {};
for (o in a) l[o] = a[o];
for (r = 0; r < n.length; r++) delete l[n[r]];
e.privateModules = l
}
}
var a = {};
r("tinymce/pasteplugin/Utils", ["tinymce/util/Tools", "tinymce/html/DomParser", "tinymce/html/Schema"], function(e, t, n) {
function r(t, n) {
return e.each(n, function(e) {
t = e.constructor == RegExp ? t.replace(e, "") : t.replace(e[0], e[1])
}), t
}
function i(i) {
function o(e) {
var t = e.name,
n = e;
if ("br" === t) return void(l += "\n");
if (c[t] && (l += " "), u[t]) return void(l += " ");
if (3 == e.type && (l += e.value), !e.shortEnded && (e = e.firstChild))
do o(e); while (e = e.next);
d[t] && n.next && (l += "\n", "p" == t && (l += "\n"))
}
var a = new n,
s = new t({}, a),
l = "",
c = a.getShortEndedElements(),
u = e.makeMap("script noscript style textarea video audio iframe object", " "),
d = a.getBlockElements();
return i = r(i, [/<!\[[^\]]+\]>/g]), o(s.parse(i)), l
}
function o(e) {
function t(e, t, n) {
return t || n ? "\xa0" : " "
}
return e = r(e, [/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g, /<!--StartFragment-->|<!--EndFragment-->/g, [/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g, t], /<br class="Apple-interchange-newline">/g, /<br>$/i])
}
function a(e) {
var t = 0;
return function() {
return e + t++
}
}
return {
filter: r,
innerText: i,
trimHtml: o,
createIdGenerator: a
}
}), r("tinymce/pasteplugin/SmartPaste", ["tinymce/util/Tools"], function(e) {
var t = function(e) {
return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(e)
},
n = function(e) {
return t(e) && /.(gif|jpe?g|png)$/.test(e)
},
r = function(e, t, n) {
return e.undoManager.extra(function() {
n(e, t)
}, function() {
e.insertContent('<img src="' + t + '">')
}), !0
},
i = function(e, t, n) {
return e.undoManager.extra(function() {
n(e, t)
}, function() {
e.execCommand("mceInsertLink", !1, t)
}), !0
},
o = function(e, n, r) {
return !(e.selection.isCollapsed() !== !1 || !t(n)) && i(e, n, r)
},
a = function(e, t, i) {
return !!n(t) && r(e, t, i)
},
s = function(e, t) {
return e.insertContent(t, {
merge: e.settings.paste_merge_formats !== !1,
paste: !0
}), !0
},
l = function(t, n) {
e.each([o, a, s], function(e) {
return e(t, n, s) !== !0
})
},
c = function(e, t) {
e.settings.smart_paste === !1 ? s(e, t) : l(e, t)
};
return {
isImageUrl: n,
isAbsoluteUrl: t,
insertContent: c
}
}), r("tinymce/pasteplugin/Clipboard", ["tinymce/Env", "tinymce/dom/RangeUtils", "tinymce/util/VK", "tinymce/pasteplugin/Utils", "tinymce/pasteplugin/SmartPaste", "tinymce/util/Delay"], function(e, t, n, r, i, o) {
return function(a) {
function s(e) {
var t, n = a.dom;
if (t = a.fire("BeforePastePreProcess", {
content: e
}), t = a.fire("PastePreProcess", t), e = t.content, !t.isDefaultPrevented()) {
if (a.hasEventListeners("PastePostProcess") && !t.isDefaultPrevented()) {
var r = n.add(a.getBody(), "div", {
style: "display:none"
}, e);
t = a.fire("PastePostProcess", {
node: r
}), n.remove(r), e = t.node.innerHTML
}
t.isDefaultPrevented() || i.insertContent(a, e)
}
}
function l(e) {
e = a.dom.encode(e).replace(/\r\n/g, "\n");
var t, n = a.dom.getParent(a.selection.getStart(), a.dom.isBlock),
i = a.settings.forced_root_block;
i && (t = a.dom.createHTML(i, a.settings.forced_root_block_attrs), t = t.substr(0, t.length - 3) + ">"), n && /^(PRE|DIV)$/.test(n.nodeName) || !i ? e = r.filter(e, [
[/\n/g, "<br>"]
]) : (e = r.filter(e, [
[/\n\n/g, "</p>" + t],
[/^(.*<\/p>)(<p>)$/, t + "$1"],
[/\n/g, "<br />"]
]), e.indexOf("<p>") != -1 && (e = t + e)), s(e)
}
function c() {
function t(e) {
var t, n, i, o = e.startContainer;
if (t = e.getClientRects(), t.length) return t[0];
if (e.collapsed && 1 == o.nodeType) {
for (i = o.childNodes[_.startOffset]; i && 3 == i.nodeType && !i.data.length;) i = i.nextSibling;
if (i) return "BR" == i.tagName && (n = r.doc.createTextNode("\ufeff"), i.parentNode.insertBefore(n, i), e = r.createRng(), e.setStartBefore(n), e.setEndAfter(n), t = e.getClientRects(), r.remove(n)), t.length ? t[0] : void 0
}
}
var n, r = a.dom,
i = a.getBody(),
o = a.dom.getViewPort(a.getWin()),
s = o.y,
l = 20;
if (_ = a.selection.getRng(), a.inline && (n = a.selection.getScrollContainer(), n && n.scrollTop > 0 && (s = n.scrollTop)), _.getClientRects) {
var c = t(_);
if (c) l = s + (c.top - r.getPos(i).y);
else {
l = s;
var u = _.startContainer;
u && (3 == u.nodeType && u.parentNode != i && (u = u.parentNode), 1 == u.nodeType && (l = r.getPos(u, n || i).y))
}
}
N = r.add(a.getBody(), "div", {
id: "mcepastebin",
contentEditable: !0,
"data-mce-bogus": "all",
style: "position: absolute; top: " + l + "px;width: 10px; height: 10px; overflow: hidden; opacity: 0"
}, A), (e.ie || e.gecko) && r.setStyle(N, "left", "rtl" == r.getStyle(i, "direction", !0) ? 65535 : -65535), r.bind(N, "beforedeactivate focusin focusout", function(e) {
e.stopPropagation()
}), N.focus(), a.selection.select(N, !0)
}
function u() {
if (N) {
for (var e; e = a.dom.get("mcepastebin");) a.dom.remove(e), a.dom.unbind(e);
_ && a.selection.setRng(_)
}
N = _ = null
}
function d() {
var e, t, n, r, i = "";
for (e = a.dom.select("div[id=mcepastebin]"), t = 0; t < e.length; t++) n = e[t], n.firstChild && "mcepastebin" == n.firstChild.id && (n = n.firstChild), r = n.innerHTML, i != A && (i += r);
return i
}
function f(e) {
var t = {};
if (e) {
if (e.getData) {
var n = e.getData("Text");
n && n.length > 0 && n.indexOf(B) == -1 && (t["text/plain"] = n)
}
if (e.types)
for (var r = 0; r < e.types.length; r++) {
var i = e.types[r];
t[i] = e.getData(i)
}
}
return t
}
function h(e) {
return f(e.clipboardData || a.getDoc().dataTransfer)
}
function p(e) {
return x(e, "text/html") || x(e, "text/plain")
}
function m(e) {
var t;
return t = e.indexOf(","), t !== -1 ? e.substr(t + 1) : null
}
function g(e, t) {
return !e.images_dataimg_filter || e.images_dataimg_filter(t)
}
function v(e, t, n) {
e && (a.selection.setRng(e), e = null);
var r = t.result,
i = m(r),
o = new Image;
if (o.src = r, g(a.settings, o)) {
var l, c, u = a.editorUpload.blobCache;
c = u.findFirst(function(e) {
return e.base64() === i
}), c ? l = c : (l = u.create(D(), n, i), u.add(l)), s('<img src="' + l.blobUri() + '">')
} else s('<img src="' + r + '">')
}
function y(e, t) {
function n(n) {
var r, i, o, a = !1;
if (n)
for (r = 0; r < n.length; r++)
if (i = n[r], /^image\/(jpeg|png|gif|bmp)$/.test(i.type)) {
var s = i.getAsFile ? i.getAsFile() : i;
o = new FileReader, o.onload = v.bind(null, t, o, s), o.readAsDataURL(s), e.preventDefault(), a = !0
}
return a
}
var r = e.clipboardData || e.dataTransfer;
if (a.settings.paste_data_images && r) return n(r.items) || n(r.files)
}
function b(e) {
var t = e.clipboardData;
return navigator.userAgent.indexOf("Android") != -1 && t && t.items && 0 === t.items.length
}
function C(e) {
return t.getCaretRangeFromPoint(e.clientX, e.clientY, a.getDoc())
}
function x(e, t) {
return t in e && e[t].length > 0
}
function w(e) {
return n.metaKeyPressed(e) && 86 == e.keyCode || e.shiftKey && 45 == e.keyCode
}
function E() {
function t(e, t, n) {
var i;
return x(e, "text/html") ? i = e["text/html"] : (i = d(), i == A && (n = !0)), i = r.trimHtml(i), N && N.firstChild && "mcepastebin" === N.firstChild.id && (n = !0), u(), i.length || (n = !0), n && (i = x(e, "text/plain") && i.indexOf("</p>") == -1 ? e["text/plain"] : r.innerText(i)), i == A ? void(t || a.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")) : void(n ? l(i) : s(i))
}
function n(e) {
var t = e["text/plain"];
return !!t && 0 === t.indexOf("file://")
}
a.on("keydown", function(t) {
function n(e) {
w(e) && !e.isDefaultPrevented() && u()
}
if (w(t) && !t.isDefaultPrevented()) {
if (S = t.shiftKey && 86 == t.keyCode, S && e.webkit && navigator.userAgent.indexOf("Version/") != -1) return;
if (t.stopImmediatePropagation(), T = (new Date).getTime(), e.ie && S) return t.preventDefault(), void a.fire("paste", {
ieFake: !0
});
u(), c(), a.once("keyup", n), a.once("paste", function() {
a.off("keyup", n)
})
}
});
var i = function() {
return _ || a.selection.getRng()
};
a.on("paste", function(n) {
var r = (new Date).getTime(),
s = h(n),
l = (new Date).getTime() - r,
f = (new Date).getTime() - T - l < 1e3,
m = "text" == k.pasteFormat || S;
return S = !1, n.isDefaultPrevented() || b(n) ? void u() : !p(s) && y(n, i()) ? void u() : (f || n.preventDefault(), !e.ie || f && !n.ieFake || (c(), a.dom.bind(N, "paste", function(e) {
e.stopPropagation()
}), a.getDoc().execCommand("Paste", !1, null), s["text/html"] = d()), void(x(s, "text/html") ? (n.preventDefault(), t(s, f, m)) : o.setEditorTimeout(a, function() {
t(s, f, m)
}, 0)))
}), a.on("dragstart dragend", function(e) {
R = "dragstart" == e.type
}), a.on("drop", function(e) {
var t, i;
if (i = C(e), !e.isDefaultPrevented() && !R && (t = f(e.dataTransfer), (p(t) && !n(t) || !y(e, i)) && i && a.settings.paste_filter_drop !== !1)) {
var c = t["mce-internal"] || t["text/html"] || t["text/plain"];
c && (e.preventDefault(), o.setEditorTimeout(a, function() {
a.undoManager.transact(function() {
t["mce-internal"] && a.execCommand("Delete"), a.selection.setRng(i), c = r.trimHtml(c), t["text/html"] ? s(c) : l(c)
})
}))
}
}), a.on("dragover dragend", function(e) {
a.settings.paste_data_images && e.preventDefault()
})
}
var N, _, S, k = this,
T = 0,
R = !1,
A = "%MCEPASTEBIN%",
B = "data:text/mce-internal,",
D = r.createIdGenerator("mceclip");
k.pasteHtml = s, k.pasteText = l, k.pasteImageData = y, a.on("preInit", function() {
E(), a.parser.addNodeFilter("img", function(t, n, r) {
function i(e) {
return e.data && e.data.paste === !0
}
function o(t) {
t.attr("data-mce-object") || u === e.transparentSrc || t.remove()
}
function s(e) {
return 0 === e.indexOf("webkit-fake-url")
}
function l(e) {
return 0 === e.indexOf("data:")
}
if (!a.settings.paste_data_images && i(r))
for (var c = t.length; c--;) {
var u = t[c].attributes.map.src;
u && (s(u) ? o(t[c]) : !a.settings.allow_html_data_urls && l(u) && o(t[c]))
}
})
})
}
}), r("tinymce/pasteplugin/WordFilter", ["tinymce/util/Tools", "tinymce/html/DomParser", "tinymce/html/Schema", "tinymce/html/Serializer", "tinymce/html/Node", "tinymce/pasteplugin/Utils"], function(e, t, n, r, i, o) {
function a(e) {
return /<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e) || /class="OutlineElement/.test(e) || /id="?docs\-internal\-guid\-/.test(e)
}
function s(t) {
var n, r;
return r = [/^[IVXLMCD]{1,2}\.[ \u00a0]/, /^[ivxlmcd]{1,2}\.[ \u00a0]/, /^[a-z]{1,2}[\.\)][ \u00a0]/, /^[A-Z]{1,2}[\.\)][ \u00a0]/, /^[0-9]+\.[ \u00a0]/, /^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/, /^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/], t = t.replace(/^[\u00a0 ]+/, ""), e.each(r, function(e) {
if (e.test(t)) return n = !0, !1
}), n
}
function l(e) {
return /^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(e)
}
function c(c) {
var u = c.settings;
c.on("BeforePastePreProcess", function(d) {
function f(e) {
function t(e) {
var n = "";
if (3 === e.type) return e.value;
if (e = e.firstChild)
do n += t(e); while (e = e.next);
return n
}
function n(e, t) {
if (3 === e.type && t.test(e.value)) return e.value = e.value.replace(t, ""), !1;
if (e = e.firstChild)
do
if (!n(e, t)) return !1; while (e = e.next);
return !0
}
function r(e) {
if (e._listIgnore) return void e.remove();
if (e = e.firstChild)
do r(e); while (e = e.next)
}
function o(e, t, o) {
var s = e._listLevel || u;
s != u && (s < u ? a && (a = a.parent.parent) : (c = a, a = null)), a && a.name == t ? a.append(e) : (c = c || a, a = new i(t, 1), o > 1 && a.attr("start", "" + o), e.wrap(a)), e.name = "li", s > u && c && c.lastChild.append(a), u = s, r(e), n(e, /^\u00a0+/), n(e, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/), n(e, /^\u00a0+/)
}
for (var a, c, u = 1, d = [], f = e.firstChild;
"undefined" != typeof f && null !== f;)
if (d.push(f), f = f.walk(), null !== f)
for (;
"undefined" != typeof f && f.parent !== e;) f = f.walk();
for (var h = 0; h < d.length; h++)
if (e = d[h], "p" == e.name && e.firstChild) {
var p = t(e);
if (l(p)) {
o(e, "ul");
continue
}
if (s(p)) {
var m = /([0-9]+)\./.exec(p),
g = 1;
m && (g = parseInt(m[1], 10)), o(e, "ol", g);
continue
}
if (e._listLevel) {
o(e, "ul", 1);
continue
}
a = null
} else c = a, a = null
}
function h(t, n) {
var r, o = {},
a = c.dom.parseStyle(n);
return e.each(a, function(e, i) {
switch (i) {
case "mso-list":
r = /\w+ \w+([0-9]+)/i.exec(n), r && (t._listLevel = parseInt(r[1], 10)), /Ignore/i.test(e) && t.firstChild && (t._listIgnore = !0, t.firstChild._listIgnore = !0);
break;
case "horiz-align":
i = "text-align";
break;
case "vert-align":
i = "vertical-align";
break;
case "font-color":
case "mso-foreground":
i = "color";
break;
case "mso-background":
case "mso-highlight":
i = "background";
break;
case "font-weight":
case "font-style":
return void("normal" != e && (o[i] = e));
case "mso-element":
if (/^(comment|comment-list)$/i.test(e)) return void t.remove()
}
return 0 === i.indexOf("mso-comment") ? void t.remove() : void(0 !== i.indexOf("mso-") && ("all" == p || m && m[i]) && (o[i] = e))
}), /(bold)/i.test(o["font-weight"]) && (delete o["font-weight"], t.wrap(new i("b", 1))), /(italic)/i.test(o["font-style"]) && (delete o["font-style"], t.wrap(new i("i", 1))), o = c.dom.serializeStyle(o, t.name), o ? o : null
}
var p, m, g = d.content;
if (g = g.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi, ""), g = g.replace(/<br class="?Apple-interchange-newline"?>/gi, ""), p = u.paste_retain_style_properties, p && (m = e.makeMap(p.split(/[, ]/))), u.paste_enable_default_filters !== !1 && a(d.content)) {
d.wordContent = !0, g = o.filter(g, [/<!--[\s\S]+?-->/gi, /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, [/<(\/?)s>/gi, "<$1strike>"],
[/&nbsp;/gi, "\xa0"],
[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi, function(e, t) {
return t.length > 0 ? t.replace(/./, " ").slice(Math.floor(t.length / 2)).split("").join("\xa0") : ""
}]
]);
var v = u.paste_word_valid_elements;
v || (v = "-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody");
var y = new n({
valid_elements: v,
valid_children: "-li[p]"
});
e.each(y.elements, function(e) {
e.attributes.class || (e.attributes.class = {}, e.attributesOrder.push("class")), e.attributes.style || (e.attributes.style = {}, e.attributesOrder.push("style"))
});
var b = new t({}, y);
b.addAttributeFilter("style", function(e) {
for (var t, n = e.length; n--;) t = e[n], t.attr("style", h(t, t.attr("style"))), "span" == t.name && t.parent && !t.attributes.length && t.unwrap()
}), b.addAttributeFilter("class", function(e) {
for (var t, n, r = e.length; r--;) t = e[r], n = t.attr("class"), /^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n) && t.remove(), t.attr("class", null)
}), b.addNodeFilter("del", function(e) {
for (var t = e.length; t--;) e[t].remove()
}), b.addNodeFilter("a", function(e) {
for (var t, n, r, i = e.length; i--;)
if (t = e[i], n = t.attr("href"), r = t.attr("name"), n && n.indexOf("#_msocom_") != -1) t.remove();
else if (n && 0 === n.indexOf("file://") && (n = n.split("#")[1], n && (n = "#" + n)), n || r) {
if (r && !/^_?(?:toc|edn|ftn)/i.test(r)) {
t.unwrap();
continue
}
t.attr({
href: n,
name: r
})
} else t.unwrap()
});
var C = b.parse(g);
u.paste_convert_word_fake_lists !== !1 && f(C), d.content = new r({
validate: u.validate
}, y).serialize(C)
}
})
}
return c.isWordContent = a, c
}), r("tinymce/pasteplugin/Quirks", ["tinymce/Env", "tinymce/util/Tools", "tinymce/pasteplugin/WordFilter", "tinymce/pasteplugin/Utils"], function(e, t, n, r) {
return function(i) {
function o(e) {
i.on("BeforePastePreProcess", function(t) {
t.content = e(t.content)
})
}
function a(e) {
if (!n.isWordContent(e)) return e;
var o = [];
t.each(i.schema.getBlockElements(), function(e, t) {
o.push(t)
});
var a = new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?(" + o.join("|") + ")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*", "g");
return e = r.filter(e, [
[a, "$1"]
]), e = r.filter(e, [
[/<br><br>/g, "<BR><BR>"],
[/<br>/g, " "],
[/<BR><BR>/g, "<br>"]
])
}
function s(e) {
if (n.isWordContent(e)) return e;
var t = i.settings.paste_webkit_styles;
if (i.settings.paste_remove_styles_if_webkit === !1 || "all" == t) return e;
if (t && (t = t.split(/[, ]/)), t) {
var r = i.dom,
o = i.selection.getNode();
e = e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function(e, n, i, a) {
var s = r.parseStyle(i, "span"),
l = {};
if ("none" === t) return n + a;
for (var c = 0; c < t.length; c++) {
var u = s[t[c]],
d = r.getStyle(o, t[c], !0);
/color/.test(t[c]) && (u = r.toHex(u), d = r.toHex(d)), d != u && (l[t[c]] = u)
}
return l = r.serializeStyle(l, "span"), l ? n + ' style="' + l + '"' + a : n + a
})
} else e = e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, "$1$3");
return e = e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function(e, t, n, r) {
return t + ' style="' + n + '"' + r
})
}
e.webkit && o(s), e.ie && o(a)
}
}), r("tinymce/pasteplugin/Plugin", ["tinymce/PluginManager", "tinymce/pasteplugin/Clipboard", "tinymce/pasteplugin/WordFilter", "tinymce/pasteplugin/Quirks"], function(e, t, n, r) {
var i;
e.add("paste", function(o) {
function a() {
return i || o.settings.paste_plaintext_inform === !1
}
function s() {
if ("text" == c.pasteFormat) c.pasteFormat = "html", o.fire("PastePlainTextToggle", {
state: !1
});
else if (c.pasteFormat = "text", o.fire("PastePlainTextToggle", {
state: !0
}), !a()) {
var e = o.translate("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.");
o.notificationManager.open({
text: e,
type: "info"
}), i = !0
}
o.focus()
}
function l() {
var e = this;
e.active("text" === c.pasteFormat), o.on("PastePlainTextToggle", function(t) {
e.active(t.state)
})
}
var c, u = this,
d = o.settings;
return /(^|[ ,])powerpaste([, ]|$)/.test(d.plugins) && e.get("powerpaste") ? void("undefined" != typeof console && console.log && console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option.")) : (u.clipboard = c = new t(o), u.quirks = new r(o), u.wordFilter = new n(o), o.settings.paste_as_text && (u.clipboard.pasteFormat = "text"), d.paste_preprocess && o.on("PastePreProcess", function(e) {
d.paste_preprocess.call(u, u, e)
}), d.paste_postprocess && o.on("PastePostProcess", function(e) {
d.paste_postprocess.call(u, u, e)
}), o.addCommand("mceInsertClipboardContent", function(e, t) {
t.content && u.clipboard.pasteHtml(t.content), t.text && u.clipboard.pasteText(t.text)
}), o.settings.paste_block_drop && o.on("dragend dragover draggesture dragdrop drop drag", function(e) {
e.preventDefault(), e.stopPropagation()
}), o.settings.paste_data_images || o.on("drop", function(e) {
var t = e.dataTransfer;
t && t.files && t.files.length > 0 && e.preventDefault()
}), o.addCommand("mceTogglePlainTextPaste", s), o.addButton("pastetext", {
icon: "pastetext",
tooltip: "Paste as text",
onclick: s,
onPostRender: l
}), void o.addMenuItem("pastetext", {
text: "Paste as text",
selectable: !0,
active: c.pasteFormat,
onclick: s,
onPostRender: l
}))
})
}), o(["tinymce/pasteplugin/Utils"])
}(this);

View File

@@ -0,0 +1,42 @@
tinymce.PluginManager.add("preview", function(e) {
var t = e.settings,
n = !tinymce.Env.ie;
e.addCommand("mcePreview", function() {
e.windowManager.open({
title: "Preview",
width: parseInt(e.getParam("plugin_preview_width", "650"), 10),
height: parseInt(e.getParam("plugin_preview_height", "500"), 10),
html: '<iframe src="javascript:\'\'" frameborder="0"' + (n ? ' sandbox="allow-scripts"' : "") + "></iframe>",
buttons: {
text: "Close",
onclick: function() {
this.parent().parent().close()
}
},
onPostRender: function() {
var r, i = "";
i += '<base href="' + e.documentBaseURI.getURI() + '">', tinymce.each(e.contentCSS, function(t) {
i += '<link type="text/css" rel="stylesheet" href="' + e.documentBaseURI.toAbsolute(t) + '">'
});
var o = t.body_id || "tinymce";
o.indexOf("=") != -1 && (o = e.getParam("body_id", "", "hash"), o = o[e.id] || o);
var a = t.body_class || "";
a.indexOf("=") != -1 && (a = e.getParam("body_class", "", "hash"), a = a[e.id] || "");
var s = '<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A") {e.preventDefault();}}}, false);</script> ',
l = e.settings.directionality ? ' dir="' + e.settings.directionality + '"' : "";
if (r = "<!DOCTYPE html><html><head>" + i + '</head><body id="' + o + '" class="mce-content-body ' + a + '"' + l + ">" + e.getContent() + s + "</body></html>", n) this.getEl("body").firstChild.src = "data:text/html;charset=utf-8," + encodeURIComponent(r);
else {
var c = this.getEl("body").firstChild.contentWindow.document;
c.open(), c.write(r), c.close()
}
}
})
}), e.addButton("preview", {
title: "Preview",
cmd: "mcePreview"
}), e.addMenuItem("preview", {
text: "Preview",
cmd: "mcePreview",
context: "view"
})
});

View File

@@ -0,0 +1,14 @@
tinymce.PluginManager.add("print", function(e) {
e.addCommand("mcePrint", function() {
e.getWin().print()
}), e.addButton("print", {
title: "Print",
cmd: "mcePrint"
}), e.addShortcut("Meta+P", "", "mcePrint"), e.addMenuItem("print", {
text: "Print",
cmd: "mcePrint",
icon: "print",
shortcut: "Meta+P",
context: "file"
})
});

View File

@@ -0,0 +1,38 @@
tinymce.PluginManager.add("save", function(e) {
function t() {
var t;
if (t = tinymce.DOM.getParent(e.id, "form"), !e.getParam("save_enablewhendirty", !0) || e.isDirty()) return tinymce.triggerSave(), e.getParam("save_onsavecallback") ? (e.execCallback("save_onsavecallback", e), void e.nodeChanged()) : void(t ? (e.setDirty(!1), t.onsubmit && !t.onsubmit() || ("function" == typeof t.submit ? t.submit() : n(e.translate("Error: Form submit field collision."))), e.nodeChanged()) : n(e.translate("Error: No form element found.")))
}
function n(t) {
e.notificationManager.open({
text: t,
type: "error"
})
}
function r() {
var t = tinymce.trim(e.startContent);
return e.getParam("save_oncancelcallback") ? void e.execCallback("save_oncancelcallback", e) : (e.setContent(t), e.undoManager.clear(), void e.nodeChanged())
}
function i() {
var t = this;
e.on("nodeChange dirty", function() {
t.disabled(e.getParam("save_enablewhendirty", !0) && !e.isDirty())
})
}
e.addCommand("mceSave", t), e.addCommand("mceCancel", r), e.addButton("save", {
icon: "save",
text: "Save",
cmd: "mceSave",
disabled: !0,
onPostRender: i
}), e.addButton("cancel", {
text: "Cancel",
icon: !1,
cmd: "mceCancel",
disabled: !0,
onPostRender: i
}), e.addShortcut("Meta+S", "", "mceSave")
});

View File

@@ -0,0 +1,300 @@
! function() {
function e(e) {
return e && 1 == e.nodeType && "false" === e.contentEditable
}
function t(t, n, r, i, o) {
function a(e, t) {
if (t = t || 0, !e[0]) throw "findAndReplaceDOMText cannot handle zero-length matches";
var n = e.index;
if (t > 0) {
var r = e[t];
if (!r) throw "Invalid capture group";
n += e[0].indexOf(r), e[0] = r
}
return [n, n + e[0].length, [e[0]]]
}
function s(t) {
var n;
if (3 === t.nodeType) return t.data;
if (p[t.nodeName] && !h[t.nodeName]) return "";
if (n = "", e(t)) return "\n";
if ((h[t.nodeName] || m[t.nodeName]) && (n += "\n"), t = t.firstChild)
do n += s(t); while (t = t.nextSibling);
return n
}
function l(t, n, r) {
var i, o, a, s, l = [],
c = 0,
u = t,
d = n.shift(),
f = 0;
e: for (;;) {
if ((h[u.nodeName] || m[u.nodeName] || e(u)) && c++, 3 === u.nodeType && (!o && u.length + c >= d[1] ? (o = u, s = d[1] - c) : i && l.push(u), !i && u.length + c > d[0] && (i = u, a = d[0] - c), c += u.length), i && o) {
if (u = r({
startNode: i,
startNodeIndex: a,
endNode: o,
endNodeIndex: s,
innerNodes: l,
match: d[2],
matchIndex: f
}), c -= o.length - s, i = null, o = null, l = [], d = n.shift(), f++, !d) break
} else if (p[u.nodeName] && !h[u.nodeName] || !u.firstChild) {
if (u.nextSibling) {
u = u.nextSibling;
continue
}
} else if (!e(u)) {
u = u.firstChild;
continue
}
for (;;) {
if (u.nextSibling) {
u = u.nextSibling;
break
}
if (u.parentNode === t) break e;
u = u.parentNode
}
}
}
function c(e) {
var t;
if ("function" != typeof e) {
var n = e.nodeType ? e : f.createElement(e);
t = function(e, t) {
var r = n.cloneNode(!1);
return r.setAttribute("data-mce-index", t), e && r.appendChild(f.createTextNode(e)), r
}
} else t = e;
return function(e) {
var n, r, i, o = e.startNode,
a = e.endNode,
s = e.matchIndex;
if (o === a) {
var l = o;
i = l.parentNode, e.startNodeIndex > 0 && (n = f.createTextNode(l.data.substring(0, e.startNodeIndex)), i.insertBefore(n, l));
var c = t(e.match[0], s);
return i.insertBefore(c, l), e.endNodeIndex < l.length && (r = f.createTextNode(l.data.substring(e.endNodeIndex)), i.insertBefore(r, l)), l.parentNode.removeChild(l), c
}
n = f.createTextNode(o.data.substring(0, e.startNodeIndex)), r = f.createTextNode(a.data.substring(e.endNodeIndex));
for (var u = t(o.data.substring(e.startNodeIndex), s), d = [], h = 0, p = e.innerNodes.length; h < p; ++h) {
var m = e.innerNodes[h],
g = t(m.data, s);
m.parentNode.replaceChild(g, m), d.push(g)
}
var v = t(a.data.substring(0, e.endNodeIndex), s);
return i = o.parentNode, i.insertBefore(n, o), i.insertBefore(u, o), i.removeChild(o), i = a.parentNode, i.insertBefore(v, a), i.insertBefore(r, a), i.removeChild(a), v
}
}
var u, d, f, h, p, m, g = [],
v = 0;
if (f = n.ownerDocument, h = o.getBlockElements(), p = o.getWhiteSpaceElements(), m = o.getShortEndedElements(), d = s(n)) {
if (t.global)
for (; u = t.exec(d);) g.push(a(u, i));
else u = d.match(t), g.push(a(u, i));
return g.length && (v = g.length, l(n, g, c(r))), v
}
}
function n(e) {
function n() {
function t() {
o.statusbar.find("#next").disabled(!a(d + 1).length), o.statusbar.find("#prev").disabled(!a(d - 1).length)
}
function n() {
e.windowManager.alert("Could not find the specified string.", function() {
o.find("#find")[0].focus()
})
}
var r, i = {};
r = tinymce.trim(e.selection.getContent({
format: "text"
}));
var o = e.windowManager.open({
layout: "flex",
pack: "center",
align: "center",
onClose: function() {
e.focus(), u.done()
},
onSubmit: function(e) {
var r, s, l, c;
return e.preventDefault(), s = o.find("#case").checked(), c = o.find("#words").checked(), l = o.find("#find").value(), l.length ? i.text == l && i.caseState == s && i.wholeWord == c ? 0 === a(d + 1).length ? void n() : (u.next(), void t()) : (r = u.find(l, s, c), r || n(), o.statusbar.items().slice(1).disabled(0 === r), t(), void(i = {
text: l,
caseState: s,
wholeWord: c
})) : (u.done(!1), void o.statusbar.items().slice(1).disabled(!0))
},
buttons: [{
text: "Find",
subtype: "primary",
onclick: function() {
o.submit()
}
}, {
text: "Replace",
disabled: !0,
onclick: function() {
u.replace(o.find("#replace").value()) || (o.statusbar.items().slice(1).disabled(!0), d = -1, i = {})
}
}, {
text: "Replace all",
disabled: !0,
onclick: function() {
u.replace(o.find("#replace").value(), !0, !0), o.statusbar.items().slice(1).disabled(!0), i = {}
}
}, {
type: "spacer",
flex: 1
}, {
text: "Prev",
name: "prev",
disabled: !0,
onclick: function() {
u.prev(), t()
}
}, {
text: "Next",
name: "next",
disabled: !0,
onclick: function() {
u.next(), t()
}
}],
title: "Find and replace",
items: {
type: "form",
padding: 20,
labelGap: 30,
spacing: 10,
items: [{
type: "textbox",
name: "find",
size: 40,
label: "Find",
value: r
}, {
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: " "
}]
}
})
}
function r(e) {
var t = e.getAttribute("data-mce-index");
return "number" == typeof t ? "" + t : t
}
function i(n) {
var r, i;
return i = e.dom.create("span", {
"data-mce-bogus": 1
}), i.className = "mce-match-marker", r = e.getBody(), u.done(!1), t(n, r, i, !1, e.schema)
}
function o(e) {
var t = e.parentNode;
e.firstChild && t.insertBefore(e.firstChild, e), e.parentNode.removeChild(e)
}
function a(t) {
var n, i = [];
if (n = tinymce.toArray(e.getBody().getElementsByTagName("span")), n.length)
for (var o = 0; o < n.length; o++) {
var a = r(n[o]);
null !== a && a.length && a === t.toString() && i.push(n[o])
}
return i
}
function s(t) {
var n = d,
r = e.dom;
t = t !== !1, t ? n++ : n--, r.removeClass(a(d), "mce-match-marker-selected");
var i = a(n);
return i.length ? (r.addClass(a(n), "mce-match-marker-selected"), e.selection.scrollIntoView(i[0]), n) : -1
}
function l(t) {
var n = e.dom,
r = t.parentNode;
n.remove(t), n.isEmpty(r) && n.remove(r)
}
function c(e) {
var t = r(e);
return null !== t && t.length > 0
}
var u = this,
d = -1;
u.init = function(e) {
e.addMenuItem("searchreplace", {
text: "Find and replace",
shortcut: "Meta+F",
onclick: n,
separator: "before",
context: "edit"
}), e.addButton("searchreplace", {
tooltip: "Find and replace",
shortcut: "Meta+F",
onclick: n
}), e.addCommand("SearchReplace", n), e.shortcuts.add("Meta+F", "", n)
}, u.find = function(e, t, n) {
e = e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), e = n ? "\\b" + e + "\\b" : e;
var r = i(new RegExp(e, t ? "g" : "gi"));
return r && (d = -1, d = s(!0)), r
}, u.next = function() {
var e = s(!0);
e !== -1 && (d = e)
}, u.prev = function() {
var e = s(!1);
e !== -1 && (d = e)
}, u.replace = function(t, n, i) {
var s, f, h, p, m, g, v = d;
for (n = n !== !1, h = e.getBody(), f = tinymce.grep(tinymce.toArray(h.getElementsByTagName("span")), c), s = 0; s < f.length; s++) {
var y = r(f[s]);
if (p = m = parseInt(y, 10), i || p === d) {
for (t.length ? (f[s].firstChild.nodeValue = t, o(f[s])) : l(f[s]); f[++s];) {
if (p = parseInt(r(f[s]), 10), p !== m) {
s--;
break
}
l(f[s])
}
n && v--
} else m > d && f[s].setAttribute("data-mce-index", m - 1)
}
return e.undoManager.add(), d = v, n ? (g = a(v + 1).length > 0, u.next()) : (g = a(v - 1).length > 0, u.prev()), !i && g
}, u.done = function(t) {
var n, i, a, s;
for (i = tinymce.toArray(e.getBody().getElementsByTagName("span")), n = 0; n < i.length; n++) {
var l = r(i[n]);
null !== l && l.length && (l === d.toString() && (a || (a = i[n].firstChild), s = i[n].firstChild), o(i[n]))
}
if (a && s) {
var c = e.dom.createRng();
return c.setStart(a, 0), c.setEnd(s, s.data.length), t !== !1 && e.selection.setRng(c), c
}
}
}
tinymce.PluginManager.add("searchreplace", n)
}();

View File

@@ -0,0 +1,150 @@
tinymce.PluginManager.add("template", function(e) {
function t(t) {
return function() {
var n = e.settings.templates;
return "function" == typeof n ? void n(t) : void("string" == typeof n ? tinymce.util.XHR.send({
url: n,
success: function(e) {
t(tinymce.util.JSON.parse(e))
}
}) : t(n))
}
}
function n(t) {
function n(t) {
function n(t) {
if (t.indexOf("<html>") == -1) {
var n = "";
tinymce.each(e.contentCSS, function(t) {
n += '<link type="text/css" rel="stylesheet" href="' + e.documentBaseURI.toAbsolute(t) + '">'
});
var i = e.settings.body_class || "";
i.indexOf("=") != -1 && (i = e.getParam("body_class", "", "hash"), i = i[e.id] || ""), t = "<!DOCTYPE html><html><head>" + n + '</head><body class="' + i + '">' + t + "</body></html>"
}
t = o(t, "template_preview_replace_values");
var a = r.find("iframe")[0].getEl().contentWindow.document;
a.open(), a.write(t), a.close()
}
var a = t.control.value();
a.url ? tinymce.util.XHR.send({
url: a.url,
success: function(e) {
i = e, n(i)
}
}) : (i = a.content, n(i)), r.find("#description")[0].text(t.control.value().description)
}
var r, i, s = [];
if (!t || 0 === t.length) {
var l = e.translate("No templates defined.");
return void e.notificationManager.open({
text: l,
type: "info"
})
}
tinymce.each(t, function(e) {
s.push({
selected: !s.length,
text: e.title,
value: {
url: e.url,
content: e.content,
description: e.description
}
})
}), r = e.windowManager.open({
title: "Insert template",
layout: "flex",
direction: "column",
align: "stretch",
padding: 15,
spacing: 10,
items: [{
type: "form",
flex: 0,
padding: 0,
items: [{
type: "container",
label: "Templates",
items: {
type: "listbox",
label: "Templates",
name: "template",
values: s,
onselect: n
}
}]
}, {
type: "label",
name: "description",
label: "Description",
text: "\xa0"
}, {
type: "iframe",
flex: 1,
border: 1
}],
onsubmit: function() {
a(!1, i)
},
minWidth: Math.min(tinymce.DOM.getViewPort().w, e.getParam("template_popup_width", 600)),
minHeight: Math.min(tinymce.DOM.getViewPort().h, e.getParam("template_popup_height", 500))
}), r.find("listbox")[0].fire("select")
}
function r(t, n) {
function r(e, t) {
if (e = "" + e, e.length < t)
for (var n = 0; n < t - e.length; n++) e = "0" + e;
return e
}
var i = "Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),
o = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),
a = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
s = "January February March April May June July August September October November December".split(" ");
return n = n || new Date, t = t.replace("%D", "%m/%d/%Y"), t = t.replace("%r", "%I:%M:%S %p"), t = t.replace("%Y", "" + n.getFullYear()), t = t.replace("%y", "" + n.getYear()), t = t.replace("%m", r(n.getMonth() + 1, 2)), t = t.replace("%d", r(n.getDate(), 2)), t = t.replace("%H", "" + r(n.getHours(), 2)), t = t.replace("%M", "" + r(n.getMinutes(), 2)), t = t.replace("%S", "" + r(n.getSeconds(), 2)), t = t.replace("%I", "" + ((n.getHours() + 11) % 12 + 1)), t = t.replace("%p", "" + (n.getHours() < 12 ? "AM" : "PM")), t = t.replace("%B", "" + e.translate(s[n.getMonth()])), t = t.replace("%b", "" + e.translate(a[n.getMonth()])), t = t.replace("%A", "" + e.translate(o[n.getDay()])), t = t.replace("%a", "" + e.translate(i[n.getDay()])), t = t.replace("%%", "%")
}
function i(t) {
var n = e.dom,
r = e.getParam("template_replace_values");
s(n.select("*", t), function(e) {
s(r, function(t, i) {
n.hasClass(e, i) && "function" == typeof r[i] && r[i](e)
})
})
}
function o(t, n) {
return s(e.getParam(n), function(e, n) {
"function" == typeof e && (e = e(n)), t = t.replace(new RegExp("\\{\\$" + n + "\\}", "g"), e)
}), t
}
function a(t, n) {
function a(e, t) {
return new RegExp("\\b" + t + "\\b", "g").test(e.className)
}
var l, c, u = e.dom,
d = e.selection.getContent();
n = o(n, "template_replace_values"), l = u.create("div", null, n), c = u.select(".mceTmpl", l), c && c.length > 0 && (l = u.create("div", null), l.appendChild(c[0].cloneNode(!0))), s(u.select("*", l), function(t) {
a(t, e.getParam("template_cdate_classes", "cdate").replace(/\s+/g, "|")) && (t.innerHTML = r(e.getParam("template_cdate_format", e.getLang("template.cdate_format")))), a(t, e.getParam("template_mdate_classes", "mdate").replace(/\s+/g, "|")) && (t.innerHTML = r(e.getParam("template_mdate_format", e.getLang("template.mdate_format")))), a(t, e.getParam("template_selected_content_classes", "selcontent").replace(/\s+/g, "|")) && (t.innerHTML = d)
}), i(l), e.execCommand("mceInsertContent", !1, l.innerHTML), e.addVisual()
}
var s = tinymce.each;
e.addCommand("mceInsertTemplate", a), e.addButton("template", {
title: "Insert template",
onclick: t(n)
}), e.addMenuItem("template", {
text: "Template",
onclick: t(n),
context: "insert"
}), e.on("PreProcess", function(t) {
var n = e.dom;
s(n.select("div", t.node), function(t) {
n.hasClass(t, "mceTmpl") && (s(n.select("*", t), function(t) {
n.hasClass(t, e.getParam("template_mdate_classes", "mdate").replace(/\s+/g, "|")) && (t.innerHTML = r(e.getParam("template_mdate_format", e.getLang("template.mdate_format"))))
}), i(t))
})
})
});

View File

@@ -0,0 +1,117 @@
tinymce.PluginManager.add("textcolor", function(e) {
function t(t) {
var n;
return e.dom.getParents(e.selection.getStart(), function(e) {
var r;
(r = e.style["forecolor" == t ? "color" : "background-color"]) && (n = r)
}), n
}
function n(t) {
var n, r, i = [];
for (r = ["000000", "Black", "993300", "Burnt orange", "333300", "Dark olive", "003300", "Dark green", "003366", "Dark azure", "000080", "Navy Blue", "333399", "Indigo", "333333", "Very dark gray", "800000", "Maroon", "FF6600", "Orange", "808000", "Olive", "008000", "Green", "008080", "Teal", "0000FF", "Blue", "666699", "Grayish blue", "808080", "Gray", "FF0000", "Red", "FF9900", "Amber", "99CC00", "Yellow green", "339966", "Sea green", "33CCCC", "Turquoise", "3366FF", "Royal blue", "800080", "Purple", "999999", "Medium gray", "FF00FF", "Magenta", "FFCC00", "Gold", "FFFF00", "Yellow", "00FF00", "Lime", "00FFFF", "Aqua", "00CCFF", "Sky blue", "993366", "Red violet", "FFFFFF", "White", "FF99CC", "Pink", "FFCC99", "Peach", "FFFF99", "Light yellow", "CCFFCC", "Pale green", "CCFFFF", "Pale cyan", "99CCFF", "Light sky blue", "CC99FF", "Plum"], r = e.settings.textcolor_map || r, r = e.settings[t + "_map"] || r, n = 0; n < r.length; n += 2) i.push({
text: r[n + 1],
color: "#" + r[n]
});
return i
}
function r() {
function t(e, t) {
var n = "transparent" == e;
return '<td class="mce-grid-cell' + (n ? " mce-colorbtn-trans" : "") + '"><div id="' + p + "-" + m++ + '" data-mce-color="' + (e ? e : "") + '" role="option" tabIndex="-1" style="' + (e ? "background-color: " + e : "") + '" title="' + tinymce.translate(t) + '">' + (n ? "&#215;" : "") + "</div></td>"
}
var r, i, o, a, s, u, d, f, h = this,
p = h._id,
m = 0;
for (f = h.settings.origin, r = n(f), r.push({
text: tinymce.translate("No color"),
color: "transparent"
}), o = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>', a = r.length - 1, u = 0; u < c[f]; u++) {
for (o += "<tr>", s = 0; s < l[f]; s++) d = u * l[f] + s, d > a ? o += "<td></td>" : (i = r[d], o += t(i.color, i.text));
o += "</tr>"
}
if (e.settings.color_picker_callback) {
for (o += '<tr><td colspan="' + l[f] + '" class="mce-custom-color-btn"><div id="' + p + '-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="' + p + '-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">' + tinymce.translate("Custom...") + "</button></div></td></tr>", o += "<tr>", s = 0; s < l[f]; s++) o += t("", "Custom color");
o += "</tr>"
}
return o += "</tbody></table>"
}
function i(t, n) {
e.undoManager.transact(function() {
e.focus(), e.formatter.apply(t, {
value: n
}), e.nodeChanged()
})
}
function o(t) {
e.undoManager.transact(function() {
e.focus(), e.formatter.remove(t, {
value: null
}, null, !0), e.nodeChanged()
})
}
function a(n) {
function r(e) {
d.hidePanel(), d.color(e), i(d.settings.format, e)
}
function a() {
d.hidePanel(), d.resetColor(), o(d.settings.format)
}
function s(e, t) {
e.style.background = t, e.setAttribute("data-mce-color", t)
}
var c, u, d = this.parent();
u = d.settings.origin, tinymce.DOM.getParent(n.target, ".mce-custom-color-btn") && (d.hidePanel(), e.settings.color_picker_callback.call(e, function(e) {
var t, n, i, o = d.panel.getEl().getElementsByTagName("table")[0];
for (t = tinymce.map(o.rows[o.rows.length - 1].childNodes, function(e) {
return e.firstChild
}), i = 0; i < t.length && (n = t[i], n.getAttribute("data-mce-color")); i++);
if (i == l[u])
for (i = 0; i < l[u] - 1; i++) s(t[i], t[i + 1].getAttribute("data-mce-color"));
s(n, e), r(e)
}, t(d.settings.format))), c = n.target.getAttribute("data-mce-color"), c ? (this.lastId && document.getElementById(this.lastId).setAttribute("aria-selected", !1), n.target.setAttribute("aria-selected", !0), this.lastId = n.target.id, "transparent" == c ? a() : r(c)) : null !== c && d.hidePanel()
}
function s() {
var e = this;
e._color ? i(e.settings.format, e._color) : o(e.settings.format)
}
var l, c;
c = {
forecolor: e.settings.forecolor_rows || e.settings.textcolor_rows || 5,
backcolor: e.settings.backcolor_rows || e.settings.textcolor_rows || 5
}, l = {
forecolor: e.settings.forecolor_cols || e.settings.textcolor_cols || 8,
backcolor: e.settings.backcolor_cols || e.settings.textcolor_cols || 8
}, e.addButton("forecolor", {
type: "colorbutton",
tooltip: "Text color",
format: "forecolor",
panel: {
origin: "forecolor",
role: "application",
ariaRemember: !0,
html: r,
onclick: a
},
onclick: s
}), e.addButton("backcolor", {
type: "colorbutton",
tooltip: "Background color",
format: "hilitecolor",
panel: {
origin: "backcolor",
role: "application",
ariaRemember: !0,
html: r,
onclick: a
},
onclick: s
})
});

View File

@@ -0,0 +1,97 @@
tinymce.PluginManager.add("textpattern", function(e) {
function t() {
return c && (l.sort(function(e, t) {
return e.start.length > t.start.length ? -1 : e.start.length < t.start.length ? 1 : 0
}), c = !1), l
}
function n(e) {
for (var n = t(), r = 0; r < n.length; r++)
if (0 === e.indexOf(n[r].start) && (!n[r].end || e.lastIndexOf(n[r].end) == e.length - n[r].end.length)) return n[r]
}
function r(e, n, r) {
var i, o, a;
for (i = t(), a = 0; a < i.length; a++)
if (o = i[a], o.end && e.substr(n - o.end.length - r, o.end.length) == o.end) return o
}
function i(t) {
function i() {
l = l.splitText(u), l.splitText(c - u - p), l.deleteData(0, h.start.length), l.deleteData(l.data.length - h.end.length, h.end.length)
}
var o, a, s, l, c, u, d, f, h, p, m;
if (o = e.selection, a = e.dom, o.isCollapsed() && (s = o.getRng(!0), l = s.startContainer, c = s.startOffset, d = l.data, p = t ? 1 : 0, 3 == l.nodeType && (h = r(d, c, p), h && (u = Math.max(0, c - p), u = d.lastIndexOf(h.start, u - h.end.length - 1), u !== -1 && (f = a.createRng(), f.setStart(l, u), f.setEnd(l, c - p), h = n(f.toString()), h && h.end && !(l.data.length <= h.start.length + h.end.length)))))) return m = e.formatter.get(h.format), m && m[0].inline ? (i(), e.formatter.apply(h.format, {}, l), l) : void 0
}
function o() {
var t, r, i, o, a, s, l, c, u, d, f;
if (t = e.selection, r = e.dom, t.isCollapsed() && (l = r.getParent(t.getStart(), "p"))) {
for (u = new tinymce.dom.TreeWalker(l, l); a = u.next();)
if (3 == a.nodeType) {
o = a;
break
}
if (o) {
if (c = n(o.data), !c) return;
if (d = t.getRng(!0), i = d.startContainer, f = d.startOffset, o == i && (f = Math.max(0, f - c.start.length)), tinymce.trim(o.data).length == c.start.length) return;
c.format && (s = e.formatter.get(c.format), s && s[0].block && (o.deleteData(0, c.start.length), e.formatter.apply(c.format, {}, o), d.setStart(i, f), d.collapse(!0), t.setRng(d))), c.cmd && e.undoManager.transact(function() {
o.deleteData(0, c.start.length), e.execCommand(c.cmd)
})
}
}
}
function a() {
var t, n;
n = i(), n && (t = e.dom.createRng(), t.setStart(n, n.data.length), t.setEnd(n, n.data.length), e.selection.setRng(t)), o()
}
function s() {
var t, n, r, o, a;
t = i(!0), t && (a = e.dom, n = t.data.slice(-1), /[\u00a0 ]/.test(n) && (t.deleteData(t.data.length - 1, 1), r = a.doc.createTextNode(n), t.nextSibling ? a.insertAfter(r, t.nextSibling) : t.parentNode.appendChild(r), o = a.createRng(), o.setStart(r, 1), o.setEnd(r, 1), e.selection.setRng(o)))
}
var l, c = !0;
l = e.settings.textpattern_patterns || [{
start: "*",
end: "*",
format: "italic"
}, {
start: "**",
end: "**",
format: "bold"
}, {
start: "#",
format: "h1"
}, {
start: "##",
format: "h2"
}, {
start: "###",
format: "h3"
}, {
start: "####",
format: "h4"
}, {
start: "#####",
format: "h5"
}, {
start: "######",
format: "h6"
}, {
start: "1. ",
cmd: "InsertOrderedList"
}, {
start: "* ",
cmd: "InsertUnorderedList"
}, {
start: "- ",
cmd: "InsertUnorderedList"
}], e.on("keydown", function(e) {
13 != e.keyCode || tinymce.util.VK.modifierPressed(e) || a()
}, !0), e.on("keyup", function(e) {
32 != e.keyCode || tinymce.util.VK.modifierPressed(e) || s()
}), this.getPatterns = t, this.setPatterns = function(e) {
l = e, c = !0
}
});

View File

@@ -0,0 +1,130 @@
tinymce.PluginManager.add("toc", function(e) {
function t(t) {
return e.schema.isValidChild("div", t)
}
function n(t) {
return t && e.dom.is(t, "." + d.className) && e.getBody().contains(t)
}
function r() {
var t = this;
t.disabled(e.readonly || !o()), e.on("LoadContent SetContent change", function() {
t.disabled(e.readonly || !o())
})
}
function i(e) {
var t, n = [];
for (t = 1; t <= e; t++) n.push("h" + t);
return n.join(",")
}
function o() {
return !(!d || !a(d).length)
}
function a(t) {
var n = i(t.depth),
r = f(n);
return r.length && /^h[1-9]$/i.test(t.headerTag) && (r = r.filter(function(n, r) {
return !e.dom.hasClass(r.parentNode, t.className)
})), tinymce.map(r, function(e) {
return e.id || (e.id = m()), {
id: e.id,
level: parseInt(e.nodeName.replace(/^H/i, ""), 10),
title: f.text(e)
}
})
}
function s(e) {
var t, n = 9;
for (t = 0; t < e.length; t++)
if (e[t].level < n && (n = e[t].level), 1 == n) return n;
return n
}
function l(t, n) {
var r = "<" + t + ' contenteditable="true">',
i = "</" + t + ">";
return r + e.dom.encode(n) + i
}
function c(e) {
var t = u(e);
return '<div class="' + e.className + '" contenteditable="false">' + t + "</div>"
}
function u(e) {
var t, n, r, i, o = "",
c = a(e),
u = s(c) - 1;
if (!c.length) return "";
for (o += l(e.headerTag, tinymce.translate("Table of Contents")), t = 0; t < c.length; t++) {
if (r = c[t], i = c[t + 1] && c[t + 1].level, u === r.level) o += "<li>";
else
for (n = u; n < r.level; n++) o += "<ul><li>";
if (o += '<a href="#' + r.id + '">' + r.title + "</a>", i !== r.level && i)
for (n = r.level; n > i; n--) o += "</li></ul><li>";
else o += "</li>", i || (o += "</ul>");
u = r.level
}
return o
}
var d, f = e.$,
h = {
depth: 3,
headerTag: "h2",
className: "mce-toc"
},
p = function(e) {
var t = 0;
return function() {
var n = (new Date).getTime().toString(32);
return e + n + (t++).toString(32)
}
},
m = p("mcetoc_");
e.on("PreInit", function() {
var n = e.settings,
r = parseInt(n.toc_depth, 10) || 0;
d = {
depth: r >= 1 && r <= 9 ? r : h.depth,
headerTag: t(n.toc_header) ? n.toc_header : h.headerTag,
className: n.toc_class ? e.dom.encode(n.toc_class) : h.className
}
}), e.on("PreProcess", function(e) {
var t = f("." + d.className, e.node);
t.length && (t.removeAttr("contentEditable"), t.find("[contenteditable]").removeAttr("contentEditable"))
}), e.on("SetContent", function() {
var e = f("." + d.className);
e.length && (e.attr("contentEditable", !1), e.children(":first-child").attr("contentEditable", !0))
});
var g = function(t) {
return !t.length || e.dom.getParents(t[0], ".mce-offscreen-selection").length > 0
};
e.addCommand("mceInsertToc", function() {
var t = f("." + d.className);
g(t) ? e.insertContent(c(d)) : e.execCommand("mceUpdateToc")
}), e.addCommand("mceUpdateToc", function() {
var t = f("." + d.className);
t.length && e.undoManager.transact(function() {
t.html(u(d))
})
}), e.addButton("toc", {
tooltip: "Table of Contents",
cmd: "mceInsertToc",
icon: "toc",
onPostRender: r
}), e.addButton("tocupdate", {
tooltip: "Update",
cmd: "mceUpdateToc",
icon: "reload"
}), e.addContextToolbar(n, "tocupdate"), e.addMenuItem("toc", {
text: "Table of Contents",
context: "insert",
cmd: "mceInsertToc",
onPostRender: r
})
});

View File

@@ -0,0 +1,36 @@
tinymce.PluginManager.add("visualblocks", function(e, t) {
function n() {
var t = this;
t.active(o), e.on("VisualBlocks", function() {
t.active(e.dom.hasClass(e.getBody(), "mce-visualblocks"))
})
}
var r, i, o;
window.NodeList && (e.addCommand("mceVisualBlocks", function() {
var n, a = e.dom;
r || (r = a.uniqueId(), n = a.create("link", {
id: r,
rel: "stylesheet",
href: t + "/css/visualblocks.css"
}), e.getDoc().getElementsByTagName("head")[0].appendChild(n)), e.on("PreviewFormats AfterPreviewFormats", function(t) {
o && a.toggleClass(e.getBody(), "mce-visualblocks", "afterpreviewformats" == t.type)
}), a.toggleClass(e.getBody(), "mce-visualblocks"), o = e.dom.hasClass(e.getBody(), "mce-visualblocks"), i && i.active(a.hasClass(e.getBody(), "mce-visualblocks")), e.fire("VisualBlocks")
}), e.addButton("visualblocks", {
title: "Show blocks",
cmd: "mceVisualBlocks",
onPostRender: n
}), e.addMenuItem("visualblocks", {
text: "Show blocks",
cmd: "mceVisualBlocks",
onPostRender: n,
selectable: !0,
context: "view",
prependToContext: !0
}), e.on("init", function() {
e.settings.visualblocks_default_state && e.execCommand("mceVisualBlocks", !1, null, {
skip_focus: !0
})
}), e.on("remove", function() {
e.dom.removeClass(e.getBody(), "mce-visualblocks")
}))
});

View File

@@ -0,0 +1,55 @@
tinymce.PluginManager.add("visualchars", function(e) {
function t(t) {
function n(e) {
return '<span data-mce-bogus="1" class="mce-' + h[e] + '">' + e + "</span>"
}
function o() {
var e, t = "";
for (e in h) t += e;
return new RegExp("[" + t + "]", "g")
}
function a() {
var e, t = "";
for (e in h) t && (t += ","), t += "span.mce-" + h[e];
return t
}
var s, l, c, u, d, f, h, p, m = e.getBody(),
g = e.selection;
if (h = {
"\xa0": "nbsp",
"\xad": "shy"
}, r = !r, i.state = r, e.fire("VisualChars", {
state: r
}), p = o(), t && (f = g.getBookmark()), r)
for (l = [], tinymce.walk(m, function(e) {
3 == e.nodeType && e.nodeValue && p.test(e.nodeValue) && l.push(e)
}, "childNodes"), c = 0; c < l.length; c++) {
for (u = l[c].nodeValue, u = u.replace(p, n), d = e.dom.create("div", null, u); s = d.lastChild;) e.dom.insertAfter(s, l[c]);
e.dom.remove(l[c])
} else
for (l = e.dom.select(a(), m), c = l.length - 1; c >= 0; c--) e.dom.remove(l[c], 1);
g.moveToBookmark(f)
}
function n() {
var t = this;
e.on("VisualChars", function(e) {
t.active(e.state)
})
}
var r, i = this;
e.addCommand("mceVisualChars", t), e.addButton("visualchars", {
title: "Show invisible characters",
cmd: "mceVisualChars",
onPostRender: n
}), e.addMenuItem("visualchars", {
text: "Show invisible characters",
cmd: "mceVisualChars",
onPostRender: n,
selectable: !0,
context: "view",
prependToContext: !0
})
});

View File

@@ -0,0 +1,191 @@
! function() {
var e = {},
t = function(t) {
for (var n = e[t], i = n.deps, o = n.defn, a = i.length, s = new Array(a), l = 0; l < a; ++l) s[l] = r(i[l]);
var c = o.apply(null, s);
if (void 0 === c) throw "module [" + t + "] returned undefined";
n.instance = c
},
n = function(t, n, r) {
if ("string" != typeof t) throw "module id must be a string";
if (void 0 === n) throw "no dependencies for " + t;
if (void 0 === r) throw "no definition function for " + t;
e[t] = {
deps: n,
defn: r,
instance: void 0
}
},
r = function(n) {
var r = e[n];
if (void 0 === r) throw "module [" + n + "] was undefined";
return void 0 === r.instance && t(n), r.instance
},
i = function(e, t) {
for (var n = e.length, i = new Array(n), o = 0; o < n; ++o) i.push(r(e[o]));
t.apply(null, t)
},
o = {};
o.bolt = {
module: {
api: {
define: n,
require: i,
demand: r
}
}
};
var a = n,
s = function(e, t) {
a(e, [], function() {
return t
})
};
s("1", tinymce.PluginManager), s("2", tinymce.util.Delay), a("4", [], function() {
var e = {
aletter: "[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]",
midnumlet: "['\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]",
midletter: "[:\xb7\xb7\u05f4\u2027\ufe13\ufe55\uff1a]",
midnum: "[,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]",
numeric: "[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]",
cr: "\\r",
lf: "\\n",
newline: "[\v\f\x85\u2028\u2029]",
extend: "[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]",
format: "[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]",
katakana: "[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]",
extendnumlet: "[_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f]",
punctuation: "[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]"
},
t = {
ALETTER: 0,
MIDNUMLET: 1,
MIDLETTER: 2,
MIDNUM: 3,
NUMERIC: 4,
CR: 5,
LF: 6,
NEWLINE: 7,
EXTEND: 8,
FORMAT: 9,
KATAKANA: 10,
EXTENDNUMLET: 11,
OTHER: 12
},
n = [new RegExp(e.aletter), new RegExp(e.midnumlet), new RegExp(e.midletter), new RegExp(e.midnum), new RegExp(e.numeric), new RegExp(e.cr), new RegExp(e.lf), new RegExp(e.newline), new RegExp(e.extend), new RegExp(e.format), new RegExp(e.katakana), new RegExp(e.extendnumlet)],
r = "",
i = new RegExp("^" + e.punctuation + "$"),
o = /\s/;
return {
characterIndices: t,
SETS: n,
EMPTY_STRING: r,
PUNCTUATION: i,
WHITESPACE: o
}
}), a("7", [], function() {
var e = function(e, t, n) {
var r, i;
if (!e) return 0;
if (n = n || e, void 0 !== e.length) {
for (r = 0, i = e.length; r < i; r++)
if (t.call(n, e[r], r, e) === !1) return 0
} else
for (r in e)
if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1) return 0;
return 1
},
t = function(t, n) {
var r = [];
return e(t, function(e, i) {
r.push(n(e, i, t))
}), r
};
return {
each: e,
map: t
}
}), a("5", ["4", "7"], function(e, t) {
var n = e.SETS,
r = e.characterIndices.OTHER,
i = function(e) {
var t, i, o = r,
a = n.length;
for (t = 0; t < a; ++t)
if (i = n[t], i && i.test(e)) {
o = t;
break
}
return o
},
o = function(e) {
var t = {};
return function(n) {
if (t[n]) return t[n];
var r = e(n);
return t[n] = r, r
}
},
a = function(e) {
var n = o(i);
return t.map(e.split(""), n)
};
return {
classify: a
}
}), a("6", ["4"], function(e) {
var t = e.characterIndices,
n = function(e, n) {
var r, i, o = e[n],
a = e[n + 1];
return !(n < 0 || n > e.length - 1 && 0 !== n) && ((o !== t.ALETTER || a !== t.ALETTER) && (i = e[n + 2], (o !== t.ALETTER || a !== t.MIDLETTER && a !== t.MIDNUMLET || i !== t.ALETTER) && (r = e[n - 1], (o !== t.MIDLETTER && o !== t.MIDNUMLET || a !== t.ALETTER || r !== t.ALETTER) && ((o !== t.NUMERIC && o !== t.ALETTER || a !== t.NUMERIC && a !== t.ALETTER) && ((o !== t.MIDNUM && o !== t.MIDNUMLET || a !== t.NUMERIC || r !== t.NUMERIC) && ((o !== t.NUMERIC || a !== t.MIDNUM && a !== t.MIDNUMLET || i !== t.NUMERIC) && (o !== t.EXTEND && o !== t.FORMAT && r !== t.EXTEND && r !== t.FORMAT && a !== t.EXTEND && a !== t.FORMAT && ((o !== t.CR || a !== t.LF) && (o === t.NEWLINE || o === t.CR || o === t.LF || (a === t.NEWLINE || a === t.CR || a === t.LF || (o !== t.KATAKANA || a !== t.KATAKANA) && ((a !== t.EXTENDNUMLET || o !== t.ALETTER && o !== t.NUMERIC && o !== t.KATAKANA && o !== t.EXTENDNUMLET) && (o !== t.EXTENDNUMLET || a !== t.ALETTER && a !== t.NUMERIC && a !== t.KATAKANA))))))))))))
};
return {
isWordBoundary: n
}
}), a("3", ["4", "5", "6"], function(e, t, n) {
var r = e.EMPTY_STRING,
i = e.WHITESPACE,
o = e.PUNCTUATION,
a = function(e, a) {
var s, l, c, u = 0,
d = t.classify(e),
f = d.length,
h = [],
p = [];
for (a || (a = {}), a.ignoreCase && (e = e.toLowerCase()), l = a.includePunctuation, c = a.includeWhitespace; u < f; ++u) s = e.charAt(u), h.push(s), n.isWordBoundary(d, u) && (h = h.join(r), !h || !c && i.test(h) || !l && o.test(h) || p.push(h), h = []);
return p
};
return {
getWords: a
}
}), a("0", ["1", "2", "3"], function(e, t, n) {
return e.add("wordcount", function(e) {
var r = function(e) {
return e.removed ? "" : e.getBody().innerText
},
i = function() {
return n.getWords(r(e)).length
},
o = function() {
e.theme.panel.find("#wordcount").text(["Words: {0}", i()])
};
return e.on("init", function() {
var n = e.theme.panel && e.theme.panel.find("#statusbar")[0],
r = t.debounce(o, 300);
n && tinymce.util.Delay.setEditorTimeout(e, function() {
n.insert({
type: "label",
name: "wordcount",
text: ["Words: {0}", i()],
classes: "wordcount",
disabled: e.settings.readonly
}, 0), e.on("setcontent beforeaddundo undo redo keyup", r)
}, 0)
}), {
getCount: i
}
}),
function() {}
}), r("0")()
}();

View File

@@ -0,0 +1,217 @@
body {
background-color: #FFFFFF;
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
scrollbar-darkshadow-color: #DDDDDD;
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
scrollbar-track-color: #F5F5F5
}
td,
th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px
}
.mce-content-body .mce-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
vertical-align: top;
background: transparent;
text-decoration: none;
color: black;
font-family: Arial;
font-size: 11px;
text-shadow: none;
float: none;
position: static;
width: auto;
height: auto;
white-space: nowrap;
cursor: inherit;
line-height: normal;
font-weight: normal;
text-align: left;
-webkit-tap-highlight-color: transparent;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
direction: ltr;
max-width: none
}
.mce-object {
border: 1px dotted #3A3A3A;
background: #D5D5D5 url(img/object.gif) no-repeat center
}
.mce-preview-object {
display: inline-block;
position: relative;
margin: 0 2px 0 2px;
line-height: 0;
border: 1px solid gray
}
.mce-preview-object .mce-shim {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
}
figure.align-left {
float: left
}
figure.align-right {
float: right
}
figure.image.align-center {
display: table;
margin-left: auto;
margin-right: auto
}
figure.image {
display: inline-block;
border: 1px solid gray;
margin: 0 2px 0 1px;
background: #f5f2f0
}
figure.image img {
margin: 8px 8px 0 8px
}
figure.image figcaption {
margin: 6px 8px 6px 8px;
text-align: center
}
.mce-toc {
border: 1px solid gray
}
.mce-toc h2 {
margin: 4px
}
.mce-toc li {
list-style-type: none
}
.mce-preview-object[data-mce-selected="2"] .mce-shim {
display: none
}
.mce-pagebreak {
cursor: default;
display: block;
border: 0;
width: 100%;
height: 5px;
border: 1px dashed #666;
margin-top: 15px;
page-break-before: always
}
@media print {
.mce-pagebreak {
border: 0
}
}
.mce-item-anchor {
cursor: default;
display: inline-block;
-webkit-user-select: all;
-webkit-user-modify: read-only;
-moz-user-select: all;
-moz-user-modify: read-only;
user-select: all;
user-modify: read-only;
width: 9px !important;
height: 9px !important;
border: 1px dotted #3A3A3A;
background: #D5D5D5 url(img/anchor.gif) no-repeat center
}
.mce-nbsp,
.mce-shy {
background: #AAA
}
.mce-shy::after {
content: '-'
}
hr {
cursor: default
}
.mce-match-marker {
background: #AAA;
color: #fff
}
.mce-match-marker-selected {
background: #3399ff;
color: #fff
}
.mce-spellchecker-word {
border-bottom: 2px solid #F00;
cursor: default
}
.mce-spellchecker-grammar {
border-bottom: 2px solid #008000;
cursor: default
}
.mce-item-table,
.mce-item-table td,
.mce-item-table th,
.mce-item-table caption {
border: 1px dashed #BBB
}
td[data-mce-selected],
th[data-mce-selected] {
background-color: #3399ff !important
}
.mce-edit-focus {
outline: 1px dotted #333
}
.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus {
outline: 2px solid #2d8ac7
}
.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover {
outline: 2px solid #7ACAFF
}
.mce-content-body *[contentEditable=false][data-mce-selected] {
outline: 2px solid #2d8ac7
}
.mce-resize-bar-dragging {
background-color: blue;
opacity: .25;
filter: alpha(opacity=25);
zoom: 1
}

File diff suppressed because one or more lines are too long