tiddlywiki-production
Version:
a non-linear personal web notebook
1 lines • 13.5 kB
JavaScript
$tw.preloadTiddler({"title":"$:/plugins/tiddlywiki/comments","name":"Comments","description":"Threaded tiddler comments","list":"readme config","version":"5.1.22","plugin-type":"plugin","dependents":"","type":"application/json","text":"{\"tiddlers\":{\"$:/config/Comments/EnableFilter\":{\"title\":\"$:/config/Comments/EnableFilter\",\"text\":\"[all[current]!is[system]]\\n\"},\"$:/plugins/tiddlywiki/comments/above-story\":{\"title\":\"$:/plugins/tiddlywiki/comments/above-story\",\"tags\":\"$:/tags/AboveStory\",\"text\":\"<$reveal state=\\\"$:/config/Comments/EnableWikiComments\\\" type=\\\"match\\\" text=\\\"yes\\\" default=\\\"no\\\">\\n\\n<$tiddler tiddler=\\\"$:/SiteTitle\\\">\\n\\n<$transclude tiddler=\\\"$:/plugins/tiddlywiki/comments/comments-template\\\" mode=\\\"inline\\\"/>\\n\\n</$tiddler>\\n\\n</$reveal>\\n\"},\"$:/plugins/tiddlywiki/comments/add-comment-button-actions\":{\"title\":\"$:/plugins/tiddlywiki/comments/add-comment-button-actions\",\"text\":\"<$set name=\\\"username\\\" value={{$:/status/UserName}} emptyValue=\\\"(anonymous)\\\">\\n<$set name=\\\"target\\\" filter=\\\"[<currentTiddler>]\\\">\\n<$action-createtiddler $basetitle={{{ [[Comment by ']addsuffix<username>addsuffix[' on ']addsuffix<currentTiddler>addsuffix[']] }}} role=\\\"comment\\\" list=<<target>> text=\\\"\\\" edit-mode=\\\"yes\\\"/>\\n</$set>\\n</$set>\\n\"},\"$:/plugins/tiddlywiki/comments/add-comment-button\":{\"title\":\"$:/plugins/tiddlywiki/comments/add-comment-button\",\"text\":\"<$reveal state=\\\"$:/status/IsReadOnly\\\" type=\\\"match\\\" text=\\\"no\\\" default=\\\"no\\\" tag=\\\"div\\\" class=\\\"tc-comment-button\\\">\\n<$button class=\\\"tc-btn-invisible\\\" actions={{$:/plugins/tiddlywiki/comments/add-comment-button-actions}}>\\nadd comment {{$:/core/images/add-comment}}\\n</$button>\\n</$reveal>\\n\"},\"$:/plugins/tiddlywiki/comments/comments-template\":{\"title\":\"$:/plugins/tiddlywiki/comments/comments-template\",\"text\":\"<div class=\\\"tc-comments\\\">\\n<ol class=\\\"tc-comment-list\\\">\\n<$list filter=\\\"[all[tiddlers+shadows]role[comment]contains<currentTiddler>sort[created]!has[draft.of]]\\\">\\n<li>\\n<div class=\\\"tc-comment-entry\\\">\\n<div class=\\\"tc-comment-entry-heading\\\">\\n<$link>{{!!creator}} at <$view field=\\\"modified\\\" format=\\\"date\\\" template=\\\"0hh:0mm:0ss DDD DDth MMM YYYY\\\"/></$link>\\n<$list filter=\\\"[all[shadows+tiddlers]tag[$:/tags/CommentToolbarButton]!has[draft.of]]\\\" variable=\\\"listItem\\\">\\n<$transclude tiddler=<<listItem>> mode=\\\"inline\\\"/>\\n</$list>\\n</div>\\n<div class=\\\"tc-comment-entry-body\\\">\\n<$reveal type=\\\"match\\\" state=\\\"!!edit-mode\\\" text=\\\"yes\\\">\\n<$edit-text tiddler=<<currentTiddler>> tag=\\\"textarea\\\" focus=\\\"true\\\"/>\\n</$reveal>\\n<$reveal type=\\\"nomatch\\\" state=\\\"!!edit-mode\\\" text=\\\"yes\\\">\\n<$transclude tiddler=<<currentTiddler>> mode=\\\"block\\\"/>\\n<$transclude tiddler=\\\"$:/plugins/tiddlywiki/comments/add-comment-button\\\" mode=\\\"inline\\\"/>\\n</$reveal>\\n</div>\\n</div>\\n<$transclude tiddler=\\\"$:/plugins/tiddlywiki/comments/comments-template\\\" mode=\\\"inline\\\"/>\\n</li>\\n</$list>\\n</ol>\\n</div>\\n\"},\"$:/plugins/tiddlywiki/comments/config\":{\"title\":\"$:/plugins/tiddlywiki/comments/config\",\"text\":\"\\\\define select(description,filter)\\n<$button>\\n<$action-setfield $tiddler=\\\"$:/config/Comments/EnableFilter\\\" $value=<<__filter__>>/>\\n$description$\\n</$button>\\n\\\\end\\n\\n! Wiki Comments\\n\\n<$checkbox tiddler=\\\"$:/config/Comments/EnableWikiComments\\\" field=\\\"text\\\" checked=\\\"yes\\\" unchecked=\\\"no\\\" default=\\\"no\\\"> <$link to=\\\"$:/config/Comments/EnableWikiComments\\\">Allow wiki-level comments as well as tiddler comments</$link> </$checkbox>\\n\\n! Tiddler Comments\\n\\nThis filter expression determines which tiddlers will have commenting enabled:\\n\\n<$edit-text tiddler=\\\"$:/config/Comments/EnableFilter\\\" tag=\\\"input\\\"/>\\n\\nOr you can choose a preselected filter:\\n\\n* <<select \\\"All tiddlers except system tiddlers\\\" \\\"[all[current]!is[system]]\\\">>\\n* <<select \\\"Only tiddlers tagged 'commentable'\\\" \\\"[all[current]tag[commentable]]\\\">>\\n* <<select \\\"Disable all commenting\\\" \\\"\\\">>\\n\"},\"$:/plugins/tiddlywiki/comments/filter-all-comments\":{\"title\":\"$:/plugins/tiddlywiki/comments/filter-all-comments\",\"tags\":\"$:/tags/Filter\",\"filter\":\"[role[comment]!sort[modified]]\",\"description\":\"All comments\",\"text\":\"\"},\"$:/plugins/tiddlywiki/comments/footer-view-template-segment\":{\"title\":\"$:/plugins/tiddlywiki/comments/footer-view-template-segment\",\"tags\":\"$:/tags/ViewTemplate\",\"list-after\":\"$:/core/ui/ViewTemplate/body\",\"text\":\"<$list filter={{$:/config/Comments/EnableFilter}} variable=\\\"ignore\\\">\\n<div class=\\\"tc-comments-segment\\\">\\n<$transclude tiddler=\\\"$:/plugins/tiddlywiki/comments/add-comment-button\\\" mode=\\\"inline\\\"/>\\n<$transclude tiddler=\\\"$:/plugins/tiddlywiki/comments/comments-template\\\" mode=\\\"inline\\\"/>\\n</div>\\n</$list>\"},\"$:/plugins/tiddlywiki/comments/header-view-template-segment\":{\"title\":\"$:/plugins/tiddlywiki/comments/header-view-template-segment\",\"tags\":\"$:/tags/ViewTemplate\",\"list-before\":\"$:/core/ui/ViewTemplate/body\",\"text\":\"\\\\define display-original-comment()\\n<$link><$text text=<<currentTiddler>>/></$link>\\n\\\\end\\n\\n\\\\define find-original-comment(exclude)\\n<$list filter=\\\"[<currentTiddler>role[comment]]\\\" emptyMessage=<<display-original-comment>> variable=\\\"ignore\\\">\\n<$list filter=\\\"[list<currentTiddler>sort[title]] -[enlist<__exclude__>]\\\">\\n<$set name=\\\"newExclude\\\" filter=\\\"[enlist<__exclude__>] [<currentTiddler>]\\\">\\n<$macrocall $name=\\\"find-original-comment\\\" exclude=<<newExclude>>/>\\n</$set>\\n</$list>\\n</$list>\\n\\\\end\\n\\n<$list filter=\\\"[all[current]role[comment]]\\\" variable=\\\"ignore\\\">\\n<div class=\\\"tc-is-comment-header\\\">\\n<p>\\nThis tiddler is a comment on\\n<$list filter=\\\"[list<currentTiddler>sort[title]]\\\">\\n<<find-original-comment>> \\n</$list>\\n</p>\\n<$list filter=\\\"[list<currentTiddler>role[comment]sort[title]limit[1]]\\\" variable=\\\"ignore\\\">\\n<p>\\nParent comments:\\n</p>\\n<ul>\\n<$list filter=\\\"[list<currentTiddler>role[comment]sort[title]]\\\">\\n<li>\\n<$link to=<<currentTiddler>>><$text text=<<currentTiddler>>/></$link>\\n</li>\\n</$list>\\n</ul>\\n</$list>\\n</div>\\n</$list>\\n\"},\"$:/plugins/tiddlywiki/comments/readme\":{\"title\":\"$:/plugins/tiddlywiki/comments/readme\",\"text\":\"This plugin provides a simple means for adding threaded comments to tiddlers.\\n\\n* Click the \\\"add comment\\\" button to make a new comment, and then click the \\\"save\\\" button to save it\\n* You can comment on a tiddler itself, or add a comment to an existing comment\\n* The sidebar tab ''Comments'' lists a timeline of all comments\\n* Comments are attributed to the username stored in the system tiddler [[$:/status/UserName]]\\n* By default, comments are available on all non-system tiddlers. The ''config'' tab lets you customise which tiddlers can accept comments by specifying a filter extension\\n* The buttons for adding and editing comments are only available if the system tiddler [[$:/status/IsReadOnly]] is not set to `yes`\\n* Use the \\\"All comments\\\" option in the $:/AdvancedSearch ''Filter'' tab to see or export all comments\\n\\n!! Data Model\\n\\nThe data model employed by the comments plugin is very simple:\\n\\n* Comment tiddlers are identified by the `role` field being set to `comment`\\n* The `list` field of comment tiddlers lists the tiddlers to which this comment applies\\n** It is thus possible for a comment to be applied to multiple tiddlers at once\\n** The links between comments can be preserved when renaming them by using the relink checkbox in the edit template\\n* The `edit-mode` field of comment tiddlers is set to `yes` to display it in edit mode, or `no` to display it in view mode\\n* The `saved-text` field is updated when switching to edit mode so that it can be restored if the user cancels\\n\\n\"},\"$:/plugins/tiddlywiki/comments/sidebar-segment\":{\"title\":\"$:/plugins/tiddlywiki/comments/sidebar-segment\",\"tags\":\"$:/tags/SideBarSegment\",\"list-after\":\"$:/core/ui/SideBarSegments/site-subtitle\",\"text\":\"<$reveal state=\\\"$:/config/Comments/EnableWikiComments\\\" type=\\\"match\\\" text=\\\"yes\\\" default=\\\"no\\\">\\n<$tiddler tiddler=\\\"$:/SiteTitle\\\">\\n<$transclude tiddler=\\\"$:/plugins/tiddlywiki/comments/add-comment-button\\\" mode=\\\"inline\\\"/>\\n</$tiddler>\\n</$reveal>\\n\"},\"$:/plugins/tiddlywiki/comments/sidebar\":{\"title\":\"$:/plugins/tiddlywiki/comments/sidebar\",\"tags\":\"$:/tags/SideBar\",\"caption\":\"Comments\",\"text\":\"<div class=\\\"tc-timeline\\\">\\n<$list filter=\\\"[all[tiddlers+shadows]role[comment]has[modified]!sort[modified]eachday[modified]]\\\">\\n<div class=\\\"tc-menu-list-item\\\">\\n<$view field=\\\"modified\\\" format=\\\"date\\\" template=\\\"DDth MMM YYYY\\\"/>\\n<$list filter=\\\"[all[tiddlers+shadows]role[comment]sameday:modified{!!modified}!sort[modified]]\\\">\\n<div class=\\\"tc-menu-list-subitem\\\">\\n<$link>Comment by '<$view field=\\\"modifier\\\">(anonymous)</$view>'</$link> on\\n<$list filter=\\\"[list<currentTiddler>sort[title]]\\\">\\n<$link to=<<currentTiddler>>><$text text=<<currentTiddler>>/></$link>\\n</$list>\\n</div>\\n</$list>\\n</div>\\n</$list>\\n</div>\\n\"},\"$:/plugins/tiddlywiki/comments/styles\":{\"title\":\"$:/plugins/tiddlywiki/comments/styles\",\"tags\":\"[[$:/tags/Stylesheet]]\",\"text\":\"\\\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline\\n\\n.tc-is-comment-header {\\n\\tpadding: 0.25em;\\n\\tborder: 2px solid #c1e1ea;\\n\\tborder-radius: 4px;\\n\\tbackground: #f1fcff;\\n}\\n\\n.tc-comments-segment {\\n\\tborder-top: 2px solid #d7eef4;\\n}\\n\\n.tc-comment-button button {\\n\\twidth: 100%;\\n\\ttext-align: right;\\n}\\n\\n.tc-sidebar-scrollable .tc-comment-button button {\\n\\twidth: auto;\\n\\ttext-align: right;\\n}\\n\\n.tc-comment-button button svg {\\n\\tfill: #26cb56;\\n\\theight: 2em;\\n\\twidth: 2em;\\n}\\n\\n.tc-comments {\\n}\\n\\n.tc-comment-list {\\n\\tlist-style: none;\\n padding-left: 0;\\n}\\n\\n.tc-comment-list .tc-comments {\\n\\tpadding-left: 1em;\\n}\\n\\n.tc-comment-entry {\\n\\tposition: relative;\\n\\tborder: 2px solid #c1e1ea;\\n\\tborder-radius: 4px;\\n\\tmargin: 0.5em 0 0 0;\\n\\tbackground: #f1fcff;\\n}\\n\\n.tc-comment-entry-heading {\\n\\tfont-size: 0.7em;\\n\\tfont-weight: bold;\\n\\ttext-transform: uppercase;\\n\\tbackground: #d7eef4;\\n\\tcolor: #5B6D80;\\n\\tpadding: 0 0.5em;\\n}\\n\\n.tc-comment-entry-body {\\n\\tfont-size: 0.8em;\\n\\tpadding: 0 0.5em;\\n}\\n\\n.tc-comment-entry-body textarea {\\n\\tfont-size: 1.1em;\\n\\twidth: 100%\\n}\\n\"},\"$:/tags/CommentToolbarButton\":{\"title\":\"$:/tags/CommentToolbarButton\",\"list\":\"[[$:/plugins/tiddlywiki/comments/toolbar-button-cancel]] [[$:/plugins/tiddlywiki/comments/toolbar-button-delete]] [[$:/plugins/tiddlywiki/comments/toolbar-button-save]] [[$:/plugins/tiddlywiki/comments/toolbar-button-edit]]\"},\"$:/plugins/tiddlywiki/comments/toolbar-button-cancel\":{\"title\":\"$:/plugins/tiddlywiki/comments/toolbar-button-cancel\",\"tags\":\"$:/tags/CommentToolbarButton\",\"text\":\"<$reveal state=\\\"$:/status/IsReadOnly\\\" type=\\\"match\\\" text=\\\"no\\\" default=\\\"no\\\" tag=\\\"span\\\">\\n<$reveal type=\\\"match\\\" state=\\\"!!edit-mode\\\" text=\\\"yes\\\">\\n<$button>\\n<$action-setfield $tiddler=<<currentTiddler>> $field=\\\"edit-mode\\\" $value=\\\"no\\\"/>\\n<$action-setfield $tiddler=<<currentTiddler>> $field=\\\"text\\\" $value={{!!saved-text}}/>\\ncancel\\n</$button>\\n</$reveal>\\n</$reveal>\\n\"},\"$:/plugins/tiddlywiki/comments/toolbar-button-delete\":{\"title\":\"$:/plugins/tiddlywiki/comments/toolbar-button-delete\",\"tags\":\"$:/tags/CommentToolbarButton\",\"text\":\"<$reveal state=\\\"$:/status/IsReadOnly\\\" type=\\\"match\\\" text=\\\"no\\\" default=\\\"no\\\" tag=\\\"span\\\">\\n<$reveal type=\\\"match\\\" state=\\\"!!edit-mode\\\" text=\\\"yes\\\">\\n<$button>\\n<$action-deletetiddler $tiddler=<<currentTiddler>>/>\\ndelete\\n</$button>\\n</$reveal>\\n</$reveal>\\n\"},\"$:/plugins/tiddlywiki/comments/toolbar-button-edit\":{\"title\":\"$:/plugins/tiddlywiki/comments/toolbar-button-edit\",\"tags\":\"$:/tags/CommentToolbarButton\",\"text\":\"<$reveal state=\\\"$:/status/IsReadOnly\\\" type=\\\"match\\\" text=\\\"no\\\" default=\\\"no\\\" tag=\\\"span\\\">\\n<$reveal type=\\\"nomatch\\\" state=\\\"!!edit-mode\\\" text=\\\"yes\\\">\\n<$button>\\n<$action-setfield $tiddler=<<currentTiddler>> $field=\\\"edit-mode\\\" $value=\\\"yes\\\"/>\\n<$action-setfield $tiddler=<<currentTiddler>> $field=\\\"saved-text\\\" $value={{!!text}}/>\\nedit\\n</$button>\\n</$reveal>\\n</$reveal>\\n\"},\"$:/plugins/tiddlywiki/comments/toolbar-button-save\":{\"title\":\"$:/plugins/tiddlywiki/comments/toolbar-button-save\",\"tags\":\"$:/tags/CommentToolbarButton\",\"text\":\"<$reveal state=\\\"$:/status/IsReadOnly\\\" type=\\\"match\\\" text=\\\"no\\\" default=\\\"no\\\" tag=\\\"span\\\">\\n<$reveal type=\\\"match\\\" state=\\\"!!edit-mode\\\" text=\\\"yes\\\">\\n<$button>\\n<$action-setfield $tiddler=<<currentTiddler>> $field=\\\"edit-mode\\\" $value=\\\"no\\\"/>\\nsave\\n</$button>\\n</$reveal>\\n</$reveal>\\n\"}}}"});