diff --git a/.gitignore b/.gitignore
index 42a1b3c705..bcf9d6fe94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,9 @@
dist/
yarn.lock
npm-debug.log
-node_modules/
-sftp-config.json
+node_modules/*
+!node_modules/nodebb-plugin-composer-default/
+sftp-config.json
config.json
jsconfig.json
public/src/nodebb.min.js
diff --git a/README.md b/README.md
index 6ef180f625..4ad48e3c4b 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,10 @@ NodeBB by itself contains a "common core" of basic functionality, while addition
### [Try it now](//try.nodebb.org) | [Documentation](//docs.nodebb.org)
+## Group Names
+
+Aadi, Mohamed, Ashwaq, Aya, and Haya.
+
## Screenshots
NodeBB's theming engine is highly flexible and does not restrict your design choices. Check out some themed installs in these screenshots below:
diff --git a/UserGuide.md b/UserGuide.md
new file mode 100644
index 0000000000..74517cfdd3
--- /dev/null
+++ b/UserGuide.md
@@ -0,0 +1,140 @@
+# ELEV8's User Guide
+
+## User Story 1: Detection of inappropriate words
+
+***As an instructor, I want the system to automatically detect and flag inappropriate words, so that the community stays respectful and focused.***
+
+**Status:** Complete
+
+**Acceptance Criteria:**
+1- The system checks each word in a user's post or reply against a predefined dictionary of inappropriate words.
+
+2- If an inappropriate word is detected, the word is replaceed with asterisks.
+
+**How to test this feature:**
+
+1- Log into NodeBB
+
+2- Choose one of the categories by clicking on one of them
+
+
+3- Create a new topic
+
+4- Write anything that has an innapropriate word in the post content box and then press submit:
+
+
+5- If the word is in our dictionary of bad words, it will get censored and look like this:
+
+
+**Automated testing:**
+
+**Location:** The tests for the inappropriate words feature are located in test/posts.js. The actual tests can be found between lines 56 and 92.
+
+**What is Being Tested:** the tests added focus on ensuring that the inappropriate words feature works correctly by censoring offensive language in the user posts.
+
+The first test sets up a mock bad words list and verifies that the censorBadWords function replaces these words with asterisks in the content.
+
+The second test handles content with no bad words. It confirms that when the censorBadWords function is called on clean content, the text remains unchanged, e.g., "This is a clean test"
+
+The third test deals with special characters and mixed-case bad words (e.g., "This is a BadWord1! and badword2"). It checks that bad words are censored regardless of their case or punctuation, returning the correct censored version of the content.
+
+**Why the Tests are Sufficient:** The tests thoroughly cover all key aspects of the inappropriate words filtering feature. The first test ensures that the censoring mechanism functions as intended by replacing offensive words with asterisks, validating the core functionality. The second test confirms that clean content remains unchanged, which is crucial for maintaining the integrity of user posts that do not contain offensive language. The third test addresses edge cases, such as handling special characters and mixed-case bad words, ensuring that inappropriate content is caught regardless of variations in punctuation or capitalization. These tests cover the full spectrum of expected use cases, providing confidence that the feature will perform reliably in different scenarios.
+
+## User Story 2: Anonymous posts
+
+***As a user, I want the option to post anonymously to my instructors so that I can express my concerns openly without fear of repercussions.***
+
+**Status:** Complete
+
+**Acceptance Criteria:**
+1- The frontend should display an anonymous posting checkbox option, allowing users to submit posts without revealing their identity.
+
+2- Ensure both backend and frontend integration to mask the user's identity while maintaining proper functionality of the post submission and display process.
+
+**How to test this feature:**
+
+1- On the NodeBB homepage, click on the "General Discussion" category (or any other relevant category where you want to post).
+
+
+
+
+2- Once inside the chosen category, locate and click the "New Topic" button, usually found at the top or bottom of the page.
+
+
+
+
+3- In the new topic form, look for the Anonymous checkbox located next to the Title input box. Click on the checkbox to enable anonymous posting.
+
+Fill in the Title and Content of your post as usual. You can also attach files or add formatting if needed.
+
+
+
+
+4- After writing your post, click the Submit button to post it anonymously. Your post will now appear in the thread, and your identity will be hidden.
+
+
+
+
+**Note:** You can also use the anonymous posting feature to reply to existing topics or posts. Simply click the Reply button within any topic, check the Anonymous checkbox, and submit your reply anonymously. However, in this scenario, we are demonstrating the process for creating a new topic.
+
+**Automated testing:**
+
+**Location:** The tests for the anonymous feature are located in test/topics.js. The relevant tests can be found between lines 2504 and 2560.
+
+**What is Being Tested:** The tests added focus on ensuring that the anonymous posting feature works correctly in the forum.
+
+The first test checks that when a new post is created with the anonymous flag set to false, the post is linked to the correct user and is not anonymous. It verifies the post’s metadata to ensure the correct user information is displayed.
+
+The second test verifies that when a post is created with the anonymous flag set to true, the post correctly hides the user's identity. It checks that the post is marked as anonymous in the database and that the anonymous flag remains true when the post is fetched.
+
+**Why the Tests are Sufficient:** These tests cover the core functionality of the anonymous feature, ensuring that the system correctly handles both anonymous and non-anonymous posts. By validating the behavior of the anonymous flag in different scenarios, these tests ensure that the user’s identity is appropriately masked or revealed depending on their choice. The tests also account for proper storage of this data in the database, making them comprehensive for the feature.
+
+
+## User Story 3: Emoji Reactions in Chat Section
+
+***As a user, I want to react to messages in the chat with a range of emojis to quickly express emotions and reactions without typing a response.***
+
+**Status:** Incomplete
+
+**Acceptance Criteria:**
+1- The task will be considered complete when the backend successfully tracks and stores emoji reactions for chat messages.
+
+2- The feature must be seamlessly integrated with the existing chat structure and support multiple reactions per message.
+
+3- The task will be considered complete when all emojis are available in the chat reaction system.
+
+**Progress:** We were only able to complete the frontend implementation of the emoji chat feature for this user story.
+
+
+
+**Justification:** While working on the backend logic for emoji reactions, we faced challenges with socket programming, which required real-time synchronization of reactions across multiple users in a chat room. This task involved advanced socket handling techniques beyond my current expertise. Additionally, integrating the emoji reactions into the existing chat system was more complex than expected due to dependencies on real-time updates and performance optimization across different browsers. Although we were able to implement the foundational parts of the feature, including the API endpoint and core logic for handling reactions, the complexity and scope of the task were too large to complete within a single sprint.
+
+## User Story 4: Pre-defined Replies
+
+***As a user, I want to be able to quickly respond to messages by clicking buttons with predefined replies so that I don't waste time typing out responses that are common.***
+
+**Status:** Complete
+
+**Acceptance Criteria:**
+1- The task will be complete when a clickable button is added to the user interface beside the regular reply button.
+
+2- Clicking any of the predefined quick reply buttons results in the corresponding message being inserted into the quick reply text box.
+
+3- The existing file containing the buttons for replying and quick replying must be identified and integrated with the new feature.
+
+**How to test this feature:**
+
+1- Login to Nodebb.
+
+2- Choose any message you would like to respond to. You should see a quick reply button at the bottom of the page, along with the other suggested responses.
+
+
+3- Select a suggested response to reply to the message,it should automatically be inserted into the quick reply text box. Then click on the quick reply button to post your message.
+
+
+
+
+
+
+
+
diff --git a/dump.rdb b/dump.rdb
new file mode 100644
index 0000000000..35576d01a1
Binary files /dev/null and b/dump.rdb differ
diff --git a/node_modules/nodebb-plugin-composer-default/.eslintrc b/node_modules/nodebb-plugin-composer-default/.eslintrc
new file mode 100644
index 0000000000..74e8dc064a
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/.eslintrc
@@ -0,0 +1,3 @@
+{
+ "extends": "nodebb/lib"
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/.gitattributes b/node_modules/nodebb-plugin-composer-default/.gitattributes
new file mode 100644
index 0000000000..412eeda78d
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/.gitattributes
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
diff --git a/node_modules/nodebb-plugin-composer-default/.jshintrc b/node_modules/nodebb-plugin-composer-default/.jshintrc
new file mode 100644
index 0000000000..1981c254c5
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/.jshintrc
@@ -0,0 +1,86 @@
+{
+ // JSHint Default Configuration File (as on JSHint website)
+ // See http://jshint.com/docs/ for more details
+
+ "maxerr" : 50, // {int} Maximum error before stopping
+
+ // Enforcing
+ "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
+ "camelcase" : false, // true: Identifiers must be in camelCase
+ "curly" : true, // true: Require {} for every new block or scope
+ "eqeqeq" : true, // true: Require triple equals (===) for comparison
+ "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
+ "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
+ "indent" : 4, // {int} Number of spaces to use for indentation
+ "latedef" : false, // true: Require variables/functions to be defined before being used
+ "newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
+ "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
+ "noempty" : true, // true: Prohibit use of empty blocks
+ "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
+ "plusplus" : false, // true: Prohibit use of `++` & `--`
+ "quotmark" : false, // Quotation mark consistency:
+ // false : do nothing (default)
+ // true : ensure whatever is used is consistent
+ // "single" : require single quotes
+ // "double" : require double quotes
+ "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
+ "unused" : true, // true: Require all defined variables be used
+ "strict" : true, // true: Requires all functions run in ES5 Strict Mode
+ "trailing" : false, // true: Prohibit trailing whitespaces
+ "maxparams" : false, // {int} Max number of formal params allowed per function
+ "maxdepth" : false, // {int} Max depth of nested blocks (within functions)
+ "maxstatements" : false, // {int} Max number statements per function
+ "maxcomplexity" : false, // {int} Max cyclomatic complexity per function
+ "maxlen" : false, // {int} Max number of characters per line
+
+ // Relaxing
+ "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
+ "boss" : false, // true: Tolerate assignments where comparisons would be expected
+ "debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
+ "eqnull" : false, // true: Tolerate use of `== null`
+ "es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
+ "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
+ "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
+ // (ex: `for each`, multiple try/catch, function expression…)
+ "evil" : false, // true: Tolerate use of `eval` and `new Function()`
+ "expr" : false, // true: Tolerate `ExpressionStatement` as Programs
+ "funcscope" : false, // true: Tolerate defining variables inside control statements"
+ "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
+ "iterator" : false, // true: Tolerate using the `__iterator__` property
+ "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
+ "laxbreak" : false, // true: Tolerate possibly unsafe line breakings
+ "laxcomma" : false, // true: Tolerate comma-first style coding
+ "loopfunc" : false, // true: Tolerate functions being defined in loops
+ "multistr" : false, // true: Tolerate multi-line strings
+ "proto" : false, // true: Tolerate using the `__proto__` property
+ "scripturl" : false, // true: Tolerate script-targeted URLs
+ "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
+ "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
+ "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
+ "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
+ "validthis" : false, // true: Tolerate using this in a non-constructor function
+
+ // Environments
+ "browser" : true, // Web Browser (window, document, etc)
+ "couch" : false, // CouchDB
+ "devel" : true, // Development/debugging (alert, confirm, etc)
+ "dojo" : false, // Dojo Toolkit
+ "jquery" : true, // jQuery
+ "mootools" : false, // MooTools
+ "node" : true, // Node.js
+ "nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
+ "prototypejs" : false, // Prototype and Scriptaculous
+ "rhino" : false, // Rhino
+ "worker" : false, // Web Workers
+ "wsh" : false, // Windows Scripting Host
+ "yui" : false, // Yahoo User Interface
+
+ // Legacy
+ "nomen" : false, // true: Prohibit dangling `_` in variables
+ "onevar" : false, // true: Allow only one `var` statement per function
+ "passfail" : false, // true: Stop on first error
+ "white" : false, // true: Check against strict whitespace and indentation rules
+
+ // Custom Globals
+ "globals" : {} // additional predefined global variables
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/LICENSE b/node_modules/nodebb-plugin-composer-default/LICENSE
new file mode 100644
index 0000000000..b8658d3aa1
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2016 NodeBB Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/README.md b/node_modules/nodebb-plugin-composer-default/README.md
new file mode 100644
index 0000000000..7bcfff9aff
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/README.md
@@ -0,0 +1,11 @@
+# Default Composer for NodeBB
+
+This plugin activates the default composer for NodeBB. It is activated by default, but can be swapped out as necessary.
+
+## Screenshots
+
+### Desktop
+![Desktop Composer](screenshots/desktop.png?raw=true)
+
+### Mobile Devices
+![Mobile Composer](screenshots/mobile.png?raw=true)
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/controllers.js b/node_modules/nodebb-plugin-composer-default/controllers.js
new file mode 100644
index 0000000000..cef271849f
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/controllers.js
@@ -0,0 +1,11 @@
+'use strict';
+
+const Controllers = {};
+
+Controllers.renderAdminPage = function (req, res) {
+ res.render('admin/plugins/composer-default', {
+ title: 'Composer (Default)',
+ });
+};
+
+module.exports = Controllers;
diff --git a/node_modules/nodebb-plugin-composer-default/library.js b/node_modules/nodebb-plugin-composer-default/library.js
new file mode 100644
index 0000000000..c80eef1f5e
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/library.js
@@ -0,0 +1,310 @@
+'use strict';
+
+const url = require('url');
+
+const nconf = require.main.require('nconf');
+const validator = require('validator');
+
+const plugins = require.main.require('./src/plugins');
+const topics = require.main.require('./src/topics');
+const categories = require.main.require('./src/categories');
+const posts = require.main.require('./src/posts');
+const user = require.main.require('./src/user');
+const meta = require.main.require('./src/meta');
+const privileges = require.main.require('./src/privileges');
+const translator = require.main.require('./src/translator');
+const utils = require.main.require('./src/utils');
+const helpers = require.main.require('./src/controllers/helpers');
+const SocketPlugins = require.main.require('./src/socket.io/plugins');
+const socketMethods = require('./websockets');
+
+const plugin = module.exports;
+
+plugin.socketMethods = socketMethods;
+
+plugin.init = async function (data) {
+ const { router } = data;
+ const routeHelpers = require.main.require('./src/routes/helpers');
+ const controllers = require('./controllers');
+ SocketPlugins.composer = socketMethods;
+ routeHelpers.setupAdminPageRoute(router, '/admin/plugins/composer-default', controllers.renderAdminPage);
+};
+
+plugin.appendConfig = async function (config) {
+ config['composer-default'] = await meta.settings.get('composer-default');
+ return config;
+};
+
+plugin.addAdminNavigation = async function (header) {
+ header.plugins.push({
+ route: '/plugins/composer-default',
+ icon: 'fa-edit',
+ name: 'Composer (Default)',
+ });
+ return header;
+};
+
+plugin.addPrefetchTags = async function (hookData) {
+ const prefetch = [
+ '/assets/src/modules/composer.js', '/assets/src/modules/composer/uploads.js', '/assets/src/modules/composer/drafts.js',
+ '/assets/src/modules/composer/tags.js', '/assets/src/modules/composer/categoryList.js', '/assets/src/modules/composer/resize.js',
+ '/assets/src/modules/composer/autocomplete.js', '/assets/templates/composer.tpl',
+ `/assets/language/${meta.config.defaultLang || 'en-GB'}/topic.json`,
+ `/assets/language/${meta.config.defaultLang || 'en-GB'}/modules.json`,
+ `/assets/language/${meta.config.defaultLang || 'en-GB'}/tags.json`,
+ ];
+
+ hookData.links = hookData.links.concat(prefetch.map(path => ({
+ rel: 'prefetch',
+ href: `${nconf.get('relative_path') + path}?${meta.config['cache-buster']}`,
+ })));
+
+ return hookData;
+};
+
+plugin.getFormattingOptions = async function () {
+ const defaultVisibility = {
+ mobile: true,
+ desktop: true,
+
+ // op or reply
+ main: true,
+ reply: true,
+ };
+ let payload = {
+ defaultVisibility,
+ options: [
+ {
+ name: 'tags',
+ title: '[[global:tags.tags]]',
+ className: 'fa fa-tags',
+ visibility: {
+ ...defaultVisibility,
+ desktop: false,
+ },
+ },
+ {
+ name: 'zen',
+ title: '[[modules:composer.zen-mode]]',
+ className: 'fa fa-arrows-alt',
+ visibility: defaultVisibility,
+ },
+ ],
+ };
+ if (parseInt(meta.config.allowTopicsThumbnail, 10) === 1) {
+ payload.options.push({
+ name: 'thumbs',
+ title: '[[topic:composer.thumb-title]]',
+ className: 'fa fa-address-card-o',
+ badge: true,
+ visibility: {
+ ...defaultVisibility,
+ reply: false,
+ },
+ });
+ }
+
+ payload = await plugins.hooks.fire('filter:composer.formatting', payload);
+
+ payload.options.forEach((option) => {
+ option.visibility = {
+ ...defaultVisibility,
+ ...option.visibility || {},
+ };
+ });
+
+ return payload ? payload.options : null;
+};
+
+plugin.filterComposerBuild = async function (hookData) {
+ const { req } = hookData;
+ const { res } = hookData;
+
+ if (req.query.p) {
+ try {
+ const a = url.parse(req.query.p, true, true);
+ return helpers.redirect(res, `/${(a.path || '').replace(/^\/*/, '')}`);
+ } catch (e) {
+ return helpers.redirect(res, '/');
+ }
+ } else if (!req.query.pid && !req.query.tid && !req.query.cid) {
+ return helpers.redirect(res, '/');
+ }
+ const [
+ isMainPost,
+ postData,
+ topicData,
+ categoryData,
+ isAdmin,
+ isMod,
+ formatting,
+ tagWhitelist,
+ globalPrivileges,
+ canTagTopics,
+ canScheduleTopics,
+ ] = await Promise.all([
+ posts.isMain(req.query.pid),
+ getPostData(req),
+ getTopicData(req),
+ categories.getCategoryFields(req.query.cid, [
+ 'name', 'icon', 'color', 'bgColor', 'backgroundImage', 'imageClass', 'minTags', 'maxTags',
+ ]),
+ user.isAdministrator(req.uid),
+ isModerator(req),
+ plugin.getFormattingOptions(),
+ getTagWhitelist(req.query, req.uid),
+ privileges.global.get(req.uid),
+ canTag(req),
+ canSchedule(req),
+ ]);
+
+ const isEditing = !!req.query.pid;
+ const isGuestPost = postData && parseInt(postData.uid, 10) === 0;
+ const save_id = utils.generateSaveId(req.uid);
+ const discardRoute = generateDiscardRoute(req, topicData);
+ const body = await generateBody(req, postData);
+
+ let action = 'topics.post';
+ let isMain = isMainPost;
+ if (req.query.tid) {
+ action = 'posts.reply';
+ } else if (req.query.pid) {
+ action = 'posts.edit';
+ } else {
+ isMain = true;
+ }
+ globalPrivileges['topics:tag'] = canTagTopics;
+ const cid = parseInt(req.query.cid, 10);
+ const topicTitle = topicData && topicData.title ? topicData.title.replace(/%/g, '%').replace(/,/g, ',') : validator.escape(String(req.query.title || ''));
+ return {
+ req: req,
+ res: res,
+ templateData: {
+ disabled: !req.query.pid && !req.query.tid && !req.query.cid,
+ pid: parseInt(req.query.pid, 10),
+ tid: parseInt(req.query.tid, 10),
+ cid: cid || (topicData ? topicData.cid : null),
+ action: action,
+ toPid: parseInt(req.query.toPid, 10),
+ discardRoute: discardRoute,
+
+ resizable: false,
+ allowTopicsThumbnail: parseInt(meta.config.allowTopicsThumbnail, 10) === 1 && isMain,
+
+ // can't use title property as that is used for page title
+ topicTitle: topicTitle,
+ titleLength: topicTitle ? topicTitle.length : 0,
+ topic: topicData,
+ thumb: topicData ? topicData.thumb : '',
+ body: body,
+
+ isMain: isMain,
+ isTopicOrMain: !!req.query.cid || isMain,
+ maximumTitleLength: meta.config.maximumTitleLength,
+ maximumPostLength: meta.config.maximumPostLength,
+ minimumTagLength: meta.config.minimumTagLength || 3,
+ maximumTagLength: meta.config.maximumTagLength || 15,
+ tagWhitelist: tagWhitelist,
+ selectedCategory: cid ? categoryData : null,
+ minTags: categoryData.minTags,
+ maxTags: categoryData.maxTags,
+
+ isTopic: !!req.query.cid,
+ isEditing: isEditing,
+ canSchedule: canScheduleTopics,
+ showHandleInput: meta.config.allowGuestHandles === 1 &&
+ (req.uid === 0 || (isEditing && isGuestPost && (isAdmin || isMod))),
+ handle: postData ? postData.handle || '' : undefined,
+ formatting: formatting,
+ isAdminOrMod: isAdmin || isMod,
+ save_id: save_id,
+ privileges: globalPrivileges,
+ 'composer:showHelpTab': meta.config['composer:showHelpTab'] === 1,
+ },
+ };
+};
+
+function generateDiscardRoute(req, topicData) {
+ if (req.query.cid) {
+ return `${nconf.get('relative_path')}/category/${validator.escape(String(req.query.cid))}`;
+ } else if ((req.query.tid || req.query.pid)) {
+ if (topicData) {
+ return `${nconf.get('relative_path')}/topic/${topicData.slug}`;
+ }
+ return `${nconf.get('relative_path')}/`;
+ }
+}
+
+async function generateBody(req, postData) {
+ let body = '';
+ // Quoted reply
+ if (req.query.toPid && parseInt(req.query.quoted, 10) === 1 && postData) {
+ const username = await user.getUserField(postData.uid, 'username');
+ const translated = await translator.translate(`[[modules:composer.user-said, ${username}]]`);
+ body = `${translated}\n` +
+ `> ${postData ? `${postData.content.replace(/\n/g, '\n> ')}\n\n` : ''}`;
+ } else if (req.query.body || req.query.content) {
+ body = validator.escape(String(req.query.body || req.query.content));
+ }
+ body = postData ? postData.content : '';
+ return translator.escape(body);
+}
+
+async function getPostData(req) {
+ if (!req.query.pid && !req.query.toPid) {
+ return null;
+ }
+
+ return await posts.getPostData(req.query.pid || req.query.toPid);
+}
+
+async function getTopicData(req) {
+ if (req.query.tid) {
+ return await topics.getTopicData(req.query.tid);
+ } else if (req.query.pid) {
+ return await topics.getTopicDataByPid(req.query.pid);
+ }
+ return null;
+}
+
+async function isModerator(req) {
+ if (!req.loggedIn) {
+ return false;
+ }
+ const cid = cidFromQuery(req.query);
+ return await user.isModerator(req.uid, cid);
+}
+
+async function canTag(req) {
+ if (parseInt(req.query.cid, 10)) {
+ return await privileges.categories.can('topics:tag', req.query.cid, req.uid);
+ }
+ return true;
+}
+
+async function canSchedule(req) {
+ if (parseInt(req.query.cid, 10)) {
+ return await privileges.categories.can('topics:schedule', req.query.cid, req.uid);
+ }
+ return false;
+}
+
+async function getTagWhitelist(query, uid) {
+ const cid = await cidFromQuery(query);
+ const [tagWhitelist, isAdminOrMod] = await Promise.all([
+ categories.getTagWhitelist([cid]),
+ privileges.categories.isAdminOrMod(cid, uid),
+ ]);
+ return categories.filterTagWhitelist(tagWhitelist[0], isAdminOrMod);
+}
+
+async function cidFromQuery(query) {
+ if (query.cid) {
+ return query.cid;
+ } else if (query.tid) {
+ return await topics.getTopicField(query.tid, 'cid');
+ } else if (query.pid) {
+ return await posts.getCidByPid(query.pid);
+ }
+ return null;
+}
diff --git a/node_modules/nodebb-plugin-composer-default/package.json b/node_modules/nodebb-plugin-composer-default/package.json
new file mode 100644
index 0000000000..625184980c
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/package.json
@@ -0,0 +1,43 @@
+{
+ "name": "nodebb-plugin-composer-default",
+ "version": "10.2.36",
+ "description": "Default composer for NodeBB",
+ "main": "library.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/NodeBB/nodebb-plugin-composer-default"
+ },
+ "scripts": {
+ "lint": "eslint ."
+ },
+ "keywords": [
+ "nodebb",
+ "plugin",
+ "composer",
+ "markdown"
+ ],
+ "author": {
+ "name": "NodeBB Team",
+ "email": "sales@nodebb.org"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/NodeBB/nodebb-plugin-composer-default/issues"
+ },
+ "readmeFilename": "README.md",
+ "nbbpm": {
+ "compatibility": "^3.0.0"
+ },
+ "dependencies": {
+ "@textcomplete/contenteditable": "^0.1.12",
+ "@textcomplete/core": "^0.1.12",
+ "@textcomplete/textarea": "^0.1.12",
+ "screenfull": "^5.0.2",
+ "validator": "^13.7.0"
+ },
+ "devDependencies": {
+ "eslint": "^7.32.0",
+ "eslint-config-nodebb": "^0.0.1",
+ "eslint-plugin-import": "^2.23.4"
+ }
+}
diff --git a/node_modules/nodebb-plugin-composer-default/plugin.json b/node_modules/nodebb-plugin-composer-default/plugin.json
new file mode 100644
index 0000000000..c75ef14259
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/plugin.json
@@ -0,0 +1,35 @@
+{
+ "id": "nodebb-plugin-composer-default",
+ "url": "https://github.com/NodeBB/nodebb-plugin-composer-default",
+ "library": "library.js",
+ "hooks": [
+ { "hook": "static:app.load", "method": "init" },
+ { "hook": "filter:config.get", "method": "appendConfig" },
+ { "hook": "filter:composer.build", "method": "filterComposerBuild" },
+ { "hook": "filter:admin.header.build", "method": "addAdminNavigation" },
+ { "hook": "filter:meta.getLinkTags", "method": "addPrefetchTags" }
+ ],
+ "scss": [
+ "./static/scss/composer.scss"
+ ],
+ "scripts": [
+ "./static/lib/client.js",
+ "./node_modules/screenfull/dist/screenfull.js"
+ ],
+ "modules": {
+ "composer.js": "./static/lib/composer.js",
+ "composer/categoryList.js": "./static/lib/composer/categoryList.js",
+ "composer/controls.js": "./static/lib/composer/controls.js",
+ "composer/drafts.js": "./static/lib/composer/drafts.js",
+ "composer/formatting.js": "./static/lib/composer/formatting.js",
+ "composer/preview.js": "./static/lib/composer/preview.js",
+ "composer/resize.js": "./static/lib/composer/resize.js",
+ "composer/scheduler.js": "./static/lib/composer/scheduler.js",
+ "composer/tags.js": "./static/lib/composer/tags.js",
+ "composer/uploads.js": "./static/lib/composer/uploads.js",
+ "composer/autocomplete.js": "./static/lib/composer/autocomplete.js",
+ "composer/post-queue.js": "./static/lib/composer/post-queue.js",
+ "../admin/plugins/composer-default.js": "./static/lib/admin.js"
+ },
+ "templates": "static/templates"
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/screenshots/desktop.png b/node_modules/nodebb-plugin-composer-default/screenshots/desktop.png
new file mode 100644
index 0000000000..a6d4631e4e
Binary files /dev/null and b/node_modules/nodebb-plugin-composer-default/screenshots/desktop.png differ
diff --git a/node_modules/nodebb-plugin-composer-default/screenshots/mobile.png b/node_modules/nodebb-plugin-composer-default/screenshots/mobile.png
new file mode 100644
index 0000000000..a50a01ea93
Binary files /dev/null and b/node_modules/nodebb-plugin-composer-default/screenshots/mobile.png differ
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/.eslintrc b/node_modules/nodebb-plugin-composer-default/static/lib/.eslintrc
new file mode 100644
index 0000000000..9fc9d47e53
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/.eslintrc
@@ -0,0 +1,6 @@
+{
+ "extends": "nodebb/public",
+ "rules": {
+ "no-cond-assign": ["error", "except-parens"]
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/admin.js b/node_modules/nodebb-plugin-composer-default/static/lib/admin.js
new file mode 100644
index 0000000000..cc693300ea
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/admin.js
@@ -0,0 +1,15 @@
+'use strict';
+
+define('admin/plugins/composer-default', ['settings'], function (Settings) {
+ const ACP = {};
+
+ ACP.init = function () {
+ Settings.load('composer-default', $('.composer-default-settings'));
+
+ $('#save').on('click', function () {
+ Settings.save('composer-default', $('.composer-default-settings'));
+ });
+ };
+
+ return ACP;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/client.js b/node_modules/nodebb-plugin-composer-default/static/lib/client.js
new file mode 100644
index 0000000000..2b46e406b8
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/client.js
@@ -0,0 +1,89 @@
+'use strict';
+
+$(document).ready(function () {
+ $(window).on('action:app.load', function () {
+ require(['composer/drafts'], function (drafts) {
+ drafts.migrateGuest();
+ drafts.loadOpen();
+ });
+ });
+
+ $(window).on('action:composer.topic.new', function (ev, data) {
+ if (config['composer-default'].composeRouteEnabled !== 'on') {
+ require(['composer'], function (composer) {
+ composer.newTopic({
+ cid: data.cid,
+ title: data.title || '',
+ body: data.body || '',
+ tags: data.tags || [],
+ });
+ });
+ } else {
+ ajaxify.go(
+ 'compose?cid=' + data.cid +
+ (data.title ? '&title=' + encodeURIComponent(data.title) : '') +
+ (data.body ? '&body=' + encodeURIComponent(data.body) : '')
+ );
+ }
+ });
+
+ $(window).on('action:composer.post.edit', function (ev, data) {
+ if (config['composer-default'].composeRouteEnabled !== 'on') {
+ require(['composer'], function (composer) {
+ composer.editPost({ pid: data.pid });
+ });
+ } else {
+ ajaxify.go('compose?pid=' + data.pid);
+ }
+ });
+
+ $(window).on('action:composer.post.new', function (ev, data) {
+ // backwards compatibility
+ data.body = data.body || data.text;
+ data.title = data.title || data.topicName;
+ if (config['composer-default'].composeRouteEnabled !== 'on') {
+ require(['composer'], function (composer) {
+ composer.newReply({
+ tid: data.tid,
+ toPid: data.pid,
+ title: data.title,
+ body: data.body,
+ });
+ });
+ } else {
+ ajaxify.go(
+ 'compose?tid=' + data.tid +
+ (data.pid ? '&toPid=' + data.pid : '') +
+ (data.title ? '&title=' + encodeURIComponent(data.title) : '') +
+ (data.body ? '&body=' + encodeURIComponent(data.body) : '')
+ );
+ }
+ });
+
+ $(window).on('action:composer.addQuote', function (ev, data) {
+ data.body = data.body || data.text;
+ data.title = data.title || data.topicName;
+ if (config['composer-default'].composeRouteEnabled !== 'on') {
+ require(['composer'], function (composer) {
+ var topicUUID = composer.findByTid(data.tid);
+ composer.addQuote({
+ tid: data.tid,
+ toPid: data.pid,
+ selectedPid: data.selectedPid,
+ title: data.title,
+ username: data.username,
+ body: data.body,
+ uuid: topicUUID,
+ });
+ });
+ } else {
+ ajaxify.go('compose?tid=' + data.tid + '&toPid=' + data.pid + '"ed=1&username=' + data.username);
+ }
+ });
+
+ $(window).on('action:composer.enhance', function (ev, data) {
+ require(['composer'], function (composer) {
+ composer.enhance(data.container);
+ });
+ });
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer.js
new file mode 100644
index 0000000000..1965622926
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer.js
@@ -0,0 +1,919 @@
+'use strict';
+
+define('composer', [
+ 'taskbar',
+ 'translator',
+ 'composer/uploads',
+ 'composer/formatting',
+ 'composer/drafts',
+ 'composer/tags',
+ 'composer/categoryList',
+ 'composer/preview',
+ 'composer/resize',
+ 'composer/autocomplete',
+ 'composer/scheduler',
+ 'composer/post-queue',
+ 'scrollStop',
+ 'topicThumbs',
+ 'api',
+ 'bootbox',
+ 'alerts',
+ 'hooks',
+ 'messages',
+ 'search',
+ 'screenfull',
+], function (taskbar, translator, uploads, formatting, drafts, tags,
+ categoryList, preview, resize, autocomplete, scheduler, postQueue, scrollStop,
+ topicThumbs, api, bootbox, alerts, hooks, messagesModule, search, screenfull) {
+ var composer = {
+ active: undefined,
+ posts: {},
+ bsEnvironment: undefined,
+ formatting: undefined,
+ };
+
+ var isAnonymous = false;
+
+ $(window).off('resize', onWindowResize).on('resize', onWindowResize);
+ onWindowResize();
+
+ $(window).on('action:composer.topics.post', function (ev, data) {
+ localStorage.removeItem('category:' + data.data.cid + ':bookmark');
+ localStorage.removeItem('category:' + data.data.cid + ':bookmark:clicked');
+ });
+
+ $(window).on('popstate', function () {
+ var env = utils.findBootstrapEnvironment();
+ if (composer.active && (env === 'xs' || env === 'sm')) {
+ if (!composer.posts[composer.active].modified) {
+ composer.discard(composer.active);
+ if (composer.discardConfirm && composer.discardConfirm.length) {
+ composer.discardConfirm.modal('hide');
+ delete composer.discardConfirm;
+ }
+ return;
+ }
+
+ translator.translate('[[modules:composer.discard]]', function (translated) {
+ composer.discardConfirm = bootbox.confirm(translated, function (confirm) {
+ if (confirm) {
+ composer.discard(composer.active);
+ } else {
+ composer.posts[composer.active].modified = true;
+ }
+ });
+ composer.posts[composer.active].modified = false;
+ });
+ }
+ });
+
+ function removeComposerHistory() {
+ var env = composer.bsEnvironment;
+ if (ajaxify.data.template.compose === true || env === 'xs' || env === 'sm') {
+ history.back();
+ }
+ }
+
+ function onWindowResize() {
+ var env = utils.findBootstrapEnvironment();
+ var isMobile = env === 'xs' || env === 'sm';
+
+ if (preview.toggle) {
+ if (preview.env !== env && isMobile) {
+ preview.env = env;
+ preview.toggle(false);
+ }
+ preview.env = env;
+ }
+
+ if (composer.active !== undefined) {
+ resize.reposition($('.composer[data-uuid="' + composer.active + '"]'));
+
+ if (!isMobile && window.location.pathname.startsWith(config.relative_path + '/compose')) {
+ /*
+ * If this conditional is met, we're no longer in mobile/tablet
+ * resolution but we've somehow managed to have a mobile
+ * composer load, so let's go back to the topic
+ */
+ history.back();
+ } else if (isMobile && !window.location.pathname.startsWith(config.relative_path + '/compose')) {
+ /*
+ * In this case, we're in mobile/tablet resolution but the composer
+ * that loaded was a regular composer, so let's fix the address bar
+ */
+ mobileHistoryAppend();
+ }
+ }
+ composer.bsEnvironment = env;
+ }
+
+ function alreadyOpen(post) {
+ // If a composer for the same cid/tid/pid is already open, return the uuid, else return bool false
+ var type;
+ var id;
+
+ if (post.hasOwnProperty('cid')) {
+ type = 'cid';
+ } else if (post.hasOwnProperty('tid')) {
+ type = 'tid';
+ } else if (post.hasOwnProperty('pid')) {
+ type = 'pid';
+ }
+
+ id = post[type];
+
+ // Find a match
+ for (var uuid in composer.posts) {
+ if (composer.posts[uuid].hasOwnProperty(type) && id === composer.posts[uuid][type]) {
+ return uuid;
+ }
+ }
+
+ // No matches...
+ return false;
+ }
+
+ function push(post) {
+ if (!post) {
+ return;
+ }
+
+ var uuid = utils.generateUUID();
+ var existingUUID = alreadyOpen(post);
+
+ if (existingUUID) {
+ taskbar.updateActive(existingUUID);
+ return composer.load(existingUUID);
+ }
+
+ var actionText = '[[topic:composer.new-topic]]';
+ if (post.action === 'posts.reply') {
+ actionText = '[[topic:composer.replying-to]]';
+ } else if (post.action === 'posts.edit') {
+ actionText = '[[topic:composer.editing-in]]';
+ }
+
+ translator.translate(actionText, function (translatedAction) {
+ taskbar.push('composer', uuid, {
+ title: translatedAction.replace('%1', '"' + post.title + '"'),
+ });
+ });
+
+ composer.posts[uuid] = post;
+ composer.load(uuid);
+ }
+
+ async function composerAlert(post_uuid, message) {
+ $('.composer[data-uuid="' + post_uuid + '"]').find('.composer-submit').removeAttr('disabled');
+
+ const { showAlert } = await hooks.fire('filter:composer.error', { post_uuid, message, showAlert: true });
+
+ if (showAlert) {
+ alerts.alert({
+ type: 'danger',
+ timeout: 10000,
+ title: '',
+ message: message,
+ alert_id: 'post_error',
+ });
+ }
+ }
+
+ composer.findByTid = function (tid) {
+ // Iterates through the initialised composers and returns the uuid of the matching composer
+ for (var uuid in composer.posts) {
+ if (composer.posts.hasOwnProperty(uuid) && composer.posts[uuid].hasOwnProperty('tid') && parseInt(composer.posts[uuid].tid, 10) === parseInt(tid, 10)) {
+ return uuid;
+ }
+ }
+
+ return null;
+ };
+
+ composer.addButton = function (iconClass, onClick, title) {
+ formatting.addButton(iconClass, onClick, title);
+ };
+
+ composer.newTopic = async (data) => {
+ let pushData = {
+ save_id: data.save_id,
+ action: 'topics.post',
+ cid: data.cid,
+ handle: data.handle,
+ title: data.title || '',
+ body: data.body || '',
+ tags: data.tags || [],
+ modified: !!((data.title && data.title.length) || (data.body && data.body.length)),
+ isMain: true,
+ };
+
+ ({ pushData } = await hooks.fire('filter:composer.topic.push', {
+ data: data,
+ pushData: pushData,
+ }));
+
+ push(pushData);
+ };
+
+ composer.addQuote = function (data) {
+ // tid, toPid, selectedPid, title, username, text, uuid
+ data.uuid = data.uuid || composer.active;
+
+ var escapedTitle = (data.title || '')
+ .replace(/([\\`*_{}[\]()#+\-.!])/g, '\\$1')
+ .replace(/\[/g, '[')
+ .replace(/\]/g, ']')
+ .replace(/%/g, '%')
+ .replace(/,/g, ',');
+
+ if (data.body) {
+ data.body = '> ' + data.body.replace(/\n/g, '\n> ') + '\n\n';
+ }
+ var link = '[' + escapedTitle + '](' + config.relative_path + '/post/' + encodeURIComponent(data.selectedPid || data.toPid) + ')';
+ if (data.uuid === undefined) {
+ if (data.title && (data.selectedPid || data.toPid)) {
+ composer.newReply({
+ tid: data.tid,
+ toPid: data.toPid,
+ title: data.title,
+ body: '[[modules:composer.user-said-in, ' + data.username + ', ' + link + ']]\n' + data.body,
+ });
+ } else {
+ composer.newReply({
+ tid: data.tid,
+ toPid: data.toPid,
+ title: data.title,
+ body: '[[modules:composer.user-said, ' + data.username + ']]\n' + data.body,
+ });
+ }
+ return;
+ } else if (data.uuid !== composer.active) {
+ // If the composer is not currently active, activate it
+ composer.load(data.uuid);
+ }
+
+ var postContainer = $('.composer[data-uuid="' + data.uuid + '"]');
+ var bodyEl = postContainer.find('textarea');
+ var prevText = bodyEl.val();
+ if (data.title && (data.selectedPid || data.toPid)) {
+ translator.translate('[[modules:composer.user-said-in, ' + data.username + ', ' + link + ']]\n', config.defaultLang, onTranslated);
+ } else {
+ translator.translate('[[modules:composer.user-said, ' + data.username + ']]\n', config.defaultLang, onTranslated);
+ }
+
+ function onTranslated(translated) {
+ composer.posts[data.uuid].body = (prevText.length ? prevText + '\n\n' : '') + translated + data.body;
+ bodyEl.val(composer.posts[data.uuid].body);
+ focusElements(postContainer);
+ preview.render(postContainer);
+ }
+ };
+
+ composer.newReply = function (data) {
+ translator.translate(data.body, config.defaultLang, function (translated) {
+ push({
+ save_id: data.save_id,
+ action: 'posts.reply',
+ tid: data.tid,
+ toPid: data.toPid,
+ title: data.title,
+ body: translated,
+ modified: !!(translated && translated.length),
+ isMain: false,
+ });
+ });
+ };
+
+ composer.editPost = function (data) {
+ // pid, text
+ socket.emit('plugins.composer.push', data.pid, function (err, postData) {
+ if (err) {
+ return alerts.error(err);
+ }
+ postData.save_id = data.save_id;
+ postData.action = 'posts.edit';
+ postData.pid = data.pid;
+ postData.modified = false;
+ if (data.body) {
+ postData.body = data.body;
+ postData.modified = true;
+ }
+ if (data.title) {
+ postData.title = data.title;
+ postData.modified = true;
+ }
+ push(postData);
+ });
+ };
+
+ composer.load = function (post_uuid) {
+ var postContainer = $('.composer[data-uuid="' + post_uuid + '"]');
+ if (postContainer.length) {
+ activate(post_uuid);
+ resize.reposition(postContainer);
+ focusElements(postContainer);
+ onShow();
+ } else if (composer.formatting) {
+ createNewComposer(post_uuid);
+ } else {
+ socket.emit('plugins.composer.getFormattingOptions', function (err, options) {
+ if (err) {
+ return alerts.error(err);
+ }
+ composer.formatting = options;
+ createNewComposer(post_uuid);
+ });
+ }
+ };
+
+ composer.enhance = function (postContainer, post_uuid, postData) {
+ /*
+ This method enhances a composer container with client-side sugar (preview, etc)
+ Everything in here also applies to the /compose route
+ */
+
+ if (!post_uuid && !postData) {
+ post_uuid = utils.generateUUID();
+ composer.posts[post_uuid] = ajaxify.data;
+ postData = ajaxify.data;
+ postContainer.attr('data-uuid', post_uuid);
+ }
+
+ categoryList.init(postContainer, composer.posts[post_uuid]);
+ scheduler.init(postContainer, composer.posts);
+
+ formatting.addHandler(postContainer);
+ formatting.addComposerButtons();
+ preview.handleToggler(postContainer);
+ postQueue.showAlert(postContainer, postData);
+ uploads.initialize(post_uuid);
+ tags.init(postContainer, composer.posts[post_uuid]);
+ autocomplete.init(postContainer, post_uuid);
+
+ postContainer.on('change', 'input, textarea', function () {
+ composer.posts[post_uuid].modified = true;
+ });
+
+ postContainer.on('click', '.composer-submit', function (e) {
+ e.preventDefault();
+ e.stopPropagation(); // Other click events bring composer back to active state which is undesired on submit
+
+ $(this).attr('disabled', true);
+ post(post_uuid);
+ });
+
+ // event listener for the anonymous checkbox
+ // Added after adding the front end check box for anonymous posting
+ postContainer.on('change', '#anonymous-checkbox', function () {
+ isAnonymous = $(this).is(':checked');
+ });
+
+ require(['mousetrap'], function (mousetrap) {
+ mousetrap(postContainer.get(0)).bind('mod+enter', function () {
+ postContainer.find('.composer-submit').attr('disabled', true);
+ post(post_uuid);
+ });
+ });
+
+ postContainer.find('.composer-discard').on('click', function (e) {
+ e.preventDefault();
+
+ if (!composer.posts[post_uuid].modified) {
+ composer.discard(post_uuid);
+ return removeComposerHistory();
+ }
+
+ formatting.exitFullscreen();
+
+ var btn = $(this).prop('disabled', true);
+ translator.translate('[[modules:composer.discard]]', function (translated) {
+ bootbox.confirm(translated, function (confirm) {
+ if (confirm) {
+ composer.discard(post_uuid);
+ removeComposerHistory();
+ }
+ btn.prop('disabled', false);
+ });
+ });
+ });
+
+
+ postContainer.on('click', '.suggested-response', function () {
+ var responseText = $(this).data('response');
+
+ // Find the composer textarea within the current composer instance
+ var textarea = postContainer.find('textarea.write');
+ var currentText = textarea.val();
+
+ // Insert or append the response text
+ if (!currentText.trim()) {
+ textarea.val(responseText);
+ } else {
+ textarea.val(currentText + '\n' + responseText);
+ }
+
+ // Move cursor to the end
+ textarea[0].selectionStart = textarea[0].selectionEnd = textarea.val().length;
+
+ // Trigger input event to update previews or autosave features
+ textarea.trigger('input');
+ });
+
+ postContainer.find('.composer-minimize, .minimize .trigger').on('click', function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ composer.minimize(post_uuid);
+ });
+
+ const textareaEl = postContainer.find('textarea');
+ textareaEl.on('input propertychange', utils.debounce(function () {
+ preview.render(postContainer);
+ }, 250));
+
+ textareaEl.on('scroll', function () {
+ preview.matchScroll(postContainer);
+ });
+
+ drafts.init(postContainer, postData);
+ const draft = drafts.get(postData.save_id);
+
+ preview.render(postContainer, function () {
+ preview.matchScroll(postContainer);
+ });
+
+ handleHelp(postContainer);
+ handleSearch(postContainer);
+ focusElements(postContainer);
+ if (postData.action === 'posts.edit') {
+ composer.updateThumbCount(post_uuid, postContainer);
+ }
+
+ // Hide "zen mode" if fullscreen API is not enabled/available (ahem, iOS...)
+ if (!screenfull.isEnabled) {
+ $('[data-format="zen"]').parent().addClass('hidden');
+ }
+
+ hooks.fire('action:composer.enhanced', { postContainer, postData, draft });
+ };
+
+ async function getSelectedCategory(postData) {
+ if (ajaxify.data.template.category && parseInt(postData.cid, 10) === parseInt(ajaxify.data.cid, 10)) {
+ // no need to load data if we are already on the category page
+ return ajaxify.data;
+ } else if (parseInt(postData.cid, 10)) {
+ return await api.get(`/api/category/${postData.cid}`, {});
+ }
+ return null;
+ }
+
+ async function createNewComposer(post_uuid) {
+ var postData = composer.posts[post_uuid];
+
+ var isTopic = postData ? postData.hasOwnProperty('cid') : false;
+ var isMain = postData ? !!postData.isMain : false;
+ var isEditing = postData ? !!postData.pid : false;
+ var isGuestPost = postData ? parseInt(postData.uid, 10) === 0 : false;
+ const isScheduled = postData.timestamp > Date.now();
+
+ // see
+ // https://github.com/NodeBB/NodeBB/issues/2994 and
+ // https://github.com/NodeBB/NodeBB/issues/1951
+ // remove when 1951 is resolved
+
+ var title = postData.title.replace(/%/g, '%').replace(/,/g, ',');
+ postData.category = await getSelectedCategory(postData);
+ const privileges = postData.category ? postData.category.privileges : ajaxify.data.privileges;
+ var data = {
+ topicTitle: title,
+ titleLength: title.length,
+ body: translator.escape(utils.escapeHTML(postData.body)),
+ mobile: composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm',
+ resizable: true,
+ thumb: postData.thumb,
+ isTopicOrMain: isTopic || isMain,
+ maximumTitleLength: config.maximumTitleLength,
+ maximumPostLength: config.maximumPostLength,
+ minimumTagLength: config.minimumTagLength,
+ maximumTagLength: config.maximumTagLength,
+ 'composer:showHelpTab': config['composer:showHelpTab'],
+ isTopic: isTopic,
+ isEditing: isEditing,
+ canSchedule: !!(isMain && privileges &&
+ ((privileges['topics:schedule'] && !isEditing) || (isScheduled && privileges.view_scheduled))),
+ showHandleInput: config.allowGuestHandles &&
+ (app.user.uid === 0 || (isEditing && isGuestPost && app.user.isAdmin)),
+ handle: postData ? postData.handle || '' : undefined,
+ formatting: composer.formatting,
+ tagWhitelist: postData.category ? postData.category.tagWhitelist : ajaxify.data.tagWhitelist,
+ privileges: app.user.privileges,
+ selectedCategory: postData.category,
+ submitOptions: [
+ // Add items using `filter:composer.create`, or just add them to the
in DOM
+ // {
+ // action: 'foobar',
+ // text: 'Text Label',
+ // }
+ ],
+ };
+
+ if (data.mobile) {
+ mobileHistoryAppend();
+
+ app.toggleNavbar(false);
+ }
+
+ postData.mobile = composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm';
+
+ ({ postData, createData: data } = await hooks.fire('filter:composer.create', {
+ postData: postData,
+ createData: data,
+ }));
+
+ app.parseAndTranslate('composer', data, function (composerTemplate) {
+ if ($('.composer.composer[data-uuid="' + post_uuid + '"]').length) {
+ return;
+ }
+ composerTemplate = $(composerTemplate);
+
+ composerTemplate.find('.title').each(function () {
+ $(this).text(translator.unescape($(this).text()));
+ });
+
+ composerTemplate.attr('data-uuid', post_uuid);
+
+ $(document.body).append(composerTemplate);
+
+ var postContainer = $(composerTemplate[0]);
+
+ resize.reposition(postContainer);
+ composer.enhance(postContainer, post_uuid, postData);
+ /*
+ Everything after this line is applied to the resizable composer only
+ Want something done to both resizable composer and the one in /compose?
+ Put it in composer.enhance().
+
+ Eventually, stuff after this line should be moved into composer.enhance().
+ */
+
+ activate(post_uuid);
+
+ postContainer.on('click', function () {
+ if (!taskbar.isActive(post_uuid)) {
+ taskbar.updateActive(post_uuid);
+ }
+ });
+
+ resize.handleResize(postContainer);
+
+ if (composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm') {
+ var submitBtns = postContainer.find('.composer-submit');
+ var mobileSubmitBtn = postContainer.find('.mobile-navbar .composer-submit');
+ var textareaEl = postContainer.find('.write');
+ var idx = textareaEl.attr('tabindex');
+
+ submitBtns.removeAttr('tabindex');
+ mobileSubmitBtn.attr('tabindex', parseInt(idx, 10) + 1);
+ }
+
+ $(window).trigger('action:composer.loaded', {
+ postContainer: postContainer,
+ post_uuid: post_uuid,
+ composerData: composer.posts[post_uuid],
+ formatting: composer.formatting,
+ });
+
+ scrollStop.apply(postContainer.find('.write'));
+ focusElements(postContainer);
+ onShow();
+ });
+ }
+
+ function mobileHistoryAppend() {
+ var path = 'compose?p=' + window.location.pathname;
+ var returnPath = window.location.pathname.slice(1) + window.location.search;
+
+ // Remove relative path from returnPath
+ if (returnPath.startsWith(config.relative_path.slice(1))) {
+ returnPath = returnPath.slice(config.relative_path.length);
+ }
+
+ // Add in return path to be caught by ajaxify when post is completed, or if back is pressed
+ window.history.replaceState({
+ url: null,
+ returnPath: returnPath,
+ }, returnPath, config.relative_path + '/' + returnPath);
+
+ // Update address bar in case f5 is pressed
+ window.history.pushState({
+ url: path,
+ }, path, `${config.relative_path}/${returnPath}`);
+ }
+
+ function handleHelp(postContainer) {
+ const helpBtn = postContainer.find('[data-action="help"]');
+ helpBtn.on('click', async function () {
+ const html = await socket.emit('plugins.composer.renderHelp');
+ if (html && html.length > 0) {
+ bootbox.dialog({
+ size: 'large',
+ message: html,
+ onEscape: true,
+ backdrop: true,
+ onHidden: function () {
+ helpBtn.focus();
+ },
+ });
+ }
+ });
+ }
+
+ function handleSearch(postContainer) {
+ var uuid = postContainer.attr('data-uuid');
+ var isEditing = composer.posts[uuid] && composer.posts[uuid].action === 'posts.edit';
+ var env = utils.findBootstrapEnvironment();
+ var isMobile = env === 'xs' || env === 'sm';
+ if (isEditing || isMobile) {
+ return;
+ }
+
+ search.enableQuickSearch({
+ searchElements: {
+ inputEl: postContainer.find('input.title'),
+ resultEl: postContainer.find('.quick-search-container'),
+ },
+ searchOptions: {
+ composer: 1,
+ },
+ hideOnNoMatches: true,
+ hideDuringSearch: true,
+ });
+ }
+
+ function activate(post_uuid) {
+ if (composer.active && composer.active !== post_uuid) {
+ composer.minimize(composer.active);
+ }
+
+ composer.active = post_uuid;
+ const postContainer = $('.composer[data-uuid="' + post_uuid + '"]');
+ postContainer.css('visibility', 'visible');
+ $(window).trigger('action:composer.activate', {
+ post_uuid: post_uuid,
+ postContainer: postContainer,
+ });
+ }
+
+ function focusElements(postContainer) {
+ setTimeout(function () {
+ var title = postContainer.find('input.title');
+
+ if (title.length) {
+ title.focus();
+ } else {
+ postContainer.find('textarea').focus().putCursorAtEnd();
+ }
+ }, 20);
+ }
+
+ async function post(post_uuid) {
+ var postData = composer.posts[post_uuid];
+ var postContainer = $('.composer[data-uuid="' + post_uuid + '"]');
+ var handleEl = postContainer.find('.handle');
+ var titleEl = postContainer.find('.title');
+ var bodyEl = postContainer.find('textarea');
+ var thumbEl = postContainer.find('input#topic-thumb-url');
+ var onComposeRoute = postData.hasOwnProperty('template') && postData.template.compose === true;
+ const submitBtn = postContainer.find('.composer-submit');
+
+ titleEl.val(titleEl.val().trim());
+ bodyEl.val(utils.rtrim(bodyEl.val()));
+ if (thumbEl.length) {
+ thumbEl.val(thumbEl.val().trim());
+ }
+
+ var action = postData.action;
+
+ var checkTitle = (postData.hasOwnProperty('cid') || parseInt(postData.pid, 10)) && postContainer.find('input.title').length;
+ var isCategorySelected = !checkTitle || (checkTitle && parseInt(postData.cid, 10));
+
+ // Specifically for checking title/body length via plugins
+ var payload = {
+ post_uuid: post_uuid,
+ postData: postData,
+ postContainer: postContainer,
+ titleEl: titleEl,
+ titleLen: titleEl.val().length,
+ bodyEl: bodyEl,
+ bodyLen: bodyEl.val().length,
+ };
+
+ await hooks.fire('filter:composer.check', payload);
+ $(window).trigger('action:composer.check', payload);
+
+ if (payload.error) {
+ return composerAlert(post_uuid, payload.error);
+ }
+
+ if (uploads.inProgress[post_uuid] && uploads.inProgress[post_uuid].length) {
+ return composerAlert(post_uuid, '[[error:still-uploading]]');
+ } else if (checkTitle && payload.titleLen < parseInt(config.minimumTitleLength, 10)) {
+ return composerAlert(post_uuid, '[[error:title-too-short, ' + config.minimumTitleLength + ']]');
+ } else if (checkTitle && payload.titleLen > parseInt(config.maximumTitleLength, 10)) {
+ return composerAlert(post_uuid, '[[error:title-too-long, ' + config.maximumTitleLength + ']]');
+ } else if (action === 'topics.post' && !isCategorySelected) {
+ return composerAlert(post_uuid, '[[error:category-not-selected]]');
+ } else if (payload.bodyLen < parseInt(config.minimumPostLength, 10)) {
+ return composerAlert(post_uuid, '[[error:content-too-short, ' + config.minimumPostLength + ']]');
+ } else if (payload.bodyLen > parseInt(config.maximumPostLength, 10)) {
+ return composerAlert(post_uuid, '[[error:content-too-long, ' + config.maximumPostLength + ']]');
+ } else if (checkTitle && !tags.isEnoughTags(post_uuid)) {
+ return composerAlert(post_uuid, '[[error:not-enough-tags, ' + tags.minTagCount() + ']]');
+ } else if (scheduler.isActive() && scheduler.getTimestamp() <= Date.now()) {
+ return composerAlert(post_uuid, '[[error:scheduling-to-past]]');
+ }
+
+ let composerData = {
+ uuid: post_uuid,
+ };
+ let method = 'post';
+ let route = '';
+
+ if (action === 'topics.post') {
+ route = '/topics';
+ composerData = {
+ ...composerData,
+ handle: handleEl ? handleEl.val() : undefined,
+ title: titleEl.val(),
+ content: bodyEl.val(),
+ thumb: thumbEl.val() || '',
+ cid: categoryList.getSelectedCid(),
+ tags: tags.getTags(post_uuid),
+ timestamp: scheduler.getTimestamp(),
+ isAnonymous: isAnonymous,
+ };
+ } else if (action === 'posts.reply') {
+ route = `/topics/${postData.tid}`;
+ composerData = {
+ ...composerData,
+ tid: postData.tid,
+ handle: handleEl ? handleEl.val() : undefined,
+ content: bodyEl.val(),
+ toPid: postData.toPid,
+ isAnonymous: isAnonymous,
+ };
+ } else if (action === 'posts.edit') {
+ method = 'put';
+ route = `/posts/${postData.pid}`;
+ composerData = {
+ ...composerData,
+ pid: postData.pid,
+ handle: handleEl ? handleEl.val() : undefined,
+ content: bodyEl.val(),
+ title: titleEl.val(),
+ thumb: thumbEl.val() || '',
+ tags: tags.getTags(post_uuid),
+ timestamp: scheduler.getTimestamp(),
+ isAnonymous: isAnonymous,
+ };
+ }
+ var submitHookData = {
+ composerEl: postContainer,
+ action: action,
+ composerData: composerData,
+ postData: postData,
+ redirect: true,
+ };
+
+ await hooks.fire('filter:composer.submit', submitHookData);
+ hooks.fire('action:composer.submit', Object.freeze(submitHookData));
+
+ // Minimize composer (and set textarea as readonly) while submitting
+ var taskbarIconEl = $('#taskbar .composer[data-uuid="' + post_uuid + '"] i');
+ var textareaEl = postContainer.find('.write');
+ taskbarIconEl.removeClass('fa-plus').addClass('fa-circle-o-notch fa-spin');
+ composer.minimize(post_uuid);
+ textareaEl.prop('readonly', true);
+
+ api[method](route, composerData)
+ .then((data) => {
+ submitBtn.removeAttr('disabled');
+ postData.submitted = true;
+
+ composer.discard(post_uuid);
+ drafts.removeDraft(postData.save_id);
+
+ if (data.queued) {
+ alerts.alert({
+ type: 'success',
+ title: '[[global:alert.success]]',
+ message: data.message,
+ timeout: 10000,
+ clickfn: function () {
+ ajaxify.go(`/post-queue/${data.id}`);
+ },
+ });
+ } else if (action === 'topics.post') {
+ if (submitHookData.redirect) {
+ ajaxify.go('topic/' + data.slug, undefined, (onComposeRoute || composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm'));
+ }
+ } else if (action === 'posts.reply') {
+ if (onComposeRoute || composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm') {
+ window.history.back();
+ } else if (submitHookData.redirect &&
+ ((ajaxify.data.template.name !== 'topic') ||
+ (ajaxify.data.template.topic && parseInt(postData.tid, 10) !== parseInt(ajaxify.data.tid, 10)))
+ ) {
+ ajaxify.go('post/' + data.pid);
+ }
+ } else {
+ removeComposerHistory();
+ }
+
+ hooks.fire('action:composer.' + action, { composerData: composerData, data: data });
+ })
+ .catch((err) => {
+ // Restore composer on error
+ composer.load(post_uuid);
+ textareaEl.prop('readonly', false);
+ if (err.message === '[[error:email-not-confirmed]]') {
+ return messagesModule.showEmailConfirmWarning(err.message);
+ }
+ composerAlert(post_uuid, err.message);
+ });
+ }
+
+ function onShow() {
+ $('html').addClass('composing');
+ }
+
+ function onHide() {
+ $('#content').css({ paddingBottom: 0 });
+ $('html').removeClass('composing');
+ app.toggleNavbar(true);
+ formatting.exitFullscreen();
+ }
+
+ composer.discard = function (post_uuid) {
+ if (composer.posts[post_uuid]) {
+ var postData = composer.posts[post_uuid];
+ var postContainer = $('.composer[data-uuid="' + post_uuid + '"]');
+ postContainer.remove();
+ drafts.removeDraft(postData.save_id);
+ topicThumbs.deleteAll(post_uuid);
+
+ taskbar.discard('composer', post_uuid);
+ $('[data-action="post"]').removeAttr('disabled');
+
+ hooks.fire('action:composer.discard', {
+ post_uuid: post_uuid,
+ postData: postData,
+ });
+ delete composer.posts[post_uuid];
+ composer.active = undefined;
+ }
+ scheduler.reset();
+ onHide();
+ };
+
+ // Alias to .discard();
+ composer.close = composer.discard;
+
+ composer.minimize = function (post_uuid) {
+ var postContainer = $('.composer[data-uuid="' + post_uuid + '"]');
+ postContainer.css('visibility', 'hidden');
+ composer.active = undefined;
+ taskbar.minimize('composer', post_uuid);
+ $(window).trigger('action:composer.minimize', {
+ post_uuid: post_uuid,
+ });
+
+ onHide();
+ };
+
+ composer.minimizeActive = function () {
+ if (composer.active) {
+ composer.miminize(composer.active);
+ }
+ };
+
+ composer.updateThumbCount = function (uuid, postContainer) {
+ const composerObj = composer.posts[uuid];
+ if (composerObj.action === 'topics.post' || (composerObj.action === 'posts.edit' && composerObj.isMain)) {
+ const calls = [
+ topicThumbs.get(uuid),
+ ];
+ if (composerObj.pid) {
+ calls.push(topicThumbs.getByPid(composerObj.pid));
+ }
+ Promise.all(calls).then((thumbs) => {
+ const thumbCount = thumbs.flat().length;
+ const formatEl = postContainer.find('[data-format="thumbs"]');
+ formatEl.find('.badge')
+ .text(thumbCount)
+ .toggleClass('hidden', !thumbCount);
+ });
+ }
+ };
+
+ return composer;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/autocomplete.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/autocomplete.js
new file mode 100644
index 0000000000..ec2ce15d33
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/autocomplete.js
@@ -0,0 +1,99 @@
+'use strict';
+
+define('composer/autocomplete', [
+ 'composer/preview', '@textcomplete/core', '@textcomplete/textarea', '@textcomplete/contenteditable',
+], function (preview, { Textcomplete }, { TextareaEditor }, { ContenteditableEditor }) {
+ var autocomplete = {
+ _active: {},
+ };
+
+ $(window).on('action:composer.discard', function (evt, data) {
+ if (autocomplete._active.hasOwnProperty(data.post_uuid)) {
+ autocomplete._active[data.post_uuid].destroy();
+ delete autocomplete._active[data.post_uuid];
+ }
+ });
+
+ autocomplete.init = function (postContainer, post_uuid) {
+ var element = postContainer.find('.write');
+ var dropdownClass = 'composer-autocomplete-dropdown-' + post_uuid;
+ var timer;
+
+ if (!element.length) {
+ /**
+ * Some composers do their own thing before calling autocomplete.init() again.
+ * One reason is because they want to override the textarea with their own element.
+ * In those scenarios, they don't specify the "write" class, and this conditional
+ * looks for that and stops the autocomplete init process.
+ */
+ return;
+ }
+
+ var data = {
+ element: element,
+ strategies: [],
+ options: {
+ style: {
+ 'z-index': 20000,
+ },
+ className: dropdownClass + ' dropdown-menu textcomplete-dropdown',
+ },
+ };
+
+ element.on('keyup', function () {
+ clearTimeout(timer);
+ timer = setTimeout(function () {
+ var dropdown = document.querySelector('.' + dropdownClass);
+ if (dropdown) {
+ var pos = dropdown.getBoundingClientRect();
+
+ var margin = parseFloat(dropdown.style.marginTop, 10) || 0;
+
+ var offset = window.innerHeight + margin - 10 - pos.bottom;
+ dropdown.style.marginTop = Math.min(offset, 0) + 'px';
+ }
+ }, 0);
+ });
+
+ $(window).trigger('composer:autocomplete:init', data);
+
+ autocomplete._active[post_uuid] = autocomplete.setup(data);
+
+ data.element.on('textComplete:select', function () {
+ preview.render(postContainer);
+ });
+ };
+
+ // This is a generic method that is also used by the chat
+ autocomplete.setup = function ({ element, strategies, options }) {
+ const targetEl = element.get(0);
+ if (!targetEl) {
+ return;
+ }
+ var editor;
+ if (targetEl.nodeName === 'TEXTAREA' || targetEl.nodeName === 'INPUT') {
+ editor = new TextareaEditor(targetEl);
+ } else if (targetEl.nodeName === 'DIV' && targetEl.getAttribute('contenteditable') === 'true') {
+ editor = new ContenteditableEditor(targetEl);
+ }
+ if (!editor) {
+ throw new Error('unknown target element type');
+ }
+ // yuku-t/textcomplete inherits directionality from target element itself
+ targetEl.setAttribute('dir', document.querySelector('html').getAttribute('data-dir'));
+
+ var textcomplete = new Textcomplete(editor, strategies, {
+ dropdown: options,
+ });
+ textcomplete.on('rendered', function () {
+ if (textcomplete.dropdown.items.length) {
+ // Activate the first item by default.
+ textcomplete.dropdown.items[0].activate();
+ }
+ });
+
+ return textcomplete;
+ };
+
+ return autocomplete;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/categoryList.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/categoryList.js
new file mode 100644
index 0000000000..79f5b7a46b
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/categoryList.js
@@ -0,0 +1,115 @@
+'use strict';
+
+define('composer/categoryList', [
+ 'categorySelector', 'taskbar', 'api',
+], function (categorySelector, taskbar, api) {
+ var categoryList = {};
+
+ var selector;
+
+ categoryList.init = function (postContainer, postData) {
+ var listContainer = postContainer.find('.category-list-container');
+ if (!listContainer.length) {
+ return;
+ }
+
+ postContainer.on('action:composer.resize', function () {
+ toggleDropDirection(postContainer);
+ });
+
+ categoryList.updateTaskbar(postContainer, postData);
+
+ selector = categorySelector.init(listContainer.find('[component="category-selector"]'), {
+ privilege: 'topics:create',
+ states: ['watching', 'tracking', 'notwatching', 'ignoring'],
+ onSelect: function (selectedCategory) {
+ if (postData.hasOwnProperty('cid')) {
+ changeCategory(postContainer, postData, selectedCategory);
+ }
+ },
+ });
+ if (!selector) {
+ return;
+ }
+ if (postData.cid && postData.category) {
+ selector.selectedCategory = { cid: postData.cid, name: postData.category.name };
+ } else if (ajaxify.data.template.compose && ajaxify.data.selectedCategory) {
+ // separate composer route
+ selector.selectedCategory = { cid: ajaxify.data.cid, name: ajaxify.data.selectedCategory };
+ }
+
+ // this is the mobile category selector
+ postContainer.find('.category-name')
+ .translateHtml(selector.selectedCategory ? selector.selectedCategory.name : '[[modules:composer.select-category]]')
+ .on('click', function () {
+ categorySelector.modal({
+ privilege: 'topics:create',
+ states: ['watching', 'tracking', 'notwatching', 'ignoring'],
+ openOnLoad: true,
+ showLinks: false,
+ onSubmit: function (selectedCategory) {
+ postContainer.find('.category-name').text(selectedCategory.name);
+ selector.selectCategory(selectedCategory.cid);
+ if (postData.hasOwnProperty('cid')) {
+ changeCategory(postContainer, postData, selectedCategory);
+ }
+ },
+ });
+ });
+
+ toggleDropDirection(postContainer);
+ };
+
+ function toggleDropDirection(postContainer) {
+ postContainer.find('.category-list-container [component="category-selector"]').toggleClass('dropup', postContainer.outerHeight() < $(window).height() / 2);
+ }
+
+ categoryList.getSelectedCid = function () {
+ var selectedCategory;
+ if (selector) {
+ selectedCategory = selector.getSelectedCategory();
+ }
+ return selectedCategory ? selectedCategory.cid : 0;
+ };
+
+ categoryList.updateTaskbar = function (postContainer, postData) {
+ if (parseInt(postData.cid, 10)) {
+ api.get(`/categories/${postData.cid}`, {}).then(function (category) {
+ updateTaskbarByCategory(postContainer, category);
+ });
+ }
+ };
+
+ function updateTaskbarByCategory(postContainer, category) {
+ if (category) {
+ var uuid = postContainer.attr('data-uuid');
+ taskbar.update('composer', uuid, {
+ image: category.backgroundImage,
+ color: category.color,
+ 'background-color': category.bgColor,
+ icon: category.icon && category.icon.slice(3),
+ });
+ }
+ }
+
+ async function changeCategory(postContainer, postData, selectedCategory) {
+ postData.cid = selectedCategory.cid;
+ const categoryData = await window.fetch(`${config.relative_path}/api/category/${selectedCategory.cid}`).then(r => r.json());
+ postData.category = categoryData;
+ updateTaskbarByCategory(postContainer, categoryData);
+ require(['composer/scheduler', 'composer/tags', 'composer/post-queue'], function (scheduler, tags, postQueue) {
+ scheduler.onChangeCategory(categoryData);
+ tags.onChangeCategory(postContainer, postData, selectedCategory.cid, categoryData);
+ postQueue.onChangeCategory(postContainer, postData);
+
+ $(window).trigger('action:composer.changeCategory', {
+ postContainer: postContainer,
+ postData: postData,
+ selectedCategory: selectedCategory,
+ categoryData: categoryData,
+ });
+ });
+ }
+
+ return categoryList;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/controls.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/controls.js
new file mode 100644
index 0000000000..bf393fc21a
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/controls.js
@@ -0,0 +1,171 @@
+'use strict';
+
+define('composer/controls', ['composer/preview'], function (preview) {
+ var controls = {};
+
+ /** ********************************************** */
+ /* Rich Textarea Controls */
+ /** ********************************************** */
+ controls.insertIntoTextarea = function (textarea, value) {
+ var payload = {
+ context: this,
+ textarea: textarea,
+ value: value,
+ preventDefault: false,
+ };
+ $(window).trigger('action:composer.insertIntoTextarea', payload);
+
+ if (payload.preventDefault) {
+ return;
+ }
+
+ var $textarea = $(payload.textarea);
+ var currentVal = $textarea.val();
+ var postContainer = $textarea.parents('[component="composer"]');
+
+ $textarea.val(
+ currentVal.slice(0, payload.textarea.selectionStart) +
+ payload.value +
+ currentVal.slice(payload.textarea.selectionStart)
+ );
+
+ preview.render(postContainer);
+ };
+
+ controls.replaceSelectionInTextareaWith = function (textarea, value) {
+ var payload = {
+ context: this,
+ textarea: textarea,
+ value: value,
+ preventDefault: false,
+ };
+ $(window).trigger('action:composer.replaceSelectionInTextareaWith', payload);
+
+ if (payload.preventDefault) {
+ return;
+ }
+
+ var $textarea = $(payload.textarea);
+ var currentVal = $textarea.val();
+ var postContainer = $textarea.parents('[component="composer"]');
+
+ $textarea.val(
+ currentVal.slice(0, payload.textarea.selectionStart) +
+ payload.value +
+ currentVal.slice(payload.textarea.selectionEnd)
+ );
+
+ preview.render(postContainer);
+ };
+
+ controls.wrapSelectionInTextareaWith = function (textarea, leading, trailing) {
+ var payload = {
+ context: this,
+ textarea: textarea,
+ leading: leading,
+ trailing: trailing,
+ preventDefault: false,
+ };
+ $(window).trigger('action:composer.wrapSelectionInTextareaWith', payload);
+
+ if (payload.preventDefault) {
+ return;
+ }
+
+ if (trailing === undefined) {
+ trailing = leading;
+ }
+
+ var $textarea = $(textarea);
+ var currentVal = $textarea.val();
+
+ var matches = /^(\s*)([\s\S]*?)(\s*)$/.exec(currentVal.slice(textarea.selectionStart, textarea.selectionEnd));
+
+ if (!matches[2]) {
+ // selection is entirely whitespace
+ matches = [null, '', currentVal.slice(textarea.selectionStart, textarea.selectionEnd), ''];
+ }
+
+ $textarea.val(
+ currentVal.slice(0, textarea.selectionStart) +
+ matches[1] +
+ leading +
+ matches[2] +
+ trailing +
+ matches[3] +
+ currentVal.slice(textarea.selectionEnd)
+ );
+
+ return [matches[1].length, matches[3].length];
+ };
+
+ controls.updateTextareaSelection = function (textarea, start, end) {
+ var payload = {
+ context: this,
+ textarea: textarea,
+ start: start,
+ end: end,
+ preventDefault: false,
+ };
+ $(window).trigger('action:composer.updateTextareaSelection', payload);
+
+ if (payload.preventDefault) {
+ return;
+ }
+
+ textarea.setSelectionRange(payload.start, payload.end);
+ $(payload.textarea).focus();
+ };
+
+ controls.getBlockData = function (textareaEl, query, selectionStart) {
+ // Determines whether the cursor is sitting inside a block-type element (bold, italic, etc.)
+ var value = textareaEl.value;
+ query = query.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
+ var regex = new RegExp(query, 'g');
+ var match;
+ var matchIndices = [];
+ var payload;
+
+ // Isolate the line the cursor is on
+ value = value.split('\n').reduce(function (memo, line) {
+ if (memo !== null) {
+ return memo;
+ }
+
+ memo = selectionStart <= line.length ? line : null;
+
+ if (memo === null) {
+ selectionStart -= (line.length + 1);
+ }
+
+ return memo;
+ }, null);
+
+ // Find query characters and determine return payload
+ while ((match = regex.exec(value)) !== null) {
+ matchIndices.push(match.index);
+ }
+
+ payload = {
+ in: !!(matchIndices.reduce(function (memo, cur) {
+ if (selectionStart >= cur + 2) {
+ memo += 1;
+ }
+
+ return memo;
+ }, 0) % 2),
+ atEnd: matchIndices.reduce(function (memo, cur) {
+ if (memo) {
+ return memo;
+ }
+
+ return selectionStart === cur;
+ }, false),
+ };
+
+ payload.atEnd = payload.in ? payload.atEnd : false;
+ return payload;
+ };
+
+ return controls;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/drafts.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/drafts.js
new file mode 100644
index 0000000000..5a23cd10dc
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/drafts.js
@@ -0,0 +1,341 @@
+'use strict';
+
+define('composer/drafts', ['api', 'alerts'], function (api, alerts) {
+ const drafts = {};
+ const draftSaveDelay = 1000;
+ drafts.init = function (postContainer, postData) {
+ const draftIconEl = postContainer.find('.draft-icon');
+ const uuid = postContainer.attr('data-uuid');
+ function doSaveDraft() {
+ // check if composer is still around,
+ // it might have been gone by the time this timeout triggers
+ if (!$(`[component="composer"][data-uuid="${uuid}"]`).length) {
+ return;
+ }
+
+ if (!postData.save_id) {
+ postData.save_id = utils.generateSaveId(app.user.uid);
+ }
+ // Post is modified, save to list of opened drafts
+ drafts.addToDraftList('available', postData.save_id);
+ drafts.addToDraftList('open', postData.save_id);
+ saveDraft(postContainer, draftIconEl, postData);
+ }
+
+ postContainer.on('keyup', 'textarea, input.handle, input.title', utils.debounce(doSaveDraft, draftSaveDelay));
+ postContainer.on('click', 'input[type="checkbox"]', utils.debounce(doSaveDraft, draftSaveDelay));
+ postContainer.on('click', '[component="category/list"] [data-cid]', utils.debounce(doSaveDraft, draftSaveDelay));
+ postContainer.on('itemAdded', '.tags', utils.debounce(doSaveDraft, draftSaveDelay));
+ postContainer.on('thumb.uploaded', doSaveDraft);
+
+ draftIconEl.on('animationend', function () {
+ $(this).toggleClass('active', false);
+ });
+
+ $(window).on('unload', function () {
+ // remove all drafts from the open list
+ const open = drafts.getList('open');
+ if (open.length) {
+ open.forEach(save_id => drafts.removeFromDraftList('open', save_id));
+ }
+ });
+
+ drafts.migrateGuest();
+ drafts.migrateThumbs(...arguments);
+ };
+
+ function getStorage(uid) {
+ return parseInt(uid, 10) > 0 ? localStorage : sessionStorage;
+ }
+
+ drafts.get = function (save_id) {
+ if (!save_id) {
+ return null;
+ }
+ const uid = save_id.split(':')[1];
+ const storage = getStorage(uid);
+ try {
+ const draftJson = storage.getItem(save_id);
+ const draft = JSON.parse(draftJson) || null;
+ if (!draft) {
+ throw new Error(`can't parse draft json for ${save_id}`);
+ }
+ draft.save_id = save_id;
+ if (draft.timestamp) {
+ draft.timestampISO = utils.toISOString(draft.timestamp);
+ }
+ $(window).trigger('action:composer.drafts.get', {
+ save_id: save_id,
+ draft: draft,
+ storage: storage,
+ });
+ return draft;
+ } catch (e) {
+ console.warn(`[composer/drafts] Could not get draft ${save_id}, removing`);
+ drafts.removeFromDraftList('available');
+ drafts.removeFromDraftList('open');
+ return null;
+ }
+ };
+
+ function saveDraft(postContainer, draftIconEl, postData) {
+ if (canSave(app.user.uid ? 'localStorage' : 'sessionStorage') && postData && postData.save_id && postContainer.length) {
+ const titleEl = postContainer.find('input.title');
+ const title = titleEl && titleEl.length && titleEl.val();
+ const raw = postContainer.find('textarea').val();
+ const storage = getStorage(app.user.uid);
+
+ if (raw.length || (title && title.length)) {
+ const draftData = {
+ save_id: postData.save_id,
+ action: postData.action,
+ text: raw,
+ uuid: postContainer.attr('data-uuid'),
+ timestamp: Date.now(),
+ };
+
+ if (postData.action === 'topics.post') {
+ // New topic only
+ const tags = postContainer.find('input.tags').val();
+ draftData.tags = tags;
+ draftData.title = title;
+ draftData.cid = postData.cid;
+ } else if (postData.action === 'posts.reply') {
+ // new reply only
+ draftData.title = postData.title;
+ draftData.tid = postData.tid;
+ draftData.toPid = postData.toPid;
+ } else if (postData.action === 'posts.edit') {
+ draftData.pid = postData.pid;
+ draftData.title = title || postData.title;
+ }
+ if (!app.user.uid) {
+ draftData.handle = postContainer.find('input.handle').val();
+ }
+
+ // save all draft data into single item as json
+ storage.setItem(postData.save_id, JSON.stringify(draftData));
+
+ $(window).trigger('action:composer.drafts.save', {
+ storage: storage,
+ postData: postData,
+ postContainer: postContainer,
+ });
+ draftIconEl.toggleClass('active', true);
+ } else {
+ drafts.removeDraft(postData.save_id);
+ }
+ }
+ }
+
+ drafts.removeDraft = function (save_id) {
+ if (!save_id) {
+ return;
+ }
+
+ // Remove save_id from list of open and available drafts
+ drafts.removeFromDraftList('available', save_id);
+ drafts.removeFromDraftList('open', save_id);
+ const uid = save_id.split(':')[1];
+ const storage = getStorage(uid);
+ storage.removeItem(save_id);
+
+ $(window).trigger('action:composer.drafts.remove', {
+ storage: storage,
+ save_id: save_id,
+ });
+ };
+
+ drafts.getList = function (set) {
+ try {
+ const draftIds = localStorage.getItem(`drafts:${set}`);
+ return JSON.parse(draftIds) || [];
+ } catch (e) {
+ console.warn('[composer/drafts] Could not read list of available drafts');
+ return [];
+ }
+ };
+
+ drafts.addToDraftList = function (set, save_id) {
+ if (!canSave(app.user.uid ? 'localStorage' : 'sessionStorage') || !save_id) {
+ return;
+ }
+ const list = drafts.getList(set);
+ if (!list.includes(save_id)) {
+ list.push(save_id);
+ localStorage.setItem('drafts:' + set, JSON.stringify(list));
+ }
+ };
+
+ drafts.removeFromDraftList = function (set, save_id) {
+ if (!canSave(app.user.uid ? 'localStorage' : 'sessionStorage') || !save_id) {
+ return;
+ }
+ const list = drafts.getList(set);
+ if (list.includes(save_id)) {
+ list.splice(list.indexOf(save_id), 1);
+ localStorage.setItem('drafts:' + set, JSON.stringify(list));
+ }
+ };
+
+ drafts.migrateGuest = function () {
+ // If any drafts are made while as guest, and user then logs in, assume control of those drafts
+ if (canSave('localStorage') && app.user.uid) {
+ // composer::
+ const test = /^composer:\d+:\d$/;
+ const keys = Object.keys(sessionStorage).filter(function (key) {
+ return test.test(key);
+ });
+ const migrated = new Set([]);
+ const renamed = keys.map(function (key) {
+ const parts = key.split(':');
+ parts[1] = app.user.uid;
+
+ migrated.add(parts.join(':'));
+ return parts.join(':');
+ });
+
+ keys.forEach(function (key, idx) {
+ localStorage.setItem(renamed[idx], sessionStorage.getItem(key));
+ sessionStorage.removeItem(key);
+ });
+
+ migrated.forEach(function (save_id) {
+ drafts.addToDraftList('available', save_id);
+ });
+
+ return migrated;
+ }
+ };
+
+ drafts.migrateThumbs = function (postContainer, postData) {
+ if (!app.uid) {
+ return;
+ }
+
+ // If any thumbs were uploaded, migrate them to this new composer's uuid
+ const newUUID = postContainer.attr('data-uuid');
+ const draft = drafts.get(postData.save_id);
+
+ if (draft && draft.uuid) {
+ api.put(`/topics/${draft.uuid}/thumbs`, {
+ tid: newUUID,
+ }).then(() => {
+ require(['composer'], function (composer) {
+ composer.updateThumbCount(newUUID, postContainer);
+ });
+ });
+ }
+ };
+
+ drafts.listAvailable = function () {
+ const available = drafts.getList('available');
+ return available.map(drafts.get).filter(Boolean);
+ };
+
+ drafts.getAvailableCount = function () {
+ return drafts.listAvailable().length;
+ };
+
+ drafts.open = function (save_id) {
+ if (!save_id) {
+ return;
+ }
+ const draft = drafts.get(save_id);
+ openComposer(save_id, draft);
+ };
+
+ drafts.loadOpen = function () {
+ if (ajaxify.data.template.login || ajaxify.data.template.register || (config.hasOwnProperty('openDraftsOnPageLoad') && !config.openDraftsOnPageLoad)) {
+ return;
+ }
+ // Load drafts if they were open
+ const available = drafts.getList('available');
+ const open = drafts.getList('open');
+
+ if (available.length) {
+ // Deconstruct each save_id and open up composer
+ available.forEach(function (save_id) {
+ if (!save_id || open.includes(save_id)) {
+ return;
+ }
+ const draft = drafts.get(save_id);
+ if (!draft || (!draft.text && !draft.title)) {
+ drafts.removeFromDraftList('available', save_id);
+ drafts.removeFromDraftList('open', save_id);
+ return;
+ }
+ openComposer(save_id, draft);
+ });
+ }
+ };
+
+ function openComposer(save_id, draft) {
+ const saveObj = save_id.split(':');
+ const uid = saveObj[1];
+ // Don't open other peoples' drafts
+ if (parseInt(app.user.uid, 10) !== parseInt(uid, 10)) {
+ return;
+ }
+ require(['composer'], function (composer) {
+ if (draft.action === 'topics.post') {
+ composer.newTopic({
+ save_id: draft.save_id,
+ cid: draft.cid,
+ handle: app.user && app.user.uid ? undefined : utils.escapeHTML(draft.handle),
+ title: utils.escapeHTML(draft.title),
+ body: draft.text,
+ tags: String(draft.tags || '').split(','),
+ });
+ } else if (draft.action === 'posts.reply') {
+ api.get('/topics/' + draft.tid, {}, function (err, topicObj) {
+ if (err) {
+ return alerts.error(err);
+ }
+
+ composer.newReply({
+ save_id: draft.save_id,
+ tid: draft.tid,
+ toPid: draft.toPid,
+ title: topicObj.title,
+ body: draft.text,
+ });
+ });
+ } else if (draft.action === 'posts.edit') {
+ composer.editPost({
+ save_id: draft.save_id,
+ pid: draft.pid,
+ title: draft.title ? utils.escapeHTML(draft.title) : undefined,
+ body: draft.text,
+ });
+ }
+ });
+ }
+
+ // Feature detection courtesy of: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
+ function canSave(type) {
+ var storage;
+ try {
+ storage = window[type];
+ var x = '__storage_test__';
+ storage.setItem(x, x);
+ storage.removeItem(x);
+ return true;
+ } catch (e) {
+ return e instanceof DOMException && (
+ // everything except Firefox
+ e.code === 22 ||
+ // Firefox
+ e.code === 1014 ||
+ // test name field too, because code might not be present
+ // everything except Firefox
+ e.name === 'QuotaExceededError' ||
+ // Firefox
+ e.name === 'NS_ERROR_DOM_QUOTA_REACHED') &&
+ // acknowledge QuotaExceededError only if there's something already stored
+ (storage && storage.length !== 0);
+ }
+ }
+
+ return drafts;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/formatting.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/formatting.js
new file mode 100644
index 0000000000..dca150fdd4
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/formatting.js
@@ -0,0 +1,194 @@
+'use strict';
+
+define('composer/formatting', [
+ 'composer/preview', 'composer/resize', 'topicThumbs', 'screenfull',
+], function (preview, resize, topicThumbs, screenfull) {
+ var formatting = {};
+
+ var formattingDispatchTable = {
+ picture: function () {
+ var postContainer = this;
+ postContainer.find('#files')
+ .attr('accept', 'image/*')
+ .click();
+ },
+
+ upload: function () {
+ var postContainer = this;
+ postContainer.find('#files')
+ .attr('accept', '')
+ .click();
+ },
+
+ thumbs: function () {
+ formatting.exitFullscreen();
+ var postContainer = this;
+ require(['composer'], function (composer) {
+ const uuid = postContainer.get(0).getAttribute('data-uuid');
+ const composerObj = composer.posts[uuid];
+
+ if (composerObj.action === 'topics.post' || (composerObj.action === 'posts.edit' && composerObj.isMain)) {
+ topicThumbs.modal.open({ id: uuid, pid: composerObj.pid }).then(() => {
+ postContainer.trigger('thumb.uploaded'); // toggle draft save
+
+ // Update client-side with count
+ composer.updateThumbCount(uuid, postContainer);
+ });
+ }
+ });
+ },
+
+ tags: function () {
+ var postContainer = this;
+ postContainer.find('.tags-container').toggleClass('hidden');
+ },
+
+ zen: function () {
+ var postContainer = this;
+ $(window).one('resize', function () {
+ function onResize() {
+ if (!screenfull.isFullscreen) {
+ app.toggleNavbar(true);
+ $('html').removeClass('zen-mode');
+ resize.reposition(postContainer);
+ $(window).off('resize', onResize);
+ }
+ }
+
+ if (screenfull.isFullscreen) {
+ app.toggleNavbar(false);
+ $('html').addClass('zen-mode');
+ postContainer.find('.write').focus();
+
+ $(window).on('resize', onResize);
+ $(window).one('action:composer.topics.post action:composer.posts.reply action:composer.posts.edit action:composer.discard', screenfull.exit);
+ }
+ });
+
+ screenfull.toggle(postContainer.get(0));
+ $(window).trigger('action:composer.fullscreen', { postContainer: postContainer });
+ },
+ };
+
+ var buttons = [];
+
+ formatting.exitFullscreen = function () {
+ if (screenfull.isEnabled && screenfull.isFullscreen) {
+ screenfull.exit();
+ }
+ };
+
+ formatting.addComposerButtons = function () {
+ const formattingBarEl = $('.formatting-bar');
+ const fileForm = formattingBarEl.find('.formatting-group #fileForm');
+ buttons.forEach((btn) => {
+ let markup = ``;
+ if (Array.isArray(btn.dropdownItems) && btn.dropdownItems.length) {
+ markup = generateFormattingDropdown(btn);
+ } else {
+ markup = `
+
+
+
+ ${generateBadgetHtml(btn)}
+
+
+ `;
+ }
+ fileForm.before(markup);
+ });
+
+ const els = formattingBarEl.find('.formatting-group>li');
+ els.tooltip({
+ container: '#content',
+ animation: false,
+ trigger: 'manual',
+ }).on('mouseenter', function (ev) {
+ const target = $(ev.target);
+ const isDropdown = target.hasClass('dropdown-menu') || !!target.parents('.dropdown-menu').length;
+ if (!isDropdown) {
+ $(this).tooltip('show');
+ }
+ }).on('click mouseleave', function () {
+ $(this).tooltip('hide');
+ });
+ };
+
+ function generateBadgetHtml(btn) {
+ let badgeHtml = '';
+ if (btn.badge) {
+ badgeHtml = ` `;
+ }
+ return badgeHtml;
+ }
+
+ function generateFormattingDropdown(btn) {
+ const dropdownItemsHtml = btn.dropdownItems.map(function (btn) {
+ return `
+
+
+ ${btn.text}
+ ${generateBadgetHtml(btn)}
+
+
+ `;
+ });
+ return `
+
+
+
+
+
+
+ `;
+ }
+
+ formatting.addButton = function (iconClass, onClick, title, name) {
+ name = name || iconClass.replace('fa fa-', '');
+ formattingDispatchTable[name] = onClick;
+ buttons.push({
+ name,
+ iconClass,
+ title,
+ });
+ };
+
+ formatting.addDropdown = function (data) {
+ buttons.push({
+ iconClass: data.iconClass,
+ title: data.title,
+ dropdownItems: data.dropdownItems,
+ });
+ data.dropdownItems.forEach((btn) => {
+ if (btn.name && btn.onClick) {
+ formattingDispatchTable[btn.name] = btn.onClick;
+ }
+ });
+ };
+
+ formatting.getDispatchTable = function () {
+ return formattingDispatchTable;
+ };
+
+ formatting.addButtonDispatch = function (name, onClick) {
+ formattingDispatchTable[name] = onClick;
+ };
+
+ formatting.addHandler = function (postContainer) {
+ postContainer.on('click', '.formatting-bar [data-format]', function (event) {
+ var format = $(this).attr('data-format');
+ var textarea = $(this).parents('[component="composer"]').find('textarea')[0];
+
+ if (formattingDispatchTable.hasOwnProperty(format)) {
+ formattingDispatchTable[format].call(
+ postContainer, textarea, textarea.selectionStart, textarea.selectionEnd, event
+ );
+ preview.render(postContainer);
+ }
+ });
+ };
+
+ return formatting;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/post-queue.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/post-queue.js
new file mode 100644
index 0000000000..2022430842
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/post-queue.js
@@ -0,0 +1,25 @@
+'use strict';
+
+define('composer/post-queue', [], function () {
+ const postQueue = {};
+
+ postQueue.showAlert = async function (postContainer, postData) {
+ const alertEl = postContainer.find('[component="composer/post-queue/alert"]')
+ if (!config.postQueue || app.user.isAdmin || app.user.isGlobalMod || app.user.isMod) {
+ alertEl.remove();
+ return;
+ }
+ const shouldQueue = await socket.emit('plugins.composer.shouldQueue', { postData: postData });
+ alertEl.toggleClass('show', shouldQueue);
+ alertEl.toggleClass('pe-none', !shouldQueue);
+ };
+
+ postQueue.onChangeCategory = async function (postContainer, postData) {
+ if (!config.postQueue) {
+ return;
+ }
+ postQueue.showAlert(postContainer, postData);
+ };
+
+ return postQueue;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/preview.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/preview.js
new file mode 100644
index 0000000000..9074e6edc2
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/preview.js
@@ -0,0 +1,105 @@
+'use strict';
+
+define('composer/preview', ['hooks'], function (hooks) {
+ var preview = {};
+
+ preview.render = function (postContainer, callback) {
+ callback = callback || function () {};
+ if (!postContainer.find('.preview-container').is(':visible')) {
+ return callback();
+ }
+
+ var textarea = postContainer.find('textarea');
+
+ socket.emit('plugins.composer.renderPreview', textarea.val(), function (err, preview) {
+ if (err) {
+ return;
+ }
+ preview = $('' + preview + '
');
+ preview.find('img:not(.not-responsive)').addClass('img-fluid');
+ postContainer.find('.preview').html(preview);
+ hooks.fire('action:composer.preview', { postContainer, preview });
+ callback();
+ });
+ };
+
+ preview.matchScroll = function (postContainer) {
+ if (!postContainer.find('.preview-container').is(':visible')) {
+ return;
+ }
+ var textarea = postContainer.find('textarea');
+ var preview = postContainer.find('.preview');
+
+ if (textarea.length && preview.length) {
+ var diff = textarea[0].scrollHeight - textarea.height();
+
+ if (diff === 0) {
+ return;
+ }
+
+ var scrollPercent = textarea.scrollTop() / diff;
+
+ preview.scrollTop(Math.max(preview[0].scrollHeight - preview.height(), 0) * scrollPercent);
+ }
+ };
+
+ preview.handleToggler = function ($postContainer) {
+ const postContainer = $postContainer.get(0);
+ preview.env = utils.findBootstrapEnvironment();
+ const isMobile = ['xs', 'sm'].includes(preview.env);
+ const toggler = postContainer.querySelector('.formatting-bar [data-action="preview"]');
+ const showText = toggler.querySelector('.show-text');
+ const hideText = toggler.querySelector('.hide-text');
+ const previewToggled = localStorage.getItem('composer:previewToggled');
+ const hidePreviewOnOpen = config['composer-default'].hidePreviewOnOpen === 'on';
+ let show = !isMobile && (
+ ((previewToggled === null && !hidePreviewOnOpen) || previewToggled === 'true')
+ );
+ const previewContainer = postContainer.querySelector('.preview-container');
+ const writeContainer = postContainer.querySelector('.write-container');
+
+ if (!toggler) {
+ return;
+ }
+
+ function togglePreview(show) {
+ if (isMobile) {
+ previewContainer.classList.toggle('hide', false);
+ writeContainer.classList.toggle('maximized', false);
+
+ previewContainer.classList.toggle('d-none', !show);
+ previewContainer.classList.toggle('d-flex', show);
+ previewContainer.classList.toggle('w-100', show);
+
+ writeContainer.classList.toggle('d-flex', !show);
+ writeContainer.classList.toggle('d-none', show);
+ writeContainer.classList.toggle('w-100', !show);
+ } else {
+ previewContainer.classList.toggle('hide', !show);
+ writeContainer.classList.toggle('w-50', show);
+ writeContainer.classList.toggle('w-100', !show);
+ localStorage.setItem('composer:previewToggled', show);
+ }
+ showText.classList.toggle('hide', show);
+ hideText.classList.toggle('hide', !show);
+ if (show) {
+ preview.render($postContainer);
+ }
+ preview.matchScroll($postContainer);
+ }
+ preview.toggle = togglePreview;
+
+ toggler.addEventListener('click', (e) => {
+ if (e.button !== 0) {
+ return;
+ }
+
+ show = !show;
+ togglePreview(show);
+ });
+
+ togglePreview(show);
+ };
+
+ return preview;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/resize.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/resize.js
new file mode 100644
index 0000000000..5fa84f3a3f
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/resize.js
@@ -0,0 +1,197 @@
+
+'use strict';
+
+define('composer/resize', ['taskbar'], function (taskbar) {
+ var resize = {};
+ var oldRatio = 0;
+ var minimumRatio = 0.3;
+ var snapMargin = 0.05;
+ var smallMin = 768;
+
+ var $body = $('body');
+ var $window = $(window);
+ var $headerMenu = $('[component="navbar"]');
+ const content = document.getElementById('content');
+
+ var header = $headerMenu[0];
+
+ function getSavedRatio() {
+ return localStorage.getItem('composer:resizeRatio') || 0.5;
+ }
+
+ function saveRatio(ratio) {
+ localStorage.setItem('composer:resizeRatio', Math.min(ratio, 1));
+ }
+
+ function getBounds() {
+ var headerRect;
+ if (header) {
+ headerRect = header.getBoundingClientRect();
+ } else {
+ // Mock data
+ headerRect = { bottom: 0 };
+ }
+
+ var headerBottom = Math.max(headerRect.bottom, 0);
+
+ var rect = {
+ top: 0,
+ left: 0,
+ right: window.innerWidth,
+ bottom: window.innerHeight,
+ };
+
+ rect.width = rect.right;
+ rect.height = rect.bottom;
+
+ rect.boundedTop = headerBottom;
+ rect.boundedHeight = rect.bottom - headerBottom;
+
+ return rect;
+ }
+
+ function doResize(postContainer, ratio) {
+ var bounds = getBounds();
+ var elem = postContainer[0];
+ var style = window.getComputedStyle(elem);
+
+ // Adjust minimumRatio for shorter viewports
+ var minHeight = parseInt(style.getPropertyValue('min-height'), 10);
+ var adjustedMinimum = Math.max(minHeight / window.innerHeight, minimumRatio);
+
+ if (bounds.width >= smallMin) {
+ const boundedDifference = (bounds.height - bounds.boundedHeight) / bounds.height;
+ ratio = Math.min(Math.max(ratio, adjustedMinimum + boundedDifference), 1);
+
+ var top = ratio * bounds.boundedHeight / bounds.height;
+ elem.style.top = ((1 - top) * 100).toString() + '%';
+
+ // Add some extra space at the bottom of the body so that
+ // the user can still scroll to the last post w/ composer open
+ var rect = elem.getBoundingClientRect();
+ content.style.paddingBottom = (rect.bottom - rect.top).toString() + 'px';
+ } else {
+ elem.style.top = 0;
+ content.style.paddingBottom = 0;
+ }
+
+ postContainer.ratio = ratio;
+
+ taskbar.updateActive(postContainer.attr('data-uuid'));
+ }
+
+ var resizeIt = doResize;
+ var raf = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame;
+
+ if (raf) {
+ resizeIt = function (postContainer, ratio) {
+ raf(function () {
+ doResize(postContainer, ratio);
+
+ setTimeout(function () {
+ $window.trigger('action:composer.resize');
+ postContainer.trigger('action:composer.resize');
+ }, 0);
+ });
+ };
+ }
+
+ resize.reposition = function (postContainer) {
+ var ratio = getSavedRatio();
+
+ if (ratio >= 1 - snapMargin) {
+ ratio = 1;
+ postContainer.addClass('maximized');
+ }
+
+ resizeIt(postContainer, ratio);
+ };
+
+ resize.maximize = function (postContainer, state) {
+ if (state) {
+ resizeIt(postContainer, 1);
+ } else {
+ resize.reposition(postContainer);
+ }
+ };
+
+ resize.handleResize = function (postContainer) {
+ var resizeOffset = 0;
+ var resizeBegin = 0;
+ var resizeEnd = 0;
+ var $resizer = postContainer.find('.resizer');
+ var resizer = $resizer[0];
+
+ function resizeStart(e) {
+ var resizeRect = resizer.getBoundingClientRect();
+ var resizeCenterY = (resizeRect.top + resizeRect.bottom) / 2;
+
+ resizeOffset = (resizeCenterY - e.clientY) / 2;
+ resizeBegin = e.clientY;
+
+ $window.on('mousemove', resizeAction);
+ $window.on('mouseup', resizeStop);
+ $body.on('touchmove', resizeTouchAction);
+ }
+
+ function resizeAction(e) {
+ var position = e.clientY - resizeOffset;
+ var bounds = getBounds();
+ var ratio = (bounds.height - position) / (bounds.boundedHeight);
+
+ resizeIt(postContainer, ratio);
+ }
+
+ function resizeStop(e) {
+ e.preventDefault();
+ resizeEnd = e.clientY;
+
+ postContainer.find('textarea').focus();
+ $window.off('mousemove', resizeAction);
+ $window.off('mouseup', resizeStop);
+ $body.off('touchmove', resizeTouchAction);
+
+ var position = resizeEnd - resizeOffset;
+ var bounds = getBounds();
+ var ratio = (bounds.height - position) / (bounds.boundedHeight);
+
+ if (resizeEnd - resizeBegin === 0 && postContainer.hasClass('maximized')) {
+ postContainer.removeClass('maximized');
+ ratio = (!oldRatio || oldRatio >= 1 - snapMargin) ? 0.5 : oldRatio;
+ resizeIt(postContainer, ratio);
+ } else if (resizeEnd - resizeBegin === 0 || ratio >= 1 - snapMargin) {
+ resizeIt(postContainer, 1);
+ postContainer.addClass('maximized');
+ oldRatio = ratio;
+ } else {
+ postContainer.removeClass('maximized');
+ }
+
+ saveRatio(ratio);
+ }
+
+ function resizeTouchAction(e) {
+ e.preventDefault();
+ resizeAction(e.touches[0]);
+ }
+
+ $resizer
+ .on('mousedown', function (e) {
+ if (e.button !== 0) {
+ return;
+ }
+
+ e.preventDefault();
+ resizeStart(e);
+ })
+ .on('touchstart', function (e) {
+ e.preventDefault();
+ resizeStart(e.touches[0]);
+ })
+ .on('touchend', resizeStop);
+ };
+
+ return resize;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/scheduler.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/scheduler.js
new file mode 100644
index 0000000000..e238c33bdc
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/scheduler.js
@@ -0,0 +1,201 @@
+'use strict';
+
+define('composer/scheduler', ['benchpress', 'bootbox', 'alerts', 'translator'], function (
+ Benchpress,
+ bootbox,
+ alerts,
+ translator
+) {
+ const scheduler = {};
+ const state = {
+ timestamp: 0,
+ open: false,
+ edit: false,
+ posts: {},
+ };
+ let displayBtnCons = [];
+ let displayBtns;
+ let cancelBtn;
+ let submitContainer;
+ let submitOptionsCon;
+
+ const dropdownDisplayBtn = {
+ el: null,
+ defaultText: '',
+ activeText: '',
+ };
+
+ const submitBtn = {
+ el: null,
+ icon: null,
+ defaultText: '',
+ activeText: '',
+ };
+ let dateInput;
+ let timeInput;
+
+ $(window).on('action:composer.activate', handleOnActivate);
+
+ scheduler.init = function ($postContainer, posts) {
+ state.timestamp = 0;
+ state.posts = posts;
+
+ translator.translateKeys(['[[topic:composer.post-later]]', '[[modules:composer.change-schedule-date]]']).then((translated) => {
+ dropdownDisplayBtn.defaultText = translated[0];
+ dropdownDisplayBtn.activeText = translated[1];
+ });
+
+ displayBtnCons = $postContainer[0].querySelectorAll('.display-scheduler');
+ displayBtns = $postContainer[0].querySelectorAll('.display-scheduler i');
+ dropdownDisplayBtn.el = $postContainer[0].querySelector('.dropdown-item.display-scheduler');
+ cancelBtn = $postContainer[0].querySelector('.dropdown-item.cancel-scheduling');
+ submitContainer = $postContainer.find('[component="composer/submit/container"]');
+ submitOptionsCon = $postContainer.find('[component="composer/submit/options/container"]');
+
+ submitBtn.el = $postContainer[0].querySelector('.composer-submit:not(.btn-sm)');
+ submitBtn.icon = submitBtn.el.querySelector('i');
+ submitBtn.defaultText = submitBtn.el.lastChild.textContent;
+ submitBtn.activeText = submitBtn.el.getAttribute('data-text-variant');
+
+ cancelBtn.addEventListener('click', cancelScheduling);
+ displayBtnCons.forEach(el => el.addEventListener('click', openModal));
+ };
+
+ scheduler.getTimestamp = function () {
+ if (!scheduler.isActive() || isNaN(state.timestamp)) {
+ return 0;
+ }
+ return state.timestamp;
+ };
+
+ scheduler.isActive = function () {
+ return state.timestamp > 0;
+ };
+
+ scheduler.isOpen = function () {
+ return state.open;
+ };
+
+ scheduler.reset = function () {
+ state.timestamp = 0;
+ };
+
+ scheduler.onChangeCategory = function (categoryData) {
+ toggleDisplayButtons(categoryData.privileges['topics:schedule']);
+ toggleItems(false);
+ const optionsVisible = categoryData.privileges['topics:schedule'] || submitOptionsCon.attr('data-submit-options') > 0;
+ submitContainer.find('.composer-submit').toggleClass('rounded-1', !optionsVisible);
+ submitOptionsCon.toggleClass('hidden', !optionsVisible);
+ scheduler.reset();
+ };
+
+ async function openModal() {
+ const html = await Benchpress.render('modals/topic-scheduler');
+ bootbox.dialog({
+ message: html,
+ title: '[[modules:composer.schedule-for]]',
+ className: 'topic-scheduler',
+ onShown: initModal,
+ onHidden: handleOnHidden,
+ onEscape: true,
+ buttons: {
+ cancel: {
+ label: state.timestamp ? '[[modules:composer.cancel-scheduling]]' : '[[modules:bootbox.cancel]]',
+ className: (state.timestamp ? 'btn-warning' : 'btn-outline-secondary') + (state.edit ? ' hidden' : ''),
+ callback: cancelScheduling,
+ },
+ set: {
+ label: '[[modules:composer.set-schedule-date]]',
+ className: 'btn-primary',
+ callback: setTimestamp,
+ },
+ },
+ });
+ }
+
+ function initModal(ev) {
+ state.open = true;
+ const schedulerContainer = ev.target.querySelector('.datetime-picker');
+ dateInput = schedulerContainer.querySelector('input[type="date"]');
+ timeInput = schedulerContainer.querySelector('input[type="time"]');
+ initDateTimeInputs();
+ }
+
+ function handleOnHidden() {
+ state.open = false;
+ }
+
+ function handleOnActivate(ev, { post_uuid }) {
+ state.edit = false;
+
+ const postData = state.posts[post_uuid];
+ if (postData && postData.isMain && postData.timestamp > Date.now()) {
+ state.timestamp = postData.timestamp;
+ state.edit = true;
+ toggleItems();
+ }
+ }
+
+ function initDateTimeInputs() {
+ const d = new Date();
+ // Update min. selectable date and time
+ const nowLocalISO = new Date(d.getTime() - (d.getTimezoneOffset() * 60000)).toJSON();
+ dateInput.setAttribute('min', nowLocalISO.slice(0, 10));
+ timeInput.setAttribute('min', nowLocalISO.slice(11, -8));
+
+ if (scheduler.isActive()) {
+ const scheduleDate = new Date(state.timestamp - (d.getTimezoneOffset() * 60000)).toJSON();
+ dateInput.value = scheduleDate.slice(0, 10);
+ timeInput.value = scheduleDate.slice(11, -8);
+ }
+ }
+
+ function setTimestamp() {
+ const bothFilled = dateInput.value && timeInput.value;
+ const timestamp = new Date(`${dateInput.value} ${timeInput.value}`).getTime();
+ if (!bothFilled || isNaN(timestamp) || timestamp < Date.now()) {
+ state.timestamp = 0;
+ const message = timestamp < Date.now() ? '[[error:scheduling-to-past]]' : '[[error:invalid-schedule-date]]';
+ alerts.alert({
+ type: 'danger',
+ timeout: 3000,
+ title: '',
+ alert_id: 'post_error',
+ message,
+ });
+ return false;
+ }
+ if (!state.timestamp) {
+ toggleItems(true);
+ }
+ state.timestamp = timestamp;
+ }
+
+ function cancelScheduling() {
+ if (!state.timestamp) {
+ return;
+ }
+ toggleItems(false);
+ state.timestamp = 0;
+ }
+
+ function toggleItems(active = true) {
+ displayBtns.forEach(btn => btn.classList.toggle('active', active));
+ if (submitBtn.icon) {
+ submitBtn.icon.classList.toggle('fa-check', !active);
+ submitBtn.icon.classList.toggle('fa-clock-o', active);
+ }
+ if (dropdownDisplayBtn.el) {
+ dropdownDisplayBtn.el.textContent = active ? dropdownDisplayBtn.activeText : dropdownDisplayBtn.defaultText;
+ cancelBtn.classList.toggle('hidden', !active);
+ }
+ // Toggle submit button text
+ submitBtn.el.lastChild.textContent = active ? submitBtn.activeText : submitBtn.defaultText;
+ }
+
+ function toggleDisplayButtons(show) {
+ displayBtnCons.forEach(btn => btn.classList.toggle('hidden', !show));
+ }
+
+ return scheduler;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/tags.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/tags.js
new file mode 100644
index 0000000000..338e4546d2
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/tags.js
@@ -0,0 +1,227 @@
+
+'use strict';
+
+define('composer/tags', ['alerts'], function (alerts) {
+ var tags = {};
+
+ var minTags;
+ var maxTags;
+
+ tags.init = function (postContainer, postData) {
+ var tagEl = postContainer.find('.tags');
+ if (!tagEl.length) {
+ return;
+ }
+
+ minTags = ajaxify.data.hasOwnProperty('minTags') ? ajaxify.data.minTags : config.minimumTagsPerTopic;
+ maxTags = ajaxify.data.hasOwnProperty('maxTags') ? ajaxify.data.maxTags : config.maximumTagsPerTopic;
+
+ tagEl.tagsinput({
+ tagClass: 'badge bg-info rounded-1',
+ confirmKeys: [13, 44],
+ trimValue: true,
+ });
+ var input = postContainer.find('.bootstrap-tagsinput input');
+
+ toggleTagInput(postContainer, postData, ajaxify.data);
+
+ app.loadJQueryUI(function () {
+ input.autocomplete({
+ delay: 100,
+ position: { my: 'left bottom', at: 'left top', collision: 'flip' },
+ appendTo: postContainer.find('.bootstrap-tagsinput'),
+ open: function () {
+ $(this).autocomplete('widget').css('z-index', 20000);
+ },
+ source: function (request, response) {
+ socket.emit('topics.autocompleteTags', {
+ query: request.term,
+ cid: postData.cid,
+ }, function (err, tags) {
+ if (err) {
+ return alerts.error(err);
+ }
+ if (tags) {
+ response(tags);
+ }
+ $('.ui-autocomplete a').attr('data-ajaxify', 'false');
+ });
+ },
+ select: function (/* event, ui */) {
+ // when autocomplete is selected from the dropdown simulate a enter key down to turn it into a tag
+ triggerEnter(input);
+ },
+ });
+
+ addTags(postData.tags, tagEl);
+
+ tagEl.on('beforeItemAdd', function (event) {
+ var reachedMaxTags = maxTags && maxTags <= tags.getTags(postContainer.attr('data-uuid')).length;
+ var cleanTag = utils.cleanUpTag(event.item, config.maximumTagLength);
+ var different = cleanTag !== event.item;
+ event.cancel = different ||
+ event.item.length < config.minimumTagLength ||
+ event.item.length > config.maximumTagLength ||
+ reachedMaxTags;
+
+ if (event.item.length < config.minimumTagLength) {
+ return alerts.error('[[error:tag-too-short, ' + config.minimumTagLength + ']]');
+ } else if (event.item.length > config.maximumTagLength) {
+ return alerts.error('[[error:tag-too-long, ' + config.maximumTagLength + ']]');
+ } else if (reachedMaxTags) {
+ return alerts.error('[[error:too-many-tags, ' + maxTags + ']]');
+ }
+ if (different) {
+ tagEl.tagsinput('add', cleanTag);
+ }
+ });
+
+ var skipAddCheck = false;
+ var skipRemoveCheck = false;
+ tagEl.on('itemRemoved', function (event) {
+ if (skipRemoveCheck) {
+ skipRemoveCheck = false;
+ return;
+ }
+
+ if (!event.item) {
+ return;
+ }
+ socket.emit('topics.canRemoveTag', { tag: event.item }, function (err, allowed) {
+ if (err) {
+ return alerts.error(err);
+ }
+ if (!allowed) {
+ alerts.error('[[error:cant-remove-system-tag]]');
+ skipAddCheck = true;
+ tagEl.tagsinput('add', event.item);
+ }
+ });
+ });
+
+ tagEl.on('itemAdded', function (event) {
+ if (skipAddCheck) {
+ skipAddCheck = false;
+ return;
+ }
+ var cid = postData.hasOwnProperty('cid') ? postData.cid : ajaxify.data.cid;
+ socket.emit('topics.isTagAllowed', { tag: event.item, cid: cid || 0 }, function (err, allowed) {
+ if (err) {
+ return alerts.error(err);
+ }
+ if (!allowed) {
+ skipRemoveCheck = true;
+ return tagEl.tagsinput('remove', event.item);
+ }
+ $(window).trigger('action:tag.added', { cid: cid, tagEl: tagEl, tag: event.item });
+ if (input.length) {
+ input.autocomplete('close');
+ }
+ });
+ });
+ });
+
+ input.attr('tabIndex', tagEl.attr('tabIndex'));
+ input.on('blur', function () {
+ triggerEnter(input);
+ });
+
+ $('[component="composer/tag/dropdown"]').on('click', 'li', function () {
+ var tag = $(this).attr('data-tag');
+ if (tag) {
+ addTags([tag], tagEl);
+ }
+ return false;
+ });
+ };
+
+ tags.isEnoughTags = function (post_uuid) {
+ return tags.getTags(post_uuid).length >= minTags;
+ };
+
+ tags.minTagCount = function () {
+ return minTags;
+ };
+
+ tags.onChangeCategory = function (postContainer, postData, cid, categoryData) {
+ var tagDropdown = postContainer.find('[component="composer/tag/dropdown"]');
+ if (!tagDropdown.length) {
+ return;
+ }
+
+ toggleTagInput(postContainer, postData, categoryData);
+ tagDropdown.toggleClass('hidden', !categoryData.tagWhitelist || !categoryData.tagWhitelist.length);
+ if (categoryData.tagWhitelist) {
+ app.parseAndTranslate('composer', 'tagWhitelist', { tagWhitelist: categoryData.tagWhitelist }, function (html) {
+ tagDropdown.find('.dropdown-menu').html(html);
+ });
+ }
+ };
+
+ function toggleTagInput(postContainer, postData, data) {
+ var tagEl = postContainer.find('.tags');
+ var input = postContainer.find('.bootstrap-tagsinput input');
+ if (!input.length) {
+ return;
+ }
+
+ if (data.hasOwnProperty('minTags')) {
+ minTags = data.minTags;
+ }
+ if (data.hasOwnProperty('maxTags')) {
+ maxTags = data.maxTags;
+ }
+
+ if (data.tagWhitelist && data.tagWhitelist.length) {
+ input.attr('readonly', '');
+ input.attr('placeholder', '');
+
+ tagEl.tagsinput('items').slice().forEach(function (tag) {
+ if (data.tagWhitelist.indexOf(tag) === -1) {
+ tagEl.tagsinput('remove', tag);
+ }
+ });
+ } else {
+ input.removeAttr('readonly');
+ input.attr('placeholder', postContainer.find('input.tags').attr('placeholder'));
+ }
+ postContainer.find('.tags-container').toggleClass('haswhitelist', !!(data.tagWhitelist && data.tagWhitelist.length));
+ postContainer.find('.tags-container').toggleClass('hidden', (
+ data.privileges && data.privileges.hasOwnProperty('topics:tag') && !data.privileges['topics:tag']) ||
+ (maxTags === 0 && !postData && !postData.tags && !postData.tags.length));
+
+ if (data.privileges && data.privileges.hasOwnProperty('topics:tag') && !data.privileges['topics:tag']) {
+ tagEl.tagsinput('removeAll');
+ }
+
+ $(window).trigger('action:tag.toggleInput', {
+ postContainer: postContainer,
+ tagWhitelist: data.tagWhitelist,
+ tagsInput: input,
+ });
+ }
+
+ function triggerEnter(input) {
+ // http://stackoverflow.com/a/3276819/583363
+ var e = jQuery.Event('keypress');
+ e.which = 13;
+ e.keyCode = 13;
+ setTimeout(function () {
+ input.trigger(e);
+ }, 100);
+ }
+
+ function addTags(tags, tagEl) {
+ if (tags && tags.length) {
+ for (var i = 0; i < tags.length; ++i) {
+ tagEl.tagsinput('add', tags[i]);
+ }
+ }
+ }
+
+ tags.getTags = function (post_uuid) {
+ return $('.composer[data-uuid="' + post_uuid + '"] .tags').tagsinput('items');
+ };
+
+ return tags;
+});
diff --git a/node_modules/nodebb-plugin-composer-default/static/lib/composer/uploads.js b/node_modules/nodebb-plugin-composer-default/static/lib/composer/uploads.js
new file mode 100644
index 0000000000..6da01db605
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/lib/composer/uploads.js
@@ -0,0 +1,271 @@
+'use strict';
+
+define('composer/uploads', [
+ 'composer/preview',
+ 'composer/categoryList',
+ 'translator',
+ 'alerts',
+ 'uploadHelpers',
+ 'jquery-form',
+], function (preview, categoryList, translator, alerts, uploadHelpers) {
+ var uploads = {
+ inProgress: {},
+ };
+
+ var uploadingText = '';
+
+ uploads.initialize = function (post_uuid) {
+ initializeDragAndDrop(post_uuid);
+ initializePaste(post_uuid);
+
+ addChangeHandlers(post_uuid);
+ addTopicThumbHandlers(post_uuid);
+ translator.translate('[[modules:composer.uploading, ' + 0 + '%]]', function (translated) {
+ uploadingText = translated;
+ });
+ };
+
+ function addChangeHandlers(post_uuid) {
+ var postContainer = $('.composer[data-uuid="' + post_uuid + '"]');
+
+ postContainer.find('#files').on('change', function (e) {
+ var files = (e.target || {}).files ||
+ ($(this).val() ? [{ name: $(this).val(), type: utils.fileMimeType($(this).val()) }] : null);
+ if (files) {
+ uploadContentFiles({ files: files, post_uuid: post_uuid, route: '/api/post/upload' });
+ }
+ });
+ }
+
+ function addTopicThumbHandlers(post_uuid) {
+ var postContainer = $('.composer[data-uuid="' + post_uuid + '"]');
+
+ postContainer.on('click', '.topic-thumb-clear-btn', function (e) {
+ postContainer.find('input#topic-thumb-url').val('').trigger('change');
+ resetInputFile(postContainer.find('input#topic-thumb-file'));
+ $(this).addClass('hide');
+ e.preventDefault();
+ });
+
+ postContainer.on('paste change keypress', 'input#topic-thumb-url', function () {
+ var urlEl = $(this);
+ setTimeout(function () {
+ var url = urlEl.val();
+ if (url) {
+ postContainer.find('.topic-thumb-clear-btn').removeClass('hide');
+ } else {
+ resetInputFile(postContainer.find('input#topic-thumb-file'));
+ postContainer.find('.topic-thumb-clear-btn').addClass('hide');
+ }
+ postContainer.find('img.topic-thumb-preview').attr('src', url);
+ }, 100);
+ });
+ }
+
+ function resetInputFile($el) {
+ $el.wrap('').closest('form').get(0).reset();
+ $el.unwrap();
+ }
+
+ function initializeDragAndDrop(post_uuid) {
+ var postContainer = $('.composer[data-uuid="' + post_uuid + '"]');
+ uploadHelpers.handleDragDrop({
+ container: postContainer,
+ callback: function (upload) {
+ uploadContentFiles({
+ files: upload.files,
+ post_uuid: post_uuid,
+ route: '/api/post/upload',
+ formData: upload.formData,
+ });
+ },
+ });
+ }
+
+ function initializePaste(post_uuid) {
+ var postContainer = $('.composer[data-uuid="' + post_uuid + '"]');
+ uploadHelpers.handlePaste({
+ container: postContainer,
+ callback: function (upload) {
+ uploadContentFiles({
+ files: upload.files,
+ fileNames: upload.fileNames,
+ post_uuid: post_uuid,
+ route: '/api/post/upload',
+ formData: upload.formData,
+ });
+ },
+ });
+ }
+
+ function escapeRegExp(text) {
+ return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+ }
+
+ function insertText(str, index, insert) {
+ return str.slice(0, index) + insert + str.slice(index);
+ }
+
+ function uploadContentFiles(params) {
+ var files = [...params.files];
+ var post_uuid = params.post_uuid;
+ var postContainer = $('.composer[data-uuid="' + post_uuid + '"]');
+ var textarea = postContainer.find('textarea');
+ var text = textarea.val();
+ var uploadForm = postContainer.find('#fileForm');
+ var doneUploading = false;
+ uploadForm.attr('action', config.relative_path + params.route);
+
+ var cid = categoryList.getSelectedCid();
+ if (!cid && ajaxify.data.cid) {
+ cid = ajaxify.data.cid;
+ }
+ var i = 0;
+ var isImage = false;
+ for (i = 0; i < files.length; ++i) {
+ isImage = files[i].type.match(/image./);
+ if ((isImage && !app.user.privileges['upload:post:image']) || (!isImage && !app.user.privileges['upload:post:file'])) {
+ return alerts.error('[[error:no-privileges]]');
+ }
+ }
+
+ var filenameMapping = [];
+ let filesText = '';
+ for (i = 0; i < files.length; ++i) {
+ // The filename map has datetime and iterator prepended so that they can be properly tracked even if the
+ // filenames are identical.
+ filenameMapping.push(i + '_' + Date.now() + '_' + (params.fileNames ? params.fileNames[i] : files[i].name));
+ isImage = files[i].type.match(/image./);
+
+ if (!app.user.isAdmin && files[i].size > parseInt(config.maximumFileSize, 10) * 1024) {
+ uploadForm[0].reset();
+ return alerts.error('[[error:file-too-big, ' + config.maximumFileSize + ']]');
+ }
+ filesText += (isImage ? '!' : '') + '[' + filenameMapping[i] + '](' + uploadingText + ') ';
+ }
+
+ const cursorPosition = textarea.getCursorPosition();
+ const textLen = text.length;
+ text = insertText(text, cursorPosition, filesText);
+
+ if (uploadForm.length) {
+ postContainer.find('[data-action="post"]').prop('disabled', true);
+ }
+ textarea.val(text);
+
+ $(window).trigger('action:composer.uploadStart', {
+ post_uuid: post_uuid,
+ files: filenameMapping.map(function (filename, i) {
+ return {
+ filename: filename.replace(/^\d+_\d{13}_/, ''),
+ isImage: /image./.test(files[i].type),
+ };
+ }),
+ text: uploadingText,
+ });
+
+ uploadForm.off('submit').submit(function () {
+ function updateTextArea(filename, text, trim) {
+ var newFilename;
+ if (trim) {
+ newFilename = filename.replace(/^\d+_\d{13}_/, '');
+ }
+ var current = textarea.val();
+ var re = new RegExp(escapeRegExp(filename) + ']\\([^)]+\\)', 'g');
+ textarea.val(current.replace(re, (newFilename || filename) + '](' + text + ')'));
+
+ $(window).trigger('action:composer.uploadUpdate', {
+ post_uuid: post_uuid,
+ filename: filename,
+ text: text,
+ });
+ }
+
+ uploads.inProgress[post_uuid] = uploads.inProgress[post_uuid] || [];
+ uploads.inProgress[post_uuid].push(1);
+
+ if (params.formData) {
+ params.formData.append('cid', cid);
+ }
+
+ $(this).ajaxSubmit({
+ headers: {
+ 'x-csrf-token': config.csrf_token,
+ },
+ resetForm: true,
+ clearForm: true,
+ formData: params.formData,
+ data: { cid: cid },
+
+ error: function (xhr) {
+ doneUploading = true;
+ postContainer.find('[data-action="post"]').prop('disabled', false);
+ const errorMsg = onUploadError(xhr, post_uuid);
+ for (var i = 0; i < files.length; ++i) {
+ updateTextArea(filenameMapping[i], errorMsg, true);
+ }
+ preview.render(postContainer);
+ },
+
+ uploadProgress: function (event, position, total, percent) {
+ translator.translate('[[modules:composer.uploading, ' + percent + '%]]', function (translated) {
+ if (doneUploading) {
+ return;
+ }
+ for (var i = 0; i < files.length; ++i) {
+ updateTextArea(filenameMapping[i], translated);
+ }
+ });
+ },
+
+ success: function (res) {
+ const uploads = res.response.images;
+ doneUploading = true;
+ if (uploads && uploads.length) {
+ for (var i = 0; i < uploads.length; ++i) {
+ uploads[i].filename = filenameMapping[i].replace(/^\d+_\d{13}_/, '');
+ uploads[i].isImage = /image./.test(files[i].type);
+ updateTextArea(filenameMapping[i], uploads[i].url, true);
+ }
+ }
+ preview.render(postContainer);
+ textarea.prop('selectionEnd', cursorPosition + textarea.val().length - textLen);
+ textarea.focus();
+ postContainer.find('[data-action="post"]').prop('disabled', false);
+ $(window).trigger('action:composer.upload', {
+ post_uuid: post_uuid,
+ files: uploads,
+ });
+ },
+
+ complete: function () {
+ uploadForm[0].reset();
+ uploads.inProgress[post_uuid].pop();
+ },
+ });
+
+ return false;
+ });
+
+ uploadForm.submit();
+ }
+
+ function onUploadError(xhr, post_uuid) {
+ var msg = (xhr.responseJSON &&
+ (xhr.responseJSON.error || (xhr.responseJSON.status && xhr.responseJSON.status.message))) ||
+ '[[error:parse-error]]';
+
+ if (xhr && xhr.status === 413) {
+ msg = xhr.statusText || 'Request Entity Too Large';
+ }
+ alerts.error(msg);
+ $(window).trigger('action:composer.uploadError', {
+ post_uuid: post_uuid,
+ message: msg,
+ });
+ return msg;
+ }
+
+ return uploads;
+});
+
diff --git a/node_modules/nodebb-plugin-composer-default/static/scss/composer.scss b/node_modules/nodebb-plugin-composer-default/static/scss/composer.scss
new file mode 100644
index 0000000000..e9157dc92d
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/scss/composer.scss
@@ -0,0 +1,385 @@
+.composer {
+ background-color: var(--bs-body-bg);
+ color: var(--bs-body-color);
+ z-index: $zindex-dropdown;
+ visibility: hidden;
+ padding: 0;
+ position: fixed;
+ bottom: 0;
+ top: 0;
+ right: 0;
+ left: 0;
+
+ .mobile-navbar {
+ position: static;
+ min-height: 40px;
+ margin: 0;
+
+ .btn-group {
+ flex-shrink: 0;
+ }
+
+ button {
+ font-size: 20px;
+ }
+
+ display: flex;
+
+ .category-name-container, .title {
+ text-align: center;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ flex-grow: 2;
+ font-size: 16px;
+ line-height: inherit;
+ padding: 9px 5px;
+ margin: 0;
+ }
+ }
+
+ .title-container {
+ > div[data-component="composer/handle"] {
+ flex: 0.33;
+ }
+
+ .category-list-container {
+
+ [component="category-selector"] {
+ .category-dropdown-menu {
+ max-height: 300px;
+ }
+ }
+ }
+
+ .category-list {
+ padding: 0 2rem;
+ }
+
+ .action-bar {
+ .dropdown-menu:empty {
+ & ~ .dropdown-toggle {
+ display: none;
+ }
+ }
+ }
+ }
+
+ .formatting-bar {
+ .spacer {
+ &:before {
+ content: ' | ';
+ color: $gray-200;
+ }
+ }
+ }
+
+ .tags-container {
+ [component="composer/tag/dropdown"] {
+ .dropdown-menu {
+ max-height: 400px;
+ overflow-y: auto;
+ }
+
+ > button {
+ border: 0;
+ }
+ }
+ // if picking tags from taglist dropdown hide the input
+ &.haswhitelist .bootstrap-tagsinput {
+ input {
+ display: none;
+ }
+ }
+ .bootstrap-tagsinput {
+ background: transparent;
+ flex-grow: 1;
+ border: 0;
+ padding: 0;
+ box-shadow: none;
+ max-height: 80px;
+ overflow: auto;
+
+ input {
+ &::placeholder{
+ color: $input-placeholder-color;
+ }
+ color: $body-color;
+ font-size: 16px;
+ width: 50%;
+ @include media-breakpoint-down(md) {
+ width: 100%;
+ }
+
+
+ height: 28px;
+ padding: 4px 6px;
+ }
+
+ .ui-autocomplete {
+ max-height: 350px;
+ overflow-x: hidden;
+ overflow-y: auto;
+ }
+ }
+ }
+
+ .resizer {
+ background: linear-gradient(transparent, var(--bs-body-bg));
+ margin-left: calc($spacer * -0.5);
+ padding-left: $spacer;
+
+ .trigger {
+ cursor: ns-resize;
+
+ .handle {
+ border-top-left-radius: 50%;
+ border-top-right-radius: 50%;
+ border-bottom: 0 !important;
+ }
+ }
+ }
+
+ .minimize {
+ display: none;
+ position: absolute;
+ top: 0px;
+ right: 10px;
+ height: 0;
+
+ @include pointer;
+
+ .trigger {
+ position: relative;
+ display: block;
+ top: -20px;
+ right: 0px;
+ margin: 0 auto;
+ margin-left: 20px;
+ line-height: 26px;
+ @include transition(filter .15s linear);
+
+ &:hover {
+ filter: invert(100%);
+ }
+
+ i {
+ width: 32px;
+ height: 32px;
+ background: #333;
+ border: 1px solid #333;
+ border-radius: 50%;
+
+ position: relative;
+
+ color: #FFF;
+ font-size: 16px;
+
+ &:before {
+ position: relative;
+ top: 25%;
+ }
+ }
+ }
+ }
+
+ &.reply {
+ .title-container {
+ display: none;
+ }
+ }
+
+ &.resizable.maximized {
+ .resizer {
+ top: 0 !important;
+ background: transparent;
+
+ .trigger {
+ height: $spacer * 0.5;
+
+ .handle {
+ border-top-left-radius: 0%;
+ border-top-right-radius: 0%;
+ border-bottom-left-radius: 50%;
+ border-bottom-right-radius: 50%;
+ border-bottom: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important;
+ }
+
+ i {
+ &:before {
+ content: fa-content($fa-var-chevron-down);
+ }
+ }
+ }
+ }
+ }
+
+ .draft-icon {
+ font-family: 'FontAwesome';
+ color: $success;
+ opacity: 0;
+
+ &::before {
+ content: fa-content($fa-var-save);
+ }
+
+ &.active {
+ animation: draft-saved 3s ease;
+ }
+ }
+
+ textarea {
+ resize: none;
+ }
+
+ .preview {
+ padding: $input-padding-y $input-padding-x;
+ }
+}
+
+.datetime-picker {
+ display: flex;
+ justify-content: center;
+ flex-direction: row;
+ min-width: 310px;
+ max-width: 310px;
+ margin: 0 auto;
+
+ input {
+ flex: 3;
+ line-height: inherit;
+ }
+
+ input + input {
+ border-left: none;
+ flex: 2;
+ }
+}
+
+.modal.topic-scheduler {
+ z-index: 1070;
+ & + .modal-backdrop {
+ z-index: 1060;
+ }
+}
+
+@keyframes draft-saved {
+ 0%, 100% {
+ opacity: 0;
+ }
+
+ 15% {
+ opacity: 1;
+ }
+
+ 30% {
+ opacity: 0.5;
+ }
+
+ 45% {
+ opacity: 1;
+ }
+
+ 85% {
+ opacity: 1;
+ }
+}
+
+@keyframes pulse {
+ from {
+ transform: scale(1);
+ color: inherit;
+ }
+ 50% {
+ transform: scale(.9);
+ }
+ to {
+ transform: scale(1);
+ color: #00adff;
+ }
+}
+
+@include media-breakpoint-down(lg) {
+ html.composing .composer { z-index: $zindex-modal; }
+}
+
+@include media-breakpoint-down(sm) {
+ html.composing {
+ .composer {
+ height: 100%;
+
+ .draft-icon {
+ position: absolute;
+ bottom: 1em;
+ right: 0em;
+
+ &::after {
+ top: 7px;
+ }
+ }
+
+ .preview-container {
+ max-width: initial;
+ }
+ }
+
+ body {
+ padding-bottom: 0 !important;
+ }
+ }
+}
+
+@include media-breakpoint-up(lg) {
+ html.composing {
+ .composer {
+ left: 15%;
+ width: 70%;
+ min-height: 400px;
+
+ .resizer {
+ display: block;
+ }
+
+ .minimize {
+ display: block;
+ }
+ }
+ }
+}
+
+@include media-breakpoint-up(md) {
+ // without this formatting elements that are dropdowns are not visible on desktop.
+ // on mobile dropdowns use bottom-sheet and overflow is auto
+ .formatting-group {
+ overflow: visible!important;
+ }
+}
+
+@import './zen-mode';
+@import './page-compose';
+@import './textcomplete';
+
+
+.skin-noskin, .skin-cosmo, .skin-flatly,
+.skin-journal, .skin-litera, .skin-minty, .skin-pulse,
+.skin-sandstone, .skin-sketchy, .skin-spacelab, .skin-united {
+ .composer {
+ color: var(--bs-secondary) !important;
+ background-color: var(--bs-light) !important;
+ }
+}
+
+.skin-cerulean, .skin-lumen, .skin-lux, .skin-morph,
+.skin-simplex, .skin-yeti, .skin-zephyr {
+ .composer {
+ color: var(--bs-body) !important;
+ background-color: var(--bs-light) !important;
+ }
+}
+
+@include color-mode(dark) {
+ .skin-noskin .composer {
+ color: var(--bs-secondary)!important;
+ background-color: var(--bs-body-bg)!important;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/static/scss/page-compose.scss b/node_modules/nodebb-plugin-composer-default/static/scss/page-compose.scss
new file mode 100644
index 0000000000..2b2756f426
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/scss/page-compose.scss
@@ -0,0 +1,35 @@
+.page-compose .composer {
+ z-index: initial;
+ position: static;
+ [data-action="hide"] {
+ display: none;
+ }
+
+ @include media-breakpoint-down(md) {
+ .title-container {
+ flex-wrap: wrap;
+ }
+ .category-list-container {
+ [component="category-selector-selected"] > span {
+ display: inline!important;
+ }
+ width: 100%;
+ }
+ }
+}
+
+.zen-mode .page-compose .composer {
+ position: absolute;
+}
+.page-compose {
+ &.skin-noskin, &.skin-cosmo, &.skin-flatly,
+ &.skin-journal, &.skin-litera, &.skin-minty, &.skin-pulse,
+ &.skin-sandstone, &.skin-sketchy, &.skin-spacelab, &.skin-united,
+ &.skin-cerulean, &.skin-lumen, &.skin-lux, &.skin-morph,
+ &.skin-simplex, &.skin-yeti, &.skin-zephyr {
+ .composer {
+ color: var(--bs-body-color) !important;
+ background-color: var(--bs-body-bg) !important;
+ }
+ }
+}
diff --git a/node_modules/nodebb-plugin-composer-default/static/scss/textcomplete.scss b/node_modules/nodebb-plugin-composer-default/static/scss/textcomplete.scss
new file mode 100644
index 0000000000..7a4cad943a
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/scss/textcomplete.scss
@@ -0,0 +1,26 @@
+.textcomplete-dropdown {
+ border: 1px solid $border-color;
+ background-color: $body-bg;
+ color: $body-color;
+ list-style: none;
+ padding: 0;
+ margin: 0;
+
+ li {
+ margin: 0;
+ }
+
+ .textcomplete-footer, .textcomplete-item {
+ border-top: 1px solid $border-color;
+ }
+
+ .textcomplete-item {
+ padding: 2px 5px;
+ cursor: pointer;
+
+ &:hover, &.active {
+ color: $dropdown-link-hover-color;
+ background-color: $dropdown-link-hover-bg;
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/static/scss/zen-mode.scss b/node_modules/nodebb-plugin-composer-default/static/scss/zen-mode.scss
new file mode 100644
index 0000000000..b29340e8d3
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/scss/zen-mode.scss
@@ -0,0 +1,51 @@
+html.zen-mode {
+ overflow: hidden;
+}
+
+.zen-mode .composer {
+ &.resizable {
+ padding-top: 0;
+ }
+
+ .composer-container {
+ padding-top: 5px;
+ }
+
+ .tag-row {
+ display: none;
+ }
+
+ .title-container .category-list-container {
+ margin-top: 3px;
+ }
+
+ .write, .preview {
+ border: none;
+ outline: none;
+ }
+
+ .resizer {
+ display: none;
+ }
+
+ &.reply {
+ .title-container {
+ display: none;
+ }
+ }
+
+ @include media-breakpoint-up(md) {
+ & {
+ padding-left: 15px;
+ padding-right: 15px;
+ }
+ .write-preview-container {
+ margin-bottom: 0;
+
+ > div {
+ padding: 0;
+ margin: 0;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/static/templates/admin/plugins/composer-default.tpl b/node_modules/nodebb-plugin-composer-default/static/templates/admin/plugins/composer-default.tpl
new file mode 100644
index 0000000000..a7fa31ce59
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/templates/admin/plugins/composer-default.tpl
@@ -0,0 +1,22 @@
+
+
diff --git a/node_modules/nodebb-plugin-composer-default/static/templates/compose.tpl b/node_modules/nodebb-plugin-composer-default/static/templates/compose.tpl
new file mode 100644
index 0000000000..9fb4300baf
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/templates/compose.tpl
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+ {{{ if isTopicOrMain }}}
+
+ {{{ end }}}
+
+
diff --git a/node_modules/nodebb-plugin-composer-default/static/templates/composer.tpl b/node_modules/nodebb-plugin-composer-default/static/templates/composer.tpl
new file mode 100644
index 0000000000..cc8baf7ca0
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/templates/composer.tpl
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+ {{{ if isTopic }}}
+
+
+
+ {{{ end }}}
+ {{{ if !isTopicOrMain }}}
+ {{{ if isEditing }}}[[topic:composer.editing-in, "{topicTitle}"]]{{{ else }}}[[topic:composer.replying-to, "{topicTitle}"]]{{{ end }}}
+ {{{ end }}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Thanks!
+ Makes sense.
+ Sounds good!
+ Could you explain further?
+
+
+
+
+ {{{ if isTopicOrMain }}}
+
+ {{{ end }}}
+
+
[[topic:composer.drag-and-drop-images]]
+
+
+
+
+
diff --git a/node_modules/nodebb-plugin-composer-default/static/templates/modals/topic-scheduler.tpl b/node_modules/nodebb-plugin-composer-default/static/templates/modals/topic-scheduler.tpl
new file mode 100644
index 0000000000..29736747c6
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/templates/modals/topic-scheduler.tpl
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-formatting.tpl b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-formatting.tpl
new file mode 100644
index 0000000000..941f06f2e4
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-formatting.tpl
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ [[modules:composer.show-preview]]
+ [[modules:composer.hide-preview]]
+
+ {{{ if composer:showHelpTab }}}
+
+
+ [[modules:composer.help]]
+
+ {{{ end }}}
+
+
+
diff --git a/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-tags.tpl b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-tags.tpl
new file mode 100644
index 0000000000..e247403419
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-tags.tpl
@@ -0,0 +1,17 @@
+
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl
new file mode 100644
index 0000000000..e7c6232460
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl
@@ -0,0 +1,67 @@
+
+ {{{ if isTopic }}}
+
+
+
+ {{{ end }}}
+
+ {{{ if showHandleInput }}}
+
+
+
+ {{{ end }}}
+
+
+ {{{ if isTopicOrMain }}}
+
+ {{{ else }}}
+ {{{ if isEditing }}}[[topic:composer.editing-in, "{topicTitle}"]]{{{ else }}}[[topic:composer.replying-to, "{topicTitle}"]]{{{ end }}}
+ {{{ end }}}
+
+
+
+
+
+
+
+
+
[[topic:composer.hide]]
+
[[topic:composer.discard]]
+
+
+
[[topic:composer.submit]]
+
+
+
+ [[topic:composer.additional-options]]
+
+
+
+
+
+
diff --git a/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-write-preview.tpl b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-write-preview.tpl
new file mode 100644
index 0000000000..37cefbd220
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-write-preview.tpl
@@ -0,0 +1,10 @@
+
+
+
[[modules:composer.post-queue-alert]]
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-plugin-composer-default/websockets.js b/node_modules/nodebb-plugin-composer-default/websockets.js
new file mode 100644
index 0000000000..882dbb2b0d
--- /dev/null
+++ b/node_modules/nodebb-plugin-composer-default/websockets.js
@@ -0,0 +1,94 @@
+'use strict';
+
+const meta = require.main.require('./src/meta');
+const privileges = require.main.require('./src/privileges');
+const posts = require.main.require('./src/posts');
+const topics = require.main.require('./src/topics');
+const plugins = require.main.require('./src/plugins');
+
+const Sockets = module.exports;
+
+Sockets.push = async function (socket, pid) {
+ const canRead = await privileges.posts.can('topics:read', pid, socket.uid);
+ if (!canRead) {
+ throw new Error('[[error:no-privileges]]');
+ }
+
+ const postData = await posts.getPostFields(pid, ['content', 'tid', 'uid', 'handle', 'timestamp']);
+ if (!postData && !postData.content) {
+ throw new Error('[[error:invalid-pid]]');
+ }
+
+ const [topic, tags, isMain] = await Promise.all([
+ topics.getTopicDataByPid(pid),
+ topics.getTopicTags(postData.tid),
+ posts.isMain(pid),
+ ]);
+
+ if (!topic) {
+ throw new Error('[[error:no-topic]]');
+ }
+
+ const result = await plugins.hooks.fire('filter:composer.push', {
+ pid: pid,
+ uid: postData.uid,
+ handle: parseInt(meta.config.allowGuestHandles, 10) ? postData.handle : undefined,
+ body: postData.content,
+ title: topic.title,
+ thumb: topic.thumb,
+ tags: tags,
+ isMain: isMain,
+ timestamp: postData.timestamp,
+ });
+ return result;
+};
+
+Sockets.editCheck = async function (socket, pid) {
+ const isMain = await posts.isMain(pid);
+ return { titleEditable: isMain };
+};
+
+Sockets.renderPreview = async function (socket, content) {
+ return await plugins.hooks.fire('filter:parse.raw', content);
+};
+
+Sockets.renderHelp = async function () {
+ const helpText = meta.config['composer:customHelpText'] || '';
+ if (!meta.config['composer:showHelpTab']) {
+ throw new Error('help-hidden');
+ }
+
+ const parsed = await plugins.hooks.fire('filter:parse.raw', helpText);
+ if (meta.config['composer:allowPluginHelp'] && plugins.hooks.hasListeners('filter:composer.help')) {
+ return await plugins.hooks.fire('filter:composer.help', parsed) || helpText;
+ }
+ return helpText;
+};
+
+Sockets.getFormattingOptions = async function () {
+ return await require('./library').getFormattingOptions();
+};
+
+Sockets.shouldQueue = async function (socket, data) {
+ if (!data || !data.postData) {
+ throw new Error('[[error:invalid-data]]');
+ }
+ if (socket.uid <= 0) {
+ return false;
+ }
+
+ let shouldQueue = false;
+ const { postData } = data;
+ if (postData.action === 'posts.reply') {
+ shouldQueue = await posts.shouldQueue(socket.uid, {
+ tid: postData.tid,
+ content: postData.content || '',
+ });
+ } else if (postData.action === 'topics.post') {
+ shouldQueue = await posts.shouldQueue(socket.uid, {
+ cid: postData.cid,
+ content: postData.content || '',
+ });
+ }
+ return shouldQueue;
+};
diff --git a/node_modules/nodebb-theme-persona/.eslintrc b/node_modules/nodebb-theme-persona/.eslintrc
new file mode 100644
index 0000000000..cbdeb84dea
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/.eslintrc
@@ -0,0 +1,3 @@
+{
+ "extends": "nodebb/lib"
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/README.md b/node_modules/nodebb-theme-persona/README.md
new file mode 100644
index 0000000000..071064aef2
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/README.md
@@ -0,0 +1,20 @@
+Persona theme for NodeBB
+====================
+
+The Persona theme is the default theme for NodeBB for versions spanning v0.7.1 through to v2.x
+
+For the v3.x release line, Persona will be a supported theme bundled with NodeBB, but will not be active by default.
+
+## Issues
+
+Issues are now tracked in [the main project issue tracker](https://github.com/NodeBB/NodeBB/issues?q=is%3Aopen+is%3Aissue+label%3Athemes).
+
+## Addons
+
+[Recent Cards](https://github.com/psychobunny/nodebb-plugin-recent-cards)
+
+## Screenshots
+
+![](https://d2gn4xht817m0g.cloudfront.net/p/product_screenshots/images/original/000/570/286/570286-db378dfd28256a8fabacc9129b3638dc678ac393.png?1439315393)
+
+![](https://d2gn4xht817m0g.cloudfront.net/p/product_screenshots/images/original/000/570/287/570287-5875c63ce086d361b76d94e5bc7cc88a5fd34b8b.png?1439315419)
diff --git a/node_modules/nodebb-theme-persona/languages/persona.json b/node_modules/nodebb-theme-persona/languages/persona.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/languages/persona.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/lib/controllers.js b/node_modules/nodebb-theme-persona/lib/controllers.js
new file mode 100644
index 0000000000..0a0e90787a
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/lib/controllers.js
@@ -0,0 +1,24 @@
+'use strict';
+
+const accountHelpers = require.main.require('./src/controllers/accounts/helpers');
+const helpers = require.main.require('./src/controllers/helpers');
+
+const Controllers = module.exports;
+
+Controllers.renderAdminPage = (req, res) => {
+ res.render('admin/plugins/persona', {
+ title: 'Persona Theme',
+ });
+};
+
+Controllers.renderThemeSettings = async (req, res, next) => {
+ const userData = await accountHelpers.getUserDataByUserSlug(req.params.userslug, req.uid, req.query);
+ if (!userData) {
+ return next();
+ }
+
+ userData.title = '[[themes/persona:settings.title]]';
+ userData.breadcrumbs = helpers.buildBreadcrumbs([{ text: userData.username, url: `/user/${userData.userslug}` }, { text: '[[themes/persona:settings.title]]' }]);
+
+ res.render('account/theme', userData);
+};
diff --git a/node_modules/nodebb-theme-persona/library.js b/node_modules/nodebb-theme-persona/library.js
new file mode 100644
index 0000000000..acbc377b47
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/library.js
@@ -0,0 +1,97 @@
+'use strict';
+
+const meta = require.main.require('./src/meta');
+
+const controllers = require('./lib/controllers');
+
+const library = module.exports;
+
+library.init = async function (params) {
+ const { router, middleware } = params;
+ const routeHelpers = require.main.require('./src/routes/helpers');
+ routeHelpers.setupAdminPageRoute(router, '/admin/plugins/persona', [], controllers.renderAdminPage);
+
+ routeHelpers.setupPageRoute(router, '/user/:userslug/theme', [
+ middleware.exposeUid,
+ middleware.ensureLoggedIn,
+ middleware.canViewUsers,
+ middleware.checkAccountPermissions,
+ ], controllers.renderThemeSettings);
+};
+
+library.addAdminNavigation = async function (header) {
+ header.plugins.push({
+ route: '/plugins/persona',
+ icon: 'fa-paint-brush',
+ name: 'Persona Theme',
+ });
+ return header;
+};
+
+library.addProfileItem = async (data) => {
+ data.links.push({
+ id: 'theme',
+ route: 'theme',
+ icon: 'fa-paint-brush',
+ name: '[[themes/persona:settings.title]]',
+ visibility: {
+ self: true,
+ other: false,
+ moderator: false,
+ globalMod: false,
+ admin: false,
+ },
+ });
+
+ return data;
+};
+
+library.defineWidgetAreas = async function (areas) {
+ const locations = ['header', 'sidebar', 'footer'];
+ const templates = [
+ 'categories.tpl', 'category.tpl', 'topic.tpl', 'users.tpl',
+ 'unread.tpl', 'recent.tpl', 'popular.tpl', 'top.tpl', 'tags.tpl', 'tag.tpl',
+ 'login.tpl', 'register.tpl',
+ ];
+ function capitalizeFirst(str) {
+ return str.charAt(0).toUpperCase() + str.slice(1);
+ }
+ templates.forEach((template) => {
+ locations.forEach((location) => {
+ areas.push({
+ name: `${capitalizeFirst(template.split('.')[0])} ${capitalizeFirst(location)}`,
+ template: template,
+ location: location,
+ });
+ });
+ });
+
+ areas = areas.concat([
+ {
+ name: 'Main post header',
+ template: 'topic.tpl',
+ location: 'mainpost-header',
+ },
+ {
+ name: 'Main post footer',
+ template: 'topic.tpl',
+ location: 'mainpost-footer',
+ },
+ {
+ name: 'Account Header',
+ template: 'account/profile.tpl',
+ location: 'header',
+ },
+ ]);
+ return areas;
+};
+
+library.getThemeConfig = async function (config) {
+ const settings = await meta.settings.get('persona');
+ config.hideSubCategories = settings.hideSubCategories === 'on';
+ config.hideCategoryLastPost = settings.hideCategoryLastPost === 'on';
+ config.enableQuickReply = settings.enableQuickReply === 'on';
+ return config;
+};
+
+
diff --git a/node_modules/nodebb-theme-persona/package.json b/node_modules/nodebb-theme-persona/package.json
new file mode 100644
index 0000000000..42cce8a817
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "nodebb-theme-persona",
+ "version": "13.3.25",
+ "nbbpm": {
+ "compatibility": "^3.7.0"
+ },
+ "description": "Persona theme for NodeBB",
+ "main": "library.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/NodeBB/nodebb-theme-persona"
+ },
+ "scripts": {
+ "lint": "eslint ."
+ },
+ "keywords": [
+ "nodebb",
+ "theme",
+ "forum",
+ "bootstrap",
+ "responsive"
+ ],
+ "contributors": [
+ {
+ "name": "Andrew Rodrigues",
+ "email": "andrew@nodebb.org",
+ "url": "https://github.com/psychobunny"
+ },
+ {
+ "name": "Julian Lam",
+ "email": "julian@nodebb.org",
+ "url": "https://github.com/julianlam"
+ },
+ {
+ "name": "Barış Soner Uşaklı",
+ "email": "baris@nodebb.org",
+ "url": "https://github.com/barisusakli"
+ }
+ ],
+ "license": "BSD-2-Clause",
+ "bugs": {
+ "url": "https://github.com/NodeBB/nodebb-theme-persona/issues"
+ },
+ "dependencies": {
+ "pulling": "^2.0.0"
+ },
+ "devDependencies": {
+ "eslint": "^7.32.0",
+ "eslint-config-nodebb": "^0.0.2",
+ "eslint-plugin-import": "^2.24.2"
+ }
+}
diff --git a/node_modules/nodebb-theme-persona/plugin.json b/node_modules/nodebb-theme-persona/plugin.json
new file mode 100644
index 0000000000..e4b63c4789
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/plugin.json
@@ -0,0 +1,21 @@
+{
+ "id": "nodebb-theme-persona",
+ "hooks": [
+ { "hook": "filter:widgets.getAreas", "method": "defineWidgetAreas" },
+ { "hook": "filter:config.get", "method": "getThemeConfig" },
+ { "hook": "static:app.load", "method": "init" },
+ { "hook": "filter:admin.header.build", "method": "addAdminNavigation" },
+ { "hook": "filter:user.profileMenu", "method": "addProfileItem" }
+ ],
+ "scripts": [
+ "public/modules/autohidingnavbar.js",
+ "public/persona.js"
+ ],
+ "modules": {
+ "../admin/plugins/persona.js": "public/admin.js",
+ "persona/taskbar.js": "public/modules/taskbar.js",
+ "persona/mobile-menu.js": "public/modules/mobile-menu.js",
+ "../client/account/theme.js": "public/settings.js"
+ },
+ "languages": "languages"
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/public/.eslintrc b/node_modules/nodebb-theme-persona/public/.eslintrc
new file mode 100644
index 0000000000..bf4af75c76
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/public/.eslintrc
@@ -0,0 +1,3 @@
+{
+ "extends": "nodebb/public"
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/public/admin.js b/node_modules/nodebb-theme-persona/public/admin.js
new file mode 100644
index 0000000000..0a9aa8a663
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/public/admin.js
@@ -0,0 +1,15 @@
+'use strict';
+
+define('admin/plugins/persona', ['settings'], function (Settings) {
+ var ACP = {};
+
+ ACP.init = function () {
+ Settings.load('persona', $('.persona-settings'));
+
+ $('#save').on('click', function () {
+ Settings.save('persona', $('.persona-settings'));
+ });
+ };
+
+ return ACP;
+});
diff --git a/node_modules/nodebb-theme-persona/public/modules/autohidingnavbar.js b/node_modules/nodebb-theme-persona/public/modules/autohidingnavbar.js
new file mode 100644
index 0000000000..eeeec76165
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/public/modules/autohidingnavbar.js
@@ -0,0 +1,221 @@
+/*
+ * Bootstrap Auto-Hiding Navbar - v4.0.0
+ * An extension for Bootstrap's fixed navbar which hides the navbar while the page is scrolling downwards and shows it the other way. The plugin is able to show/hide the navbar programmatically as well.
+ * http://www.virtuosoft.eu/code/bootstrap-autohidingnavbar/
+ *
+ * Made by István Ujj-Mészáros
+ * Under Apache License v2.0 License
+ */
+;(function($, window, document, undefined) {
+ var pluginName = 'autoHidingNavbar',
+ $window = $(window),
+ $document = $(document),
+ _scrollThrottleTimer = null,
+ _resizeThrottleTimer = null,
+ _throttleDelay = 70,
+ _lastScrollHandlerRun = 0,
+ _previousScrollTop = null,
+ _windowHeight = $window.height(),
+ _visible = true,
+ _hideOffset,
+ defaults = {
+ disableAutohide: false,
+ showOnUpscroll: true,
+ showOnBottom: true,
+ hideOffset: 'auto', // "auto" means the navbar height
+ animationDuration: 200,
+ navbarOffset: 0
+ };
+
+ function AutoHidingNavbar(element, options) {
+ this.element = $(element);
+ this.settings = $.extend({}, defaults, options);
+ this._defaults = defaults;
+ this._name = pluginName;
+ this.init();
+ }
+
+ function hide(autoHidingNavbar) {
+ if (!_visible) {
+ return;
+ }
+
+ autoHidingNavbar.element.addClass('navbar-hidden').animate({
+ top: -1 * parseInt(autoHidingNavbar.element.css('height'), 10) + autoHidingNavbar.settings.navbarOffset
+ }, {
+ queue: false,
+ duration: autoHidingNavbar.settings.animationDuration
+ });
+
+ try {
+ $('.dropdown.open .dropdown-toggle, .dropdown.show .dropdown-toggle', autoHidingNavbar.element).dropdown('toggle');
+ }
+ catch(e) {}
+
+ _visible = false;
+
+ autoHidingNavbar.element.trigger('hide.autoHidingNavbar');
+ }
+
+ function show(autoHidingNavbar) {
+ if (_visible) {
+ return;
+ }
+
+ autoHidingNavbar.element.removeClass('navbar-hidden').animate({
+ top: 0
+ }, {
+ queue: false,
+ duration: autoHidingNavbar.settings.animationDuration
+ });
+ _visible = true;
+
+ autoHidingNavbar.element.trigger('show.autoHidingNavbar');
+ }
+
+ function detectState(autoHidingNavbar) {
+ var scrollTop = $window.scrollTop(),
+ scrollDelta = scrollTop - _previousScrollTop;
+
+ _previousScrollTop = scrollTop;
+
+ if (scrollDelta < 0) {
+ if (_visible) {
+ return;
+ }
+
+ if (autoHidingNavbar.settings.showOnUpscroll || scrollTop <= _hideOffset) {
+ show(autoHidingNavbar);
+ }
+ }
+ else if (scrollDelta > 0) {
+ if (!_visible) {
+ if (autoHidingNavbar.settings.showOnBottom && scrollTop + _windowHeight === $document.height()) {
+ show(autoHidingNavbar);
+ }
+ return;
+ }
+
+ if (scrollTop >= _hideOffset) {
+ hide(autoHidingNavbar);
+ }
+ }
+
+ }
+
+ function scrollHandler(autoHidingNavbar) {
+ if (autoHidingNavbar.settings.disableAutohide) {
+ return;
+ }
+
+ _lastScrollHandlerRun = new Date().getTime();
+
+ detectState(autoHidingNavbar);
+ }
+
+ function bindEvents(autoHidingNavbar) {
+ $document.on('scroll.' + pluginName, function() {
+ if (new Date().getTime() - _lastScrollHandlerRun > _throttleDelay) {
+ scrollHandler(autoHidingNavbar);
+ }
+ else {
+ clearTimeout(_scrollThrottleTimer);
+ _scrollThrottleTimer = setTimeout(function() {
+ scrollHandler(autoHidingNavbar);
+ }, _throttleDelay);
+ }
+ });
+
+ $window.on('resize.' + pluginName, function() {
+ clearTimeout(_resizeThrottleTimer);
+ _resizeThrottleTimer = setTimeout(function() {
+ _windowHeight = $window.height();
+ }, _throttleDelay);
+ });
+ }
+
+ function unbindEvents() {
+ $document.off('.' + pluginName);
+
+ $window.off('.' + pluginName);
+ }
+
+ AutoHidingNavbar.prototype = {
+ init: function() {
+ this.elements = {
+ navbar: this.element
+ };
+
+ this.setDisableAutohide(this.settings.disableAutohide);
+ this.setShowOnUpscroll(this.settings.showOnUpscroll);
+ this.setShowOnBottom(this.settings.showOnBottom);
+ this.setHideOffset(this.settings.hideOffset);
+ this.setAnimationDuration(this.settings.animationDuration);
+
+ _hideOffset = this.settings.hideOffset === 'auto' ? parseInt(this.element.css('height'), 10) : this.settings.hideOffset;
+ bindEvents(this);
+
+ return this.element;
+ },
+ setDisableAutohide: function(value) {
+ this.settings.disableAutohide = value;
+ return this.element;
+ },
+ setShowOnUpscroll: function(value) {
+ this.settings.showOnUpscroll = value;
+ return this.element;
+ },
+ setShowOnBottom: function(value) {
+ this.settings.showOnBottom = value;
+ return this.element;
+ },
+ setHideOffset: function(value) {
+ this.settings.hideOffset = value;
+ return this.element;
+ },
+ setAnimationDuration: function(value) {
+ this.settings.animationDuration = value;
+ return this.element;
+ },
+ show: function() {
+ show(this);
+ return this.element;
+ },
+ hide: function() {
+ hide(this);
+ return this.element;
+ },
+ destroy: function() {
+ unbindEvents(this);
+ show(this);
+ $.data(this, 'plugin_' + pluginName, null);
+ return this.element;
+ }
+ };
+
+ $.fn[pluginName] = function(options) {
+ var args = arguments;
+
+ if (options === undefined || typeof options === 'object') {
+ return this.each(function() {
+ if (!$.data(this, 'plugin_' + pluginName)) {
+ $.data(this, 'plugin_' + pluginName, new AutoHidingNavbar(this, options));
+ }
+ });
+ } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
+ var returns;
+
+ this.each(function() {
+ var instance = $.data(this, 'plugin_' + pluginName);
+
+ if (instance instanceof AutoHidingNavbar && typeof instance[options] === 'function') {
+ returns = instance[options].apply(instance, Array.prototype.slice.call(args, 1));
+ }
+ });
+
+ return returns !== undefined ? returns : this;
+ }
+
+ };
+
+ })(jQuery, window, document);
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/public/modules/mobile-menu.js b/node_modules/nodebb-theme-persona/public/modules/mobile-menu.js
new file mode 100644
index 0000000000..b435e1683d
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/public/modules/mobile-menu.js
@@ -0,0 +1,190 @@
+'use strict';
+
+define('persona/mobile-menu', [
+ 'pulling/build/pulling-drawer', 'storage', 'alerts', 'search',
+], function (
+ Pulling, Storage, alerts, search
+) {
+ const Menu = {};
+
+ Menu.init = function () {
+ if (!Pulling) {
+ return;
+ }
+
+ // initialization
+ const panelEl = document.getElementById('panel');
+ const menuEl = document.getElementById('menu');
+ const chatsMenuEl = document.getElementById('chats-menu');
+ if (!menuEl || !chatsMenuEl) {
+ return;
+ }
+ const chatMenuVisible = app.user && parseInt(app.user.uid, 10);
+ let swapped = !!Storage.getItem('persona:menus:legacy-layout');
+ const margin = window.innerWidth;
+
+ if (swapped) {
+ $('#mobile-menu').removeClass('float-start');
+ $('#mobile-chats').addClass('float-start');
+ }
+
+ if (document.documentElement.getAttribute('data-dir') === 'rtl') {
+ swapped = !swapped;
+ }
+
+ const navSlideout = Pulling.create({
+ panel: panelEl,
+ menu: menuEl,
+ width: 256,
+ margin: margin,
+ side: swapped ? 'right' : 'left',
+ });
+ $('#menu').removeClass('hidden');
+
+ let chatsSlideout;
+ if (chatMenuVisible) {
+ chatsSlideout = Pulling.create({
+ panel: panelEl,
+ menu: chatsMenuEl,
+ width: 256,
+ margin: margin,
+ side: swapped ? 'left' : 'right',
+ });
+ $('#chats-menu').removeClass('hidden');
+ }
+
+ // all menus
+
+ function closeOnClick() {
+ navSlideout.close();
+ if (chatsSlideout) { chatsSlideout.close(); }
+ }
+
+ function onBeforeOpen() {
+ document.documentElement.classList.add('slideout-open');
+ }
+
+ function onClose() {
+ $('#mobile-menu').blur();
+ document.documentElement.classList.remove('slideout-open');
+ $('#panel').off('click', closeOnClick);
+ }
+
+ $(window).on('resize action:ajaxify.start', function () {
+ navSlideout.close();
+ if (chatsSlideout) {
+ chatsSlideout.close();
+ }
+ });
+
+ navSlideout
+ .ignore('code, code *, .preventSlideout, .preventSlideout *')
+ .on('closed', onClose)
+ .on('beforeopen', onBeforeOpen)
+ .on('opened', function () {
+ $('#panel').one('click', closeOnClick);
+ });
+
+ if (chatMenuVisible) {
+ chatsSlideout
+ .ignore('code, code *, .preventSlideout, .preventSlideout *')
+ .on('closed', onClose)
+ .on('beforeopen', onBeforeOpen)
+ .on('opened', function () {
+ $('#panel').one('click', closeOnClick);
+ });
+ }
+
+ // left slideout navigation menu
+
+ $('#mobile-menu').on('click', function () {
+ navSlideout.enable().toggle();
+ });
+
+ if (chatMenuVisible) {
+ navSlideout.on('beforeopen', function () {
+ chatsSlideout.close();
+ chatsSlideout.disable();
+ }).on('closed', function () {
+ chatsSlideout.enable();
+ });
+ }
+
+ $('#menu [data-section="navigation"] ul').html(
+ $('#main-nav').html() +
+ ($('#logged-out-menu').html() || '')
+ );
+
+ $('#user-control-list').children().clone(true, true).appendTo($('#chats-menu [data-section="profile"] ul'));
+
+ socket.on('event:user_status_change', function (data) {
+ if (parseInt(data.uid, 10) === app.user.uid) {
+ app.updateUserStatus($('#chats-menu [component="user/status"]'), data.status);
+ navSlideout.close();
+ }
+ });
+
+ // right slideout notifications & chats menu
+
+ function loadNotificationsAndChats() {
+ require(['notifications', 'chat'], function (notifications, chat) {
+ const notifList = $('#chats-menu [data-section="notifications"] ul');
+ notifications.loadNotifications(notifList, function () {
+ notifList.find('.deco-none').removeClass('deco-none');
+ chat.loadChatsDropdown($('#chats-menu .chat-list'));
+ });
+ });
+ }
+
+ if (chatMenuVisible) {
+ $('#mobile-chats').removeClass('hidden').on('click', function () {
+ navSlideout.close();
+ chatsSlideout.enable().toggle();
+ });
+ $('#chats-menu').on('click', 'li[data-roomid]', function () {
+ chatsSlideout.close();
+ });
+
+ chatsSlideout
+ .on('opened', loadNotificationsAndChats)
+ .on('beforeopen', function () {
+ navSlideout.close().disable();
+ })
+ .on('closed', function () {
+ navSlideout.enable();
+ });
+ }
+
+ const searchInputEl = $('.navbar .navbar-search input[name="term"]');
+ const searchButton = $('.navbar .navbar-search button[type="button"]');
+ searchButton.off('click').on('click', function () {
+ if (!config.loggedIn && !app.user.privileges['search:content']) {
+ alerts.alert({
+ message: '[[error:search-requires-login]]',
+ timeout: 3000,
+ });
+ ajaxify.go('login');
+ return false;
+ }
+
+ searchButton.addClass('hidden');
+ searchInputEl.removeClass('hidden').focus();
+ return false;
+ });
+ searchInputEl.on('blur', function () {
+ searchInputEl.addClass('hidden');
+ searchButton.removeClass('hidden');
+ });
+ search.enableQuickSearch({
+ searchElements: {
+ inputEl: searchInputEl,
+ resultEl: $('.navbar .navbar-search .quick-search-container'),
+ },
+ searchOptions: {
+ in: config.searchDefaultInQuick,
+ },
+ });
+ };
+
+ return Menu;
+});
diff --git a/node_modules/nodebb-theme-persona/public/modules/taskbar.js b/node_modules/nodebb-theme-persona/public/modules/taskbar.js
new file mode 100644
index 0000000000..f8530e4de0
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/public/modules/taskbar.js
@@ -0,0 +1,65 @@
+'use strict';
+
+define('persona/taskbar', [
+ 'hooks',
+], function (
+ hooks
+) {
+ const Taskbar = {};
+
+ Taskbar.init = function () {
+ hooks.on('filter:taskbar.push', (data) => {
+ data.options.className = 'taskbar-' + data.module;
+ if (data.module === 'composer') {
+ data.options.icon = 'fa-commenting-o';
+ } else if (data.module === 'chat') {
+ if (data.element.length && !data.element.hasClass('active')) {
+ increaseChatCount(data.element);
+ }
+ }
+ });
+ hooks.on('action:taskbar.pushed', (data) => {
+ if (data.module === 'chat') {
+ createChatIcon(data);
+ const elData = data.element.data();
+ if (elData && elData.options && !elData.options.isSelf) {
+ increaseChatCount(data.element);
+ }
+ }
+ });
+
+ socket.on('event:chats.markedAsRead', function (data) {
+ $('#taskbar [data-roomid="' + data.roomId + '"]')
+ .removeClass('new')
+ .attr('data-content', 0);
+ });
+
+ function createChatIcon(data) {
+ $.getJSON(config.relative_path + '/api/user/' + app.user.userslug + '/chats/' + data.options.roomId, function (chatObj) {
+ const el = $('#taskbar [data-uuid="' + data.uuid + '"] a');
+ el.parent('[data-uuid]').attr('data-roomId', data.options.roomId);
+
+ if (chatObj.users.length === 1) {
+ const user = chatObj.users[0];
+ el.find('i').remove();
+
+ if (user.picture) {
+ el.css('background-image', 'url(' + user.picture + ')');
+ el.css('background-size', 'cover');
+ } else {
+ el.css('background-color', user['icon:bgColor'])
+ .text(user['icon:text'])
+ .addClass('avatar');
+ }
+ }
+ });
+ }
+
+ function increaseChatCount(el) {
+ const count = (parseInt($(el).attr('data-content'), 10) || 0) + 1;
+ $(el).attr('data-content', count);
+ }
+ };
+
+ return Taskbar;
+});
diff --git a/node_modules/nodebb-theme-persona/public/persona.js b/node_modules/nodebb-theme-persona/public/persona.js
new file mode 100644
index 0000000000..5e77bcc998
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/public/persona.js
@@ -0,0 +1,257 @@
+'use strict';
+
+$(document).ready(function () {
+ setupNProgress();
+ setupTaskbar();
+ setupEditedByIcon();
+ setupMobileMenu();
+ configureNavbarHiding();
+
+ $(window).on('resize', utils.debounce(configureNavbarHiding, 200));
+ $(window).on('resize', updatePanelOffset);
+
+ function updatePanelOffset() {
+ const header = document.getElementById('header-menu');
+
+ if (!header) {
+ console.warn('[persona/updatePanelOffset] Could not find #header-menu, panel offset unchanged.');
+ return;
+ }
+
+ const rect = header.getBoundingClientRect();
+ const offset = Math.max(0, rect.bottom);
+ document.documentElement.style.setProperty('--panel-offset', `${offset}px`);
+ }
+
+ var lastBSEnv = '';
+ function configureNavbarHiding() {
+ if (!$.fn.autoHidingNavbar) {
+ return;
+ }
+
+ require(['hooks', 'storage'], (hooks, Storage) => {
+ let preference = ['xs', 'sm'];
+
+ try {
+ preference = JSON.parse(Storage.getItem('persona:navbar:autohide')) || preference;
+ } catch (e) {
+ console.warn('[persona/settings] Unable to parse value for navbar autohiding');
+ }
+ var env = utils.findBootstrapEnvironment();
+ // if env didn't change don't destroy and recreate
+ if (env === lastBSEnv) {
+ return;
+ }
+ lastBSEnv = env;
+ var navbarEl = $('[component="navbar"]');
+ navbarEl.autoHidingNavbar('destroy').removeData('plugin_autoHidingNavbar');
+ navbarEl.css('top', '');
+
+ hooks
+ .on('filter:navigator.scroll', (data) => {
+ navbarEl.autoHidingNavbar('setDisableAutohide', true);
+ return data;
+ })
+ .on('action:navigator.scrolled', () => {
+ navbarEl.autoHidingNavbar('setDisableAutohide', false);
+ });
+
+ hooks.fire('filter:persona.configureNavbarHiding', {
+ resizeEnvs: preference,
+ }).then(({ resizeEnvs }) => {
+ if (resizeEnvs.includes(env)) {
+ navbarEl.autoHidingNavbar({
+ showOnBottom: false,
+ });
+ }
+
+ function fixTopCss(topValue) {
+ if (ajaxify.data.template.topic) {
+ $('.topic .topic-header').css({ top: topValue });
+ } else {
+ var topicListHeader = $('.topic-list-header');
+ if (topicListHeader.length) {
+ topicListHeader.css({ top: topValue });
+ }
+ }
+ }
+
+ navbarEl.off('show.autoHidingNavbar')
+ .on('show.autoHidingNavbar', function () {
+ fixTopCss('');
+ });
+
+ navbarEl.off('hide.autoHidingNavbar')
+ .on('hide.autoHidingNavbar', function () {
+ fixTopCss('0px');
+ });
+ });
+ });
+ }
+
+ function setupNProgress() {
+ require(['nprogress'], function (NProgress) {
+ if (typeof NProgress === 'undefined') {
+ return;
+ }
+
+ $(window).on('action:ajaxify.start', function () {
+ NProgress.set(0.7);
+ });
+
+ $(window).on('action:ajaxify.end', function (ev, data) {
+ NProgress.done();
+ setupHoverCards();
+
+ if (data.url && data.url.match('user/')) {
+ setupFavouriteButtonOnProfile();
+ }
+ });
+ });
+ }
+
+ function setupTaskbar() {
+ require(['persona/taskbar'], function (taskbar) {
+ taskbar.init();
+ });
+ }
+
+ function setupEditedByIcon() {
+ function activateEditedTooltips() {
+ $('[data-pid] [component="post/editor"]').each(function () {
+ var el = $(this);
+ var icon;
+
+ if (!el.attr('data-editor')) {
+ return;
+ }
+
+ icon = el.closest('[data-pid]').find('.edit-icon').first();
+ icon.prop('title', el.text()).tooltip().removeClass('hidden');
+ });
+ }
+
+ $(window).on('action:posts.edited', function (ev, data) {
+ var parent = $('[data-pid="' + data.post.pid + '"]');
+ var icon = parent.find('.edit-icon').filter(function (index, el) {
+ return parseInt($(el).closest('[data-pid]').attr('data-pid'), 10) === parseInt(data.post.pid, 10);
+ });
+ var el = parent.find('[component="post/editor"]').first();
+ icon.prop('title', el.text()).tooltip().removeClass('hidden');
+ });
+
+ $(window).on('action:topic.loaded', activateEditedTooltips);
+ $(window).on('action:posts.loaded', activateEditedTooltips);
+ }
+
+ function setupMobileMenu() {
+ require(['persona/mobile-menu'], function (mobileMenu) {
+ mobileMenu.init();
+ });
+ }
+
+ function setupHoverCards() {
+ require(['components'], function (components) {
+ components.get('topic')
+ .on('click', '[component="user/picture"],[component="user/status"]', generateUserCard);
+ });
+
+ $(window).on('action:posts.loading', function (ev, data) {
+ for (var i = 0, ii = data.posts.length; i < ii; i++) {
+ (ajaxify.data.topics || ajaxify.data.posts)[data.posts[i].index] = data.posts[i];
+ }
+ });
+ }
+
+ function generateUserCard(ev) {
+ var avatar = $(this);
+ var uid = avatar.parents('[data-uid]').attr('data-uid');
+ var data = (ajaxify.data.topics || ajaxify.data.posts);
+
+ for (var i = 0, ii = data.length; i < ii; i++) {
+ if (parseInt(data[i].uid, 10) === parseInt(uid, 10)) {
+ data = data[i].user;
+ break;
+ }
+ }
+
+ $('.persona-usercard').remove();
+
+ if (parseInt(data.uid, 10) === 0) {
+ return false;
+ }
+
+ socket.emit('user.isFollowing', { uid: data.uid }, function (err, isFollowing) {
+ if (err) {
+ return err;
+ }
+
+ app.parseAndTranslate('modules/usercard', data, function (html) {
+ var card = $(html);
+ avatar.parents('a').after(card.hide());
+
+ if (parseInt(app.user.uid, 10) === parseInt(data.uid, 10) || !app.user.uid) {
+ card.find('.btn-morph').hide();
+ } else {
+ setupFavouriteMorph(card, data.uid, data.username);
+
+ if (isFollowing) {
+ $('.btn-morph').addClass('heart');
+ } else {
+ $('.btn-morph').addClass('plus');
+ }
+ }
+
+ setupCardRemoval(card);
+ card.fadeIn();
+ });
+ });
+
+ ev.preventDefault();
+ return false;
+ }
+
+ function setupFavouriteButtonOnProfile() {
+ setupFavouriteMorph($('[component="account/cover"]'), ajaxify.data.uid, ajaxify.data.username);
+ }
+
+ function setupCardRemoval(card) {
+ function removeCard(ev) {
+ if ($(ev.target).closest('.persona-usercard').length === 0) {
+ card.fadeOut(function () {
+ card.remove();
+ });
+
+ $(document).off('click', removeCard);
+ }
+ }
+
+ $(document).on('click', removeCard);
+ }
+
+ function setupFavouriteMorph(parent, uid, username) {
+ require(['api', 'alerts'], function (api, alerts) {
+ parent.find('.btn-morph').click(function (ev) {
+ var type = $(this).hasClass('plus') ? 'follow' : 'unfollow';
+ var method = $(this).hasClass('plus') ? 'put' : 'del';
+
+ api[method]('/users/' + uid + '/follow').then(() => {
+ alerts.success('[[global:alert.' + type + ', ' + username + ']]');
+ });
+
+ $(this).toggleClass('plus').toggleClass('heart');
+ $(this).translateAttr('title', type === 'follow' ? '[[global:unfollow]]' : '[[global:follow]]');
+
+ if ($(this).find('b.drop').length === 0) {
+ $(this).prepend(' ');
+ }
+
+ var drop = $(this).find('b.drop').removeClass('animate');
+ var x = ev.pageX - (drop.width() / 2) - $(this).offset().left;
+ var y = ev.pageY - (drop.height() / 2) - $(this).offset().top;
+
+ drop.css({ top: y + 'px', left: x + 'px' }).addClass('animate');
+ });
+ });
+ }
+});
diff --git a/node_modules/nodebb-theme-persona/public/settings.js b/node_modules/nodebb-theme-persona/public/settings.js
new file mode 100644
index 0000000000..5e2359ab58
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/public/settings.js
@@ -0,0 +1,53 @@
+'use strict';
+
+define('forum/account/theme', ['forum/account/header', 'storage', 'settings', 'alerts'], function (header, Storage, settings, alerts) {
+ const Theme = {};
+
+ Theme.init = () => {
+ header.init();
+ Theme.setupForm();
+ };
+
+ Theme.setupForm = () => {
+ const saveEl = document.getElementById('save');
+ const formEl = document.getElementById('theme-settings');
+ const [sidebarSwapped, autohideNavbarEnvs] = [
+ !!Storage.getItem('persona:menus:legacy-layout'),
+ Storage.getItem('persona:navbar:autohide'),
+ ];
+
+ document.getElementById('persona:menus:legacy-layout').checked = sidebarSwapped;
+ try {
+ const parsed = JSON.parse(autohideNavbarEnvs) || ['xs', 'sm'];
+ parsed.forEach((env) => {
+ const optionEl = document.getElementById('persona:navbar:autohide').querySelector(`option[value="${env}"]`);
+ optionEl.selected = true;
+ });
+ } catch (e) {
+ console.warn(e);
+ }
+
+ if (saveEl) {
+ saveEl.addEventListener('click', () => {
+ const themeSettings = settings.helper.serializeForm($(formEl));
+ Object.keys(themeSettings).forEach((key) => {
+ if (key === 'persona:menus:legacy-layout') {
+ if (themeSettings[key] === 'on') {
+ Storage.setItem('persona:menus:legacy-layout', 'true');
+ } else {
+ Storage.removeItem('persona:menus:legacy-layout');
+ }
+
+ return;
+ }
+
+ Storage.setItem(key, themeSettings[key]);
+ });
+
+ alerts.success('[[success:settings-saved]]');
+ });
+ }
+ };
+
+ return Theme;
+});
diff --git a/node_modules/nodebb-theme-persona/screenshot.png b/node_modules/nodebb-theme-persona/screenshot.png
new file mode 100644
index 0000000000..f7904fc18a
Binary files /dev/null and b/node_modules/nodebb-theme-persona/screenshot.png differ
diff --git a/node_modules/nodebb-theme-persona/scss/account.scss b/node_modules/nodebb-theme-persona/scss/account.scss
new file mode 100644
index 0000000000..0d3e749483
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/account.scss
@@ -0,0 +1,336 @@
+.account {
+ .breadcrumb {
+ margin-bottom: 30px;
+ }
+
+ .edit-form {
+ max-width: 300px;
+ margin-left: auto;
+ margin-right: auto;
+ margin-bottom: 50px;
+ }
+
+ > .row {
+ margin-left: auto;
+ margin-right: auto;
+
+ .fullname {
+ text-align: center;
+ font-size: 20px;
+ color: $gray-600;
+ font-weight: 300;
+ margin-bottom: 24px;
+ }
+ }
+
+ .cover {
+ background-size: cover;
+ background-repeat: no-repeat;
+ height: 200px;
+ position: relative;
+ margin-bottom: 1em;
+ background-origin: content-box;
+ width: 100%;
+ top: var(--panel-offset);
+ position: absolute;
+ left: auto;
+ right: 0px;
+
+ .avatar-wrapper {
+ position: absolute;
+ left: 50%;
+ margin-left: -64px;
+ top: 128px;
+ border: 4px solid white;
+ border-radius: 50%;
+
+ .persona-fab.btn-morph {
+ top: 93px;
+ right: 4px;
+ position: absolute;
+ }
+
+ .status {
+ position: absolute;
+ font-size: 23px;
+ top: 17px;
+ right: -3px;
+ }
+
+ .chat, .follow {
+ position: absolute;
+ width: 30px;
+ height: 30px;
+ }
+
+ .chat {
+ left: -1px;
+ bottom: 1px;
+ }
+
+ .follow {
+ right: 1px;
+ bottom: 1px;
+ }
+ }
+
+ &:hover {
+ .controls {
+ opacity: 0.8;
+ }
+ }
+
+ .controls {
+ text-align: center;
+ height: 200px;
+ line-height: 200px;
+ opacity: 0;
+ @include transition(opacity .15s linear);
+ cursor: pointer;
+ pointer-events: none;
+
+ > * {
+ pointer-events: all;
+ }
+
+ .fa {
+ color: white;
+ background-color: #333;
+ opacity: 1;
+ margin: 15px;
+ padding: 5px;
+ }
+ }
+
+ &.active {
+ &:hover {
+ cursor: move;
+ }
+
+ .controls {
+ > * {
+ display: none;
+ }
+ }
+
+ .save {
+ display: inline-block;
+ }
+ }
+
+ &.saving {
+ .save {
+ display: none;
+ }
+
+ .indicator {
+ display: inline-block;
+ }
+ }
+
+ .save, .indicator {
+ display: inline-block;
+ position: absolute;
+ top: 1em;
+ right: 2em;
+ opacity: 1;
+ background-color: $primary;
+ color: $gray-200;
+ padding: 0.5em;
+ font-weight: bold;
+
+ &:hover {
+ cursor: pointer;
+ }
+ }
+
+ .save {
+ display: none;
+ }
+
+ .indicator {
+ display: none;
+ }
+ }
+
+ margin-top: 200px;
+
+ .container {
+ height: 200px;
+ position: relative;
+ pointer-events: none;
+
+ > * {
+ pointer-events: all;
+ }
+ }
+
+ @include media-breakpoint-up(md) {
+ margin-top: 300px;
+
+ .cover, .container {
+ height: 300px;
+
+ .controls {
+ height: 300px;
+ line-height: 300px;
+ }
+
+ .avatar-wrapper {
+ top: 230px;
+ }
+ }
+ }
+
+ .profile {
+ margin-bottom: 40px;
+
+ .fullname {
+ margin-bottom: 12px;
+ font-size: 32px;
+ }
+
+ .username {
+ text-transform: uppercase;
+ text-align: center;
+ margin-top: 0px;
+ font-size: 15px;
+ }
+
+ .aboutme > p {
+ max-width: 75%;
+ margin-left: auto;
+ margin-right: auto;
+ color: $gray-600;
+ }
+
+ .profile-meta {
+ font-size: 10px;
+ text-transform: uppercase;
+ color: #777;
+ margin-top: 25px;
+
+ strong {
+ color: #333;
+ }
+ }
+
+ .account-stats {
+ text-align: center;
+ font-size: 35px;
+ line-height: 25px;
+ margin-top: 25px;
+ margin-bottom: -20px;
+
+ .stat {
+ display: inline-block;
+ min-width: 100px;
+ margin-bottom: 20px;
+ }
+
+ .stat-label {
+ font-size: 12px;
+ text-transform: uppercase;
+ color: $gray-600;
+ }
+ }
+ }
+
+ .show-success {
+ .form-control {
+ border-color: #5cb85c;
+ background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%235cb85c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
+ padding-right: 2.25rem;
+ background-repeat: no-repeat;
+ background-position: center right .625rem;
+ -webkit-background-size: 1.25rem 1.25rem;
+ background-size: 1.25rem 1.25rem;
+ }
+
+ .form-feedback {
+ color: #5cb85c;
+ display: block;
+ margin-top: .25rem;
+ }
+ }
+
+ .show-danger {
+ .form-control {
+ border-color: #d9534f;
+ background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E");
+ padding-right: 2.25rem;
+ background-repeat: no-repeat;
+ background-position: center right .625rem;
+ -webkit-background-size: 1.25rem 1.25rem;
+ background-size: 1.25rem 1.25rem;
+ }
+
+ .form-feedback {
+ color: #d9534f;
+ display: block;
+ margin-top: .25rem;
+ }
+ }
+
+ .categories {
+ [component="categories/category"] {
+ .depth-1 {
+ padding-left: 50px;
+ }
+ .depth-2 {
+ padding-left: 100px;
+ }
+ .depth-3 {
+ padding-left: 150px;
+ }
+ .depth-4 {
+ padding-left: 150px;
+ }
+ }
+ }
+}
+
+
+.btn-group.account-fab {
+ position: absolute;
+ right: 15px;
+ bottom: -26px;
+
+ .open #profile {
+ background-color: lighten($primary, 10%);
+ }
+
+ .persona-fab {
+ color: white;
+ font-size: 20px;
+ }
+}
+
+@include media-breakpoint-down(md) {
+ .account > .row {
+ overflow: hidden;
+ }
+
+ .profile {
+ margin-top: -25px;
+ }
+}
+
+
+.account-picture-block{
+ vertical-align:top;
+
+ .dropdown-toggle {
+ cursor: pointer;
+ }
+}
+
+.user-picture-label {
+ font-size:20px;
+}
+
+
+.account-username{
+ font-size:20px;
+ font-weight:bold;
+}
diff --git a/node_modules/nodebb-theme-persona/scss/categories.scss b/node_modules/nodebb-theme-persona/scss/categories.scss
new file mode 100644
index 0000000000..ee21c42a07
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/categories.scss
@@ -0,0 +1,205 @@
+.categories, .category > ul {
+ list-style-type: none;
+ padding: 0;
+
+ > li {
+
+ padding-bottom: 10px;
+
+ @include media-breakpoint-down(sm) {
+ border-top: 1px solid $gray-200;
+ &:last-child {
+ border-bottom: 1px solid $gray-200;
+ };
+ }
+
+ min-height: 53px;
+
+ .content {
+ padding: 10px 15px;
+
+ img, .user-icon {
+ @include user-icon-style(46px, 2.4rem, 50%);
+ }
+
+ h2 {
+ display: block;
+ word-wrap: break-word;
+ overflow: hidden;
+ font-size: 18px;
+ line-height: 22px;
+ }
+ }
+
+ @media (max-width: 500px) {
+ .teaser {
+ position: absolute;
+ right: 4px;
+ }
+ }
+
+ .mobile-stat {
+ padding-left: 0px;
+ padding-top: 10px;
+ font-size: 16px;
+ }
+
+ .lastpost {
+ border-left: 4px solid #ccc;
+ text-align: left;
+ margin-top: 10px;
+ overflow: hidden;
+ height: 53px;
+ font-size: 12px;
+ line-height: 14px;
+
+ > * {
+ padding-left: 20px;
+ }
+
+ p {
+ margin: 0;
+ .emoji {
+ max-width: 12px;
+ max-height: 12px;
+ }
+ }
+
+ .post-content {
+ overflow: hidden;
+ blockquote {
+ display: none;
+ }
+ }
+
+ .user-icon {
+ display: inline-block;
+ @include user-icon-style(24px, 1.5rem, 50%);
+ }
+ }
+
+ .category-children {
+ .category-children-item {
+ min-width: 180px;
+ margin-right: 10px;
+ margin-bottom: 1px;
+ display: inline-block;
+ }
+ }
+
+ [component="topic/header"] > i[component="topic/pinned"] {
+ color: $danger;
+ }
+ }
+
+ &.ui-sortable > li .content h2 {
+ > [component="topic/pinned"] {
+ &:after {
+ position: absolute;
+ top: 0.5rem;
+ left: calc(62px + 2rem);
+ width: 4rem;
+ height: 3rem;
+ background: rgba(0, 0, 0, 0.5);
+ color: rgba(255, 255, 255, 0.9);
+ font-family: "FontAwesome";
+ content: "\f07d \f255";
+ text-align: center;
+ font-size: 1.5rem;
+ padding-top: 0.66rem;
+ cursor: move;
+ opacity: 0;
+
+ -webkit-transition: opacity 100ms linear;
+ -moz-transition: opacity 100ms linear;
+ -ms-transition: opacity 100ms linear;
+ -o-transition: opacity 100ms linear;
+ transition: opacity 100ms linear;
+ }
+ }
+
+ &:hover {
+ > [component="topic/pinned"] {
+ &:after {
+ opacity: 1;
+ }
+ }
+ }
+ }
+}
+
+
+.category-header {
+ width: 100%;
+ height: 110px;
+ text-align: center;
+ margin: 0;
+ padding-top:25px;
+ @include pointer;
+ margin-bottom: 10px;
+ overflow:hidden;
+
+ &:hover {
+ filter: brightness(115%);
+ -webkit-filter: brightness(115%);
+ }
+
+ .category-box {
+ height:90px;
+
+ .post-preview {
+ padding-left:10px;
+ padding-right:10px;
+ text-align:left;
+ img {
+ width:60px;
+ height:60px;
+ padding-right:5px;
+ }
+
+ p {
+ overflow: hidden;
+ text-overflow:ellipsis;
+ height:60px;
+ }
+ }
+ }
+}
+
+.category-header-image-auto {
+ -webkit-background-size: auto!important;
+ -moz-background-size: auto!important;
+ -o-background-size: auto!important;
+ background-size: auto!important;
+ background-position: 0% 0% !important;
+}
+
+.category-header-image-cover {
+ -webkit-background-size: cover!important;
+ -moz-background-size: cover!important;
+ -o-background-size: cover!important;
+ background-size: cover!important;
+ background-position: center!important;
+}
+
+.category-header-image-contain {
+ -webkit-background-size: contain!important;
+ -moz-background-size: contain!important;
+ -o-background-size: contain!important;
+ background-size: contain!important;
+ background-position: center!important;
+}
+
+
+.stats {
+ font-size: 20px;
+ text-align: center;
+ margin-top: 10px;
+ line-height: 22px;
+
+ small {
+ text-transform: uppercase;
+ font-weight: 300;
+ font-size: 12px;
+ }
+}
diff --git a/node_modules/nodebb-theme-persona/scss/category.scss b/node_modules/nodebb-theme-persona/scss/category.scss
new file mode 100644
index 0000000000..592bed3738
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/category.scss
@@ -0,0 +1,161 @@
+.category {
+
+ .topic-list {
+ overflow: visible;
+ }
+
+ > ul {
+ > li {
+ list-style: none;
+
+ &:not(.unread) {
+ .lastpost {
+ border-color: lighten($gray-600, 20%) !important;
+ }
+
+ h2 a {
+ color: $text-muted;
+ }
+ }
+ .info {
+ margin-left: 62px;
+ font-size: 0.75rem;
+ }
+ &.deleted {
+ -moz-opacity: 0.30;
+ opacity: 0.30;
+ }
+
+ &.scheduled {
+ opacity: 0.7;
+ }
+
+ .select {
+ position: relative;
+ @include pointer;
+
+ &:before {
+ content: "";
+ display: none;
+ }
+
+ .fa-check {
+ padding: 14.5px; /* 14.5*2 + 15 + 2px border = 46px */
+ border-radius: 50%;
+ position: absolute;
+ font-size: 15px;
+ opacity: 0;
+ top: 0px;
+ left: 0px;
+ border: 1px solid transparent;
+ background: $white;
+ width: 100%;
+ height: 100%;
+ padding: 14px;
+
+ &:before {
+ @include pointer;
+ }
+ }
+
+ .avatar {
+ opacity: 1;
+ }
+
+ .fa-check, .avatar {
+ @include transition(.2s ease-in-out all);
+ }
+
+ float: left;
+ }
+
+ .avatar .select {
+ .fa-check {
+ border: 1px solid $success;
+ color: $success;
+ }
+ }
+
+ .avatar .select:hover {
+ .avatar {
+ opacity: 0;
+ }
+
+ .fa-check {
+ border: 1px solid $success;
+ color: $success;
+ opacity: 1;
+ }
+ }
+
+ &.selected {
+ .select .avatar {
+ opacity: 0;
+ }
+
+ .avatar .select {
+ .fa-check {
+ opacity: 1;
+ background-color: $success;
+ border: 1px solid $success;
+ color: $white;
+ @include transition(all .15s ease-in-out);
+ }
+
+ &:hover .fa-check {
+ background-color: $success;
+ border: 1px solid $success;
+ color: $white;
+ }
+ }
+ }
+
+ .lastpost .user-icon {
+ display: inline-block;
+ @include user-icon-style(24px, 1.5rem, 50%);
+ }
+ }
+
+ &:last-child li {
+ border-bottom: 0;
+ }
+ }
+
+ .unread {
+ .title {
+ font-weight: bold;
+ }
+ }
+
+ .subcategory {
+ margin-bottom: 10px;
+ }
+}
+
+.category, .categories, .subcategory {
+ > p {
+ text-transform: uppercase;
+ }
+
+ .description {
+ font-weight: normal;
+ line-height: 1.2;
+ margin-top: 5px;
+ min-height: 25px
+ }
+
+ .title, .description, .category-children {
+ margin-left: 62px;
+ }
+}
+
+.categories-title {
+ text-transform: uppercase;
+ margin: 0 0 10px;
+ font-size: 14px;
+ font-weight: normal;
+ line-height: 1.42857143;
+}
+
+
+
diff --git a/node_modules/nodebb-theme-persona/scss/chats.scss b/node_modules/nodebb-theme-persona/scss/chats.scss
new file mode 100644
index 0000000000..ada1687d90
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/chats.scss
@@ -0,0 +1,14 @@
+body.page-user-chats {
+ $calcHeight: calc(100vh - var(--panel-offset));
+
+ > #panel {
+ height: $calcHeight;
+ > .container {
+ height: 100%;
+ }
+ }
+ #content.container {
+ padding-top: 0 !important;
+ padding-bottom: 0 !important;
+ }
+}
diff --git a/node_modules/nodebb-theme-persona/scss/flags.scss b/node_modules/nodebb-theme-persona/scss/flags.scss
new file mode 100644
index 0000000000..7c682d49a7
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/flags.scss
@@ -0,0 +1,43 @@
+.page-flags {
+ [component="flags/list"] {
+ tr {
+ @include pointer;
+ }
+ }
+
+ #flags-daily-wrapper + .panel-footer {
+ @include pointer;
+ }
+
+ [component="flag/reports"] {
+ blockquote {
+ margin: 0;
+ margin-top: 1rem;
+ overflow-wrap: break-word;
+ }
+ }
+
+ [component="flag/notes"] {
+ .media {
+ padding: 1rem;
+ }
+
+ .media-right {
+ visibility: hidden;
+
+ i {
+ padding: 1rem;
+ }
+ }
+
+ &:hover {
+ .media-right {
+ visibility: visible;
+ }
+ }
+
+ .editing {
+ background-color: $info;
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/footer.scss b/node_modules/nodebb-theme-persona/scss/footer.scss
new file mode 100644
index 0000000000..9e3eae3eca
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/footer.scss
@@ -0,0 +1,17 @@
+.footer {
+ text-align: center;
+ -webkit-transition: opacity 200ms linear;
+ -moz-transition: opacity 200ms linear;
+ -ms-transition: opacity 200ms linear;
+ -o-transition: opacity 200ms linear;
+ transition: opacity 200ms linear;
+
+ .copyright {
+ padding-bottom: 10px;
+ }
+
+ &.ajaxifying {
+ -moz-opacity: 0.00;
+ opacity: 0.00;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/groups.scss b/node_modules/nodebb-theme-persona/scss/groups.scss
new file mode 100644
index 0000000000..1cbf086661
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/groups.scss
@@ -0,0 +1,167 @@
+.groups.details {
+ margin-top: 200px;
+
+ [component="groups/cover"] {
+ background-size: cover;
+ background-repeat: no-repeat;
+ background-origin: content-box;
+
+ min-height: 200px;
+ width: 100%;
+ margin-bottom: 1em;
+ padding-left: 0;
+ padding-right: 0;
+
+ position: absolute;
+ top: var(--panel-offset);
+ right: 0;
+ left: auto;
+
+ &:hover {
+ .controls {
+ opacity: 0.8;
+ }
+ }
+
+ .controls {
+ text-align: center;
+ min-height: 200px;
+ line-height: 200px;
+ opacity: 0;
+ @include transition(opacity .15s linear);
+ cursor: pointer;
+ pointer-events: none;
+
+ > * {
+ pointer-events: all;
+ }
+
+ .fa {
+ color: white;
+ background-color: #333;
+ opacity: 1;
+ margin: 15px;
+ padding: 5px;
+ }
+ }
+
+ &.active {
+ &:hover {
+ cursor: move;
+ }
+
+ .controls {
+ > * {
+ display: none;
+ }
+ }
+
+ .save {
+ display: inline-block;
+ }
+ }
+
+ &.saving {
+ .save {
+ display: none;
+ }
+
+ .indicator {
+ display: inline-block;
+ }
+ }
+
+ .save, .indicator {
+ display: inline-block;
+ position: absolute;
+ top: 1em;
+ right: 2em;
+ opacity: 1;
+ background-color: $primary;
+ color: $gray-200;
+ padding: 0.5em;
+ font-weight: bold;
+
+ &:hover {
+ cursor: pointer;
+ }
+ }
+
+ .save {
+ display: none;
+ }
+
+ .indicator {
+ display: none;
+ }
+ }
+
+ h1 {
+ overflow-wrap: break-word;
+ margin-top: 0;
+ }
+
+ .post-body {
+ .topic-title, p {
+ overflow-y: hidden;
+ display: block;
+ }
+ }
+
+ @include media-breakpoint-up(md) {
+ margin-top: 300px;
+
+ [component="groups/cover"] {
+ min-height: 300px;
+
+ .controls {
+ min-height: 300px;
+ line-height: 300px;
+ }
+ }
+ }
+
+ .panel-title {
+ .label {
+ padding: .2em .3em .1em;
+ }
+ }
+}
+
+.groups.list {
+ [component="groups/summary"] {
+ .list-cover {
+ display: block;
+ background-size: cover;
+ min-height: 125px;
+ background-position: 50% 50%;
+ @include pointer;
+
+ h5 {
+ background-color: rgba(0,0,0,0.5);
+ display: inline-block;
+ padding: 0.25em 0.5em;
+ color: white;
+ font-weight: bold;
+ text-transform: capitalize;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow-x: hidden;
+ max-width: 100%;
+ }
+ }
+
+ .members {
+ padding-left: 0;
+
+ > li {
+ list-style-type: none;
+ display: inline-block;
+ }
+
+ .truncated {
+ vertical-align: bottom;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/header.scss b/node_modules/nodebb-theme-persona/scss/header.scss
new file mode 100644
index 0000000000..7e7d6da59a
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/header.scss
@@ -0,0 +1,361 @@
+.header, .slideout-menu {
+ .notifications.dropdown, .chats.dropdown {
+ .dropdown-menu {
+ padding: 0;
+ }
+ }
+
+ @mixin notification-list() {
+ overflow-x: hidden;
+ overflow-y: auto;
+ max-height: 250px;
+ padding: 0;
+
+ li {
+ display: flex;
+ gap: 1rem;
+ width: 400px;
+ text-align: left;
+ list-style-type: none;
+ padding: .75em 0.5em;
+
+ &.loading-text, &.no-notifs {
+ justify-content: center;
+
+ a {
+ color: inherit;
+ }
+ }
+
+ .notification-chat-content {
+ flex: 1;
+
+ a {
+ white-space: normal;
+ margin: 0;
+ text-overflow: ellipsis;
+
+ .text {
+ margin-left: 40px;
+ margin-right: 60px;
+ display: block;
+ min-height: 32px;
+ }
+ }
+ }
+
+ .notification-chat-controls {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: .5rem;
+
+ .relTime {
+ font-size: 10px;
+ }
+ }
+
+ .mark-read {
+ color: $secondary;
+ .read {
+ display: block;
+ }
+ .unread {
+ display: none;
+ }
+ &:hover {
+ color: darken($secondary, 10%);
+ @include pointer;
+ }
+ }
+
+ &.unread {
+ background-color: $warning;
+
+ &:hover {
+ background-color: darken($warning, 5%);
+ }
+
+ .mark-read {
+ .read {
+ display: none;
+ }
+ .unread {
+ display: block;
+ }
+ }
+ }
+ }
+ }
+
+ .notification-list {
+ @include notification-list;
+ }
+
+ .chat-list {
+ @include notification-list;
+
+ > li {
+ @include pointer;
+ width: 500px;
+ padding: 0;
+ margin: 0;
+ gap: 0;
+ overflow-y: hidden;
+
+ .notification-chat-content {
+ padding: 0.5rem;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ .teaser-content {
+ white-space: nowrap;
+ max-height: 19px;
+ }
+
+ &:not(:last-child) {
+ border-bottom: 1px solid $dropdown-border-color;
+ }
+
+ &.no_active a {
+ text-align: center;
+ white-space: normal;
+ }
+
+ a {
+ line-height: 24px;
+ }
+
+ .members {
+ padding-left: 1rem;
+
+ li {
+ display: inline-block;
+ width: 16px;
+ padding: 0;
+ margin: 0;
+ }
+ }
+ }
+ }
+}
+
+.header {
+
+ [component="navbar/title"] {
+ display: none !important; //temp
+ }
+
+ #user_dropdown {
+ padding: 9px 15px;
+
+ img, .user-icon {
+ @include user-icon-style(30px, 1.8rem, 50%);
+ border: 0px none;
+
+ span {
+ font-size: 14px;
+ font-weight: 400;
+ }
+ }
+ }
+
+ .forum-logo {
+ max-height: 50px;
+ width: auto;
+ }
+
+ .header-topic-title {
+ text-align: right;
+ padding: 15px 15px;
+ font-size: 18px;
+ line-height: 20px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ span {
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ color: $primary;
+ }
+ }
+}
+
+.breadcrumb {
+ li {
+ max-width: 100%;
+ @include text-ellipsis;
+ position: relative;
+ }
+
+ .fa {
+ margin-left: 10px;
+ color: rgb(153, 153, 153);
+ }
+
+ @include media-breakpoint-down(sm) {
+ li {
+ display: none;
+ }
+
+ li:nth-last-child(2), li:nth-last-child(1), li:last-child {
+ display: inline-block;
+ }
+
+ li:nth-last-child(2):before {
+ display: none;
+ }
+
+ li:last-child {
+ white-space: normal;
+ }
+ }
+}
+
+#reconnect {
+ font-size: 14px;
+ -webkit-transition: opacity 250ms linear;
+ -moz-transition: opacity 250ms linear;
+ -ms-transition: opacity 250ms linear;
+ -o-transition: opacity 250ms linear;
+ transition: opacity 250ms linear;
+ -moz-opacity: 0.00;
+ opacity: 0.00;
+ min-width: 45px;
+
+ &.active {
+ -moz-opacity: 1;
+ opacity: 1;
+ }
+
+ & +div.tooltip .tooltip-inner {
+ width: 350px;
+ }
+}
+.unread-count {
+ position: relative;
+ &:after {
+ position: absolute;
+ left: 10px;
+ top: -10px;
+ font-size: 10px;
+ text-align: center;
+ border: 1px solid #890405;
+ color: #fff;
+ font-weight: bold;
+ min-width: 16px;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ background: #c91106;
+ padding: 1px 2px;
+ font-family: $font-family-sans-serif;
+ }
+}
+
+.unread-count[data-content]:not([data-content=""]):not([data-content="0"]):after {
+ content: attr(data-content);
+}
+
+.navbar-toggler {
+ .notification-icon {
+ position: absolute;
+ &[component="unread/icon"]::after {
+ left: -10px;
+ }
+ &[component="notifications/icon"]:after {
+ left: -5px;
+ top: -5px;
+ }
+ &[component="chat/icon"]:after {
+ left: 20px;
+ top: -5px;
+ }
+
+ &:before {
+ display: none;
+ }
+ }
+}
+
+.slideout-menu .unread-count:after {
+ position: relative;
+ left: -6px;
+ top: -7px;
+}
+
+#search-form {
+ #search-button {
+ max-width: 60px;
+ width: auto;
+ transition-property: max-width, padding-left, padding-right;
+ transition-duration: .2s;
+ transition-timing-function: ease;
+ overflow: hidden;
+ }
+ #search-button.hidden {
+ display: inline-block !important;
+ visibility: visible !important;
+ max-width: 0;
+ padding-left: 0;
+ padding-right: 0;
+ }
+ #search-fields {
+ overflow: hidden;
+ transition: max-width 0.2s ease 0s;
+ display: inline-block !important;
+ visibility: visible !important;
+
+ &.hidden {
+ max-width: 0;
+ }
+
+ input.form-control {
+ white-space: nowrap;
+ outline: none;
+ box-shadow: none;
+ }
+ }
+}
+
+body.skin-default .header {
+ .notification-list {
+ li {
+ a {
+ color: inherit;
+ }
+ }
+ }
+}
+
+label.dropdown-toggle {
+ cursor: pointer;
+ margin: 0;
+}
+
+#user-control-list-check:checked + #user-control-list {
+ display: block;
+}
+
+.dropdown-menu > li > form {
+ > button, > .btn-link {
+ text-align: left;
+ width: 100%;
+ background: none;
+ border: none;
+ display: block;
+ padding: 3px 20px;
+ clear: both;
+ font-weight: normal;
+ line-height: $line-height-base;
+ white-space: nowrap; // prevent links from randomly breaking onto new lines
+
+ &:hover,
+ &:focus {
+ text-decoration: none;
+ color: $dropdown-link-hover-color;
+ background-color: $dropdown-link-hover-bg;
+ }
+ }
+}
diff --git a/node_modules/nodebb-theme-persona/scss/helpers.scss b/node_modules/nodebb-theme-persona/scss/helpers.scss
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/node_modules/nodebb-theme-persona/scss/keyframes.scss b/node_modules/nodebb-theme-persona/scss/keyframes.scss
new file mode 100644
index 0000000000..61ce020bea
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/keyframes.scss
@@ -0,0 +1,152 @@
+@-webkit-keyframes taskbar-active {
+ 0% {
+ background: #e7e7e7;
+ color: #333;
+ }
+ 50% {
+ background: #558;
+ color: #fff;
+ }
+ 100% {
+ background: #e7e7e7;
+ color: #333;
+ }
+}
+
+@-moz-keyframes taskbar-active {
+ 0% {
+ background: #e7e7e7;
+ color: #333;
+ }
+ 50% {
+ background: #558;
+ color: #fff;
+ }
+ 100% {
+ background: #e7e7e7;
+ color: #333;
+ }
+}
+
+@-o-keyframes taskbar-active {
+ 0% {
+ background: #e7e7e7;
+ color: #333;
+ }
+ 50% {
+ background: #558;
+ color: #fff;
+ }
+ 100% {
+ background: #e7e7e7;
+ color: #333;
+ }
+}
+
+@keyframes taskbar-active {
+ 0% {
+ background: #e7e7e7;
+ color: #333;
+ }
+ 50% {
+ background: #558;
+ color: #fff;
+ }
+ 100% {
+ background: #e7e7e7;
+ color: #333;
+ }
+}
+
+@-webkit-keyframes topic-reply-pulse {
+ 0%, 100% { opacity: 1; }
+ 50% { opacity: 0.3; }
+}
+
+@keyframes topic-reply-pulse {
+ 0%, 100% { opacity: 1; }
+ 50% { opacity: 0.3; }
+}
+
+
+
+// originally from http://daneden.github.io/animate.css/
+@-webkit-keyframes bounceIn {
+ 0%, 20%, 40%, 60%, 80%, 100% {
+ -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
+ transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
+ }
+
+ 0% {
+ opacity: 0;
+ -webkit-transform: scale3d(.3, .3, .3);
+ transform: scale3d(.3, .3, .3);
+ }
+
+ 20% {
+ -webkit-transform: scale3d(1.1, 1.1, 1.1);
+ transform: scale3d(1.1, 1.1, 1.1);
+ }
+
+ 40% {
+ -webkit-transform: scale3d(.9, .9, .9);
+ transform: scale3d(.9, .9, .9);
+ }
+
+ 60% {
+ opacity: 1;
+ -webkit-transform: scale3d(1.03, 1.03, 1.03);
+ transform: scale3d(1.03, 1.03, 1.03);
+ }
+
+ 80% {
+ -webkit-transform: scale3d(.97, .97, .97);
+ transform: scale3d(.97, .97, .97);
+ }
+
+ 100% {
+ opacity: 1;
+ -webkit-transform: scale3d(1, 1, 1);
+ transform: scale3d(1, 1, 1);
+ }
+}
+
+@keyframes bounceIn {
+ 0%, 20%, 40%, 60%, 80%, 100% {
+ -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
+ transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
+ }
+
+ 0% {
+ opacity: 0;
+ -webkit-transform: scale3d(.3, .3, .3);
+ transform: scale3d(.3, .3, .3);
+ }
+
+ 20% {
+ -webkit-transform: scale3d(1.1, 1.1, 1.1);
+ transform: scale3d(1.1, 1.1, 1.1);
+ }
+
+ 40% {
+ -webkit-transform: scale3d(.9, .9, .9);
+ transform: scale3d(.9, .9, .9);
+ }
+
+ 60% {
+ opacity: 1;
+ -webkit-transform: scale3d(1.03, 1.03, 1.03);
+ transform: scale3d(1.03, 1.03, 1.03);
+ }
+
+ 80% {
+ -webkit-transform: scale3d(.97, .97, .97);
+ transform: scale3d(.97, .97, .97);
+ }
+
+ 100% {
+ opacity: 1;
+ -webkit-transform: scale3d(1, 1, 1);
+ transform: scale3d(1, 1, 1);
+ }
+}
diff --git a/node_modules/nodebb-theme-persona/scss/mixins.scss b/node_modules/nodebb-theme-persona/scss/mixins.scss
new file mode 100644
index 0000000000..360cacbf4c
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/mixins.scss
@@ -0,0 +1,130 @@
+
+
+@mixin timeline-style() {
+ > [component="post"], .timeline-event {
+ position: relative; // for absolutely positioned pseudo-element, below
+ border-left: 2px solid lighten($primary, 30%);
+ margin-left: 1.5rem;
+
+ &:not(:last-child) {
+ padding-bottom: $post-padding;
+ }
+ &:not(:first-child) {
+ padding-top: $post-padding;
+ }
+
+ > div:not(.content) {
+ margin-left: -1.5rem;
+ }
+
+ .icon .avatar, .timeline-badge {
+ // Opaque ring
+ position: relative;
+ z-index: 1;
+ box-shadow: 0 0 0 ($spacer * .5) $body-bg;
+ }
+ }
+
+ @include media-breakpoint-down(sm) {
+ [component="post"] {
+ border: 0;
+ padding: $post-padding 0;
+
+ margin-left: initial;
+ > div:not(.content) {
+ margin-left: 0;
+ }
+ }
+
+ [component="post"]:last-child:after {
+ display: none;
+ }
+
+ .timeline-event {
+ margin-left: 1rem;
+
+ &:before, &+:not(.timeline-event):before {
+ content: '';
+ width: 1rem;
+ position: absolute;
+ top: 0;
+ left: calc(-0.5rem - 1px);
+ border-bottom: 2px solid lighten($primary, 30%);
+ }
+
+ &+:not(.timeline-event):before {
+ left: calc(.5rem + 1px);
+ }
+
+ &+.timeline-event:before {
+ display: none;
+ }
+
+ .timeline-text.timeago {
+ display: none;
+ }
+ }
+ }
+
+ @include media-breakpoint-up(sm) {
+ .timeline-event {
+ [component="topic/event/delete"] {
+ visibility: hidden;
+ }
+
+ &:hover {
+ [component="topic/event/delete"] {
+ visibility: visible;
+
+ &:hover {
+ color: $danger;
+ }
+ }
+ }
+ }
+ }
+
+ .necro-post {
+ border-left-style: dashed;
+ }
+
+ > [component="post"]:last-child:after {
+ content: '';
+ width: 1rem;
+ position: absolute;
+ bottom: 0;
+ left: calc(-0.5rem - 1px);
+ border-bottom: 2px solid lighten($primary, 30%);
+ }
+
+ [component="topic/event"], [component="topic/necro-post"] {
+ &.timeline-event {
+ text-align: left;
+ justify-content: left;
+ font-size: 1em;
+
+ .timeline-badge {
+ float: left;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+
+ width: 32px;
+ height: 32px;
+ padding: 0;
+ margin-left: -17px;
+ margin-right: 17px;
+ color: lighten($primary, 30%);
+ background-color: $body-bg;
+ border: 2px solid lighten($primary, 30%);
+ border-radius: 50%;
+ }
+
+ .timeline-text {
+ line-height: 32px;
+ text-transform: initial;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/mobile.scss b/node_modules/nodebb-theme-persona/scss/mobile.scss
new file mode 100644
index 0000000000..4edf1ace95
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/mobile.scss
@@ -0,0 +1,331 @@
+
+.slideout-menu {
+ overflow-y: auto;
+ -webkit-overflow-scrolling: touch;
+}
+
+/* iPhone 5 and other such devices */
+@include media-breakpoint-down(sm) {
+ .chat-modal {
+ width: 100%;
+ height: 100%;
+ top: 0px !important;
+ left: 0px !important;
+
+ .modal-dialog {
+ margin: 0;
+ height: 100%;
+ width: 100%;
+
+ .modal-content {
+ height: 100%;
+ border: none;
+ }
+ }
+ }
+
+ .account {
+ margin-top: 256px;
+
+ .cover .controls i {
+ font-size: 3em;
+ }
+ }
+}
+
+@include media-breakpoint-down(lg) {
+ #panel {
+ background-color: inherit;
+ min-height: 100%;
+ padding-bottom: 40px;
+ }
+
+ body, #panel, .slideout-menu {
+ -webkit-overflow-scrolling: touch;
+ }
+
+ .navbar-toggle {
+ padding: 10px 17px;
+ margin: 0;
+ line-height: 30px;
+ border: none;
+
+ mobile-menu {
+ .unread-count::after {
+ left: 32px;
+ }
+ }
+ .header & .notification-icon {
+ left: auto;
+ right: 7px;
+ top: 10px;
+ &[component="notifications/icon"] {
+ right: 41px;
+ }
+ &.unread-count::after {
+ position: static;
+ }
+ }
+ }
+ .navbar .navbar-search {
+ input[name="term"] {
+ width: 150px;
+ }
+
+ padding: 4px 0px 4px 0px;
+ }
+ #menu .menu-section {
+ padding-top: 20px;
+ }
+ #chats-menu {
+ .nav-pills {
+ [component="user/status"] {
+ position: absolute;
+ right: 24px;
+ }
+
+ background-color: #101010;
+ height: 50px;
+ li {
+ margin: 0;
+ padding: 0;
+ width: 33%;
+ text-align: center;
+ height: 100%;
+ a {
+ height: 100%;
+ padding-top: 15px;
+ &.active {
+ background-color: $dark;
+ }
+ }
+ }
+ }
+ }
+
+ .slideout-menu {
+ z-index: 10000 !important;
+ background-color: $dark;
+
+ a, button {
+ color: #fff;
+ text-decoration: none;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+ .nav-item .dropdown-menu {
+ width: 100%;
+ background-color: $dark;
+ }
+ .chat-list {
+ max-height: 100%;
+
+ li {
+ width: auto;
+ border: none;
+ color: #fff;
+ position: relative;
+ height: 60px;
+
+ &:hover {
+ background: none;
+ }
+
+ &:not(:last-child) {
+ border-bottom: none;
+ }
+
+ .main-avatar {
+ position: absolute;
+ top: 0;
+ left: 0;
+
+ .avatar {
+ $size: 40px;
+ @include user-icon-style($size, calc($size * 0.6), 0);
+ }
+ }
+
+ .members {
+ display: none;
+ }
+
+ .room-name {
+ display: block;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ padding-left: 60px;
+ }
+
+ .teaser-content {
+ padding-left: 60px;
+ display: block;
+ font-size: 13px;
+ opacity: .8;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+ .teaser-timestamp {
+ font-size: 10px;
+ margin-right: 0.5rem;
+ margin-top: 0.5rem;
+ }
+ }
+ }
+
+ .menu-section {
+ .notification-list-mobile li .text {
+ display: block;
+ }
+ .chat-list, .notification-list-mobile {
+ .user-link {
+ display: inline;
+ }
+ .unread {
+ background-color: inherit;
+ }
+
+ .notification-chat-content {
+ padding-top: 10px;
+ padding-right: 20px;
+ }
+
+ .notification-chat-controls {
+ display: none;
+ }
+ }
+ .chat-list .unread .room-name::after,
+ .notification-list-mobile .unread a::after {
+ content: "new";
+ text-transform: uppercase;
+ color: #FFF;
+ margin-left: 5px;
+ font-size: 10px;
+ background: #C91106;
+ border: 1px solid #890405;
+ padding: 2px 3px;
+ border-radius: 5px;
+ }
+ }
+
+ .counter {
+ font-style: normal;
+
+ &:after {
+ top: -1px;
+ padding: 3px 7px;
+ background: #333;
+ border: 1px solid #222;
+ }
+
+ &:before {
+ display: none;
+ }
+ }
+ }
+
+ .menu-header-title {
+ font-weight: 400;
+ letter-spacing: 0.5px;
+ margin: 0;
+ }
+
+ .menu-section-title {
+ text-transform: uppercase;
+ color: #85888d;
+ font-weight: 200;
+ font-size: 13px;
+ letter-spacing: 1px;
+ padding: 0 20px;
+ margin:0;
+ }
+
+ .menu-section-list {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+
+ a, button {
+ display: block;
+ padding: 10px 20px;
+ text-align: left;
+ width: 100%;
+
+ &:hover {
+ background-color: rgba(255, 255, 255, 0.1);
+ text-decoration: none;
+ }
+ }
+
+ .user-status {
+ padding-left: 40px;
+ }
+ }
+
+ .slideout-open,
+ .slideout-open body,
+ .slideout-open .slideout-panel {
+ overflow: hidden;
+ overflow-y: hidden !important;
+ }
+
+ @keyframes fade {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: .3;
+ }
+ }
+ .subnav-is-opened .main-nav__secondary-nav {
+ display: block;
+ animation: fade 250ms ease-in-out both;
+ }
+
+ .slideout-open .slideout-panel {
+ &::after {
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ z-index: 1040;
+ content: ' ';
+
+ opacity: 0;
+ }
+ }
+
+ .menu-profile {
+ text-align: center;
+ background: #101010;
+ position: absolute;
+ height: 75px;
+ width: 100%;
+ top: 0px;
+ z-index: 1;
+
+ img, .user-icon {
+ @include user-icon-style(70px, 4rem);
+ position: absolute;
+ bottom: -22px;
+ left: 93px;
+ border-radius: 50%;
+ }
+
+ i {
+ position: absolute;
+ left: 145px;
+ font-size: 21px;
+ top: 28px;
+ }
+ }
+
+ [data-section="notifications"] ul li a:first-child {
+ display: none;
+ }
+}
diff --git a/node_modules/nodebb-theme-persona/scss/modules/composer.scss b/node_modules/nodebb-theme-persona/scss/modules/composer.scss
new file mode 100644
index 0000000000..836da1da9e
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/modules/composer.scss
@@ -0,0 +1,21 @@
+body.page-compose,
+.page-compose #content,
+.page-compose #panel {
+ height: calc(100vh - var(--panel-offset));
+}
+
+.page-compose .composer .composer-container {
+ border: 0;
+}
+
+.composer {
+ .composer-container {
+ border-top: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
+ border-left: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
+ border-right: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
+ }
+
+ .resizer {
+ border: 0 !important;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/modules/cookie-consent.scss b/node_modules/nodebb-theme-persona/scss/modules/cookie-consent.scss
new file mode 100644
index 0000000000..1233692594
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/modules/cookie-consent.scss
@@ -0,0 +1,13 @@
+.cookie-consent {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ line-height: 3em;
+ padding-left: 1rem;
+ width: 100%;
+ background: rgba(240,240,240,.8);
+ z-index: $zindex-popover;
+ a {
+ font-weight: bold;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/modules/fab.scss b/node_modules/nodebb-theme-persona/scss/modules/fab.scss
new file mode 100644
index 0000000000..8952549076
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/modules/fab.scss
@@ -0,0 +1,33 @@
+.persona-fab {
+ box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.156863), 0px 2px 10px 0px rgba(0, 0, 0, 0.117647);
+
+ background-color: $primary;
+ border: none;
+ border-radius: 50%;
+ cursor: pointer;
+ line-height: 55.5px;
+ vertical-align: middle;
+ height: 55.5px;
+ width: 55.5px;
+}
+
+.btn-group.open .dropdown-toggle.persona-fab {
+ box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.156863), 0px 2px 10px 0px rgba(0, 0, 0, 0.117647);
+}
+
+.persona-fab.btn-morph {
+ padding: 0;
+
+ &.heart {
+ > span > span {
+ background-color: #E91E63;
+ }
+ }
+
+ &.plus {
+ background-color: $success;
+ > span > span {
+ background-color: white;
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/modules/morph.scss b/node_modules/nodebb-theme-persona/scss/modules/morph.scss
new file mode 100644
index 0000000000..3de238f93e
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/modules/morph.scss
@@ -0,0 +1,269 @@
+// modified from http://codepen.io/albebonv/pen/gIlrw
+
+.btn-morph {
+ display: inline-block;
+ width: 2em;
+ height: 2em;
+ background-color: #FFF;
+ color: #9e9e9e;
+ box-shadow: 0 0 5px rgba(0,0,0,0.2);
+ border-radius: 1em;
+ overflow: hidden;
+ transform: translateZ(0);
+ transition: all 0.5s ease;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+.btn-morph:hover {
+ box-shadow: 0 0 10px rgba(0,0,0,0.4);
+}
+
+.btn-morph:active {
+ transform: scale(1.1,1.1);
+}
+
+.btn-morph:focus {
+ outline: 0;
+ border:none;
+ color: rgba(0, 0, 0, 0);
+}
+
+.btn-morph > span {
+ display: block;
+ position: relative;
+ width: 1em;
+ height: 1em;
+ transition: transform 0.5s ease;
+ overflow: hidden;
+ margin: 0.5em;
+}
+
+.btn-morph > span > span {
+ display: block;
+ background-color: #9e9e9e;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 1em;
+ height: 1em;
+ transition: all 0.5s ease;
+ border: 1px solid transparent;
+}
+
+header .btn-morph > span > span {
+ background-color: #e91e63;
+}
+
+.btn-morph.play > span {
+ transform: translate(1em,0) scale(1.6,1);
+}
+
+.btn-morph.play > span > span {
+ transform: rotate(-45deg) translate(-1em, -1em) scale(1,1);
+}
+
+.btn-morph.pause > span > span {
+ transform: scale(0.4,1) translate(-1.6em, 0);
+}
+
+.btn-morph.pause > span > span.s3 {
+ transform: scale(0.4,1) translate(1.6em, 0);
+}
+
+.btn-morph.stop > span {
+ transform: scale(0.8,0.8);
+}
+
+.btn-morph.menu > span > span {
+ transform: scale(1,0.2) translate(0,-3em);
+}
+
+.btn-morph.menu > span > span.s2 {
+ transform: scale(1,0.2) translate(0,0);
+}
+
+.btn-morph.menu > span > span.s3 {
+ transform: scale(1,0.2) translate(0,3em);
+}
+
+.btn-morph.close > span {
+ transform: rotate(45deg);
+}
+
+.btn-morph.close > span > span , .btn-morph.plus > span > span {
+ transform: scale(0.8,0.1);
+}
+
+.btn-morph.close > span > span.s3 , .btn-morph.plus > span > span.s3 {
+ transform: scale(0.1,0.8);
+}
+
+.btn-morph.minus > span > span {
+ transform: scale(1,0.2);
+}
+
+.btn-morph.more > span > span {
+ transform: scale(0.2,0.2) translate(-3em,0);
+ border-radius: 2em;
+}
+
+.btn-morph.more > span > span.s2 {
+ transform: scale(0.2,0.2) translate(0,0);
+}
+
+.btn-morph.more > span > span.s3 {
+ transform: scale(0.2,0.2) translate(3em,0);
+}
+
+.btn-morph.topArrow > span > span {
+ width: 0.4em;
+ height: 1.8em;
+ transform: translate(0.8em,0.2em);
+}
+
+.btn-morph.topArrow > span > span.s2 {
+ transform-origin: 0 0;
+ height: 1.4em;
+ transform: translate(1em,0) rotate(45deg);
+}
+
+.btn-morph.topArrow > span > span.s3 {
+ transform-origin: 100% 0;
+ height: 1.4em;
+ transform: translate(0.6em,0) rotate(-45deg);
+}
+
+.btn-morph.bottomArrow > span > span {
+ width: 0.4em;
+ height: 1.8em;
+ transform: translate(0.8em,0);
+}
+
+.btn-morph.bottomArrow > span > span.s2 {
+ transform-origin: 100% 100%;
+ height: 1.4em;
+ transform: translate(0.6em,0.6em) rotate(45deg);
+}
+
+.btn-morph.bottomArrow > span > span.s3 {
+ transform-origin: 0 100%;
+ height: 1.4em;
+ transform: translate(1em,0.6em) rotate(-45deg);
+}
+
+.btn-morph.rightArrow > span > span {
+ width: 1.8em;
+ height: 0.4em;
+ transform: translate(0,0.8em);
+}
+
+.btn-morph.rightArrow > span > span.s2 {
+ transform-origin: 100% 0;
+ width: 1.4em;
+ transform: translate(0.6em,1em) rotate(45deg);
+}
+
+.btn-morph.rightArrow > span > span.s3 {
+ transform-origin: 100% 100%;
+ width: 1.4em;
+ transform: translate(0.6em,0.6em) rotate(-45deg);
+}
+
+.btn-morph.leftArrow > span > span {
+ width: 1.8em;
+ height: 0.4em;
+ transform: translate(0.2em,0.8em);
+}
+
+.btn-morph.leftArrow > span > span.s2 {
+ transform-origin: 0 100%;
+ width: 1.4em;
+ transform: translate(0,0.6em) rotate(45deg);
+}
+
+.btn-morph.leftArrow > span > span.s3 {
+ transform-origin: 0 0;
+ width: 1.4em;
+ transform: translate(0,1em) rotate(-45deg);
+}
+
+.btn-morph.checked > span > span {
+ width: 1em;
+ height: 0.4em;
+ transform-origin: 100% 100%;
+ transform: translate(-0.3em,1.4em) rotate(45deg);
+}
+
+.btn-morph.checked > span > span.s3 {
+ width: 1.8em;
+ transform-origin: 0 100%;
+ transform: translate(0.7em,1.4em) rotate(-45deg);
+}
+
+.btn-morph.heart > span > span {
+ width: 0.5em;
+ height: 0.85em;
+ top: 0.1em;
+ left: 0.5em;
+ transform-origin: 0 100%;
+ transform: rotate(-45deg);
+ border-radius: 0.5em 0.5em 0 0;
+}
+
+.btn-morph.heart > span > span.s3 {
+ transform-origin: 100% 100%;
+ left: 0em;
+ transform: rotate(45deg);
+}
+
+
+.drop {
+ display: block;
+ position: absolute;
+ background: #CCC;
+ border-radius: 100%;
+ transform: scale(0);
+ pointer-events: none;
+ width: 100%;
+ height: 100%;
+}
+
+.drop:before {
+ display: block;
+ position: absolute;
+ content: "";
+ background-color: $gray-200;
+ border-radius: 100%;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ transform: scale(0);
+}
+
+.drop.animate {
+ animation: drop 1s ease-out;
+}
+
+.drop.animate:before {
+ animation: drop2 1s ease-out;
+}
+
+@keyframes drop {
+ 100% {
+ opacity: 0;
+ transform: scale(1.25);
+ }
+}
+
+@keyframes drop2 {
+ 30% {
+ opacity: 1;
+ transform: scale(0);
+ }
+
+ 100% {
+ opacity: 0;
+ transform: scale(1.25);
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/modules/necro-post.scss b/node_modules/nodebb-theme-persona/scss/modules/necro-post.scss
new file mode 100644
index 0000000000..5739692edd
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/modules/necro-post.scss
@@ -0,0 +1,9 @@
+.topic .necro-post {
+ text-align: center;
+ margin-bottom: 0;
+ font-size: 1.5em;
+
+ .timeline-text {
+ margin-left: 32px;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/modules/nprogress.scss b/node_modules/nodebb-theme-persona/scss/modules/nprogress.scss
new file mode 100644
index 0000000000..9ceb4cdfb1
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/modules/nprogress.scss
@@ -0,0 +1,80 @@
+#nprogress {
+ pointer-events: none;
+}
+
+#nprogress .bar {
+ background: #29d;
+
+ position: fixed;
+ z-index: 1031;
+ top: 0;
+ left: 0;
+
+ width: 100%;
+ height: 2px;
+}
+
+#nprogress .peg {
+ display: block;
+ position: absolute;
+ right: 0px;
+ width: 100px;
+ height: 100%;
+ box-shadow: 0 0 10px #29d, 0 0 5px #29d;
+ opacity: 1.0;
+
+ -webkit-transform: rotate(3deg) translate(0px, -4px);
+ -ms-transform: rotate(3deg) translate(0px, -4px);
+ transform: rotate(3deg) translate(0px, -4px);
+}
+
+#nprogress .spinner {
+ display: block;
+ position: fixed;
+ z-index: 1031;
+ top: 15px;
+ right: 15px;
+}
+
+@include media-breakpoint-down(sm) {
+ #nprogress .spinner {
+ bottom: 15px;
+ right: 15px;
+ top: initial;
+ }
+}
+
+
+#nprogress .spinner-icon {
+ width: 18px;
+ height: 18px;
+ box-sizing: border-box;
+
+ border: solid 2px transparent;
+ border-top-color: #29d;
+ border-left-color: #29d;
+ border-radius: 50%;
+
+ -webkit-animation: nprogress-spinner 400ms linear infinite;
+ animation: nprogress-spinner 400ms linear infinite;
+}
+
+.nprogress-custom-parent {
+ overflow: hidden;
+ position: relative;
+}
+
+.nprogress-custom-parent #nprogress .spinner,
+.nprogress-custom-parent #nprogress .bar {
+ position: absolute;
+}
+
+@-webkit-keyframes nprogress-spinner {
+ 0% { -webkit-transform: rotate(0deg); }
+ 100% { -webkit-transform: rotate(360deg); }
+}
+@keyframes nprogress-spinner {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
+}
+
diff --git a/node_modules/nodebb-theme-persona/scss/modules/taskbar.scss b/node_modules/nodebb-theme-persona/scss/modules/taskbar.scss
new file mode 100644
index 0000000000..e646f316b6
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/modules/taskbar.scss
@@ -0,0 +1,161 @@
+@import "../keyframes";
+
+.modal-unfocused {
+ z-index: $zindex-modal - 5 !important;
+}
+
+.taskbar {
+ display: none;
+ left: 15px;
+ right: auto;
+
+ margin-top: 0;
+ @include transition(.15s ease-in opacity);
+
+ background: none;
+ border: none;
+
+ &[data-active="1"] {
+ display: block;
+ }
+
+ &:hover {
+ -moz-opacity: 1;
+ opacity: 1;
+ }
+
+ &.navbar {
+ min-height: 32px;
+ }
+
+ .navbar-nav {
+ float: unset;
+ display: flex;
+ flex-direction: column;
+ padding-right: 15px;
+ padding-bottom: 15px;
+
+ li {
+ margin-top: 1rem;
+
+ &.new a {
+ -webkit-animation-name: bounceIn;
+ animation-name: bounceIn;
+ -webkit-animation-duration: 1s;
+ animation-duration: 1s;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+ }
+
+ &.active a {
+ &::after {
+ content: '\f06e';
+ font-family: "FontAwesome";
+ font-size: 13px;
+ background: black;
+ border-radius: 50%;
+ color: white;
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 20px;
+ height: 20px;
+ }
+ }
+
+ &.new a::after {
+ display: none;
+ }
+
+ a {
+ display: inline-block;
+ padding: 3px 15px;
+ font-size: 20px;
+
+ &.avatar {
+ overflow: visible;
+ }
+
+ &:focus, &:hover {
+ color: $gray-200;
+ }
+
+ border-radius: 50%;
+ height: 50px;
+ width: 50px;
+
+ > span {
+ display: none;
+ }
+
+ -webkit-animation-name: bounceIn;
+ animation-name: bounceIn;
+ -webkit-animation-duration: 1s;
+ animation-duration: 1s;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+ }
+
+ img {
+ max-width: 24px;
+ max-height: 24px;
+ margin-right: 1em;
+ }
+
+ &.pulse a {
+ -webkit-animation-name: bounceIn;
+ animation-name: bounceIn;
+ -webkit-animation-duration: 1s;
+ animation-duration: 1s;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+ }
+
+ &.taskbar-composer {
+ a, a:hover, a:focus, a:active {
+ background-color: $danger;
+ color: white;
+ background-size: cover;
+ }
+ }
+
+ &.taskbar-chat {
+ a, a:hover, a:focus, a:active {
+ background: $primary;
+ }
+
+ &.new:after {
+ content: attr(data-content);
+ position: absolute;
+ left: 52px;
+ top: 0px;
+ font-size: 10px;
+ text-align: center;
+ border: 1px solid $danger;
+ color: #fff;
+ font-weight: bold;
+ min-width: 20px;
+ border-radius: 4px;
+ background: $danger;
+ padding: 1px 2px;
+ font-family: $font-family-sans-serif;
+ }
+
+ &.new[data-content="0"]:after {
+ display: none;
+ }
+ }
+
+ &.taskbar-composer, &.taskbar-chat {
+ a {
+ text-align: center;
+
+ i {
+ font-size: 18px;
+ line-height: 42px;
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/modules/user-menu.scss b/node_modules/nodebb-theme-persona/scss/modules/user-menu.scss
new file mode 100644
index 0000000000..dbaa904995
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/modules/user-menu.scss
@@ -0,0 +1,8 @@
+[component="header/usercontrol"] {
+ [component="header/profilelink"] > div, .user-status > div {
+ min-width: 1.25em; // match fontawesome fixed width
+ }
+ .user-status.selected span {
+ font-weight: bold;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/modules/usercard.scss b/node_modules/nodebb-theme-persona/scss/modules/usercard.scss
new file mode 100644
index 0000000000..f75a3beb4a
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/modules/usercard.scss
@@ -0,0 +1,65 @@
+.persona-usercard {
+ position: absolute;
+ background: #333;
+ top: -50%;
+ left: 0px;
+ box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.25), 0px 2px 10px 0px rgba(0, 0, 0, 0.25);
+ height: 150px;
+ width: 450px;
+ z-index: 1;
+ display: block;
+
+ a, a:hover, a:visited, a:active {
+ text-decoration: none;
+ color: white;
+ }
+
+ .usercard-picture {
+ width: 150px;
+ height: 150px;
+ float: left;
+ background-size: cover;
+ background-repeat: no-repeat;
+ font-size: 75px;
+ line-height: 140px;
+ text-align: center;
+ }
+
+ .usercard-body {
+ padding: 5px 15px;
+ float: left;
+
+ height: 150px;
+ width: 300px;
+ color: white;
+ }
+
+ .usercard-name {
+ font-size: 28px;
+ }
+
+ .usercard-username {
+ text-transform: uppercase;
+ font-size: 13px;
+ }
+
+ .usercard-info {
+ text-align: center;
+ font-size: 30px;
+ font-weight: 300;
+
+ small {
+ text-transform: uppercase;
+ font-size: 10px;
+ display: block;
+ margin-top: 15px;
+ font-weight: 400;
+ }
+ }
+
+ .persona-fab.btn-morph {
+ top: 75px;
+ right: 15px;
+ position: absolute;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/noscript.scss b/node_modules/nodebb-theme-persona/scss/noscript.scss
new file mode 100644
index 0000000000..6c1a1cf98b
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/noscript.scss
@@ -0,0 +1,81 @@
+noscript {
+ @mixin default() {
+ list-style-type: none;
+ padding: 1em;
+ margin-bottom: 1em;
+ @include zebra;
+ }
+
+ .categories {
+ li {
+ @include default;
+
+ .icon {
+ float: left;
+ width: auto;
+ height: auto;
+ padding: 0;
+ margin: 0;
+ margin-right: 1em;
+ }
+
+ a {
+ font-size: 20px;
+ }
+ }
+ }
+
+ .topics {
+ li {
+ @include default;
+ }
+
+ .timestamp {
+ float: right;
+ color: #999;
+ font-style: italic;
+ font-size: 12px;
+ }
+
+ .teaser {
+ margin-left: 16px;
+ margin-top: 8px;
+
+ img {
+ float: left;
+ width: 64px;
+ margin-right: 1em;
+ }
+
+ p {
+ color: #666;
+ font-size: 13px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ margin-left: 64px;
+ padding-top: 10px;
+ }
+ }
+ }
+
+ .posts {
+ li {
+ @include default;
+
+ .profile {
+ text-align: center;
+
+ img {
+ width: 64px;
+ }
+
+ span {
+ font-weight: bold;
+ display: inline-block;
+ margin-top: 1em;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/overrides.scss b/node_modules/nodebb-theme-persona/scss/overrides.scss
new file mode 100644
index 0000000000..7c0c1f1c03
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/overrides.scss
@@ -0,0 +1,40 @@
+// only overrides to bs5 variables here
+
+$navbar-nav-link-padding-x: 0.875rem!default;
+
+// persona colors
+$white: #fff !default;
+$gray-100: #f8f9fa !default;
+$gray-200: #e9ecef !default;
+$gray-300: #dee2e6 !default;
+$gray-400: #ced4da !default;
+$gray-500: #adb5bd !default;
+$gray-600: #6c757d !default;
+$gray-700: #495057 !default;
+$gray-800: #343a40 !default;
+$gray-900: #212529 !default;
+$black: #000 !default;
+
+$primary: darken(#428bca, 6.5%) !default;
+$secondary: $gray-600 !default;
+$success: #5cb85c !default;
+$info: #5bc0de !default;
+$warning: #f0ad4e !default;
+$danger: #d9534f !default;
+$light: $gray-100 !default;
+$dark: $gray-900 !default;
+$link-decoration:none !default;
+
+// font
+$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
+// BS5 default is 1rem(16px)
+$font-size-base: 0.875rem!default;
+
+// no rounded in persona
+$enable-rounded: false;
+
+// no caret on dropdown-toggle
+$enable-caret: false;
+
+// disable smooth scroll, this makes window.scrollTo(0,0) in ajaxify.js take x milliseconds
+$enable-smooth-scroll: false;
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/persona.scss b/node_modules/nodebb-theme-persona/scss/persona.scss
new file mode 100644
index 0000000000..ddac753a0b
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/persona.scss
@@ -0,0 +1,35 @@
+@import "variables";
+@import "style";
+@import "mixins";
+
+@import "topic";
+@import "category";
+@import "tags";
+@import "noscript";
+@import "categories";
+@import "header";
+@import "account";
+@import "groups";
+@import "chats";
+@import "search";
+@import "topics_list";
+@import "footer";
+@import "posts_list";
+@import "register";
+@import "flags";
+
+@import "mobile";
+
+@import "helpers";
+@import "keyframes";
+
+@import "modules/nprogress";
+@import "modules/usercard";
+@import "modules/taskbar";
+@import "modules/fab";
+@import "modules/morph";
+@import "modules/cookie-consent";
+@import "modules/necro-post";
+@import "modules/composer";
+@import "modules/user-menu";
+
diff --git a/node_modules/nodebb-theme-persona/scss/posts_list.scss b/node_modules/nodebb-theme-persona/scss/posts_list.scss
new file mode 100644
index 0000000000..4c542fd4de
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/posts_list.scss
@@ -0,0 +1,128 @@
+.posts-list {
+ padding-left: 0px;
+
+ .posts-list-item {
+ width: 100%;
+ margin-bottom: 0px;
+
+ &.deleted {
+ -moz-opacity: 0.30;
+ opacity: 0.30;
+ }
+
+ &.scheduled {
+ opacity: 0.7;
+ }
+
+ .user-img {
+ position: absolute;
+ top: 50%;
+ margin-top: -14px;
+ margin-left: -14px;
+ }
+
+ a {
+ span {
+ overflow: hidden;
+ padding-left: 8px;
+ }
+ }
+
+ .topic-title {
+ color: $gray-800;
+ font-weight: 900;
+ font-size: 125%;
+ text-decoration: underline;
+ }
+
+ .topic-category {
+ text-transform: uppercase;
+ font-size: 10px;
+ color: $gray-600;
+ margin-top: 6px;
+ margin-right: 10px;
+ margin-bottom: 25px;
+ display: inline-block;
+ margin-top: 10px;
+
+ a {
+ font-weight: 900;
+ color: $gray-600;
+ }
+ }
+
+ .content {
+ max-height: 240px;
+ position: relative;
+ clear: left;
+ display: block;
+ overflow: hidden;
+ padding-right: 10px;
+ margin-top: 5px;
+ clear: both;
+
+ h1, h2, h3, h4, h5, h6 {
+ margin: 0;
+ font-size: 100%;
+ }
+
+ blockquote {
+ font-size: 100%;
+ margin: 8px 0;
+ padding: 0 10px;
+ }
+
+ p {
+ margin: 0 0 2px;
+ }
+ }
+
+ .post-body {
+ border-right: 2px solid $primary;
+ min-height: 100px;
+ position: relative; // to handle abs. positioning in .post-info child
+ }
+
+ .post-info {
+ position: absolute;
+ top: 50%;
+ left: 100%;
+ width: 175px;
+ height: 28px;
+ font-size: 10px;
+
+ > a {
+ position: relative;
+ .user-img {
+ text-align: center;
+ padding: 0;
+ }
+ }
+
+ .post-author {
+ padding-left: 25px;
+ margin-top: -14px;
+ color: $gray-600;
+
+ a {
+ color: $gray-600;
+ font-weight: 900;
+
+ }
+
+ text-transform: uppercase;
+ }
+ }
+ }
+}
+
+.posts-list.diffs .posts-list-item .content {
+ max-height: inherit;
+ overflow-y: none;
+}
+
+@include media-breakpoint-down(sm) {
+ .posts-list .posts-list-item .post-info {
+ width: 100px;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/register.scss b/node_modules/nodebb-theme-persona/scss/register.scss
new file mode 100644
index 0000000000..8ad2801ac9
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/register.scss
@@ -0,0 +1,71 @@
+.page-register-complete {
+ .tos {
+ background: $body-bg;
+ max-height: 350px;
+ margin-top: 5px;
+ overflow-y: scroll;
+ padding: 15px;
+ font-size: 1.25rem;
+ line-height: 2rem;
+ }
+}
+
+.register-block {
+ margin-top: 15px;
+
+ .register-success {
+ .form-control {
+ border-color: #5cb85c;
+ background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%235cb85c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
+ padding-right: 2.25rem;
+ background-repeat: no-repeat;
+ background-position: center right .625rem;
+ -webkit-background-size: 1.25rem 1.25rem;
+ background-size: 1.25rem 1.25rem;
+ }
+
+ .register-feedback {
+ color: #5cb85c;
+ display: block;
+ margin-top: .25rem;
+ }
+ }
+
+ .register-danger {
+ .form-control {
+ border-color: #d9534f;
+ background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E");
+ padding-right: 2.25rem;
+ background-repeat: no-repeat;
+ background-position: center right .625rem;
+ -webkit-background-size: 1.25rem 1.25rem;
+ background-size: 1.25rem 1.25rem;
+ }
+
+ .register-feedback {
+ color: #d9534f;
+ display: block;
+ margin-top: .25rem;
+ }
+ }
+}
+
+.login-block {
+ margin-top: 15px;
+
+ #login {
+ margin-bottom: 10px;
+ }
+}
+
+.register-block, .login-block {
+ #caps-lock-warning {
+ margin-top: 10px;
+ }
+}
+
+@include media-breakpoint-down(sm) {
+ .alt-login-block {
+ margin-bottom: 20px;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/search.scss b/node_modules/nodebb-theme-persona/scss/search.scss
new file mode 100644
index 0000000000..5283b4ed70
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/search.scss
@@ -0,0 +1,48 @@
+[component="search/filters"] {
+ .filter-btn {
+ border-color: $gray-300!important;
+ &.active-filter {
+ border-color: $primary!important;
+ }
+ }
+}
+
+.search-result-title {
+ font-weight: 600;
+}
+
+.search-result-text {
+ max-height: 250px;
+ overflow: hidden;
+ position: relative;
+
+ h4, p {
+ overflow-y: hidden;
+ }
+}
+
+.topic-search {
+ position: fixed;
+ top: 60px;
+ right: 10px;
+
+ button {
+ padding: 4px 6px;
+ }
+}
+
+@include media-breakpoint-down(sm) {
+ .quick-search-container {
+ left: 0px;
+ right: 0px;
+ }
+}
+
+.quick-search-results, .search-results {
+ .post-info {
+ font-size: 12px;
+ .category-item .icon {
+ margin-top: -3px;
+ }
+ }
+}
diff --git a/node_modules/nodebb-theme-persona/scss/style.scss b/node_modules/nodebb-theme-persona/scss/style.scss
new file mode 100644
index 0000000000..1a2c562bb8
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/style.scss
@@ -0,0 +1,270 @@
+html {
+ overflow-y: scroll;
+ min-height: 100%;
+ height: 100%;
+}
+
+body {
+ min-height: 100%;
+}
+
+@include media-breakpoint-down(sm) {
+ .slideout-panel {
+ min-height: 100vh;
+ }
+}
+
+button, a {
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
+}
+
+.block, .show {
+ display: block;
+}
+
+a:hover, .btn-link:hover, .btn-link:active, .btn-link:focus {
+ text-decoration:none;
+}
+
+.alt-logins {
+ margin: 0 0 0 1em;
+ padding: 0;
+ list-style-type: none;
+
+ li {
+ vertical-align: middle;
+ background: transparent;
+ margin: 0.25em;
+ @include pointer;
+ @include inline-block;
+ }
+}
+
+#content {
+ padding-bottom: 20px;
+ -webkit-transition: opacity 150ms linear;
+ -moz-transition: opacity 150ms linear;
+ -ms-transition: opacity 150ms linear;
+ -o-transition: opacity 150ms linear;
+ transition: opacity 150ms linear;
+
+ &.ajaxifying {
+ -moz-opacity: 0;
+ opacity: 0;
+ }
+}
+
+.status {
+ font-size: 10px;
+ vertical-align: middle;
+
+ &.online {
+ color: $success;
+ }
+
+ &.away {
+ color: $warning;
+ }
+
+ &.dnd {
+ color: $danger;
+ }
+
+ &.offline {
+ color: $gray-600;
+ }
+}
+
+
+.topic .topic-item, .category .category-item {
+ -webkit-transition: background-color 500ms linear;
+ -moz-transition: background-color 500ms linear;
+ -ms-transition: background-color 500ms linear;
+ -o-transition: background-color 500ms linear;
+ transition: background-color 500ms linear;
+}
+
+.topic .topic-item.highlight, .category .category-item.highlight {
+ background-color: lighten($info, 20%);
+}
+
+.fa-facebook-square {
+ color:#3b5998;
+ background:transparent;
+}
+
+.fa-twitter-square {
+ color:#2fc2ef;
+ background:transparent;
+}
+
+.fa-google-plus-square {
+ color:#df5138;
+ background:transparent;
+}
+
+.category .post-link, .topic .post-link {
+ display:inline-block;
+ width:90%;
+ height:25px;
+ font-size:10px;
+ padding:0px;
+}
+
+.menu-icon {
+ background: transparent;
+ width: 20px;
+ height: 20px;
+ text-align: center;
+ display: inline-block;
+ line-height: 20px;
+ cursor: pointer;
+}
+
+.dropdown-menu {
+ .badge {
+ vertical-align: 1px;
+ }
+
+ a[role="menuitem"]:focus {
+ outline: none;
+ }
+}
+
+.caret {
+ display: inline-block;
+ width: 0;
+ height: 0;
+ vertical-align: middle;
+ border-top: 4px dashed;
+ border-right: 4px solid transparent;
+ border-left: 4px solid transparent;
+}
+
+.fade-out {
+ position: absolute;
+ top: 190px;
+ left: 0;
+ width: 100%;
+ margin: 0;
+ padding: 30px 0;
+}
+
+.skin-default, .skin-cerulean, .skin-cosmo, .skin-flatly, .skin-journal, .skin-lumen, .skin-paper, .skin-readable, .skin-sandstone, .skin-spacelab, .skin-united, .skin-yeti {
+ .fade-out {
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, transparent),color-stop(1, white));
+ background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), white);
+ background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0), white);
+ background-image: -ms-linear-gradient(top, transparent, white);
+ background-image: -o-linear-gradient(top, transparent, white);
+ }
+}
+
+.skin-cyborg .fade-out {
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, transparent),color-stop(1, #060606));
+ background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), #060606);
+ background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0), #060606);
+ background-image: -ms-linear-gradient(top, transparent, #060606);
+ background-image: -o-linear-gradient(top, transparent, #060606);
+}
+
+.skin-darkly .fade-out {
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, transparent),color-stop(1, #222222));
+ background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), #222222);
+ background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0), #222222);
+ background-image: -ms-linear-gradient(top, transparent, #222222);
+ background-image: -o-linear-gradient(top, transparent, #222222);
+}
+
+.skin-simplex .fade-out {
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, transparent),color-stop(1, #fcfcfc));
+ background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), #fcfcfc);
+ background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0), #fcfcfc);
+ background-image: -ms-linear-gradient(top, transparent, #fcfcfc);
+ background-image: -o-linear-gradient(top, transparent, #fcfcfc);
+}
+
+.skin-slate .fade-out {
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, transparent),color-stop(1, #272b30));
+ background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), #272b30);
+ background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0), #272b30);
+ background-image: -ms-linear-gradient(top, transparent, #272b30);
+ background-image: -o-linear-gradient(top, transparent, #272b30);
+}
+
+.skin-superhero .fade-out {
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, transparent),color-stop(1, #2b3e50));
+ background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), #2b3e50);
+ background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0), #2b3e50);
+ background-image: -ms-linear-gradient(top, transparent, #2b3e50);
+ background-image: -o-linear-gradient(top, transparent, #2b3e50);
+}
+
+.icon-container {
+ .row {
+ margin: 0;
+ i {
+ width:20px;
+ height:20px;
+ margin: 1px;
+ @include pointer();
+ line-height: 20px;
+ text-align: center;
+
+ &:hover, &.selected {
+ background: black;
+ color: white;
+ }
+ }
+ }
+}
+
+.maintenance {
+ .well {
+ white-space: pre-line;
+ }
+}
+
+
+.footer {
+ margin-top: 1em;
+}
+
+a.permalink {
+ &,
+ &:hover,
+ &:focus,
+ &:active {
+ text-decoration: underline;
+ }
+}
+
+.deco-none, .deco-none:link, .deco-none:hover {
+ color: inherit;
+ text-decoration: inherit;
+}
+
+.disabled a {
+ pointer-events: none;
+}
+
+@include media-breakpoint-down(sm) {
+ .form-control {
+ font-size: 16px;
+ }
+}
+
+.background-link-container {
+ position: relative;
+ a {
+ position: relative;
+ }
+
+ a.background-link {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ }
+}
diff --git a/node_modules/nodebb-theme-persona/scss/tags.scss b/node_modules/nodebb-theme-persona/scss/tags.scss
new file mode 100644
index 0000000000..9e250b36d8
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/tags.scss
@@ -0,0 +1,11 @@
+
+.tag-list {
+ .tag {
+ text-transform: uppercase;
+ font-size: 10px;
+ background: $gray-200;
+ color: $gray-600;
+ padding: 5px;
+ white-space: nowrap;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/topic.scss b/node_modules/nodebb-theme-persona/scss/topic.scss
new file mode 100644
index 0000000000..108a700bc4
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/topic.scss
@@ -0,0 +1,571 @@
+.topic {
+ [component="post/header"] {
+ margin-top: 0px;
+ line-height: 40px;
+
+ .topic-title {
+ word-wrap: break-word;
+ color:inherit;
+ }
+
+ > span {
+ text-transform: uppercase;
+ color: $gray-600;
+ display: inline-block;
+ margin-top: 8px;
+ }
+
+ .topic-title {
+ text-transform: initial;
+ }
+ }
+
+ [component="topic/labels"] {
+ font-size: 20px;
+ color: $text-muted;
+ }
+
+ [component="topic/browsing-users"] {
+ margin-bottom: -5px;
+ }
+ .topic-header {
+ top: var(--panel-offset);
+ background-color: $body-bg;
+ z-index: $zindex-dropdown; // allows for top nav dropdowns to appear on top
+ }
+
+ .topic-info {
+ border-bottom: 1px solid $post-border-color;
+ }
+
+ .posts {
+ h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child {
+ margin-top: 0px;
+ }
+
+ .icon {
+ position: relative;
+ border-radius: 50%;
+ min-width: 46px;
+ min-height: 46px;
+ margin-top: 2px;
+
+
+ > a > .status {
+ position: absolute;
+ right: 12px;
+ font-size: 12px;
+ top: 0px;
+ z-index: 1;
+
+ @include media-breakpoint-up(md) {
+ top: 2px;
+ font-size: 16px;
+ }
+ }
+
+ .avatar {
+ margin-right: 15px;
+ }
+ }
+
+ .status {
+ vertical-align: 0%;
+ }
+ }
+
+ .login-required {
+ display: inline-block;
+ padding: 0 0.5em;
+ border: 1px dashed $gray-600;
+ }
+
+ .bookmarked {
+ font-size: 16px;
+ color: darken($post-highlight, 20%);
+ opacity: 0;
+ @include transition(0.75s ease-in-out opacity);
+ margin-left: 5px;
+ }
+
+ [component="post/anchor"] {
+ position: relative;
+ top: -$post-padding;
+ }
+
+ [component="post/upvote"], [component="post/downvote"] {
+ display: inline-block;
+ padding: 1rem;
+ color: $text-muted;
+
+ &:focus {
+ text-decoration: none;
+ }
+ }
+
+ [component="post/upvote"].upvoted i {
+ @include fa-icon-solid($fa-var-circle-chevron-up);
+ color: $primary;
+ }
+
+ [component="post/downvote"].downvoted i {
+ @include fa-icon-solid($fa-var-circle-chevron-down);
+ color: $primary;
+ }
+
+ [component="post/vote-count"] {
+ display: inline-block;
+ padding: 1rem 0.5rem;
+ }
+
+ [component="post/parent"] {
+ border: 0;
+ font-size: 10px;
+ }
+
+ .threaded-replies {
+ margin-left: 60px;
+ padding: 1rem 0px;
+ text-decoration: none;
+
+ img, .user-icon {
+ @include user-icon-style(16px, 10px, 50%);
+ vertical-align: 1px;
+ }
+
+ img {
+ vertical-align: -4px;
+ }
+
+ .replies-count {
+ margin-left: 3px;
+ }
+
+ .fa {
+ font-size: 80%;
+ }
+
+ .avatars {
+ position: relative;
+ }
+ }
+
+ [component="post/replies"] {
+ margin-left: 61px;
+ margin-top: $post-padding;
+ border-left: 5px solid #eee;
+ padding-left: 20px;
+ .timeline-event { display: none; }
+ [component="post"]:last-child > hr {
+ display: none;
+ }
+ }
+
+ .stats {
+ font-size: 12px;
+ margin: 0px 2px 0px 2px;
+ display: inline-block;
+ }
+
+ .title {
+ p {
+ margin-bottom: 4px;
+ }
+
+ small {
+ margin-top: 2px;
+ display: block;
+
+ color: $gray-600;
+
+ strong {
+ color: $gray-800;
+ }
+ }
+ }
+
+ .content {
+ margin-top: $post-padding;
+ padding-bottom: 1px;
+ margin-top: -43px;
+ margin-left: 38px;
+ word-wrap: break-word;
+ overflow: hidden;
+ min-height: 60px;
+ }
+
+ .post-tools {
+ a {
+ padding: 1rem 10px;
+ @include pointer;
+ }
+ }
+
+ [component="post/tools"] {
+ font-size: 14px;
+
+ > a {
+ padding: 1rem;
+ }
+
+ // temporary until we build component toggling
+ .favourite.btn-warning, .follow.btn-success {
+ background: white !important;
+ color: #333;
+ &:hover {
+ background: $primary !important;
+ }
+ }
+ }
+
+ h1 {
+ .btn-group, .btn {
+ margin-left: 15px;
+ }
+
+ .btn {
+ background: $body-bg;
+ text-transform: uppercase;
+ font-weight: 600;
+ box-shadow: none !important;
+ font-size: 11px;
+ color: $gray-600;
+ padding: 0;
+ }
+ }
+
+ .post-signature {
+ font-size: 12px;
+ border-top: 1px dashed #dedede;
+ padding: 1px;
+ padding-top: 5px;
+ display: block;
+ font-style: italic;
+ margin-left: 61px;
+ max-width: 100%;
+ word-wrap: break-word;
+ }
+
+ @include media-breakpoint-down(sm) {
+ .content {
+ margin-left: 0;
+ margin-top: -10px;
+
+ .table {
+ overflow-x: auto;
+ display: block;
+ }
+ }
+
+ .post-signature {
+ margin-left: 0px;
+ }
+
+ .posts .icon {
+ min-width: 0;
+ min-height: 0;
+ margin-top: 0px;
+
+ .avatar {
+ @include user-icon-style(23px, calc(23px * 0.6), 50%);
+ }
+ }
+
+ [component="post/reply-count"] {
+ margin-left: 0;
+ }
+
+ [component="post/replies"] {
+ margin-left: 1px;
+ }
+ }
+
+ .quick-reply {
+ position: relative;
+ .icon {
+ position: relative;
+ border-radius: 50%;
+ min-width: 46px;
+ min-height: 46px;
+ margin-top: 2px;
+
+ > a > .status {
+ position: absolute;
+ right: 12px;
+ font-size: 12px;
+ top: 0px;
+
+ @include media-breakpoint-up(md) {
+ top: 2px;
+ font-size: 16px;
+ }
+ }
+
+ .avatar {
+ margin-right: 15px;
+ }
+ }
+
+ .quickreply-message {
+ margin-left: 63px;
+ margin-bottom: 5px;
+
+ @include media-breakpoint-down(sm) {
+ margin-left: 0;
+
+ [component="topic/quickreply/text"] {
+ font-size: 16px;
+ padding: 10px;
+ }
+ }
+ }
+ }
+}
+
+
+.topic {
+ &.deleted {
+ opacity: 0.3;
+
+ .votes {
+ display: none;
+ }
+ }
+
+ .posts {
+ &.timeline {
+ @include timeline-style;
+ }
+
+ list-style-type: none;
+ padding: 0;
+
+ [component="post"] {
+ position: relative;
+ @include transition(0.75s ease-in-out border-color);
+
+ .edit-icon {
+ vertical-align: -2%;
+ }
+
+ &.deleted {
+ > .content {
+ opacity: 0.3;
+ }
+
+ .votes {
+ display: none;
+ }
+ }
+
+ &.highlight {
+ border-color: darken($post-highlight, 20%);
+ box-shadow: 0px 2px 2px -2px $post-highlight;
+
+ .bookmarked {
+ opacity: 1;
+ }
+ }
+ }
+
+ .content {
+ @include fix-lists;
+
+ > blockquote {
+ > blockquote {
+ > *:not(.blockquote) {
+ display: none;
+ }
+ }
+
+ > blockquote.uncollapsed {
+ > *:not(.blockquote) {
+ display: block;
+ }
+ }
+ }
+
+ iframe, .img-fluid {
+ max-width: 85%;
+ display: inline;
+ }
+
+ pre {
+ max-height: 350px;
+
+ code {
+ white-space: pre;
+ word-wrap: normal;
+ min-width: 100%;
+ }
+ }
+
+ @include media-breakpoint-down(sm) {
+ pre {
+ max-height: 250px;
+ }
+ }
+ }
+ }
+
+ .pagination-block {
+ position: fixed;
+ bottom: 0px;
+ right: 0px;
+ z-index: 100;
+ transition: opacity 250ms ease-in;
+ opacity: 0;
+
+ .pagination-text {
+ position: relative;
+ top: -3px;
+ font-weight: bolder;
+ }
+
+ &.ready {
+ opacity: 1;
+ }
+
+ .wrapper {
+ padding: 5px 0px 5px 0px;
+ .dropdown-toggle {
+ padding-left: 20px;
+ padding-right: 20px;
+ padding-top: 10px;
+ }
+ .dropdown-menu {
+ width: 475px;
+
+ li {
+ padding: 15px;
+ }
+ .post-content {
+ height: 350px;
+ overflow: hidden;
+ }
+ .scroller-container {
+ height: 300px;
+ border-right: 3px solid $gray-200;
+ margin-right: 3px;
+ cursor: pointer;
+ .scroller-thumb {
+ height: 40px;
+ position: relative;
+ right: -6px;
+ padding-right: 15px;
+ margin-right: -15px;
+
+
+ .scroller-thumb-icon {
+ width: 9px;
+ height: 40px;
+ background-color: $primary;
+ position: relative;
+ display: inline-block;
+ border-radius: 3px;
+ }
+ .thumb-text {
+ font-weight: bolder;
+ user-select: none;
+ position: relative;
+ top: -15px;
+ padding-right: 10px;
+ }
+ }
+ }
+ }
+ @include media-breakpoint-down(sm) {
+ .dropdown-menu {
+ width: 100%;
+ }
+ }
+ }
+ .progress-bar {
+ display:block;
+ z-index: -1;
+ position: absolute;
+ transition: width 50ms ease-in;
+ height: 100%;
+ }
+ }
+ @include media-breakpoint-down(sm) {
+ .pagination-block {
+ width: 100%;
+ }
+ }
+}
+
+.thread_active_users {
+ text-transform: initial;
+
+ a[data-uid] {
+ position: relative;
+
+ img, .user-icon {
+ @include user-icon-style(20px, 1rem, 50%);
+ vertical-align: middle;
+ margin: 0 7px;
+ }
+
+ &::after {
+ position: absolute;
+ z-index: 0;
+ opacity: 0;
+
+ font-family: "FontAwesome";
+ content: "\f11c";
+ padding: 4px 0.25em;
+ top: -36px;
+ left: 7px;
+
+ @include transition("opacity ease 250ms, top ease 250ms")
+ }
+
+ &.replying::after {
+ opacity: 1;
+ top: -50px;
+ animation: topic-reply-pulse 2s ease-in infinite;
+ }
+ }
+
+ .anonymous-box {
+ border: 1px solid #ddd;
+ width: 24px;
+ height: 24px;
+ position: relative;
+ text-align: center;
+ }
+}
+
+[component="post"] {
+ >.post-header [component="user/picture"], >.post-header [component="user/status"] {
+ opacity: 1;
+ }
+
+ >.post-header .icon:before {
+ opacity: 0;
+ }
+
+ &.selected {
+ background-color: initial;
+
+ >.post-header .icon:before {
+ border: 1px solid $success;
+ color: $white;
+ background-color: $success;
+ -webkit-transition: .2s ease-in-out all;
+ transition: .2s ease-in-out all;
+ content: fa-content($fa-var-check);
+ padding: 14px;
+ border-radius: 50%;
+ opacity: 1;
+ position: absolute;
+ display: inline-block;
+ font: normal normal normal 14px/1 FontAwesome;
+ }
+
+ >.post-header [component="user/picture"], >.post-header [component="user/status"] {
+ opacity: 0;
+ }
+ }
+}
diff --git a/node_modules/nodebb-theme-persona/scss/topics_list.scss b/node_modules/nodebb-theme-persona/scss/topics_list.scss
new file mode 100644
index 0000000000..9cf4f88ec2
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/topics_list.scss
@@ -0,0 +1,17 @@
+#new-topics-alert {
+ margin-bottom: 0px;
+ padding: 10px 16px;
+}
+
+.topic-list-header {
+ top: calc(var(--panel-offset));
+ background-color: $body-bg;
+ z-index: $zindex-dropdown; // allows for top nav dropdowns to appear on top
+ border-top: 1px solid $post-border-color;
+ border-bottom: 1px solid $post-border-color;
+}
+
+.topic-list .title small {
+ font-size: 12px;
+ font-weight: normal;
+}
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/scss/variables.scss b/node_modules/nodebb-theme-persona/scss/variables.scss
new file mode 100644
index 0000000000..53da97114f
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/scss/variables.scss
@@ -0,0 +1,7 @@
+//== Topic List
+//
+//## Post objects found on the category, recent, popular, etc. pages
+
+$post-padding: 20px;
+$post-border-color: $gray-200;
+$post-highlight: $info;
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/best.tpl b/node_modules/nodebb-theme-persona/templates/account/best.tpl
new file mode 100644
index 0000000000..21b7d5b195
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/best.tpl
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/blocks.tpl b/node_modules/nodebb-theme-persona/templates/account/blocks.tpl
new file mode 100644
index 0000000000..cc0392f559
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/blocks.tpl
@@ -0,0 +1,46 @@
+
+[[pages:account/blocks, {username}]]
+
+
+
+
+ {{{ each users }}}
+
+
+ [[user:unblock-user]]
+
+ {{{ end }}}
+
+
style="display: none;">[[user:has-no-blocks]]
+
+
+
+
+
diff --git a/node_modules/nodebb-theme-persona/templates/account/bookmarks.tpl b/node_modules/nodebb-theme-persona/templates/account/bookmarks.tpl
new file mode 100644
index 0000000000..21b7d5b195
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/bookmarks.tpl
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/categories.tpl b/node_modules/nodebb-theme-persona/templates/account/categories.tpl
new file mode 100644
index 0000000000..0e23757e8d
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/categories.tpl
@@ -0,0 +1,29 @@
+
+
+
+
{title}
+
+
+
+ [[user:change-all]]
+
+
+
+
+
+
+
+ {{{each categories}}}
+
+ {{{end}}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/consent.tpl b/node_modules/nodebb-theme-persona/templates/account/consent.tpl
new file mode 100644
index 0000000000..eaad7332d4
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/consent.tpl
@@ -0,0 +1,69 @@
+
+[[user:consent.title]]
+[[user:consent.lead]]
+[[user:consent.intro]]
+
+
+
+
+
+
+
+ [[user:consent.received]]
+
+
+
+
+ [[user:consent.not-received]]
+
+
+ [[user:consent.give]]
+
+
+
+
+
+
[[user:consent.email-intro]]
+
+
[[user:consent.digest-frequency, {digest.frequency}]]
+
+ [[user:consent.digest-off]]
+
+
+
+
+
+
+
+
+
+
[[user:consent.right-of-access]]
+
[[user:consent.right-of-access-description]]
+
[[user:consent.right-to-rectification]]
+
[[user:consent.right-to-rectification-description]]
+
[[user:consent.right-to-erasure]]
+
[[user:consent.right-to-erasure-description]]
+
[[user:consent.right-to-data-portability]]
+
[[user:consent.right-to-data-portability-description]]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/controversial.tpl b/node_modules/nodebb-theme-persona/templates/account/controversial.tpl
new file mode 100644
index 0000000000..21b7d5b195
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/controversial.tpl
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/downvoted.tpl b/node_modules/nodebb-theme-persona/templates/account/downvoted.tpl
new file mode 100644
index 0000000000..21b7d5b195
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/downvoted.tpl
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/edit.tpl b/node_modules/nodebb-theme-persona/templates/account/edit.tpl
new file mode 100644
index 0000000000..5100dc2167
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/edit.tpl
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
+
[[user:sso.title]]
+
+ {{{each sso}}}
+
+ {{{end}}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/edit/password.tpl b/node_modules/nodebb-theme-persona/templates/account/edit/password.tpl
new file mode 100644
index 0000000000..c7b1d847f1
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/edit/password.tpl
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+ [[user:current-password]]
+ disabled>
+
+
+
+
+ [[user:new-password]]
+
+
+
+
+
+ [[user:confirm-password]]
+
+
+
+
+
+ [[user:change-password]]
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/edit/username.tpl b/node_modules/nodebb-theme-persona/templates/account/edit/username.tpl
new file mode 100644
index 0000000000..fd5de4b7fb
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/edit/username.tpl
@@ -0,0 +1,26 @@
+
+
+
+
+ [[user:username]]
+
+
+
+
+
+
+
+ [[user:current-password]]
+ disabled>
+
+
+
+
+
+
+
+ [[user:change-username]]
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/followers.tpl b/node_modules/nodebb-theme-persona/templates/account/followers.tpl
new file mode 100644
index 0000000000..a1afa2cb71
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/followers.tpl
@@ -0,0 +1,17 @@
+
+
+
+
+
[[pages:{template.name}, {username}]]
+
+
+
+
+
[[user:has-no-follower]]
+
+
+
+
+
+
+
diff --git a/node_modules/nodebb-theme-persona/templates/account/following.tpl b/node_modules/nodebb-theme-persona/templates/account/following.tpl
new file mode 100644
index 0000000000..a6ed8d78a3
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/following.tpl
@@ -0,0 +1,17 @@
+
+
+
+
+
[[pages:{template.name}, {username}]]
+
+
+
+
+
[[user:follows-no-one]]
+
+
+
+
+
+
+
diff --git a/node_modules/nodebb-theme-persona/templates/account/groups.tpl b/node_modules/nodebb-theme-persona/templates/account/groups.tpl
new file mode 100644
index 0000000000..61e03d7976
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/groups.tpl
@@ -0,0 +1,17 @@
+
+
+
+
[[pages:{template.name}, {username}]]
+
+
+
+
+
[[groups:no-groups-found]]
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/ignored.tpl b/node_modules/nodebb-theme-persona/templates/account/ignored.tpl
new file mode 100644
index 0000000000..238b943cd5
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/ignored.tpl
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/info.tpl b/node_modules/nodebb-theme-persona/templates/account/info.tpl
new file mode 100644
index 0000000000..7ae5ea1394
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/info.tpl
@@ -0,0 +1,292 @@
+
+
+
+
+
+
[[global:sessions]]
+
+
+
+
+
+
+
+
+
+
+
+ {{{each ips}}}
+ {@value}
+ {{{end}}}
+
+
+
+
+
+
+
+
+ {{{ each usernames }}}
+
+ {./value}
+
+
+
+ {{{ end }}}
+
+
+
+
+
+
+
+
+ {{{ each emails }}}
+
+ {./value}
+
+
+ {{{ end }}}
+
+
+
+
+
+
+
+
+
+
[[user:info.moderation-note.add]]
+
+
+ {{{ each moderationNotes }}}
+
+
+
+
+
+
+
+ {./note}
+
+
[[topic:edit]]
+
+
+
+
{./rawNote}
+
+ [[global:cancel]]
+ [[global:save]]
+
+
+
+ {{{ end }}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
[[user:info.no-flags]]
+
+
+
+
+
+
+
+
+
+ {{{ each history.bans }}}
+
+
+
+ {{{ if (./type != "unban") }}}
+
[[user:banned]]
+ {{{ else }}}
+
[[user:unbanned]]
+ {{{ end }}}
+
+
+ [[user:info.banned-reason-label]]: {./reason}
+
+
+ {{{ if ./until }}}
+ [[user:info.banned-until, {isoTimeToLocaleString(./untilISO, config.userLang)}]]
+ {{{ else }}}
+ {{{ if (./type != "unban") }}}
+ [[user:info.banned-permanently]]
+ {{{ end }}}
+ {{{ end }}}
+
+
+ {{{ end }}}
+
+
+
[[user:info.no-ban-history]]
+
+
+
+
+
+
+
+ {{{ if history.mutes.length }}}
+
+ {{{ each history.mutes }}}
+
+
+
+ {{{ if (./type != "unmute") }}}
+
[[user:muted]]
+ {{{ else }}}
+
[[user:unmuted]]
+ {{{ end }}}
+
+
+ [[user:info.banned-reason-label]]: {./reason}
+
+
+ {{{ if ./until }}}
+ [[user:info.muted-until, {isoTimeToLocaleString(./untilISO, config.userLang)}]]
+ {{{ end }}}
+
+
+ {{{ end }}}
+
+ {{{ else }}}
+
[[user:info.no-mute-history]]
+ {{{ end }}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/posts.tpl b/node_modules/nodebb-theme-persona/templates/account/posts.tpl
new file mode 100644
index 0000000000..23a00d898d
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/posts.tpl
@@ -0,0 +1,19 @@
+
+
+
+
{title}
+
+
+
{noItemsFoundKey}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/profile.tpl b/node_modules/nodebb-theme-persona/templates/account/profile.tpl
new file mode 100644
index 0000000000..4c5cee3fd4
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/profile.tpl
@@ -0,0 +1,167 @@
+
+
+
+
{fullname}{username}
+
+
@{username}[[user:banned]]
+
+
+
+
+ [[user:info.banned-until, {banned_until_readable}]]
+
+ [[user:info.banned-permanently]]
+
+
+
+
+
+
+
+ {{{each selectedGroup}}}
+
+
+
+ {{{end}}}
+
+
+
+
+
+
{aboutmeParsed}
+
+
+
+
+
+
{humanReadableNumber(reputation)}
+
[[global:reputation]]
+
+
+
+
+
{humanReadableNumber(profileviews)}
+
[[user:profile-views]]
+
+
+
+
+
+
+
+
+
+
+
[[user:joined]]
+
+
+
[[user:lastonline]]
+
+
+
+
[[user:email]]
+
{email}
+
+
+
+
[[user:website]]
+
{websiteName}
+
+
+
+
[[user:location]]
+
{location}
+
+
+
+
[[user:age]]
+
{age}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{{each ips}}}
+
{ips}
+ {{{end}}}
+
+
+
+
+
+
+
+ {{{ if bestPosts.length }}}
+
+
[[pages:account/best, {username}]]
+
+
+
+ {{{each bestPosts}}}
+
+ {{{end}}}
+
+
+
+ {{{ end }}}
+ {{{ if latestPosts.length}}}
+
+
[[pages:account/latest-posts, {username}]]
+
+
+ {{{each latestPosts}}}
+
+ {{{end}}}
+
+
+
+ {{{ end }}}
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/sessions.tpl b/node_modules/nodebb-theme-persona/templates/account/sessions.tpl
new file mode 100644
index 0000000000..679e0b322d
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/sessions.tpl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
[[user:sessions.description]]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/settings.tpl b/node_modules/nodebb-theme-persona/templates/account/settings.tpl
new file mode 100644
index 0000000000..f7d680c9cc
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/settings.tpl
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
[[user:select-skin]]
+
+
+ {{{each bootswatchSkinOptions}}}
+ selected>{bootswatchSkinOptions.name}
+ {{{end}}}
+
+
+
+
+
+
[[user:select-homepage]]
+
+
+
[[user:homepage]]
+
+
[[user:homepage-description]]
+
+
+
[[user:custom-route]]
+
+
[[user:custom-route-help]]
+
+
+
+
+
[[global:privacy]]
+
+
+
[[user:browsing]]
+
+
+
[[global:pagination]]
+
+
+
[[global:sort]]
+
+
+ [[user:category-topic-sort]]
+
+ [[topic:recently-replied]]
+ [[topic:recently-created]]
+ [[topic:most-posts]]
+ [[topic:most-votes]]
+ [[topic:most-views]]
+
+
+
+ [[user:topic-post-sort]]
+
+ [[topic:oldest-to-newest]]
+ [[topic:newest-to-oldest]]
+ [[topic:most-votes]]
+
+
+
+
+
+
[[global:email]]
+
+
+
[[user:digest-label]]
+
+ {{{each dailyDigestFreqOptions}}}
+ selected="1">{dailyDigestFreqOptions.name}
+ {{{end}}}
+
+
[[user:digest-description]]
+
+
+
+
+ {{{each customSettings}}}
+
{customSettings.title}
+
+ {customSettings.content}
+
+ {{{end}}}
+
+
+
+
+
[[global:language]]
+
+
+
+
+ {{{each languages}}}
+ selected>{languages.name} ({languages.code})
+ {{{end}}}
+
+
+
+
+
+
[[user:acp-language]]
+
+
+
+ {{{each acpLanguages}}}
+ selected>{acpLanguages.name} ({acpLanguages.code})
+ {{{end}}}
+
+
+
+
+
+
+
+
[[topic:watch]]
+
+
+ checked />
+
+ [[user:follow-topics-you-create]]
+
+
+
+ checked/>
+
+ [[user:follow-topics-you-reply-to]]
+
+
+
+ [[user:default-category-watch-state]]
+
+ selected>[[category:tracking]]
+ selected>[[category:not-watching]]
+ selected>[[category:ignoring]]
+
+
+
+
+
+
[[user:notifications]]
+
+ {{{each notificationSettings}}}
+
+
+ {notificationSettings.label}
+
+
+
+ selected>[[notifications:none]]
+ selected>[[notifications:notification-only]]
+ selected>[[notifications:email-only]]
+ selected>[[notifications:notification-and-email]]
+
+
+
+ {{{end}}}
+
+
+
+ [[user:upvote-notif-freq]]
+
+
+
+ {{{each upvoteNotifFreq}}}
+ selected>
+ [[user:upvote-notif-freq.{upvoteNotifFreq.name}]]
+
+ {{{end}}}
+
+
+
+
+
+
+
+
+
diff --git a/node_modules/nodebb-theme-persona/templates/account/tags.tpl b/node_modules/nodebb-theme-persona/templates/account/tags.tpl
new file mode 100644
index 0000000000..4834eb1714
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/tags.tpl
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/theme.tpl b/node_modules/nodebb-theme-persona/templates/account/theme.tpl
new file mode 100644
index 0000000000..13a6305180
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/theme.tpl
@@ -0,0 +1,26 @@
+
+
+
[[themes/persona:settings.intro]]
+
+
+
+
+
+
+ [[themes/persona:settings.mobile-menu-side]]
+
+
+
+ [[themes/persona:settings.autoHidingNavbar]]
+
+ [[themes/persona:settings.autoHidingNavbar-xs]]
+ [[themes/persona:settings.autoHidingNavbar-sm]]
+ [[themes/persona:settings.autoHidingNavbar-md]]
+ [[themes/persona:settings.autoHidingNavbar-lg]]
+
+
+
+ [[global:save-changes]]
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/topics.tpl b/node_modules/nodebb-theme-persona/templates/account/topics.tpl
new file mode 100644
index 0000000000..938b2e6d41
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/topics.tpl
@@ -0,0 +1,30 @@
+
+
+
+
{title}
+
+
+
+ [[topic:sort-by]]
+
+
+
+
+
+
+
{noItemsFoundKey}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/uploads.tpl b/node_modules/nodebb-theme-persona/templates/account/uploads.tpl
new file mode 100644
index 0000000000..31e03e609a
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/uploads.tpl
@@ -0,0 +1,43 @@
+
+
+
{title}
+
+
+
[[uploads:private-uploads-info]]
+
+
[[uploads:public-uploads-info]]
+
+
+
+
[[uploads:no-uploads-found]]
+
+
+
+
+
+
+
+
+
+
+
+ {{{each uploads}}}
+
+
+ {uploads.url}
+
+
+
+
+
+
+
+ {{{end}}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/upvoted.tpl b/node_modules/nodebb-theme-persona/templates/account/upvoted.tpl
new file mode 100644
index 0000000000..21b7d5b195
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/upvoted.tpl
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/account/watched.tpl b/node_modules/nodebb-theme-persona/templates/account/watched.tpl
new file mode 100644
index 0000000000..238b943cd5
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/account/watched.tpl
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/node_modules/nodebb-theme-persona/templates/admin/plugins/persona.tpl b/node_modules/nodebb-theme-persona/templates/admin/plugins/persona.tpl
new file mode 100644
index 0000000000..955f863801
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/admin/plugins/persona.tpl
@@ -0,0 +1,24 @@
+
diff --git a/node_modules/nodebb-theme-persona/templates/categories.tpl b/node_modules/nodebb-theme-persona/templates/categories.tpl
new file mode 100644
index 0000000000..e977c4c4b7
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/categories.tpl
@@ -0,0 +1,31 @@
+
+
+ {{{ each widgets.header }}}
+ {{widgets.header.html}}
+ {{{ end }}}
+
+
+
+
+
+
+ {{{ each widgets.footer }}}
+ {{widgets.footer.html}}
+ {{{ end }}}
+
diff --git a/node_modules/nodebb-theme-persona/templates/category.tpl b/node_modules/nodebb-theme-persona/templates/category.tpl
new file mode 100644
index 0000000000..bf3b81c1aa
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/category.tpl
@@ -0,0 +1,63 @@
+
+
+ {{{ each widgets.header }}}
+ {{widgets.header.html}}
+ {{{ end }}}
+
+
+
+
+
+
+ {{{each widgets.footer}}}
+ {{widgets.footer.html}}
+ {{{end}}}
+
+
+
+
+
+
+
diff --git a/node_modules/nodebb-theme-persona/templates/flags/detail.tpl b/node_modules/nodebb-theme-persona/templates/flags/detail.tpl
new file mode 100644
index 0000000000..bcce35240b
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/flags/detail.tpl
@@ -0,0 +1,208 @@
+
+
+
+
+
+ {target_readable}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
[[flags:target-purged]]
+
+
+
+
+
+
+
+
+
+
[[flags:state]]
+
+ [[flags:state-open]]
+ [[flags:state-wip]]
+ [[flags:state-resolved]]
+ [[flags:state-rejected]]
+
+
+
+
[[flags:assignee]]
+
+ [[flags:no-assignee]]
+ {{{each assignees}}}
+ {../username}
+ {{{end}}}
+
+
+
+ [[flags:update]]
+
+
+
+
+
+
+
+
+
[[flags:notes]]
+ [[flags:add-note]]
+
+
+
+
+
+
+
[[flags:no-notes]]
+
+ {{{each notes}}}
+
+ {{{end}}}
+
+
+
+
[[flags:quick-actions]]
+
+
+
+
+
+
[[flags:history]]
+
+
+
[[flags:no-history]]
+
+ {{{each history}}}
+
+
+
+
+
+ {{{each ./fields}}}
+
+ [[flags:{@key}]] → {@value}
+
+ {{{end}}}
+ {{{ each ./meta }}}
+
+ {{./key}} {{{ if ./value }}} → {{ ./value }} {{{ end }}}
+
+ {{{ end }}}
+
+
+
+ {{{end}}}
+
+
+
+
+
diff --git a/node_modules/nodebb-theme-persona/templates/flags/list.tpl b/node_modules/nodebb-theme-persona/templates/flags/list.tpl
new file mode 100644
index 0000000000..b28213395b
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/flags/list.tpl
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[flags:bulk-actions]]
+
+
+
+
+
+
+
+
+
diff --git a/node_modules/nodebb-theme-persona/templates/footer.tpl b/node_modules/nodebb-theme-persona/templates/footer.tpl
new file mode 100644
index 0000000000..afafc19045
--- /dev/null
+++ b/node_modules/nodebb-theme-persona/templates/footer.tpl
@@ -0,0 +1,11 @@
+
+
+ {{{ if !isSpider }}}
+
+
+
+ {{{ end }}}
+
+
+