ScrapBindings-settings
ScrapBindingsのtakker.icon用設定ファイル
2024-05-27
14:25:52 使用中止
takker99/ScrapBindings-settingsに移行した
2023-12-25
16:21:25 間違えてformatまで消してしまっていたのを復元
2023-12-18
12:35:25 日刊記録sheet作成系コマンドを消す
2023-09-13
12:54:56 <S-C-x>,<S-C-d>でブラウザ機能を起動しないようにした
chrome用
2022-05-09
06:52:16 takker-workflow@0.0.1/linkToTaskの順番を入れ替えた
08:12:01 意味なかった
2022-04-30
06:50:05
takker-workflow@0.0.1/linkToTask機能を入れた
moduleを新しいのに差し替えた
06:20:52 つかっていないmakeJudgeTimeFromSelection()を削除した
2022-04-20
12:37:21 Google Calenderの手動同期機能を入れた
2022-03-12
21:26:10 custom-new-page-3を入れた
2022-02-10
13:19:26 日刊記録sheetとGoogle Calendarを同期する機能を削除
2022-01-05
16:35:13 takker99/takker-schedulerに変えた
2021-08-12
15:38:46 物理キーボード用拡張shortcut keyを導入するScrapBindingsの設定を追加した
15:32:10 <C-j>などを消した
物理キーボード用拡張shortcut keyを導入するScrapBindingsの設定と競合するので
2021-07-11
17:44:17 takker-scheduler-3/syncの変更を反映した
2021-06-08
22:29:05 使っていないkey bindingsを消してscrapbox-edit-emulationをdepedenciesから外した
もう動かないコードを含んでいるので、外したかった
22:14:44 update a library
2021-05-22
10:30:23 <input>から予定を入れる機能を入れた
2021-05-03
18:26:55
2021-03-15
07:37:34
takker-scheduler-3の設定を別ファイルにした
importするfileの数をなるべく減らす
01:25:45 exportの名前を変えた
s/tritask/task
2021-03-13
13:44:12 scrapbox-timestampの使用を止めて、代わりにdate-fns.min.jsを使うようにした
2021-01-05
21:35:04 tritask-scrapbox-betaの設定を分割した
2021-01-03
09:28:01 timestamp挿入commandを別ページに切り出した
scrapbox-timestamp
2021-01-02
12:32:11 依存コードにscrapbox-dom-accessorを入れるの忘れてた
2020-12-30
07:31:08 scrapbox-cursor-position-3に変更した
07:26:26 debugを変更した
07:17:05 設定変数を分割して見やすくした
07:16:33 tab/shift+tabでインデントを操作できるようにした
table:目次
Page Menu操作 ScrapBindings-settings#5febab3a1280f000007d4fed
cursor移動 ScrapBindings-settings#5febabff1280f000007d504c
テキスト編集 ScrapBindings-settings#600417641280f0000074186a
scrapbox-timestamp ScrapBindings-settings#5ff10c3b1280f00000bcdc3a
debug用 ScrapBindings-settings#5febac4b1280f000007d5096
タスク用 ScrapBindings-settings#5ff45cd81280f00000a4a206
mobile用 物理キーボード用拡張shortcut keyを導入するScrapBindingsの設定
code:config.js
import { lightFormat, addDays } from "../date-fns/mod.ts";
import {
caret, getCharDOM, getLineDOM, press, insertText,
moveLeft, moveUp, moveDown, moveRight,
goHeadLine, goLastLine,
scrollUp, scrollDown,
scrollHalfUp, scrollHalfDown,
} from "../scrapbox-userscript-std/dom.ts";
ページ遷移
code:config.js
const navigation = [
// リンクを踏む
{key: "ctrl+]", command: () => {
const { position: { line, char } } = caret();
getCharDOM(line, char)?.closest("a.page-link")?.click?.()
// なかったらその行の中で一番先頭のリンクを踏む
??getLineDOM(line)?.querySelector?.("a.page-link")?.click?.();
return false;
},},
// 戻る
{key: "ctrl+o", command: () => {
history.back();
return false;
},},
];
cursor移動
code:config.js
const motion = [
// 移動系
{key: 'ctrl+home', command: () => {goHeadLine();return false;},},
{key: 'ctrl+end', command: () => {goLastLine();return false;},},
{key: 'ctrl+u', command: () => {scrollHalfUp();return false;},},
{key: 'ctrl+d', command: () => {scrollHalfDown();return false;},},
{key: 'ctrl+b', command: () => {scrollUp();return false;},},
{key: 'ctrl+f', command: () => {scrollDown();return false;},},
];
indent操作
tabを使ったindentはここを参考にした
/foldrr/scrapbox-editor-indent-line
code blockでもtabでindentできるようにした
code block中でtab文字は使わないtakker.icon
01:20:46 リンク補完のときに誤動作するのでやめた
code:config.js
const indent = [/*
{key: 'tab', command: () => {
if (scrapboxDOM.cursorLine.getElementsByClassName('table-block').length !== 0) return true;
if (!!scrapboxDOM.popupMenu) return true;
indentLines();
return false;
},},
{key: 'shift+tab', command: () => {
if (scrapboxDOM.cursorLine.getElementsByClassName('table-block').length !== 0) return true;
if (!!scrapboxDOM.popupMenu) return true;
deindentLines();
return false;
},},*/
];
テキスト編集
custom-new-page
for-custom-new-page
2022-04-26 07:21:34 ページを開かないやつも作りたい
2022-04-27 12:49:37 作った
code:config.js
import { makeNewPage } from "../custom-new-page/mod.ts";
import {
newPageHook,
splittedLinkHook,
taskLineHook,
} from "../for-custom-new-page/mod.ts";
const hooks = taskLineHook, newPageHook, splittedLinkHook;
const edit = [
{key: 'ctrl+shift+x', command: () => {
const project = window.prompt("Create a new page at", scrapbox.Project.name);
if (!project) return;
makeNewPage({ project, mode: "self", hooks })?.();
return false;
},},
{key: 'ctrl+shift+d', command: () => {
const project = window.prompt("Create a new page at", scrapbox.Project.name);
if (!project) return;
makeNewPage({ project, mode: "noopen", hooks })?.();
return false;
},},
];
scrapbox-timestamp
cf. /scrapboxlab/タイムスタンプを削除する
code:config.js
// timestampを無効化する
// alt+tの誤動作を防止する
scrapbox.TimeStamp.removeAllFormats();
const timestamp = [
{key: 'alt+t alt+t', command: () => {
insertText(lightFormat(new Date(), '#yyyy-MM-dd HH:mm:ss '));
return false;
},},
{key: 'alt+t alt+j', command: () => {
insertText(lightFormat(new Date(), 'yyyy-MM-dd HH:mm:ss '));
return false;
},},
{key: 'alt+t alt+k', command: () => {
insertText(lightFormat(new Date(), 'HH:mm:ss '));
return false;
},},
{key: 'alt+t alt+l', command: () => {
insertText(lightFormat(new Date(), 'yyyy-MM-dd'));
return false;
},},
];
debug用
code:config.js.disabled(js)
import {selection} from '../scrapbox-selection-3/script.js';
import {tidySpaces} from '../選択範囲の行の空白を整えるUserScript/script.js';
import {sortLines} from '../選択範囲の行を並び替えるUserScript/script.js';
const debug = [
// 選択範囲の情報を取得する
{key: 'ctrl+s ctrl+s', command: () => {
console.log(selection.text);
return false;
},},
// 空白をいい感じにする
{key: 'shift+alt+f', command: () => {tidySpaces(); return false;},},
// 辞書順に並び替える
{key: 'shift+alt+g', command: () => {sortLines(); return false;},},
];
code:config.js
import { mobile } from "../物理キーボード用拡張shortcut_keyを導入するScrapBindingsの設定/script.js";
import { taskCommon } from "./task-common.ts";
export const config = [
...navigation,
...motion,
...indent,
...edit,
...timestamp,
...mobile,
...taskCommon,
//...debug,
];
takker99/takker-scheduler用
bundlerを介さないと実行できないので注意
任意のprojectから使いたいもの
takker99/takker-scheduler/mobileにも同じコード有り
予定タスク以外は現在日付で展開させたいかも
$ deno check -r=https://scrapbox.io --remote https://scrapbox.io/api/code/takker/ScrapBindings-settings/task-common.ts
code:task-common.ts
import {
transport, createTask, toString
} from "../takker99%2Ftakker-scheduler/deps.ts";
import {
parse, toTaskLine
} from "../takker99%2Ftakker-scheduler/workflow.ts";
import {
caret, getLines, replaceLines
} from "../scrapbox-userscript-std/dom.ts";
import type { Scrapbox } from "../scrapbox-jp%2Ftypes/userscript.ts";
declare const scrapbox: Scrapbox;
export const taskCommon = [
{key: 'alt+a alt+c', command: () => {
(async () => {
const start, end = getLineRange();
const text = getLines().slice(start, end + 1).map((line) => {
const text = line.text;
const link = line.text.match(/\[(^\]+)\]/)?.1;
if (!link) return text;
const result = parse(link);
if (!result || !result.ok) return text;
const task = result.value;
if (task.freshness?.status === "done") return text;
const taskLine = toTaskLine(task);
taskLine.title = [${link}];
if (!taskLine) return text;
return toString(taskLine);
}).join("\n");
await replaceLines(start, end, text);
await createTask();
})();
return false;
},},
{key: 'alt+a alt+m', command: () => {
if (scrapbox.Layout !== "page") return;
transport({
from: {
project: scrapbox.Project.name,
title: scrapbox.Page.title,
},
to: "takker-memex",
});
return false;
},},
];
/** 選択範囲に含まれる行かカーソルがいる行を返す
*
* ported from https://github.com/takker99/takker-scheduler/blob/0.7.6/commands/getLineRange.ts
*/
const getLineRange = (): readonly number, number => {
const { selectionRange: { start, end }, selectedText, position } = caret();
return selectedText === ""
? position.line, position.line
: start.line > end.line
? end.line, start.line
: start.line, end.line as const;
};
/takker-memexだけで使うもの
$ deno check -r=https://scrapbox.io --remote https://scrapbox.io/api/code/takker/ScrapBindings-settings/task.ts
code:task.ts
import {
addTask, startTask, endTask, posterioriEndTask,
walkDay, moveToday, format
} from "../takker99%2Ftakker-scheduler/deps.ts";
import type { Scrapbox } from "../scrapbox-jp%2Ftypes/userscript.ts";
declare const scrapbox: Scrapbox;
export const task = [
{key: 'alt+a alt+a', command: () => {addTask();return false;},},
{key: 'alt+a alt+s', command: () => {startTask();return false;},},
{key: 'alt+a alt+e', command: () => {endTask();return false;},},
{key: 'alt+a alt+0', command: () => {posterioriEndTask();return false;},},
{key: 'alt+a alt+1', command: () => {walkDay(1);return false;},},
{key: 'alt+a alt+2', command: () => {walkDay(2);return false;},},
{key: 'alt+a alt+3', command: () => {walkDay(3);return false;},},
{key: 'alt+a alt+4', command: () => {walkDay(4);return false;},},
{key: 'alt+a alt+5', command: () => {walkDay(5);return false;},},
{key: 'alt+a alt+t', command: () => {moveToday();return false;},},
{key: 'alt+a alt+l', command: () => {
window.open("https://script.google.com/macros/s/AKfycbyAgN8nmUXjVXL_tahDzVyyrMzFaI4CJVmIapk8G0GuxxVN-7oUbuDJOf31fP7SFjx9/exec");
return false;
},},
{key: 'alt+a alt+shift+s', command: () => {
if (scrapbox.Layout !== "page") return;
format(scrapbox.Project.name, scrapbox.Page.title);
return false;
},},
];
#2023-12-25 16:21:21
#2023-12-18 12:35:54
#2023-09-18 08:19:25
#2023-09-13 12:55:39
#2023-02-06 20:25:42 custom-new-page@0.4.0の変更を反映
#2023-02-04 14:47:15
#2022-08-19 21:51:17
#2022-08-13 16:16:38
#2022-04-30 06:21:11
#2022-04-27 12:49:45
#2022-04-26 13:47:14
#2022-04-20 12:37:16
#2022-03-12 21:26:26
#2022-02-10 13:20:01
#2022-01-19 21:52:01 一部のタスク操作コマンドを全てのprojectでも使えるようにした
#2022-01-17 00:47:46 transport()追加
#2022-01-07 10:47:05
#2022-01-05 16:35:09
#2021-08-12 15:38:19
#2021-07-16 13:06:24
#2021-06-10 15:43:30
#2021-06-08 22:15:03
#2021-05-22 09:19:32
#2021-05-16 18:12:27
#2021-05-09 13:06:42
#2021-05-03 18:28:15
#2021-03-15 01:26:11
#2021-03-13 13:43:52
#2021-02-20 01:21:14
#2021-01-23 20:35:01
#2021-01-21 16:35:42
#2021-01-20 18:23:13
#2021-01-17 19:55:51
#2021-01-08 11:26:07
#2021-01-06 15:50:10
#2021-01-05 17:39:29
#2021-01-02 06:48:15
#2021-01-01 14:37:07
#2020-12-30 07:14:19
#2020-12-25 11:23:42
#2020-12-24 01:55:28