diff --git a/plugins/tiddlywiki/comments/above-story.tid b/plugins/tiddlywiki/comments/above-story.tid new file mode 100644 index 000000000..5042faf1d --- /dev/null +++ b/plugins/tiddlywiki/comments/above-story.tid @@ -0,0 +1,8 @@ +title: $:/plugins/tiddlywiki/comments/above-story +tags: $:/tags/AboveStory + +<$reveal state="$:/config/Comments/EnableWikiComments" type="match" text="yes" default="no"> +<$tiddler tiddler="$:/SiteTitle"> +<$transclude tiddler="$:/plugins/tiddlywiki/comments/comments-template" mode="inline"/> + + diff --git a/plugins/tiddlywiki/comments/add-comment-button.tid b/plugins/tiddlywiki/comments/add-comment-button.tid index 49110c5ec..3ee8938a4 100644 --- a/plugins/tiddlywiki/comments/add-comment-button.tid +++ b/plugins/tiddlywiki/comments/add-comment-button.tid @@ -1,10 +1,7 @@ title: $:/plugins/tiddlywiki/comments/add-comment-button <$reveal state="$:/status/IsReadOnly" type="match" text="no" default="no" tag="div" class="tc-comment-button"> -<$button class="tc-btn-invisible"> -<$set name="username" value={{$:/status/UserName}} emptyValue="(anonymous)"> -<$action-createtiddler $basetitle={{{ [[Comment by ']addsuffixaddsuffix[' on ']addsuffixaddsuffix[']] }}} comment-target=<> text="" edit-mode="yes"/> - +<$button class="tc-btn-invisible" actions={{$:/plugins/tiddlywiki/comments/add-comment-button}}> add comment {{$:/core/images/add-comment}} diff --git a/plugins/tiddlywiki/comments/comments-template.tid b/plugins/tiddlywiki/comments/comments-template.tid index 485e1d3c9..95b9ae797 100644 --- a/plugins/tiddlywiki/comments/comments-template.tid +++ b/plugins/tiddlywiki/comments/comments-template.tid @@ -7,30 +7,9 @@ title: $:/plugins/tiddlywiki/comments/comments-template
<$link>{{!!creator}} at <$view field="modified" format="date" template="0hh:0mm:0ss DDD DDth MMM YYYY"/> -<$reveal state="$:/status/IsReadOnly" type="match" text="no" default="no" tag="span"> -<$reveal type="match" state="!!edit-mode" text="yes"> -<$button> -<$action-setfield $tiddler=<> $field="edit-mode" $value="no"/> -<$action-setfield $tiddler=<> $field="text" $value={{!!saved-text}}/> -cancel - -<$button> -<$action-deletetiddler $tiddler=<>/> -delete - -<$button> -<$action-setfield $tiddler=<> $field="edit-mode" $value="no"/> -save - - -<$reveal type="nomatch" state="!!edit-mode" text="yes"> -<$button> -<$action-setfield $tiddler=<> $field="edit-mode" $value="yes"/> -<$action-setfield $tiddler=<> $field="saved-text" $value={{!!text}}/> -edit - - - +<$list filter="[all[shadows+tiddlers]tag[$:/tags/CommentToolbarButton]!has[draft.of]]" variable="listItem"> +<$transclude tiddler=<> mode="inline"/> +
<$reveal type="match" state="!!edit-mode" text="yes"> diff --git a/plugins/tiddlywiki/comments/config.tid b/plugins/tiddlywiki/comments/config.tid index 5a58c659d..c3edf70fe 100644 --- a/plugins/tiddlywiki/comments/config.tid +++ b/plugins/tiddlywiki/comments/config.tid @@ -7,6 +7,12 @@ $description$ \end +! Wiki Comments + +<$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 + +! Tiddler Comments + This filter expression determines which tiddlers will have commenting enabled: <$edit-text tiddler="$:/config/Comments/EnableFilter" tag="input"/> diff --git a/plugins/tiddlywiki/comments/filter-all-comments.tid b/plugins/tiddlywiki/comments/filter-all-comments.tid new file mode 100644 index 000000000..c024caba8 --- /dev/null +++ b/plugins/tiddlywiki/comments/filter-all-comments.tid @@ -0,0 +1,5 @@ +title: $:/plugins/tiddlywiki/comments/filter-all-comments +tags: $:/tags/Filter +filter: [has[comment-target]!sort[modified]] +description: All comments + diff --git a/plugins/tiddlywiki/comments/readme.tid b/plugins/tiddlywiki/comments/readme.tid index cbf5c7256..70d8b7172 100644 --- a/plugins/tiddlywiki/comments/readme.tid +++ b/plugins/tiddlywiki/comments/readme.tid @@ -8,3 +8,4 @@ This plugin provides a simple means for adding threaded comments to tiddlers. * Comments are attributed to the username stored in the system tiddler [[$:/status/UserName]] * 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 * The buttons for adding and editing comments are only available if the system tiddler [[$:/status/IsReadOnly]] is not set to `yes` +* Use the "All comments" option in the $:/AdvancedSearch ''Filter'' tab to see or export all comments diff --git a/plugins/tiddlywiki/comments/sidebar-segment.tid b/plugins/tiddlywiki/comments/sidebar-segment.tid new file mode 100644 index 000000000..5b1ba02be --- /dev/null +++ b/plugins/tiddlywiki/comments/sidebar-segment.tid @@ -0,0 +1,9 @@ +title: $:/plugins/tiddlywiki/comments/sidebar-segment +tags: $:/tags/SideBarSegment +list-after: $:/core/ui/SideBarSegments/site-subtitle + +<$reveal state="$:/config/Comments/EnableWikiComments" type="match" text="yes" default="no"> +<$tiddler tiddler="$:/SiteTitle"> +<$transclude tiddler="$:/plugins/tiddlywiki/comments/add-comment-button" mode="inline"/> + + diff --git a/plugins/tiddlywiki/comments/styles.tid b/plugins/tiddlywiki/comments/styles.tid index d8d9a9c1c..86ae9c9a6 100644 --- a/plugins/tiddlywiki/comments/styles.tid +++ b/plugins/tiddlywiki/comments/styles.tid @@ -17,6 +17,11 @@ tags: [[$:/tags/Stylesheet]] text-align: right; } +.tc-sidebar-scrollable .tc-comment-button button { + width: auto; + text-align: right; +} + .tc-comment-button button svg { fill: #26cb56; height: 2em; diff --git a/plugins/tiddlywiki/comments/tagsCommentToolbarButton.tid b/plugins/tiddlywiki/comments/tagsCommentToolbarButton.tid new file mode 100644 index 000000000..8b210af1a --- /dev/null +++ b/plugins/tiddlywiki/comments/tagsCommentToolbarButton.tid @@ -0,0 +1,2 @@ +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]] \ No newline at end of file diff --git a/plugins/tiddlywiki/comments/toolbar-button-cancel.tid b/plugins/tiddlywiki/comments/toolbar-button-cancel.tid new file mode 100644 index 000000000..1da7ea3ea --- /dev/null +++ b/plugins/tiddlywiki/comments/toolbar-button-cancel.tid @@ -0,0 +1,12 @@ +title: $:/plugins/tiddlywiki/comments/toolbar-button-cancel +tags: $:/tags/CommentToolbarButton + +<$reveal state="$:/status/IsReadOnly" type="match" text="no" default="no" tag="span"> +<$reveal type="match" state="!!edit-mode" text="yes"> +<$button> +<$action-setfield $tiddler=<> $field="edit-mode" $value="no"/> +<$action-setfield $tiddler=<> $field="text" $value={{!!saved-text}}/> +cancel + + + diff --git a/plugins/tiddlywiki/comments/toolbar-button-delete.tid b/plugins/tiddlywiki/comments/toolbar-button-delete.tid new file mode 100644 index 000000000..b0b2c1402 --- /dev/null +++ b/plugins/tiddlywiki/comments/toolbar-button-delete.tid @@ -0,0 +1,11 @@ +title: $:/plugins/tiddlywiki/comments/toolbar-button-delete +tags: $:/tags/CommentToolbarButton + +<$reveal state="$:/status/IsReadOnly" type="match" text="no" default="no" tag="span"> +<$reveal type="match" state="!!edit-mode" text="yes"> +<$button> +<$action-deletetiddler $tiddler=<>/> +delete + + + diff --git a/plugins/tiddlywiki/comments/toolbar-button-edit.tid b/plugins/tiddlywiki/comments/toolbar-button-edit.tid new file mode 100644 index 000000000..bc4af4bfa --- /dev/null +++ b/plugins/tiddlywiki/comments/toolbar-button-edit.tid @@ -0,0 +1,12 @@ +title: $:/plugins/tiddlywiki/comments/toolbar-button-edit +tags: $:/tags/CommentToolbarButton + +<$reveal state="$:/status/IsReadOnly" type="match" text="no" default="no" tag="span"> +<$reveal type="nomatch" state="!!edit-mode" text="yes"> +<$button> +<$action-setfield $tiddler=<> $field="edit-mode" $value="yes"/> +<$action-setfield $tiddler=<> $field="saved-text" $value={{!!text}}/> +edit + + + diff --git a/plugins/tiddlywiki/comments/toolbar-button-save.tid b/plugins/tiddlywiki/comments/toolbar-button-save.tid new file mode 100644 index 000000000..5672a4b15 --- /dev/null +++ b/plugins/tiddlywiki/comments/toolbar-button-save.tid @@ -0,0 +1,11 @@ +title: $:/plugins/tiddlywiki/comments/toolbar-button-save +tags: $:/tags/CommentToolbarButton + +<$reveal state="$:/status/IsReadOnly" type="match" text="no" default="no" tag="span"> +<$reveal type="match" state="!!edit-mode" text="yes"> +<$button> +<$action-setfield $tiddler=<> $field="edit-mode" $value="no"/> +save + + +