Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve ESLint & invalid header warnings #663

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"https://*.discord.com/login"
],
"icon": "https://victornpb.github.io/undiscord/images/icon128.png",
"updateURL": "https://raw.githubusercontent.com/victornpb/deleteDiscordMessages/master/deleteDiscordMessages.user.js",
"downloadURL": "https://raw.githubusercontent.com/victornpb/deleteDiscordMessages/master/deleteDiscordMessages.user.js",
"contributionURL": "https://www.buymeacoffee.com/vitim",
"grant": "none"
},
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions src/undiscord-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ function initUI() {
$('#toggleSidebar').onclick = ()=> ui.undiscordWindow.classList.toggle('hide-sidebar');
$('button#start').onclick = startAction;
$('button#stop').onclick = stopAction;
$('button#clear').onclick = () => ui.logArea.innerHTML = '';
$('button#getAuthor').onclick = () => $('input#authorId').value = getAuthorId();
$('button#clear').onclick = () => { ui.logArea.innerHTML = '' };
$('button#getAuthor').onclick = () => { $('input#authorId').value = getAuthorId() };
$('button#getGuild').onclick = () => {
const guildId = $('input#guildId').value = getGuildId();
if (guildId === '@me') $('input#channelId').value = getChannelId();
Expand All @@ -129,7 +129,7 @@ function initUI() {
if (id) $('input#maxId').value = id;
toggleWindow();
};
$('button#getToken').onclick = () => $('input#token').value = fillToken();
$('button#getToken').onclick = () => { $('input#token').value = fillToken() };

// sync delays
$('input#searchDelay').onchange = (e) => {
Expand Down
12 changes: 7 additions & 5 deletions src/utils/drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,13 @@ function createElement(tag='div', attrs, parent) {
function defaultArgs(defaults, options) {
function isObj(x) { return x !== null && typeof x === 'object'; }
function hasOwn(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
if (isObj(options)) for (let prop in defaults) {
if (hasOwn(defaults, prop) && hasOwn(options, prop) && options[prop] !== undefined) {
if (isObj(defaults[prop])) defaultArgs(defaults[prop], options[prop]);
else defaults[prop] = options[prop];
if (isObj(options)) {
for (let prop in defaults) {
if (hasOwn(defaults, prop) && hasOwn(options, prop) && options[prop] !== undefined) {
if (isObj(defaults[prop])) defaultArgs(defaults[prop], options[prop]);
else defaults[prop] = options[prop];
}
}
return defaults;
}
return defaults;
}
2 changes: 1 addition & 1 deletion src/utils/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export const log = {
};

var logFn; // custom console.log function
export const setLogFn = (fn) => logFn = fn;
export const setLogFn = (fn) => {logFn = fn};