generated at
import-old
2021-11-16 18:11:41 archived
new version→import
hr
他のprojectの自分のページで使用するUserScript

2021-06-28 13:53:08 ↓をfrom-programming-notes-scriptsに移した
2021-06-20 08:26:55 /programming-notesのcodeをfrom-programming-notesに移した
2021-05-26 20:12:59 common.js をbundleしたfor-any-project-minを使うようにした
2021-04-09 14:28:28 external-completion-3に切り替えた
2021-01-10 11:18:27 動的importのときにログを出力するようにした
2021-01-03 09:07:22 UserScriptの読み込みを制御できるようにした
2020-09-22 21:03:32 機能毎に選んでimport出来るようにした

Log出力機能付きimport
script.js
let 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); } }

URLに noscript=true を渡されたらUserScriptをoffにして開く
script.js
import {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');

projectに応じて読み込むscriptを変える
script.js
switch (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; } })();

全てのprojectで使うscript
common.js
import {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.js
import '../Open_Google_Calendar_PageMenu/script.js';
from-programming-notesから読み込む
common.js
import '../from-programming-notes/index.js';
common.js
import {scrapBindings} from '../ScrapBindings/script.js'; import {config} from '../ScrapBindings-settings/config.js'; scrapBindings.install() .then(() => scrapBindings.push(...config));
common.js
import "../@takker%2Fscrapjupyter-min/mod.js";
common.js
import { 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>`); }
external-completion-3で読み込むリスト
project-list.js
export 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', ];
privateになっちゃったやつ
u-labo's Scrapbox 授業関連 アーカイブ
common.js
import {popupBindings} from '../Popup_Menuに独自のkeyboard_shortcutを割り当てるUserScript/script.js'; popupBindings.start(); popupBindings.push( {key: '-', buttonName: '\uf0cc'}, // 複数行打ち消し線 {key: ']', buttonName: '\uf127'}, // リンクを外す {key: 'c', buttonName: 'Copy plain'}, );
その他script
common.js
import '../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();
カスタム日時挿入
/takker/takker-memex以外で使う
2021-01-18 08:56:23 やめた
common.js_disabled
if (!['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用script
takker.js
import '../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.js
import '../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.js
import {execute as execute1} from '../Scrapbox-theme-saver/script.js'; import '../pin-diary-4-min/script.js';

hr
UserCSS

#2022-11-26 22:49:40
#2022-07-18 07:23:12
#2022-01-17 22:31:28
#2021-11-16 18:11:53
#2021-09-17 15:28:19
#2021-09-14 18:57:35
#2021-09-05 12:55:23
#2021-08-30 19:39:49
#2021-07-30 01:05:50
#2021-07-06 07:43:05
#2021-06-28 13:54:01
#2021-06-20 08:26:50
#2021-06-17 15:39:55
#2021-06-13 10:07:40
#2021-05-31 01:29:49
#2021-05-30 13:35:38
#2021-05-26 14:39:42
#2021-05-25 15:31:24
#2021-05-21 07:51:22
#2021-05-09 11:18:58
#2021-05-07 14:15:54
#2021-04-24 10:33:04
#2021-04-23 15:06:04
#2021-04-19 09:26:02
#2021-04-13 16:47:44
#2021-04-12 02:51:41
#2021-04-09 13:24:05
#2021-03-31 01:41:21
#2021-03-29 11:50:37
#2021-03-27 02:32:15
#2021-03-21 03:13:53
#2021-03-16 04:24:30
#2021-03-15 01:28:48
#2021-03-01 03:28:53
#2021-02-25 14:59:31
#2021-02-24 10:27:58
#2021-02-07 01:38:15
#2021-02-04 06:04:10
#2021-02-02 09:51:32
#2021-01-30 22:10:53
#2021-01-25 00:37:46
#2021-01-24 18:09:15
#2021-01-23 20:44:35
#2021-01-20 22:15:19
#2021-01-19 00:05:10
#2021-01-18 08:56:53
#2021-01-17 11:27:10
#2021-01-15 13:12:26
#2021-01-14 16:47:43
#2021-01-10 03:21:18
#2021-01-09 00:24:58
#2021-01-06 09:37:59
#2021-01-05 22:26:28
#2021-01-04 18:56:03
#2021-01-03 09:40:54
#2020-12-31 13:54:33
#2020-12-28 17:52:21
#2020-12-26 05:38:15
#2020-12-02 23:09:16
#2020-11-10 17:44:52
#2020-11-03 08:59:28
#2020-10-25 16:54:23
#2020-10-22 04:36:38
#2020-10-18 19:53:48
#2020-10-15 18:31:47
#2020-10-01 14:23:12
#2020-09-28 16:18:38
#2020-09-22 21:03:24