/*! * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.7.0 (2021-02-10) * */ !function(o){var r={};function t(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return o[e].call(n.exports,n,n.exports,t),n.l=!0,n.exports}t.m=o,t.c=r,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s="./src/js/plugins/bbcode/plugin.js")}({"./src/js/plugins/bbcode/plugin.js":function(module,exports){eval("/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n *\n * Version: 5.7.0 (2021-02-10)\n */\n (function () {\n 'use strict';\n\n var global = tinymce.util.Tools.resolve('tinymce.PluginManager');\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');\n\n var html2bbcode = function (s) {\n s = global$1.trim(s);\n var rep = function (re, str) {\n s = s.replace(re, str);\n };\n rep(/(.*?)<\\/a>/gi, '[url=$1]$2[/url]');\n rep(/(.*?)<\\/font>/gi, '[code][color=$1]$2[/color][/code]');\n rep(/(.*?)<\\/font>/gi, '[quote][color=$1]$2[/color][/quote]');\n rep(/(.*?)<\\/font>/gi, '[code][color=$1]$2[/color][/code]');\n rep(/(.*?)<\\/font>/gi, '[quote][color=$1]$2[/color][/quote]');\n rep(/(.*?)<\\/span>/gi, '[color=$1]$2[/color]');\n rep(/(.*?)<\\/font>/gi, '[color=$1]$2[/color]');\n rep(/(.*?)<\\/span>/gi, '[size=$1]$2[/size]');\n rep(/(.*?)<\\/font>/gi, '$1');\n rep(//gi, '[img]$1[/img]');\n rep(/(.*?)<\\/span>/gi, '[code]$1[/code]');\n rep(/(.*?)<\\/span>/gi, '[quote]$1[/quote]');\n rep(/(.*?)<\\/strong>/gi, '[code][b]$1[/b][/code]');\n rep(/(.*?)<\\/strong>/gi, '[quote][b]$1[/b][/quote]');\n rep(/(.*?)<\\/em>/gi, '[code][i]$1[/i][/code]');\n rep(/(.*?)<\\/em>/gi, '[quote][i]$1[/i][/quote]');\n rep(/(.*?)<\\/u>/gi, '[code][u]$1[/u][/code]');\n rep(/(.*?)<\\/u>/gi, '[quote][u]$1[/u][/quote]');\n rep(/<\\/(strong|b)>/gi, '[/b]');\n rep(/<(strong|b)>/gi, '[b]');\n rep(/<\\/(em|i)>/gi, '[/i]');\n rep(/<(em|i)>/gi, '[i]');\n rep(/<\\/u>/gi, '[/u]');\n rep(/(.*?)<\\/span>/gi, '[u]$1[/u]');\n rep(//gi, '[u]');\n rep(/]*>/gi, '[quote]');\n rep(/<\\/blockquote>/gi, '[/quote]');\n rep(/
/gi, '\\n');\n rep(//gi, '\\n');\n rep(/
/gi, '\\n');\n rep(/

/gi, '');\n rep(/<\\/p>/gi, '\\n');\n rep(/ |\\u00a0/gi, ' ');\n rep(/"/gi, '\"');\n rep(/</gi, '<');\n rep(/>/gi, '>');\n rep(/&/gi, '&');\n return s;\n };\n var bbcode2html = function (s) {\n s = global$1.trim(s);\n var rep = function (re, str) {\n s = s.replace(re, str);\n };\n rep(/\\n/gi, '
');\n rep(/\\[b\\]/gi, '');\n rep(/\\[\\/b\\]/gi, '');\n rep(/\\[i\\]/gi, '');\n rep(/\\[\\/i\\]/gi, '');\n rep(/\\[u\\]/gi, '');\n rep(/\\[\\/u\\]/gi, '');\n rep(/\\[url=([^\\]]+)\\](.*?)\\[\\/url\\]/gi, '$2');\n rep(/\\[url\\](.*?)\\[\\/url\\]/gi, '$1');\n rep(/\\[img\\](.*?)\\[\\/img\\]/gi, '');\n rep(/\\[color=(.*?)\\](.*?)\\[\\/color\\]/gi, '$2');\n rep(/\\[code\\](.*?)\\[\\/code\\]/gi, '$1 ');\n rep(/\\[quote.*?\\](.*?)\\[\\/quote\\]/gi, '$1 ');\n return s;\n };\n\n function Plugin () {\n global.add('bbcode', function (editor) {\n editor.on('BeforeSetContent', function (e) {\n e.content = bbcode2html(e.content);\n });\n editor.on('PostProcess', function (e) {\n if (e.set) {\n e.content = bbcode2html(e.content);\n }\n if (e.get) {\n e.content = html2bbcode(e.content);\n }\n });\n });\n }\n\n Plugin();\n\n}());\n\n\n//# sourceURL=webpack:///./src/js/plugins/bbcode/plugin.js?")}});