Skip to content

Commit

Permalink
ESlint fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjaySunil committed Mar 1, 2021
1 parent e94bd60 commit 4aa4f5a
Show file tree
Hide file tree
Showing 31 changed files with 1,295 additions and 1,292 deletions.
33 changes: 18 additions & 15 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true,
"node": true
},
"extends": [
"google"
],
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
}
}
"env": {
"browser": true,
"commonjs": true,
"es2021": true,
"node": true
},
"extends": [
"google"
],
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"require-jsdoc": 0,
"max-len": 0,
"no-invalid-this": 0
}
}
172 changes: 86 additions & 86 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,92 +5,92 @@
*/

!(function (a) {
"use strict";
a(".dropdown-menu a.dropdown-toggle").on("click", function (t) {
return (
a(this).next().hasClass("show") ||
a(this)
.parents(".dropdown-menu")
.first()
.find(".show")
.removeClass("show"),
a(this).next(".dropdown-menu").toggleClass("show"),
!1
);
}),
a(function () {
a('[data-toggle="tooltip"]').tooltip();
}),
a(function () {
a('[data-toggle="popover"]').popover();
}),
a("#light-dark").on("click", function (t) {
if (localStorage.getItem("theme") == "dark") {
localStorage.setItem("theme", "light");
$(".bot-avatar").css("display", "none");
setTimeout(() => {
$(".bot-avatar").fadeIn();
}, 100);
checkTheme();
} else {
localStorage.setItem("theme", "dark");
$(".bot-avatar").css("display", "none");
setTimeout(() => {
$(".bot-avatar").fadeIn();
}, 100);
checkTheme();
}
// location.reload();
}),
Waves.init();
$("[contenteditable]").focusout(function () {
var element = $(this);
if (!element.text().trim().length) {
element.empty();
}
});
function checkTheme() {
if (localStorage.getItem("theme") == "light") {
setTimeout(() => {
a("#bootstrap-style").attr("disabled", !1);
}, 50)
setTimeout(() => {
a("#bootstrap-dark-style").attr("disabled", !0);
a("#app-dark-style").attr("disabled", !0),
a("#app-style").attr("disabled", !1);
}, 100)
} else {
localStorage.setItem("theme", "dark");
setTimeout(() => {
a("#bootstrap-dark-style").attr("disabled", !1);
}, 50)
setTimeout(() => {
a("#bootstrap-style").attr("disabled", !0),
a("#app-dark-style").attr("disabled", !1),
a("#app-style").attr("disabled", !0);
}, 100)
}
}
checkTheme();
'use strict';
a('.dropdown-menu a.dropdown-toggle').on('click', function (t) {
return (
a(this).next().hasClass('show') ||
a(this)
.parents('.dropdown-menu')
.first()
.find('.show')
.removeClass('show'),
a(this).next('.dropdown-menu').toggleClass('show'),
!1
);
}),
a(function () {
a('[data-toggle="tooltip"]').tooltip();
}),
a(function () {
a('[data-toggle="popover"]').popover();
}),
a('#light-dark').on('click', function (t) {
if (localStorage.getItem('theme') == 'dark') {
localStorage.setItem('theme', 'light');
$('.bot-avatar').css('display', 'none');
setTimeout(() => {
$('.bot-avatar').fadeIn();
}, 100);
checkTheme();
} else {
localStorage.setItem('theme', 'dark');
$('.bot-avatar').css('display', 'none');
setTimeout(() => {
$('.bot-avatar').fadeIn();
}, 100);
checkTheme();
}
// location.reload();
}),
Waves.init();
$('[contenteditable]').focusout(function () {
const element = $(this);
if (!element.text().trim().length) {
element.empty();
}
});
function checkTheme() {
if (localStorage.getItem('theme') == 'light') {
setTimeout(() => {
a('#bootstrap-style').attr('disabled', !1);
}, 50);
setTimeout(() => {
a('#bootstrap-dark-style').attr('disabled', !0);
a('#app-dark-style').attr('disabled', !0),
a('#app-style').attr('disabled', !1);
}, 100);
} else {
localStorage.setItem('theme', 'dark');
setTimeout(() => {
a('#bootstrap-dark-style').attr('disabled', !1);
}, 50);
setTimeout(() => {
a('#bootstrap-style').attr('disabled', !0),
a('#app-dark-style').attr('disabled', !1),
a('#app-style').attr('disabled', !0);
}, 100);
}
}
checkTheme();
})(jQuery);

