diff --git a/src/webfiles/ctr/js/debug.js b/src/webfiles/ctr/js/debug.js index 8bd65d6..a791ea9 100644 --- a/src/webfiles/ctr/js/debug.js +++ b/src/webfiles/ctr/js/debug.js @@ -98,7 +98,7 @@ if (typeof cave === 'undefined') { * @param errorCode */ error_callErrorViewer: function (errorCode) { - const fakeMessage = 'Message for error code ' + errorCode; + var fakeMessage = 'Message for error code ' + errorCode; alert(errorCode + '\n\n' + fakeMessage); }, /** @@ -142,7 +142,7 @@ if (typeof cave === 'undefined') { console.log('cave.ls_setItem()'); // string でないと実機でエラー出るので挙動を合わせる // If it is not string, an error will occur on the actual machine, so match the behavior - for (let i = 0; i < 2; i++) { + for (var i = 0; i < 2; i++) { if (typeof arguments[i] !== 'string') { console.error('Argument ' + i + ' should be string'); console.error('JavaScript Extension error. Arguments Count or Argument Type is not mutch. Or , too big arguments.'); @@ -229,7 +229,7 @@ if (typeof cave === 'undefined') { */ ls_setCanUseCachedServiceToken: function (can_use) { console.log('cave.ls_setCanUseCachedServiceToken'); - const flag = can_use ? '1' : '0'; + var flag = can_use ? '1' : '0'; sessionStorage.setItem('custk', flag); }, /** @@ -282,7 +282,7 @@ if (typeof cave === 'undefined') { */ dialog_twoButton: function (title, message, buttonL_text, buttonR_text) { console.log('cave.dialog_twoButton()'); - const result = confirm('タイトル:' + title + '\n' + 'メッセージ:' + message + '\n\n[ ' + buttonL_text + ' (Cancel) ] [ ' + buttonR_text + ' (OK) ]'); + var result = confirm('タイトル:' + title + '\n' + 'メッセージ:' + message + '\n\n[ ' + buttonL_text + ' (Cancel) ] [ ' + buttonR_text + ' (OK) ]'); return result ? 1 : 0; }, @@ -526,7 +526,7 @@ if (typeof cave === 'undefined') { // テスト等でスクショの有無を固定したい場合にクッキーで指定できるようにする, 実機ではこの挙動は存在しない // If you want to fix the presence or absence of screenshots in tests, etc., make it possible to specify with cookies, this behavior does not exist on the actual device - const force = Olv.Cookie.get('force_screenshot_for_test'); + var force = Olv.Cookie.get('force_screenshot_for_test'); if (force === 'true') { return true; } @@ -569,7 +569,7 @@ if (typeof cave === 'undefined') { }, lls_getPath: function (key) { console.log('cave.getPath(' + key + ')'); - const value = localStorage.getItem(key); + var value = localStorage.getItem(key); if (value == 0) { return '/img/dummy-image/screenshot-dummy-3ds-low.jpeg'; } else { @@ -686,7 +686,7 @@ if (typeof cave === 'undefined') { }, convertTimeToString: function (unixTime) { console.log('cave.convertTimeToString(' + unixTime + ')'); - const date = new Date(unixTime * 1000); + var date = new Date(unixTime * 1000); return date.getFullYear() + '-' + this._toDoubleDigits(date.getMonth() + 1) + '-' + this._toDoubleDigits(date.getDate()) + ' ' + this._toDoubleDigits(date.getHours()) + ':' + this._toDoubleDigits(date.getMinutes()) + ':' + this._toDoubleDigits(date.getSeconds()); }, diff --git a/src/webfiles/ctr/js/pjax.js b/src/webfiles/ctr/js/pjax.js index 58fe964..7f86d81 100644 --- a/src/webfiles/ctr/js/pjax.js +++ b/src/webfiles/ctr/js/pjax.js @@ -20,13 +20,13 @@ var Pjax = { return this; }, refresh: function () { - const els = document.querySelectorAll(this.elements); + var els = document.querySelectorAll(this.elements); if (!els) { return; } console.log(this.elements); console.log(els); - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { els[i].addEventListener('click', function (e) { pageWrapper(e, this); }); @@ -44,7 +44,7 @@ var Pjax = { console.log(url); }, get: function (url, callback) { - const xhttp = new XMLHttpRequest(); + var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function () { if (this.readyState === 4) { document.dispatchEvent(Pjax.events.PjaxLoaded); @@ -56,13 +56,13 @@ var Pjax = { xhttp.send(); }, parseDom: function (data) { - const response = data.responseText; + var response = data.responseText; if (response && data.status === 200) { - const html = document.implementation.createHTMLDocument(''); + var html = document.implementation.createHTMLDocument(''); html.documentElement.innerHTML = response; - for (let i = 0; i < Pjax.selectors.length; i++) { - const newElement = html.querySelector(Pjax.selectors[i]); - const oldElement = document.querySelector(Pjax.selectors[i]); + for (var i = 0; i < Pjax.selectors.length; i++) { + var newElement = html.querySelector(Pjax.selectors[i]); + var oldElement = document.querySelector(Pjax.selectors[i]); if (!newElement || !oldElement) { continue; } @@ -81,7 +81,7 @@ var Pjax = { if (!this.canGoBack()) { return; } - const url = this.history.pop(); + var url = this.history.pop(); this.loadUrl(url, true); } }; diff --git a/src/webfiles/portal/js/debug.js b/src/webfiles/portal/js/debug.js index 3159898..d768606 100644 --- a/src/webfiles/portal/js/debug.js +++ b/src/webfiles/portal/js/debug.js @@ -145,7 +145,7 @@ if (typeof wiiuBOSS === 'undefined') { window.wiiuBOSS = { isRegisteredBossTask: function () { console.debug('wiiuBOSS.isRegisteredBossTask'); - const result = { + var result = { isRegistered: true }; return result; @@ -162,7 +162,7 @@ if (typeof wiiuBOSS === 'undefined') { }, isRegisteredDirectMessageTask: function () { console.debug('wiiuBOSS.isRegisteredDirectMessageTask'); - const result = { + var result = { isRegistered: true }; return result; @@ -194,8 +194,8 @@ if (typeof wiiuMainApplication === 'undefined') { null ], _getImage: function () { - const images = this._images; - const index = Math.floor(Math.random() * images.length); + var images = this._images; + var index = Math.floor(Math.random() * images.length); // テスト等でスクショの有無を固定したい場合にクッキーで指定できるようにする, 実機ではこの挙動は存在しない // If you want to fix the presence or absence of screenshots in tests, etc., make it possible to specify with cookies, this behavior does not exist on the actual device @@ -225,7 +225,7 @@ if (typeof wiiuMemo === 'undefined') { open: function (reset) { console.debug('wiiuMemo.open(reset = ' + reset + ')'); this._isFinish = false; - const self = this; + var self = this; setTimeout(function () { self._isFinish = true; }, 100); @@ -263,7 +263,7 @@ if (typeof wiiuPDM === 'undefined') { if (typeof wiiuErrorViewer === 'undefined') { window.wiiuErrorViewer = { openByCode: function (errorCode) { - const message = 'Message for error code ' + errorCode; + var message = 'Message for error code ' + errorCode; this.openByCodeAndMessage(errorCode, message); }, openByCodeAndMessage: function (errorCode, errorMessage) { diff --git a/src/webfiles/portal/js/juxt.js b/src/webfiles/portal/js/juxt.js index 2f3e98d..eca7862 100644 --- a/src/webfiles/portal/js/juxt.js +++ b/src/webfiles/portal/js/juxt.js @@ -1,14 +1,14 @@ -let pjax; +var pjax; setInterval(checkForUpdates, 30000); setInterval(input, 100); function initNavBar() { - const els = document.querySelectorAll('#nav-menu > li[data-tab]'); + var els = document.querySelectorAll('#nav-menu > li[data-tab]'); if (!els) return; - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { els[i].addEventListener('click', function (e) { - const el = e.currentTarget; - for (let i = 0; i < els.length; i++) { + var el = e.currentTarget; + for (var i = 0; i < els.length; i++) { if (els[i].classList.contains('selected')) els[i].classList.remove('selected'); } @@ -17,19 +17,19 @@ function initNavBar() { } } function initYeah() { - const els = document.querySelectorAll('button[data-post].yeah-button'); + var els = document.querySelectorAll('button[data-post].yeah-button'); if (!els) return; - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { els[i].removeEventListener('click', yeah); els[i].addEventListener('click', yeah); } function yeah(e) { - const el = e.currentTarget; - const id = el.getAttribute('data-post'); - const parent = document.getElementById(id); - const count = document.getElementById('count-' + id); + var el = e.currentTarget; + var id = el.getAttribute('data-post'); + var parent = document.getElementById(id); + var count = document.getElementById('count-' + id); el.disabled = true; - const params = 'postID=' + id; + var params = 'postID=' + id; if (el.classList.contains('selected')) { el.classList.remove('selected'); parent.classList.remove('yeah'); @@ -43,7 +43,7 @@ function initYeah() { } POST('/posts/empathy', params, function a(data) { - const post = JSON.parse(data.response); + var post = JSON.parse(data.response); if (!post || post.status !== 200) { // Apparently there was an actual error code for not being able to yeah a post, who knew! // TODO: Find more of these @@ -55,25 +55,25 @@ function initYeah() { } } function initTabs() { - const els = document.querySelectorAll('.tab-button'); + var els = document.querySelectorAll('.tab-button'); if (!els) return; - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { els[i].removeEventListener('click', tabs); els[i].addEventListener('click', tabs); } function tabs(e) { e.preventDefault(); - const el = e.currentTarget; - const child = el.children[0]; + var el = e.currentTarget; + var child = el.children[0]; - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { if (els[i].classList.contains('selected')) els[i].classList.remove('selected'); } el.classList.add('selected'); GET(child.getAttribute('href') + '?pjax=true', function a(data) { - const response = data.response; + var response = data.response; if (response && data.status === 200) { document.getElementsByClassName('tab-body')[0].innerHTML = data.response; window.history.pushState({ url: child.href, title: '', scrollPos: [0, 0] }, '', child.href); @@ -84,9 +84,9 @@ function initTabs() { } } function initPosts() { - const els = document.querySelectorAll('.post-content[data-href]'); + var els = document.querySelectorAll('.post-content[data-href]'); if (!els) return; - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { els[i].addEventListener('click', function (e) { pjax.loadUrl(e.currentTarget.getAttribute('data-href')); }); @@ -95,13 +95,13 @@ function initPosts() { initSpoilers(); } function initMorePosts() { - const els = document.querySelectorAll('.load-more[data-href]'); + var els = document.querySelectorAll('.load-more[data-href]'); if (!els) return; - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { els[i].addEventListener('click', function (e) { - const el = e.currentTarget; + var el = e.currentTarget; GET(el.getAttribute('data-href'), function a(data) { - const response = data.response; + var response = data.response; if (response && data.status === 200) { el.parentElement.outerHTML = data.response; initPosts(); @@ -113,21 +113,21 @@ function initMorePosts() { } } function initPostModules() { - const els = document.querySelectorAll('[data-module-show]'); + var els = document.querySelectorAll('[data-module-show]'); console.log(els); if (!els) return; - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { els[i].addEventListener('click', function (e) { - const el = e.currentTarget; - const show = el.getAttribute('data-module-show'); - const hide = el.getAttribute('data-module-hide'); + var el = e.currentTarget; + var show = el.getAttribute('data-module-show'); + var hide = el.getAttribute('data-module-hide'); if (!show || !hide) return; document.getElementById(hide).style.display = 'none'; document.getElementById(show).style.display = 'block'; - const header = el.getAttribute('data-header'); - const menu = el.getAttribute('data-menu'); - const sound = el.getAttribute('data-sound'); + 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 (header === 'true') @@ -144,20 +144,20 @@ function initPostModules() { } } function initPostEmotion() { - const els = document.querySelectorAll('input[data-mii-face-url]'); + var els = document.querySelectorAll('input[data-mii-face-url]'); if (!els) return; - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { els[i].addEventListener('click', function (e) { - const el = e.currentTarget; + var el = e.currentTarget; document.getElementById('mii-face').src = el.getAttribute('data-mii-face-url'); wiiuSound.playSoundByName(el.getAttribute('data-sound'), 3); }); } } function initSounds() { - const els = document.querySelectorAll('[data-sound]'); + var els = document.querySelectorAll('[data-sound]'); if (!els) return; - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { els[i].addEventListener('click', playSound); } function playSound(e) { @@ -173,11 +173,11 @@ function initNewPost() { initScreenShots(); } function initSpoilers() { - const els = document.querySelectorAll('button[data-post-id]'); + var els = document.querySelectorAll('button[data-post-id]'); if (!els) return; - for (let i = 0; i < els.length; i++) { + for (var i = 0; i < els.length; i++) { els[i].addEventListener('click', function (e) { - const el = e.currentTarget; + var el = e.currentTarget; document.getElementById('post-' + el.getAttribute('data-post-id')).classList.remove('spoiler'); el.outerHTML = ''; }); @@ -212,8 +212,8 @@ document.addEventListener('pjax:error', function (e) { document.addEventListener('pjax:success', function () { console.debug('Event: pjax:success', arguments); wiiuBrowser.showLoadingIcon(false); - const back = document.getElementById('nav-menu-back'); - const close = document.getElementById('nav-menu-exit'); + var back = document.getElementById('nav-menu-back'); + var close = document.getElementById('nav-menu-exit'); if (wiiuBrowser.canHistoryBack()) { back.classList.remove('selected'); back.classList.remove('none'); @@ -243,7 +243,7 @@ function hideScreenShots() { // eslint-disable-next-line no-unused-vars -- Used by src/webfiles/portal/partials/new_post.ejs function chooseScreenShot(value) { - const screenshot = document.getElementById('screenshot-value'); + var screenshot = document.getElementById('screenshot-value'); switch (value) { case 0: screenshot.value = wiiuMainApplication.getScreenShot(true); @@ -262,10 +262,10 @@ function chooseScreenShot(value) { // eslint-disable-next-line no-unused-vars -- Used in src/webfiles/portal/community.ejs and src/webfiles/portal/user_page.ejs function follow(el) { - const id = el.getAttribute('data-community-id'); - const count = document.getElementById('followers'); + var id = el.getAttribute('data-community-id'); + var count = document.getElementById('followers'); el.disabled = true; - const params = 'id=' + id; + var params = 'id=' + id; if (el.classList.contains('checked')) { el.classList.remove('checked'); wiiuSound.playSoundByName('SE_OLV_MII_CANCEL', 1); @@ -275,7 +275,7 @@ function follow(el) { } POST(el.getAttribute('data-url'), params, function a(data) { - const element = JSON.parse(data.response); + var element = JSON.parse(data.response); if (!element || element.status !== 200) { // Apparently there was an actual error code for not being able to yeah a post, who knew! // TODO: Find more of these @@ -323,9 +323,9 @@ function exit() { // eslint-disable-next-line no-unused-vars -- Used in src/webfiles/portal/partials/post_template.ejs function deletePost(post) { - const id = post.getAttribute('data-post'); + var id = post.getAttribute('data-post'); if (!id) return; - const 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) { DELETE('/posts/' + id, function a(data) { if (!data || data.status !== 200) { @@ -340,10 +340,10 @@ function deletePost(post) { // eslint-disable-next-line no-unused-vars -- Used in src/webfiles/portal/partials/post_template.ejs function reportPost(post) { - const id = post.getAttribute('data-post'); - const button = document.getElementById('report-launcher'); - const form = document.getElementById('report-form'); - const formID = document.getElementById('report-post-id'); + var id = post.getAttribute('data-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; form.action = '/posts/' + id + '/report'; @@ -353,9 +353,9 @@ function reportPost(post) { } function checkForUpdates() { GET('/users/notifications.json', function updates(data) { - const notificationObj = JSON.parse(data.responseText); - const messages = document.getElementById('message-badge'); - const news = document.getElementById('news-badge'); + var notificationObj = JSON.parse(data.responseText); + var messages = document.getElementById('message-badge'); + var news = document.getElementById('news-badge'); /**/ if (notificationObj.message_count > 0 && notificationObj.message_count < 99) { @@ -382,7 +382,7 @@ function checkForUpdates() { } function POST(url, data, callback) { wiiuBrowser.showLoadingIcon(true); - const xhttp = new XMLHttpRequest(); + var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function () { if (this.readyState === 4) { wiiuBrowser.showLoadingIcon(false); @@ -395,7 +395,7 @@ function POST(url, data, callback) { } function GET(url, callback) { wiiuBrowser.showLoadingIcon(true); - const xhttp = new XMLHttpRequest(); + var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function () { if (this.readyState === 4) { wiiuBrowser.showLoadingIcon(false); @@ -408,7 +408,7 @@ function GET(url, callback) { function DELETE(url, callback) { wiiuBrowser.showLoadingIcon(true); - const xhttp = new XMLHttpRequest(); + var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function () { if (this.readyState === 4) { wiiuBrowser.showLoadingIcon(false);