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