Skip to content

Commit

Permalink
Updated with Git-Sync
Browse files Browse the repository at this point in the history
update plugins

Updated with Git-Sync
  • Loading branch information
Zacharia2 committed Jun 18, 2023
1 parent a82345d commit 67e1c27
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 27 deletions.
2 changes: 1 addition & 1 deletion tiddlers/TCTSystem/plugins/flibbles/relink.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tiddlers/TCTSystem/plugins/flibbles/relink.json.meta
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ plugin-type: plugin
source: https://github.com/flibbles/tw5-relink
title: $:/plugins/flibbles/relink
type: application/json
version: 2.3.1
version: 2.3.4
2 changes: 1 addition & 1 deletion tiddlers/TCTSystem/plugins/kookma/shiraz.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tiddlers/TCTSystem/plugins/kookma/shiraz.json.meta
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ plugin-type: plugin
source: https://github.com/kookma/TW-Shiraz
title: $:/plugins/kookma/shiraz
type: application/json
version: 2.8.2
version: 2.8.3
2 changes: 1 addition & 1 deletion tiddlers/TCTSystem/plugins/linonetwo/copy-on-select.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"tiddlers":{"$:/plugins/linonetwo/copy-on-select/copy-on-select.html":{"title":"$:/plugins/linonetwo/copy-on-select/copy-on-select.html","text":"<script type=\"application/javascript\">\n // we won't do copy on select on text editor, otherwise you can't select and override text in the editor or text input\n function checkIfElementIsEditor(element) {\n if (!element || !element.nodeName) return false;\n const isEditableElement = ['INPUT', 'TEXTAREA', 'BUTTON'].includes(element.nodeName);\n if (!isEditableElement) {\n if (!element.className || !element.className.toLowerCase) return false;\n }\n const isTextEditor = element.className.toLowerCase().includes('codemirror');\n const isSlateEditor = element.dataset.slateEditor || element.dataset.slateNode || element.dataset.slateLeaf || element.dataset.slateString;\n\n return isEditableElement || isTextEditor || isSlateEditor;\n }\n // if we start selection on editor, we prevent the following execution of this script\n let copyOnSelectPreventCopy = false;\n /** mousedown and wait for 1s to copy */\n let copyTimeoutNotDone = true;\n /** 1s */\n const copyTimeout = 1;\n let copyTimeoutHandler = 0;\n\n const cleanUp = () => {\n copyTimeoutNotDone = true;\n copyOnSelectPreventCopy = false;\n clearTimeout(copyTimeoutHandler);\n };\n\n /**\n * remove the tailing \\n when copying title\n * And display a notification\n */\n const copyTextModifier = (event) => {\n const selection = document.getSelection();\n let copiedText = selection.toString();\n if (copiedText.endsWith('\\n')) {\n copiedText = copiedText.substring(0, copiedText.length - 1);\n }\n // if selection is empty, don't do anything\n if (!copiedText) return;\n event.preventDefault();\n event.clipboardData.setData('text/plain', copiedText);\n\n $tw.wiki.addTiddler({ title: '$:/state/notification/copy-on-select', text: `Copy\\n\\n${copiedText}` });\n $tw.notifier.display('$:/state/notification/copy-on-select');\n /** display copied text in notification */\n // const truncateLength = 30;\n // if (copiedText.length > truncateLength) {\n // copiedText = `${copiedText.substring(0, 30)} ...`;\n // }\n };\n /** Copy on select, copy document selection when mouse is down for a while */\n const onCopy = () => {\n /** NodeList from root html to current element, can't get selection info. So need to use `document.execCommand('copy')` instead of copy .innerText */\n const elementsUnderMouse = document.querySelectorAll(':hover');\n\n const copyPrevented =\n copyTimeoutNotDone || copyOnSelectPreventCopy || !elementsUnderMouse?.length || Array.from(elementsUnderMouse).some(checkIfElementIsEditor);\n cleanUp();\n if (copyPrevented) {\n return;\n }\n\n document.addEventListener('copy', copyTextModifier);\n /** $tw.utils.copyToClipboard(copiedText); can't copy image or html h1 format */\n // does not work on safari https://stackoverflow.com/questions/71340178/combination-of-document-addeventlistener-and-document-execcommandcopy-does-n/71372287#71372287\n document.execCommand('copy');\n document.removeEventListener('copy', copyTextModifier);\n };\n\n document.addEventListener('mousedown', () => {\n const elementsUnderMouse = document.querySelectorAll(':hover');\n\n if (!elementsUnderMouse?.length || Array.from(elementsUnderMouse).some(checkIfElementIsEditor)) {\n copyOnSelectPreventCopy = true;\n } else {\n copyOnSelectPreventNextCopy = false;\n // if hold mouse till copyTimeout, means timeout done, then \"not done\" is false\n copyTimeoutNotDone = false;\n copyTimeoutHandler = setTimeout(onCopy, copyTimeout * 1000);\n }\n });\n\n document.addEventListener('mouseup', () => {\n cleanUp();\n });\n</script>\n","type":"text/html","created":"20200411065413157","modified":"20200414150804034","creator":"LinOnetwo","tags":"$:/tags/RawMarkup"},"$:/plugins/linonetwo/copy-on-select/readme":{"title":"$:/plugins/linonetwo/copy-on-select/readme","created":"20200414135748497","modified":"20200602062349232","creator":"LinOnetwo","type":"text/vnd.tiddlywiki","text":"Copy what you are selecting inside the wiki into the clipboard when holding mouse for 1 second\n\n!! 动机 Motivation\n\n我已经习惯了用方便的[[Copy On Select|https://addons.mozilla.org/en-US/firefox/addon/copy-on-select]] Firefox 插件,现在到了 TiddlyWiki 里我经常还是以为选中了就复制了,然后黏贴到别的地方才发现其实并没有复制,很不习惯。\n\n所以我自己重新写了一个适配 TiddlyWiki 的选中即复制脚本。\n\nI've gotten used to using the handy [[Copy On Select|https://addons.mozilla.org/en-US/firefox/addon/copy-on-select]] Firefox plugin, but now in TiddlyWiki I often still think I've copied it when I select it, and then I found out that I hadn't copied it until I pasted it somewhere else, which was very uncomfortable.\n\nSo I rewrote my own copy-on-selection script for TiddlyWiki.\n\n!! 用法 Usage\n\n选中编辑器、按钮等区域以外的任何文本,并保持按住鼠标一秒,就复制选中的内容。\n\n这个插件里的条件语句让它在编辑器等特殊区域内不会起作用,以免干扰「全选黏贴覆盖原有内容」等操作。\n\nSelect any text outside the editor, buttons, etc., and hold the mouse down for a second to copy the selected content.\n\nThe conditional statement in this plugin makes it not work in special areas like the editor, so as not to interfere with operations like \"select all and paste overwrite\".\n"}}}
{"tiddlers":{"$:/config/linonetwo/copy-on-select/CopyTimeout":{"title":"$:/config/linonetwo/copy-on-select/CopyTimeout","text":"0.6"},"$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy":{"title":"$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy","text":"yes"},"$:/plugins/linonetwo/copy-on-select/copy-on-select.js":{"title":"$:/plugins/linonetwo/copy-on-select/copy-on-select.js","text":"exports.name = 'copy-on-select';\nexports.platforms = ['browser'];\nexports.after = ['story'];\nexports.synchronous = true;\n\nexports.startup = function () {\n // we won't do copy on select on text editor, otherwise you can't select and override text in the editor or text input\n function checkIfElementIsEditor(element) {\n if (!element || !element.nodeName) return false;\n const isEditableElement = ['INPUT', 'TEXTAREA', 'BUTTON'].includes(element.nodeName);\n if (!isEditableElement) {\n if (!element.className || !element.className.toLowerCase) return false;\n }\n const isTextEditor = element.className.toLowerCase().includes('codemirror');\n const isSlateEditor = element.dataset.slateEditor || element.dataset.slateNode || element.dataset.slateLeaf || element.dataset.slateString;\n\n return isEditableElement || isTextEditor || isSlateEditor;\n }\n // if we start selection on editor, we prevent the following execution of this script\n let copyOnSelectPreventCopy = false;\n /** mousedown and wait for 1s to copy */\n let copyTimeoutNotDone = true;\n /** 0.6s */\n let copyTimeout = 0.6;\n let showNotification = true;\n const loadConfig = () => {\n copyTimeout = Number($tw.wiki.getTiddlerText('$:/config/linonetwo/copy-on-select/CopyTimeout', '1')) || 0.6;\n if (!isFinite(copyTimeout)) {\n copyTimeout = 0.6;\n }\n showNotification = $tw.wiki.getTiddlerText('$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy') === 'yes';\n };\n let copyTimeoutHandler = 0;\n let copyReadyTimeoutHandler = 0;\n\n const cleanUp = () => {\n copyTimeoutNotDone = true;\n copyOnSelectPreventCopy = false;\n clearTimeout(copyTimeoutHandler);\n document.removeEventListener('mousemove', startCopyReadyCountDownCallback);\n };\n\n /**\n * remove the tailing \\n when copying title\n * And display a notification\n */\n const copyTextModifier = (event) => {\n const selection = document.getSelection();\n let copiedText = selection.toString();\n if (copiedText.endsWith('\\n')) {\n copiedText = copiedText.substring(0, copiedText.length - 1);\n }\n // if selection is empty, don't do anything\n if (!copiedText) return;\n event.preventDefault();\n event.clipboardData.setData('text/plain', copiedText);\n\n // DEBUG: console showNotification\n console.log(`showNotification`, showNotification);\n if (showNotification) {\n $tw.wiki.addTiddler({ title: '$:/state/notification/copy-on-select', text: `Copy\\n\\n${copiedText}` });\n $tw.notifier.display('$:/state/notification/copy-on-select');\n /** display copied text in notification */\n // const truncateLength = 30;\n // if (copiedText.length > truncateLength) {\n // copiedText = `${copiedText.substring(0, 30)} ...`;\n // }\n }\n };\n /** Copy on select, copy document selection when mouse is down for a while */\n const onCopy = () => {\n /** NodeList from root html to current element, can't get selection info. So need to use `document.execCommand('copy')` instead of copy .innerText */\n const elementsUnderMouse = document.querySelectorAll(':hover');\n\n const copyPrevented =\n copyTimeoutNotDone || copyOnSelectPreventCopy || !elementsUnderMouse?.length || Array.from(elementsUnderMouse).some(checkIfElementIsEditor);\n if (copyPrevented) {\n return;\n }\n\n // this will only work for 2 times. On 3 times, it will not get called, no way around this.\n document.addEventListener('copy', copyTextModifier);\n /** $tw.utils.copyToClipboard(copiedText); can't copy image or html h1 format */\n // does not work on safari https://stackoverflow.com/questions/71340178/combination-of-document-addeventlistener-and-document-execcommandcopy-does-n/71372287#71372287\n document.execCommand('copy');\n document.removeEventListener('copy', copyTextModifier);\n };\n\n function startCopyReadyCountDown() {\n // when mouse move, reset the timeout, so we won't copy while user still selecting\n document.addEventListener('mousemove', startCopyReadyCountDownCallback);\n }\n function startCopyReadyCountDownCallback() {\n clearTimeout(copyTimeoutHandler);\n copyTimeoutHandler = setTimeout(onCopy, copyTimeout * 1000);\n }\n\n document.addEventListener('mousedown', () => {\n const elementsUnderMouse = document.querySelectorAll(':hover');\n\n if (!elementsUnderMouse?.length || Array.from(elementsUnderMouse).some(checkIfElementIsEditor)) {\n copyOnSelectPreventCopy = true;\n } else {\n copyOnSelectPreventNextCopy = false;\n // if hold mouse till copyTimeout, means timeout done, then \"not done\" is false\n copyTimeoutNotDone = false;\n loadConfig();\n startCopyReadyCountDown();\n }\n });\n\n document.addEventListener('mouseup', () => {\n cleanUp();\n });\n};\n","creator":"LinOnetwo","type":"application/javascript","module-type":"startup"},"$:/plugins/linonetwo/copy-on-select/readme":{"title":"$:/plugins/linonetwo/copy-on-select/readme","created":"20200414135748497","modified":"20200602062349232","creator":"LinOnetwo","type":"text/vnd.tiddlywiki","text":"Copy what you are selecting inside the wiki into the clipboard when holding mouse for 1 second\n\n!! 动机 Motivation\n\n我已经习惯了用方便的[[Copy On Select|https://addons.mozilla.org/en-US/firefox/addon/copy-on-select]] Firefox 插件,现在到了 TiddlyWiki 里我经常还是以为选中了就复制了,然后黏贴到别的地方才发现其实并没有复制,很不习惯。\n\n所以我自己重新写了一个适配 TiddlyWiki 的选中即复制脚本。\n\nI've gotten used to using the handy [[Copy On Select|https://addons.mozilla.org/en-US/firefox/addon/copy-on-select]] Firefox plugin, but now in TiddlyWiki I often still think I've copied it when I select it, and then I found out that I hadn't copied it until I pasted it somewhere else, which was very uncomfortable.\n\nSo I rewrote my own copy-on-selection script for TiddlyWiki.\n\n!! 用法 Usage\n\n选中编辑器、按钮等区域以外的任何文本,并保持按住鼠标一秒,就复制选中的内容。\n\n这个插件里的条件语句让它在编辑器等特殊区域内不会起作用,以免干扰「全选黏贴覆盖原有内容」等操作。\n\nSelect any text outside the editor, buttons, etc., and hold the mouse down for a second to copy the selected content.\n\nThe conditional statement in this plugin makes it not work in special areas like the editor, so as not to interfere with operations like \"select all and paste overwrite\".\n"},"$:/plugins/linonetwo/copy-on-select/settings":{"title":"$:/plugins/linonetwo/copy-on-select/settings","text":"<$edit-text tag=input tiddler=\"$:/config/linonetwo/copy-on-select/CopyTimeout\" field=\"text\" /> <$link to=\"$:/config/linonetwo/copy-on-select/CopyTimeout\">When mouse stop moving for how many second, starts copy.</$link> \n\n<$checkbox tiddler=\"$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"no\"> <$link to=\"$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy\">Show Notification On Copy</$link> </$checkbox>\n"}}}
4 changes: 2 additions & 2 deletions tiddlers/TCTSystem/plugins/linonetwo/copy-on-select.json.meta
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ author: LinOnetwo
core-version: >=5.1.22
dependents:
description: Copy what you are selecting inside the wiki into the clipboard when holding mouse for 1 second
list: readme
list: readme settings
name: copy-on-select
plugin-type: plugin
title: $:/plugins/linonetwo/copy-on-select
type: application/json
version: 0.1.2
version: 0.2.0
2 changes: 1 addition & 1 deletion tiddlers/TCTSystem/plugins/linonetwo/itonnote.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tiddlers/TCTSystem/plugins/linonetwo/itonnote.json.meta
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
author: LinOnetwo
core-version: >=5.1.22
dependents: $:/plugins/bimlas/locator
dependents: $:/plugins/bimlas/locator $:/plugins/tiddlywiki/browser-sniff
description: Heavy lifting for new users to set up a powerful and opinionated knowledge management system.
list: readme description ControlPanel
name: ItonNote
plugin-type: plugin
title: $:/plugins/linonetwo/itonnote
type: application/json
version: 1.0.9
version: 1.1.0
4 changes: 2 additions & 2 deletions tiddlers/TCTSystem/plugins/linonetwo/tw-mobile-sync.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tiddlers/TCTSystem/themes/linonetwo/itonnote.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tiddlers/TCTSystem/themes/linonetwo/itonnote.json.meta
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ author: LinOnetwo
core-version: >=5.0.0
dependents: $:/themes/tiddlywiki/vanilla
description: Notion and VSCode inspired theme
list: readme settings
name: ItonNote Theme
plugin-priority: 1
plugin-type: theme
title: $:/themes/linonetwo/itonnote
type: application/json
version: 0.2.18
version: 0.2.21
13 changes: 0 additions & 13 deletions tiddlers/我的最终工作.tid

This file was deleted.

0 comments on commit 67e1c27

Please sign in to comment.