typeof _translations !== "undefined" || (_translations = {})
_translations["declared"] = _translations["declared"] || (_translations["declared"] = {})
_translations["declared_files"] = _translations["declared_files"] || (_translations["declared_files"] = {})
unique_translation_check: {
if (_translations["declared_files"]["f7ffefe1f23e9f41f63ecb2759b0052d274d4984d577731464ae6be88cf1b89f"] !== undefined) {
console.warn("This file has already been loaded!\nAre you executing scripts twice?")
break unique_translation_check;
}
else
_translations["declared_files"]["f7ffefe1f23e9f41f63ecb2759b0052d274d4984d577731464ae6be88cf1b89f"] = "f7ffefe1f23e9f41f63ecb2759b0052d274d4984d577731464ae6be88cf1b89f"
/*Auto generated helper for testing if the translation keys are unique*/
for (var { name: _i, path: _a } of []) {
if (_translations["declared"][_i] !== undefined)
throw "Translation with generated name \"" + _i + "\" already exists!\nIt has been already defined here: " + _translations["declared"][_i] + "\nAttempted to redefine here: " + _a + "\nRegenerate and/or fix your program!";
else
_translations["declared"][_i] = _a
}
}
/*
Copyright (C) 2011 Patrick Gillespie, http://patorjk.com/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Extendible BBCode Parser v1.0.0
By Patrick Gillespie (patorjk@gmail.com)
Website: http://patorjk.com/
This module allows you to parse BBCode and to extend to the mark-up language
to add in your own tags.
*/
var XBBCODE;
(function (XBBCODE) {
// -----------------------------------------------------------------------------
// Set up private variables
// -----------------------------------------------------------------------------
const urlPattern = /^(?:https?|file|c):(?:\/{1,3}|\\{1})[-a-zA-Z0-9:;,@#%&()~_?\+=\/\\\.]*$/, colorNamePattern = /^(?:aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen)$/, colorCodePattern = /^#?[a-fA-F0-9]{6}$/, emailPattern = /[^\s@]+@[^\s@]+\.[^\s@]+/, fontFacePattern = /^([a-z][a-z0-9_]+|"[a-z][a-z0-9_\s]+")$/i;
let tagList, tagsNoParseList = [], bbRegExp, pbbRegExp, pbbRegExp2, openTags, closeTags;
/* -----------------------------------------------------------------------------
* _tags
* This object contains a list of _tags that your code will be able to understand.
* Each tag object has the following properties:
*
* openTag - A function that takes in the tag's parameters (if any) and its
* contents, and returns what its HTML open tag should be.
* Example: [color=red]test[/color] would take in "=red" as a
* parameter input, and "test" as a content input.
* It should be noted that any BBCode inside of "content" will have
* been processed by the time it enter the openTag function.
*
* closeTag - A function that takes in the tag's parameters (if any) and its
* contents, and returns what its HTML close tag should be.
*
* displayContent - Defaults to true. If false, the content for the tag will
* not be displayed. This is useful for _tags like IMG where
* its contents are actually a parameter input.
*
* restrictChildrenTo - A list of BBCode _tags which are allowed to be nested
* within this BBCode tag. If this property is omitted,
* any BBCode tag may be nested within the tag.
*
* restrictParentsTo - A list of BBCode _tags which are allowed to be parents of
* this BBCode tag. If this property is omitted, any BBCode
* tag may be a parent of the tag.
*
* noParse - true or false. If true, none of the content WITHIN this tag will be
* parsed by the XBBCode parser.
*
*
*
* LIMITIONS on adding NEW TAGS:
* - Tag names should be alphanumeric (including underscores) and all _tags should have an opening tag
* and a closing tag.
* The [*] tag is an exception because it was already a standard
* bbcode tag. Technecially _tags don't *have* to be alphanumeric, but since
* regular expressions are used to parse the text, if you use a non-alphanumeric
* tag names, just make sure the tag name gets escaped properly (if needed).
* --------------------------------------------------------------------------- */
let _tags = {
"b": {
openTag: function (params, content) {
return '';
},
closeTag: function (params, content) {
return '';
}
},
/*
This tag does nothing and is here mostly to be used as a classification for
the bbcode input when evaluating parent-child tag relationships
*/
"bbcode": {
openTag: function (params, content) {
return '';
},
closeTag: function (params, content) {
return '';
}
},
"center": {
openTag: function (params, content) {
return '';
},
closeTag: function (params, content) {
return '';
}
},
"code": {
openTag: function (params, content) {
return '';
},
closeTag: function (params, content) {
return '';
},
noParse: true
},
"color": {
openTag: function (params, content) {
params = params || '';
var colorCode = (params.substr(1)).toLowerCase() || "black";
colorNamePattern.lastIndex = 0;
colorCodePattern.lastIndex = 0;
if (!colorNamePattern.test(colorCode)) {
if (!colorCodePattern.test(colorCode)) {
colorCode = "black";
}
else {
if (colorCode.substr(0, 1) !== "#") {
colorCode = "#" + colorCode;
}
}
}
return '';
},
closeTag: function (params, content) {
return '';
}
},
"email": {
openTag: function (params, content) {
var myEmail;
if (!params) {
myEmail = content.replace(/<.*?>/g, "");
}
else {
myEmail = params.substr(1);
}
emailPattern.lastIndex = 0;
if (!emailPattern.test(myEmail)) {
return '';
}
return '';
},
closeTag: function (params, content) {
return '';
}
},
"face": {
openTag: function (params, content) {
params = params || '';
var faceCode = params.substr(1) || "inherit";
fontFacePattern.lastIndex = 0;
if (!fontFacePattern.test(faceCode)) {
faceCode = "inherit";
}
return '';
},
closeTag: function (params, content) {
return '';
}
},
"font": {
openTag: function (params, content) {
params = params || '';
var faceCode = params.substr(1) || "inherit";
fontFacePattern.lastIndex = 0;
if (!fontFacePattern.test(faceCode)) {
faceCode = "inherit";
}
return '';
},
closeTag: function (params, content) {
return '';
}
},
"i": {
openTag: function (params, content) {
return '';
},
closeTag: function (params, content) {
return '';
}
},
"img": {
openTag: function (params, content) {
var myUrl = content;
urlPattern.lastIndex = 0;
if (!urlPattern.test(myUrl)) {
myUrl = "";
}
return '';
},
closeTag: function (params, content) {
return '';
},
displayContent: false
},
"justify": {
openTag: function (params, content) {
return '';
},
closeTag: function (params, content) {
return '';
}
},
"large": {
openTag: function (params, content) {
params = params || '';
var colorCode = params.substr(1) || "inherit";
colorNamePattern.lastIndex = 0;
colorCodePattern.lastIndex = 0;
if (!colorNamePattern.test(colorCode)) {
if (!colorCodePattern.test(colorCode)) {
colorCode = "inherit";
}
else {
if (colorCode.substr(0, 1) !== "#") {
colorCode = "#" + colorCode;
}
}
}
return '';
},
closeTag: function (params, content) {
return '';
}
},
"left": {
openTag: function (params, content) {
return '';
},
closeTag: function (params, content) {
return '';
}
},
"li": {
openTag: function (params, content) {
return "
'; }, closeTag: function (params, content) { return ''; } }, "right": { openTag: function (params, content) { return ''; }, closeTag: function (params, content) { return ''; } }, "s": { openTag: function (params, content) { return ''; }, closeTag: function (params, content) { return ''; } }, "size": { openTag: function (params, content) { params = params || ''; var mySize = parseInt(params.substr(1), 10) || 0; if (mySize < 4 || mySize > 40) { mySize = 14; } return ''; }, closeTag: function (params, content) { return ''; } }, "small": { openTag: function (params, content) { params = params || ''; var colorCode = params.substr(1) || "inherit"; colorNamePattern.lastIndex = 0; colorCodePattern.lastIndex = 0; if (!colorNamePattern.test(colorCode)) { if (!colorCodePattern.test(colorCode)) { colorCode = "inherit"; } else { if (colorCode.substr(0, 1) !== "#") { colorCode = "#" + colorCode; } } } return ''; }, closeTag: function (params, content) { return ''; } }, "sub": { openTag: function (params, content) { return ''; }, closeTag: function (params, content) { return ''; } }, "sup": { openTag: function (params, content) { return ''; }, closeTag: function (params, content) { return ''; } }, "table": { openTag: function (params, content) { return '