Merge remote-tracking branch 'thatonecalculator/repair-style' into develop

This commit is contained in:
ThatOneCalculator 2022-07-18 20:34:06 -07:00
commit f63e725a90
6 changed files with 277 additions and 80 deletions

View file

@ -1,23 +1,11 @@
* {
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
}
html {
background: #ffb4e1;
}
main {
background: #dedede;
}
main > .tabs { main > .tabs {
padding: 16px; padding: 16px;
border-bottom: solid 4px #c3c3c3; border-bottom: 4px solid #c3c3c3;
} }
#lsEditor > .adder { #lsEditor > .adder {
margin: 16px; margin: 16px;
padding: 16px; padding: 16px;
border: solid 2px #c3c3c3; border: 2px solid #c3c3c3;
} }
#lsEditor > .adder > textarea { #lsEditor > .adder > textarea {
display: block; display: block;
@ -27,10 +15,10 @@ main > .tabs {
} }
#lsEditor > .record { #lsEditor > .record {
padding: 16px; padding: 16px;
border-bottom: solid 1px #c3c3c3; border-bottom: 1px solid #c3c3c3;
} }
#lsEditor > .record > header { #lsEditor > .record > header {
font-weight: bold; font-weight: 700;
} }
#lsEditor > .record > textarea { #lsEditor > .record > textarea {
display: block; display: block;
@ -38,3 +26,123 @@ main > .tabs {
min-height: 5em; min-height: 5em;
box-sizing: border-box; box-sizing: border-box;
} }
html {
background: #222;
}
main {
background: #333;
border-radius: 10px;
}
#tl > div {
padding: 16px;
border-bottom: 1px solid #c3c3c3;
}
#tl > div > header {
font-weight: 700;
}
* {
font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif;
}
#misskey_app {
display: none !important;
}
body,
html {
background-color: #222;
color: #dfddcc;
justify-content: center;
margin: auto;
padding: 10px;
text-align: center;
}
button {
border-radius: 999px;
padding: 0px 12px 0px 12px;
border: none;
cursor: pointer;
margin-bottom: 12px;
background: linear-gradient(90deg, rgb(134, 179, 0), rgb(74, 179, 0));
line-height: 50px;
color: #222;
font-weight: bold;
font-size: 20px;
padding: 12px;
}
button {
border-radius: 999px;
padding: 0px 12px 0px 12px;
border: none;
cursor: pointer;
margin-bottom: 12px;
}
button {
background: #444;
line-height: 40px;
color: rgb(153, 204, 0);
font-size: 16px;
padding: 0 20px;
margin-right: 5px;
margin-left: 5px;
}
button:hover {
background: #555;
}
#ls {
background: linear-gradient(90deg, rgb(134, 179, 0), rgb(74, 179, 0));
line-height: 30px;
color: #222;
font-weight: bold;
font-size: 18px;
padding: 12px;
}
#ls:hover {
background: rgb(153, 204, 0);
}
a {
color: rgb(134, 179, 0);
text-decoration: none;
}
p,
li {
font-size: 16px;
}
h1 {
font-size: 32px;
}
code {
font-family: Fira, FiraCode, monospace;
}
textarea {
background-color: #444;
border: solid #aaa;
border-radius: 10px;
color: #dfddcc;
margin-top: 1rem;
margin-bottom: 1rem;
width: 20rem;
height: 7.5rem;
padding: 0.5rem;
}
textarea:focus {
border: solid #eee;
}
input {
background-color: #666;
border: solid #aaa;
border-radius: 10px;
color: #dfddcc;
margin-top: 1rem;
margin-bottom: 1rem;
width: 10rem;
height: 1rem;
padding: 0.5rem;
}
input:focus {
border: solid #eee;
}

View file

@ -8,7 +8,7 @@ window.onload = async () => {
const promise = new Promise((resolve, reject) => { const promise = new Promise((resolve, reject) => {
// Append a credential // Append a credential
if (i) data.i = i; if (i) data.i = i;
// Send request // Send request
fetch(endpoint.indexOf('://') > -1 ? endpoint : `/api/${endpoint}`, { fetch(endpoint.indexOf('://') > -1 ? endpoint : `/api/${endpoint}`, {
method: 'POST', method: 'POST',
@ -17,7 +17,7 @@ window.onload = async () => {
cache: 'no-cache' cache: 'no-cache'
}).then(async (res) => { }).then(async (res) => {
const body = res.status === 204 ? null : await res.json(); const body = res.status === 204 ? null : await res.json();
if (res.status === 200) { if (res.status === 200) {
resolve(body); resolve(body);
} else if (res.status === 204) { } else if (res.status === 204) {
@ -27,7 +27,7 @@ window.onload = async () => {
} }
}).catch(reject); }).catch(reject);
}); });
return promise; return promise;
}; };
@ -44,7 +44,7 @@ window.onload = async () => {
const addKeyInput = document.createElement('input'); const addKeyInput = document.createElement('input');
const addValueTextarea = document.createElement('textarea'); const addValueTextarea = document.createElement('textarea');
const addButton = document.createElement('button'); const addButton = document.createElement('button');
addButton.textContent = 'add'; addButton.textContent = 'Add';
addButton.addEventListener('click', () => { addButton.addEventListener('click', () => {
localStorage.setItem(addKeyInput.value, addValueTextarea.value); localStorage.setItem(addKeyInput.value, addValueTextarea.value);
location.reload(); location.reload();
@ -64,13 +64,13 @@ window.onload = async () => {
const textarea = document.createElement('textarea'); const textarea = document.createElement('textarea');
textarea.textContent = localStorage.getItem(k); textarea.textContent = localStorage.getItem(k);
const saveButton = document.createElement('button'); const saveButton = document.createElement('button');
saveButton.textContent = 'save'; saveButton.textContent = 'Save';
saveButton.addEventListener('click', () => { saveButton.addEventListener('click', () => {
localStorage.setItem(k, textarea.value); localStorage.setItem(k, textarea.value);
location.reload(); location.reload();
}); });
const removeButton = document.createElement('button'); const removeButton = document.createElement('button');
removeButton.textContent = 'remove'; removeButton.textContent = 'Remove';
removeButton.addEventListener('click', () => { removeButton.addEventListener('click', () => {
localStorage.removeItem(k); localStorage.removeItem(k);
location.reload(); location.reload();

View file

@ -1,19 +1,81 @@
* {
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
}
html { html {
background: #ffb4e1; background: #222;
} }
main { main {
background: #dedede; background: #333;
border-radius: 10px;
} }
#tl > div { #tl > div {
padding: 16px; padding: 16px;
border-bottom: solid 1px #c3c3c3; border-bottom: 1px solid #c3c3c3;
} }
#tl > div > header { #tl > div > header {
font-weight: bold; font-weight: 700;
}
* {
font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif;
}
#misskey_app {
display: none !important;
}
body,
html {
background-color: #222;
color: #dfddcc;
justify-content: center;
margin: auto;
padding: 10px;
text-align: center;
}
button {
border-radius:999px;
padding:0 40px;
margin-top: 1rem;
border:none;
cursor:pointer;
margin-bottom:12px;
background:linear-gradient(90deg,#86b300,#4ab300);
line-height:50px;
color:#222;
font-weight:700;
font-size:20px;
}
button:hover {
background: rgb(153, 204, 0);
}
a {
color: rgb(134, 179, 0);
text-decoration: none;
}
p,
li {
font-size: 16px;
}
h1 {
font-size: 32px;
}
code {
font-family: Fira, FiraCode, monospace;
}
#text {
background-color: #444;
border: solid #aaa;
border-radius: 10px;
color: #dfddcc;
margin-top: 3rem;
width: 20rem;
height: 5rem;
padding: 0.5rem;
}
#text:focus {
border: solid #eee;
}
@media screen and (max-width: 500px) {
#text {
width: 80%
}
} }

View file

@ -5,7 +5,8 @@ html
head head
meta(charset='utf-8') meta(charset='utf-8')
meta(name='application-name' content='Calckey') meta(name='application-name' content='Calckey')
title Calckey Repair Tool meta(name='viewport' content='width=device-width, initial-scale=1.0')
title Misskey Repair Tool
style style
include ../bios.css include ../bios.css
script script
@ -13,8 +14,8 @@ html
body body
header header
h1 Calckey Repair Tool #{version} h1 Calckey Repair Tool v#{version}
main main
div.tabs div.tabs
button#ls edit local storage button#ls Edit local storage
div#content div#content

View file

@ -5,7 +5,8 @@ html
head head
meta(charset='utf-8') meta(charset='utf-8')
meta(name='application-name' content='Calckey') meta(name='application-name' content='Calckey')
title Calckey Cli meta(name='viewport' content='width=device-width, initial-scale=1.0')
title Misskey Cli
style style
include ../cli.css include ../cli.css
script script
@ -13,9 +14,10 @@ html
body body
header header
h1 Calckey Cli #{version} h1 Calckey Simple Client v#{version}
main main
div#form div#form
textarea#text textarea#text
button#submit submit br
button#submit Post
div#tl div#tl

View file

@ -1,47 +1,71 @@
doctype html doctype html
html html
#msg head
script. meta(charset='utf-8')
const msg = document.getElementById('msg'); meta(name='application-name' content='Calckey')
const successText = `\nSuccess Flush! <a href="/">Back to Calckey</a>\n成功しました。<a href="/">Misskeyを開き直してください。</a>`; meta(name='viewport' content='width=device-width, initial-scale=1.0')
title Flush Misskey
message('Start flushing.'); style.
* {
(async function() { font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif;
try { }
localStorage.clear(); body,
message('localStorage cleared.'); html {
background-color: #222;
const idbPromises = ['MisskeyClient', 'keyval-store'].map((name, i, arr) => new Promise((res, rej) => { color: #dfddcc;
const delidb = indexedDB.deleteDatabase(name); justify-content: center;
delidb.onsuccess = () => res(message(`indexedDB "${name}" cleared. (${i + 1}/${arr.length})`)); margin: auto;
delidb.onerror = e => rej(e) padding: 10px;
})); text-align: center;
}
await Promise.all(idbPromises); a {
color: rgb(134, 179, 0);
if (navigator.serviceWorker.controller) { text-decoration: none;
navigator.serviceWorker.controller.postMessage('clear');
await navigator.serviceWorker.getRegistrations()
.then(registrations => {
return Promise.all(registrations.map(registration => registration.unregister()));
})
.catch(e => { throw Error(e) });
}
message(successText);
} catch (e) {
message(`\n${e}\n\nFlush Failed. <a href="/flush">Please retry.</a>\n失敗しました。<a href="/flush">もう一度試してみてください。</a>`);
message(`\nIf you retry more than 3 times, clear the browser cache or contact to instance admin.\n3回以上試しても失敗する場合、ブラウザのキャッシュを消去し、それでもだめならインスタンス管理者に連絡してみてください。\n`)
console.error(e);
setTimeout(() => {
location = '/';
}, 10000)
} }
})();
function message(text) { body
msg.insertAdjacentHTML('beforeend', `<p>[${(new Date()).toString()}] ${text.replace(/\n/g,'<br>')}</p>`) #msg
} script.
const msg = document.getElementById('msg');
const successText = `\nSuccess Flush! <a href="/">Back to Calckey</a>\n成功しました。<a href="/">Calckeyを開き直してください。</a>`;
message('Start flushing.');
(async function() {
try {
localStorage.clear();
message('localStorage cleared.');
const idbPromises = ['MisskeyClient', 'keyval-store'].map((name, i, arr) => new Promise((res, rej) => {
const delidb = indexedDB.deleteDatabase(name);
delidb.onsuccess = () => res(message(`indexedDB "${name}" cleared. (${i + 1}/${arr.length})`));
delidb.onerror = e => rej(e)
}));
await Promise.all(idbPromises);
if (navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.postMessage('clear');
await navigator.serviceWorker.getRegistrations()
.then(registrations => {
return Promise.all(registrations.map(registration => registration.unregister()));
})
.catch(e => { throw Error(e) });
}
message(successText);
} catch (e) {
message(`\n${e}\n\nFlush Failed. <a href="/flush">Please retry.</a>\n失敗しました。<a href="/flush">もう一度試してみてください。</a>`);
message(`\nIf you retry more than 3 times, clear the browser cache or contact to instance admin.\n3回以上試しても失敗する場合、ブラウザのキャッシュを消去し、それでもだめならインスタンス管理者に連絡してみてください。\n`)
console.error(e);
setTimeout(() => {
location = '/';
}, 10000)
}
})();
function message(text) {
msg.insertAdjacentHTML('beforeend', `<p>[${(new Date()).toString()}] ${text.replace(/\n/g,'<br>')}</p>`)
}