function BetterDiscordConsole(message, color) {
color = color || "black";
switch (color) {
case "success":
color = "Green";
break;
case "info":
color = "DodgerBlue";
break;
case "error":
color = "Red";
break;
case "warning":
color = "Orange";
break;
default:
color = color;
}
console.log("%c" + message, "color:" + color);
function betterDiscordConsole(message, color) {
color = color || 'black';
switch (color) {
case 'success':
color = 'Green';
break;
case 'info':
color = 'DodgerBlue';
break;
case 'error':
color = 'Red';
break;
case 'warning':
color = 'Orange';
break;
default:
color = color;
}
console.log('%c' + message, 'color:' + color);
}
56 changes: 28 additions & 28 deletions assets/js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,58 @@

// ------------------------------------- NavBar ------------------------------------

$("#profile-nav-text").attr("title", translation.navbar.profileNav)
$("#chat-nav-text").attr("title", translation.navbar.chatNav)
$("#lastMessages-nav-text").attr("title", translation.navbar.lastMessagesNav)
$("#chatServerInfo-nav-text").attr("title", translation.navbar.infoNav)
$("#settings-nav-text").attr("title", translation.navbar.settingsNav)

$("#light-dark").attr("title", translation.navbar.lightDark)
$("#login-logout").attr("title", translation.navbar.logoutTitle)
$('#profile-nav-text').attr('title', translation.navbar.profileNav);
$('#chat-nav-text').attr('title', translation.navbar.chatNav);
$('#lastMessages-nav-text').attr('title', translation.navbar.lastMessagesNav);
$('#chatServerInfo-nav-text').attr('title', translation.navbar.infoNav);
$('#settings-nav-text').attr('title', translation.navbar.settingsNav);

$('#light-dark').attr('title', translation.navbar.lightDark);
$('#login-logout').attr('title', translation.navbar.logoutTitle);
// ------------------------------------- NavBar --------------------------------------

// ------------------------------------- Headings ------------------------------------
$("#my-profile-text").html(translation.headings.profile)
$("#chats-text").html(translation.headings.guildName)
$("#settings-text").html(translation.headings.settings)
$('#my-profile-text').html(translation.headings.profile);
$('#chats-text').html(translation.headings.guildName);
$('#settings-text').html(translation.headings.settings);
// ------------------------------------- Headings ------------------------------------

// ------------------------------------- Sub-headings ---------------------------------
$(".about-text").html(translation['sub-headings'].about)
$("#tools-text").html(`${translation['sub-headings'].tools} <i class="mdi mdi-chevron-up float-right accor-plus-icon"></i>`)
$("#tools-text-noicon").html(translation['sub-headings'].tools)
$("#info-text").html(translation['sub-headings'].info)
$('.about-text').html(translation['sub-headings'].about);
$('#tools-text').html(`${translation['sub-headings'].tools} <i class="mdi mdi-chevron-up float-right accor-plus-icon"></i>`);
$('#tools-text-noicon').html(translation['sub-headings'].tools);
$('#info-text').html(translation['sub-headings'].info);
// ------------------------------------- Sub-headings --------------------------------

// ------------------------------------- Profile ------------------------------------
$("#name-text").html(translation.text.profileSection.name)
$("#discrim-text").html(translation.text.profileSection.discrim)
$("#id-text").html(translation.text.profileSection.id)
$("#guilds-text").html(translation.text.profileSection.guilds)
$("#created-at-text").html(translation.text.profileSection.createdAt)
$('#name-text').html(translation.text.profileSection.name);
$('#discrim-text').html(translation.text.profileSection.discrim);
$('#id-text').html(translation.text.profileSection.id);
$('#guilds-text').html(translation.text.profileSection.guilds);
$('#created-at-text').html(translation.text.profileSection.createdAt);
// ------------------------------------- Profile ------------------------------------

// ------------------------------------- Settings ------------------------------------
$("#createbotinvite-text").html(translation.text.settingsSection.createBotInvite)
$("#eval-text").html(translation.text.settingsSection.eval)
$("#languages-text").html(`${translation.text.settingsSection.languages} <i class="mdi mdi-chevron-up float-right accor-plus-icon"></i>
`)
$('#createbotinvite-text').html(translation.text.settingsSection.createBotInvite);
$('#eval-text').html(translation.text.settingsSection.eval);
$('#languages-text').html(`${translation.text.settingsSection.languages} <i class="mdi mdi-chevron-up float-right accor-plus-icon"></i>
`);
// ------------------------------------- Settings ------------------------------------

// ------------------------------------- Buttons -------------------------------------
channelName.html(`${translation.text.channelNameLabel}`);

guildName.html(
`<img class="avatarIMG" src="" alt=""> ${translation.headings.guildName}`
`<img class="avatarIMG" src="" alt=""> ${translation.headings.guildName}`,
);
guildNameNoPic.html(`${translation.headings.guildName}`);
$("#last").html(translation.headings.lastMessages);
$('#last').html(translation.headings.lastMessages);

refreshToken.html(
`${translation.buttons.editToken}<i class="ri-logout-circle-r-line float-right text-muted"></i>`
`${translation.buttons.editToken}<i class="ri-logout-circle-r-line float-right text-muted"></i>`,
);
refreshChat.html(`${translation.buttons.refreshChat}`);
leaveGuild.html(`${translation.buttons.leave}`);
inviteBtn.html(`${translation.buttons.invite}`);
send.html(`${translation.buttons.send}`);
// ------------------------------------- Buttons ------------------------------------
// ------------------------------------- Buttons ------------------------------------
Loading

0 comments on commit 4aa4f5a

Please sign in to comment.