common.js
をbundleしたfor-any-project-minを使うようにしたscript.jslet VERBOSE = true;
async function importWithLogger(source) {
if (VERBOSE) console.log(`[import@/${scrapbox.Project.name}] Start importing '${source}'...`);
try {
const promise = await import(source);
if (VERBOSE) console.log(`[import@/${scrapbox.Project.name}] Finish importing '${source}'.`);
return promise;
} catch(e) {
if (!(e instanceof SyntaxError)) return undefined;
console.error(`[import@/${scrapbox.Project.name}] ${e.message}`);
console.error(`[import@/${scrapbox.Project.name}] file: ${e.fileName}, line: ${e.lineNumber}, col: ${e.columnNumber}`);
console.error(e.stack);
throw Error(e);
}
}
noscript=true
を渡されたらUserScriptをoffにして開くscript.jsimport {selfURLParameters} from '../scrapbox-url-parameters/script.js';
(() => {
if (selfURLParameters.get('noscript') === 'true') {
console.info('[scrapbox-url-parameters] No script mode');
// これ以降のscriptを読み込まない
return;
}
if (selfURLParameters.get('verbose') === 'false') VERBOSE = false;
// 共通して読み込むscript
//importWithLogger('./common.js');
importWithLogger('../for-any-project/script.js');
script.jsswitch (scrapbox.Project.name) {
case 'takker':
importWithLogger('./takker.js');
break;
case 'takker-memex':
importWithLogger('./takker-memex.js');
break;
case 'customize':
case 'scrapboxlab':
break;
case 'villagepump':
importWithLogger ('./villagepump.js');
break;
case 'programming-notes':
// themeをpaper-dark-darkにする
importWithLogger('../scrapbox-theme-customizer/script.js')
.then(({setTheme}) => setTheme('paper-dark-dark'));
break;
default:
break;
}
})();
common.jsimport {GYAZO_ACCESS_TOKEN} from '/api/code/takker-memex/GYAZO_ACCESS_TOKEN/auth.js';
import {addGyazoMenu} from '../Gyazoにuploadした画像URLをコピペするPage_Menu/script.js';
addGyazoMenu({GYAZO_ACCESS_TOKEN, imageNum: 10, theme: 'dark'});
common.jsimport '../Open_Google_Calendar_PageMenu/script.js';
common.jsimport '../from-programming-notes/index.js';
common.jsimport {scrapBindings} from '../ScrapBindings/script.js';
import {config} from '../ScrapBindings-settings/config.js';
scrapBindings.install()
.then(() => scrapBindings.push(...config));
common.jsimport "../@takker%2Fscrapjupyter-min/mod.js";
common.jsimport { setup as setup2 } from "../アナログ時計を表示するUserScript/script.js";
if (!isMobile()) setup2();
common.js.disabled(js)import {external, icon, bare} from '../external-completion-3/script.js';
import {projects} from './project-list.js';
external(projects);
bare(['takker', 'takker-memex',]);
icon (['icons', 'emoji', 'icons2',]);
if (!takker_list.includes(scrapbox.Project.name)) {
document.head.insertAdjacentHTML('beforeend',
`<style>
[data-project-theme="paper-dark-dark"] suggest-container,
[data-project-theme="default-dark"] suggest-container{
--completion-bg: #373b44;
--completion-item-text-color: var(--page-text-color);
--completion-item-hover-text-color: var(--page-text-color);
--completion-item-hover-bg: #373b44;
--completion-border: 1px solid #8888882d;
}
</style>`);
} else {
document.head.insertAdjacentHTML('beforeend',
`<style>
suggest-container {
--completion-bg: #373b44;
--completion-item-text-color: var(--page-text-color);
--completion-item-hover-text-color: var(--page-text-color);
--completion-item-hover-bg: #373b44;
--completion-border: 1px solid #8888882d;
}
</style>`);
}
project-list.jsexport const projects = [
'hub',
'shokai',
'nishio',
'masui',
'rakusai',
'yuiseki',
'june29',
'villagepump',
'rashitamemo',
'thinkandcreateteck',
'customize',
'scrapboxlab',
'scrasobox',
'foldrr',
'scrapbox-drinkup',
'nota-techconf',
'motoso',
'public-mrsekut',
'mrsekut-p',
'marshmallow-rm',
'wkpmm',
'sushitecture',
'nwtgck',
'dojineko',
'kadoyau',
'inteltank',
'sta',
'kn1cht',
'miyamonz',
'rmaruon',
'MISONLN41',
'yuta0801',
'tus-survey-1',
'aviutl',
'ePi5131',
'choiyakiBox',
'choiyaki-hondana',
'suto3',
'spud-oimo',
'keroxp',
'aioilight',
'NDLSH-SB',
'programming-notes',
'takker-private',
'takker-books',
'takker-CEPM',
'hitorigakusai',
'kagerw',
'yosider',
'bluepegasusyk',
'unnamedcamp',
'ayu-mushi',
'kidaaam-92022284',
'issac-37765679',
'ima1zumi',
];
common.jsimport {popupBindings} from '../Popup_Menuに独自のkeyboard_shortcutを割り当てるUserScript/script.js';
popupBindings.start();
popupBindings.push(
{key: '-', buttonName: '\uf0cc'}, // 複数行打ち消し線
{key: ']', buttonName: '\uf127'}, // リンクを外す
{key: 'c', buttonName: 'Copy plain'},
);
common.jsimport '../popup/script.js';
import '../mobileからtimestampを行頭に挿入するUserScript/script.js';
import {isMobile} from '../mobile版scrapboxの判定/script.js';
import {isolate} from '../custom-new-page-2/script.js';
import {settings} from '../custom-new-page-2-settings/script.js';
import {setup} from '../scrapbox-keicho/script.js';
if (isMobile()) {
scrapbox.PageMenu.addMenu({
title: 'New Page',
image: 'https://img.icons8.com/ios/180/FFFFFF/cut-paper.png',
onClick: () => isolate(settings),
});
} else {
setup();
}
import '../scrapbox-icon-button/script.js';
import '../scrapbox-pomodoro-timer-2/import.js';
import '../メモ帳を表示するPage_Menu/script.js';
import {initialize} from '../scrapbox-speech-input/script.js';
//import {initialize} from '/api/code/programming-notes/scrapbox-speech-input/script.js';
initialize();
import '../Kakeruを開くPage_Menu/script.js';
// タイムスタンプを消す
scrapbox.TimeStamp.removeAllFormats();
common.js_disabledif (!['takker', 'takker-memex'].includes(scrapbox.Project.name)) {
scrapbox.TimeStamp.addFormat('#YYYY-MM-DD HH:mm:ss');
scrapbox.TimeStamp.addFormat('HH:mm:ss ');
scrapbox.TimeStamp.addFormat('[[]/icon[s]/[d]on[e].icon[]]HH:mm:ss ');
scrapbox.TimeStamp.addFormat('[[]YYYY-MM-DD[]]');
scrapbox.TimeStamp.addFormat('YYYY-MM-DD HH:mm:ss ');
scrapbox.TimeStamp.addFormat('🔳');
scrapbox.TimeStamp.addFormat('✅');
}
takker.jsimport '../New_Buttonで開くページを変更する/script.js';
import {scrapboxDOM} from '../scrapbox-dom-accessor/script.js';
window.scrapboxDOM = scrapboxDOM;
//import '../WebからコピペしたらSB記法に変換する_-_Scrapboxとあそぶ/script2.js';
import {execute} from '../IME_onの時、キー入力をScrapboxに渡すUserScript/script.js';
execute();
//import '../Scanした紙のノートをScrapboxに取り込むUserScript/script.js';
import '../scrapbox-open-episopass/script.js';
takker-memex.jsimport '../New_Buttonで開くページを変更する/script.js';
import '../LETUS_online_editor形式に変換してcopyするPopupMenu/script.js';
import '../選択範囲をspell_checkするPopupMenu/script.js';
import '../文字カウント_(scrapbox)/script.js';
import {scrapBindings} from '../ScrapBindings/script.js';
import {task} from '../ScrapBindings-settings/task.js';
scrapBindings.install()
.then(() => scrapBindings.push(...task));
import '../takker-scheduler-3%2Fmobile/script.js';
import '../scrapbox-open-episopass/script.js';
villagepump.jsimport {execute as execute1} from '../Scrapbox-theme-saver/script.js';
import '../pin-diary-4-min/script.js';