Astroport.ONE/templates/tw/$ _plugins_astroport_lasert...

2 lines
5.2 KiB
JSON

[{"created":"20221206094839243","creator":"Boris","text":"{\n \"tiddlers\": {\n \"$:/plugins/astroport/lasertag/tag-on-import.js\": {\n \"created\": \"20221206090145388\",\n \"creator\": \"Boris\",\n \"text\": \"(function(){\\n\\n\\t/*jslint node: true, browser: true */\\n\\t/*global $tw: false */\\n\\t\\\"use strict\\\";\\n\\n\\t// Export name and synchronous status\\n\\texports.name = \\\"tagonimport\\\";\\n\\texports.platforms = [\\\"browser\\\"];\\n\\texports.after = [\\\"startup\\\"];\\n\\n\\texports.startup = function() {\\n\\n\\t\\t$tw.hooks.addHook('th-importing-tiddler', function (tiddler) {\\n\\n\\n\\t\\t\\tlet defaultTags = $tw.wiki.getTiddlerList(\\\"$:/config/NewTiddler/Tags\\\", \\\"text\\\")\\n\\t\\t\\t\\n\\t\\t\\tvar updatedTiddler = $tw.utils.updateTiddler({\\n\\t\\t\\t\\ttiddler: tiddler,\\n\\t\\t\\t\\taddTags: defaultTags\\n\\t\\t\\t})\\n\\n\\t\\t\\treturn updatedTiddler;\\n\\n\\t\\t});\\n\\n\\t};\\n\\n})();\",\n \"tags\": \"\",\n \"title\": \"$:/plugins/astroport/lasertag/tag-on-import.js\",\n \"modified\": \"20221206094828863\",\n \"modifier\": \"Boris\",\n \"module-type\": \"startup\",\n \"type\": \"application/javascript\"\n },\n \"$:/core/macros/tag\": {\n \"created\": \"20221126185104782\",\n \"creator\": \"Boris\",\n \"text\": \"\\\\define tag-pill-styles()\\nbackground-color:$(backgroundColor)$;\\nfill:$(foregroundColor)$;\\ncolor:$(foregroundColor)$;\\n\\\\end\\n\\n<!-- This has no whitespace trim to avoid modifying $actions$. Closing tags omitted for brevity. -->\\n\\\\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)\\n<$vars\\n\\tforegroundColor=<<contrastcolour target:\\\"\\\"\\\"$colour$\\\"\\\"\\\" fallbackTarget:\\\"\\\"\\\"$fallbackTarget$\\\"\\\"\\\" colourA:\\\"\\\"\\\"$colourA$\\\"\\\"\\\" colourB:\\\"\\\"\\\"$colourB$\\\"\\\"\\\">>\\n\\tbackgroundColor=\\\"\\\"\\\"$colour$\\\"\\\"\\\"\\n><$element-tag$\\n\\t$element-attributes$\\n\\tclass=\\\"tc-tag-label tc-btn-invisible\\\"\\n\\tstyle=<<tag-pill-styles>>\\n><$set name=\\\"tiddlersWithThisTag\\\" filter=\\\"[tag<__tag__>]\\\"><$action-listops $tiddler=\\\"$:/StoryList\\\" $field=\\\"list\\\" $filter=\\\"[enlist<tiddlersWithThisTag>] +[!sort[create]] +[limit[5]]\\\" /></$set>$actions$<$transclude tiddler=\\\"\\\"\\\"$icon$\\\"\\\"\\\"/><$view tiddler=<<__tag__>> field=\\\"title\\\" format=\\\"text\\\" />\\n\\\\end\\n\\n\\n\\\\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)\\n<$macrocall $name=\\\"tag-pill-inner\\\" tag=<<__tag__>> icon=\\\"\\\"\\\"$icon$\\\"\\\"\\\" colour=\\\"\\\"\\\"$colour$\\\"\\\"\\\" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag=\\\"\\\"\\\"$element-tag$\\\"\\\"\\\" element-attributes=\\\"\\\"\\\"$element-attributes$\\\"\\\"\\\" actions=\\\"\\\"\\\"$actions$\\\"\\\"\\\"/>\\n\\\\end\\n\\n\\\\define tag-pill(tag,element-tag:\\\"span\\\",element-attributes:\\\"\\\",actions:\\\"\\\")\\n\\\\whitespace trim\\n<span class=\\\"tc-tag-list-item\\\" data-tag-title=<<__tag__>>>\\n<$let currentTiddler=<<__tag__>>>\\n<$macrocall $name=\\\"tag-pill-body\\\" tag=<<__tag__>> icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} element-tag=\\\"\\\"\\\"$element-tag$\\\"\\\"\\\" element-attributes=\\\"\\\"\\\"$element-attributes$\\\"\\\"\\\" actions=\\\"\\\"\\\"$actions$\\\"\\\"\\\"/>\\n</$let>\\n</span>\\n\\\\end\\n\\n\\\\define tag(tag)\\n{{$tag$||$:/core/ui/TagTemplate}}\\n\\\\end\\n\",\n \"title\": \"$:/core/macros/tag\",\n \"tags\": \"$:/tags/Macro\",\n \"modified\": \"20221206141041799\",\n \"modifier\": \"Boris\"\n },\n \"$:/core/ui/TagTemplate\": {\n \"created\": \"20221126144610490\",\n \"creator\": \"Boris\",\n \"text\": \"\\\\whitespace trim\\n<span class=\\\"tc-tag-list-item\\\" data-tag-title=<<currentTiddler>>>\\n<$set name=\\\"transclusion\\\" value=<<currentTiddler>>>\\n<$macrocall $name=\\\"tag-pill-body\\\" tag=<<currentTiddler>> icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} element-tag=\\\"\\\"\\\"$button\\\"\\\"\\\" element-attributes=\\\"\\\"\\\"tag='span'\\\"\\\"\\\"/>\\n</$set>\\n</span>\\n\",\n \"title\": \"$:/core/ui/TagTemplate\",\n \"modified\": \"20221206140859322\",\n \"modifier\": \"Boris\",\n \"tags\": \"\"\n }\n }\n}","tags":"","title":"$:/plugins/astroport/lasertag","modified":"20221206141340994","modifier":"Boris","type":"application/json","author":"Astroport","name":"Astroport :: Lasertag ::","description":"Automatically tag tiddlers on import, and update the view when clicking tag pills","plugin-type":"plugin","version":"0.0.5","plugin-priority":"10"}]