Files
Curse/packages/backend/assets/misc/bios.js
かっこかり f222d7e24d enhance(backend): pugをやめ、JSXベースのテンプレートに変更 (#16908)
* enhance(backend): pugをやめ、JSXベースのテンプレートに変更 (to misskey-dev dev branch) (#16889)

* wip

* wip

* wip

* wip

* fix lint

* attempt to fix test

* fix

* fix

* fix: oauthページの描画がおかしい問題を修正

* typo [ci skip]

* fix

* fix

* fix

* fix

* fix

* refactor

* fix

* fix

* fix broken lockfile

* fix: expose supported languages as global variable

* remove i18n package from root as it is no longer required [ci skip]

* fix

* fix: add i18n package.json to Docker target-builder stage for federation tests (#16909)

* Initial plan

* fix: add i18n package.json to Docker target-builder stage for federation tests

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>

* fix: followup-test-federation for enh-remove-pug (#16910)

* fix: followup-test-federation for enh-remove-pug

* Revert "fix: add i18n package.json to Docker target-builder stage for federation tests (#16909)"

This reverts commit 14313468d3.

* fix: CSSが読み込まれない場合がある問題を修正

* fix [ci skip]

* fix: propsのデフォルト値をnull合体演算子から論理和演算子に変更(空文字に対処するため)

* remove @types/pug

* enhance: bootloaderを埋め込むように

* fix possible race condition

* remove esbuild

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Co-authored-by: おさむのひと <46447427+samunohito@users.noreply.github.com>
2025-12-01 18:36:55 +09:00

93 lines
2.6 KiB
JavaScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
'use strict';
window.onload = async () => {
const account = JSON.parse(localStorage.getItem('account'));
const i = account.token;
const api = (endpoint, data = {}) => {
const promise = new Promise((resolve, reject) => {
// Append a credential
if (i) data.i = i;
// Send request
window.fetch(endpoint.indexOf('://') > -1 ? endpoint : `/api/${endpoint}`, {
method: 'POST',
body: JSON.stringify(data),
credentials: 'omit',
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) {
resolve();
} else {
reject(body.error);
}
}).catch(reject);
});
return promise;
};
const content = document.getElementById('content');
document.getElementById('ls').addEventListener('click', () => {
content.innerHTML = '';
const lsEditor = document.createElement('div');
lsEditor.id = 'lsEditor';
const adder = document.createElement('div');
adder.classList.add('adder');
const addKeyInput = document.createElement('input');
const addValueTextarea = document.createElement('textarea');
const addButton = document.createElement('button');
addButton.textContent = 'add';
addButton.addEventListener('click', () => {
localStorage.setItem(addKeyInput.value, addValueTextarea.value);
location.reload();
});
adder.appendChild(addKeyInput);
adder.appendChild(addValueTextarea);
adder.appendChild(addButton);
lsEditor.appendChild(adder);
for (let i = 0; i < localStorage.length; i++) {
const k = localStorage.key(i);
const record = document.createElement('div');
record.classList.add('record');
const header = document.createElement('header');
header.textContent = k;
const textarea = document.createElement('textarea');
textarea.textContent = localStorage.getItem(k);
const saveButton = document.createElement('button');
saveButton.textContent = 'save';
saveButton.addEventListener('click', () => {
localStorage.setItem(k, textarea.value);
location.reload();
});
const removeButton = document.createElement('button');
removeButton.textContent = 'remove';
removeButton.addEventListener('click', () => {
localStorage.removeItem(k);
location.reload();
});
record.appendChild(header);
record.appendChild(textarea);
record.appendChild(saveButton);
record.appendChild(removeButton);
lsEditor.appendChild(record);
}
content.appendChild(lsEditor);
});
};