title: $:/plugins/tiddlywiki/dynannotate/examples/combined tags: $:/tags/dynannotateExamples caption: Combined \define click-annotation-actions() <$action-setfield $tiddler="$:/temp/dynannotate/demo/annotation-title" $value=<>/> \end \define create-annotation-actions() <$action-createtiddler $basetitle="$:/plugins/tiddlywiki/dynannotate/demo-annotation" $savetitle={{{ [addprefix[$:/state/dynannotate/temp-save-title/]] }}} annotate-tiddler=<> annotate-text=<> annotate-prefix=<> annotate-suffix=<> annotate-colour=<> /> <$set name="popup-coords" value={{{ [addprefix[$:/state/dynannotate/popup-selection/]get[text]] }}}> <$action-deletetiddler $tiddler={{{ [addprefix[$:/state/dynannotate/popup-selection/]] }}}/> <$action-setfield $tiddler="$:/temp/dynannotate/demo/annotation-title" $value={{{ [addprefix[$:/state/dynannotate/temp-save-title/]get[text]] }}}/> <$action-popup $state={{{ [addprefix[$:/state/dynannotate/popup-annotation/]] }}} $coords=<>/> \end
This example combines many of the features of the dynannotate plugin: * using annotation tiddlers to store the details of each annotation * triggering actions when the annotations are clicked * attaching a popup to the annotations * tracking the selection with another popup See the [[source|$:/plugins/tiddlywiki/dynannotate/examples/combined]] for details
Search: <$edit-text tiddler="$:/temp/search" tag="input"/> <$list filter="[all[tiddlers+shadows]tag[DynannotateDemo]sort[title]]" variable="chunk">
<$dynannotate filter="[all[shadows+tiddlers]!has[draft.of]annotate-tiddler]" actions=<> popup={{{ [addprefix[$:/state/dynannotate/popup-annotation/]] }}} selection={{{ [addprefix[$:/state/dynannotate/selection/]] }}} selectionPrefix={{{ [addprefix[$:/state/dynannotate/selection-prefix/]] }}} selectionSuffix={{{ [addprefix[$:/state/dynannotate/selection-suffix/]] }}} selectionPopup={{{ [addprefix[$:/state/dynannotate/popup-selection/]] }}} search={{$:/temp/search}} searchClass="tc-dynannotation-search-overlay-blurred" searchMinLength={{$:/config/Search/MinLength}} > <$transclude tiddler=<> mode="block"/> <$reveal type="popup" state={{{ [addprefix[$:/state/dynannotate/popup-annotation/]] }}} position="belowright" animate="yes" retain="yes" style="overflow-y:hidden;">
<$tiddler tiddler={{$:/temp/dynannotate/demo/annotation-title}}>

This is an annotation

The annotation is stored in the tiddler:

<$link><$view field="title"/>

The annotated text is ''<$view field="annotate-text"/>''.

Annotation Colour: <$macrocall $name='colour-picker' actions=""" <$action-setfield $field="annotate-colour" $value=<>/> """/>

<$reveal type="popup" state={{{ [addprefix[$:/state/dynannotate/popup-selection/]] }}} position="belowright" animate="yes" retain="yes" style="overflow-y:hidden;">
<$vars text={{{ [addprefix[$:/state/dynannotate/selection/]get[text]] }}} prefix={{{ [addprefix[$:/state/dynannotate/selection-prefix/]get[text]] }}} suffix={{{ [addprefix[$:/state/dynannotate/selection-suffix/]get[text]] }}} colour={{{ [addprefix[$:/state/dynannotate/annotation-colour/]get[text]] }}} > <$button actions=<>> Create annotation

Text: <$text text=<>/>

Prefix: <$text text=<>/>

Suffix: <$text text=<>/>