Socket
Socket
Sign inDemoInstall

nodebb-theme-oxide

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodebb-theme-oxide - npm Package Compare versions

Comparing version 5.0.24 to 5.0.27

.eslintrc.js

2

.github/ISSUE_TEMPLATE/bug_report.md

@@ -11,3 +11,3 @@ ---

**Smartphone / Desktop:** (please complete the following information)
- **NodeBB version:**
- **NodeBB version:**
- **NodeBB git hash:** (git rev-parse HEAD)

@@ -14,0 +14,0 @@ - **Device:**

{
"mobile-menu-side": "Menüposition der mobilen Seiten umschalten",
"theme-settings": "Themen Einstellungen",
"hide-sub-category": "Unterkategorien in der Kategorieansicht ausblenden",
"hide-last-entry": "Blenden Sie den letzten Eintrag in der Kategorieansicht aus",
"enable-quick-reply": "Aktivieren Sie die schnelle Antwort",
"card-information": "Information über ",
"aboutme": "Über mich",
"not-support-js": "Ihr Browser scheint kein JavaScript zu unterstützen. Dies führt dazu, dass Ihre Anzeige weniger wird und Sie möglicherweise einige Aktionen nicht ausführen können",
"download-brower-js": "Laden Sie einen Browser herunter, der JavaScript unterstützt, oder aktivieren Sie ihn, wenn er deaktiviert ist (z. B. NoScript).",
"last-post": "Laatste bericht",
"show-topic-tid": "ID-Thema im Titel anzeigen",
"quick-reply-placeholder": "Nachrichteninhalt",
"enable-category-icon": "Kategorie-Icons anzeigen",
"bagde-title": "Abzeichen",
"enable-show-user-all-groups-in-profile": "Alle Benutzergruppen in der Profilansicht anzeigen",
"rediect": "Externer Link",
"show-more": "Zeig mehr",
"topic-created": "Thema erstellt",
"account-ips": "Zeigen Sie die IP-Liebe des Benutzers im Profil an",
"toggle-theme-text": "Dunkles Thema"
}
"mobile-menu-side": "Menüposition der mobilen Seiten umschalten",
"theme-settings": "Themen Einstellungen",
"hide-sub-category": "Unterkategorien in der Kategorieansicht ausblenden",
"hide-last-entry": "Blenden Sie den letzten Eintrag in der Kategorieansicht aus",
"enable-quick-reply": "Aktivieren Sie die schnelle Antwort",
"card-information": "Information über ",
"aboutme": "Über mich",
"not-support-js": "Ihr Browser scheint kein JavaScript zu unterstützen. Dies führt dazu, dass Ihre Anzeige weniger wird und Sie möglicherweise einige Aktionen nicht ausführen können",
"download-brower-js": "Laden Sie einen Browser herunter, der JavaScript unterstützt, oder aktivieren Sie ihn, wenn er deaktiviert ist (z. B. NoScript).",
"last-post": "Laatste bericht",
"show-topic-tid": "ID-Thema im Titel anzeigen",
"quick-reply-placeholder": "Nachrichteninhalt",
"enable-category-icon": "Kategorie-Icons anzeigen",
"bagde-title": "Abzeichen",
"enable-show-user-all-groups-in-profile": "Alle Benutzergruppen in der Profilansicht anzeigen",
"rediect": "Externer Link",
"show-more": "Zeig mehr",
"topic-created": "Thema erstellt",
"account-ips": "Zeigen Sie die IP-Liebe des Benutzers im Profil an",
"toggle-theme-text": "Dunkles Thema"
}
{
"mobile-menu-side": "Switch which side each mobile menu is on",
"theme-settings": "Theme settings",
"hide-sub-category": "Hide sub-categories in the category view",
"hide-last-entry": "Hide the last entry in the category view",
"enable-quick-reply": "Turn on the quick reply",
"card-information": "Information about ",
"aboutme": "About me",
"not-support-js": "Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you may not be able to execute some actions.",
"download-brower-js": "Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).",
"last-post": "Last post",
"show-topic-tid": "Show ID topic in title",
"quick-reply-placeholder": "Message content",
"enable-category-icon": "Show category icons",
"bagde-title": "Badges",
"enable-show-user-all-groups-in-profile": "Show all user groups in profile view",
"rediect": "External link",
"show-more": "Show more",
"topic-created": "Topic created",
"account-ips": "Show the user IPs in the profile",
"toggle-theme-text": "Dark theme"
}
"mobile-menu-side": "Switch which side each mobile menu is on",
"theme-settings": "Theme settings",
"hide-sub-category": "Hide sub-categories in the category view",
"hide-last-entry": "Hide the last entry in the category view",
"enable-quick-reply": "Turn on the quick reply",
"card-information": "Information about ",
"aboutme": "About me",
"not-support-js": "Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you may not be able to execute some actions.",
"download-brower-js": "Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).",
"last-post": "Last post",
"show-topic-tid": "Show ID topic in title",
"quick-reply-placeholder": "Message content",
"enable-category-icon": "Show category icons",
"bagde-title": "Badges",
"enable-show-user-all-groups-in-profile": "Show all user groups in profile view",
"rediect": "External link",
"show-more": "Show more",
"topic-created": "Topic created",
"account-ips": "Show the user IPs in the profile",
"toggle-theme-text": "Dark theme"
}
{
"mobile-menu-side": "Switch which side each mobile menu is on",
"theme-settings": "Theme settings",
"hide-sub-category": "Hide sub-categories in the category view",
"hide-last-entry": "Hide the last entry in the category view",
"enable-quick-reply": "Turn on the quick reply",
"card-information": "Information about ",
"aboutme": "About me",
"not-support-js": "Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you may not be able to execute some actions.",
"download-brower-js": "Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).",
"last-post": "Last post",
"show-topic-tid": "Show ID topic in title",
"quick-reply-placeholder": "Message content",
"enable-category-icon": "Show category icons",
"bagde-title": "Badges",
"enable-show-user-all-groups-in-profile": "Show all user groups in profile view",
"rediect": "External link",
"show-more": "Show more",
"topic-created": "Topic created",
"account-ips": "Show the user IPs in the profile",
"toggle-theme-text": "Dark theme"
}
"mobile-menu-side": "Switch which side each mobile menu is on",
"theme-settings": "Theme settings",
"hide-sub-category": "Hide sub-categories in the category view",
"hide-last-entry": "Hide the last entry in the category view",
"enable-quick-reply": "Turn on the quick reply",
"card-information": "Information about ",
"aboutme": "About me",
"not-support-js": "Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you may not be able to execute some actions.",
"download-brower-js": "Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).",
"last-post": "Last post",
"show-topic-tid": "Show ID topic in title",
"quick-reply-placeholder": "Message content",
"enable-category-icon": "Show category icons",
"bagde-title": "Badges",
"enable-show-user-all-groups-in-profile": "Show all user groups in profile view",
"rediect": "External link",
"show-more": "Show more",
"topic-created": "Topic created",
"account-ips": "Show the user IPs in the profile",
"toggle-theme-text": "Dark theme"
}
{
"mobile-menu-side": "Menu mobilne po prawej stronie",
"theme-settings": "Ustawienia tematu",
"hide-sub-category": "Ukryj podkategorie w widoku kategorii",
"hide-last-entry": "Ukryj ostatni wpis w widoku kategorii",
"enable-quick-reply": "Włącz szybką odpowiedź",
"card-information": "Informacje o ",
"aboutme": "O mnie",
"not-support-js": "Twoja przeglądarka prawdopodobnie nie obsługuje JavaScript. W rezultacie wrażenia z oglądania zostaną zmniejszone, a wykonanie niektórych czynności może nie być możliwe.",
"download-brower-js": "Pobierz przeglądarkę obsługującą JavaScript lub włącz ją, jeśli jest wyłączona (np. NoScript).",
"last-post": "Ostatni post",
"show-topic-tid": "Pokaż ID tematu w poście",
"quick-reply-placeholder": "Treść wiadomości",
"enable-category-icon": "Pokaż ikony kategori",
"bagde-title": "Plakietki",
"enable-show-user-all-groups-in-profile": "Pokaż wszystkie grupy użytkowników w widoku profilu",
"rediect": "Link zewnętrzny",
"show-more": "Pokaż więcej",
"topic-created": "Temat utworzony",
"account-ips": "Pokazuj adresy IP użytkownika w profilu",
"toggle-theme-text": "Ciemny motyw"
}
"mobile-menu-side": "Menu mobilne po prawej stronie",
"theme-settings": "Ustawienia tematu",
"hide-sub-category": "Ukryj podkategorie w widoku kategorii",
"hide-last-entry": "Ukryj ostatni wpis w widoku kategorii",
"enable-quick-reply": "Włącz szybką odpowiedź",
"card-information": "Informacje o ",
"aboutme": "O mnie",
"not-support-js": "Twoja przeglądarka prawdopodobnie nie obsługuje JavaScript. W rezultacie wrażenia z oglądania zostaną zmniejszone, a wykonanie niektórych czynności może nie być możliwe.",
"download-brower-js": "Pobierz przeglądarkę obsługującą JavaScript lub włącz ją, jeśli jest wyłączona (np. NoScript).",
"last-post": "Ostatni post",
"show-topic-tid": "Pokaż ID tematu w poście",
"quick-reply-placeholder": "Treść wiadomości",
"enable-category-icon": "Pokaż ikony kategori",
"bagde-title": "Plakietki",
"enable-show-user-all-groups-in-profile": "Pokaż wszystkie grupy użytkowników w widoku profilu",
"rediect": "Link zewnętrzny",
"show-more": "Pokaż więcej",
"topic-created": "Temat utworzony",
"account-ips": "Pokazuj adresy IP użytkownika w profilu",
"toggle-theme-text": "Ciemny motyw"
}

