mirror of
https://github.com/PretendoNetwork/juxtaposition-ui.git
synced 2026-03-21 17:34:24 -05:00
style: update common-eslint package, and actually fix block linting
Some checks failed
Build and Publish Docker Image / build-publish (push) Has been cancelled
Some checks failed
Build and Publish Docker Image / build-publish (push) Has been cancelled
This commit is contained in:
parent
c37afff6ea
commit
fbd90bccfd
8
package-lock.json
generated
8
package-lock.json
generated
|
|
@ -38,7 +38,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
||||
"@pretendonetwork/eslint-config": "^0.0.5",
|
||||
"@pretendonetwork/eslint-config": "^0.0.6",
|
||||
"@stylistic/eslint-plugin": "^2.13.0",
|
||||
"bmp-js": "^0.1.0",
|
||||
"ejs": "^3.1.10",
|
||||
|
|
@ -1327,9 +1327,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@pretendonetwork/eslint-config": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@pretendonetwork/eslint-config/-/eslint-config-0.0.5.tgz",
|
||||
"integrity": "sha512-42V3RqtzPF8XPHi0HF45VlJ7oGTvTvoU0S6uKGgG5VNh7E9FM7IuHO3Jd1vWKCPoZv+M4mkYfIrb787oR1aLUg==",
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@pretendonetwork/eslint-config/-/eslint-config-0.0.6.tgz",
|
||||
"integrity": "sha512-05mveVecjyadnKrY4dBDtdt3UE3j+1HMEHuFbLfwmb/g3749VL4Bnop1HiuNkUY9p1AhYXHmVJQsicFhWzGP1g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
||||
"@pretendonetwork/eslint-config": "^0.0.5",
|
||||
"@pretendonetwork/eslint-config": "^0.0.6",
|
||||
"@stylistic/eslint-plugin": "^2.13.0",
|
||||
"bmp-js": "^0.1.0",
|
||||
"ejs": "^3.1.10",
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ cave.toolbar_setCallback(8, function () { });
|
|||
|
||||
function initPostModules() {
|
||||
var els = document.querySelectorAll('[data-module-show]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].onclick = postModel;
|
||||
}
|
||||
|
|
@ -37,13 +39,19 @@ function initPostModules() {
|
|||
var message = el.getAttribute('data-message');
|
||||
var screenshot = el.getAttribute('data-screenshot');
|
||||
|
||||
if (sound) cave.snd_playSe(sound);
|
||||
if (!show || !hide) return;
|
||||
if (sound) {
|
||||
cave.snd_playSe(sound);
|
||||
}
|
||||
if (!show || !hide) {
|
||||
return;
|
||||
}
|
||||
document.getElementById(hide).style.display = 'none';
|
||||
document.getElementById(show).style.display = 'block';
|
||||
if (header === 'true')
|
||||
if (header === 'true') {
|
||||
document.getElementById('header').style.display = 'block';
|
||||
else document.getElementById('header').style.display = 'none';
|
||||
} else {
|
||||
document.getElementById('header').style.display = 'none';
|
||||
}
|
||||
if (screenshot) {
|
||||
var screenshotButton = document.getElementById('screenshot-button');
|
||||
if (!cave.capture_isEnabled()) {
|
||||
|
|
@ -78,7 +86,9 @@ function initPostModules() {
|
|||
}
|
||||
function initMorePosts() {
|
||||
var els = document.querySelectorAll('.load-more[data-href]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].addEventListener('click', function (e) {
|
||||
var el = e.currentTarget;
|
||||
|
|
@ -89,14 +99,18 @@ function initMorePosts() {
|
|||
el.parentElement.outerHTML = response;
|
||||
initPosts();
|
||||
initMorePosts();
|
||||
} else el.parentElement.outerHTML = '';
|
||||
} else {
|
||||
el.parentElement.outerHTML = '';
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
function initPosts() {
|
||||
var els = document.querySelectorAll('.post-content[data-href]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].addEventListener('click', function (e) {
|
||||
pjax.loadUrl(e.currentTarget.getAttribute('data-href'));
|
||||
|
|
@ -107,7 +121,9 @@ function initPosts() {
|
|||
}
|
||||
function initYeah() {
|
||||
var els = document.querySelectorAll('button[data-post]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].onclick = yeah;
|
||||
}
|
||||
|
|
@ -121,12 +137,16 @@ function initYeah() {
|
|||
if (classList.contains(el, 'selected')) {
|
||||
classList.remove(el, 'selected');
|
||||
classList.remove(parent, 'yeah');
|
||||
if (count) count.innerText -= 1;
|
||||
if (count) {
|
||||
count.innerText -= 1;
|
||||
}
|
||||
cave.snd_playSe('SE_OLV_CANCEL');
|
||||
} else {
|
||||
classList.add(el, 'selected');
|
||||
classList.add(parent, 'yeah');
|
||||
if (count) count.innerText = ++count.innerText;
|
||||
if (count) {
|
||||
count.innerText = ++count.innerText;
|
||||
}
|
||||
cave.snd_playSe('SE_OLV_MII_ADD');
|
||||
}
|
||||
POST('/posts/empathy', params, function a(data) {
|
||||
|
|
@ -137,13 +157,17 @@ function initYeah() {
|
|||
return cave.error_callErrorViewer(155927);
|
||||
}
|
||||
el.disabled = false;
|
||||
if (count) count.innerText = post.count;
|
||||
if (count) {
|
||||
count.innerText = post.count;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function initSpoilers() {
|
||||
var els = document.querySelectorAll('button[data-post-id]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].addEventListener('click', function (e) {
|
||||
var el = e.currentTarget;
|
||||
|
|
@ -160,7 +184,9 @@ function initSpoilers() {
|
|||
}
|
||||
function initTabs() {
|
||||
var els = document.querySelectorAll('.tab-button');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].onclick = tabs;
|
||||
}
|
||||
|
|
@ -171,8 +197,9 @@ function initTabs() {
|
|||
var child = el.children[0];
|
||||
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
if (classList.contains(els[i], 'selected'))
|
||||
if (classList.contains(els[i], 'selected')) {
|
||||
classList.remove(els[i], 'selected');
|
||||
}
|
||||
}
|
||||
classList.add(el, 'selected');
|
||||
|
||||
|
|
@ -192,7 +219,9 @@ function initTabs() {
|
|||
// eslint-disable-next-line no-unused-vars -- Used in src/webfiles/ctr/post.ejs
|
||||
function deletePost(post) {
|
||||
var id = post.getAttribute('data-post');
|
||||
if (!id) return;
|
||||
if (!id) {
|
||||
return;
|
||||
}
|
||||
var confirm = cave.dialog_twoButton(
|
||||
'Delete Post',
|
||||
'Are you sure you want to delete your post? This cannot be undone.',
|
||||
|
|
@ -220,7 +249,9 @@ function reportPost(post) {
|
|||
var button = document.getElementById('report-launcher');
|
||||
var form = document.getElementById('report-form');
|
||||
var formID = document.getElementById('report-post-id');
|
||||
if (!id || !button || !form || !formID) return;
|
||||
if (!id || !button || !form || !formID) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.action = '/posts/' + id + '/report';
|
||||
formID.value = id;
|
||||
|
|
@ -228,12 +259,17 @@ function reportPost(post) {
|
|||
}
|
||||
|
||||
function back() {
|
||||
if (!pjax.canGoBack()) cave.toolbar_setButtonType(0);
|
||||
else pjax.back();
|
||||
if (!pjax.canGoBack()) {
|
||||
cave.toolbar_setButtonType(0);
|
||||
} else {
|
||||
pjax.back();
|
||||
}
|
||||
}
|
||||
|
||||
function stopLoading() {
|
||||
if (window.location.href.indexOf('/titles/show/first') !== -1) return;
|
||||
if (window.location.href.indexOf('/titles/show/first') !== -1) {
|
||||
return;
|
||||
}
|
||||
cave.transition_end();
|
||||
cave.lls_setItem('agree_olv', '1');
|
||||
cave.toolbar_setActiveButton(3);
|
||||
|
|
@ -283,18 +319,22 @@ var PostStorage = {
|
|||
cave.lls_removeItem(e);
|
||||
},
|
||||
hasKey: function (e) {
|
||||
for (var t = cave.lls_getCount(), i = 0; i < t; i++)
|
||||
if (e === cave.lls_getKeyAt(i)) return !0;
|
||||
for (var t = cave.lls_getCount(), i = 0; i < t; i++) {
|
||||
if (e === cave.lls_getKeyAt(i)) {
|
||||
return !0;
|
||||
}
|
||||
}
|
||||
return !1;
|
||||
},
|
||||
sweep: function () {
|
||||
var t = PostStorage.getAll();
|
||||
var i = t[0];
|
||||
if (t[1] > 0)
|
||||
if (t[1] > 0) {
|
||||
for (var o in i) {
|
||||
var n = JSON.parse(cave.lls_getItem(o)).screenShotKey;
|
||||
n && !PostStorage.hasKey(n) && cave.lls_removeItem(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -338,7 +378,9 @@ function newText() {
|
|||
|
||||
// eslint-disable-next-line no-unused-vars -- Used in src/webfiles/ctr/partials/new_post.ejs
|
||||
function newPainting(reset) {
|
||||
if (reset) cave.memo_clear();
|
||||
if (reset) {
|
||||
cave.memo_clear();
|
||||
}
|
||||
classList.remove(document.getElementById('text-sprite'), 'selected');
|
||||
classList.remove(document.getElementById('post-text'), 'selected');
|
||||
classList.add(document.getElementById('memo-sprite'), 'selected');
|
||||
|
|
@ -434,7 +476,10 @@ document.addEventListener('PjaxLoaded', function (e) {
|
|||
document.addEventListener('PjaxDone', function (_e) {
|
||||
initAll();
|
||||
cave.brw_scrollImmediately(0, 0);
|
||||
if (pjax.canGoBack()) cave.toolbar_setButtonType(1);
|
||||
else cave.toolbar_setButtonType(0);
|
||||
if (pjax.canGoBack()) {
|
||||
cave.toolbar_setButtonType(1);
|
||||
} else {
|
||||
cave.toolbar_setButtonType(0);
|
||||
}
|
||||
cave.transition_end();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,13 +4,16 @@ setInterval(input, 100);
|
|||
|
||||
function initNavBar() {
|
||||
var els = document.querySelectorAll('#nav-menu > li[data-tab]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].addEventListener('click', function (e) {
|
||||
var el = e.currentTarget;
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
if (els[i].classList.contains('selected'))
|
||||
if (els[i].classList.contains('selected')) {
|
||||
els[i].classList.remove('selected');
|
||||
}
|
||||
}
|
||||
el.classList.add('selected');
|
||||
});
|
||||
|
|
@ -18,7 +21,9 @@ function initNavBar() {
|
|||
}
|
||||
function initYeah() {
|
||||
var els = document.querySelectorAll('button[data-post].yeah-button');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].removeEventListener('click', yeah);
|
||||
els[i].addEventListener('click', yeah);
|
||||
|
|
@ -33,12 +38,16 @@ function initYeah() {
|
|||
if (el.classList.contains('selected')) {
|
||||
el.classList.remove('selected');
|
||||
parent.classList.remove('yeah');
|
||||
if (count) count.innerText -= 1;
|
||||
if (count) {
|
||||
count.innerText -= 1;
|
||||
}
|
||||
wiiuSound.playSoundByName('SE_OLV_MII_CANCEL', 1);
|
||||
} else {
|
||||
el.classList.add('selected');
|
||||
parent.classList.add('yeah');
|
||||
if (count) count.innerText = ++count.innerText;
|
||||
if (count) {
|
||||
count.innerText = ++count.innerText;
|
||||
}
|
||||
wiiuSound.playSoundByName('SE_WAVE_MII_ADD', 1);
|
||||
}
|
||||
|
||||
|
|
@ -50,13 +59,17 @@ function initYeah() {
|
|||
return wiiuErrorViewer.openByCode(1155927);
|
||||
}
|
||||
el.disabled = false;
|
||||
if (count) count.innerText = post.count;
|
||||
if (count) {
|
||||
count.innerText = post.count;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function initTabs() {
|
||||
var els = document.querySelectorAll('.tab-button');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].removeEventListener('click', tabs);
|
||||
els[i].addEventListener('click', tabs);
|
||||
|
|
@ -67,8 +80,9 @@ function initTabs() {
|
|||
var child = el.children[0];
|
||||
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
if (els[i].classList.contains('selected'))
|
||||
if (els[i].classList.contains('selected')) {
|
||||
els[i].classList.remove('selected');
|
||||
}
|
||||
}
|
||||
el.classList.add('selected');
|
||||
|
||||
|
|
@ -85,7 +99,9 @@ function initTabs() {
|
|||
}
|
||||
function initPosts() {
|
||||
var els = document.querySelectorAll('.post-content[data-href]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].addEventListener('click', function (e) {
|
||||
pjax.loadUrl(e.currentTarget.getAttribute('data-href'));
|
||||
|
|
@ -96,7 +112,9 @@ function initPosts() {
|
|||
}
|
||||
function initMorePosts() {
|
||||
var els = document.querySelectorAll('.load-more[data-href]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].addEventListener('click', function (e) {
|
||||
var el = e.currentTarget;
|
||||
|
|
@ -106,8 +124,9 @@ function initMorePosts() {
|
|||
el.parentElement.outerHTML = data.response;
|
||||
initPosts();
|
||||
initMorePosts();
|
||||
} else
|
||||
} else {
|
||||
el.parentElement.outerHTML = '';
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -115,29 +134,37 @@ function initMorePosts() {
|
|||
function initPostModules() {
|
||||
var els = document.querySelectorAll('[data-module-show]');
|
||||
console.log(els);
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].addEventListener('click', function (e) {
|
||||
var el = e.currentTarget;
|
||||
var show = el.getAttribute('data-module-show');
|
||||
var hide = el.getAttribute('data-module-hide');
|
||||
if (!show || !hide) return;
|
||||
if (!show || !hide) {
|
||||
return;
|
||||
}
|
||||
document.getElementById(hide).style.display = 'none';
|
||||
document.getElementById(show).style.display = 'block';
|
||||
|
||||
var header = el.getAttribute('data-header');
|
||||
var menu = el.getAttribute('data-menu');
|
||||
var sound = el.getAttribute('data-sound');
|
||||
if (sound) wiiuSound.playSoundByName(sound, 3);
|
||||
if (sound) {
|
||||
wiiuSound.playSoundByName(sound, 3);
|
||||
}
|
||||
|
||||
if (header === 'true')
|
||||
if (header === 'true') {
|
||||
document.getElementById('header').style.display = 'block';
|
||||
else
|
||||
} else {
|
||||
document.getElementById('header').style.display = 'none';
|
||||
if (menu === 'true')
|
||||
}
|
||||
if (menu === 'true') {
|
||||
document.getElementById('nav-menu').style.display = 'block';
|
||||
else
|
||||
} else {
|
||||
document.getElementById('nav-menu').style.display = 'none';
|
||||
}
|
||||
wiiuBrowser.showLoadingIcon(false);
|
||||
initNewPost();
|
||||
});
|
||||
|
|
@ -145,7 +172,9 @@ function initPostModules() {
|
|||
}
|
||||
function initPostEmotion() {
|
||||
var els = document.querySelectorAll('input[data-mii-face-url]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].addEventListener('click', function (e) {
|
||||
var el = e.currentTarget;
|
||||
|
|
@ -156,7 +185,9 @@ function initPostEmotion() {
|
|||
}
|
||||
function initSounds() {
|
||||
var els = document.querySelectorAll('[data-sound]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].addEventListener('click', playSound);
|
||||
}
|
||||
|
|
@ -174,7 +205,9 @@ function initNewPost() {
|
|||
}
|
||||
function initSpoilers() {
|
||||
var els = document.querySelectorAll('button[data-post-id]');
|
||||
if (!els) return;
|
||||
if (!els) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].addEventListener('click', function (e) {
|
||||
var el = e.currentTarget;
|
||||
|
|
@ -313,9 +346,9 @@ function stopLoading() {
|
|||
function exit() {
|
||||
wiiu.gamepad.update();
|
||||
|
||||
if (wiiu.gamepad.hold === 8192 || wiiu.gamepad.hold === 40960)
|
||||
if (wiiu.gamepad.hold === 8192 || wiiu.gamepad.hold === 40960) {
|
||||
alert('Debug Menu');
|
||||
else {
|
||||
} else {
|
||||
wiiuSound.playSoundByName('SE_WAVE_EXIT', 1);
|
||||
wiiuBrowser.closeApplication();
|
||||
}
|
||||
|
|
@ -324,7 +357,9 @@ function exit() {
|
|||
// eslint-disable-next-line no-unused-vars -- Used in src/webfiles/portal/partials/post_template.ejs
|
||||
function deletePost(post) {
|
||||
var id = post.getAttribute('data-post');
|
||||
if (!id) return;
|
||||
if (!id) {
|
||||
return;
|
||||
}
|
||||
var confirm = wiiuDialog.confirm('Are you sure you want to delete your post? This cannot be undone.', 'No', 'Yes');
|
||||
if (confirm) {
|
||||
DELETE('/posts/' + id, function a(data) {
|
||||
|
|
@ -344,7 +379,9 @@ function reportPost(post) {
|
|||
var button = document.getElementById('report-launcher');
|
||||
var form = document.getElementById('report-form');
|
||||
var formID = document.getElementById('report-post-id');
|
||||
if (!id || !button || !form || !formID) return;
|
||||
if (!id || !button || !form || !formID) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.action = '/posts/' + id + '/report';
|
||||
formID.value = id;
|
||||
|
|
@ -430,7 +467,9 @@ function back() {
|
|||
|
||||
function input() {
|
||||
wiiu.gamepad.update();
|
||||
if (wiiu.gamepad.isDataValid === 0) return;
|
||||
if (wiiu.gamepad.isDataValid === 0) {
|
||||
return;
|
||||
}
|
||||
switch (wiiu.gamepad.hold) {
|
||||
case 12:
|
||||
return wiiuBrowser.lockUserOperation(false);
|
||||
|
|
|
|||
|
|
@ -342,7 +342,9 @@ function reportPost(post) {
|
|||
const button = document.getElementById('report-launcher');
|
||||
const form = document.getElementById('report-form');
|
||||
const formID = document.getElementById('report-post-id');
|
||||
if (!id || !button || !form || !formID) return;
|
||||
if (!id || !button || !form || !formID) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.action = '/posts/' + id + '/report';
|
||||
formID.value = id;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user