{"tiddlers":{"$:/plugins/linonetwo/copy-on-select/config":{"title":"$:/plugins/linonetwo/copy-on-select/config","tags":"$:/tags/ControlPanel/SettingsTab","caption":"<<lingo Name $:/plugins/linonetwo/copy-on-select/language/>>","text":"\\define lingo-base() $:/plugins/linonetwo/copy-on-select/language/\n\n<<lingo Configs/Description>>\n\n---\n\n;<<lingo Configs/ShowNotification/Caption>>\n:<$checkbox tiddler=\"$:/plugins/linonetwo/copy-on-select/configs/ShowNotificationOnCopy\" field=\"text\" checked=\"yes\" unchecked=\"\"> <$link to=\"$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy\"><<lingo Configs/ShowNotification/Description>></$link></$checkbox>\n;<<lingo Configs/CopyTimeout>>\n:<$edit-text tiddler=\"$:/plugins/linonetwo/copy-on-select/configs/CopyTimeout\" tabindex=-1 focus=false cancelPopups=\"yes\" fileDrop=no tag=\"input\" /> <$link to=\"$:/config/linonetwo/copy-on-select/CopyTimeout\"><<lingo Configs/CopyTimeout/Description>></$link>\n"},"$:/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/language/en-GB/Readme":{"title":"$:/plugins/linonetwo/copy-on-select/language/en-GB/Readme","text":"\\define lingo-base() $:/plugins/linonetwo/copy-on-select/language/\n\n<<lingo Description>>\n\n!! Motivation\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\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/language/en-GB/Name":{"title":"$:/plugins/linonetwo/copy-on-select/language/en-GB/Name","text":"Copy on Select"},"$:/plugins/linonetwo/copy-on-select/language/en-GB/Description":{"title":"$:/plugins/linonetwo/copy-on-select/language/en-GB/Description","text":"Copy what you are selecting inside the wiki into the clipboard when holding mouse for 1 second"},"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/Description":{"title":"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/Description","text":"These settings let you customise the behaviour of Copy on Select plugin."},"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/ShowNotification/Caption":{"title":"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/ShowNotification/Caption","text":"Show Notification"},"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/ShowNotification/Description":{"title":"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/ShowNotification/Description","text":"Show Notification On Copy"},"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/CopyTimeout":{"title":"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/CopyTimeout","text":"Copy Timeout"},"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/CopyTimeout/Description":{"title":"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/CopyTimeout/Description","text":"When mouse hold and stop moving for how many second, starts copy."},"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Readme":{"title":"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Readme","text":"\\define lingo-base() $:/plugins/linonetwo/copy-on-select/language/\n\n<<lingo Description>>\n\n!! 动机\n\n我已经习惯了用方便的[[Copy On Select|https://addons.mozilla.org/en-US/firefox/addon/copy-on-select]] Firefox 插件，现在到了 TiddlyWiki 里我经常还是以为选中了就复制了，然后黏贴到别的地方才发现其实并没有复制，很不习惯。\n\n所以我自己重新写了一个适配 TiddlyWiki 的选中即复制脚本。\n\n!! 用法\n\n选中编辑器、按钮等区域以外的任何文本，并保持按住鼠标一秒，就复制选中的内容。\n\n这个插件里的条件语句让它在编辑器等特殊区域内不会起作用，以免干扰「全选黏贴覆盖原有内容」等操作。\n"},"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Name":{"title":"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Name","text":"选中就复制"},"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Description":{"title":"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Description","text":"按住鼠标 1 秒钟，将 Wiki 中选择的内容复制到剪贴板中。"},"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/Description":{"title":"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/Description","text":"通过这些设置，您可以自定义「选中就复制」插件的行为。"},"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/ShowNotification/Caption":{"title":"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/ShowNotification/Caption","text":"显示通知"},"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/ShowNotification/Description":{"title":"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/ShowNotification/Description","text":"复制成功时弹消息"},"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/CopyTimeout":{"title":"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/CopyTimeout","text":"复制超时"},"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/CopyTimeout/Description":{"title":"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/CopyTimeout/Description","text":"当鼠标按住并停止移动多少秒后，开始复制。"},"$:/plugins/linonetwo/copy-on-select/readme":{"title":"$:/plugins/linonetwo/copy-on-select/readme","created":"20200414135748497","modified":"20200602062349232","creator":"LinOnetwo","type":"text/vnd.tiddlywiki","text":"\\define lingo-base() $:/plugins/linonetwo/copy-on-select/language/\n\n<<lingo Readme>>"},"$:/plugins/linonetwo/copy-on-select/tree":{"title":"$:/plugins/linonetwo/copy-on-select/tree","type":"text/vnd.tiddlywiki","text":"<<tree prefix:\"$:/plugins/linonetwo/copy-on-select/\">>"},"$:/plugins/linonetwo/copy-on-select/copy-on-select.js":{"creator":"LinOnetwo","title":"$:/plugins/linonetwo/copy-on-select/copy-on-select.js","type":"application/javascript","module-type":"startup","Modern.TiddlyDev#Origin":"copy-on-select.ts","text":"\"use strict\";exports.name=\"copy-on-select\",exports.platforms=[\"browser\"],exports.after=[\"story\"],exports.synchronous=!0,exports.startup=function(){function t(e){var t,o,n;return!(!e||!e.nodeName||!((t=[\"INPUT\",\"TEXTAREA\",\"BUTTON\"].includes(e.nodeName))||e.className&&e.className.toLowerCase))&&(o=e.className.toLowerCase().includes(\"codemirror\"),n=e.dataset.slateEditor||e.dataset.slateNode||e.dataset.slateLeaf||e.dataset.slateString,t||o||n)}let o=!1,n=!0,s=.6,i=!0;let e=0;const r=e=>{let t=document.getSelection().toString();(t=t.endsWith(\"\\n\")?t.substring(0,t.length-1):t)&&(e.preventDefault(),e.clipboardData.setData(\"text/plain\",t),console.log(\"showNotification\",i),i)&&($tw.wiki.addTiddler({title:\"$:/state/notification/copy-on-select\",text:\"Copy\\n\\n\".concat(t)}),$tw.notifier.display(\"$:/state/notification/copy-on-select\"))},a=()=>{var e=document.querySelectorAll(\":hover\");n||o||!(null!=e&&e.length)||Array.from(e).some(t)||(document.addEventListener(\"copy\",r),document.execCommand(\"copy\"),document.removeEventListener(\"copy\",r))};function c(){clearTimeout(e),e=setTimeout(a,1e3*s)}document.addEventListener(\"mousedown\",()=>{var e=document.querySelectorAll(\":hover\");null==e||!e.length||Array.from(e).some(t)?o=!0:(o=!1,n=!1,s=Number($tw.wiki.getTiddlerText(\"$:/config/linonetwo/copy-on-select/CopyTimeout\",\"1\"))||.6,isFinite(s)||(s=.6),i=\"yes\"===$tw.wiki.getTiddlerText(\"$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy\"),document.addEventListener(\"mousemove\",c))}),document.addEventListener(\"mouseup\",()=>{n=!0,o=!1,clearTimeout(e),document.removeEventListener(\"mousemove\",c)})};"}}}