@@ -1,18 +0,16 @@

'use strict';
/* globals $, app */
"use strict";
define('admin/plugins/oxide', ['settings'], function(Settings) {
define("admin/plugins/oxide", ["settings"], (settings) => {
let ACP = {};
var ACP = {};
ACP.init = () => {
settings.load("oxide", $(".oxide-settings"));
ACP.init = function() {
Settings.load('oxide', $('.oxide-settings'));
$('#save').on('click', function() {
Settings.save('oxide', $('.oxide-settings'), function() {
$("#save").on("click", () => {
settings.save("oxide", $(".oxide-settings"), () => {
app.alert({
type: 'success',
alert_id: 'oxide-saved',
title: 'Settings Saved',
message: 'Oxide settings saved'
type: "success",
alert_id: "oxide-saved",
title: "Settings Saved",
message: "Oxide settings saved",
});

@@ -24,2 +22,2 @@ });

return ACP;
});
});
"use strict";
/*globals $, app, ajaxify, socket*/
/*globals ajaxify, socket*/
define('oxide/quickreply', ['components', 'composer/autocomplete'], function (components, autocomplete) {
var QuickReply = {};
define("oxide/quickreply", ["components", "composer/autocomplete"], (components, autocomplete) => {
let QuickReply = {};
QuickReply.init = function () {
var element = components.get('topic/quickreply/text');
var data = {
QuickReply.init = () => {
const element = components.get("topic/quickreply/text");
const data = {
element: element,

@@ -16,23 +15,24 @@ strategies: [],

style: {
'z-index': 100,
}
}
"z-index": 100,
},
},
};
$(window).trigger('composer:autocomplete:init', data);
autocomplete._active['oxide_qr'] = autocomplete.setup(data);
$(window).trigger("composer:autocomplete:init", data);
components.get('topic/quickreply/button').on('click', function (e) {
autocomplete._active["oxide_qr"] = autocomplete.setup(data);
components.get("topic/quickreply/button").on("click", (e) => {
e.preventDefault();
var replyMsg = components.get('topic/quickreply/text').val();
var replyData = {
const replyMsg = components.get("topic/quickreply/text").val();
const replyData = {
tid: ajaxify.data.tid,
handle: undefined,
content: replyMsg
content: replyMsg,
};
socket.emit('posts.reply', replyData, function (err, data) {
if (err) {
app.alertError(err.message);
}
socket.emit("posts.reply", replyData, (err, data) => {
if (err) return app.alertError(err.message);
if (data && data.queued) {

@@ -42,4 +42,4 @@ app.alertSuccess(data.message);

components.get('topic/quickreply/text').val('');
autocomplete._active['oxide_qr'].hide();
components.get("topic/quickreply/text").val("");
autocomplete._active["oxide_qr"].hide();
});

@@ -50,2 +50,2 @@ });

return QuickReply;
});
});

@@ -0,34 +1,38 @@

/* globals ajaxify */
(() => {
"use strict";
const setTheme = (bool) => {
document.documentElement.setAttribute("dark", bool);
localStorage.setItem("user:dark", bool);
}
const setTheme = (isDark) => {
const safeBool = Boolean(isDark);
document.documentElement.setAttribute("dark", safeBool);
localStorage.setItem("user:dark", safeBool);
};
const toggleTheme = (e) => {
const classBtn = e.target;
e.stopPropagation();
if (classBtn.className === "off") {
const { target } = e;
if (target.classList.contains("off")) {
setTheme(true);
classBtn.className = "on";
target.classList.add("on");
} else {
setTheme(false);
classBtn.className = "off";
target.classList.add("off");
}
}
};
const addButton = () => {
if (ajaxify.data.loggedIn) {
const toggleBtn = document.querySelector("#toggle-theme");
isDark ? toggleBtn.classList.add("on") : toggleBtn.classList.add("off");
if (!ajaxify.data.loggedIn) return null;
toggleBtn.addEventListener("click", toggleTheme, false);
} else {
return null;
}
}
const toggleBtn = document.querySelector("#toggle-theme");
isDark ? toggleBtn.classList.add("on") : toggleBtn.classList.add("off");
toggleBtn.addEventListener("click", toggleTheme);
};
const isDark = JSON.parse(localStorage.getItem("user:dark"));

@@ -39,2 +43,2 @@

$(window).on("action:ajaxify.end", addButton);
})()
})();
"use strict";
/*globals ajaxify, config, utils, app, socket, NProgress*/
/*globals ajaxify, config, utils, socket, NProgress*/
$(document).ready(function() {
setupNProgress();
setupTaskbar();
setupEditedByIcon();
setupMobileMenu();
setupQuickReply();
configureNavbarHiding();
fixHeaderPadding();
$(document).ready(() => {
const fixHeaderPadding = () => {
const env = utils.findBootstrapEnvironment();
$(window).on('resize', utils.debounce(configureNavbarHiding, 200));
$(window).on('resize', fixHeaderPadding);
if (env === "sm" || env === "xs" || env === "md") {
return $("#panel").css("padding-top", $("#header-menu").outerHeight(true));
}
$(window).on('action:app.loggedIn', function () {
setupMobileMenu();
});
$("#panel").css("padding-top", $("#header-menu").outerHeight(true) - 70);
};
function fixHeaderPadding() {
var env = utils.findBootstrapEnvironment();
if (env === 'sm' || env === 'xs' || env === 'md') {
$('#panel').css('padding-top', $('#header-menu').outerHeight(true));
} else {
$('#panel').css('padding-top', $('#header-menu').outerHeight(true) - 70);
}
}
const configureNavbarHiding = () => {
let navbarEl = $(".navbar-fixed-top");
function configureNavbarHiding() {
var navbarEl = $(".navbar-fixed-top");
navbarEl.autoHidingNavbar('destroy');
navbarEl.css('top', '');
navbarEl.autoHidingNavbar("destroy");
navbarEl.css("top", "");
var env = utils.findBootstrapEnvironment();
if (env === 'xs' || env === 'sm') {
const env = utils.findBootstrapEnvironment();
if (env === "xs" || env === "sm")
navbarEl.autoHidingNavbar({
showOnBottom: false,
});
}
}
};
function setupNProgress() {
$(window).on('action:ajaxify.start', function() {
const setupNProgress = () => {
$(window).on("action:ajaxify.start", () => {
NProgress.set(0.7);
});
$(window).on('action:ajaxify.end', function(ev, data) {
$(window).on("action:ajaxify.end", (ev, { url = "" }) => {
NProgress.done();
setupHoverCards();
if (data.url && data.url.match('user/')) {
setupFavouriteButtonOnProfile();
}
if (url && url.match("user/")) setupFavouriteButtonOnProfile();
});
}
};
function setupTaskbar() {
$(window).on('filter:taskbar.push', function (ev, data) {
data.options.className = 'taskbar-' + data.module;
const setupTaskbar = () => {
const createChatIcon = (data) => {
const URL = `${config.relative_path}/api/user/${app.user.userslug}/chats/${data.options.roomId}`;
if (data.module === 'composer') {
data.options.icon = 'fa-commenting-o';
} else if (data.module === 'chat') {
if (!data.element.length) {
createChatIcon(data);
$(window).one('action:taskbar.pushed', function (ev, data) {
updateChatCount(data.element);
});
$.getJSON(URL, (chatObj) => {
const el = $(`#taskbar [data-uuid="${data.uuid}"] a`);
} else if (!data.element.hasClass('active')) {
updateChatCount(data.element);
el.parent("[data-uuid]").attr("data-roomId", data.options.roomId);
if (chatObj.users.length === 1) {
const [user] = chatObj.users;
el.find("i").remove();
if (user.picture) return el.css("background-image", "url(" + user.picture + ")");
el.css("background-color", user["icon:bgColor"])
.text(user["icon:text"])
.addClass("user-icon");
}
}
});
});
};
socket.on('event:chats.markedAsRead', function (data) {
$('#taskbar [data-roomId="' + data.roomId + '"]')
.removeClass('new')
.attr('data-content', 0);
const updateChatCount = (el) => {
const count = (parseInt($(el).attr("data-content"), 10) || 0) + 1;
$(el).attr("data-content", count);
};
socket.on("event:chats.markedAsRead", ({ roomId }) => {
$(`#taskbar [data-roomId="${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) {
var el = $('#taskbar [data-uuid="' + data.uuid + '"] a');
el.parent('[data-uuid]').attr('data-roomId', data.options.roomId);
$(window).on("filter:taskbar.push", (ev, data) => {
const { options, module, element } = data || {};
if (chatObj.users.length === 1) {
var user = chatObj.users[0];
el.find('i').remove();
options.className = "taskbar-" + module;
if (user.picture) {
el.css('background-image', 'url(' + user.picture + ')');
} else {
el.css('background-color', user['icon:bgColor'])
.text(user['icon:text'])
.addClass('user-icon');
}
if (module === "composer") return (options.icon = "fa-commenting-o");
if (module === "chat") {
if (!element.length) {
createChatIcon(data);
$(window).one("action:taskbar.pushed", () => updateChatCount(element));
} else if (!element.hasClass("active")) {
updateChatCount(element);
}
});
}
}
});
};
function updateChatCount(el) {
var count = (parseInt($(el).attr('data-content'), 10) || 0) + 1;
$(el).attr('data-content', count);
}
}
// this...
function setupEditedByIcon() {
function activateEditedTooltips() {
$('[data-pid] [component="post/editor"]').each(function() {
var el = $(this), icon;
var el = $(this),
icon;
if (!el.attr('data-editor')) {
if (!el.attr("data-editor")) {
return;
}
icon = el.closest('[data-pid]').find('.edit-icon').first();
icon.prop('title', el.text()).tooltip('fixTitle').removeClass('hidden');
icon = el
.closest("[data-pid]")
.find(".edit-icon")
.first();
icon
.prop("title", el.text())
.tooltip("fixTitle")
.removeClass("hidden");
});
}
$(window).on('action:posts.edited', function(ev, data) {
$(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 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('fixTitle').removeClass('hidden');
icon
.prop("title", el.text())
.tooltip("fixTitle")
.removeClass("hidden");
});
$(window).on('action:topic.loaded', activateEditedTooltips);
$(window).on('action:posts.loaded', activateEditedTooltips);
$(window).on("action:topic.loaded", activateEditedTooltips);
$(window).on("action:posts.loaded", activateEditedTooltips);
}
// Not edited
function setupMobileMenu() {

@@ -141,16 +147,15 @@ if (!window.addEventListener) {

require(['pulling', 'storage'], function (Pulling, Storage) {
require(["pulling", "storage"], function(Pulling, Storage) {
// initialization
var chatMenuVisible = !config.disableChat && app.user && parseInt(app.user.uid, 10);
var swapped = !!Storage.getItem('oxide:menus:legacy-layout');
var swapped = !!Storage.getItem("oxide:menus:legacy-layout");
var margin = window.innerWidth;
if (swapped) {
$('#mobile-menu').removeClass('pull-left');
$('#mobile-chats').addClass('pull-left');
$("#mobile-menu").removeClass("pull-left");
$("#mobile-chats").addClass("pull-left");
}
if (document.documentElement.getAttribute('data-dir') === 'rtl') {
if (document.documentElement.getAttribute("data-dir") === "rtl") {
swapped = !swapped;

@@ -160,9 +165,9 @@ }

var navSlideout = Pulling.create({
panel: document.getElementById('panel'),
menu: document.getElementById('menu'),
panel: document.getElementById("panel"),
menu: document.getElementById("menu"),
width: 256,
margin: margin,
side: swapped ? 'right' : 'left',
side: swapped ? "right" : "left",
});
$('#menu').removeClass('hidden');
$("#menu").removeClass("hidden");

@@ -172,9 +177,9 @@ var chatsSlideout;

chatsSlideout = Pulling.create({
panel: document.getElementById('panel'),
menu: document.getElementById('chats-menu'),
panel: document.getElementById("panel"),
menu: document.getElementById("chats-menu"),
width: 256,
margin: margin,
side: swapped ? 'left' : 'right',
side: swapped ? "left" : "right",
});
$('#chats-menu').removeClass('hidden');
$("#chats-menu").removeClass("hidden");
}

@@ -186,27 +191,31 @@

navSlideout.close();
if (chatsSlideout) { chatsSlideout.close(); }
if (chatsSlideout) {
chatsSlideout.close();
}
}
function onBeforeOpen() {
document.documentElement.classList.add('slideout-open');
document.documentElement.classList.add("slideout-open");
}
function onClose() {
$('#mobile-menu').blur();
document.documentElement.classList.remove('slideout-open');
$('#panel').off('click', closeOnClick);
$("#mobile-menu").blur();
document.documentElement.classList.remove("slideout-open");
$("#panel").off("click", closeOnClick);
}
$(window).on('resize action:ajaxify.start', function () {
$(window).on("resize action:ajaxify.start", function() {
navSlideout.close();
if (chatsSlideout) { chatsSlideout.close(); }
$('.account .cover').css('top', $('[component="navbar"]').height());
if (chatsSlideout) {
chatsSlideout.close();
}
$(".account .cover").css("top", $('[component="navbar"]').height());
});
navSlideout
.ignore('code, code *, .preventSlideout, .preventSlideout *')
.on('closed', onClose)
.on('beforeopen', onBeforeOpen)
.on('opened', function () {
$('#panel').one('click', closeOnClick);
.ignore("code, code *, .preventSlideout, .preventSlideout *")
.on("closed", onClose)
.on("beforeopen", onBeforeOpen)
.on("opened", function() {
$("#panel").one("click", closeOnClick);
});

@@ -216,7 +225,7 @@

chatsSlideout
.ignore('code, code *, .preventSlideout, .preventSlideout *')
.on('closed', onClose)
.on('beforeopen', onBeforeOpen)
.on('opened', function () {
$('#panel').one('click', closeOnClick);
.ignore("code, code *, .preventSlideout, .preventSlideout *")
.on("closed", onClose)
.on("beforeopen", onBeforeOpen)
.on("opened", function() {
$("#panel").one("click", closeOnClick);
});

@@ -227,3 +236,3 @@ }

$('#mobile-menu').on('click', function () {
$("#mobile-menu").on("click", function() {
navSlideout.enable().toggle();

@@ -233,3 +242,3 @@ });

function loadNotifications() {
require(['notifications'], function(notifications) {
require(["notifications"], function(notifications) {
notifications.loadNotifications($('#menu [data-section="notifications"] ul'));

@@ -239,17 +248,24 @@ });

navSlideout.on('opened', loadNotifications);
navSlideout.on("opened", loadNotifications);
if (chatMenuVisible) {
navSlideout.on('beforeopen', function () {
chatsSlideout.close();
chatsSlideout.disable();
}).on('closed', function () {
chatsSlideout.enable();
});
navSlideout
.on("beforeopen", function() {
chatsSlideout.close();
chatsSlideout.disable();
})
.on("closed", function() {
chatsSlideout.enable();
});
}
$('#menu [data-section="navigation"] ul').html($('#main-nav').html() + ($('#search-menu').html() || '') + ($('#logged-out-menu').html() || ''));
$('#user-control-list').children().clone(true, true).appendTo($('#menu [data-section="profile"] ul'));
$('#menu [data-section="navigation"] ul').html(
$("#main-nav").html() + ($("#search-menu").html() || "") + ($("#logged-out-menu").html() || "")
);
$("#user-control-list")
.children()
.clone(true, true)
.appendTo($('#menu [data-section="profile"] ul'));
socket.on('event:user_status_change', function (data) {
socket.on("event:user_status_change", function(data) {
if (parseInt(data.uid, 10) === app.user.uid) {

@@ -264,4 +280,4 @@ app.updateUserStatus($('#menu [component="user/status"]'), data.status);

function loadChats() {
require(['chat'], function (chat) {
chat.loadChatsDropdown($('#chats-menu .chat-list'));
require(["chat"], function(chat) {
chat.loadChatsDropdown($("#chats-menu .chat-list"));
});

@@ -271,7 +287,9 @@ }

if (chatMenuVisible) {
$('#mobile-chats').removeClass('hidden').on('click', function() {
navSlideout.close();
chatsSlideout.enable().toggle();
});
$('#chats-menu').on('click', 'li[data-roomid]', function () {
$("#mobile-chats")
.removeClass("hidden")
.on("click", function() {
navSlideout.close();
chatsSlideout.enable().toggle();
});
$("#chats-menu").on("click", "li[data-roomid]", function() {
chatsSlideout.close();

@@ -281,7 +299,7 @@ });

chatsSlideout
.on('opened', loadChats)
.on('beforeopen', function () {
.on("opened", loadChats)
.on("beforeopen", function() {
navSlideout.close().disable();
})
.on('closed', function () {
.on("closed", function() {
navSlideout.enable();

@@ -295,22 +313,26 @@ });

function setupSetting() {
if (ajaxify.data.template['account/settings'] && !document.getElementById('oxide:menus:legacy-layout')) {
require(['translator'], function (translator) {
translator.translate('[[oxide:mobile-menu-side]]', function (translated) {
$('<div class="well checkbox"><label><input type="checkbox" id="oxide:menus:legacy-layout"/><strong>' + translated + '</strong></label></div>')
.appendTo('#content .account > .row > div:first-child')
.find('input')
.prop('checked', Storage.getItem('oxide:menus:legacy-layout', 'true'))
.change(function (e) {
if (ajaxify.data.template["account/settings"] && !document.getElementById("oxide:menus:legacy-layout")) {
require(["translator"], function(translator) {
translator.translate("[[oxide:mobile-menu-side]]", function(translated) {
$(
'<div class="well checkbox"><label><input type="checkbox" id="oxide:menus:legacy-layout"/><strong>' +
translated +
"</strong></label></div>"
)
.appendTo("#content .account > .row > div:first-child")
.find("input")
.prop("checked", Storage.getItem("oxide:menus:legacy-layout", "true"))
.change(function(e) {
if (e.target.checked) {
Storage.setItem('oxide:menus:legacy-layout', 'true');
Storage.setItem("oxide:menus:legacy-layout", "true");
} else {
Storage.removeItem('oxide:menus:legacy-layout');
Storage.removeItem("oxide:menus:legacy-layout");
}
});
});
})
});
}
}
$(window).on('action:ajaxify.end', setupSetting);
$(window).on("action:ajaxify.end", setupSetting);
setupSetting();

@@ -320,9 +342,9 @@ });

// Not edited
function setupHoverCards() {
require(['components'], function (components) {
components.get('topic')
.on('click', '[component="user/picture"],[component="user/status"]', generateUserCard);
require(["components"], function(components) {
components.get("topic").on("click", '[component="user/picture"],[component="user/status"]', generateUserCard);
});
$(window).on('action:posts.loading', function (ev, data) {
$(window).on("action:posts.loading", function(ev, data) {
for (var i = 0, ii = data.posts.length; i < ii; i++) {

@@ -336,4 +358,4 @@ (ajaxify.data.topics || ajaxify.data.posts)[data.posts[i].index] = data.posts[i];

var avatar = $(this),
index = avatar.parents('[data-index]').attr('data-index'),
data = (ajaxify.data.topics || ajaxify.data.posts);
index = avatar.parents("[data-index]").attr("data-index"),
data = ajaxify.data.topics || ajaxify.data.posts;

@@ -347,3 +369,3 @@ for (var i = 0, ii = data.length; i < ii; i++) {

$('.oxide-usercard').remove();
$(".oxide-usercard").remove();

@@ -354,9 +376,9 @@ if (parseInt(data.uid, 10) === 0) {

socket.emit('user.isFollowing', {uid: data.uid}, function(err, isFollowing) {
app.parseAndTranslate('modules/usercard', data, function(html) {
socket.emit("user.isFollowing", { uid: data.uid }, function(err, isFollowing) {
app.parseAndTranslate("modules/usercard", data, function(html) {
var card = $(html);
avatar.parents('a').after(card.hide());
avatar.parents("a").after(card.hide());
if (parseInt(app.user.uid, 10) === parseInt(data.uid, 10) || !app.user.uid) {
card.find('.btn-morph').hide();
card.find(".btn-morph").hide();
} else {

@@ -366,9 +388,9 @@ setupFavouriteMorph(card, data.uid, data.username);

if (isFollowing) {
$('.btn-morph').addClass('heart');
$(".btn-morph").addClass("heart");
} else {
$('.btn-morph').addClass('plus');
$(".btn-morph").addClass("plus");
}
}
utils.makeNumbersHumanReadable(card.find('.human-readable-number'));
utils.makeNumbersHumanReadable(card.find(".human-readable-number"));
setupCardRemoval(card);

@@ -383,25 +405,23 @@ card.fadeIn();

function setupFavouriteButtonOnProfile() {
const setupFavouriteButtonOnProfile = () =>
setupFavouriteMorph($('[component="account/cover"]'), ajaxify.data.uid, ajaxify.data.username);
}
function setupCardRemoval(card) {
function removeCard(ev) {
if ($(ev.target).closest('.oxide-usercard').length === 0) {
card.fadeOut(function() {
card.remove();
});
const setupCardRemoval = (card) => {
const removeCard = ({ target }) => {
if ($(target).closest(".oxide-usercard").length === 0) {
card.fadeOut(() => card.remove());
$(document).off('click', removeCard);
$(document).off("click", removeCard);
}
}
};
$(document).on('click', removeCard);
}
$(document).on("click", removeCard);
};
// this...
function setupFavouriteMorph(parent, uid, username) {
parent.find('.btn-morph').click(function(ev) {
var type = $(this).hasClass('plus') ? 'follow' : 'unfollow';
parent.find(".btn-morph").click(function(ev) {
var type = $(this).hasClass("plus") ? "follow" : "unfollow";
socket.emit('user.' + type, {uid: uid}, function(err) {
socket.emit("user." + type, { uid: uid }, function(err) {
if (err) {

@@ -411,29 +431,46 @@ return app.alertError(err.message);

app.alertSuccess('[[global:alert.' + type + ', ' + username + ']]');
app.alertSuccess("[[global:alert." + type + ", " + username + "]]");
});
$(this).toggleClass('plus').toggleClass('heart');
$(this).translateAttr('title', type === 'follow' ? '[[global:unfollow]]' : '[[global:follow]]');
$(this)
.toggleClass("plus")
.toggleClass("heart");
$(this).translateAttr("title", type === "follow" ? "[[global:unfollow]]" : "[[global:follow]]");
if ($(this).find('b.drop').length === 0) {
if ($(this).find("b.drop").length === 0) {
$(this).prepend('<b class="drop"></b>');
}
var drop = $(this).find('b.drop').removeClass('animate'),
var drop = $(this)
.find("b.drop")
.removeClass("animate"),
x = ev.pageX - drop.width() / 2 - $(this).offset().left,
y = ev.pageY - drop.height() / 2 - $(this).offset().top;
drop.css({top: y + 'px', left: x + 'px'}).addClass('animate');
drop.css({ top: y + "px", left: x + "px" }).addClass("animate");
});
}
function setupQuickReply() {
$(window).on('action:ajaxify.end', function(ev, data) {
if (data.url && data.url.match('^topic/') && config.enableQuickReply) {
require(['oxide/quickreply'], function(quickreply) {
quickreply.init();
});
}
const setupQuickReply = () => {
$(window).on("action:ajaxify.end", (ev, { url = "" }) => {
if (!(url && url.match("^topic/") && config.enableQuickReply)) return;
require(["oxide/quickreply"], (quickreply) => quickreply.init());
});
}
});
};
setupNProgress();
configureNavbarHiding();
setupMobileMenu();
fixHeaderPadding();
setupTaskbar();
setupEditedByIcon();
setupQuickReply();
$(window).on("resize", utils.debounce(configureNavbarHiding, 200));
$(window).on("resize", fixHeaderPadding);
$(window).on("action:app.loggedIn", () => {
setupMobileMenu();
});
});

@@ -1,15 +0,14 @@

'use strict';
"use strict";
var striptags = require('striptags');
var meta = require.main.require('./src/meta');
var user = require.main.require('./src/user');
const striptags = require("striptags");
const meta = require.main.require("./src/meta");
const user = require.main.require("./src/user");
var library = {};
let library = {};
library.init = function(params, callback) {
var app = params.router;
var middleware = params.middleware;
library.init = ({ router, middleware }, callback) => {
const app = router;
app.get('/admin/plugins/oxide', middleware.admin.buildHeader, renderAdmin);
app.get('/api/admin/plugins/oxide', renderAdmin);
app.get("/admin/plugins/oxide", middleware.admin.buildHeader, renderAdmin);
app.get("/api/admin/plugins/oxide", renderAdmin);

@@ -19,7 +18,7 @@ callback();

library.addAdminNavigation = function(header, callback) {
library.addAdminNavigation = (header, callback) => {
header.plugins.push({
route: '/plugins/oxide',
icon: 'fa-paint-brush',
name: 'Oxide Theme'
route: "/plugins/oxide",
icon: "fa-paint-brush",
name: "Oxide Theme",
});

@@ -30,17 +29,16 @@

library.getTeasers = function(data, callback) {
data.teasers.forEach(function(teaser) {
if (teaser && teaser.content) {
teaser.content = striptags(teaser.content, ['img']);
}
});
library.getTeasers = (data, callback) => {
data.teaser.forEach((teaser) =>
teaser && teaser.content ? (teaser.content = striptags(teaser.content, ["img"])) : ""
);
callback(null, data);
};
library.defineWidgetAreas = function(areas, callback) {
areas = areas.concat([
library.defineWidgetAreas = (areas, callback) => {
const localAreas = [
{
name: "Categories Sidebar",
template: "categories.tpl",
location: "sidebar"
location: "sidebar",
},

@@ -50,3 +48,3 @@ {

template: "category.tpl",
location: "sidebar"
location: "sidebar",
},

@@ -56,3 +54,3 @@ {

template: "topic.tpl",
location: "sidebar"
location: "sidebar",
},

@@ -62,3 +60,3 @@ {

template: "categories.tpl",
location: "header"
location: "header",
},

@@ -68,3 +66,3 @@ {

template: "category.tpl",
location: "header"
location: "header",
},

@@ -74,3 +72,3 @@ {

template: "topic.tpl",
location: "header"
location: "header",
},

@@ -80,3 +78,3 @@ {

template: "categories.tpl",
location: "footer"
location: "footer",
},

@@ -86,3 +84,3 @@ {

template: "category.tpl",
location: "footer"
location: "footer",
},

@@ -92,37 +90,48 @@ {

template: "topic.tpl",
location: "footer"
}
]);
location: "footer",
},
];
callback(null, areas);
callback(null, [...areas, ...localAreas]);
};
library.getThemeConfig = function(config, callback) {
meta.settings.get('oxide', function(err, settings) {
if (err) {
return callback(err);
}
config.hideSubCategories = settings.hideSubCategories === 'on';
config.hideCategoryLastPost = settings.hideCategoryLastPost === 'on';
config.enableQuickReply = settings.enableQuickReply === 'on';
config.enableShowTid = settings.enableShowTid === 'on';
config.enableCategoryIcon = settings.enableCategoryIcon === 'on';
config.enableShowUserAllGroupsInProfile = settings.enableShowUserAllGroupsInProfile === 'on';
config.enableShowIpInUserProfile = settings.enableShowIpInUserProfile === 'on';
callback(null, config);
library.getThemeConfig = (config, callback) => {
meta.settings.get("oxide", (err, settings) => {
if (err) return callback(err);
const {
hideSubCategories,
hideCategoryLastPost,
enableQuickReply,
enableShowTid,
enableCategoryIcon,
enableShowUserAllGroupsInProfile,
enableShowIpInUserProfile,
} = settings;
config.hideSubCategories = hideSubCategories === "on";
config.hideCategoryLastPost = hideCategoryLastPost === "on";
config.enableQuickReply = enableQuickReply === "on";
config.enableShowTid = enableShowTid === "on";
config.enableCategoryIcon = enableCategoryIcon === "on";
config.enableShowUserAllGroupsInProfile = enableShowUserAllGroupsInProfile === "on";
config.enableShowIpInUserProfile = enableShowIpInUserProfile === "on";
});
callback(null, config);
};
function renderAdmin(req, res, next) {
res.render('admin/plugins/oxide', {});
}
const renderAdmin = (req, res) => res.render("admin/plugins/oxide");
library.addUserToTopic = function(data, callback) {
if (data.req.user) {
user.getUserData(data.req.user.uid, function(err, userdata) {
if (err) {
return callback(err);
}
library.addUserToTopic = (data, callback) => {
const {
req: { user: reqUser = {} },
} = data;
if (reqUser) {
user.getUserData(reqUser.uid, (err, userdata) => {
if (err) return callback(err);
data.templateData.loggedInUser = userdata;
callback(null, data);

@@ -133,7 +142,8 @@ });

uid: 0,
username: '[[global:guest]]',
username: "[[global:guest]]",
picture: user.getDefaultAvatar(),
'icon:text': '?',
'icon:bgColor': '#aaa',
"icon:text": "?",
"icon:bgColor": "#aaa",
};
callback(null, data);

@@ -143,7 +153,7 @@ }

library.getLinkTags = function (data, callback) {
library.getLinkTags = (data, callback) => {
data.links.push({
rel: 'prefetch stylesheet',
type: '',
href: 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700',
rel: "prefetch stylesheet",
type: "",
href: "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700",
});

@@ -154,2 +164,2 @@

module.exports = library;
module.exports = library;
{
"name": "nodebb-theme-oxide",
"description": "A theme that is based on the GitHub design.",
"version": "5.0.24",
"version": "5.0.27",
"homepage": "https://github.com/youhosi/nodebb-theme-oxide",

@@ -24,7 +24,7 @@ "license": "MIT",

"nbbpm": {
"compatibility": "^1.12.2"
"compatibility": "^1.13.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/youhosi/nodebb-theme-oxide.git"
"url": "git://youhosi/nodebb-theme-oxide.git"
},

@@ -37,3 +37,22 @@ "bugs": {

"striptags": "^3.1.1"
},
"devDependencies": {
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.7.0",
"husky": "^3.1.0",
"lint-staged": "^9.4.3",
"prettier": "^1.19.1"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.+(js)": [
"prettier --config .prettierrc --write",
"eslint --fix",
"git add"
]
}
}

@@ -11,3 +11,3 @@ {

{ "hook": "filter:topic.build", "method": "addUserToTopic" },
{ "hook": "filter:meta.getLinkTags", "method": "getLinkTags"}
{ "hook": "filter:meta.getLinkTags", "method": "getLinkTags" }
],

@@ -24,6 +24,4 @@ "scripts": [

},
"acpScripts": [
"lib/admin.js"
],
"acpScripts": ["lib/admin.js"],
"languages": "languages"
}
}
### :tada: nodebb-theme-oxide
---
NodeBB theme made to look similar to GitHub design.

@@ -7,3 +9,5 @@ Theme itself is not fully done yet, there might still be some places where CSS styling is missing, in addition, some visual components might need to be changed depending on your taste.

### :books: Installation
---
> npm i nodebb-theme-oxide

@@ -17,3 +21,5 @@

### :page_facing_up: Contributing
---
1. Fork it!

@@ -26,2 +32,3 @@ 2. Create your feature branch: git checkout -b my-new-feature

### 🧐 Screenshots
---

@@ -32,2 +39,2 @@

![screenshot](https://raw.githubusercontent.com/youhosi/nodebb-theme-oxide/master/img/screenshot.png "Categories page")
![screenshot](https://raw.githubusercontent.com/youhosi/nodebb-theme-oxide/master/img/screenshot2.png "Categories page")
![screenshot](https://raw.githubusercontent.com/youhosi/nodebb-theme-oxide/master/img/screenshot2.png "Categories page")
{
"id": "nodebb-theme-oxide",
"name": "Oxide",
"description": "A theme that is based on the GitHub design.",
"url": "https://github.com/youhosi/nodebb-theme-oxide",
"screenshot": "./img/screenshot.png"
}
"id": "nodebb-theme-oxide",
"name": "Oxide",
"description": "A theme that is based on the GitHub design.",
"url": "https://github.com/youhosi/nodebb-theme-oxide",
"screenshot": "./img/screenshot.png"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc