Merge remote-tracking branch 'thatonecalculator/repair-style' into develop
This commit is contained in:
commit
f63e725a90
6 changed files with 277 additions and 80 deletions
|
@ -1,23 +1,11 @@
|
|||
* {
|
||||
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
|
||||
}
|
||||
|
||||
html {
|
||||
background: #ffb4e1;
|
||||
}
|
||||
|
||||
main {
|
||||
background: #dedede;
|
||||
}
|
||||
main > .tabs {
|
||||
padding: 16px;
|
||||
border-bottom: solid 4px #c3c3c3;
|
||||
border-bottom: 4px solid #c3c3c3;
|
||||
}
|
||||
|
||||
#lsEditor > .adder {
|
||||
margin: 16px;
|
||||
padding: 16px;
|
||||
border: solid 2px #c3c3c3;
|
||||
border: 2px solid #c3c3c3;
|
||||
}
|
||||
#lsEditor > .adder > textarea {
|
||||
display: block;
|
||||
|
@ -27,10 +15,10 @@ main > .tabs {
|
|||
}
|
||||
#lsEditor > .record {
|
||||
padding: 16px;
|
||||
border-bottom: solid 1px #c3c3c3;
|
||||
border-bottom: 1px solid #c3c3c3;
|
||||
}
|
||||
#lsEditor > .record > header {
|
||||
font-weight: bold;
|
||||
font-weight: 700;
|
||||
}
|
||||
#lsEditor > .record > textarea {
|
||||
display: block;
|
||||
|
@ -38,3 +26,123 @@ main > .tabs {
|
|||
min-height: 5em;
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ window.onload = async () => {
|
|||
const promise = new Promise((resolve, reject) => {
|
||||
// Append a credential
|
||||
if (i) data.i = i;
|
||||
|
||||
|
||||
// Send request
|
||||
fetch(endpoint.indexOf('://') > -1 ? endpoint : `/api/${endpoint}`, {
|
||||
method: 'POST',
|
||||
|
@ -17,7 +17,7 @@ window.onload = async () => {
|
|||
cache: 'no-cache'
|
||||
}).then(async (res) => {
|
||||
const body = res.status === 204 ? null : await res.json();
|
||||
|
||||
|
||||
if (res.status === 200) {
|
||||
resolve(body);
|
||||
} else if (res.status === 204) {
|
||||
|
@ -27,7 +27,7 @@ window.onload = async () => {
|
|||
}
|
||||
}).catch(reject);
|
||||
});
|
||||
|
||||
|
||||
return promise;
|
||||
};
|
||||
|
||||
|
@ -44,7 +44,7 @@ window.onload = async () => {
|
|||
const addKeyInput = document.createElement('input');
|
||||
const addValueTextarea = document.createElement('textarea');
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'add';
|
||||
addButton.textContent = 'Add';
|
||||
addButton.addEventListener('click', () => {
|
||||
localStorage.setItem(addKeyInput.value, addValueTextarea.value);
|
||||
location.reload();
|
||||
|
@ -64,13 +64,13 @@ window.onload = async () => {
|
|||
const textarea = document.createElement('textarea');
|
||||
textarea.textContent = localStorage.getItem(k);
|
||||
const saveButton = document.createElement('button');
|
||||
saveButton.textContent = 'save';
|
||||
saveButton.textContent = 'Save';
|
||||
saveButton.addEventListener('click', () => {
|
||||
localStorage.setItem(k, textarea.value);
|
||||
location.reload();
|
||||
});
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'remove';
|
||||
removeButton.textContent = 'Remove';
|
||||
removeButton.addEventListener('click', () => {
|
||||
localStorage.removeItem(k);
|
||||
location.reload();
|
||||
|
|
|
@ -1,19 +1,81 @@
|
|||
* {
|
||||
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
|
||||
}
|
||||
|
||||
html {
|
||||
background: #ffb4e1;
|
||||
background: #222;
|
||||
}
|
||||
|
||||
main {
|
||||
background: #dedede;
|
||||
background: #333;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#tl > div {
|
||||
padding: 16px;
|
||||
border-bottom: solid 1px #c3c3c3;
|
||||
border-bottom: 1px solid #c3c3c3;
|
||||
}
|
||||
#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%
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,8 @@ html
|
|||
head
|
||||
meta(charset='utf-8')
|
||||
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
|
||||
include ../bios.css
|
||||
script
|
||||
|
@ -13,8 +14,8 @@ html
|
|||
|
||||
body
|
||||
header
|
||||
h1 Calckey Repair Tool #{version}
|
||||
h1 Calckey Repair Tool v#{version}
|
||||
main
|
||||
div.tabs
|
||||
button#ls edit local storage
|
||||
button#ls Edit local storage
|
||||
div#content
|
||||
|
|
|
@ -5,7 +5,8 @@ html
|
|||
head
|
||||
meta(charset='utf-8')
|
||||
meta(name='application-name' content='Calckey')
|
||||
title Calckey Cli
|
||||
meta(name='viewport' content='width=device-width, initial-scale=1.0')
|
||||
title Misskey Cli
|
||||
style
|
||||
include ../cli.css
|
||||
script
|
||||
|
@ -13,9 +14,10 @@ html
|
|||
|
||||
body
|
||||
header
|
||||
h1 Calckey Cli #{version}
|
||||
h1 Calckey Simple Client v#{version}
|
||||
main
|
||||
div#form
|
||||
textarea#text
|
||||
button#submit submit
|
||||
br
|
||||
button#submit Post
|
||||
div#tl
|
||||
|
|
|
@ -1,47 +1,71 @@
|
|||
doctype html
|
||||
|
||||
html
|
||||
#msg
|
||||
script.
|
||||
const msg = document.getElementById('msg');
|
||||
const successText = `\nSuccess Flush! <a href="/">Back to Calckey</a>\n成功しました。<a href="/">Misskeyを開き直してください。</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)
|
||||
head
|
||||
meta(charset='utf-8')
|
||||
meta(name='application-name' content='Calckey')
|
||||
meta(name='viewport' content='width=device-width, initial-scale=1.0')
|
||||
title Flush Misskey
|
||||
style.
|
||||
* {
|
||||
font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif;
|
||||
}
|
||||
body,
|
||||
html {
|
||||
background-color: #222;
|
||||
color: #dfddcc;
|
||||
justify-content: center;
|
||||
margin: auto;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
a {
|
||||
color: rgb(134, 179, 0);
|
||||
text-decoration: none;
|
||||
}
|
||||
})();
|
||||
|
||||
function message(text) {
|
||||
msg.insertAdjacentHTML('beforeend', `<p>[${(new Date()).toString()}] ${text.replace(/\n/g,'<br>')}</p>`)
|
||||
}
|
||||
body
|
||||
#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>`)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue