From 9d56055b4152d3366e8f97666e8d3b7eec9cb88f Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 14:11:19 -0500
Subject: [PATCH 01/36] initial attempt
---
library.js | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/library.js b/library.js
index 518ebcb3..426fab5a 100644
--- a/library.js
+++ b/library.js
@@ -41,9 +41,7 @@ Comments.getCommentData = async function (req, res, next) {
const tid = await Comments.getTopicIDByCommentID(commentID);
const topicData = await topics.getTopicData(tid);
- if (!topicData) {
- return next();
- }
+
const start = pagination * 10;
const stop = start + 9;
const [postData, userData, isAdmin, isPublisher, categoryData, mainPost] = await Promise.all([
@@ -55,22 +53,27 @@ Comments.getCommentData = async function (req, res, next) {
topics.getMainPost(tid, req.uid),
]);
- const hostUrls = (meta.config['blog-comments:url'] || '').split(',');
- let url;
+ let postData = [], categoryData = null, mainPost = null;
+ if (topicData) {
+ [postData, categoryData, mainPost] = await Promise.all([
+ topics.getTopicPosts(topicData, `tid:${tid}:posts`, start, stop, req.uid, true),
+ topics.getCategoryData(tid),
+ topics.getMainPost(tid, req.uid),
+ ]);
+ }
- hostUrls.forEach((hostUrl) => {
+ const hostUrls = (meta.config['blog-comments:url'] || '').split(',');
+ const url = hostUrls.find((hostUrl) => {
hostUrl = hostUrl.trim();
if (hostUrl[hostUrl.length - 1] === '/') {
hostUrl = hostUrl.substring(0, hostUrl.length - 1);
}
- if (hostUrl === req.get('origin')) {
- url = req.get('origin');
- }
+ return (hostUrl === req.get('origin'))
});
if (url) {
- res.header('Access-Control-Allow-Origin', url);
+ res.header('Access-Control-Allow-Origin', req.get('origin'));
} else {
winston.warn(`[nodebb-plugin-blog-comments] Origin (${req.get('origin')}) does not match hostUrls: ${hostUrls.join(', ')}`);
}
@@ -88,9 +91,9 @@ Comments.getCommentData = async function (req, res, next) {
if (userData.picture && !userData.picture.startsWith('http')) {
userData.picture = userData.picture.replace(relativePath, '');
}
+
const compose_location = meta.config['blog-comments:compose-location'] || 'top';
const top = compose_location === 'top';
- const bottom = compose_location === 'bottom';
res.json({
posts: posts,
@@ -104,7 +107,7 @@ Comments.getCommentData = async function (req, res, next) {
category: categoryData,
mainPost: mainPost,
atTop: top,
- atBottom: bottom,
+ atBottom: !top,
});
};
From 4fbd2412154200aa3154994736ff60ddc6855bec Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 14:16:03 -0500
Subject: [PATCH 02/36] Fix library
---
library.js | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/library.js b/library.js
index 426fab5a..cd673ee4 100644
--- a/library.js
+++ b/library.js
@@ -44,13 +44,10 @@ Comments.getCommentData = async function (req, res, next) {
const start = pagination * 10;
const stop = start + 9;
- const [postData, userData, isAdmin, isPublisher, categoryData, mainPost] = await Promise.all([
- topics.getTopicPosts(topicData, `tid:${tid}:posts`, start, stop, req.uid, true),
+ const [userData, isAdmin, isPublisher] = await Promise.all([
user.getUserData(req.uid),
user.isAdministrator(req.uid),
groups.isMember(req.uid, 'publishers'),
- topics.getCategoryData(tid),
- topics.getMainPost(tid, req.uid),
]);
let postData = [], categoryData = null, mainPost = null;
From 3ea1a544f1a6ed0090fb0b9a9d76809655243ddd Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 14:17:55 -0500
Subject: [PATCH 03/36] Update library.js
---
library.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/library.js b/library.js
index cd673ee4..0dbcd46b 100644
--- a/library.js
+++ b/library.js
@@ -94,7 +94,7 @@ Comments.getCommentData = async function (req, res, next) {
res.json({
posts: posts,
- postCount: topicData.postcount,
+ postCount: topicData ? topicData.postcount : 0,
user: userData,
template: Comments.template,
token: req.csrfToken && req.csrfToken(),
From 3cdd4adf4a4b0a3ef209214a890b629be78c028c Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 15:12:05 -0500
Subject: [PATCH 04/36] Tweak approach
---
public/lib/general.js | 49 +++++++++++++-------------
public/templates/comments/comments.tpl | 4 +--
2 files changed, 26 insertions(+), 27 deletions(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index f606ee0d..c8732ce8 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -144,32 +144,31 @@
authenticate('login');
}
}
- } else {
- if (data.isAdmin) {
- if (articleData) {
- var translator = document.createElement('span'),
- gTags = articleData.tags,
- url = articleData.url,
- title= articleData.title_plain,
- cid = articleData.cid || -1,
- tags = [];
- translator.innerHTML = articleData.markDownContent;
-
- var markdown = translator.firstChild.innerHTML + '\n\n**Click [here]('+ url +') to see the full blog post**';
-
- for (var tag in gTags) {
- if (gTags.hasOwnProperty(tag)) {
- tags.push(gTags[tag].title);
- }
- }
- document.getElementById('nodebb-content-markdown').value = markdown;
- document.getElementById('nodebb-content-title').value = title;
- document.getElementById('nodebb-content-cid').value = cid;
- document.getElementById('nodebb-content-tags').value = JSON.stringify(tags);
- } else {
- console.error('Declare articleData variable!');
- }
+ } else if (data.isAdmin) {
+ if (!articleData) {
+ console.error('Declare articleData variable!');
+ return;
+ }
+
+ var translator = document.createElement('span'),
+ gTags = articleData.tags,
+ url = articleData.url,
+ title= articleData.title_plain,
+ cid = articleData.cid || -1,
+ tags = [];
+ translator.innerHTML = articleData.markDownContent;
+
+ var markdown = translator.firstChild.innerHTML + '\n\n**Click [here]('+ url +') to see the full blog post**';
+
+ for (var tag in gTags) {
+ if (gTags.hasOwnProperty(tag)) {
+ tags.push(gTags[tag].title);
+ }
}
+ document.getElementById('nodebb-content-markdown').value = markdown;
+ document.getElementById('nodebb-content-title').value = title;
+ document.getElementById('nodebb-content-cid').value = cid;
+ document.getElementById('nodebb-content-tags').value = JSON.stringify(tags);
}
}
};
diff --git a/public/templates/comments/comments.tpl b/public/templates/comments/comments.tpl
index 75ca202a..32b9e9d9 100644
--- a/public/templates/comments/comments.tpl
+++ b/public/templates/comments/comments.tpl
@@ -32,9 +32,9 @@
{user.username} commented {posts.timestamp} {posts.content}
From 9bcf7d2cbf3cf46a272040e7b937bcc8d3e2bacd Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 15:36:25 -0500
Subject: [PATCH 06/36] More testing.
---
public/lib/general.js | 494 ++++++++++++++++++++++++-
public/templates/comments/comments.tpl | 7 +
2 files changed, 500 insertions(+), 1 deletion(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index c8732ce8..ed22ed8f 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -83,6 +83,8 @@
}
if (pagination) {
+ console.log(data, templates.blocks)
+ // var html = templates.parse(template, data);
html = normalizePost(parse(data, templates.blocks['posts']));
commentsDiv.innerHTML = commentsDiv.innerHTML + html;
} else {
@@ -354,4 +356,494 @@
})(data, "", template);
}
-}());
\ No newline at end of file
+}());
+
+
+// https://raw.githubusercontent.com/benchpressjs/benchpressjs/v0.3.1/lib/templates.js
+(function(module) {
+ var templates = {
+ cache: {},
+ globals: {}
+ },
+ helpers = {},
+ loader,
+ worker;
+
+ var regexes = {
+ nestedConditionals: /(?!^)(?!$)/g,
+ conditionalBlock: /[\r\n?\n]*?[\r\n?\n]*?/,
+ conditionalHelper: //,
+ conditionalArgs: /[ ]*,[ ]*/,
+ innerLoop: /\s*/g,
+ removeTabspace: /^\t*?|^\r\n?\t*?|\t?$|\r\n?\t*?$/g,
+ removeWhitespace: /(^[\r\n?|\n]*)|([\r\n\t]*$)/g,
+ cleanupEmptyLoops: /\s*/g,
+ cleanupMissingKeys: /[\r\n]*?[\/]?\{[a-zA-Z0-9\.]+[\r\n]*?\}/g,
+ leftoverRoot: /\.\.\/([\S]*?)[\}| ]/g,
+ getUndefinedKeys: //g,
+ backReferenceFix: /\$+/g,
+ escapeBlocks: //g,
+ escapeKeys: /\{([\s\S]*?)\}/g,
+ rootKey: /\{\.\.\/([\S]*?)\}/g,
+ rootConditional: /IF \.\.\/([\S]*?)/g,
+ rootConditionalFalse: /IF !\.\.\/([\S]*?)/g
+ };
+
+ if (typeof self !== 'undefined' && self.addEventListener) {
+ self.addEventListener('message', function(ev) {
+ if (!ev || !ev.data || !ev.data.template || !ev.data.object) {
+ return;
+ }
+ var data = ev.data;
+
+ self.postMessage({
+ result: !data.block ? templates.parse(data.template, data.object) : templates.parse(data.template, data.block, data.object),
+ signature: data.signature
+ }, '*');
+ }, false);
+ }
+
+ var callbacks = {},
+ signature = 0,
+ MAX_SAFE_INT = Math.pow(2, 53) - 1;
+
+ templates.setupWebWorker = function(pathToScript) {
+ try {
+ worker = new Worker(pathToScript);
+
+ worker.addEventListener('message', function(e) {
+ if (callbacks[e.data.signature]) {
+ callbacks[e.data.signature](e.data.result);
+ }
+ }, false);
+ } catch (err) {}
+ };
+
+ function launchWorker(template, obj, block, callback) {
+ signature++;
+ if (signature > MAX_SAFE_INT) {
+ signature = 0;
+ }
+
+ obj = sanitise(obj);
+
+ worker.postMessage({
+ template: template,
+ object: obj,
+ block: block,
+ signature: signature
+ });
+
+ callbacks[signature] = function(result) {
+ callback(result);
+ delete callbacks[signature];
+ };
+ }
+
+ function sanitise(obj) {
+ for(var prop in obj) {
+ if (!obj.hasOwnProperty(prop) || typeof obj[prop] === 'function') {
+ delete obj[prop];
+ }
+ }
+
+ return obj;
+ }
+
+ templates.parse = function(template, block, obj, callback) {
+ if (typeof block !== 'string') {
+ callback = obj;
+ obj = block;
+ block = false;
+ }
+
+ if (!template) {
+ return callback ? callback('') : '';
+ }
+
+ obj = registerGlobals(obj || {});
+
+ if (loader && callback) {
+ if (!templates.cache[template]) {
+ loader(template, function(loaded) {
+ templates.cache[template] = loaded;
+
+ launchCallback(loaded, obj, block, callback);
+ });
+ } else {
+ launchCallback(templates.cache[template], obj, block, callback);
+ }
+ } else if (callback) {
+ launchCallback(template, obj, block, callback);
+ } else {
+ return parseTemplate(block, template, obj);
+ }
+ };
+
+ function launchCallback(template, obj, block, callback) {
+ if (worker) {
+ launchWorker(template, obj, block, callback);
+ } else {
+ callback(parseTemplate(block, template, obj));
+ }
+ }
+
+ function parseTemplate(block, template, obj) {
+ block = !block ? template : templates.getBlock(template, block);
+ template = parse(block, obj);
+
+ return parseFunctions(template, template, obj);
+ }
+
+ templates.registerHelper = function(name, func) {
+ helpers[name] = func;
+ };
+
+ templates.registerLoader = function(func) {
+ loader = func;
+ };
+
+ templates.setGlobal = function(key, value) {
+ templates.globals[key] = value;
+ };
+
+ templates.getBlock = function(template, block) {
+ return template.replace(new RegExp('[\\s\\S]*([\\s\\S]*?)[\\s\\S]*', 'g'), '$1');
+ };
+
+ templates.flush = function() {
+ templates.cache = {};
+ };
+
+ function express(filename, options, fn) {
+ var fs = require('fs'),
+ tpl = filename.replace(options.settings.views + '/', '');
+
+ options._locals = null;
+
+ if (!templates.cache[tpl]) {
+ fs.readFile(filename, function(err, html) {
+ templates.cache[tpl] = (html || '').toString();
+ return fn(err, templates.parse(templates.cache[tpl], options));
+ });
+ } else {
+ return fn(null, templates.parse(templates.cache[tpl], options));
+ }
+ }
+
+ function replace(string, regex, value) {
+ return string.replace(regex, value.toString().replace(regexes.backReferenceFix, '$$$'));
+ }
+
+ function replaceValue(template, key, value) {
+ var string;
+
+ value = value.toString();
+ string = replace(template, new RegExp('{{' + key + '}}', 'g'), value);
+
+ return replace(string, new RegExp('{' + key + '}', 'g'), value
+ .replace(regexes.escapeKeys, '{$1}')
+ .replace(regexes.escapeBlocks, '<!--$1-->')
+ );
+ }
+
+ function makeRegex(block, namespace) {
+ namespace = '(' + namespace + ')?';
+ return new RegExp('[\\s\\S]*?');
+ }
+
+ function makeBlockRegex(block, namespace) {
+ namespace = '(' + namespace + ')?';
+ return new RegExp('([\\r\\n?|\\n]?)|()', 'g');
+ }
+
+ function makeConditionalRegex(block) {
+ return new RegExp('([\\s\\S]*?)', 'g');
+ }
+
+ function makeStatementRegex(key) {
+ return new RegExp('()|()', 'g');
+ }
+
+ function registerGlobals(obj) {
+ for (var g in templates.globals) {
+ if (templates.globals.hasOwnProperty(g)) {
+ obj[g] = obj[g] || templates.globals[g];
+ }
+ }
+
+ return obj;
+ }
+
+ function checkConditionals(template, key, value) {
+ return checkConditional(checkConditional(template, '!' + key, !value), key, value);
+ }
+
+ function checkConditional(template, key, value) {
+ var matches = template.match(makeConditionalRegex(key));
+
+ if (matches) {
+ var statement = makeStatementRegex(key);
+ for (var i = 0, ii = matches.length; i < ii; i++) {
+ var nestedConditionals = matches[i].match(regexes.nestedConditionals),
+ match = replace(matches[i].replace(statement, ''), regexes.nestedConditionals, ''),
+ conditionalBlock = match.split(regexes.conditionalBlock);
+
+ if (conditionalBlock[1]) {
+ // there is an else statement
+ template = replace(template, matches[i], replace(conditionalBlock[value ? 0 : 1], regexes.removeWhitespace, ''));
+ } else {
+ // regular if statement
+ template = replace(template, matches[i], value ? replace(match, regexes.removeWhitespace, '') : '');
+ }
+
+ if (nestedConditionals) {
+ for (var x = 0, xx = nestedConditionals.length; x < xx; x++) {
+ template = replace(template, '', nestedConditionals[x]);
+ }
+ }
+ }
+ }
+
+ return template;
+ }
+
+ function checkConditionalHelpers(template, obj) {
+ var string,
+ func;
+
+
+ while ((string = template.match(regexes.conditionalHelper)) !== null) {
+ var fn = string[1].trim(),
+ args = fn.split(regexes.conditionalArgs);
+
+ func = args[0];
+
+ if (helpers[func]) {
+ args.shift();
+ args.unshift(obj);
+ template = checkConditionals(template, 'function.' + fn, helpers[func].apply(null, args));
+ } else {
+ template = template.replace(makeConditionalRegex('function.' + fn));
+ }
+ }
+
+ return template;
+ }
+
+ function callMethod(method, parameters) {
+ return method.apply(templates, parameters);
+ }
+
+ function parseFunctions(block, result, obj) {
+ var functions = block.match(/{function.*?}/g, '');
+ if (!functions) {
+ return result;
+ }
+
+ for (var i=0, ii=functions.length; i
')
+ .replace(regexes.rootKey, '{' + namespace + key + '.$1}')
+ .replace(regexes.rootConditional, 'IF ' + namespace + key + '.$1')
+ .replace(regexes.rootConditionalFalse, 'IF !' + namespace + key + '.$1');
+
+ if (innerLoops) {
+ for (var x = 0, xx = innerLoops.length; x < xx; x++) {
+ block = replace(block, '', innerLoops[x]);
+ }
+ }
+
+ block = block
+ .replace(regexes.removeTabspace, '');
+
+ result = parseArrayBlock(block, array[key], namespace + key + '.', isObject);
+
+ template = replace(template, regex, result.replace(regexes.removeWhitespace, ''));
+ }
+
+ return template;
+ }
+
+ function parseArrayBlock(block, array, namespace, isObject) {
+ var template = '';
+
+ for (var iterator in array) {
+ if (array.hasOwnProperty(iterator)) {
+ var result = '';
+
+ if (!isObject) {
+ iterator = parseInt(iterator, 10);
+ }
+
+ result += parse(block, array[iterator], namespace);
+
+ if (!isObject) {
+ result = checkConditionals(result, '@first', iterator === 0);
+ result = checkConditionals(result, '@last', iterator === array.length - 1);
+
+ result = result
+ .replace(/@index/g, iterator)
+ .replace(/@value/g, array[iterator]);
+ } else {
+ result = result
+ .replace(/@key/g, iterator)
+ .replace(/@value/g, array[iterator]);
+ }
+
+ result = parseFunctions(block, result, array[iterator]);
+ template = template + result;
+ }
+ }
+
+ return template;
+ }
+
+ function parseValue(template, key, value) {
+ template = checkConditionals(template, key, value);
+ return replaceValue(template, key, value);
+ }
+
+ function parse(template, obj, namespace) {
+
+ namespace = namespace || '';
+ var key;
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ if (typeof obj[key] === 'undefined' || typeof obj[key] === 'function' || !template.match(key) || (obj[key] && obj[key].constructor === Array)) {
+ continue;
+ } else if (obj[key] === null) {
+ template = replaceValue(template, namespace + key, '');
+ } else if (obj[key] instanceof Object) {
+ template = parseObject(template, obj, key, namespace);
+ template = checkConditionals(template, key, obj[key]);
+ template = parse(template, obj[key], namespace + key + '.');
+ } else {
+ template = parseValue(template, namespace + key, obj[key]);
+ }
+ }
+ }
+
+ for (key in obj) {
+ if (obj.hasOwnProperty(key) && Array.isArray(obj[key]) && template.match(key)) {
+ template = replaceValue(template, namespace + key + '.length', obj[key].length);
+ template = parseArray(template, obj, key, namespace);
+ }
+ }
+
+
+ if (namespace) {
+ namespace = '';
+ } else {
+ template = checkConditionalHelpers(template, obj);
+ template = cleanup(template, obj);
+ }
+
+ return template;
+ }
+
+ function cleanup(template, obj) {
+ template = template
+ .replace(regexes.cleanupEmptyLoops, '');
+
+ var missingKeys = template.match(regexes.cleanupMissingKeys) || [];
+
+ for (var i = 0, ii = missingKeys.length; i < ii; i++) {
+ if (missingKeys[i].substr(0, 1) !== '/') {
+ template = template.replace(missingKeys[i], '');
+ } else {
+ template = template.replace(missingKeys[i], missingKeys[i].slice(1));
+ }
+ }
+
+ var keysToReparse = {},
+ undefinedKeys = template.match(regexes.getUndefinedKeys) || [];
+
+ for (var i = 0, ii = undefinedKeys.length; i < ii; i++) {
+ var undefinedKey = regexes.getUndefinedKeys.exec(undefinedKeys[i]);
+
+ if (undefinedKey) {
+ keysToReparse[undefinedKey[1]] = false;
+ }
+ }
+
+ var leftoverRoot = template.match(regexes.leftoverRoot) || [];
+
+ for (var i = 0, ii = leftoverRoot.length; i < ii; i++) {
+ var key = regexes.leftoverRoot.exec(leftoverRoot[i]);
+
+ if (key) {
+ key = key[1].split('.')[0];
+
+ if (obj[key]) {
+ keysToReparse['../' + key] = obj[key];
+ }
+ }
+ }
+
+ var parseUndefined = false;
+
+ for(var prop in keysToReparse) {
+ if (keysToReparse.hasOwnProperty(prop)) {
+ parseUndefined = true;
+ break;
+ }
+ }
+
+ return parseUndefined ? parse(template, keysToReparse, '') : template;
+ }
+
+ module.exports = templates;
+ module.exports.__express = express;
+
+ if ('undefined' !== typeof window) {
+ window.templates = module.exports;
+ }
+
+})('undefined' === typeof module ? {
+ module: {
+ exports: {}
+ }
+} : module);
diff --git a/public/templates/comments/comments.tpl b/public/templates/comments/comments.tpl
index ee10e0d6..75ca202a 100644
--- a/public/templates/comments/comments.tpl
+++ b/public/templates/comments/comments.tpl
@@ -30,6 +30,13 @@
{user.username} commented {posts.timestamp} {posts.content}
From 8faa283c320cd22edfef48f9b86e369b9840aac8 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 15:38:00 -0500
Subject: [PATCH 07/36] More logging
---
public/lib/general.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index ed22ed8f..267df6b1 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -83,11 +83,12 @@
}
if (pagination) {
- console.log(data, templates.blocks)
+ console.log(data, templates.blocks);
// var html = templates.parse(template, data);
html = normalizePost(parse(data, templates.blocks['posts']));
commentsDiv.innerHTML = commentsDiv.innerHTML + html;
} else {
+ console.log(data, data.template);
html = parse(data, data.template);
nodebbDiv.innerHTML = normalizePost(html);
}
From d139a21431f394fe99e0ba6277c1e11f469d85d6 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 15:39:04 -0500
Subject: [PATCH 08/36] Flip out
---
public/lib/general.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index 267df6b1..4036b7e4 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -88,8 +88,9 @@
html = normalizePost(parse(data, templates.blocks['posts']));
commentsDiv.innerHTML = commentsDiv.innerHTML + html;
} else {
- console.log(data, data.template);
- html = parse(data, data.template);
+ console.log(data, data.template, templates);
+ html = templates.parse(data.template, data);
+ // html = parse(data, data.template);
nodebbDiv.innerHTML = normalizePost(html);
}
From 9824f8bf75db41123a134e82d756ce309f5f4b70 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 15:41:08 -0500
Subject: [PATCH 09/36] Tweak
---
public/lib/general.js | 1042 +++++++++++++++++++++--------------------
1 file changed, 522 insertions(+), 520 deletions(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index 4036b7e4..16047b30 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -1,365 +1,3 @@
-(function() {
- "use strict";
-
- var articlePath = window.location.protocol + '//' + window.location.host + window.location.pathname;
-
- var pluginURL = nodeBBURL + '/plugins/nodebb-plugin-blog-comments',
- savedText, nodebbDiv, contentDiv, commentsDiv, commentsCounter, commentsAuthor, commentsCategory;
-
- var stylesheet = document.createElement("link");
- stylesheet.setAttribute("rel", "stylesheet");
- stylesheet.setAttribute("type", "text/css");
- stylesheet.setAttribute("href", pluginURL + '/css/comments.css');
-
- document.getElementsByTagName("head")[0].appendChild(stylesheet);
- document.getElementById('nodebb-comments').insertAdjacentHTML('beforebegin', '
');
- nodebbDiv = document.getElementById('nodebb');
-
- function newXHR() {
- try {
- return XHR = new XMLHttpRequest();
- } catch (e) {
- try {
- return XHR = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {
- return XHR = new ActiveXObject("Msxml2.XMLHTTP");
- }
- }
- }
-
- var XHR = newXHR(), pagination = 0, modal;
-
- function authenticate(type) {
- savedText = contentDiv.value;
- modal = window.open(nodeBBURL + "/" + type + "/#blog/authenticate","_blank","toolbar=no, scrollbars=no, resizable=no, width=600, height=675");
- var timer = setInterval(function() {
- if(modal.closed) {
- clearInterval(timer);
- pagination = 0;
- reloadComments();
- }
- }, 500);
- }
-
- function normalizePost(post) {
- return post.replace(/href="\/(?=\w)/g, 'href="' + nodeBBURL + '/')
- .replace(/src="\/(?=\w)/g, 'src="' + nodeBBURL + '/');
- }
-
- XHR.onload = function() {
- if (XHR.status >= 200 && XHR.status < 400) {
- var data = JSON.parse(XHR.responseText), html;
-
- commentsDiv = document.getElementById('nodebb-comments-list');
- commentsCounter = document.getElementById('nodebb-comments-count');
- commentsAuthor = document.getElementById('nodebb-comments-author');
- commentsCategory = document.getElementById('nodebb-comments-category');
-
- data.relative_path = nodeBBURL;
- data.redirect_url = articlePath;
- data.article_id = articleID;
- data.pagination = pagination;
- data.postCount = parseInt(data.postCount, 10);
-
- for (var post in data.posts) {
- if (data.posts.hasOwnProperty(post)) {
- data.posts[post].timestamp = timeAgo(parseInt(data.posts[post].timestamp), 10);
- if (data.posts[post]['blog-comments:url']) {
- delete data.posts[post];
- }
- }
- }
-
- if (commentsCounter) {
- commentsCounter.innerHTML = data.postCount ? (data.postCount - 1) : 0;
- }
-
- if (commentsCategory) {
- commentsCategory.innerHTML = '
' + data.category.name + ' ';
- }
-
- if (commentsAuthor) {
- commentsAuthor.innerHTML = '
' + data.mainPost.user.username + ' ';
- }
-
- if (pagination) {
- console.log(data, templates.blocks);
- // var html = templates.parse(template, data);
- html = normalizePost(parse(data, templates.blocks['posts']));
- commentsDiv.innerHTML = commentsDiv.innerHTML + html;
- } else {
- console.log(data, data.template, templates);
- html = templates.parse(data.template, data);
- // html = parse(data, data.template);
- nodebbDiv.innerHTML = normalizePost(html);
- }
-
- contentDiv = document.getElementById('nodebb-content');
-
- setTimeout(function() {
- var lists = nodebbDiv.getElementsByTagName("li");
- for (var list in lists) {
- if (lists.hasOwnProperty(list)) {
- lists[list].className = '';
- }
- }
- }, 100);
-
- if (savedText) {
- contentDiv.value = savedText;
- }
-
- if (data.tid) {
- var loadMore = document.getElementById('nodebb-load-more');
- loadMore.onclick = function() {
- pagination++;
- reloadComments();
- }
- if (data.posts.length) {
- loadMore.style.display = 'inline-block';
- }
-
- if (pagination * 10 + data.posts.length + 1 >= data.postCount) {
- loadMore.style.display = 'none';
- }
-
- if (typeof jQuery !== 'undefined' && jQuery() && jQuery().fitVids) {
- jQuery(nodebbDiv).fitVids();
- }
-
- if (data.user && data.user.uid) {
- var error = window.location.href.match(/error=[\w-]*/);
- if (error) {
- error = error[0].split('=')[1];
- if (error === 'too-many-posts') {
- error = 'Please wait before posting so soon.';
- } else if (error === 'content-too-short') {
- error = 'Please post a longer reply.';
- }
-
- document.getElementById('nodebb-error').innerHTML = error;
- }
- } else {
- document.getElementById('nodebb-register').onclick = function() {
- authenticate('register');
- };
-
- document.getElementById('nodebb-login').onclick = function() {
- authenticate('login');
- }
- }
- } else if (data.isAdmin) {
- if (!articleData) {
- console.error('Declare articleData variable!');
- return;
- }
-
- var translator = document.createElement('span'),
- gTags = articleData.tags,
- url = articleData.url,
- title= articleData.title_plain,
- cid = articleData.cid || -1,
- tags = [];
- translator.innerHTML = articleData.markDownContent;
-
- var markdown = translator.firstChild.innerHTML + '\n\n**Click [here]('+ url +') to see the full blog post**';
-
- for (var tag in gTags) {
- if (gTags.hasOwnProperty(tag)) {
- tags.push(gTags[tag].title);
- }
- }
- document.getElementById('nodebb-content-markdown').value = markdown;
- document.getElementById('nodebb-content-title').value = title;
- document.getElementById('nodebb-content-cid').value = cid;
- document.getElementById('nodebb-content-tags').value = JSON.stringify(tags);
- }
- }
- };
-
- function reloadComments() {
- XHR.open('GET', nodeBBURL + '/comments/get/' + articleID + '/' + pagination, true);
- XHR.withCredentials = true;
- XHR.send();
- }
-
- reloadComments();
-
-
- function timeAgo(time){
- var time_formats = [
- [60, 'seconds', 1],
- [120, '1 minute ago'],
- [3600, 'minutes', 60],
- [7200, '1 hour ago'],
- [86400, 'hours', 3600],
- [172800, 'yesterday'],
- [604800, 'days', 86400],
- [1209600, 'last week'],
- [2419200, 'weeks', 604800],
- [4838400, 'last month'],
- [29030400, 'months', 2419200],
- [58060800, 'last year'],
- [2903040000, 'years', 29030400]
- ];
-
- var seconds = (+new Date() - time) / 1000;
-
- if (seconds < 10) {
- return 'just now';
- }
-
- var i = 0, format;
- while (format = time_formats[i++]) {
- if (seconds < format[0]) {
- if (!format[2]) {
- return format[1];
- } else {
- return Math.floor(seconds / format[2]) + ' ' + format[1] + ' ago';
- }
- }
- }
- return time;
- }
-
- var templates = {blocks: {}};
- function parse (data, template) {
- function replace(key, value, template) {
- var searchRegex = new RegExp('{' + key + '}', 'g');
- return template.replace(searchRegex, value);
- }
-
- function makeRegex(block) {
- return new RegExp("[\\s\\S]*", 'g');
- }
-
- function makeConditionalRegex(block) {
- return new RegExp("([\\s\\S]*?)", 'g');
- }
-
- function getBlock(regex, block, template) {
- data = template.match(regex);
- if (data == null) return;
-
- if (block !== undefined) templates.blocks[block] = data[0];
-
- var begin = new RegExp("(\r\n)*(\r\n)*", "g"),
- end = new RegExp("(\r\n)*(\r\n)*", "g"),
-
- data = data[0]
- .replace(begin, "")
- .replace(end, "");
-
- return data;
- }
-
- function setBlock(regex, block, template) {
- return template.replace(regex, block);
- }
-
- var regex, block;
-
- return (function parse(data, namespace, template, blockInfo) {
- if (!data || data.length == 0) {
- template = '';
- }
-
- function checkConditional(key, value) {
- var conditional = makeConditionalRegex(key),
- matches = template.match(conditional);
-
- if (matches !== null) {
- for (var i = 0, ii = matches.length; i < ii; i++) {
- var conditionalBlock = matches[i].split(//);
-
- var statement = new RegExp("()|()", 'gi');
-
- if (conditionalBlock[1]) {
- // there is an else statement
- if (!value) {
- template = template.replace(matches[i], conditionalBlock[1].replace(statement, ''));
- } else {
- template = template.replace(matches[i], conditionalBlock[0].replace(statement, ''));
- }
- } else {
- // regular if statement
- if (!value) {
- template = template.replace(matches[i], '');
- } else {
- template = template.replace(matches[i], matches[i].replace(statement, ''));
- }
- }
- }
- }
- }
-
- for (var d in data) {
- if (data.hasOwnProperty(d)) {
- if (typeof data[d] === 'undefined') {
- continue;
- } else if (data[d] === null) {
- template = replace(namespace + d, '', template);
- } else if (data[d].constructor == Array) {
- checkConditional(namespace + d + '.length', data[d].length);
- checkConditional('!' + namespace + d + '.length', !data[d].length);
-
- namespace += d + '.';
-
- var regex = makeRegex(d),
- block = getBlock(regex, namespace.substring(0, namespace.length - 1), template);
-
- if (block == null) {
- namespace = namespace.replace(d + '.', '');
- continue;
- }
-
- var numblocks = data[d].length - 1,
- i = 0,
- result = "";
-
- do {
- result += parse(data[d][i], namespace, block, {iterator: i, total: numblocks});
- } while (i++ < numblocks);
-
- namespace = namespace.replace(d + '.', '');
- template = setBlock(regex, result, template);
- } else if (data[d] instanceof Object) {
- template = parse(data[d], d + '.', template);
- } else {
- var key = namespace + d,
- value = typeof data[d] === 'string' ? data[d].replace(/^\s+|\s+$/g, '') : data[d];
-
- checkConditional(key, value);
- checkConditional('!' + key, !value);
-
- if (blockInfo && blockInfo.iterator) {
- checkConditional('@first', blockInfo.iterator === 0);
- checkConditional('!@first', blockInfo.iterator !== 0);
- checkConditional('@last', blockInfo.iterator === blockInfo.total);
- checkConditional('!@last', blockInfo.iterator !== blockInfo.total);
- }
-
- template = replace(key, value, template);
- }
- }
- }
-
- if (namespace) {
- var regex = new RegExp("{" + namespace + "[\\s\\S]*?}", 'g');
- template = template.replace(regex, '');
- namespace = '';
- } else {
- // clean up all undefined conditionals
- template = template.replace(//gi, 'ENDIF -->')
- .replace(//gi, '');
- }
-
- return template;
-
- })(data, "", template);
- }
-}());
-
// https://raw.githubusercontent.com/benchpressjs/benchpressjs/v0.3.1/lib/templates.js
(function(module) {
@@ -607,245 +245,609 @@
}
}
- return template;
- }
+ return template;
+ }
+
+ function checkConditionalHelpers(template, obj) {
+ var string,
+ func;
+
+
+ while ((string = template.match(regexes.conditionalHelper)) !== null) {
+ var fn = string[1].trim(),
+ args = fn.split(regexes.conditionalArgs);
+
+ func = args[0];
+
+ if (helpers[func]) {
+ args.shift();
+ args.unshift(obj);
+ template = checkConditionals(template, 'function.' + fn, helpers[func].apply(null, args));
+ } else {
+ template = template.replace(makeConditionalRegex('function.' + fn));
+ }
+ }
+
+ return template;
+ }
+
+ function callMethod(method, parameters) {
+ return method.apply(templates, parameters);
+ }
+
+ function parseFunctions(block, result, obj) {
+ var functions = block.match(/{function.*?}/g, '');
+ if (!functions) {
+ return result;
+ }
+
+ for (var i=0, ii=functions.length; i
')
+ .replace(regexes.rootKey, '{' + namespace + key + '.$1}')
+ .replace(regexes.rootConditional, 'IF ' + namespace + key + '.$1')
+ .replace(regexes.rootConditionalFalse, 'IF !' + namespace + key + '.$1');
+
+ if (innerLoops) {
+ for (var x = 0, xx = innerLoops.length; x < xx; x++) {
+ block = replace(block, '', innerLoops[x]);
+ }
+ }
+
+ block = block
+ .replace(regexes.removeTabspace, '');
+
+ result = parseArrayBlock(block, array[key], namespace + key + '.', isObject);
+
+ template = replace(template, regex, result.replace(regexes.removeWhitespace, ''));
+ }
+
+ return template;
+ }
+
+ function parseArrayBlock(block, array, namespace, isObject) {
+ var template = '';
+
+ for (var iterator in array) {
+ if (array.hasOwnProperty(iterator)) {
+ var result = '';
+
+ if (!isObject) {
+ iterator = parseInt(iterator, 10);
+ }
+
+ result += parse(block, array[iterator], namespace);
+
+ if (!isObject) {
+ result = checkConditionals(result, '@first', iterator === 0);
+ result = checkConditionals(result, '@last', iterator === array.length - 1);
+
+ result = result
+ .replace(/@index/g, iterator)
+ .replace(/@value/g, array[iterator]);
+ } else {
+ result = result
+ .replace(/@key/g, iterator)
+ .replace(/@value/g, array[iterator]);
+ }
+
+ result = parseFunctions(block, result, array[iterator]);
+ template = template + result;
+ }
+ }
+
+ return template;
+ }
+
+ function parseValue(template, key, value) {
+ template = checkConditionals(template, key, value);
+ return replaceValue(template, key, value);
+ }
+
+ function parse(template, obj, namespace) {
+
+ namespace = namespace || '';
+ var key;
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ if (typeof obj[key] === 'undefined' || typeof obj[key] === 'function' || !template.match(key) || (obj[key] && obj[key].constructor === Array)) {
+ continue;
+ } else if (obj[key] === null) {
+ template = replaceValue(template, namespace + key, '');
+ } else if (obj[key] instanceof Object) {
+ template = parseObject(template, obj, key, namespace);
+ template = checkConditionals(template, key, obj[key]);
+ template = parse(template, obj[key], namespace + key + '.');
+ } else {
+ template = parseValue(template, namespace + key, obj[key]);
+ }
+ }
+ }
+
+ for (key in obj) {
+ if (obj.hasOwnProperty(key) && Array.isArray(obj[key]) && template.match(key)) {
+ template = replaceValue(template, namespace + key + '.length', obj[key].length);
+ template = parseArray(template, obj, key, namespace);
+ }
+ }
+
- function checkConditionalHelpers(template, obj) {
- var string,
- func;
+ if (namespace) {
+ namespace = '';
+ } else {
+ template = checkConditionalHelpers(template, obj);
+ template = cleanup(template, obj);
+ }
+ return template;
+ }
- while ((string = template.match(regexes.conditionalHelper)) !== null) {
- var fn = string[1].trim(),
- args = fn.split(regexes.conditionalArgs);
+ function cleanup(template, obj) {
+ template = template
+ .replace(regexes.cleanupEmptyLoops, '');
- func = args[0];
+ var missingKeys = template.match(regexes.cleanupMissingKeys) || [];
- if (helpers[func]) {
- args.shift();
- args.unshift(obj);
- template = checkConditionals(template, 'function.' + fn, helpers[func].apply(null, args));
+ for (var i = 0, ii = missingKeys.length; i < ii; i++) {
+ if (missingKeys[i].substr(0, 1) !== '/') {
+ template = template.replace(missingKeys[i], '');
} else {
- template = template.replace(makeConditionalRegex('function.' + fn));
+ template = template.replace(missingKeys[i], missingKeys[i].slice(1));
}
}
- return template;
- }
+ var keysToReparse = {},
+ undefinedKeys = template.match(regexes.getUndefinedKeys) || [];
- function callMethod(method, parameters) {
- return method.apply(templates, parameters);
- }
+ for (var i = 0, ii = undefinedKeys.length; i < ii; i++) {
+ var undefinedKey = regexes.getUndefinedKeys.exec(undefinedKeys[i]);
- function parseFunctions(block, result, obj) {
- var functions = block.match(/{function.*?}/g, '');
- if (!functions) {
- return result;
+ if (undefinedKey) {
+ keysToReparse[undefinedKey[1]] = false;
+ }
}
- for (var i=0, ii=functions.length; i ');
+ nodebbDiv = document.getElementById('nodebb');
- var innerLoops = block.match(regexes.innerLoop);
+ function newXHR() {
+ try {
+ return XHR = new XMLHttpRequest();
+ } catch (e) {
+ try {
+ return XHR = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e) {
+ return XHR = new ActiveXObject("Msxml2.XMLHTTP");
+ }
+ }
+ }
- block = block
- .replace(regexes.innerLoop, '')
- .replace(regexes.rootKey, '{' + namespace + key + '.$1}')
- .replace(regexes.rootConditional, 'IF ' + namespace + key + '.$1')
- .replace(regexes.rootConditionalFalse, 'IF !' + namespace + key + '.$1');
+ var XHR = newXHR(), pagination = 0, modal;
- if (innerLoops) {
- for (var x = 0, xx = innerLoops.length; x < xx; x++) {
- block = replace(block, '', innerLoops[x]);
+ function authenticate(type) {
+ savedText = contentDiv.value;
+ modal = window.open(nodeBBURL + "/" + type + "/#blog/authenticate","_blank","toolbar=no, scrollbars=no, resizable=no, width=600, height=675");
+ var timer = setInterval(function() {
+ if(modal.closed) {
+ clearInterval(timer);
+ pagination = 0;
+ reloadComments();
+ }
+ }, 500);
+ }
+
+ function normalizePost(post) {
+ return post.replace(/href="\/(?=\w)/g, 'href="' + nodeBBURL + '/')
+ .replace(/src="\/(?=\w)/g, 'src="' + nodeBBURL + '/');
+ }
+
+ XHR.onload = function() {
+ if (XHR.status >= 200 && XHR.status < 400) {
+ var data = JSON.parse(XHR.responseText), html;
+
+ commentsDiv = document.getElementById('nodebb-comments-list');
+ commentsCounter = document.getElementById('nodebb-comments-count');
+ commentsAuthor = document.getElementById('nodebb-comments-author');
+ commentsCategory = document.getElementById('nodebb-comments-category');
+
+ data.relative_path = nodeBBURL;
+ data.redirect_url = articlePath;
+ data.article_id = articleID;
+ data.pagination = pagination;
+ data.postCount = parseInt(data.postCount, 10);
+
+ for (var post in data.posts) {
+ if (data.posts.hasOwnProperty(post)) {
+ data.posts[post].timestamp = timeAgo(parseInt(data.posts[post].timestamp), 10);
+ if (data.posts[post]['blog-comments:url']) {
+ delete data.posts[post];
+ }
}
}
+
+ if (commentsCounter) {
+ commentsCounter.innerHTML = data.postCount ? (data.postCount - 1) : 0;
+ }
- block = block
- .replace(regexes.removeTabspace, '');
+ if (commentsCategory) {
+ commentsCategory.innerHTML = '
' + data.category.name + ' ';
+ }
- result = parseArrayBlock(block, array[key], namespace + key + '.', isObject);
+ if (commentsAuthor) {
+ commentsAuthor.innerHTML = '
' + data.mainPost.user.username + ' ';
+ }
- template = replace(template, regex, result.replace(regexes.removeWhitespace, ''));
- }
+ if (pagination) {
+ console.log(data, templates.blocks);
+ // var html = templates.parse(template, data);
+ html = normalizePost(parse(data, templates.blocks['posts']));
+ commentsDiv.innerHTML = commentsDiv.innerHTML + html;
+ } else {
+ console.log(data, data.template, templates);
+ html = templates.parse(data.template, data);
+ // html = parse(data, data.template);
+ nodebbDiv.innerHTML = normalizePost(html);
+ }
- return template;
- }
+ contentDiv = document.getElementById('nodebb-content');
- function parseArrayBlock(block, array, namespace, isObject) {
- var template = '';
+ setTimeout(function() {
+ var lists = nodebbDiv.getElementsByTagName("li");
+ for (var list in lists) {
+ if (lists.hasOwnProperty(list)) {
+ lists[list].className = '';
+ }
+ }
+ }, 100);
+
+ if (savedText) {
+ contentDiv.value = savedText;
+ }
- for (var iterator in array) {
- if (array.hasOwnProperty(iterator)) {
- var result = '';
+ if (data.tid) {
+ var loadMore = document.getElementById('nodebb-load-more');
+ loadMore.onclick = function() {
+ pagination++;
+ reloadComments();
+ }
+ if (data.posts.length) {
+ loadMore.style.display = 'inline-block';
+ }
- if (!isObject) {
- iterator = parseInt(iterator, 10);
+ if (pagination * 10 + data.posts.length + 1 >= data.postCount) {
+ loadMore.style.display = 'none';
+ }
+
+ if (typeof jQuery !== 'undefined' && jQuery() && jQuery().fitVids) {
+ jQuery(nodebbDiv).fitVids();
+ }
+
+ if (data.user && data.user.uid) {
+ var error = window.location.href.match(/error=[\w-]*/);
+ if (error) {
+ error = error[0].split('=')[1];
+ if (error === 'too-many-posts') {
+ error = 'Please wait before posting so soon.';
+ } else if (error === 'content-too-short') {
+ error = 'Please post a longer reply.';
+ }
+
+ document.getElementById('nodebb-error').innerHTML = error;
+ }
+ } else {
+ document.getElementById('nodebb-register').onclick = function() {
+ authenticate('register');
+ };
+
+ document.getElementById('nodebb-login').onclick = function() {
+ authenticate('login');
+ }
+ }
+ } else if (data.isAdmin) {
+ if (!articleData) {
+ console.error('Declare articleData variable!');
+ return;
}
- result += parse(block, array[iterator], namespace);
+ var translator = document.createElement('span'),
+ gTags = articleData.tags,
+ url = articleData.url,
+ title= articleData.title_plain,
+ cid = articleData.cid || -1,
+ tags = [];
+ translator.innerHTML = articleData.markDownContent;
- if (!isObject) {
- result = checkConditionals(result, '@first', iterator === 0);
- result = checkConditionals(result, '@last', iterator === array.length - 1);
+ var markdown = translator.firstChild.innerHTML + '\n\n**Click [here]('+ url +') to see the full blog post**';
- result = result
- .replace(/@index/g, iterator)
- .replace(/@value/g, array[iterator]);
- } else {
- result = result
- .replace(/@key/g, iterator)
- .replace(/@value/g, array[iterator]);
+ for (var tag in gTags) {
+ if (gTags.hasOwnProperty(tag)) {
+ tags.push(gTags[tag].title);
+ }
}
-
- result = parseFunctions(block, result, array[iterator]);
- template = template + result;
+ document.getElementById('nodebb-content-markdown').value = markdown;
+ document.getElementById('nodebb-content-title').value = title;
+ document.getElementById('nodebb-content-cid').value = cid;
+ document.getElementById('nodebb-content-tags').value = JSON.stringify(tags);
}
}
+ };
- return template;
+ function reloadComments() {
+ XHR.open('GET', nodeBBURL + '/comments/get/' + articleID + '/' + pagination, true);
+ XHR.withCredentials = true;
+ XHR.send();
}
- function parseValue(template, key, value) {
- template = checkConditionals(template, key, value);
- return replaceValue(template, key, value);
- }
+ reloadComments();
- function parse(template, obj, namespace) {
- namespace = namespace || '';
- var key;
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- if (typeof obj[key] === 'undefined' || typeof obj[key] === 'function' || !template.match(key) || (obj[key] && obj[key].constructor === Array)) {
- continue;
- } else if (obj[key] === null) {
- template = replaceValue(template, namespace + key, '');
- } else if (obj[key] instanceof Object) {
- template = parseObject(template, obj, key, namespace);
- template = checkConditionals(template, key, obj[key]);
- template = parse(template, obj[key], namespace + key + '.');
+ function timeAgo(time){
+ var time_formats = [
+ [60, 'seconds', 1],
+ [120, '1 minute ago'],
+ [3600, 'minutes', 60],
+ [7200, '1 hour ago'],
+ [86400, 'hours', 3600],
+ [172800, 'yesterday'],
+ [604800, 'days', 86400],
+ [1209600, 'last week'],
+ [2419200, 'weeks', 604800],
+ [4838400, 'last month'],
+ [29030400, 'months', 2419200],
+ [58060800, 'last year'],
+ [2903040000, 'years', 29030400]
+ ];
+
+ var seconds = (+new Date() - time) / 1000;
+
+ if (seconds < 10) {
+ return 'just now';
+ }
+
+ var i = 0, format;
+ while (format = time_formats[i++]) {
+ if (seconds < format[0]) {
+ if (!format[2]) {
+ return format[1];
} else {
- template = parseValue(template, namespace + key, obj[key]);
+ return Math.floor(seconds / format[2]) + ' ' + format[1] + ' ago';
}
}
}
+ return time;
+ }
- for (key in obj) {
- if (obj.hasOwnProperty(key) && Array.isArray(obj[key]) && template.match(key)) {
- template = replaceValue(template, namespace + key + '.length', obj[key].length);
- template = parseArray(template, obj, key, namespace);
- }
+ var templates = {blocks: {}};
+ function parse (data, template) {
+ function replace(key, value, template) {
+ var searchRegex = new RegExp('{' + key + '}', 'g');
+ return template.replace(searchRegex, value);
}
+ function makeRegex(block) {
+ return new RegExp("[\\s\\S]*", 'g');
+ }
- if (namespace) {
- namespace = '';
- } else {
- template = checkConditionalHelpers(template, obj);
- template = cleanup(template, obj);
+ function makeConditionalRegex(block) {
+ return new RegExp("([\\s\\S]*?)", 'g');
}
- return template;
- }
+ function getBlock(regex, block, template) {
+ data = template.match(regex);
+ if (data == null) return;
- function cleanup(template, obj) {
- template = template
- .replace(regexes.cleanupEmptyLoops, '');
+ if (block !== undefined) templates.blocks[block] = data[0];
- var missingKeys = template.match(regexes.cleanupMissingKeys) || [];
+ var begin = new RegExp("(\r\n)*(\r\n)*", "g"),
+ end = new RegExp("(\r\n)*(\r\n)*", "g"),
- for (var i = 0, ii = missingKeys.length; i < ii; i++) {
- if (missingKeys[i].substr(0, 1) !== '/') {
- template = template.replace(missingKeys[i], '');
- } else {
- template = template.replace(missingKeys[i], missingKeys[i].slice(1));
- }
+ data = data[0]
+ .replace(begin, "")
+ .replace(end, "");
+
+ return data;
}
- var keysToReparse = {},
- undefinedKeys = template.match(regexes.getUndefinedKeys) || [];
+ function setBlock(regex, block, template) {
+ return template.replace(regex, block);
+ }
- for (var i = 0, ii = undefinedKeys.length; i < ii; i++) {
- var undefinedKey = regexes.getUndefinedKeys.exec(undefinedKeys[i]);
+ var regex, block;
- if (undefinedKey) {
- keysToReparse[undefinedKey[1]] = false;
+ return (function parse(data, namespace, template, blockInfo) {
+ if (!data || data.length == 0) {
+ template = '';
}
- }
- var leftoverRoot = template.match(regexes.leftoverRoot) || [];
+ function checkConditional(key, value) {
+ var conditional = makeConditionalRegex(key),
+ matches = template.match(conditional);
- for (var i = 0, ii = leftoverRoot.length; i < ii; i++) {
- var key = regexes.leftoverRoot.exec(leftoverRoot[i]);
+ if (matches !== null) {
+ for (var i = 0, ii = matches.length; i < ii; i++) {
+ var conditionalBlock = matches[i].split(//);
- if (key) {
- key = key[1].split('.')[0];
+ var statement = new RegExp("()|()", 'gi');
- if (obj[key]) {
- keysToReparse['../' + key] = obj[key];
+ if (conditionalBlock[1]) {
+ // there is an else statement
+ if (!value) {
+ template = template.replace(matches[i], conditionalBlock[1].replace(statement, ''));
+ } else {
+ template = template.replace(matches[i], conditionalBlock[0].replace(statement, ''));
+ }
+ } else {
+ // regular if statement
+ if (!value) {
+ template = template.replace(matches[i], '');
+ } else {
+ template = template.replace(matches[i], matches[i].replace(statement, ''));
+ }
+ }
+ }
}
}
- }
- var parseUndefined = false;
+ for (var d in data) {
+ if (data.hasOwnProperty(d)) {
+ if (typeof data[d] === 'undefined') {
+ continue;
+ } else if (data[d] === null) {
+ template = replace(namespace + d, '', template);
+ } else if (data[d].constructor == Array) {
+ checkConditional(namespace + d + '.length', data[d].length);
+ checkConditional('!' + namespace + d + '.length', !data[d].length);
- for(var prop in keysToReparse) {
- if (keysToReparse.hasOwnProperty(prop)) {
- parseUndefined = true;
- break;
+ namespace += d + '.';
+
+ var regex = makeRegex(d),
+ block = getBlock(regex, namespace.substring(0, namespace.length - 1), template);
+
+ if (block == null) {
+ namespace = namespace.replace(d + '.', '');
+ continue;
+ }
+
+ var numblocks = data[d].length - 1,
+ i = 0,
+ result = "";
+
+ do {
+ result += parse(data[d][i], namespace, block, {iterator: i, total: numblocks});
+ } while (i++ < numblocks);
+
+ namespace = namespace.replace(d + '.', '');
+ template = setBlock(regex, result, template);
+ } else if (data[d] instanceof Object) {
+ template = parse(data[d], d + '.', template);
+ } else {
+ var key = namespace + d,
+ value = typeof data[d] === 'string' ? data[d].replace(/^\s+|\s+$/g, '') : data[d];
+
+ checkConditional(key, value);
+ checkConditional('!' + key, !value);
+
+ if (blockInfo && blockInfo.iterator) {
+ checkConditional('@first', blockInfo.iterator === 0);
+ checkConditional('!@first', blockInfo.iterator !== 0);
+ checkConditional('@last', blockInfo.iterator === blockInfo.total);
+ checkConditional('!@last', blockInfo.iterator !== blockInfo.total);
+ }
+
+ template = replace(key, value, template);
+ }
+ }
}
- }
- return parseUndefined ? parse(template, keysToReparse, '') : template;
- }
+ if (namespace) {
+ var regex = new RegExp("{" + namespace + "[\\s\\S]*?}", 'g');
+ template = template.replace(regex, '');
+ namespace = '';
+ } else {
+ // clean up all undefined conditionals
+ template = template.replace(//gi, 'ENDIF -->')
+ .replace(//gi, '');
+ }
- module.exports = templates;
- module.exports.__express = express;
+ return template;
- if ('undefined' !== typeof window) {
- window.templates = module.exports;
+ })(data, "", template);
}
+}());
-})('undefined' === typeof module ? {
- module: {
- exports: {}
- }
-} : module);
From 10ee330c34ae1e91d14557933c34c8b71106b780 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 15:42:01 -0500
Subject: [PATCH 10/36] Oops
---
public/lib/general.js | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index 16047b30..7e485600 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -479,7 +479,6 @@
module.exports.__express = express;
if ('undefined' !== typeof window) {
- console.log("nice!");
window.templates = module.exports;
}
@@ -579,8 +578,8 @@
html = normalizePost(parse(data, templates.blocks['posts']));
commentsDiv.innerHTML = commentsDiv.innerHTML + html;
} else {
- console.log(data, data.template, templates);
- html = templates.parse(data.template, data);
+ console.log(data, data.template, window.templates);
+ html = window.templates.parse(data.template, data);
// html = parse(data, data.template);
nodebbDiv.innerHTML = normalizePost(html);
}
From 1b5b7171c8298381ad1de299fc05b3ace9c6d54f Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 15:49:19 -0500
Subject: [PATCH 11/36] Move
---
public/lib/general.js | 1043 ++++++++++++++++++++---------------------
1 file changed, 520 insertions(+), 523 deletions(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index 7e485600..94c1a2f6 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -1,3 +1,363 @@
+(function() {
+ "use strict";
+
+ var articlePath = window.location.protocol + '//' + window.location.host + window.location.pathname;
+
+ var pluginURL = nodeBBURL + '/plugins/nodebb-plugin-blog-comments',
+ savedText, nodebbDiv, contentDiv, commentsDiv, commentsCounter, commentsAuthor, commentsCategory;
+
+ var stylesheet = document.createElement("link");
+ stylesheet.setAttribute("rel", "stylesheet");
+ stylesheet.setAttribute("type", "text/css");
+ stylesheet.setAttribute("href", pluginURL + '/css/comments.css');
+
+ document.getElementsByTagName("head")[0].appendChild(stylesheet);
+ document.getElementById('nodebb-comments').insertAdjacentHTML('beforebegin', '
');
+ nodebbDiv = document.getElementById('nodebb');
+
+ function newXHR() {
+ try {
+ return XHR = new XMLHttpRequest();
+ } catch (e) {
+ try {
+ return XHR = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e) {
+ return XHR = new ActiveXObject("Msxml2.XMLHTTP");
+ }
+ }
+ }
+
+ var XHR = newXHR(), pagination = 0, modal;
+
+ function authenticate(type) {
+ savedText = contentDiv.value;
+ modal = window.open(nodeBBURL + "/" + type + "/#blog/authenticate","_blank","toolbar=no, scrollbars=no, resizable=no, width=600, height=675");
+ var timer = setInterval(function() {
+ if(modal.closed) {
+ clearInterval(timer);
+ pagination = 0;
+ reloadComments();
+ }
+ }, 500);
+ }
+
+ function normalizePost(post) {
+ return post.replace(/href="\/(?=\w)/g, 'href="' + nodeBBURL + '/')
+ .replace(/src="\/(?=\w)/g, 'src="' + nodeBBURL + '/');
+ }
+
+ XHR.onload = function() {
+ if (XHR.status >= 200 && XHR.status < 400) {
+ var data = JSON.parse(XHR.responseText), html;
+
+ commentsDiv = document.getElementById('nodebb-comments-list');
+ commentsCounter = document.getElementById('nodebb-comments-count');
+ commentsAuthor = document.getElementById('nodebb-comments-author');
+ commentsCategory = document.getElementById('nodebb-comments-category');
+
+ data.relative_path = nodeBBURL;
+ data.redirect_url = articlePath;
+ data.article_id = articleID;
+ data.pagination = pagination;
+ data.postCount = parseInt(data.postCount, 10);
+
+ for (var post in data.posts) {
+ if (data.posts.hasOwnProperty(post)) {
+ data.posts[post].timestamp = timeAgo(parseInt(data.posts[post].timestamp), 10);
+ if (data.posts[post]['blog-comments:url']) {
+ delete data.posts[post];
+ }
+ }
+ }
+
+ if (commentsCounter) {
+ commentsCounter.innerHTML = data.postCount ? (data.postCount - 1) : 0;
+ }
+
+ if (commentsCategory) {
+ commentsCategory.innerHTML = '
' + data.category.name + ' ';
+ }
+
+ if (commentsAuthor) {
+ commentsAuthor.innerHTML = '
' + data.mainPost.user.username + ' ';
+ }
+
+ if (pagination) {
+ console.log(data, templates.blocks);
+ // var html = templates.parse(template, data);
+ html = normalizePost(parse(data, templates.blocks['posts']));
+ commentsDiv.innerHTML = commentsDiv.innerHTML + html;
+ } else {
+ html = window.templates.parse(data.template, data);
+ nodebbDiv.innerHTML = normalizePost(html);
+ }
+
+ contentDiv = document.getElementById('nodebb-content');
+
+ setTimeout(function() {
+ var lists = nodebbDiv.getElementsByTagName("li");
+ for (var list in lists) {
+ if (lists.hasOwnProperty(list)) {
+ lists[list].className = '';
+ }
+ }
+ }, 100);
+
+ if (savedText) {
+ contentDiv.value = savedText;
+ }
+
+ if (data.tid) {
+ var loadMore = document.getElementById('nodebb-load-more');
+ loadMore.onclick = function() {
+ pagination++;
+ reloadComments();
+ }
+ if (data.posts.length) {
+ loadMore.style.display = 'inline-block';
+ }
+
+ if (pagination * 10 + data.posts.length + 1 >= data.postCount) {
+ loadMore.style.display = 'none';
+ }
+
+ if (typeof jQuery !== 'undefined' && jQuery() && jQuery().fitVids) {
+ jQuery(nodebbDiv).fitVids();
+ }
+
+ if (data.user && data.user.uid) {
+ var error = window.location.href.match(/error=[\w-]*/);
+ if (error) {
+ error = error[0].split('=')[1];
+ if (error === 'too-many-posts') {
+ error = 'Please wait before posting so soon.';
+ } else if (error === 'content-too-short') {
+ error = 'Please post a longer reply.';
+ }
+
+ document.getElementById('nodebb-error').innerHTML = error;
+ }
+ } else {
+ document.getElementById('nodebb-register').onclick = function() {
+ authenticate('register');
+ };
+
+ document.getElementById('nodebb-login').onclick = function() {
+ authenticate('login');
+ }
+ }
+ } else if (data.isAdmin) {
+ if (!articleData) {
+ console.error('Declare articleData variable!');
+ return;
+ }
+
+ var translator = document.createElement('span'),
+ gTags = articleData.tags,
+ url = articleData.url,
+ title= articleData.title_plain,
+ cid = articleData.cid || -1,
+ tags = [];
+ translator.innerHTML = articleData.markDownContent;
+
+ var markdown = translator.firstChild.innerHTML + '\n\n**Click [here]('+ url +') to see the full blog post**';
+
+ for (var tag in gTags) {
+ if (gTags.hasOwnProperty(tag)) {
+ tags.push(gTags[tag].title);
+ }
+ }
+ document.getElementById('nodebb-content-markdown').value = markdown;
+ document.getElementById('nodebb-content-title').value = title;
+ document.getElementById('nodebb-content-cid').value = cid;
+ document.getElementById('nodebb-content-tags').value = JSON.stringify(tags);
+ }
+ }
+ };
+
+ function reloadComments() {
+ XHR.open('GET', nodeBBURL + '/comments/get/' + articleID + '/' + pagination, true);
+ XHR.withCredentials = true;
+ XHR.send();
+ }
+
+ reloadComments();
+
+
+ function timeAgo(time){
+ var time_formats = [
+ [60, 'seconds', 1],
+ [120, '1 minute ago'],
+ [3600, 'minutes', 60],
+ [7200, '1 hour ago'],
+ [86400, 'hours', 3600],
+ [172800, 'yesterday'],
+ [604800, 'days', 86400],
+ [1209600, 'last week'],
+ [2419200, 'weeks', 604800],
+ [4838400, 'last month'],
+ [29030400, 'months', 2419200],
+ [58060800, 'last year'],
+ [2903040000, 'years', 29030400]
+ ];
+
+ var seconds = (+new Date() - time) / 1000;
+
+ if (seconds < 10) {
+ return 'just now';
+ }
+
+ var i = 0, format;
+ while (format = time_formats[i++]) {
+ if (seconds < format[0]) {
+ if (!format[2]) {
+ return format[1];
+ } else {
+ return Math.floor(seconds / format[2]) + ' ' + format[1] + ' ago';
+ }
+ }
+ }
+ return time;
+ }
+
+ var templates = {blocks: {}};
+ function parse (data, template) {
+ function replace(key, value, template) {
+ var searchRegex = new RegExp('{' + key + '}', 'g');
+ return template.replace(searchRegex, value);
+ }
+
+ function makeRegex(block) {
+ return new RegExp("[\\s\\S]*", 'g');
+ }
+
+ function makeConditionalRegex(block) {
+ return new RegExp("([\\s\\S]*?)", 'g');
+ }
+
+ function getBlock(regex, block, template) {
+ data = template.match(regex);
+ if (data == null) return;
+
+ if (block !== undefined) templates.blocks[block] = data[0];
+
+ var begin = new RegExp("(\r\n)*(\r\n)*", "g"),
+ end = new RegExp("(\r\n)*(\r\n)*", "g"),
+
+ data = data[0]
+ .replace(begin, "")
+ .replace(end, "");
+
+ return data;
+ }
+
+ function setBlock(regex, block, template) {
+ return template.replace(regex, block);
+ }
+
+ var regex, block;
+
+ return (function parse(data, namespace, template, blockInfo) {
+ if (!data || data.length == 0) {
+ template = '';
+ }
+
+ function checkConditional(key, value) {
+ var conditional = makeConditionalRegex(key),
+ matches = template.match(conditional);
+
+ if (matches !== null) {
+ for (var i = 0, ii = matches.length; i < ii; i++) {
+ var conditionalBlock = matches[i].split(//);
+
+ var statement = new RegExp("()|()", 'gi');
+
+ if (conditionalBlock[1]) {
+ // there is an else statement
+ if (!value) {
+ template = template.replace(matches[i], conditionalBlock[1].replace(statement, ''));
+ } else {
+ template = template.replace(matches[i], conditionalBlock[0].replace(statement, ''));
+ }
+ } else {
+ // regular if statement
+ if (!value) {
+ template = template.replace(matches[i], '');
+ } else {
+ template = template.replace(matches[i], matches[i].replace(statement, ''));
+ }
+ }
+ }
+ }
+ }
+
+ for (var d in data) {
+ if (data.hasOwnProperty(d)) {
+ if (typeof data[d] === 'undefined') {
+ continue;
+ } else if (data[d] === null) {
+ template = replace(namespace + d, '', template);
+ } else if (data[d].constructor == Array) {
+ checkConditional(namespace + d + '.length', data[d].length);
+ checkConditional('!' + namespace + d + '.length', !data[d].length);
+
+ namespace += d + '.';
+
+ var regex = makeRegex(d),
+ block = getBlock(regex, namespace.substring(0, namespace.length - 1), template);
+
+ if (block == null) {
+ namespace = namespace.replace(d + '.', '');
+ continue;
+ }
+
+ var numblocks = data[d].length - 1,
+ i = 0,
+ result = "";
+
+ do {
+ result += parse(data[d][i], namespace, block, {iterator: i, total: numblocks});
+ } while (i++ < numblocks);
+
+ namespace = namespace.replace(d + '.', '');
+ template = setBlock(regex, result, template);
+ } else if (data[d] instanceof Object) {
+ template = parse(data[d], d + '.', template);
+ } else {
+ var key = namespace + d,
+ value = typeof data[d] === 'string' ? data[d].replace(/^\s+|\s+$/g, '') : data[d];
+
+ checkConditional(key, value);
+ checkConditional('!' + key, !value);
+
+ if (blockInfo && blockInfo.iterator) {
+ checkConditional('@first', blockInfo.iterator === 0);
+ checkConditional('!@first', blockInfo.iterator !== 0);
+ checkConditional('@last', blockInfo.iterator === blockInfo.total);
+ checkConditional('!@last', blockInfo.iterator !== blockInfo.total);
+ }
+
+ template = replace(key, value, template);
+ }
+ }
+ }
+
+ if (namespace) {
+ var regex = new RegExp("{" + namespace + "[\\s\\S]*?}", 'g');
+ template = template.replace(regex, '');
+ namespace = '';
+ } else {
+ // clean up all undefined conditionals
+ template = template.replace(//gi, 'ENDIF -->')
+ .replace(//gi, '');
+ }
+
+ return template;
+
+ })(data, "", template);
+ }
+}());
+
// https://raw.githubusercontent.com/benchpressjs/benchpressjs/v0.3.1/lib/templates.js
(function(module) {
@@ -241,612 +601,249 @@
for (var x = 0, xx = nestedConditionals.length; x < xx; x++) {
template = replace(template, '', nestedConditionals[x]);
}
- }
- }
- }
-
- return template;
- }
-
- function checkConditionalHelpers(template, obj) {
- var string,
- func;
-
-
- while ((string = template.match(regexes.conditionalHelper)) !== null) {
- var fn = string[1].trim(),
- args = fn.split(regexes.conditionalArgs);
-
- func = args[0];
-
- if (helpers[func]) {
- args.shift();
- args.unshift(obj);
- template = checkConditionals(template, 'function.' + fn, helpers[func].apply(null, args));
- } else {
- template = template.replace(makeConditionalRegex('function.' + fn));
- }
- }
-
- return template;
- }
-
- function callMethod(method, parameters) {
- return method.apply(templates, parameters);
- }
-
- function parseFunctions(block, result, obj) {
- var functions = block.match(/{function.*?}/g, '');
- if (!functions) {
- return result;
- }
-
- for (var i=0, ii=functions.length; i
')
- .replace(regexes.rootKey, '{' + namespace + key + '.$1}')
- .replace(regexes.rootConditional, 'IF ' + namespace + key + '.$1')
- .replace(regexes.rootConditionalFalse, 'IF !' + namespace + key + '.$1');
-
- if (innerLoops) {
- for (var x = 0, xx = innerLoops.length; x < xx; x++) {
- block = replace(block, '', innerLoops[x]);
- }
- }
-
- block = block
- .replace(regexes.removeTabspace, '');
-
- result = parseArrayBlock(block, array[key], namespace + key + '.', isObject);
-
- template = replace(template, regex, result.replace(regexes.removeWhitespace, ''));
- }
-
- return template;
- }
-
- function parseArrayBlock(block, array, namespace, isObject) {
- var template = '';
-
- for (var iterator in array) {
- if (array.hasOwnProperty(iterator)) {
- var result = '';
-
- if (!isObject) {
- iterator = parseInt(iterator, 10);
- }
-
- result += parse(block, array[iterator], namespace);
-
- if (!isObject) {
- result = checkConditionals(result, '@first', iterator === 0);
- result = checkConditionals(result, '@last', iterator === array.length - 1);
-
- result = result
- .replace(/@index/g, iterator)
- .replace(/@value/g, array[iterator]);
- } else {
- result = result
- .replace(/@key/g, iterator)
- .replace(/@value/g, array[iterator]);
- }
-
- result = parseFunctions(block, result, array[iterator]);
- template = template + result;
- }
- }
-
- return template;
- }
-
- function parseValue(template, key, value) {
- template = checkConditionals(template, key, value);
- return replaceValue(template, key, value);
- }
-
- function parse(template, obj, namespace) {
-
- namespace = namespace || '';
- var key;
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- if (typeof obj[key] === 'undefined' || typeof obj[key] === 'function' || !template.match(key) || (obj[key] && obj[key].constructor === Array)) {
- continue;
- } else if (obj[key] === null) {
- template = replaceValue(template, namespace + key, '');
- } else if (obj[key] instanceof Object) {
- template = parseObject(template, obj, key, namespace);
- template = checkConditionals(template, key, obj[key]);
- template = parse(template, obj[key], namespace + key + '.');
- } else {
- template = parseValue(template, namespace + key, obj[key]);
- }
- }
- }
-
- for (key in obj) {
- if (obj.hasOwnProperty(key) && Array.isArray(obj[key]) && template.match(key)) {
- template = replaceValue(template, namespace + key + '.length', obj[key].length);
- template = parseArray(template, obj, key, namespace);
+ }
}
}
-
- if (namespace) {
- namespace = '';
- } else {
- template = checkConditionalHelpers(template, obj);
- template = cleanup(template, obj);
- }
-
return template;
}
- function cleanup(template, obj) {
- template = template
- .replace(regexes.cleanupEmptyLoops, '');
+ function checkConditionalHelpers(template, obj) {
+ var string,
+ func;
- var missingKeys = template.match(regexes.cleanupMissingKeys) || [];
- for (var i = 0, ii = missingKeys.length; i < ii; i++) {
- if (missingKeys[i].substr(0, 1) !== '/') {
- template = template.replace(missingKeys[i], '');
+ while ((string = template.match(regexes.conditionalHelper)) !== null) {
+ var fn = string[1].trim(),
+ args = fn.split(regexes.conditionalArgs);
+
+ func = args[0];
+
+ if (helpers[func]) {
+ args.shift();
+ args.unshift(obj);
+ template = checkConditionals(template, 'function.' + fn, helpers[func].apply(null, args));
} else {
- template = template.replace(missingKeys[i], missingKeys[i].slice(1));
+ template = template.replace(makeConditionalRegex('function.' + fn));
}
}
- var keysToReparse = {},
- undefinedKeys = template.match(regexes.getUndefinedKeys) || [];
+ return template;
+ }
- for (var i = 0, ii = undefinedKeys.length; i < ii; i++) {
- var undefinedKey = regexes.getUndefinedKeys.exec(undefinedKeys[i]);
+ function callMethod(method, parameters) {
+ return method.apply(templates, parameters);
+ }
- if (undefinedKey) {
- keysToReparse[undefinedKey[1]] = false;
- }
+ function parseFunctions(block, result, obj) {
+ var functions = block.match(/{function.*?}/g, '');
+ if (!functions) {
+ return result;
}
- var leftoverRoot = template.match(regexes.leftoverRoot) || [];
-
- for (var i = 0, ii = leftoverRoot.length; i < ii; i++) {
- var key = regexes.leftoverRoot.exec(leftoverRoot[i]);
-
- if (key) {
- key = key[1].split('.')[0];
+ for (var i=0, ii=functions.length; i ');
- nodebbDiv = document.getElementById('nodebb');
-
- function newXHR() {
- try {
- return XHR = new XMLHttpRequest();
- } catch (e) {
- try {
- return XHR = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {
- return XHR = new ActiveXObject("Msxml2.XMLHTTP");
- }
- }
- }
-
- var XHR = newXHR(), pagination = 0, modal;
-
- function authenticate(type) {
- savedText = contentDiv.value;
- modal = window.open(nodeBBURL + "/" + type + "/#blog/authenticate","_blank","toolbar=no, scrollbars=no, resizable=no, width=600, height=675");
- var timer = setInterval(function() {
- if(modal.closed) {
- clearInterval(timer);
- pagination = 0;
- reloadComments();
- }
- }, 500);
+ return result;
}
- function normalizePost(post) {
- return post.replace(/href="\/(?=\w)/g, 'href="' + nodeBBURL + '/')
- .replace(/src="\/(?=\w)/g, 'src="' + nodeBBURL + '/');
+ function parseObject(template, array, key, namespace) {
+ return parseArray(template, array, key, namespace, true);
}
- XHR.onload = function() {
- if (XHR.status >= 200 && XHR.status < 400) {
- var data = JSON.parse(XHR.responseText), html;
-
- commentsDiv = document.getElementById('nodebb-comments-list');
- commentsCounter = document.getElementById('nodebb-comments-count');
- commentsAuthor = document.getElementById('nodebb-comments-author');
- commentsCategory = document.getElementById('nodebb-comments-category');
+ function parseArray(template, array, key, namespace, isObject) {
- data.relative_path = nodeBBURL;
- data.redirect_url = articlePath;
- data.article_id = articleID;
- data.pagination = pagination;
- data.postCount = parseInt(data.postCount, 10);
+ if (!isObject) {
+ template = checkConditionals(template, namespace + key + '.length', array[key].length);
+ }
- for (var post in data.posts) {
- if (data.posts.hasOwnProperty(post)) {
- data.posts[post].timestamp = timeAgo(parseInt(data.posts[post].timestamp), 10);
- if (data.posts[post]['blog-comments:url']) {
- delete data.posts[post];
- }
- }
- }
-
- if (commentsCounter) {
- commentsCounter.innerHTML = data.postCount ? (data.postCount - 1) : 0;
- }
+ var regex = makeRegex(key, namespace), block, result;
- if (commentsCategory) {
- commentsCategory.innerHTML = '
' + data.category.name + ' ';
- }
+ if (!array[key].length && !isObject) {
+ return template.replace(regex, '');
+ }
- if (commentsAuthor) {
- commentsAuthor.innerHTML = '
' + data.mainPost.user.username + ' ';
- }
+ while ((block = template.match(regex)) !== null) {
+ block = block[0].replace(makeBlockRegex(key, namespace), '');
- if (pagination) {
- console.log(data, templates.blocks);
- // var html = templates.parse(template, data);
- html = normalizePost(parse(data, templates.blocks['posts']));
- commentsDiv.innerHTML = commentsDiv.innerHTML + html;
- } else {
- console.log(data, data.template, window.templates);
- html = window.templates.parse(data.template, data);
- // html = parse(data, data.template);
- nodebbDiv.innerHTML = normalizePost(html);
- }
+ var innerLoops = block.match(regexes.innerLoop);
- contentDiv = document.getElementById('nodebb-content');
+ block = block
+ .replace(regexes.innerLoop, '')
+ .replace(regexes.rootKey, '{' + namespace + key + '.$1}')
+ .replace(regexes.rootConditional, 'IF ' + namespace + key + '.$1')
+ .replace(regexes.rootConditionalFalse, 'IF !' + namespace + key + '.$1');
- setTimeout(function() {
- var lists = nodebbDiv.getElementsByTagName("li");
- for (var list in lists) {
- if (lists.hasOwnProperty(list)) {
- lists[list].className = '';
- }
+ if (innerLoops) {
+ for (var x = 0, xx = innerLoops.length; x < xx; x++) {
+ block = replace(block, '', innerLoops[x]);
}
- }, 100);
-
- if (savedText) {
- contentDiv.value = savedText;
}
- if (data.tid) {
- var loadMore = document.getElementById('nodebb-load-more');
- loadMore.onclick = function() {
- pagination++;
- reloadComments();
- }
- if (data.posts.length) {
- loadMore.style.display = 'inline-block';
- }
+ block = block
+ .replace(regexes.removeTabspace, '');
- if (pagination * 10 + data.posts.length + 1 >= data.postCount) {
- loadMore.style.display = 'none';
- }
+ result = parseArrayBlock(block, array[key], namespace + key + '.', isObject);
- if (typeof jQuery !== 'undefined' && jQuery() && jQuery().fitVids) {
- jQuery(nodebbDiv).fitVids();
- }
+ template = replace(template, regex, result.replace(regexes.removeWhitespace, ''));
+ }
- if (data.user && data.user.uid) {
- var error = window.location.href.match(/error=[\w-]*/);
- if (error) {
- error = error[0].split('=')[1];
- if (error === 'too-many-posts') {
- error = 'Please wait before posting so soon.';
- } else if (error === 'content-too-short') {
- error = 'Please post a longer reply.';
- }
+ return template;
+ }
- document.getElementById('nodebb-error').innerHTML = error;
- }
- } else {
- document.getElementById('nodebb-register').onclick = function() {
- authenticate('register');
- };
+ function parseArrayBlock(block, array, namespace, isObject) {
+ var template = '';
- document.getElementById('nodebb-login').onclick = function() {
- authenticate('login');
- }
- }
- } else if (data.isAdmin) {
- if (!articleData) {
- console.error('Declare articleData variable!');
- return;
+ for (var iterator in array) {
+ if (array.hasOwnProperty(iterator)) {
+ var result = '';
+
+ if (!isObject) {
+ iterator = parseInt(iterator, 10);
}
- var translator = document.createElement('span'),
- gTags = articleData.tags,
- url = articleData.url,
- title= articleData.title_plain,
- cid = articleData.cid || -1,
- tags = [];
- translator.innerHTML = articleData.markDownContent;
+ result += parse(block, array[iterator], namespace);
- var markdown = translator.firstChild.innerHTML + '\n\n**Click [here]('+ url +') to see the full blog post**';
+ if (!isObject) {
+ result = checkConditionals(result, '@first', iterator === 0);
+ result = checkConditionals(result, '@last', iterator === array.length - 1);
- for (var tag in gTags) {
- if (gTags.hasOwnProperty(tag)) {
- tags.push(gTags[tag].title);
- }
+ result = result
+ .replace(/@index/g, iterator)
+ .replace(/@value/g, array[iterator]);
+ } else {
+ result = result
+ .replace(/@key/g, iterator)
+ .replace(/@value/g, array[iterator]);
}
- document.getElementById('nodebb-content-markdown').value = markdown;
- document.getElementById('nodebb-content-title').value = title;
- document.getElementById('nodebb-content-cid').value = cid;
- document.getElementById('nodebb-content-tags').value = JSON.stringify(tags);
+
+ result = parseFunctions(block, result, array[iterator]);
+ template = template + result;
}
}
- };
- function reloadComments() {
- XHR.open('GET', nodeBBURL + '/comments/get/' + articleID + '/' + pagination, true);
- XHR.withCredentials = true;
- XHR.send();
+ return template;
}
- reloadComments();
-
-
- function timeAgo(time){
- var time_formats = [
- [60, 'seconds', 1],
- [120, '1 minute ago'],
- [3600, 'minutes', 60],
- [7200, '1 hour ago'],
- [86400, 'hours', 3600],
- [172800, 'yesterday'],
- [604800, 'days', 86400],
- [1209600, 'last week'],
- [2419200, 'weeks', 604800],
- [4838400, 'last month'],
- [29030400, 'months', 2419200],
- [58060800, 'last year'],
- [2903040000, 'years', 29030400]
- ];
+ function parseValue(template, key, value) {
+ template = checkConditionals(template, key, value);
+ return replaceValue(template, key, value);
+ }
- var seconds = (+new Date() - time) / 1000;
+ function parse(template, obj, namespace) {
- if (seconds < 10) {
- return 'just now';
- }
-
- var i = 0, format;
- while (format = time_formats[i++]) {
- if (seconds < format[0]) {
- if (!format[2]) {
- return format[1];
+ namespace = namespace || '';
+ var key;
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ if (typeof obj[key] === 'undefined' || typeof obj[key] === 'function' || !template.match(key) || (obj[key] && obj[key].constructor === Array)) {
+ continue;
+ } else if (obj[key] === null) {
+ template = replaceValue(template, namespace + key, '');
+ } else if (obj[key] instanceof Object) {
+ template = parseObject(template, obj, key, namespace);
+ template = checkConditionals(template, key, obj[key]);
+ template = parse(template, obj[key], namespace + key + '.');
} else {
- return Math.floor(seconds / format[2]) + ' ' + format[1] + ' ago';
+ template = parseValue(template, namespace + key, obj[key]);
}
}
}
- return time;
- }
- var templates = {blocks: {}};
- function parse (data, template) {
- function replace(key, value, template) {
- var searchRegex = new RegExp('{' + key + '}', 'g');
- return template.replace(searchRegex, value);
+ for (key in obj) {
+ if (obj.hasOwnProperty(key) && Array.isArray(obj[key]) && template.match(key)) {
+ template = replaceValue(template, namespace + key + '.length', obj[key].length);
+ template = parseArray(template, obj, key, namespace);
+ }
}
- function makeRegex(block) {
- return new RegExp("[\\s\\S]*", 'g');
- }
- function makeConditionalRegex(block) {
- return new RegExp("([\\s\\S]*?)", 'g');
+ if (namespace) {
+ namespace = '';
+ } else {
+ template = checkConditionalHelpers(template, obj);
+ template = cleanup(template, obj);
}
- function getBlock(regex, block, template) {
- data = template.match(regex);
- if (data == null) return;
-
- if (block !== undefined) templates.blocks[block] = data[0];
+ return template;
+ }
- var begin = new RegExp("(\r\n)*(\r\n)*", "g"),
- end = new RegExp("(\r\n)*(\r\n)*", "g"),
+ function cleanup(template, obj) {
+ template = template
+ .replace(regexes.cleanupEmptyLoops, '');
- data = data[0]
- .replace(begin, "")
- .replace(end, "");
+ var missingKeys = template.match(regexes.cleanupMissingKeys) || [];
- return data;
+ for (var i = 0, ii = missingKeys.length; i < ii; i++) {
+ if (missingKeys[i].substr(0, 1) !== '/') {
+ template = template.replace(missingKeys[i], '');
+ } else {
+ template = template.replace(missingKeys[i], missingKeys[i].slice(1));
+ }
}
- function setBlock(regex, block, template) {
- return template.replace(regex, block);
- }
+ var keysToReparse = {},
+ undefinedKeys = template.match(regexes.getUndefinedKeys) || [];
- var regex, block;
+ for (var i = 0, ii = undefinedKeys.length; i < ii; i++) {
+ var undefinedKey = regexes.getUndefinedKeys.exec(undefinedKeys[i]);
- return (function parse(data, namespace, template, blockInfo) {
- if (!data || data.length == 0) {
- template = '';
+ if (undefinedKey) {
+ keysToReparse[undefinedKey[1]] = false;
}
+ }
- function checkConditional(key, value) {
- var conditional = makeConditionalRegex(key),
- matches = template.match(conditional);
+ var leftoverRoot = template.match(regexes.leftoverRoot) || [];
- if (matches !== null) {
- for (var i = 0, ii = matches.length; i < ii; i++) {
- var conditionalBlock = matches[i].split(//);
+ for (var i = 0, ii = leftoverRoot.length; i < ii; i++) {
+ var key = regexes.leftoverRoot.exec(leftoverRoot[i]);
- var statement = new RegExp("()|()", 'gi');
+ if (key) {
+ key = key[1].split('.')[0];
- if (conditionalBlock[1]) {
- // there is an else statement
- if (!value) {
- template = template.replace(matches[i], conditionalBlock[1].replace(statement, ''));
- } else {
- template = template.replace(matches[i], conditionalBlock[0].replace(statement, ''));
- }
- } else {
- // regular if statement
- if (!value) {
- template = template.replace(matches[i], '');
- } else {
- template = template.replace(matches[i], matches[i].replace(statement, ''));
- }
- }
- }
+ if (obj[key]) {
+ keysToReparse['../' + key] = obj[key];
}
}
+ }
- for (var d in data) {
- if (data.hasOwnProperty(d)) {
- if (typeof data[d] === 'undefined') {
- continue;
- } else if (data[d] === null) {
- template = replace(namespace + d, '', template);
- } else if (data[d].constructor == Array) {
- checkConditional(namespace + d + '.length', data[d].length);
- checkConditional('!' + namespace + d + '.length', !data[d].length);
-
- namespace += d + '.';
-
- var regex = makeRegex(d),
- block = getBlock(regex, namespace.substring(0, namespace.length - 1), template);
-
- if (block == null) {
- namespace = namespace.replace(d + '.', '');
- continue;
- }
-
- var numblocks = data[d].length - 1,
- i = 0,
- result = "";
-
- do {
- result += parse(data[d][i], namespace, block, {iterator: i, total: numblocks});
- } while (i++ < numblocks);
-
- namespace = namespace.replace(d + '.', '');
- template = setBlock(regex, result, template);
- } else if (data[d] instanceof Object) {
- template = parse(data[d], d + '.', template);
- } else {
- var key = namespace + d,
- value = typeof data[d] === 'string' ? data[d].replace(/^\s+|\s+$/g, '') : data[d];
-
- checkConditional(key, value);
- checkConditional('!' + key, !value);
-
- if (blockInfo && blockInfo.iterator) {
- checkConditional('@first', blockInfo.iterator === 0);
- checkConditional('!@first', blockInfo.iterator !== 0);
- checkConditional('@last', blockInfo.iterator === blockInfo.total);
- checkConditional('!@last', blockInfo.iterator !== blockInfo.total);
- }
+ var parseUndefined = false;
- template = replace(key, value, template);
- }
- }
+ for(var prop in keysToReparse) {
+ if (keysToReparse.hasOwnProperty(prop)) {
+ parseUndefined = true;
+ break;
}
+ }
- if (namespace) {
- var regex = new RegExp("{" + namespace + "[\\s\\S]*?}", 'g');
- template = template.replace(regex, '');
- namespace = '';
- } else {
- // clean up all undefined conditionals
- template = template.replace(//gi, 'ENDIF -->')
- .replace(//gi, '');
- }
+ return parseUndefined ? parse(template, keysToReparse, '') : template;
+ }
- return template;
+ module.exports = templates;
+ module.exports.__express = express;
- })(data, "", template);
+ if ('undefined' !== typeof window) {
+ window.templates = module.exports;
}
-}());
+})('undefined' === typeof module ? {
+ module: {
+ exports: {}
+ }
+} : module);
From e38d55888344b9150a112ee08d14e1c9817e3e50 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 15:49:24 -0500
Subject: [PATCH 12/36] Fix template
---
public/templates/comments/comments.tpl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/public/templates/comments/comments.tpl b/public/templates/comments/comments.tpl
index 75ca202a..4937b44a 100644
--- a/public/templates/comments/comments.tpl
+++ b/public/templates/comments/comments.tpl
@@ -30,16 +30,16 @@
-
{user.username} commented {posts.timestamp} {posts.content}
+
{posts.user.username} commented {posts.timestamp} {posts.content}
From e1250808e764ed477cd2c6a2bfa32a43b2cd01ca Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 15:59:35 -0500
Subject: [PATCH 13/36] Fix template issue
---
public/templates/comments/comments.tpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/templates/comments/comments.tpl b/public/templates/comments/comments.tpl
index 4937b44a..1ff5c2f6 100644
--- a/public/templates/comments/comments.tpl
+++ b/public/templates/comments/comments.tpl
@@ -35,7 +35,7 @@
{posts.user.icon:text}
-
+
From 364beb95dd6bf818c2def19df130a7fbed1eb533 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 15:59:39 -0500
Subject: [PATCH 14/36] Logging
---
public/lib/general.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/public/lib/general.js b/public/lib/general.js
index 94c1a2f6..f5205c09 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -831,6 +831,7 @@
break;
}
}
+ console.log(keysToReparse);
return parseUndefined ? parse(template, keysToReparse, '') : template;
}
From 66871b61a6027260c7eabee211a4e3e690b587f9 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 16:02:02 -0500
Subject: [PATCH 15/36] Remove log
---
public/lib/general.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index f5205c09..94c1a2f6 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -831,7 +831,6 @@
break;
}
}
- console.log(keysToReparse);
return parseUndefined ? parse(template, keysToReparse, '') : template;
}
From 6429592663463dd0b8ea39e4be9d8cf3b6b5fbbe Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 16:02:07 -0500
Subject: [PATCH 16/36] Test pagination
---
library.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/library.js b/library.js
index 0dbcd46b..60230fdd 100644
--- a/library.js
+++ b/library.js
@@ -42,8 +42,8 @@ Comments.getCommentData = async function (req, res, next) {
const tid = await Comments.getTopicIDByCommentID(commentID);
const topicData = await topics.getTopicData(tid);
- const start = pagination * 10;
- const stop = start + 9;
+ const start = pagination * 3;
+ const stop = start + 2;
const [userData, isAdmin, isPublisher] = await Promise.all([
user.getUserData(req.uid),
user.isAdministrator(req.uid),
From e076fe10b161bf0cd62cec916d066bc0abc75c73 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 16:04:45 -0500
Subject: [PATCH 17/36] Tweak test
---
public/lib/general.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index 94c1a2f6..b404e7e2 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -83,10 +83,12 @@
}
if (pagination) {
- console.log(data, templates.blocks);
+ console.log(data, window.templates.blocks);
// var html = templates.parse(template, data);
- html = normalizePost(parse(data, templates.blocks['posts']));
- commentsDiv.innerHTML = commentsDiv.innerHTML + html;
+ // html = window.templates.parse(data.template, data);
+
+ html = parse(data, templates.blocks['posts']);
+ commentsDiv.innerHTML = commentsDiv.innerHTML + normalizePost(html);
} else {
html = window.templates.parse(data.template, data);
nodebbDiv.innerHTML = normalizePost(html);
From 5e143c9a6eb47c7894b57b3749967ff6d5880363 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 16:11:11 -0500
Subject: [PATCH 18/36] Tweak
---
public/lib/general.js | 22 ++--------------------
1 file changed, 2 insertions(+), 20 deletions(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index b404e7e2..69152132 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -83,9 +83,8 @@
}
if (pagination) {
- console.log(data, window.templates.blocks);
- // var html = templates.parse(template, data);
- // html = window.templates.parse(data.template, data);
+ console.log(data, window.templates.getBlock(data.template, 'posts'));
+ console.log(window.templates.parse(window.templates.getBlock(data.template, 'posts'), data))
html = parse(data, templates.blocks['posts']);
commentsDiv.innerHTML = commentsDiv.innerHTML + normalizePost(html);
@@ -517,22 +516,6 @@
templates.cache = {};
};
- function express(filename, options, fn) {
- var fs = require('fs'),
- tpl = filename.replace(options.settings.views + '/', '');
-
- options._locals = null;
-
- if (!templates.cache[tpl]) {
- fs.readFile(filename, function(err, html) {
- templates.cache[tpl] = (html || '').toString();
- return fn(err, templates.parse(templates.cache[tpl], options));
- });
- } else {
- return fn(null, templates.parse(templates.cache[tpl], options));
- }
- }
-
function replace(string, regex, value) {
return string.replace(regex, value.toString().replace(regexes.backReferenceFix, '$$$'));
}
@@ -838,7 +821,6 @@
}
module.exports = templates;
- module.exports.__express = express;
if ('undefined' !== typeof window) {
window.templates = module.exports;
From 3302ccf9fbd0f44dd7d975badf5dd0b7e8b345ef Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 16:12:51 -0500
Subject: [PATCH 19/36] Update behavior for parsing templates
---
public/lib/general.js | 143 +-----------------------------------------
1 file changed, 1 insertion(+), 142 deletions(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index 69152132..9e4af788 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -83,10 +83,7 @@
}
if (pagination) {
- console.log(data, window.templates.getBlock(data.template, 'posts'));
- console.log(window.templates.parse(window.templates.getBlock(data.template, 'posts'), data))
-
- html = parse(data, templates.blocks['posts']);
+ html = window.templates.parse(window.templates.getBlock(data.template, 'posts'), data);
commentsDiv.innerHTML = commentsDiv.innerHTML + normalizePost(html);
} else {
html = window.templates.parse(data.template, data);
@@ -184,7 +181,6 @@
reloadComments();
-
function timeAgo(time){
var time_formats = [
[60, 'seconds', 1],
@@ -220,143 +216,6 @@
}
return time;
}
-
- var templates = {blocks: {}};
- function parse (data, template) {
- function replace(key, value, template) {
- var searchRegex = new RegExp('{' + key + '}', 'g');
- return template.replace(searchRegex, value);
- }
-
- function makeRegex(block) {
- return new RegExp("[\\s\\S]*", 'g');
- }
-
- function makeConditionalRegex(block) {
- return new RegExp("([\\s\\S]*?)", 'g');
- }
-
- function getBlock(regex, block, template) {
- data = template.match(regex);
- if (data == null) return;
-
- if (block !== undefined) templates.blocks[block] = data[0];
-
- var begin = new RegExp("(\r\n)*(\r\n)*", "g"),
- end = new RegExp("(\r\n)*(\r\n)*", "g"),
-
- data = data[0]
- .replace(begin, "")
- .replace(end, "");
-
- return data;
- }
-
- function setBlock(regex, block, template) {
- return template.replace(regex, block);
- }
-
- var regex, block;
-
- return (function parse(data, namespace, template, blockInfo) {
- if (!data || data.length == 0) {
- template = '';
- }
-
- function checkConditional(key, value) {
- var conditional = makeConditionalRegex(key),
- matches = template.match(conditional);
-
- if (matches !== null) {
- for (var i = 0, ii = matches.length; i < ii; i++) {
- var conditionalBlock = matches[i].split(//);
-
- var statement = new RegExp("()|()", 'gi');
-
- if (conditionalBlock[1]) {
- // there is an else statement
- if (!value) {
- template = template.replace(matches[i], conditionalBlock[1].replace(statement, ''));
- } else {
- template = template.replace(matches[i], conditionalBlock[0].replace(statement, ''));
- }
- } else {
- // regular if statement
- if (!value) {
- template = template.replace(matches[i], '');
- } else {
- template = template.replace(matches[i], matches[i].replace(statement, ''));
- }
- }
- }
- }
- }
-
- for (var d in data) {
- if (data.hasOwnProperty(d)) {
- if (typeof data[d] === 'undefined') {
- continue;
- } else if (data[d] === null) {
- template = replace(namespace + d, '', template);
- } else if (data[d].constructor == Array) {
- checkConditional(namespace + d + '.length', data[d].length);
- checkConditional('!' + namespace + d + '.length', !data[d].length);
-
- namespace += d + '.';
-
- var regex = makeRegex(d),
- block = getBlock(regex, namespace.substring(0, namespace.length - 1), template);
-
- if (block == null) {
- namespace = namespace.replace(d + '.', '');
- continue;
- }
-
- var numblocks = data[d].length - 1,
- i = 0,
- result = "";
-
- do {
- result += parse(data[d][i], namespace, block, {iterator: i, total: numblocks});
- } while (i++ < numblocks);
-
- namespace = namespace.replace(d + '.', '');
- template = setBlock(regex, result, template);
- } else if (data[d] instanceof Object) {
- template = parse(data[d], d + '.', template);
- } else {
- var key = namespace + d,
- value = typeof data[d] === 'string' ? data[d].replace(/^\s+|\s+$/g, '') : data[d];
-
- checkConditional(key, value);
- checkConditional('!' + key, !value);
-
- if (blockInfo && blockInfo.iterator) {
- checkConditional('@first', blockInfo.iterator === 0);
- checkConditional('!@first', blockInfo.iterator !== 0);
- checkConditional('@last', blockInfo.iterator === blockInfo.total);
- checkConditional('!@last', blockInfo.iterator !== blockInfo.total);
- }
-
- template = replace(key, value, template);
- }
- }
- }
-
- if (namespace) {
- var regex = new RegExp("{" + namespace + "[\\s\\S]*?}", 'g');
- template = template.replace(regex, '');
- namespace = '';
- } else {
- // clean up all undefined conditionals
- template = template.replace(//gi, 'ENDIF -->')
- .replace(//gi, '');
- }
-
- return template;
-
- })(data, "", template);
- }
}());
From a6fcf045cb3fb16d30a253f3e4d7d6cbcca9dbb5 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 16:17:49 -0500
Subject: [PATCH 20/36] Support hiding branding.
---
library.js | 2 ++
public/templates/comments/admin.tpl | 5 +++++
public/templates/comments/comments.tpl | 5 ++++-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/library.js b/library.js
index 60230fdd..f14377e9 100644
--- a/library.js
+++ b/library.js
@@ -90,6 +90,7 @@ Comments.getCommentData = async function (req, res, next) {
}
const compose_location = meta.config['blog-comments:compose-location'] || 'top';
+ const show_branding = (meta.config['blog-comments:show-branding'] || 'off') === 'on';
const top = compose_location === 'top';
res.json({
@@ -105,6 +106,7 @@ Comments.getCommentData = async function (req, res, next) {
mainPost: mainPost,
atTop: top,
atBottom: !top,
+ show_branding,
});
};
diff --git a/public/templates/comments/admin.tpl b/public/templates/comments/admin.tpl
index 0ee43712..79eed2a7 100644
--- a/public/templates/comments/admin.tpl
+++ b/public/templates/comments/admin.tpl
@@ -15,6 +15,11 @@
Compose on top
Compose on bottom
+ Show branding and thread link
+
+ On
+ Off
+
diff --git a/public/templates/comments/comments.tpl b/public/templates/comments/comments.tpl
index 1ff5c2f6..9a293219 100644
--- a/public/templates/comments/comments.tpl
+++ b/public/templates/comments/comments.tpl
@@ -73,7 +73,10 @@
-
Powered by NodeBB • View original thread
+
+
Powered by NodeBB • View original thread
+
+
style="display: none" id="nodebb-load-more">Load more comments...
Commenting has been disabled.
From 3ca27caa0e18f6d818ee56f4171701df758b1af7 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 5 Jan 2022 16:19:32 -0500
Subject: [PATCH 21/36] Revert pagination tests
---
library.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/library.js b/library.js
index f14377e9..fdfc0dcf 100644
--- a/library.js
+++ b/library.js
@@ -42,8 +42,8 @@ Comments.getCommentData = async function (req, res, next) {
const tid = await Comments.getTopicIDByCommentID(commentID);
const topicData = await topics.getTopicData(tid);
- const start = pagination * 3;
- const stop = start + 2;
+ const start = pagination * 10;
+ const stop = start + 9;
const [userData, isAdmin, isPublisher] = await Promise.all([
user.getUserData(req.uid),
user.isAdministrator(req.uid),
From 0247d82e33e12fb7c70d7e580db455f9a2d5978e Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Tue, 11 Jan 2022 11:20:19 -0500
Subject: [PATCH 22/36] Tweak approach to redirect_url
---
library.js | 4 ++--
public/lib/general.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/library.js b/library.js
index fdfc0dcf..5c4038df 100644
--- a/library.js
+++ b/library.js
@@ -35,7 +35,7 @@ Comments.getTopicIDByCommentID = async function (commentID) {
return await db.getObjectField('blog-comments', commentID);
};
-Comments.getCommentData = async function (req, res, next) {
+Comments.getCommentData = async function (req, res) {
const commentID = req.params.id;
const pagination = req.params.pagination ? req.params.pagination : 0;
@@ -169,7 +169,7 @@ Comments.publishArticle = async function (req, res) {
if (result && result.postData && result.postData.tid) {
await posts.setPostField(result.postData.pid, 'blog-comments:url', url);
await db.setObjectField('blog-comments', commentID, result.postData.tid);
- res.redirect(`${(req.header('Referer') || '/')}#nodebb-comments`);
+ res.redirect(`${url || req.header('Referer') || '/'}#nodebb-comments`);
}
} catch (err) {
res.json({ error: `Unable to post topic ${err.message}` });
diff --git a/public/lib/general.js b/public/lib/general.js
index 9e4af788..2d902569 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -56,7 +56,7 @@
commentsCategory = document.getElementById('nodebb-comments-category');
data.relative_path = nodeBBURL;
- data.redirect_url = articlePath;
+ data.redirect_url = (articleData && articleData.url) ? articleData.url : articlePath;
data.article_id = articleID;
data.pagination = pagination;
data.postCount = parseInt(data.postCount, 10);
From 0ce895abfbfe164c4205c325b239f6daf64f1e18 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Tue, 11 Jan 2022 14:35:18 -0500
Subject: [PATCH 23/36] Plugins support and 302 redirect follows
---
library.js | 52 ++++++++++++++++++++++++++-----------------
public/lib/general.js | 4 ++++
2 files changed, 36 insertions(+), 20 deletions(-)
diff --git a/library.js b/library.js
index 5c4038df..ca707f91 100644
--- a/library.js
+++ b/library.js
@@ -16,13 +16,44 @@ const groups = require.main.require('./src/groups');
const Comments = module.exports;
+// CORS Middleware
+const CORSMiddleware = function (req, res, next) {
+ const hostUrls = (meta.config['blog-comments:url'] || '').split(',');
+ const url = hostUrls.find((hostUrl) => {
+ hostUrl = hostUrl.trim();
+ if (hostUrl[hostUrl.length - 1] === '/') {
+ hostUrl = hostUrl.substring(0, hostUrl.length - 1);
+ }
+
+ return (hostUrl === req.get('origin'))
+ });
+
+ if (url) {
+ res.header('Access-Control-Allow-Origin', req.get('origin'));
+ } else {
+ winston.warn(`[nodebb-plugin-blog-comments] Origin (${req.get('origin')}) does not match hostUrls: ${hostUrls.join(', ')}`);
+ }
+
+ res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT');
+ res.header('Access-Control-Allow-Headers', 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept');
+ res.header('Access-Control-Allow-Credentials', 'true');
+
+ next();
+}
+
Comments.init = async function (params) {
const { router, middleware } = params;
const routeHelpers = require.main.require('./src/routes/helpers');
Comments.template = await fs.promises.readFile(path.resolve(__dirname, './public/templates/comments/comments.tpl'), { encoding: 'utf-8' });
- router.get('/comments/get/:id/:pagination?', middleware.applyCSRF, routeHelpers.tryRoute(Comments.getCommentData));
+ const middlewares = [
+ CORSMiddleware,
+ middleware.applyCSRF,
+ middleware.pluginHooks
+ ];
+
+ router.get('/comments/get/:id/:pagination?', middlewares, routeHelpers.tryRoute(Comments.getCommentData));
router.post('/comments/reply', middleware.applyCSRF, routeHelpers.tryRoute(Comments.replyToComment));
router.post('/comments/publish', middleware.applyCSRF, routeHelpers.tryRoute(Comments.publishArticle));
@@ -59,25 +90,6 @@ Comments.getCommentData = async function (req, res) {
]);
}
- const hostUrls = (meta.config['blog-comments:url'] || '').split(',');
- const url = hostUrls.find((hostUrl) => {
- hostUrl = hostUrl.trim();
- if (hostUrl[hostUrl.length - 1] === '/') {
- hostUrl = hostUrl.substring(0, hostUrl.length - 1);
- }
-
- return (hostUrl === req.get('origin'))
- });
-
- if (url) {
- res.header('Access-Control-Allow-Origin', req.get('origin'));
- } else {
- winston.warn(`[nodebb-plugin-blog-comments] Origin (${req.get('origin')}) does not match hostUrls: ${hostUrls.join(', ')}`);
- }
-
- res.header('Access-Control-Allow-Headers', 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept');
- res.header('Access-Control-Allow-Credentials', 'true');
-
const posts = postData.filter((post) => {
if (post.user && post.user.picture && !post.user.picture.startsWith('http')) {
post.user.picture = post.user.picture.replace(relativePath, '');
diff --git a/public/lib/general.js b/public/lib/general.js
index 2d902569..1c6bad28 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -47,6 +47,10 @@
}
XHR.onload = function() {
+ if (XHR.status === 302) {
+ reloadComments();
+ return;
+ }
if (XHR.status >= 200 && XHR.status < 400) {
var data = JSON.parse(XHR.responseText), html;
From c082d781037e8f41c8f1b6922996e567c49d6641 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 12 Jan 2022 11:09:18 -0500
Subject: [PATCH 24/36] Minify and cleanup general file
---
public/lib/general.js | 639 ++++++------------------------------------
1 file changed, 82 insertions(+), 557 deletions(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index 1c6bad28..738b993d 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -1,58 +1,62 @@
-(function() {
- "use strict";
-
- var articlePath = window.location.protocol + '//' + window.location.host + window.location.pathname;
+'use strict';
- var pluginURL = nodeBBURL + '/plugins/nodebb-plugin-blog-comments',
- savedText, nodebbDiv, contentDiv, commentsDiv, commentsCounter, commentsAuthor, commentsCategory;
+/* eslint-disable no-undef */
+(function () {
+ const articlePath = `${window.location.protocol}//${window.location.host}${window.location.pathname}`;
- var stylesheet = document.createElement("link");
- stylesheet.setAttribute("rel", "stylesheet");
- stylesheet.setAttribute("type", "text/css");
- stylesheet.setAttribute("href", pluginURL + '/css/comments.css');
+ const pluginURL = `${nodeBBURL}/plugins/nodebb-plugin-blog-comments`;
+ let savedText; let contentDiv; let commentsDiv; let commentsCounter; let commentsAuthor; let
+ commentsCategory;
- document.getElementsByTagName("head")[0].appendChild(stylesheet);
+ const stylesheet = document.createElement('link');
+ stylesheet.setAttribute('rel', 'stylesheet');
+ stylesheet.setAttribute('type', 'text/css');
+ stylesheet.setAttribute('href', `${pluginURL}/css/comments.css`);
+
+ document.getElementsByTagName('head')[0].appendChild(stylesheet);
document.getElementById('nodebb-comments').insertAdjacentHTML('beforebegin', '
');
- nodebbDiv = document.getElementById('nodebb');
+ const nodebbDiv = document.getElementById('nodebb');
function newXHR() {
try {
- return XHR = new XMLHttpRequest();
- } catch (e) {
- try {
- return XHR = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {
- return XHR = new ActiveXObject("Msxml2.XMLHTTP");
- }
- }
+ return new XMLHttpRequest();
+ } catch (e) {
+ try {
+ return new ActiveXObject('Microsoft.XMLHTTP');
+ } catch (e) {
+ return new ActiveXObject('Msxml2.XMLHTTP');
+ }
+ }
}
- var XHR = newXHR(), pagination = 0, modal;
+ const XHR = newXHR(); let pagination = 0; let
+ modal;
function authenticate(type) {
savedText = contentDiv.value;
- modal = window.open(nodeBBURL + "/" + type + "/#blog/authenticate","_blank","toolbar=no, scrollbars=no, resizable=no, width=600, height=675");
- var timer = setInterval(function() {
- if(modal.closed) {
+ modal = window.open(`${nodeBBURL}/${type}/#blog/authenticate`, '_blank', 'toolbar=no, scrollbars=no, resizable=no, width=600, height=675');
+ const timer = setInterval(() => {
+ if (modal.closed) {
clearInterval(timer);
pagination = 0;
reloadComments();
- }
+ }
}, 500);
}
function normalizePost(post) {
- return post.replace(/href="\/(?=\w)/g, 'href="' + nodeBBURL + '/')
- .replace(/src="\/(?=\w)/g, 'src="' + nodeBBURL + '/');
+ return post.replace(/href="\/(?=\w)/g, `href="${nodeBBURL}/`)
+ .replace(/src="\/(?=\w)/g, `src="${nodeBBURL}/`);
}
- XHR.onload = function() {
+ XHR.onload = function () {
if (XHR.status === 302) {
reloadComments();
return;
}
if (XHR.status >= 200 && XHR.status < 400) {
- var data = JSON.parse(XHR.responseText), html;
+ const data = JSON.parse(XHR.responseText); let
+ html;
commentsDiv = document.getElementById('nodebb-comments-list');
commentsCounter = document.getElementById('nodebb-comments-count');
@@ -65,30 +69,28 @@
data.pagination = pagination;
data.postCount = parseInt(data.postCount, 10);
- for (var post in data.posts) {
- if (data.posts.hasOwnProperty(post)) {
- data.posts[post].timestamp = timeAgo(parseInt(data.posts[post].timestamp), 10);
- if (data.posts[post]['blog-comments:url']) {
- delete data.posts[post];
- }
+ data.posts.forEach((_, i) => {
+ data.posts[i].timestamp = timeAgo(parseInt(data.posts[i].timestamp, 10));
+ if (data.posts[i]['blog-comments:url']) {
+ delete data.posts[i];
}
- }
-
+ });
+
if (commentsCounter) {
commentsCounter.innerHTML = data.postCount ? (data.postCount - 1) : 0;
}
if (commentsCategory) {
- commentsCategory.innerHTML = '
' + data.category.name + ' ';
+ commentsCategory.innerHTML = `
${data.category.name} `;
}
if (commentsAuthor) {
- commentsAuthor.innerHTML = '
' + data.mainPost.user.username + ' ';
+ commentsAuthor.innerHTML = `
${data.mainPost.user.username} `;
}
if (pagination) {
html = window.templates.parse(window.templates.getBlock(data.template, 'posts'), data);
- commentsDiv.innerHTML = commentsDiv.innerHTML + normalizePost(html);
+ commentsDiv.innerHTML += normalizePost(html);
} else {
html = window.templates.parse(data.template, data);
nodebbDiv.innerHTML = normalizePost(html);
@@ -96,30 +98,28 @@
contentDiv = document.getElementById('nodebb-content');
- setTimeout(function() {
- var lists = nodebbDiv.getElementsByTagName("li");
- for (var list in lists) {
- if (lists.hasOwnProperty(list)) {
- lists[list].className = '';
- }
- }
+ setTimeout(() => {
+ const lists = Array.from(nodebbDiv.getElementsByTagName('li'));
+ lists.forEach((_, i) => {
+ lists[i].className = '';
+ });
}, 100);
-
+
if (savedText) {
contentDiv.value = savedText;
}
if (data.tid) {
- var loadMore = document.getElementById('nodebb-load-more');
- loadMore.onclick = function() {
- pagination++;
+ const loadMore = document.getElementById('nodebb-load-more');
+ loadMore.onclick = function () {
+ pagination += 1;
reloadComments();
- }
+ };
if (data.posts.length) {
- loadMore.style.display = 'inline-block';
+ loadMore.style.display = 'inline-block';
}
- if (pagination * 10 + data.posts.length + 1 >= data.postCount) {
+ if ((pagination * 10) + data.posts.length + 1 >= data.postCount) {
loadMore.style.display = 'none';
}
@@ -128,7 +128,7 @@
}
if (data.user && data.user.uid) {
- var error = window.location.href.match(/error=[\w-]*/);
+ let error = window.location.href.match(/error=[\w-]*/);
if (error) {
error = error[0].split('=')[1];
if (error === 'too-many-posts') {
@@ -138,15 +138,15 @@
}
document.getElementById('nodebb-error').innerHTML = error;
- }
+ }
} else {
- document.getElementById('nodebb-register').onclick = function() {
+ document.getElementById('nodebb-register').onclick = function () {
authenticate('register');
};
- document.getElementById('nodebb-login').onclick = function() {
+ document.getElementById('nodebb-login').onclick = function () {
authenticate('login');
- }
+ };
}
} else if (data.isAdmin) {
if (!articleData) {
@@ -154,39 +154,33 @@
return;
}
- var translator = document.createElement('span'),
- gTags = articleData.tags,
- url = articleData.url,
- title= articleData.title_plain,
- cid = articleData.cid || -1,
- tags = [];
+ const translator = document.createElement('span');
+ const gTags = articleData.tags;
+ const { url } = articleData;
+ const title = articleData.title_plain;
+ const cid = articleData.cid || -1;
translator.innerHTML = articleData.markDownContent;
- var markdown = translator.firstChild.innerHTML + '\n\n**Click [here]('+ url +') to see the full blog post**';
+ const markdown = `${translator.firstChild.innerHTML}\n\n**Click [here](${url}) to see the full blog post**`;
- for (var tag in gTags) {
- if (gTags.hasOwnProperty(tag)) {
- tags.push(gTags[tag].title);
- }
- }
document.getElementById('nodebb-content-markdown').value = markdown;
document.getElementById('nodebb-content-title').value = title;
document.getElementById('nodebb-content-cid').value = cid;
- document.getElementById('nodebb-content-tags').value = JSON.stringify(tags);
+ document.getElementById('nodebb-content-tags').value = JSON.stringify(gTags.map(tag => tag.title));
}
}
};
function reloadComments() {
- XHR.open('GET', nodeBBURL + '/comments/get/' + articleID + '/' + pagination, true);
+ XHR.open('GET', `${nodeBBURL}/comments/get/${articleID}/${pagination}`, true);
XHR.withCredentials = true;
XHR.send();
}
reloadComments();
- function timeAgo(time){
- var time_formats = [
+ function timeAgo(time) {
+ const time_formats = [
[60, 'seconds', 1],
[120, '1 minute ago'],
[3600, 'minutes', 60],
@@ -199,498 +193,29 @@
[4838400, 'last month'],
[29030400, 'months', 2419200],
[58060800, 'last year'],
- [2903040000, 'years', 29030400]
+ [2903040000, 'years', 29030400],
];
- var seconds = (+new Date() - time) / 1000;
+ const seconds = (+new Date() - time) / 1000;
if (seconds < 10) {
return 'just now';
}
-
- var i = 0, format;
- while (format = time_formats[i++]) {
- if (seconds < format[0]) {
- if (!format[2]) {
- return format[1];
- } else {
- return Math.floor(seconds / format[2]) + ' ' + format[1] + ' ago';
- }
- }
- }
- return time;
- }
-}());
-
-
-// https://raw.githubusercontent.com/benchpressjs/benchpressjs/v0.3.1/lib/templates.js
-(function(module) {
- var templates = {
- cache: {},
- globals: {}
- },
- helpers = {},
- loader,
- worker;
-
- var regexes = {
- nestedConditionals: /(?!^)(?!$)/g,
- conditionalBlock: /[\r\n?\n]*?[\r\n?\n]*?/,
- conditionalHelper: //,
- conditionalArgs: /[ ]*,[ ]*/,
- innerLoop: /\s*/g,
- removeTabspace: /^\t*?|^\r\n?\t*?|\t?$|\r\n?\t*?$/g,
- removeWhitespace: /(^[\r\n?|\n]*)|([\r\n\t]*$)/g,
- cleanupEmptyLoops: /\s*/g,
- cleanupMissingKeys: /[\r\n]*?[\/]?\{[a-zA-Z0-9\.]+[\r\n]*?\}/g,
- leftoverRoot: /\.\.\/([\S]*?)[\}| ]/g,
- getUndefinedKeys: //g,
- backReferenceFix: /\$+/g,
- escapeBlocks: //g,
- escapeKeys: /\{([\s\S]*?)\}/g,
- rootKey: /\{\.\.\/([\S]*?)\}/g,
- rootConditional: /IF \.\.\/([\S]*?)/g,
- rootConditionalFalse: /IF !\.\.\/([\S]*?)/g
- };
-
- if (typeof self !== 'undefined' && self.addEventListener) {
- self.addEventListener('message', function(ev) {
- if (!ev || !ev.data || !ev.data.template || !ev.data.object) {
- return;
- }
- var data = ev.data;
-
- self.postMessage({
- result: !data.block ? templates.parse(data.template, data.object) : templates.parse(data.template, data.block, data.object),
- signature: data.signature
- }, '*');
- }, false);
- }
-
- var callbacks = {},
- signature = 0,
- MAX_SAFE_INT = Math.pow(2, 53) - 1;
-
- templates.setupWebWorker = function(pathToScript) {
- try {
- worker = new Worker(pathToScript);
-
- worker.addEventListener('message', function(e) {
- if (callbacks[e.data.signature]) {
- callbacks[e.data.signature](e.data.result);
- }
- }, false);
- } catch (err) {}
- };
-
- function launchWorker(template, obj, block, callback) {
- signature++;
- if (signature > MAX_SAFE_INT) {
- signature = 0;
- }
-
- obj = sanitise(obj);
-
- worker.postMessage({
- template: template,
- object: obj,
- block: block,
- signature: signature
- });
-
- callbacks[signature] = function(result) {
- callback(result);
- delete callbacks[signature];
- };
- }
-
- function sanitise(obj) {
- for(var prop in obj) {
- if (!obj.hasOwnProperty(prop) || typeof obj[prop] === 'function') {
- delete obj[prop];
- }
- }
-
- return obj;
- }
-
- templates.parse = function(template, block, obj, callback) {
- if (typeof block !== 'string') {
- callback = obj;
- obj = block;
- block = false;
- }
-
- if (!template) {
- return callback ? callback('') : '';
- }
-
- obj = registerGlobals(obj || {});
-
- if (loader && callback) {
- if (!templates.cache[template]) {
- loader(template, function(loaded) {
- templates.cache[template] = loaded;
-
- launchCallback(loaded, obj, block, callback);
- });
- } else {
- launchCallback(templates.cache[template], obj, block, callback);
- }
- } else if (callback) {
- launchCallback(template, obj, block, callback);
- } else {
- return parseTemplate(block, template, obj);
- }
- };
-
- function launchCallback(template, obj, block, callback) {
- if (worker) {
- launchWorker(template, obj, block, callback);
- } else {
- callback(parseTemplate(block, template, obj));
- }
- }
-
- function parseTemplate(block, template, obj) {
- block = !block ? template : templates.getBlock(template, block);
- template = parse(block, obj);
-
- return parseFunctions(template, template, obj);
- }
-
- templates.registerHelper = function(name, func) {
- helpers[name] = func;
- };
-
- templates.registerLoader = function(func) {
- loader = func;
- };
-
- templates.setGlobal = function(key, value) {
- templates.globals[key] = value;
- };
-
- templates.getBlock = function(template, block) {
- return template.replace(new RegExp('[\\s\\S]*([\\s\\S]*?)[\\s\\S]*', 'g'), '$1');
- };
-
- templates.flush = function() {
- templates.cache = {};
- };
-
- function replace(string, regex, value) {
- return string.replace(regex, value.toString().replace(regexes.backReferenceFix, '$$$'));
- }
-
- function replaceValue(template, key, value) {
- var string;
-
- value = value.toString();
- string = replace(template, new RegExp('{{' + key + '}}', 'g'), value);
-
- return replace(string, new RegExp('{' + key + '}', 'g'), value
- .replace(regexes.escapeKeys, '{$1}')
- .replace(regexes.escapeBlocks, '<!--$1-->')
- );
- }
-
- function makeRegex(block, namespace) {
- namespace = '(' + namespace + ')?';
- return new RegExp('[\\s\\S]*?');
- }
-
- function makeBlockRegex(block, namespace) {
- namespace = '(' + namespace + ')?';
- return new RegExp('([\\r\\n?|\\n]?)|()', 'g');
- }
-
- function makeConditionalRegex(block) {
- return new RegExp('([\\s\\S]*?)', 'g');
- }
-
- function makeStatementRegex(key) {
- return new RegExp('()|()', 'g');
- }
-
- function registerGlobals(obj) {
- for (var g in templates.globals) {
- if (templates.globals.hasOwnProperty(g)) {
- obj[g] = obj[g] || templates.globals[g];
- }
- }
-
- return obj;
- }
-
- function checkConditionals(template, key, value) {
- return checkConditional(checkConditional(template, '!' + key, !value), key, value);
- }
-
- function checkConditional(template, key, value) {
- var matches = template.match(makeConditionalRegex(key));
-
- if (matches) {
- var statement = makeStatementRegex(key);
- for (var i = 0, ii = matches.length; i < ii; i++) {
- var nestedConditionals = matches[i].match(regexes.nestedConditionals),
- match = replace(matches[i].replace(statement, ''), regexes.nestedConditionals, ''),
- conditionalBlock = match.split(regexes.conditionalBlock);
-
- if (conditionalBlock[1]) {
- // there is an else statement
- template = replace(template, matches[i], replace(conditionalBlock[value ? 0 : 1], regexes.removeWhitespace, ''));
- } else {
- // regular if statement
- template = replace(template, matches[i], value ? replace(match, regexes.removeWhitespace, '') : '');
- }
-
- if (nestedConditionals) {
- for (var x = 0, xx = nestedConditionals.length; x < xx; x++) {
- template = replace(template, '', nestedConditionals[x]);
- }
- }
- }
- }
-
- return template;
- }
-
- function checkConditionalHelpers(template, obj) {
- var string,
- func;
-
-
- while ((string = template.match(regexes.conditionalHelper)) !== null) {
- var fn = string[1].trim(),
- args = fn.split(regexes.conditionalArgs);
-
- func = args[0];
-
- if (helpers[func]) {
- args.shift();
- args.unshift(obj);
- template = checkConditionals(template, 'function.' + fn, helpers[func].apply(null, args));
- } else {
- template = template.replace(makeConditionalRegex('function.' + fn));
- }
- }
-
- return template;
- }
-
- function callMethod(method, parameters) {
- return method.apply(templates, parameters);
- }
-
- function parseFunctions(block, result, obj) {
- var functions = block.match(/{function.*?}/g, '');
- if (!functions) {
- return result;
- }
-
- for (var i=0, ii=functions.length; i
seconds < time[0]);
+ if (!format) {
+ return time;
}
-
- var regex = makeRegex(key, namespace), block, result;
-
- if (!array[key].length && !isObject) {
- return template.replace(regex, '');
- }
-
- while ((block = template.match(regex)) !== null) {
- block = block[0].replace(makeBlockRegex(key, namespace), '');
-
- var innerLoops = block.match(regexes.innerLoop);
-
- block = block
- .replace(regexes.innerLoop, '')
- .replace(regexes.rootKey, '{' + namespace + key + '.$1}')
- .replace(regexes.rootConditional, 'IF ' + namespace + key + '.$1')
- .replace(regexes.rootConditionalFalse, 'IF !' + namespace + key + '.$1');
-
- if (innerLoops) {
- for (var x = 0, xx = innerLoops.length; x < xx; x++) {
- block = replace(block, '', innerLoops[x]);
- }
- }
-
- block = block
- .replace(regexes.removeTabspace, '');
-
- result = parseArrayBlock(block, array[key], namespace + key + '.', isObject);
-
- template = replace(template, regex, result.replace(regexes.removeWhitespace, ''));
+ if (!format[2]) {
+ return format[1];
}
- return template;
+ return `${Math.floor(seconds / format[2])} ${format[1]} ago`;
}
+}());
- function parseArrayBlock(block, array, namespace, isObject) {
- var template = '';
-
- for (var iterator in array) {
- if (array.hasOwnProperty(iterator)) {
- var result = '';
-
- if (!isObject) {
- iterator = parseInt(iterator, 10);
- }
-
- result += parse(block, array[iterator], namespace);
-
- if (!isObject) {
- result = checkConditionals(result, '@first', iterator === 0);
- result = checkConditionals(result, '@last', iterator === array.length - 1);
-
- result = result
- .replace(/@index/g, iterator)
- .replace(/@value/g, array[iterator]);
- } else {
- result = result
- .replace(/@key/g, iterator)
- .replace(/@value/g, array[iterator]);
- }
-
- result = parseFunctions(block, result, array[iterator]);
- template = template + result;
- }
- }
-
- return template;
- }
-
- function parseValue(template, key, value) {
- template = checkConditionals(template, key, value);
- return replaceValue(template, key, value);
- }
-
- function parse(template, obj, namespace) {
-
- namespace = namespace || '';
- var key;
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- if (typeof obj[key] === 'undefined' || typeof obj[key] === 'function' || !template.match(key) || (obj[key] && obj[key].constructor === Array)) {
- continue;
- } else if (obj[key] === null) {
- template = replaceValue(template, namespace + key, '');
- } else if (obj[key] instanceof Object) {
- template = parseObject(template, obj, key, namespace);
- template = checkConditionals(template, key, obj[key]);
- template = parse(template, obj[key], namespace + key + '.');
- } else {
- template = parseValue(template, namespace + key, obj[key]);
- }
- }
- }
-
- for (key in obj) {
- if (obj.hasOwnProperty(key) && Array.isArray(obj[key]) && template.match(key)) {
- template = replaceValue(template, namespace + key + '.length', obj[key].length);
- template = parseArray(template, obj, key, namespace);
- }
- }
-
-
- if (namespace) {
- namespace = '';
- } else {
- template = checkConditionalHelpers(template, obj);
- template = cleanup(template, obj);
- }
-
- return template;
- }
-
- function cleanup(template, obj) {
- template = template
- .replace(regexes.cleanupEmptyLoops, '');
-
- var missingKeys = template.match(regexes.cleanupMissingKeys) || [];
-
- for (var i = 0, ii = missingKeys.length; i < ii; i++) {
- if (missingKeys[i].substr(0, 1) !== '/') {
- template = template.replace(missingKeys[i], '');
- } else {
- template = template.replace(missingKeys[i], missingKeys[i].slice(1));
- }
- }
-
- var keysToReparse = {},
- undefinedKeys = template.match(regexes.getUndefinedKeys) || [];
-
- for (var i = 0, ii = undefinedKeys.length; i < ii; i++) {
- var undefinedKey = regexes.getUndefinedKeys.exec(undefinedKeys[i]);
-
- if (undefinedKey) {
- keysToReparse[undefinedKey[1]] = false;
- }
- }
-
- var leftoverRoot = template.match(regexes.leftoverRoot) || [];
-
- for (var i = 0, ii = leftoverRoot.length; i < ii; i++) {
- var key = regexes.leftoverRoot.exec(leftoverRoot[i]);
-
- if (key) {
- key = key[1].split('.')[0];
-
- if (obj[key]) {
- keysToReparse['../' + key] = obj[key];
- }
- }
- }
-
- var parseUndefined = false;
-
- for(var prop in keysToReparse) {
- if (keysToReparse.hasOwnProperty(prop)) {
- parseUndefined = true;
- break;
- }
- }
-
- return parseUndefined ? parse(template, keysToReparse, '') : template;
- }
-
- module.exports = templates;
-
- if ('undefined' !== typeof window) {
- window.templates = module.exports;
- }
-})('undefined' === typeof module ? {
- module: {
- exports: {}
- }
-} : module);
+// https://raw.githubusercontent.com/benchpressjs/benchpressjs/v0.3.1/lib/templates.js
+/* eslint-disable */
+!function(){const e={cache:{},globals:{}},t={};let n,o;const r={nestedConditionals:/(?!^)(?!$)/g,conditionalBlock:/[\r\n?\n]*?[\r\n?\n]*?/,conditionalHelper://,conditionalArgs:/[ ]*,[ ]*/,innerLoop:/\s*/g,removeTabspace:/^\t*?|^\r\n?\t*?|\t?$|\r\n?\t*?$/g,removeWhitespace:/(^[\r\n?|\n]*)|([\r\n\t]*$)/g,cleanupEmptyLoops:/\s*/g,cleanupMissingKeys:/[\r\n]*?[\/]?\{[a-zA-Z0-9\.]+[\r\n]*?\}/g,leftoverRoot:/\.\.\/([\S]*?)[\}| ]/g,getUndefinedKeys://g,backReferenceFix:/\$+/g,escapeBlocks://g,escapeKeys:/\{([\s\S]*?)\}/g,rootKey:/\{\.\.\/([\S]*?)\}/g,rootConditional:/IF \.\.\/([\S]*?)/g,rootConditionalFalse:/IF !\.\.\/([\S]*?)/g};"undefined"!=typeof self&&self.addEventListener&&self.addEventListener("message",t=>{if(!(t&&t.data&&t.data.template&&t.data.object))return;const{data:n}=t;self.postMessage({result:n.block?e.parse(n.template,n.block,n.object):e.parse(n.template,n.object),signature:n.signature},"*")},!1);const c={};let l=0;const s=2**53-1;function i(e,t,n,r){o?function(e,t,n,r){++l>s&&(l=0),t=function(e){for(const t in e)e.hasOwnProperty(t)&&"function"!=typeof e[t]||delete e[t];return e}(t),o.postMessage({template:e,object:t,block:n,signature:l}),c[l]=function(e){r(e),delete c[l]}}(e,t,n,r):r(a(n,e,t))}function a(t,n,o){return x(n=b(t=t?e.getBlock(n,t):n,o),n,o)}function f(e,t,n){return e.replace(t,n.toString().replace(r.backReferenceFix,"$$$"))}function u(e,t,n){let o;return n=n.toString(),o=f(e,new RegExp(`{{${t}}}`,"g"),n),f(o,new RegExp(`{${t}}`,"g"),n.replace(r.escapeKeys,"{$1}").replace(r.escapeBlocks,"<!--$1-->"))}function p(e,t){return t=`(${t})?`,new RegExp(`(\x3c!-- BEGIN ${t}${e} --\x3e[\\r\\n?|\\n]?)|(\x3c!-- END ${t}${e} --\x3e)`,"g")}function g(e){return new RegExp(`\x3c!-- IF ${e} --\x3e([\\s\\S]*?)\x3c!-- ENDIF ${e.split(",")[0]} --\x3e`,"g")}function d(e,t,n){return h(h(e,`!${t}`,!n),t,n)}function h(e,t,n){const o=e.match(g(t));if(o){const c=function(e){return new RegExp(`(\x3c!-- IF ${e} --\x3e)|(\x3c!-- ENDIF ${e.split(",")[0]} --\x3e)`,"g")}(t);for(let t=0,l=o.length;t{c[e.data.signature]&&c[e.data.signature](e.data.result)},!1)}catch(e){}},e.parse=function(t,o,r,c){if("string"!=typeof o&&(c=r,r=o,o=!1),!t)return c?c(""):"";if(r=function(t){for(const n in e.globals)e.globals.hasOwnProperty(n)&&(t[n]=t[n]||e.globals[n]);return t}(r||{}),n&&c)e.cache[t]?i(e.cache[t],r,o,c):n(t,n=>{e.cache[t]=n,i(n,r,o,c)});else{if(!c)return a(o,t,r);i(t,r,o,c)}},e.registerHelper=function(e,n){t[e]=n},e.registerLoader=function(e){n=e},e.setGlobal=function(t,n){e.globals[t]=n},e.getBlock=function(e,t){return e.replace(new RegExp(`[\\s\\S]*(\x3c!-- BEGIN ${t} --\x3e[\\s\\S]*?\x3c!-- END ${t} --\x3e)[\\s\\S]*`,"g"),"$1")},e.flush=function(){e.cache={}},"undefined"!=typeof module&&(module.exports=e),"undefined"!=typeof window&&(window.templates=e)}();
+/* eslint-enable */
From 01a9961b65305ca8f1d553aea94524e68ca0a2c8 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 12 Jan 2022 11:09:57 -0500
Subject: [PATCH 25/36] eslint clean
---
library.js | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/library.js b/library.js
index ca707f91..732e9fbc 100644
--- a/library.js
+++ b/library.js
@@ -25,7 +25,7 @@ const CORSMiddleware = function (req, res, next) {
hostUrl = hostUrl.substring(0, hostUrl.length - 1);
}
- return (hostUrl === req.get('origin'))
+ return (hostUrl === req.get('origin'));
});
if (url) {
@@ -39,7 +39,7 @@ const CORSMiddleware = function (req, res, next) {
res.header('Access-Control-Allow-Credentials', 'true');
next();
-}
+};
Comments.init = async function (params) {
const { router, middleware } = params;
@@ -50,10 +50,10 @@ Comments.init = async function (params) {
const middlewares = [
CORSMiddleware,
middleware.applyCSRF,
- middleware.pluginHooks
+ middleware.pluginHooks,
];
- router.get('/comments/get/:id/:pagination?', middlewares, routeHelpers.tryRoute(Comments.getCommentData));
+ router.get('/comments/get/:id/:pagination?', middlewares, routeHelpers.tryRoute(Comments.getCommentData));
router.post('/comments/reply', middleware.applyCSRF, routeHelpers.tryRoute(Comments.replyToComment));
router.post('/comments/publish', middleware.applyCSRF, routeHelpers.tryRoute(Comments.publishArticle));
@@ -81,7 +81,8 @@ Comments.getCommentData = async function (req, res) {
groups.isMember(req.uid, 'publishers'),
]);
- let postData = [], categoryData = null, mainPost = null;
+ let postData = []; let categoryData = null; let
+ mainPost = null;
if (topicData) {
[postData, categoryData, mainPost] = await Promise.all([
topics.getTopicPosts(topicData, `tid:${tid}:posts`, start, stop, req.uid, true),
From 485221c059d952c55876c2dcfa2bef7b3ff502ba Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 12 Jan 2022 11:10:54 -0500
Subject: [PATCH 26/36] show_branding default on (persist existing behavior)
---
library.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/library.js b/library.js
index 732e9fbc..0d37090b 100644
--- a/library.js
+++ b/library.js
@@ -103,7 +103,7 @@ Comments.getCommentData = async function (req, res) {
}
const compose_location = meta.config['blog-comments:compose-location'] || 'top';
- const show_branding = (meta.config['blog-comments:show-branding'] || 'off') === 'on';
+ const show_branding = (meta.config['blog-comments:show-branding'] || 'on') === 'on';
const top = compose_location === 'top';
res.json({
From 4a82ec652e13f42be260374600af6d128d4a92fa Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 12 Jan 2022 12:52:24 -0500
Subject: [PATCH 27/36] New settings for authorization URLs and method of
authorization
---
library.js | 17 +++++++++------
public/lib/general.js | 33 +++++++++++++++--------------
public/templates/comments/admin.tpl | 33 +++++++++++++++++++++++++----
3 files changed, 56 insertions(+), 27 deletions(-)
diff --git a/library.js b/library.js
index 0d37090b..01f87302 100644
--- a/library.js
+++ b/library.js
@@ -104,22 +104,25 @@ Comments.getCommentData = async function (req, res) {
const compose_location = meta.config['blog-comments:compose-location'] || 'top';
const show_branding = (meta.config['blog-comments:show-branding'] || 'on') === 'on';
- const top = compose_location === 'top';
+ const atTop = compose_location === 'top';
res.json({
- posts: posts,
+ posts,
postCount: topicData ? topicData.postcount : 0,
user: userData,
template: Comments.template,
token: req.csrfToken && req.csrfToken(),
- isAdmin: !isAdmin ? isPublisher : isAdmin,
+ isAdmin: isAdmin || isPublisher,
isLoggedIn: req.loggedIn,
- tid: tid,
+ tid,
category: categoryData,
- mainPost: mainPost,
- atTop: top,
- atBottom: !top,
+ mainPost,
+ atTop,
+ atBottom: !atTop,
show_branding,
+ loginURL: meta.config['blog-comments:login-url'] || '',
+ registerURL: meta.config['blog-comments:register-url'] || '',
+ authFlow: meta.config['blog-comments:auth-behavior'] || 'popup',
});
};
diff --git a/public/lib/general.js b/public/lib/general.js
index 738b993d..0b88e5d9 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -29,20 +29,7 @@
}
}
- const XHR = newXHR(); let pagination = 0; let
- modal;
-
- function authenticate(type) {
- savedText = contentDiv.value;
- modal = window.open(`${nodeBBURL}/${type}/#blog/authenticate`, '_blank', 'toolbar=no, scrollbars=no, resizable=no, width=600, height=675');
- const timer = setInterval(() => {
- if (modal.closed) {
- clearInterval(timer);
- pagination = 0;
- reloadComments();
- }
- }, 500);
- }
+ const XHR = newXHR(); let pagination = 0;
function normalizePost(post) {
return post.replace(/href="\/(?=\w)/g, `href="${nodeBBURL}/`)
@@ -140,12 +127,26 @@
document.getElementById('nodebb-error').innerHTML = error;
}
} else {
+ const authenticate = data.authFlow !== 'redirect' ? function (url) {
+ savedText = contentDiv.value;
+ const modal = window.open(url, '_blank', 'toolbar=no, scrollbars=no, resizable=no, width=600, height=675');
+ const timer = setInterval(() => {
+ if (modal.closed) {
+ clearInterval(timer);
+ pagination = 0;
+ reloadComments();
+ }
+ }, 500);
+ } : function (url) {
+ location.href = `${url}?callbackUrl=${data.redirect_url}`;
+ };
+
document.getElementById('nodebb-register').onclick = function () {
- authenticate('register');
+ authenticate(data.registerURL.length ? data.registerURL : `${nodeBBURL}/register/#blog/authenticate`);
};
document.getElementById('nodebb-login').onclick = function () {
- authenticate('login');
+ authenticate(data.loginURL.length ? data.loginURL : `${nodeBBURL}/login/#blog/authenticate`);
};
}
} else if (data.isAdmin) {
diff --git a/public/templates/comments/admin.tpl b/public/templates/comments/admin.tpl
index 79eed2a7..128bc2d9 100644
--- a/public/templates/comments/admin.tpl
+++ b/public/templates/comments/admin.tpl
@@ -5,21 +5,46 @@
From af0fd4c38045d8fccedf4a42c96ff5557e016ba0 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 12 Jan 2022 12:55:34 -0500
Subject: [PATCH 28/36] Fix data check.
---
public/lib/general.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/lib/general.js b/public/lib/general.js
index 0b88e5d9..0feb0d34 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -142,11 +142,11 @@
};
document.getElementById('nodebb-register').onclick = function () {
- authenticate(data.registerURL.length ? data.registerURL : `${nodeBBURL}/register/#blog/authenticate`);
+ authenticate(data.registerURL && data.registerURL.length ? data.registerURL : `${nodeBBURL}/register/#blog/authenticate`);
};
document.getElementById('nodebb-login').onclick = function () {
- authenticate(data.loginURL.length ? data.loginURL : `${nodeBBURL}/login/#blog/authenticate`);
+ authenticate(data.loginURL && data.loginURL.length ? data.loginURL : `${nodeBBURL}/login/#blog/authenticate`);
};
}
} else if (data.isAdmin) {
From 92f00ec42cd568e33aa724e93355ec3beaf392f5 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 12 Jan 2022 14:39:26 -0500
Subject: [PATCH 29/36] Support auto-creating topics
---
library.js | 21 ++++++----
public/lib/general.js | 62 +++++++++++++++++++++++------
public/templates/comments/admin.tpl | 13 ++++++
3 files changed, 77 insertions(+), 19 deletions(-)
diff --git a/library.js b/library.js
index 01f87302..d191c11e 100644
--- a/library.js
+++ b/library.js
@@ -50,14 +50,13 @@ Comments.init = async function (params) {
const middlewares = [
CORSMiddleware,
middleware.applyCSRF,
- middleware.pluginHooks,
];
- router.get('/comments/get/:id/:pagination?', middlewares, routeHelpers.tryRoute(Comments.getCommentData));
- router.post('/comments/reply', middleware.applyCSRF, routeHelpers.tryRoute(Comments.replyToComment));
- router.post('/comments/publish', middleware.applyCSRF, routeHelpers.tryRoute(Comments.publishArticle));
+ router.get('/comments/get/:id/:pagination?', middlewares, middleware.pluginHooks, routeHelpers.tryRoute(Comments.getCommentData));
+ router.post('/comments/reply', middlewares, routeHelpers.tryRoute(Comments.replyToComment));
+ router.post('/comments/publish', middlewares, routeHelpers.tryRoute(Comments.publishArticle));
- routeHelpers.setupAdminPageRoute(router, '/admin/blog-comments', middleware, [], (req, res) => {
+ routeHelpers.setupAdminPageRoute(router, '/admin/blog-comments', middleware, [], (_, res) => {
res.render('comments/admin', {});
});
};
@@ -123,6 +122,7 @@ Comments.getCommentData = async function (req, res) {
loginURL: meta.config['blog-comments:login-url'] || '',
registerURL: meta.config['blog-comments:register-url'] || '',
authFlow: meta.config['blog-comments:auth-behavior'] || 'popup',
+ autoCreate: meta.config['blog-comments:autocreate'] === 'on',
});
};
@@ -170,12 +170,19 @@ Comments.publishArticle = async function (req, res) {
groups.isMember(req.uid, 'publishers'),
]);
- if (!isAdmin && !isPublisher) {
+ let { uid } = req;
+ if (meta.config['blog-comments:autocreate'] === 'on') {
+ uid = parseInt(meta.config['blog-comments:autocreate-user-id'], 10);
+ if (!uid) {
+ return res.json({ error: 'Invalid autocreate user specified' });
+ }
+ } else if (!isAdmin && !isPublisher) {
return res.json({ error: 'Only Administrators or members of the publishers group can publish articles' });
}
+
try {
const result = await topics.post({
- uid: req.uid,
+ uid,
title: title,
content: markdown,
tags: tags ? JSON.parse(tags) : [],
diff --git a/public/lib/general.js b/public/lib/general.js
index 0feb0d34..8bb8e79c 100644
--- a/public/lib/general.js
+++ b/public/lib/general.js
@@ -36,6 +36,27 @@
.replace(/src="\/(?=\w)/g, `src="${nodeBBURL}/`);
}
+ function getArticleData() {
+ if (!articleData) {
+ console.error('Declare articleData variable!');
+ return;
+ }
+
+ const tags = (articleData.tags || []).map(tag => tag.title);
+ const { url } = articleData;
+ const title = articleData.title_plain;
+ const cid = articleData.cid || -1;
+
+ const translator = document.createElement('span');
+ translator.innerHTML = articleData.markDownContent;
+ const markdown = [
+ translator.firstChild.innerHTML,
+ articleData.url && articleData.url.length ? `\n\n**Click [here](${url}) to see the full blog post**` : '',
+ ].join('');
+
+ return [markdown, title, cid, tags];
+ }
+
XHR.onload = function () {
if (XHR.status === 302) {
reloadComments();
@@ -96,7 +117,7 @@
contentDiv.value = savedText;
}
- if (data.tid) {
+ if (data.mainPost) {
const loadMore = document.getElementById('nodebb-load-more');
loadMore.onclick = function () {
pagination += 1;
@@ -149,25 +170,42 @@
authenticate(data.loginURL && data.loginURL.length ? data.loginURL : `${nodeBBURL}/login/#blog/authenticate`);
};
}
- } else if (data.isAdmin) {
- if (!articleData) {
- console.error('Declare articleData variable!');
+ } else if (data.autoCreate) {
+ const [markdown, title, cid, tags] = getArticleData();
+ if (!markdown.length || !title.length) {
+ console.error('Need a title and content to auto-create a topic.');
return;
}
- const translator = document.createElement('span');
- const gTags = articleData.tags;
- const { url } = articleData;
- const title = articleData.title_plain;
- const cid = articleData.cid || -1;
- translator.innerHTML = articleData.markDownContent;
+ const formValues = {
+ markdown,
+ title,
+ cid,
+ tags: JSON.stringify(tags),
+ id: data.article_id,
+ url: data.redirect_url,
+ _csrf: data.token,
+ };
+
+ const formData = Object.keys(formValues).map(name => `${encodeURIComponent(name)}=${encodeURIComponent(formValues[name])}`).join('&');
- const markdown = `${translator.firstChild.innerHTML}\n\n**Click [here](${url}) to see the full blog post**`;
+ const postXHR = newXHR();
+ postXHR.onreadystatechange = function () {
+ if (postXHR.readyState === postXHR.DONE) {
+ reloadComments();
+ }
+ };
+ postXHR.open('POST', `${data.relative_path}/comments/publish`, true);
+ postXHR.withCredentials = true;
+ postXHR.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ postXHR.send(formData);
+ } else if (data.isAdmin) {
+ const [markdown, title, cid, tags] = getArticleData();
document.getElementById('nodebb-content-markdown').value = markdown;
document.getElementById('nodebb-content-title').value = title;
document.getElementById('nodebb-content-cid').value = cid;
- document.getElementById('nodebb-content-tags').value = JSON.stringify(gTags.map(tag => tag.title));
+ document.getElementById('nodebb-content-tags').value = JSON.stringify(tags);
}
}
};
diff --git a/public/templates/comments/admin.tpl b/public/templates/comments/admin.tpl
index 128bc2d9..6d0c0cc3 100644
--- a/public/templates/comments/admin.tpl
+++ b/public/templates/comments/admin.tpl
@@ -28,6 +28,19 @@
Off
+
Auto Create Topic
+
+
If no article topic exists, auto-publish articles when accessed.
+
+ On
+ Off
+
+
+
Auto Create User ID
+
+
If auto create is on, which user should own the post?
+
+
Login / Registeration Behavior
When authenticating, should it be a pop-up or redirect?
From 449aeb42ed2dbe6aa7edaac13cc69ccb6a5cff55 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 12 Jan 2022 14:39:42 -0500
Subject: [PATCH 30/36] Don't show if no mainPost content. This occurs when a
topic is purged
---
public/templates/comments/comments.tpl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/templates/comments/comments.tpl b/public/templates/comments/comments.tpl
index 9a293219..dd669286 100644
--- a/public/templates/comments/comments.tpl
+++ b/public/templates/comments/comments.tpl
@@ -1,4 +1,4 @@
-
+
@@ -92,4 +92,4 @@
-
+
From ce8424139b9bb662007303044a70c5937a4d03ee Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 12 Jan 2022 14:46:11 -0500
Subject: [PATCH 31/36] Update package and yarn files
---
package-lock.json | 1773 +--------------------------------------------
package.json | 2 +-
yarn.lock | 1062 +++++++++++++++++++++++++++
3 files changed, 1066 insertions(+), 1771 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 078d0da7..43ea460f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,1774 +1,8 @@
{
"name": "nodebb-plugin-blog-comments",
- "version": "0.8.3",
- "lockfileVersion": 2,
+ "version": "0.9.0",
+ "lockfileVersion": 1,
"requires": true,
- "packages": {
- "": {
- "name": "nodebb-plugin-blog-comments",
- "version": "0.8.3",
- "license": "BSD-2-Clause",
- "devDependencies": {
- "eslint": "8.3.0",
- "eslint-config-nodebb": "0.1.1",
- "eslint-plugin-import": "2.25.3"
- }
- },
- "node_modules/@eslint/eslintrc": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz",
- "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==",
- "dev": true,
- "dependencies": {
- "ajv": "^6.12.4",
- "debug": "^4.3.2",
- "espree": "^9.2.0",
- "globals": "^13.9.0",
- "ignore": "^4.0.6",
- "import-fresh": "^3.2.1",
- "js-yaml": "^4.1.0",
- "minimatch": "^3.0.4",
- "strip-json-comments": "^3.1.1"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- }
- },
- "node_modules/@humanwhocodes/config-array": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz",
- "integrity": "sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A==",
- "dev": true,
- "dependencies": {
- "@humanwhocodes/object-schema": "^1.2.0",
- "debug": "^4.1.1",
- "minimatch": "^3.0.4"
- },
- "engines": {
- "node": ">=10.10.0"
- }
- },
- "node_modules/@humanwhocodes/object-schema": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
- "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
- "dev": true
- },
- "node_modules/@types/json5": {
- "version": "0.0.29",
- "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
- "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=",
- "dev": true
- },
- "node_modules/acorn": {
- "version": "8.6.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz",
- "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==",
- "dev": true,
- "bin": {
- "acorn": "bin/acorn"
- },
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/acorn-jsx": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
- "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
- "dev": true,
- "peerDependencies": {
- "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
- }
- },
- "node_modules/ajv": {
- "version": "6.12.6",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
- "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
- "dev": true,
- "dependencies": {
- "fast-deep-equal": "^3.1.1",
- "fast-json-stable-stringify": "^2.0.0",
- "json-schema-traverse": "^0.4.1",
- "uri-js": "^4.2.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
- }
- },
- "node_modules/ansi-colors": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
- "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/ansi-regex": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dev": true,
- "dependencies": {
- "color-convert": "^2.0.1"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
- }
- },
- "node_modules/argparse": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
- "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
- "dev": true
- },
- "node_modules/array-includes": {
- "version": "3.1.4",
- "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz",
- "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.19.1",
- "get-intrinsic": "^1.1.1",
- "is-string": "^1.0.7"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/array.prototype.flat": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz",
- "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.19.0"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
- "dev": true
- },
- "node_modules/brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "dev": true,
- "dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "node_modules/call-bind": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
- "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
- "dev": true,
- "dependencies": {
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/callsites": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
- "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/chalk?sponsor=1"
- }
- },
- "node_modules/color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
- "dependencies": {
- "color-name": "~1.1.4"
- },
- "engines": {
- "node": ">=7.0.0"
- }
- },
- "node_modules/color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true
- },
- "node_modules/concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
- "dev": true
- },
- "node_modules/confusing-browser-globals": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz",
- "integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==",
- "dev": true
- },
- "node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
- "dev": true,
- "dependencies": {
- "path-key": "^3.1.0",
- "shebang-command": "^2.0.0",
- "which": "^2.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/debug": {
- "version": "4.3.3",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
- "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
- "dev": true,
- "dependencies": {
- "ms": "2.1.2"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/deep-is": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
- "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
- "dev": true
- },
- "node_modules/define-properties": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
- "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
- "dev": true,
- "dependencies": {
- "object-keys": "^1.0.12"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/doctrine": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
- "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
- "dev": true,
- "dependencies": {
- "esutils": "^2.0.2"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/enquirer": {
- "version": "2.3.6",
- "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
- "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
- "dev": true,
- "dependencies": {
- "ansi-colors": "^4.1.1"
- },
- "engines": {
- "node": ">=8.6"
- }
- },
- "node_modules/es-abstract": {
- "version": "1.19.1",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz",
- "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "es-to-primitive": "^1.2.1",
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.1.1",
- "get-symbol-description": "^1.0.0",
- "has": "^1.0.3",
- "has-symbols": "^1.0.2",
- "internal-slot": "^1.0.3",
- "is-callable": "^1.2.4",
- "is-negative-zero": "^2.0.1",
- "is-regex": "^1.1.4",
- "is-shared-array-buffer": "^1.0.1",
- "is-string": "^1.0.7",
- "is-weakref": "^1.0.1",
- "object-inspect": "^1.11.0",
- "object-keys": "^1.1.1",
- "object.assign": "^4.1.2",
- "string.prototype.trimend": "^1.0.4",
- "string.prototype.trimstart": "^1.0.4",
- "unbox-primitive": "^1.0.1"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/es-to-primitive": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
- "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
- "dev": true,
- "dependencies": {
- "is-callable": "^1.1.4",
- "is-date-object": "^1.0.1",
- "is-symbol": "^1.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/escape-string-regexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
- "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/eslint": {
- "version": "8.3.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.3.0.tgz",
- "integrity": "sha512-aIay56Ph6RxOTC7xyr59Kt3ewX185SaGnAr8eWukoPLeriCrvGjvAubxuvaXOfsxhtwV5g0uBOsyhAom4qJdww==",
- "dev": true,
- "dependencies": {
- "@eslint/eslintrc": "^1.0.4",
- "@humanwhocodes/config-array": "^0.6.0",
- "ajv": "^6.10.0",
- "chalk": "^4.0.0",
- "cross-spawn": "^7.0.2",
- "debug": "^4.3.2",
- "doctrine": "^3.0.0",
- "enquirer": "^2.3.5",
- "escape-string-regexp": "^4.0.0",
- "eslint-scope": "^7.1.0",
- "eslint-utils": "^3.0.0",
- "eslint-visitor-keys": "^3.1.0",
- "espree": "^9.1.0",
- "esquery": "^1.4.0",
- "esutils": "^2.0.2",
- "fast-deep-equal": "^3.1.3",
- "file-entry-cache": "^6.0.1",
- "functional-red-black-tree": "^1.0.1",
- "glob-parent": "^6.0.1",
- "globals": "^13.6.0",
- "ignore": "^4.0.6",
- "import-fresh": "^3.0.0",
- "imurmurhash": "^0.1.4",
- "is-glob": "^4.0.0",
- "js-yaml": "^4.1.0",
- "json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.4.1",
- "lodash.merge": "^4.6.2",
- "minimatch": "^3.0.4",
- "natural-compare": "^1.4.0",
- "optionator": "^0.9.1",
- "progress": "^2.0.0",
- "regexpp": "^3.2.0",
- "semver": "^7.2.1",
- "strip-ansi": "^6.0.1",
- "strip-json-comments": "^3.1.0",
- "text-table": "^0.2.0",
- "v8-compile-cache": "^2.0.3"
- },
- "bin": {
- "eslint": "bin/eslint.js"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint-config-nodebb": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/eslint-config-nodebb/-/eslint-config-nodebb-0.1.1.tgz",
- "integrity": "sha512-+LSX8iYe10fKb6k4JuyMygce7GQMSMsttdgi+BO+v+P3tXXxH//OUnEfZ2cbTungZap9Z8NuK6Tog1wrRQo6CQ==",
- "dev": true,
- "dependencies": {
- "eslint-config-airbnb-base": "15.0.0"
- },
- "peerDependencies": {
- "eslint": "7.x || 8.x",
- "eslint-plugin-import": "2.x"
- }
- },
- "node_modules/eslint-config-nodebb/node_modules/eslint-config-airbnb-base": {
- "version": "15.0.0",
- "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz",
- "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==",
- "dev": true,
- "dependencies": {
- "confusing-browser-globals": "^1.0.10",
- "object.assign": "^4.1.2",
- "object.entries": "^1.1.5",
- "semver": "^6.3.0"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- },
- "peerDependencies": {
- "eslint": "^7.32.0 || ^8.2.0",
- "eslint-plugin-import": "^2.25.2"
- }
- },
- "node_modules/eslint-config-nodebb/node_modules/semver": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
- "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
- "dev": true,
- "bin": {
- "semver": "bin/semver.js"
- }
- },
- "node_modules/eslint-import-resolver-node": {
- "version": "0.3.6",
- "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz",
- "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==",
- "dev": true,
- "dependencies": {
- "debug": "^3.2.7",
- "resolve": "^1.20.0"
- }
- },
- "node_modules/eslint-import-resolver-node/node_modules/debug": {
- "version": "3.2.7",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
- "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
- "dev": true,
- "dependencies": {
- "ms": "^2.1.1"
- }
- },
- "node_modules/eslint-module-utils": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz",
- "integrity": "sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ==",
- "dev": true,
- "dependencies": {
- "debug": "^3.2.7",
- "find-up": "^2.1.0",
- "pkg-dir": "^2.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/eslint-module-utils/node_modules/debug": {
- "version": "3.2.7",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
- "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
- "dev": true,
- "dependencies": {
- "ms": "^2.1.1"
- }
- },
- "node_modules/eslint-plugin-import": {
- "version": "2.25.3",
- "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz",
- "integrity": "sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg==",
- "dev": true,
- "dependencies": {
- "array-includes": "^3.1.4",
- "array.prototype.flat": "^1.2.5",
- "debug": "^2.6.9",
- "doctrine": "^2.1.0",
- "eslint-import-resolver-node": "^0.3.6",
- "eslint-module-utils": "^2.7.1",
- "has": "^1.0.3",
- "is-core-module": "^2.8.0",
- "is-glob": "^4.0.3",
- "minimatch": "^3.0.4",
- "object.values": "^1.1.5",
- "resolve": "^1.20.0",
- "tsconfig-paths": "^3.11.0"
- },
- "engines": {
- "node": ">=4"
- },
- "peerDependencies": {
- "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8"
- }
- },
- "node_modules/eslint-plugin-import/node_modules/debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dev": true,
- "dependencies": {
- "ms": "2.0.0"
- }
- },
- "node_modules/eslint-plugin-import/node_modules/doctrine": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
- "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
- "dev": true,
- "dependencies": {
- "esutils": "^2.0.2"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/eslint-plugin-import/node_modules/ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
- "dev": true
- },
- "node_modules/eslint-scope": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz",
- "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==",
- "dev": true,
- "dependencies": {
- "esrecurse": "^4.3.0",
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- }
- },
- "node_modules/eslint-visitor-keys": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz",
- "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==",
- "dev": true,
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- }
- },
- "node_modules/eslint/node_modules/eslint-utils": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
- "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
- "dev": true,
- "dependencies": {
- "eslint-visitor-keys": "^2.0.0"
- },
- "engines": {
- "node": "^10.0.0 || ^12.0.0 || >= 14.0.0"
- },
- "funding": {
- "url": "https://github.com/sponsors/mysticatea"
- },
- "peerDependencies": {
- "eslint": ">=5"
- }
- },
- "node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
- "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
- "dev": true,
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/espree": {
- "version": "9.2.0",
- "resolved": "https://registry.npmjs.org/espree/-/espree-9.2.0.tgz",
- "integrity": "sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg==",
- "dev": true,
- "dependencies": {
- "acorn": "^8.6.0",
- "acorn-jsx": "^5.3.1",
- "eslint-visitor-keys": "^3.1.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- }
- },
- "node_modules/esquery": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz",
- "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.1.0"
- },
- "engines": {
- "node": ">=0.10"
- }
- },
- "node_modules/esrecurse": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
- "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/estraverse": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
- "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
- "dev": true,
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/fast-deep-equal": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
- "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
- "dev": true
- },
- "node_modules/fast-json-stable-stringify": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
- "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
- "dev": true
- },
- "node_modules/fast-levenshtein": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
- "dev": true
- },
- "node_modules/file-entry-cache": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
- "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
- "dev": true,
- "dependencies": {
- "flat-cache": "^3.0.4"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/find-up": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
- "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
- "dev": true,
- "dependencies": {
- "locate-path": "^2.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/flat-cache": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
- "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
- "dev": true,
- "dependencies": {
- "flatted": "^3.1.0",
- "rimraf": "^3.0.2"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/flatted": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz",
- "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==",
- "dev": true
- },
- "node_modules/fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
- "dev": true
- },
- "node_modules/function-bind": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
- "dev": true
- },
- "node_modules/functional-red-black-tree": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
- "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
- "dev": true
- },
- "node_modules/get-intrinsic": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
- "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
- "dev": true,
- "dependencies": {
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.1"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/get-symbol-description": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz",
- "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "get-intrinsic": "^1.1.1"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/glob": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
- "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
- "dev": true,
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/glob-parent": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
- "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.3"
- },
- "engines": {
- "node": ">=10.13.0"
- }
- },
- "node_modules/globals": {
- "version": "13.12.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz",
- "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==",
- "dev": true,
- "dependencies": {
- "type-fest": "^0.20.2"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/has": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
- "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
- "dev": true,
- "dependencies": {
- "function-bind": "^1.1.1"
- },
- "engines": {
- "node": ">= 0.4.0"
- }
- },
- "node_modules/has-bigints": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz",
- "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==",
- "dev": true,
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/has-symbols": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
- "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
- "dev": true,
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/has-tostringtag": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
- "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
- "dev": true,
- "dependencies": {
- "has-symbols": "^1.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/ignore": {
- "version": "4.0.6",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
- "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
- "dev": true,
- "engines": {
- "node": ">= 4"
- }
- },
- "node_modules/import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
- "dev": true,
- "dependencies": {
- "parent-module": "^1.0.0",
- "resolve-from": "^4.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/imurmurhash": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
- "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
- "dev": true,
- "engines": {
- "node": ">=0.8.19"
- }
- },
- "node_modules/inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
- "dev": true,
- "dependencies": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "node_modules/inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
- "dev": true
- },
- "node_modules/internal-slot": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz",
- "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==",
- "dev": true,
- "dependencies": {
- "get-intrinsic": "^1.1.0",
- "has": "^1.0.3",
- "side-channel": "^1.0.4"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/is-bigint": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
- "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
- "dev": true,
- "dependencies": {
- "has-bigints": "^1.0.1"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-boolean-object": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
- "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "has-tostringtag": "^1.0.0"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-callable": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz",
- "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==",
- "dev": true,
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-core-module": {
- "version": "2.8.0",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz",
- "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
- "dev": true,
- "dependencies": {
- "has": "^1.0.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-date-object": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
- "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
- "dev": true,
- "dependencies": {
- "has-tostringtag": "^1.0.0"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-glob": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
- "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
- "dev": true,
- "dependencies": {
- "is-extglob": "^2.1.1"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-negative-zero": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
- "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==",
- "dev": true,
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-number-object": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz",
- "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==",
- "dev": true,
- "dependencies": {
- "has-tostringtag": "^1.0.0"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-regex": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
- "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "has-tostringtag": "^1.0.0"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-shared-array-buffer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz",
- "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==",
- "dev": true,
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-string": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
- "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
- "dev": true,
- "dependencies": {
- "has-tostringtag": "^1.0.0"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-symbol": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
- "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
- "dev": true,
- "dependencies": {
- "has-symbols": "^1.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-weakref": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz",
- "integrity": "sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.0"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
- "dev": true
- },
- "node_modules/js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
- "dev": true,
- "dependencies": {
- "argparse": "^2.0.1"
- },
- "bin": {
- "js-yaml": "bin/js-yaml.js"
- }
- },
- "node_modules/json-schema-traverse": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
- "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
- "dev": true
- },
- "node_modules/json-stable-stringify-without-jsonify": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
- "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
- "dev": true
- },
- "node_modules/json5": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
- "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
- "dev": true,
- "dependencies": {
- "minimist": "^1.2.0"
- },
- "bin": {
- "json5": "lib/cli.js"
- }
- },
- "node_modules/levn": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
- "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
- "dev": true,
- "dependencies": {
- "prelude-ls": "^1.2.1",
- "type-check": "~0.4.0"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/locate-path": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
- "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
- "dev": true,
- "dependencies": {
- "p-locate": "^2.0.0",
- "path-exists": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/lodash.merge": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
- "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
- "dev": true
- },
- "node_modules/lru-cache": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
- "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
- "dev": true,
- "dependencies": {
- "yallist": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/minimatch": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
- "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
- "dev": true,
- "dependencies": {
- "brace-expansion": "^1.1.7"
- },
- "engines": {
- "node": "*"
- }
- },
- "node_modules/minimist": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
- "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
- "dev": true
- },
- "node_modules/ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
- "dev": true
- },
- "node_modules/natural-compare": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
- "dev": true
- },
- "node_modules/object-inspect": {
- "version": "1.11.0",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
- "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==",
- "dev": true,
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/object-keys": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
- "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
- "dev": true,
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/object.assign": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
- "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3",
- "has-symbols": "^1.0.1",
- "object-keys": "^1.1.1"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/object.entries": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz",
- "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.19.1"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/object.values": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz",
- "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.19.1"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
- "dev": true,
- "dependencies": {
- "wrappy": "1"
- }
- },
- "node_modules/optionator": {
- "version": "0.9.1",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
- "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
- "dev": true,
- "dependencies": {
- "deep-is": "^0.1.3",
- "fast-levenshtein": "^2.0.6",
- "levn": "^0.4.1",
- "prelude-ls": "^1.2.1",
- "type-check": "^0.4.0",
- "word-wrap": "^1.2.3"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/p-limit": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
- "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
- "dev": true,
- "dependencies": {
- "p-try": "^1.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/p-locate": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
- "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
- "dev": true,
- "dependencies": {
- "p-limit": "^1.1.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/p-try": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
- "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/parent-module": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
- "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
- "dev": true,
- "dependencies": {
- "callsites": "^3.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/path-exists": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
- "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/path-key": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
- "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/path-parse": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
- "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
- "dev": true
- },
- "node_modules/pkg-dir": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
- "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
- "dev": true,
- "dependencies": {
- "find-up": "^2.1.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/prelude-ls": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
- "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
- "dev": true,
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/progress": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
- "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
- "dev": true,
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/punycode": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
- "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/regexpp": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
- "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
- "dev": true,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/mysticatea"
- }
- },
- "node_modules/resolve": {
- "version": "1.20.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
- "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
- "dev": true,
- "dependencies": {
- "is-core-module": "^2.2.0",
- "path-parse": "^1.0.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/resolve-from": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
- "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
- "dev": true,
- "dependencies": {
- "glob": "^7.1.3"
- },
- "bin": {
- "rimraf": "bin.js"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/semver": {
- "version": "7.3.5",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
- "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
- "dev": true,
- "dependencies": {
- "lru-cache": "^6.0.0"
- },
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/shebang-command": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
- "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
- "dev": true,
- "dependencies": {
- "shebang-regex": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/shebang-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
- "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/side-channel": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
- "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.0",
- "get-intrinsic": "^1.0.2",
- "object-inspect": "^1.9.0"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/string.prototype.trimend": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz",
- "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/string.prototype.trimstart": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz",
- "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/strip-ansi": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
- "dev": true,
- "dependencies": {
- "ansi-regex": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-bom": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
- "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/strip-json-comments": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
- "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
- "dev": true,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/text-table": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
- "dev": true
- },
- "node_modules/tsconfig-paths": {
- "version": "3.12.0",
- "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz",
- "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==",
- "dev": true,
- "dependencies": {
- "@types/json5": "^0.0.29",
- "json5": "^1.0.1",
- "minimist": "^1.2.0",
- "strip-bom": "^3.0.0"
- }
- },
- "node_modules/type-check": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
- "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
- "dev": true,
- "dependencies": {
- "prelude-ls": "^1.2.1"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/unbox-primitive": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
- "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
- "dev": true,
- "dependencies": {
- "function-bind": "^1.1.1",
- "has-bigints": "^1.0.1",
- "has-symbols": "^1.0.2",
- "which-boxed-primitive": "^1.0.2"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/uri-js": {
- "version": "4.4.1",
- "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
- "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
- "dev": true,
- "dependencies": {
- "punycode": "^2.1.0"
- }
- },
- "node_modules/v8-compile-cache": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
- "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==",
- "dev": true
- },
- "node_modules/which": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
- "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
- "dev": true,
- "dependencies": {
- "isexe": "^2.0.0"
- },
- "bin": {
- "node-which": "bin/node-which"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/which-boxed-primitive": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
- "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
- "dev": true,
- "dependencies": {
- "is-bigint": "^1.0.1",
- "is-boolean-object": "^1.1.0",
- "is-number-object": "^1.0.4",
- "is-string": "^1.0.5",
- "is-symbol": "^1.0.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/word-wrap": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
- "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
- "dev": true
- },
- "node_modules/yallist": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
- "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
- "dev": true
- }
- },
"dependencies": {
"@eslint/eslintrc": {
"version": "1.0.5",
@@ -1820,8 +54,7 @@
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
"integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
- "dev": true,
- "requires": {}
+ "dev": true
},
"ajv": {
"version": "6.12.6",
diff --git a/package.json b/package.json
index 689d0001..482bf4ef 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "nodebb-plugin-blog-comments",
- "version": "0.8.3",
+ "version": "0.9.0",
"description": "NodeBB Blog Comments (Ghost / WP Commenting Engine)",
"main": "library.js",
"scripts": {
diff --git a/yarn.lock b/yarn.lock
index fb57ccd1..7d36786a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,3 +2,1065 @@
# yarn lockfile v1
+"@eslint/eslintrc@^1.0.4":
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318"
+ integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==
+ dependencies:
+ ajv "^6.12.4"
+ debug "^4.3.2"
+ espree "^9.2.0"
+ globals "^13.9.0"
+ ignore "^4.0.6"
+ import-fresh "^3.2.1"
+ js-yaml "^4.1.0"
+ minimatch "^3.0.4"
+ strip-json-comments "^3.1.1"
+
+"@humanwhocodes/config-array@^0.6.0":
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.6.0.tgz#b5621fdb3b32309d2d16575456cbc277fa8f021a"
+ integrity sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A==
+ dependencies:
+ "@humanwhocodes/object-schema" "^1.2.0"
+ debug "^4.1.1"
+ minimatch "^3.0.4"
+
+"@humanwhocodes/object-schema@^1.2.0":
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
+ integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
+
+"@types/json5@^0.0.29":
+ version "0.0.29"
+ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
+ integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=
+
+acorn-jsx@^5.3.1:
+ version "5.3.2"
+ resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
+ integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
+
+acorn@^8.7.0:
+ version "8.7.0"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf"
+ integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==
+
+ajv@^6.10.0, ajv@^6.12.4:
+ version "6.12.6"
+ resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
+ integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
+ dependencies:
+ fast-deep-equal "^3.1.1"
+ fast-json-stable-stringify "^2.0.0"
+ json-schema-traverse "^0.4.1"
+ uri-js "^4.2.2"
+
+ansi-colors@^4.1.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
+ integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
+
+ansi-regex@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
+ integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
+
+ansi-styles@^4.1.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
+ integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
+ dependencies:
+ color-convert "^2.0.1"
+
+argparse@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
+ integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
+
+array-includes@^3.1.4:
+ version "3.1.4"
+ resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9"
+ integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==
+ dependencies:
+ call-bind "^1.0.2"
+ define-properties "^1.1.3"
+ es-abstract "^1.19.1"
+ get-intrinsic "^1.1.1"
+ is-string "^1.0.7"
+
+array.prototype.flat@^1.2.5:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13"
+ integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==
+ dependencies:
+ call-bind "^1.0.2"
+ define-properties "^1.1.3"
+ es-abstract "^1.19.0"
+
+balanced-match@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
+ integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
+
+brace-expansion@^1.1.7:
+ version "1.1.11"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
+ integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
+ dependencies:
+ balanced-match "^1.0.0"
+ concat-map "0.0.1"
+
+call-bind@^1.0.0, call-bind@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
+ integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==
+ dependencies:
+ function-bind "^1.1.1"
+ get-intrinsic "^1.0.2"
+
+callsites@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
+ integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
+
+chalk@^4.0.0:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
+ integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
+ dependencies:
+ ansi-styles "^4.1.0"
+ supports-color "^7.1.0"
+
+color-convert@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
+ integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
+ dependencies:
+ color-name "~1.1.4"
+
+color-name@~1.1.4:
+ version "1.1.4"
+ resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
+ integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
+
+concat-map@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
+ integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
+
+confusing-browser-globals@^1.0.10:
+ version "1.0.11"
+ resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81"
+ integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==
+
+cross-spawn@^7.0.2:
+ version "7.0.3"
+ resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
+ integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
+ dependencies:
+ path-key "^3.1.0"
+ shebang-command "^2.0.0"
+ which "^2.0.1"
+
+debug@^2.6.9:
+ version "2.6.9"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
+ integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
+ dependencies:
+ ms "2.0.0"
+
+debug@^3.2.7:
+ version "3.2.7"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
+ integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
+ dependencies:
+ ms "^2.1.1"
+
+debug@^4.1.1, debug@^4.3.2:
+ version "4.3.3"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
+ integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
+ dependencies:
+ ms "2.1.2"
+
+deep-is@^0.1.3:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
+ integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==
+
+define-properties@^1.1.3:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
+ integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
+ dependencies:
+ object-keys "^1.0.12"
+
+doctrine@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
+ integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==
+ dependencies:
+ esutils "^2.0.2"
+
+doctrine@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
+ integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==
+ dependencies:
+ esutils "^2.0.2"
+
+enquirer@^2.3.5:
+ version "2.3.6"
+ resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d"
+ integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==
+ dependencies:
+ ansi-colors "^4.1.1"
+
+es-abstract@^1.19.0, es-abstract@^1.19.1:
+ version "1.19.1"
+ resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3"
+ integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==
+ dependencies:
+ call-bind "^1.0.2"
+ es-to-primitive "^1.2.1"
+ function-bind "^1.1.1"
+ get-intrinsic "^1.1.1"
+ get-symbol-description "^1.0.0"
+ has "^1.0.3"
+ has-symbols "^1.0.2"
+ internal-slot "^1.0.3"
+ is-callable "^1.2.4"
+ is-negative-zero "^2.0.1"
+ is-regex "^1.1.4"
+ is-shared-array-buffer "^1.0.1"
+ is-string "^1.0.7"
+ is-weakref "^1.0.1"
+ object-inspect "^1.11.0"
+ object-keys "^1.1.1"
+ object.assign "^4.1.2"
+ string.prototype.trimend "^1.0.4"
+ string.prototype.trimstart "^1.0.4"
+ unbox-primitive "^1.0.1"
+
+es-to-primitive@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a"
+ integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==
+ dependencies:
+ is-callable "^1.1.4"
+ is-date-object "^1.0.1"
+ is-symbol "^1.0.2"
+
+escape-string-regexp@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
+ integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
+
+eslint-config-airbnb-base@15.0.0:
+ version "15.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236"
+ integrity sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==
+ dependencies:
+ confusing-browser-globals "^1.0.10"
+ object.assign "^4.1.2"
+ object.entries "^1.1.5"
+ semver "^6.3.0"
+
+eslint-config-nodebb@0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/eslint-config-nodebb/-/eslint-config-nodebb-0.1.1.tgz#da29bca090442d70a8532cc9e8774ef4651ed000"
+ integrity sha512-+LSX8iYe10fKb6k4JuyMygce7GQMSMsttdgi+BO+v+P3tXXxH//OUnEfZ2cbTungZap9Z8NuK6Tog1wrRQo6CQ==
+ dependencies:
+ eslint-config-airbnb-base "15.0.0"
+
+eslint-import-resolver-node@^0.3.6:
+ version "0.3.6"
+ resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd"
+ integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==
+ dependencies:
+ debug "^3.2.7"
+ resolve "^1.20.0"
+
+eslint-module-utils@^2.7.1:
+ version "2.7.2"
+ resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz#1d0aa455dcf41052339b63cada8ab5fd57577129"
+ integrity sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg==
+ dependencies:
+ debug "^3.2.7"
+ find-up "^2.1.0"
+
+eslint-plugin-import@2.25.3:
+ version "2.25.3"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz#a554b5f66e08fb4f6dc99221866e57cfff824766"
+ integrity sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg==
+ dependencies:
+ array-includes "^3.1.4"
+ array.prototype.flat "^1.2.5"
+ debug "^2.6.9"
+ doctrine "^2.1.0"
+ eslint-import-resolver-node "^0.3.6"
+ eslint-module-utils "^2.7.1"
+ has "^1.0.3"
+ is-core-module "^2.8.0"
+ is-glob "^4.0.3"
+ minimatch "^3.0.4"
+ object.values "^1.1.5"
+ resolve "^1.20.0"
+ tsconfig-paths "^3.11.0"
+
+eslint-scope@^7.1.0:
+ version "7.1.0"
+ resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153"
+ integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==
+ dependencies:
+ esrecurse "^4.3.0"
+ estraverse "^5.2.0"
+
+eslint-utils@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672"
+ integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==
+ dependencies:
+ eslint-visitor-keys "^2.0.0"
+
+eslint-visitor-keys@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
+ integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
+
+eslint-visitor-keys@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2"
+ integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==
+
+eslint@8.3.0:
+ version "8.3.0"
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.3.0.tgz#a3c2409507403c1c7f6c42926111d6cbefbc3e85"
+ integrity sha512-aIay56Ph6RxOTC7xyr59Kt3ewX185SaGnAr8eWukoPLeriCrvGjvAubxuvaXOfsxhtwV5g0uBOsyhAom4qJdww==
+ dependencies:
+ "@eslint/eslintrc" "^1.0.4"
+ "@humanwhocodes/config-array" "^0.6.0"
+ ajv "^6.10.0"
+ chalk "^4.0.0"
+ cross-spawn "^7.0.2"
+ debug "^4.3.2"
+ doctrine "^3.0.0"
+ enquirer "^2.3.5"
+ escape-string-regexp "^4.0.0"
+ eslint-scope "^7.1.0"
+ eslint-utils "^3.0.0"
+ eslint-visitor-keys "^3.1.0"
+ espree "^9.1.0"
+ esquery "^1.4.0"
+ esutils "^2.0.2"
+ fast-deep-equal "^3.1.3"
+ file-entry-cache "^6.0.1"
+ functional-red-black-tree "^1.0.1"
+ glob-parent "^6.0.1"
+ globals "^13.6.0"
+ ignore "^4.0.6"
+ import-fresh "^3.0.0"
+ imurmurhash "^0.1.4"
+ is-glob "^4.0.0"
+ js-yaml "^4.1.0"
+ json-stable-stringify-without-jsonify "^1.0.1"
+ levn "^0.4.1"
+ lodash.merge "^4.6.2"
+ minimatch "^3.0.4"
+ natural-compare "^1.4.0"
+ optionator "^0.9.1"
+ progress "^2.0.0"
+ regexpp "^3.2.0"
+ semver "^7.2.1"
+ strip-ansi "^6.0.1"
+ strip-json-comments "^3.1.0"
+ text-table "^0.2.0"
+ v8-compile-cache "^2.0.3"
+
+espree@^9.1.0, espree@^9.2.0:
+ version "9.3.0"
+ resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.0.tgz#c1240d79183b72aaee6ccfa5a90bc9111df085a8"
+ integrity sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==
+ dependencies:
+ acorn "^8.7.0"
+ acorn-jsx "^5.3.1"
+ eslint-visitor-keys "^3.1.0"
+
+esquery@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5"
+ integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==
+ dependencies:
+ estraverse "^5.1.0"
+
+esrecurse@^4.3.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921"
+ integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==
+ dependencies:
+ estraverse "^5.2.0"
+
+estraverse@^5.1.0, estraverse@^5.2.0:
+ version "5.3.0"
+ resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
+ integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
+
+esutils@^2.0.2:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
+ integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
+
+fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
+ integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
+
+fast-json-stable-stringify@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
+ integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
+
+fast-levenshtein@^2.0.6:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
+ integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
+
+file-entry-cache@^6.0.1:
+ version "6.0.1"
+ resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027"
+ integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==
+ dependencies:
+ flat-cache "^3.0.4"
+
+find-up@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
+ integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c=
+ dependencies:
+ locate-path "^2.0.0"
+
+flat-cache@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
+ integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==
+ dependencies:
+ flatted "^3.1.0"
+ rimraf "^3.0.2"
+
+flatted@^3.1.0:
+ version "3.2.4"
+ resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2"
+ integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==
+
+fs.realpath@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
+ integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
+
+function-bind@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
+ integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
+
+functional-red-black-tree@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
+ integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
+
+get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6"
+ integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==
+ dependencies:
+ function-bind "^1.1.1"
+ has "^1.0.3"
+ has-symbols "^1.0.1"
+
+get-symbol-description@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6"
+ integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==
+ dependencies:
+ call-bind "^1.0.2"
+ get-intrinsic "^1.1.1"
+
+glob-parent@^6.0.1:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3"
+ integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==
+ dependencies:
+ is-glob "^4.0.3"
+
+glob@^7.1.3:
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
+ integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
+ dependencies:
+ fs.realpath "^1.0.0"
+ inflight "^1.0.4"
+ inherits "2"
+ minimatch "^3.0.4"
+ once "^1.3.0"
+ path-is-absolute "^1.0.0"
+
+globals@^13.6.0, globals@^13.9.0:
+ version "13.12.0"
+ resolved "https://registry.yarnpkg.com/globals/-/globals-13.12.0.tgz#4d733760304230a0082ed96e21e5c565f898089e"
+ integrity sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==
+ dependencies:
+ type-fest "^0.20.2"
+
+has-bigints@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113"
+ integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==
+
+has-flag@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
+ integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
+
+has-symbols@^1.0.1, has-symbols@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423"
+ integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==
+
+has-tostringtag@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25"
+ integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==
+ dependencies:
+ has-symbols "^1.0.2"
+
+has@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
+ integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
+ dependencies:
+ function-bind "^1.1.1"
+
+ignore@^4.0.6:
+ version "4.0.6"
+ resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
+ integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==
+
+import-fresh@^3.0.0, import-fresh@^3.2.1:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
+ integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==
+ dependencies:
+ parent-module "^1.0.0"
+ resolve-from "^4.0.0"
+
+imurmurhash@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
+ integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
+
+inflight@^1.0.4:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
+ integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
+ dependencies:
+ once "^1.3.0"
+ wrappy "1"
+
+inherits@2:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
+ integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
+
+internal-slot@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c"
+ integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==
+ dependencies:
+ get-intrinsic "^1.1.0"
+ has "^1.0.3"
+ side-channel "^1.0.4"
+
+is-bigint@^1.0.1:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3"
+ integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==
+ dependencies:
+ has-bigints "^1.0.1"
+
+is-boolean-object@^1.1.0:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719"
+ integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==
+ dependencies:
+ call-bind "^1.0.2"
+ has-tostringtag "^1.0.0"
+
+is-callable@^1.1.4, is-callable@^1.2.4:
+ version "1.2.4"
+ resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945"
+ integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==
+
+is-core-module@^2.8.0:
+ version "2.8.1"
+ resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211"
+ integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==
+ dependencies:
+ has "^1.0.3"
+
+is-date-object@^1.0.1:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f"
+ integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==
+ dependencies:
+ has-tostringtag "^1.0.0"
+
+is-extglob@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
+ integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
+
+is-glob@^4.0.0, is-glob@^4.0.3:
+ version "4.0.3"
+ resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
+ integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
+ dependencies:
+ is-extglob "^2.1.1"
+
+is-negative-zero@^2.0.1:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150"
+ integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==
+
+is-number-object@^1.0.4:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0"
+ integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==
+ dependencies:
+ has-tostringtag "^1.0.0"
+
+is-regex@^1.1.4:
+ version "1.1.4"
+ resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958"
+ integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==
+ dependencies:
+ call-bind "^1.0.2"
+ has-tostringtag "^1.0.0"
+
+is-shared-array-buffer@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6"
+ integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==
+
+is-string@^1.0.5, is-string@^1.0.7:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd"
+ integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==
+ dependencies:
+ has-tostringtag "^1.0.0"
+
+is-symbol@^1.0.2, is-symbol@^1.0.3:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c"
+ integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==
+ dependencies:
+ has-symbols "^1.0.2"
+
+is-weakref@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2"
+ integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==
+ dependencies:
+ call-bind "^1.0.2"
+
+isexe@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
+ integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
+
+js-yaml@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
+ integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
+ dependencies:
+ argparse "^2.0.1"
+
+json-schema-traverse@^0.4.1:
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
+ integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
+
+json-stable-stringify-without-jsonify@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
+ integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=
+
+json5@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe"
+ integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==
+ dependencies:
+ minimist "^1.2.0"
+
+levn@^0.4.1:
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
+ integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==
+ dependencies:
+ prelude-ls "^1.2.1"
+ type-check "~0.4.0"
+
+locate-path@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
+ integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=
+ dependencies:
+ p-locate "^2.0.0"
+ path-exists "^3.0.0"
+
+lodash.merge@^4.6.2:
+ version "4.6.2"
+ resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
+ integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
+
+lru-cache@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
+ integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
+ dependencies:
+ yallist "^4.0.0"
+
+minimatch@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
+ integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
+ dependencies:
+ brace-expansion "^1.1.7"
+
+minimist@^1.2.0:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
+ integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
+
+ms@2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
+ integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
+
+ms@2.1.2:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
+ integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
+
+ms@^2.1.1:
+ version "2.1.3"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
+ integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
+
+natural-compare@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
+ integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
+
+object-inspect@^1.11.0, object-inspect@^1.9.0:
+ version "1.12.0"
+ resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0"
+ integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==
+
+object-keys@^1.0.12, object-keys@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
+ integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
+
+object.assign@^4.1.2:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940"
+ integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==
+ dependencies:
+ call-bind "^1.0.0"
+ define-properties "^1.1.3"
+ has-symbols "^1.0.1"
+ object-keys "^1.1.1"
+
+object.entries@^1.1.5:
+ version "1.1.5"
+ resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861"
+ integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==
+ dependencies:
+ call-bind "^1.0.2"
+ define-properties "^1.1.3"
+ es-abstract "^1.19.1"
+
+object.values@^1.1.5:
+ version "1.1.5"
+ resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac"
+ integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==
+ dependencies:
+ call-bind "^1.0.2"
+ define-properties "^1.1.3"
+ es-abstract "^1.19.1"
+
+once@^1.3.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
+ integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
+ dependencies:
+ wrappy "1"
+
+optionator@^0.9.1:
+ version "0.9.1"
+ resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499"
+ integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==
+ dependencies:
+ deep-is "^0.1.3"
+ fast-levenshtein "^2.0.6"
+ levn "^0.4.1"
+ prelude-ls "^1.2.1"
+ type-check "^0.4.0"
+ word-wrap "^1.2.3"
+
+p-limit@^1.1.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
+ integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==
+ dependencies:
+ p-try "^1.0.0"
+
+p-locate@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
+ integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=
+ dependencies:
+ p-limit "^1.1.0"
+
+p-try@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
+ integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=
+
+parent-module@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
+ integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==
+ dependencies:
+ callsites "^3.0.0"
+
+path-exists@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
+ integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
+
+path-is-absolute@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
+ integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
+
+path-key@^3.1.0:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
+ integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
+
+path-parse@^1.0.7:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
+ integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
+
+prelude-ls@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
+ integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
+
+progress@^2.0.0:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
+ integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
+
+punycode@^2.1.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
+ integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
+
+regexpp@^3.2.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2"
+ integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==
+
+resolve-from@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
+ integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
+
+resolve@^1.20.0:
+ version "1.21.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.21.0.tgz#b51adc97f3472e6a5cf4444d34bc9d6b9037591f"
+ integrity sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==
+ dependencies:
+ is-core-module "^2.8.0"
+ path-parse "^1.0.7"
+ supports-preserve-symlinks-flag "^1.0.0"
+
+rimraf@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
+ integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
+ dependencies:
+ glob "^7.1.3"
+
+semver@^6.3.0:
+ version "6.3.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
+ integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
+
+semver@^7.2.1:
+ version "7.3.5"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
+ integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
+ dependencies:
+ lru-cache "^6.0.0"
+
+shebang-command@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
+ integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==
+ dependencies:
+ shebang-regex "^3.0.0"
+
+shebang-regex@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
+ integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
+
+side-channel@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
+ integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==
+ dependencies:
+ call-bind "^1.0.0"
+ get-intrinsic "^1.0.2"
+ object-inspect "^1.9.0"
+
+string.prototype.trimend@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80"
+ integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==
+ dependencies:
+ call-bind "^1.0.2"
+ define-properties "^1.1.3"
+
+string.prototype.trimstart@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed"
+ integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==
+ dependencies:
+ call-bind "^1.0.2"
+ define-properties "^1.1.3"
+
+strip-ansi@^6.0.1:
+ version "6.0.1"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
+ integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
+ dependencies:
+ ansi-regex "^5.0.1"
+
+strip-bom@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
+ integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=
+
+strip-json-comments@^3.1.0, strip-json-comments@^3.1.1:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
+ integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
+
+supports-color@^7.1.0:
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
+ integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
+ dependencies:
+ has-flag "^4.0.0"
+
+supports-preserve-symlinks-flag@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
+ integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
+
+text-table@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
+ integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
+
+tsconfig-paths@^3.11.0:
+ version "3.12.0"
+ resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b"
+ integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==
+ dependencies:
+ "@types/json5" "^0.0.29"
+ json5 "^1.0.1"
+ minimist "^1.2.0"
+ strip-bom "^3.0.0"
+
+type-check@^0.4.0, type-check@~0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
+ integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==
+ dependencies:
+ prelude-ls "^1.2.1"
+
+type-fest@^0.20.2:
+ version "0.20.2"
+ resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
+ integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
+
+unbox-primitive@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"
+ integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==
+ dependencies:
+ function-bind "^1.1.1"
+ has-bigints "^1.0.1"
+ has-symbols "^1.0.2"
+ which-boxed-primitive "^1.0.2"
+
+uri-js@^4.2.2:
+ version "4.4.1"
+ resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
+ integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==
+ dependencies:
+ punycode "^2.1.0"
+
+v8-compile-cache@^2.0.3:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
+ integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==
+
+which-boxed-primitive@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"
+ integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==
+ dependencies:
+ is-bigint "^1.0.1"
+ is-boolean-object "^1.1.0"
+ is-number-object "^1.0.4"
+ is-string "^1.0.5"
+ is-symbol "^1.0.3"
+
+which@^2.0.1:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
+ integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
+ dependencies:
+ isexe "^2.0.0"
+
+word-wrap@^1.2.3:
+ version "1.2.3"
+ resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
+ integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
+
+wrappy@1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
+ integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
+
+yallist@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
+ integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
From 70fc232f0a2ac87f648d0cba662e1cab60b18656 Mon Sep 17 00:00:00 2001
From: Austin Howe <720983+theaustinhowe@users.noreply.github.com>
Date: Wed, 12 Jan 2022 16:04:05 -0500
Subject: [PATCH 32/36] Support turning profile links off
---
library.js | 1 +
public/templates/comments/admin.tpl | 9 +++++++++
public/templates/comments/comments.tpl | 12 ++++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/library.js b/library.js
index d191c11e..424ec90f 100644
--- a/library.js
+++ b/library.js
@@ -123,6 +123,7 @@ Comments.getCommentData = async function (req, res) {
registerURL: meta.config['blog-comments:register-url'] || '',
authFlow: meta.config['blog-comments:auth-behavior'] || 'popup',
autoCreate: meta.config['blog-comments:autocreate'] === 'on',
+ profileLink: !(meta.config['blog-comments:profile-links'] === 'off'),
});
};
diff --git a/public/templates/comments/admin.tpl b/public/templates/comments/admin.tpl
index 6d0c0cc3..49620d42 100644
--- a/public/templates/comments/admin.tpl
+++ b/public/templates/comments/admin.tpl
@@ -58,6 +58,15 @@
+ Support Profile Links
+
+ Users can click on avatar images to go to the user's profile
+
+
+ On
+ Off
+
+
diff --git a/public/templates/comments/comments.tpl b/public/templates/comments/comments.tpl
index dd669286..197280f5 100644
--- a/public/templates/comments/comments.tpl
+++ b/public/templates/comments/comments.tpl
@@ -30,13 +30,21 @@