├── LICENSE.meta ├── README.meta ├── tiddlers ├── configs │ ├── setcloseall.tid │ ├── setfishingdeck.tid │ ├── cascade │ │ ├── captioncascade.tid │ │ ├── learningcascade.tid │ │ └── filter │ │ │ ├── captionfilter.tid │ │ │ ├── learningfilter.tid │ │ │ └── titlefilter.tid │ ├── pluginlibrary.tid │ ├── fieldsvisibility.multids │ ├── shortcuts.multids │ ├── shortcutinfo.multids │ └── fishingpond.multids ├── settings │ ├── controlpanelsettings.tid │ ├── tiddlywikisettings.tid │ └── fishingsettings.tid └── shortcuts │ └── fold.tid ├── icons ├── cloze.tid └── select.tid ├── macros ├── fsrs.js.meta ├── questions │ ├── cloze.tid │ └── select.tid └── fsrs.js ├── filters ├── due.js.meta ├── interval.js.meta ├── sortrandom.js.meta ├── sortrandom.js ├── due.js └── interval.js ├── widgets ├── action-learn.js.meta ├── action-exportdata.js.meta ├── action-learn.js └── action-exportdata.js ├── README ├── ui ├── viewtemplate │ ├── subtitle │ │ ├── review.tid │ │ └── due.tid │ ├── title.tid │ ├── caption.tid │ ├── fold.tid │ └── button.tid ├── learning.tid ├── edittemplate │ ├── editor.tid │ └── editorbody.tid └── setting.tid ├── plugin.info ├── data.tid ├── fishingdeck.tid ├── buttons ├── editortoolbar │ ├── cloze.tid │ └── select.tid ├── fishingrod │ ├── customisefilter.tid │ ├── addfilter.tid │ ├── unaddfilter.tid │ ├── exportdata.tid │ ├── popup │ │ ├── commonfilter.tid │ │ └── customisefilter.tid │ ├── commonfilter.tid │ └── viewfilter.tid └── fishinghook │ ├── discard.tid │ ├── forget.tid │ ├── learnquestion.tid │ ├── grasp.tid │ ├── remember.tid │ ├── learnexcerpt.tid │ └── learn.tid ├── fishingrod.tid ├── LICENSE ├── styles.tid ├── fishingfloat.tid ├── fishingpond.tid ├── languages └── en-GB.multids └── icon.tid /LICENSE.meta: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/license 2 | type: text/plain -------------------------------------------------------------------------------- /README.meta: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/readme 2 | type: text/vnd.tiddlywiki 3 | -------------------------------------------------------------------------------- /tiddlers/configs/setcloseall.tid: -------------------------------------------------------------------------------- 1 | title: $:/config/Fishing/setcloseall 2 | 3 | no -------------------------------------------------------------------------------- /tiddlers/configs/setfishingdeck.tid: -------------------------------------------------------------------------------- 1 | title: $:/config/Fishing/setfishingdeck 2 | 3 | popup -------------------------------------------------------------------------------- /icons/cloze.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/icons/cloze 2 | tags: $:/tags/Image 3 | 4 | ''] :cascade[all[shadows+tiddlers]tag[$:/tags/FishingFilter/caption]!is[draft]get[text]] +[!is[blank]] -------------------------------------------------------------------------------- /tiddlers/configs/cascade/learningcascade.tid: -------------------------------------------------------------------------------- 1 | title: $:/config/FishingCascade/learning 2 | 3 | [] :cascade[all[shadows+tiddlers]tag[$:/tags/FishingFilter/learning]!is[draft]get[text]] +[!is[blank]] -------------------------------------------------------------------------------- /tiddlers/configs/cascade/filter/captionfilter.tid: -------------------------------------------------------------------------------- 1 | title: $:/config/FishingFilter/caption 2 | tags: $:/tags/FishingFilter/caption 3 | 4 | [list[$:/temp/fishing]match] 5 | [subfilter{$:/config/fishingpond/rod}match] -------------------------------------------------------------------------------- /tiddlers/configs/pluginlibrary.tid: -------------------------------------------------------------------------------- 1 | caption: {{$:/language/fishing/pluginlibrary}} 2 | tags: $:/tags/PluginLibrary 3 | title: $:/config/TiddlyMemoPluginLibrary 4 | url: https://tiddlymemo.org/library/ 5 | 6 | {{$:/language/fishing/pluginlibrarytip}} -------------------------------------------------------------------------------- /tiddlers/configs/cascade/filter/learningfilter.tid: -------------------------------------------------------------------------------- 1 | title: $:/config/FishingFilter/learning 2 | tags: $:/tags/FishingFilter/learning 3 | 4 | [list[$:/temp/fishing]match] 5 | [subfilter{$:/config/fishingpond/duepond}match] -------------------------------------------------------------------------------- /tiddlers/configs/fieldsvisibility.multids: -------------------------------------------------------------------------------- 1 | title: $:/config/EditTemplateFields/Visibility/ 2 | 3 | due: hide 4 | interval: hide 5 | grade: hide 6 | difficulty: hide 7 | stability: hide 8 | retrievability: hide 9 | lapses: hide 10 | reps: hide 11 | review: hide 12 | history: hide 13 | caption: hide -------------------------------------------------------------------------------- /ui/viewtemplate/subtitle/review.tid: -------------------------------------------------------------------------------- 1 | tags: $:/tags/ViewTemplate/Subtitle 2 | title: $:/plugins/oflg/fishing/ui/ViewTemplate/subtitle/review 3 | code-body: yes 4 | 5 | <$list 6 | filter="[has[review]]" 7 | > 8 | {{$:/language/fishing/review}}: <$view field="review" format="relativedate"/> 9 | -------------------------------------------------------------------------------- /ui/viewtemplate/title.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/ui/ViewTemplate/title 2 | code-body: yes 3 | 4 | \whitespace trim 5 | 6 |

7 | <$button 8 | class="tc-btn-invisible" 9 | tooltip=<> 10 | > 11 | {{$:/core/images/blank}} 12 | 13 |

-------------------------------------------------------------------------------- /tiddlers/configs/shortcuts.multids: -------------------------------------------------------------------------------- 1 | title: $:/config/shortcuts/ 2 | 3 | fishing-fold: ctrl-Enter 4 | fishing-learn: ctrl-L 5 | fishing-learnquestion: ctrl-Q 6 | fishing-learnexcerpt: ctrl-E 7 | fishing-forget: ctrl-0 8 | fishing-remember: ctrl-1 9 | fishing-grasp: ctrl-2 10 | fishing-discard: ctrl-D 11 | fishing-cloze: alt-shift-C 12 | fishing-select: alt-shift-S -------------------------------------------------------------------------------- /tiddlers/configs/cascade/filter/titlefilter.tid: -------------------------------------------------------------------------------- 1 | title: $:/config/ViewTemplateTitleFilters/fishing/title 2 | tags: $:/tags/ViewTemplateTitleFilter 3 | list-before: $:/config/ViewTemplateTitleFilters/system 4 | 5 | [] :cascade[all[shadows+tiddlers]tag[$:/tags/FishingFilter/caption]!is[draft]get[text]] +[!is[blank]then[$:/plugins/oflg/fishing/ui/ViewTemplate/title]] -------------------------------------------------------------------------------- /plugin.info: -------------------------------------------------------------------------------- 1 | { 2 | "author": "oflg", 3 | "core-version": ">=5.2.3", 4 | "description": "Integrate Spaced Repetition System into TiddlyWiki", 5 | "list": "readme license", 6 | "name": "Fishing", 7 | "plugin-type": "plugin", 8 | "source": "https://github.com/oflg/fishing", 9 | "title": "$:/plugins/oflg/fishing", 10 | "version": "2.5.0" 11 | } 12 | -------------------------------------------------------------------------------- /ui/viewtemplate/subtitle/due.tid: -------------------------------------------------------------------------------- 1 | tags: $:/tags/ViewTemplate/Subtitle 2 | title: $:/plugins/oflg/fishing/ui/ViewTemplate/subtitle/due 3 | list-after: $:/plugins/oflg/fishing/ui/ViewTemplate/subtitle/review 4 | code-body: yes 5 | 6 | <$list 7 | filter="[has[due]]" 8 | > 9 | {{$:/language/fishing/due}}: <$view field="due" format="relativedate"/> 10 | -------------------------------------------------------------------------------- /data.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/data 2 | type: application/json 3 | 4 | { 5 | "requestRetention": 0.9, 6 | "difficultyDecay" : -0.7, 7 | "stabilityDecay" : -0.2, 8 | "increaseFactor" : 60, 9 | "totalCase": 0, 10 | "totalDiff": 0, 11 | "totalReview": 0, 12 | "defaultDifficulty": 5, 13 | "defaultStability": 2, 14 | "stabilityDataArry": [] 15 | } 16 | -------------------------------------------------------------------------------- /fishingdeck.tid: -------------------------------------------------------------------------------- 1 | icon: $:/plugins/oflg/fishing/icon 2 | title: $:/FishingDeck 3 | caption: {{$:/language/fishing/fishingtip}} 4 | 5 | \whitespace trim 6 | 7 |
11 | 12 | {{$:/plugins/oflg/fishing/fishingpond}} 13 | 14 | {{$:/plugins/oflg/fishing/fishingrod}} 15 |
16 | -------------------------------------------------------------------------------- /tiddlers/settings/controlpanelsettings.tid: -------------------------------------------------------------------------------- 1 | caption: {{$:/language/ControlPanel/Settings/Caption}} 2 | tags: $:/tags/ControlPanel 3 | title: $:/core/ui/ControlPanel/Settings 4 | 5 |
6 | <$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/SettingsTab]!is[draft]]" default="$:/core/ui/ControlPanel/Settings/TiddlyWiki" explicitState="$:/state/tab--697582678"/> 7 |
8 | -------------------------------------------------------------------------------- /tiddlers/shortcuts/fold.tid: -------------------------------------------------------------------------------- 1 | key: ((fishing-fold)) 2 | tags: $:/tags/KeyboardShortcut 3 | title: $:/core/ui/KeyboardShortcuts/fishing-fold 4 | 5 | <$list 6 | filter="[list[$:/temp/fishing]first[]!is[blank]]" 7 | > 8 | <$action-setfield 9 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 10 | text={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]get[text]match[hide]then[show]else[hide]] }}} 11 | /> 12 | -------------------------------------------------------------------------------- /buttons/editortoolbar/cloze.tid: -------------------------------------------------------------------------------- 1 | caption: {{$:/language/fishing/cloze}} 2 | condition: [tag[?]] 3 | description: {{$:/language/fishing/clozetip}} 4 | icon: $:/plugins/oflg/fishing/icons/cloze 5 | shortcuts: ((fishing-cloze)) 6 | tags: $:/tags/EditorToolbar 7 | title: $:/plugins/oflg/fishing/buttons/editortoolbar/cloze 8 | 9 | <$action-sendmessage 10 | $message="tm-edit-text-operation" 11 | $param="wrap-selection" 12 | prefix="<>" 14 | /> -------------------------------------------------------------------------------- /tiddlers/settings/tiddlywikisettings.tid: -------------------------------------------------------------------------------- 1 | caption: TiddlyWiki 2 | tags: $:/tags/ControlPanel/SettingsTab 3 | title: $:/core/ui/ControlPanel/Settings/TiddlyWiki 4 | 5 | \define lingo-base() $:/language/ControlPanel/Settings/ 6 | 7 | <> 8 | 9 | <$list filter="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings]]"> 10 | 11 |
12 | 13 | !! <$link><$transclude field="caption"/> 14 | 15 | <$transclude/> 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /tiddlers/settings/fishingsettings.tid: -------------------------------------------------------------------------------- 1 | title: $:/core/ui/ControlPanel/Settings/Fishing 2 | caption: {{$:/language/fishing/fishing}} 3 | list-after: $:/core/ui/ControlPanel/Settings/TiddlyWiki 4 | tags: $:/tags/ControlPanel/SettingsTab 5 | 6 | {{$:/language/fishing/settings}}
7 | 8 | <$list filter="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings/Fishing]]"> 9 | 10 |
11 | 12 | !! <$transclude field="caption"/> 13 | 14 | <$transclude/> 15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /buttons/editortoolbar/select.tid: -------------------------------------------------------------------------------- 1 | caption: {{$:/language/fishing/select}} 2 | condition: [tag[?]] 3 | description: {{$:/language/fishing/selecttip}} 4 | icon: $:/plugins/oflg/fishing/icons/select 5 | list-after: $:/plugins/oflg/fishing/buttons/editortoolbar/cloze 6 | shortcuts: ((fishing-select)) 7 | tags: $:/tags/EditorToolbar 8 | title: $:/plugins/oflg/fishing/buttons/editortoolbar/select 9 | 10 | <$action-sendmessage 11 | $message="tm-edit-text-operation" 12 | $param="wrap-selection" 13 | prefix='<>' 17 | /> -------------------------------------------------------------------------------- /tiddlers/configs/shortcutinfo.multids: -------------------------------------------------------------------------------- 1 | title: $:/config/ShortcutInfo/ 2 | 3 | fishing-fold: {{$:/language/fishing/fold}} 4 | fishing-learn: {{$:/language/fishing/learn}} 5 | fishing-learnquestion: {{$:/language/fishing/learnquestion}} 6 | fishing-learnexcerpt: {{$:/language/fishing/learnexcerpt}} 7 | fishing-forget: {{$:/language/fishing/forget}} 8 | fishing-remember: {{$:/language/fishing/remember}} 9 | fishing-grasp: {{$:/language/fishing/grasp}} 10 | fishing-discard: {{$:/language/fishing/discard}} 11 | fishing-cloze: {{$:/language/fishing/cloze}} 12 | fishing-select: {{$:/language/fishing/select}} -------------------------------------------------------------------------------- /filters/sortrandom.js: -------------------------------------------------------------------------------- 1 | /*\ 2 | Filter operator for return a random title in the list. 3 | \*/ 4 | (function () { 5 | 6 | /*jslint node: true, browser: true */ 7 | /*global $tw: false */ 8 | "use strict"; 9 | 10 | /* 11 | Export our filter function 12 | */ 13 | exports.sortrandom = function (source, operator, options) { 14 | var results = []; 15 | 16 | source(function (tiddler, title) { 17 | results.push(title); 18 | }); 19 | 20 | results = results.sort(function () { 21 | return Math.random() - 0.5; 22 | }); 23 | 24 | return results; 25 | }; 26 | 27 | })(); -------------------------------------------------------------------------------- /buttons/fishingrod/customisefilter.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/buttons/fishingrod/customisefilter 2 | tags: $:/tags/FishingGrod 3 | list-after: $:/plugins/oflg/fishing/buttons/fishingrod/commonfilter 4 | popup: $:/plugins/oflg/fishing/buttons/fishingrod/popup/customisefilter 5 | icon: $:/core/images/options-button 6 | description: {{{ [{$:/language/fishing/customisefiltertip}addsuffix[ : ]addsuffix{$:/temp/fishing!!fishingrod}] }}} 7 | condition: [all[tiddlers+shadows]removeprefix[$:/plugins/oflg/fishing/fishingrod/]match{$:/temp/fishing!!fishingrod}] 8 | button-classes: fishingrod-button 9 | 10 | <$action-setfield 11 | $tiddler="$:/temp/fishing" 12 | text="" 13 | list="" 14 | /> -------------------------------------------------------------------------------- /buttons/fishingrod/addfilter.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/buttons/fishingrod/addfilter 2 | tags: $:/tags/FishingGrod 3 | list-after: $:/plugins/oflg/fishing/buttons/fishingrod/commonfilter 4 | icon: $:/core/images/plus-button 5 | description: {{{ [{$:/language/fishing/addfiltertip}addsuffix[ : ]addsuffix{$:/temp/fishing!!fishingrod}] }}} 6 | condition: [{$:/temp/fishing!!fishingrod}!is[blank]] -[all[tiddlers+shadows]removeprefix[$:/plugins/oflg/fishing/fishingrod/]match{$:/temp/fishing!!fishingrod}] 7 | button-classes: fishingrod-button 8 | 9 | <$action-setfield 10 | $tiddler={{{ [{$:/temp/fishing!!fishingrod}addprefix[$:/plugins/oflg/fishing/fishingrod/]] }}} 11 | type="application/json" 12 | /> -------------------------------------------------------------------------------- /buttons/fishingrod/unaddfilter.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/buttons/fishingrod/unaddfilter 2 | tags: $:/tags/FishingGrod 3 | list-after: $:/plugins/oflg/fishing/buttons/fishingrod/commonfilter 4 | icon: $:/core/images/cancel-button 5 | description: {{{ [{$:/language/fishing/unaddfiltertip}addsuffix[ : ]addsuffix{$:/temp/fishing!!fishingrod}] }}} 6 | condition: [all[tiddlers+shadows]removeprefix[$:/plugins/oflg/fishing/fishingrod/]match{$:/temp/fishing!!fishingrod}] 7 | button-classes: fishingrod-button 8 | 9 | 10 | <$action-deletetiddler 11 | $tiddler={{{ [{$:/temp/fishing!!fishingrod}addprefix[$:/plugins/oflg/fishing/fishingrod/]] }}} 12 | /> 13 | <$action-deletetiddler 14 | $tiddler="$:/temp/fishing" 15 | /> -------------------------------------------------------------------------------- /filters/due.js: -------------------------------------------------------------------------------- 1 | /*\ 2 | Calculate the due of tiddler 3 | \*/ 4 | (function () { 5 | 6 | /*jslint node: true, browser: true */ 7 | /*global $tw: false */ 8 | "use strict"; 9 | 10 | /* 11 | Export our filter function 12 | */ 13 | exports.due = function (source, operator, options) { 14 | var results = []; 15 | source(function (tiddler, title) { 16 | var addDay = Number(title) >= 1 ? Number(title) : 1; 17 | 18 | var dateTime = addDay * 86400000 + new Date().getTime(); 19 | var due = new Date(dateTime).toISOString().replace(/-|T|:|\.|Z/g, ""); 20 | 21 | results.push(due); 22 | }); 23 | return results; 24 | }; 25 | 26 | })(); -------------------------------------------------------------------------------- /fishingrod.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/fishingrod 2 | 3 |
6 | <$edit-text 7 | tiddler="$:/temp/fishing" 8 | field="fishingrod" 9 | tag="input" 10 | focus="true" 11 | placeholder="[tag[?]]" 12 | inputActions='<$action-setfield $tiddler="$:/temp/fishing" list=""/>' 13 | /> 14 |
15 |
18 | <$list 19 | filter="[all[shadows+tiddlers]tag[$:/tags/FishingGrod]!is[draft]]" 20 | > 21 | <$transclude 22 | tiddler="$:/plugins/oflg/fishing/ui/ViewTemplate/button" 23 | mode="inline" 24 | /> 25 | 26 |
-------------------------------------------------------------------------------- /ui/viewtemplate/caption.tid: -------------------------------------------------------------------------------- 1 | tags: $:/tags/ViewTemplate 2 | title: $:/plugins/oflg/fishing/ui/ViewTemplate/caption 3 | list-after: $:/core/ui/ViewTemplate/title 4 | code-body: yes 5 | 6 | \whitespace trim 7 | 8 | <$list 9 | filter={{$:/config/FishingCascade/caption}} 10 | > 11 | <$reveal 12 | default={{{ [get[caption]trim[]] }}} 13 | type="match" 14 | text="" 15 | > 16 | <$text 17 | text=<> 18 | /> 19 | 20 | <$reveal 21 | default={{{ [get[caption]trim[]] }}} 22 | type="nomatch" 23 | text="" 24 | > 25 | 26 | <$transclude field="caption"/> 27 | 28 | 29 |

30 | 31 | -------------------------------------------------------------------------------- /tiddlers/configs/fishingpond.multids: -------------------------------------------------------------------------------- 1 | title: $:/config/fishingpond/ 2 | 3 | rod: [tag[?]] 4 | newpond: [!has[due]] -[tag[!]] 5 | duepond: [has[due]] -[has[due]!days:due[1]] -[sameday:review] -[tag[!]] 6 | unduepond: [has[due]!days:due[1]] -[sameday:review] -[tag[!]] 7 | autoorder: [!sortsub:number{$:/config/fishingpond/autopriority}] 8 | dueorder: [sort[due]] 9 | undueorder: [!sort[due]] 10 | createdorder: [sort[created]] 11 | uncreatedorder: [!sort[created]] 12 | modifiedorder: [sort[modified]] 13 | unmodifiedorder: [!sort[modified]] 14 | azorder: [sortan[]] 15 | zaorder: [!sortan[]] 16 | randomorder: [sortrandom[]] 17 | autopriority: [{!!due}interval[]] =[{!!priority}else[0]] =[tags[]![?]![.]count[]] =[tagging[]subfilter{$:/config/fishingpond/unduepond}count[]negate[]] =[tagging[]subfilter{$:/config/fishingpond/duepond}count[]] +[sum[]] -------------------------------------------------------------------------------- /filters/interval.js: -------------------------------------------------------------------------------- 1 | /*\ 2 | Calculate the interval of tiddler 3 | \*/ 4 | (function () { 5 | 6 | /*jslint node: true, browser: true */ 7 | /*global $tw: false */ 8 | "use strict"; 9 | 10 | /* 11 | Export our filter function 12 | */ 13 | exports.interval = function (source, operator, options) { 14 | var results = []; 15 | source(function (tiddler, title) { 16 | var twTime = title; 17 | 18 | var twTimeDay = $tw.wiki.filterTiddlers("[[" + twTime + "]format:date[YYYY-0MM-0DD]]")[0], 19 | nowDay = new Date().toISOString().split("T")[0]; 20 | 21 | var diffTime = new Date(nowDay) - new Date(twTimeDay); 22 | 23 | var diffDay = diffTime / 86400000 || 0; 24 | 25 | var interval = String(diffDay > 0 ? diffDay : 0); 26 | 27 | results.push(interval); 28 | }); 29 | return results; 30 | }; 31 | 32 | })(); 33 | -------------------------------------------------------------------------------- /buttons/fishingrod/exportdata.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/buttons/fishingrod/exportdata 2 | tags: $:/tags/FishingGrod 3 | icon: $:/core/images/export-button 4 | description: {{$:/language/fishing/exportdatatip}} 5 | condition: [[all]] 6 | button-classes: fishingrod-button 7 | 8 | \define tv-action-refresh-policy() always 9 | 10 | <$action-exportdata 11 | $tiddler="$:/temp/fishing/fsrsdata" 12 | /> 13 | <$action-sendmessage 14 | $message="tm-download-file" 15 | $param="$:/core/templates/exporters/TidFile" 16 | exportFilter="[[$:/temp/fishing/fsrsdata]]" 17 | filename={{{ [addprefix[.]addprefix{$:/status/UserName}addsuffix[.txt]] }}} 18 | /> 19 | <$action-deletetiddler 20 | $tiddler="$:/temp/fishing/fsrsdata" 21 | /> 22 | <$action-sendmessage 23 | $message="tm-open-external-window" 24 | $param="https://github.com/open-spaced-repetition/fsrs.js/issues/new?assignees=&labels=data&template=upload-fsrs-algorithm-data-template.md&title=Upload+data" 25 | /> -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-2022 oflg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /macros/questions/cloze.tid: -------------------------------------------------------------------------------- 1 | tags: $:/tags/Macro 2 | title: $:/plugins/oflg/fishing/macros/questions/cloze 3 | code-body: yes 4 | 5 | \whitespace trim 6 | 7 | \define ?c(hide,show:"...",id:"default") 8 | <$reveal 9 | state=<> 10 | type="nomatch" 11 | text="show" 12 | animate="yes" 13 | > 14 | <$button 15 | class="tc-btn-invisible" 16 | > 17 | <$action-setfield 18 | $tiddler="$:/temp/fishing" 19 | $index=<<__id__>> 20 | $value={{{ [[$:/temp/fishing]getindex<__id__>match[show]then[]else[show]] }}} 21 | /> 22 | <$reveal 23 | default={{{ [[$:/temp/fishing]getindex<__id__>] }}} 24 | type="match" 25 | text="show" 26 | animate="yes" 27 | > 28 | __$hide$__ 29 | 30 | <$reveal 31 | default={{{ [[$:/temp/fishing]getindex<__id__>] }}} 32 | type="nomatch" 33 | text="show" 34 | animate="yes" 35 | > 36 | `[$show$]` 37 | 38 | 39 | 40 | <$reveal 41 | state=<> 42 | type="match" 43 | text="show" 44 | animate="yes" 45 | > 46 | __$hide$__ 47 | 48 | \end -------------------------------------------------------------------------------- /styles.tid: -------------------------------------------------------------------------------- 1 | tags: $:/tags/Stylesheet 2 | title: $:/plugins/oflg/fishing/styles.css 3 | 4 | \rules only filteredtranscludeinline transcludeinline macrodef macrocallinline 5 | 6 | .fishingrod-button { 7 | margin:0!important; 8 | padding:0 5px!important; 9 | width:auto!important; 10 | } 11 | 12 | .dropdown-more { 13 | padding:3px 20px!important; 14 | } 15 | 16 | .tc-fishing-learning { 17 | display:flex; 18 | justify-content:space-between; 19 | align-items:center; 20 | user-select:none; 21 | } 22 | 23 | .tc-fishing-learning-count{ 24 | color:grey; 25 | } 26 | 27 | .tc-fishing-learning-grade .discard{ 28 | color:black; 29 | margin-left:20px; 30 | } 31 | 32 | .tc-fishing-learning-grade .learn{ 33 | color:green; 34 | margin-left:20px; 35 | } 36 | 37 | .tc-fishing-learning-grade .forget{ 38 | color:red; 39 | margin-left:20px; 40 | } 41 | 42 | .tc-fishing-learning-grade .remember{ 43 | color:green; 44 | margin-left:20px; 45 | } 46 | 47 | .tc-fishing-learning-grade .grasp{ 48 | color:blue; 49 | margin-left:20px; 50 | } 51 | 52 | .tc-fishing-learning-grade .more{ 53 | padding-left:20px; 54 | } 55 | 56 | blockquote.tc-fish-quote { 57 | border-left: 1px solid <>; 58 | margin-right: 0; 59 | margin-left: 5px; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /ui/learning.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/ui/ViewTemplate/learning 2 | tags: $:/tags/ViewTemplate 3 | list-after: $:/core/ui/ViewTemplate/body 4 | code-body: yes 5 | 6 | \whitespace trim 7 | 8 | <$list 9 | filter={{$:/config/FishingCascade/learning}} 10 | variable="targetTiddler" 11 | > 12 | <$reveal 13 | state=<> 14 | type="nomatch" 15 | text="hide" 16 | animate="yes" 17 | > 18 |
21 | 22 |
25 | <$count filter="[subfilter{$:/temp/fishing!!fishingrod}subfilter{$:/temp/fishing!!fishingpond}]"/> 26 |
27 | 28 |
31 | <$list 32 | filter="[all[shadows+tiddlers]tag[$:/tags/FishingHook]!is[draft]]" 33 | > 34 | <$transclude 35 | tiddler="$:/plugins/oflg/fishing/ui/ViewTemplate/button" 36 | mode="inline" 37 | /> 38 | 39 |
40 |
41 | 42 | -------------------------------------------------------------------------------- /fishingfloat.tid: -------------------------------------------------------------------------------- 1 | caption: {{$:/plugins/oflg/fishing/icon}} {{$:/language/fishing/fishing}} 2 | description: {{$:/language/fishing/fishingtip}} 3 | tags: $:/tags/PageControls 4 | title: $:/plugins/oflg/fishing/fishingfloat 5 | 6 | \whitespace trim 7 | \define lingo-base() $:/language/fishing/fishingfloat/ 8 | <$button 9 | popup={{{ [{$:/config/Fishing/setfishingdeck}match[navigation]else] }}} 10 | tooltip={{$:/language/fishing/fishingtip}} 11 | aria-label={{$:/language/fishing/fishingtip}} 12 | class=<> 13 | selectedClass="tc-selected" 14 | > 15 | <$list filter="[match[yes]]"> 16 | {{$:/plugins/oflg/fishing/icon}} 17 | 18 | <$list filter="[match[yes]]"> 19 | 20 | {{$:/language/fishing/fishingtip}} 21 | 22 | 23 | <$list filter="[{$:/config/Fishing/setfishingdeck}match[navigation]]"> 24 | <$action-navigate 25 | $to="$:/FishingDeck" 26 | /> 27 | 28 | 29 | <$reveal 30 | state=<> 31 | type="popup" 32 | position="below" 33 | animate="yes" 34 | positionAllowNegative="yes" 35 | > 36 |
40 | 41 | {{$:/plugins/oflg/fishing/fishingpond}} 42 | 43 | {{$:/plugins/oflg/fishing/fishingrod}} 44 |
45 | -------------------------------------------------------------------------------- /ui/edittemplate/editor.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/ui/EditTemplate/body/editor 2 | code-body: yes 3 | 4 | \whitespace trim 5 | 6 | <$edit 7 | field="caption" 8 | tag="textarea" 9 | minHeight={{$:/themes/tiddlywiki/vanilla/metrics/lineheight}} 10 | class="tc-edit-texteditor tc-edit-texteditor-body" 11 | placeholder={{$:/language/fishing/captionplaceholder}} 12 | tabindex={{$:/config/EditTabIndex}} 13 | focus={{{ [{$:/config/AutoFocus}match[text]then[true]] ~[[false]] }}} 14 | cancelPopups="yes" 15 | fileDrop={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} 16 | > 17 | <$set 18 | name="targetTiddler" 19 | value=<> 20 | > 21 | <$list 22 | filter="[all[shadows+tiddlers]tag[$:/tags/EditorToolbar]!has[draft.of]]" 23 | > 24 | <$reveal 25 | type="nomatch" 26 | state=<> 27 | text="hide" 28 | class="tc-text-editor-toolbar-item-wrapper" 29 | > 30 | <$transclude tiddler="$:/core/ui/EditTemplate/body/toolbar/button" mode="inline"/> 31 | 32 | 33 | <$list 34 | filter="[all[shadows+tiddlers]tag[$:/tags/EditorTools]!has[draft.of]]" 35 | > 36 | <$list 37 | filter={{!!condition}} 38 | variable="list-condition" 39 | > 40 | <$transclude/> 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /buttons/fishingrod/popup/commonfilter.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/buttons/fishingrod/popup/commonfilter 2 | 3 |
6 | <$list 7 | filter="[all[tiddlers+shadows]removeprefix[$:/plugins/oflg/fishing/fishingrod/]sort[title]]" 8 | variable="fishingrod" 9 | > 10 | <$button 11 | tooltip={{{ [{$:/language/fishing/fillfiltertip}addsuffix[ : ]addsuffix] }}} 12 | aria-label={{{ [{$:/language/fishing/fillfiltertip}addsuffix[ : ]addsuffix] }}} 13 | class="tc-btn-invisible" 14 | > 15 | <$action-setfield 16 | $tiddler="$:/temp/fishing" 17 | fishingrod=<> 18 | /> 19 | <$action-deletetiddler 20 | $filter="[prefix[$:/state/FishingButtonPopup]]" 21 | /> 22 | <$list filter="[addprefix[$:/plugins/oflg/fishing/fishingrod/]]"> 23 | <$reveal 24 | default={{{ [get[caption]] }}} 25 | type="match" 26 | text="" 27 | > 28 | <$text 29 | text=<> 30 | /> 31 | 32 | <$reveal 33 | default={{{ [get[caption]] }}} 34 | type="nomatch" 35 | text="" 36 | > 37 | <> 38 | 39 | 40 | 41 | 42 |
-------------------------------------------------------------------------------- /buttons/fishingrod/commonfilter.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/buttons/fishingrod/commonfilter 2 | tags: $:/tags/FishingGrod 3 | list-before: 4 | popup: $:/plugins/oflg/fishing/buttons/fishingrod/popup/commonfilter 5 | icon: $:/core/images/down-arrow 6 | description: {{$:/language/fishing/commonfiltertip}} 7 | condition: [all[tiddlers+shadows]removeprefix[$:/plugins/oflg/fishing/fishingrod/]first[]] 8 | button-classes: fishingrod-button 9 | 10 | <$reveal 11 | state=<> 12 | type="popup" 13 | position="below" 14 | animate="yes" 15 | > 16 |
20 | <$list 21 | filter="[all[tiddlers+shadows]removeprefix[$:/plugins/oflg/fishing/fishingrod/]sort[title]]" 22 | variable="fishingrod" 23 | > 24 | <$button 25 | tooltip={{{ [{$:/language/fishing/fillfiltertip}addsuffix[ : ]addsuffix] }}} 26 | aria-label={{{ [{$:/language/fishing/fillfiltertip}addsuffix[ : ]addsuffix<$:/temp/fishing!!fishingrod>] }}} 27 | popup=<> 28 | class="tc-btn-invisible" 29 | > 30 | <$action-setfield 31 | $tiddler="$:/temp/fishing" 32 | fishingrod=<> 33 | /> 34 | <$text 35 | text={{{ [addprefix[$:/plugins/oflg/fishing/fishingrod/]get[caption]] ~[] }}} 36 | /> 37 | 38 | 39 |
40 | -------------------------------------------------------------------------------- /buttons/fishingrod/viewfilter.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/buttons/fishingrod/viewfilter 2 | tags: $:/tags/FishingGrod 3 | list-after: 4 | icon: $:/core/images/advanced-search-button 5 | description: {{{ [{$:/language/fishing/viewfiltertip}addsuffix[ : ]addsuffix{$:/temp/fishing!!fishingrod}] }}} 6 | condition: [all[tiddlers+shadows]removeprefix[$:/plugins/oflg/fishing/fishingrod/]match{$:/temp/fishing!!fishingrod}] 7 | button-classes: fishingrod-button 8 | 9 | <$action-setfield 10 | $tiddler="$:/temp/fishing" 11 | text="" 12 | list="" 13 | /> 14 | <$action-setfield 15 | $tiddler="$:/temp/advancedsearch" 16 | text="[{$:/temp/fishing!!fishingrod}addprefix[$:/plugins/oflg/fishing/fishingrod/]] [{$:/temp/fishing!!fishingrod}addprefix[$:/plugins/oflg/fishing/fishingrod/]shadowsource[]] [subfilter{$:/temp/fishing!!fishingrod}is[tiddler]] [{$:/temp/fishing!!fishingrod}addprefix[$:/plugins/oflg/fishing/fishingrod/]shadowsource[]plugintiddlers[]is[tiddler]]" 17 | /> 18 | <$action-setfield 19 | $tiddler="$:/temp/advancedsearch/input" 20 | text="[{$:/temp/fishing!!fishingrod}addprefix[$:/plugins/oflg/fishing/fishingrod/]] [{$:/temp/fishing!!fishingrod}addprefix[$:/plugins/oflg/fishing/fishingrod/]shadowsource[]] [subfilter{$:/temp/fishing!!fishingrod}is[tiddler]] [{$:/temp/fishing!!fishingrod}addprefix[$:/plugins/oflg/fishing/fishingrod/]shadowsource[]plugintiddlers[]is[tiddler]]" 21 | /> 22 | <$action-setfield 23 | $tiddler="$:/temp/advancedsearch/refresh" 24 | text="yes" 25 | /> 26 | <$action-setfield 27 | $tiddler="$:/state/tab--1498284803" 28 | text="$:/core/ui/AdvancedSearch/Filter" 29 | /> 30 | <$action-navigate 31 | $to="$:/AdvancedSearch" 32 | /> 33 | <$action-sendmessage 34 | $message="tm-focus-selector" 35 | $param=".tc-advanced-search input" 36 | /> -------------------------------------------------------------------------------- /buttons/fishingrod/popup/customisefilter.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/buttons/fishingrod/popup/customisefilter 2 | 3 |
6 | {{$:/language/fishing/setalias}} 7 |
10 | <$edit-text tiddler={{{ [{$:/temp/fishing!!fishingrod}addprefix[$:/plugins/oflg/fishing/fishingrod/]] }}} field="caption" placeholder={{$:/language/fishing/typealias}} tag="input"/> 11 |
12 | {{$:/language/fishing/setorder}} 13 | <$list 14 | filter="new due" 15 | variable="pondname" 16 | > 17 |
20 | <$text text={{{ [[$:/language/fishing/]addsuffixget[text]] }}}/> 21 | <$select 22 | tiddler={{{ [{$:/temp/fishing!!fishingrod}addprefix[$:/plugins/oflg/fishing/fishingrod/]] }}} 23 | index={{{ [addsuffix[order]] }}} 24 | default={{{ [match[new]then{$:/config/fishingpond/createdorder}] ~[match[due]then{$:/config/fishingpond/autoorder}] }}} 25 | > 26 | <$list 27 | filter="[all[tiddlers+shadows]removeprefix[$:/config/fishingpond/]suffix[order]]" 28 | variable="pondorder" 29 | > 30 | 35 | 36 | 37 |
38 | 39 |
-------------------------------------------------------------------------------- /buttons/fishinghook/discard.tid: -------------------------------------------------------------------------------- 1 | key: ((fishing-discard)) 2 | tags: $:/tags/FishingHook $:/tags/KeyboardShortcut 3 | title: $:/plugins/oflg/fishing/buttons/fishinghook/discard 4 | button-classes: discard tc-tiddlylink 5 | list-after: 6 | caption: {{$:/language/fishing/discard}} 7 | description: {{$:/language/fishing/discardtip}} 8 | condition: [] 9 | 10 | <$list 11 | filter="[!is[blank]] ~[list[$:/temp/fishing]first[]!is[blank]]" 12 | > 13 | <$navigator 14 | story="$:/StoryList" 15 | history="$:/HistoryList" 16 | relinkOnRename="yes" 17 | > 18 | <$fieldmangler> 19 | <$action-sendmessage 20 | $message="tm-add-tag" 21 | $param="!" 22 | /> 23 | <$list 24 | filter="[list[$:/temp/fishing]match]" 25 | variable="ignore" 26 | > 27 | <$action-deletetiddler 28 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 29 | /> 30 | <$action-setfield 31 | $tiddler="$:/temp/fishing" 32 | text="" 33 | type="" 34 | list={{{ [subfilter{$:/temp/fishing!!fishingrod}subfilter{$:/temp/fishing!!fishingpond}subfilter{$:/temp/fishing!!fishingorder}first[]format:titlelist[]] }}} 35 | /> 36 | <$action-setfield 37 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 38 | text={{{ [list[$:/temp/fishing]first[]has[grade]then[hide]else[show]] }}} 39 | /> 40 | <$action-sendmessage 41 | $message="tm-close-tiddler" 42 | /> 43 | <$action-navigate 44 | $to={{{ [list[$:/temp/fishing]first[]] }}} 45 | /> 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /buttons/fishinghook/forget.tid: -------------------------------------------------------------------------------- 1 | key: ((fishing-forget)) 2 | tags: $:/tags/FishingHook $:/tags/KeyboardShortcut 3 | title: $:/plugins/oflg/fishing/buttons/fishinghook/forget 4 | button-classes: forget tc-tiddlylink 5 | caption: {{$:/language/fishing/forget}} 6 | description: {{$:/language/fishing/forgettip}} 7 | condition: [has[grade]] 8 | 9 | <$list 10 | filter="[!is[blank]] ~[list[$:/temp/fishing]first[]!is[blank]has[grade]]" 11 | > 12 | <$navigator 13 | story="$:/StoryList" 14 | history="$:/HistoryList" 15 | relinkOnRename="yes" 16 | > 17 | <$fieldmangler> 18 | <$action-sendmessage 19 | $message="tm-add-tag" 20 | $param="?" 21 | /> 22 | <$action-learn 23 | $grade="0" 24 | /> 25 | <$list 26 | filter="[list[$:/temp/fishing]match]" 27 | variable="ignore" 28 | > 29 | <$action-deletetiddler 30 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 31 | /> 32 | <$action-setfield 33 | $tiddler="$:/temp/fishing" 34 | text="" 35 | type="" 36 | list={{{ [subfilter{$:/temp/fishing!!fishingrod}subfilter{$:/temp/fishing!!fishingpond}subfilter{$:/temp/fishing!!fishingorder}first[]format:titlelist[]] }}} 37 | /> 38 | <$action-setfield 39 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 40 | text={{{ [list[$:/temp/fishing]first[]has[grade]then[hide]else[show]] }}} 41 | /> 42 | <$action-sendmessage 43 | $message="tm-close-tiddler" 44 | /> 45 | <$action-navigate 46 | $to={{{ [list[$:/temp/fishing]first[]] }}} 47 | /> 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /buttons/fishinghook/learnquestion.tid: -------------------------------------------------------------------------------- 1 | key: ((fishing-learnquestion)) 2 | tags: $:/tags/FishingHook $:/tags/KeyboardShortcut 3 | title: $:/plugins/oflg/fishing/buttons/fishinghook/learnquestion 4 | button-classes: learn tc-tiddlylink 5 | list-before: 6 | caption: {{$:/language/fishing/learnquestion}} 7 | description: {{$:/language/fishing/learnquestiontip}} 8 | condition: [!tag[.]!tag[?]] 9 | 10 | <$list 11 | filter="[!is[blank]] ~[list[$:/temp/fishing]first[]!is[blank]!has[grade]]" 12 | > 13 | <$navigator 14 | story="$:/StoryList" 15 | history="$:/HistoryList" 16 | relinkOnRename="yes" 17 | > 18 | <$fieldmangler> 19 | <$action-sendmessage 20 | $message="tm-add-tag" 21 | $param="?" 22 | /> 23 | <$action-learn 24 | $grade="-1" 25 | /> 26 | <$list 27 | filter="[list[$:/temp/fishing]match]" 28 | variable="ignore" 29 | > 30 | <$action-deletetiddler 31 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 32 | /> 33 | <$action-setfield 34 | $tiddler="$:/temp/fishing" 35 | text="" 36 | type="" 37 | list={{{ [subfilter{$:/temp/fishing!!fishingrod}subfilter{$:/temp/fishing!!fishingpond}subfilter{$:/temp/fishing!!fishingorder}first[]format:titlelist[]] }}} 38 | /> 39 | <$action-setfield 40 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 41 | text={{{ [list[$:/temp/fishing]first[]has[grade]then[hide]else[show]] }}} 42 | /> 43 | <$action-sendmessage 44 | $message="tm-close-tiddler" 45 | /> 46 | <$action-navigate 47 | $to={{{ [list[$:/temp/fishing]first[]] }}} 48 | /> 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /buttons/fishinghook/grasp.tid: -------------------------------------------------------------------------------- 1 | key: ((fishing-grasp)) 2 | tags: $:/tags/FishingHook $:/tags/KeyboardShortcut 3 | title: $:/plugins/oflg/fishing/buttons/fishinghook/grasp 4 | button-classes: grasp tc-tiddlylink 5 | list-after: $:/plugins/oflg/fishing/buttons/fishinghook/remember 6 | caption: {{$:/language/fishing/grasp}} 7 | description: {{$:/language/fishing/grasptip}} 8 | condition: [has[grade]] 9 | 10 | <$list 11 | filter="[!is[blank]] ~[list[$:/temp/fishing]first[]!is[blank]has[grade]]" 12 | > 13 | <$navigator 14 | story="$:/StoryList" 15 | history="$:/HistoryList" 16 | relinkOnRename="yes" 17 | > 18 | <$fieldmangler> 19 | <$action-sendmessage 20 | $message="tm-add-tag" 21 | $param="?" 22 | /> 23 | <$action-learn 24 | $grade="2" 25 | /> 26 | <$list 27 | filter="[list[$:/temp/fishing]match]" 28 | variable="ignore" 29 | > 30 | <$action-deletetiddler 31 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 32 | /> 33 | <$action-setfield 34 | $tiddler="$:/temp/fishing" 35 | text="" 36 | type="" 37 | list={{{ [subfilter{$:/temp/fishing!!fishingrod}subfilter{$:/temp/fishing!!fishingpond}subfilter{$:/temp/fishing!!fishingorder}first[]format:titlelist[]] }}} 38 | /> 39 | <$action-setfield 40 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 41 | text={{{ [list[$:/temp/fishing]first[]has[grade]then[hide]else[show]] }}} 42 | /> 43 | <$action-sendmessage 44 | $message="tm-close-tiddler" 45 | /> 46 | <$action-navigate 47 | $to={{{ [list[$:/temp/fishing]first[]] }}} 48 | /> 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /buttons/fishinghook/remember.tid: -------------------------------------------------------------------------------- 1 | key: ((fishing-remember)) 2 | tags: $:/tags/FishingHook $:/tags/KeyboardShortcut 3 | title: $:/plugins/oflg/fishing/buttons/fishinghook/remember 4 | button-classes: remember tc-tiddlylink 5 | list-after: $:/plugins/oflg/fishing/buttons/fishinghook/forget 6 | caption: {{$:/language/fishing/remember}} 7 | description: {{$:/language/fishing/remembertip}} 8 | condition: [has[grade]] 9 | 10 | <$list 11 | filter="[!is[blank]] ~[list[$:/temp/fishing]first[]!is[blank]has[grade]]" 12 | > 13 | <$navigator 14 | story="$:/StoryList" 15 | history="$:/HistoryList" 16 | relinkOnRename="yes" 17 | > 18 | <$fieldmangler> 19 | <$action-sendmessage 20 | $message="tm-add-tag" 21 | $param="?" 22 | /> 23 | <$action-learn 24 | $grade="1" 25 | /> 26 | <$list 27 | filter="[list[$:/temp/fishing]match]" 28 | variable="ignore" 29 | > 30 | <$action-deletetiddler 31 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 32 | /> 33 | <$action-setfield 34 | $tiddler="$:/temp/fishing" 35 | text="" 36 | type="" 37 | list={{{ [subfilter{$:/temp/fishing!!fishingrod}subfilter{$:/temp/fishing!!fishingpond}subfilter{$:/temp/fishing!!fishingorder}first[]format:titlelist[]] }}} 38 | /> 39 | <$action-setfield 40 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 41 | text={{{ [list[$:/temp/fishing]first[]has[grade]then[hide]else[show]] }}} 42 | /> 43 | <$action-sendmessage 44 | $message="tm-close-tiddler" 45 | /> 46 | <$action-navigate 47 | $to={{{ [list[$:/temp/fishing]first[]] }}} 48 | /> 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /fishingpond.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/fishingpond 2 | 3 | <$list 4 | filter="new due" 5 | variable="pondname" 6 | > 7 | <$let 8 | pondordername={{{ [addsuffix[order]] }}} 9 | fishingrod={{{ [{$:/temp/fishing!!fishingrod}!is[blank]else{$:/config/fishingpond/rod}] }}} 10 | fishingpond={{{ [match[new]then{$:/config/fishingpond/newpond}] ~[match[due]then{$:/config/fishingpond/duepond}] }}} 11 | fishingorder={{{ [addprefix[$:/plugins/oflg/fishing/fishingrod/]getindex] ~[match[new]then{$:/config/fishingpond/createdorder}] ~[match[due]then{$:/config/fishingpond/autoorder}] }}} 12 | > 13 | <$button 14 | tooltip={{$:/language/fishing/fishingpondtip}} 15 | aria-label={{$:/language/fishing/fishingpondtip}} 16 | class="tc-btn-invisible tc-tiddlylink" 17 | style="padding-right:10px;" 18 | > 19 | <$list filter="[{$:/config/Fishing/setcloseall}match[yes]]"> 20 | <$action-sendmessage 21 | $message="tm-close-all-tiddlers" 22 | /> 23 | 24 | <$action-setfield 25 | $tiddler="$:/temp/fishing" 26 | text="" 27 | type="" 28 | fishingrod=<> 29 | fishingpond=<> 30 | fishingorder=<> 31 | list={{{ [subfiltersubfiltersubfilterfirst[]format:titlelist[]] }}} 32 | /> 33 | <$action-setfield 34 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 35 | text={{{ [list[$:/temp/fishing]first[]has[grade]then[hide]else[show]] }}} 36 | /> 37 | <$action-navigate 38 | $to={{{ [list[$:/temp/fishing]first[]] }}} 39 | /> 40 | <$action-popup 41 | $state=<> 42 | $coords="" 43 | /> 44 | <$text text={{{ [[$:/language/fishing/]addsuffixget[text]] }}}/>: <$count filter="[subfiltersubfilter]"/> 45 | 46 | 47 | -------------------------------------------------------------------------------- /ui/setting.tid: -------------------------------------------------------------------------------- 1 | caption: {{$:/language/fishing/globalsettings}} 2 | tags: $:/tags/ControlPanel/Settings/Fishing 3 | title: $:/plugins/oflg/fishing/ui/ControlPanel/Settings/Fishing/fishing 4 | 5 | \define setretention() 6 | {{$:/plugins/oflg/fishing/data##requestRetention}} 7 | <$range 8 | tiddler="$:/plugins/oflg/fishing/data" 9 | index="requestRetention" 10 | min="0.7" 11 | max="0.95" 12 | default="0.9" 13 | increment=".01" 14 | /> 15 | @@color:red;font-size:10px;{{$:/language/fishing/setretentiontip}}@@ 16 | \end 17 | 18 | \define setfishingdeck() 19 | <$select 20 | tiddler="$:/config/Fishing/setfishingdeck" 21 | default="popup" 22 | > 23 | 26 | 29 | 30 | \end 31 | 32 | \define setfishingdeck() 33 | <$select 34 | tiddler="$:/config/Fishing/setfishingdeck" 35 | default="popup" 36 | > 37 | 40 | 43 | 44 | \end 45 | 46 | \define setcloseall() 47 | <$select 48 | tiddler="$:/config/Fishing/setcloseall" 49 | default="no" 50 | > 51 | 54 | 57 | 58 | \end 59 | 60 | !!!{{$:/language/fishing/setbehavior}} 61 | 62 | |<$link to="$:/config/Fishing/setfishingdeck">{{$:/language/fishing/setfishingdeck}}
@@color:grey;font-size:10px;{{$:/language/fishing/setfishingdecktip}}@@ |<> | 63 | |<$link to="$:/config/Fishing/setcloseall">{{$:/language/Buttons/CloseAll/Hint}}
@@color:grey;font-size:10px;{{$:/language/fishing/setclosealltip}}@@ |<> | 64 | 65 | 66 | !!!{{$:/language/fishing/setparameter}} 67 | 68 | |{{$:/language/fishing/setretention}} |<> | 69 | 70 | !!!{{$:/language/ControlPanel/Cascades/Caption}} 71 | 72 | {{$:/language/fishing/settitletip}} 73 | {{$:/tags/FishingFilter/caption||$:/snippets/ListTaggedCascade}} 74 | 75 | {{$:/language/fishing/setlearntip}} 76 | {{$:/tags/FishingFilter/learning||$:/snippets/ListTaggedCascade}} -------------------------------------------------------------------------------- /ui/viewtemplate/fold.tid: -------------------------------------------------------------------------------- 1 | tags: $:/tags/ViewTemplate 2 | title: $:/plugins/oflg/fishing/ui/ViewTemplate/fold 3 | list-after: $:/core/ui/ViewTemplate/unfold 4 | code-body: yes 5 | 6 | <$list 7 | filter="[{!!title}] :cascade[all[shadows+tiddlers]tag[$:/tags/FishingFilter/learning]!is[draft]get[text]] +[!is[blank]limit[1]]" 8 | variable="ignore" 9 | > 10 | <$reveal 11 | state="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-bar" 12 | type="nomatch" 13 | text="show" 14 | animate="yes" 15 | > 16 | <$reveal 17 | tag="div" 18 | type="nomatch" 19 | stateTitle=<> 20 | text="hide" 21 | default="show" 22 | retain="yes" 23 | animate="yes" 24 | > 25 | <$button 26 | tooltip={{$:/language/Buttons/Fold/Hint}} 27 | aria-label={{$:/language/Buttons/Fold/Caption}} 28 | class="tc-fold-banner" 29 | > 30 | <$action-sendmessage 31 | $message="tm-fold-tiddler" 32 | $param=<> 33 | foldedState=<> 34 | /> 35 | {{$:/core/images/chevron-up}} 36 | 37 | 38 | <$reveal 39 | tag="div" 40 | type="nomatch" 41 | stateTitle=<> 42 | text="show" 43 | default="show" 44 | retain="yes" 45 | animate="yes" 46 | > 47 | <$button 48 | tooltip={{$:/language/Buttons/Unfold/Hint}} 49 | aria-label={{$:/language/Buttons/Unfold/Caption}} 50 | class="tc-unfold-banner" 51 | > 52 | <$action-sendmessage 53 | $message="tm-fold-tiddler" 54 | $param=<> 55 | foldedState=<> 56 | /> 57 | {{$:/core/images/chevron-down}} 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /buttons/fishinghook/learnexcerpt.tid: -------------------------------------------------------------------------------- 1 | key: ((fishing-learnexcerpt)) 2 | tags: $:/tags/FishingHook $:/tags/KeyboardShortcut 3 | title: $:/plugins/oflg/fishing/buttons/fishinghook/learnexcerpt 4 | button-classes: learn tc-tiddlylink 5 | list-before: 6 | caption: {{$:/language/fishing/learnexcerpt}} 7 | description: {{$:/language/fishing/learnexcerpttip}} 8 | condition: [!tag[.]!tag[?]] 9 | 10 | <$list 11 | filter="[!is[blank]] ~[list[$:/temp/fishing]first[]!is[blank]!has[grade]]" 12 | > 13 | <$navigator 14 | story="$:/StoryList" 15 | history="$:/HistoryList" 16 | relinkOnRename="yes" 17 | > 18 | <$fieldmangler> 19 | <$action-sendmessage 20 | $message="tm-add-tag" 21 | $param="?" 22 | /> 23 | <$action-sendmessage 24 | $message="tm-add-tag" 25 | $param="." 26 | /> 27 | <$action-setfield 28 | interval={{{ [get[interval]!is[blank]else[0]add[1]] }}} 29 | due={{{ [get[interval]!is[blank]else[0]add[1]due[]] }}} 30 | review=<> 31 | /> 32 | <$list 33 | filter="[list[$:/temp/fishing]match]" 34 | variable="ignore" 35 | > 36 | <$action-deletetiddler 37 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 38 | /> 39 | <$action-setfield 40 | $tiddler="$:/temp/fishing" 41 | text="" 42 | type="" 43 | list={{{ [subfilter{$:/temp/fishing!!fishingrod}subfilter{$:/temp/fishing!!fishingpond}subfilter{$:/temp/fishing!!fishingorder}first[]format:titlelist[]] }}} 44 | /> 45 | <$action-setfield 46 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 47 | text={{{ [list[$:/temp/fishing]first[]has[grade]then[hide]else[show]] }}} 48 | /> 49 | <$action-sendmessage 50 | $message="tm-close-tiddler" 51 | /> 52 | <$action-navigate 53 | $to={{{ [list[$:/temp/fishing]first[]] }}} 54 | /> 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ui/edittemplate/editorbody.tid: -------------------------------------------------------------------------------- 1 | list-after: $:/core/ui/EditTemplate/title 2 | tags: $:/tags/EditTemplate 3 | title: $:/plugins/oflg/fishing/ui/EditTemplate/body 4 | code-body: yes 5 | 6 | \define config-visibility-title() 7 | $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$ 8 | \end 9 | 10 | \define importFileActions() 11 | <$action-popup $state=<> $coords="(0,0,0,0)" $floating="yes"/> 12 | \end 13 | 14 | \whitespace trim 15 | 16 | <$list 17 | filter={{$:/config/FishingCascade/caption}} 18 | > 19 | <$let 20 | edit-preview-state={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[] }}} 21 | importTitle=<> 22 | importState=<> 23 | myTiddler=<> 24 | > 25 | <$dropzone 26 | importTitle=<> 27 | autoOpenOnImport="no" 28 | contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} 29 | class="tc-dropzone-editor" 30 | enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} 31 | filesOnly="yes" 32 | actions=<> 33 | > 34 | <$reveal 35 | stateTitle=<> 36 | type="match" 37 | text="yes" 38 | tag="div" 39 | > 40 |
43 | <$transclude tiddler="$:/plugins/oflg/fishing/ui/EditTemplate/body/editor" mode="inline"/> 44 |
49 | <$transclude tiddler=<> field="caption"/> 50 |
51 | 52 |
53 | 54 | <$reveal 55 | stateTitle=<> 56 | type="nomatch" 57 | text="yes" 58 | tag="div" 59 | > 60 | <$transclude tiddler="$:/plugins/oflg/fishing/ui/EditTemplate/body/editor" mode="inline"/> 61 | 62 | 63 | 64 | 68 | -------------------------------------------------------------------------------- /languages/en-GB.multids: -------------------------------------------------------------------------------- 1 | title: $:/language/fishing/ 2 | 3 | fishing: Fishing 4 | fishingtip: Incremental Learning 5 | fold: Unfold or fold this tiddler 6 | learn: Learn 7 | learntip: Learn this tiddler 8 | learnquestion: Learn as Question Tiddler 9 | learnquestiontip: Learn this tiddler and set it as Question Tiddler 10 | learnexcerpt: Learn as Excerpt Tiddler 11 | learnexcerpttip: Learn this tiddler and set it as Excerpt Tiddler 12 | review: Review 13 | reps: Reps 14 | lapses: Lapses 15 | forget: Forget 16 | forgettip: Forget the answer 17 | remember: Remember 18 | remembertip: Remember the answer 19 | grasp: Grasp 20 | grasptip: Grasp the question 21 | discard: Discard 22 | discardtip: No more learning this tiddler 23 | fishingpondtip: Start 24 | new: Learn new 25 | due: Review due 26 | undue: Review Undue 27 | cloze: Cloze Question 28 | clozetip: Set the selected text as cloze of Cloze Question(see manual for usage) 29 | select: Select Question 30 | selecttip: Set the selected text as options of Select Question(see manual for usage) 31 | commonfiltertip: Commonly used Filter 32 | addfiltertip: Add to commonly used Filter 33 | unaddfiltertip: Unadd this Filter 34 | fillfiltertip: Fill in this Filter 35 | customisefiltertip: Customise the behaviour of this Filter 36 | setalias: Alias 37 | typealias: Type alias 38 | setorder: Learning order 39 | autoorder: Auto priority 40 | dueorder: Due date first-last 41 | undueorder: Due date last-first 42 | modifiedorder: modified date first-last 43 | unmodifiedorder: modified date last-first 44 | createdorder: Created date first-last 45 | uncreatedorder: Created date last-first 46 | azorder: Title A-Z 47 | zaorder: Title Z-A 48 | randomorder: Random 49 | viewfiltertip: Export or delete tiddlers related to this Filter 50 | exportdatatip: Export learning data and upload it to open source platform to improve FSRS algorithm 51 | settings: These settings let you customise the behaviour of Fishing. 52 | globalsettings: Global 53 | setbehavior: Behavior 54 | setfishingdeck: Fishing Deck 55 | setfishingdecktip: Behaviour of Fishing Deck when Fishing Float is clicked 56 | setclosealltip: Behaviour of close all tiddlers when Learning Groups is clicked 57 | popup: Popup 58 | navigation: Navigation 59 | setparameter: Parameter 60 | setretention: Retention 61 | setretentiontip: Default 0.9 and must be between 0.7 and 0.95 62 | settitletip: Condition for showing caption of a tiddler. 63 | setlearntip: Condition for showing learning of a tiddler. 64 | pluginlibrary: TiddlyMemo Plugin Library 65 | pluginlibrarytip: This plugin library can be used to install and update plugins related to TiddlyMemo. 66 | captionplaceholder: Type the caption for this tiddler -------------------------------------------------------------------------------- /icon.tid: -------------------------------------------------------------------------------- 1 | tags: $:/tags/Image 2 | title: $:/plugins/oflg/fishing/icon 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /widgets/action-learn.js: -------------------------------------------------------------------------------- 1 | /*\ 2 | Action widget to set fishing fields on tiddlers. 3 | \*/ 4 | (function () { 5 | 6 | /*jslint node: true, browser: true */ 7 | /*global $tw: false */ 8 | "use strict"; 9 | 10 | var Widget = require("$:/core/modules/widgets/widget.js").widget; 11 | 12 | var LearnWidget = function (parseTreeNode, options) { 13 | this.initialise(parseTreeNode, options); 14 | }; 15 | 16 | /* 17 | Inherit from the base widget class 18 | */ 19 | LearnWidget.prototype = new Widget(); 20 | 21 | /* 22 | Render this widget into the DOM 23 | */ 24 | LearnWidget.prototype.render = function (parent, nextSibling) { 25 | this.computeAttributes(); 26 | this.execute(); 27 | }; 28 | 29 | /* 30 | Compute the internal state of the widget 31 | */ 32 | LearnWidget.prototype.execute = function () { 33 | this.actionTiddler = this.getAttribute("$tiddler", this.getVariable("currentTiddler")); 34 | this.actionGrade = this.getAttribute("$grade"); 35 | this.actionTimestamp = this.getAttribute("$timestamp", "yes") === "yes"; 36 | }; 37 | 38 | /* 39 | Refresh the widget by ensuring our attributes are up to date 40 | */ 41 | LearnWidget.prototype.refresh = function (changedTiddlers) { 42 | var changedAttributes = this.computeAttributes(); 43 | if (changedAttributes["$tiddler"] || changedAttributes["$grade"] || changedAttributes["$timestamp"]) { 44 | this.refreshSelf(); 45 | return true; 46 | } 47 | return this.refreshChildren(changedTiddlers); 48 | }; 49 | 50 | /* 51 | Invoke the action associated with this widget 52 | */ 53 | LearnWidget.prototype.invokeAction = function (triggeringWidget, event) { 54 | var title = this.actionTiddler, 55 | grade = this.actionGrade; 56 | 57 | var data = $tw.macros.fsrs.run(title, grade);//Use Free Spaced Repetition Scheduler in $:/plugins/oflg/fishing/macros/fsrs.js 58 | 59 | var creationFields = this.actionTimestamp ? $tw.wiki.getCreationFields() : undefined, 60 | modificationFields = this.actionTimestamp ? $tw.wiki.getModificationFields() : undefined; 61 | 62 | $tw.wiki.addTiddler( 63 | new $tw.Tiddler(creationFields, $tw.wiki.getTiddler(title), modificationFields, data.tiddlerData) 64 | ); 65 | 66 | $tw.wiki.addTiddler( 67 | new $tw.Tiddler(creationFields, $tw.wiki.getTiddler("$:/plugins/oflg/fishing/data"), modificationFields, { 68 | text: JSON.stringify(data.globalData) 69 | }) 70 | ); 71 | 72 | return true;// Action was invoked 73 | }; 74 | 75 | exports["action-learn"] = LearnWidget; 76 | })(); -------------------------------------------------------------------------------- /buttons/fishinghook/learn.tid: -------------------------------------------------------------------------------- 1 | key: ((fishing-learn)) 2 | tags: $:/tags/FishingHook $:/tags/KeyboardShortcut 3 | title: $:/plugins/oflg/fishing/buttons/fishinghook/learn 4 | button-classes: learn tc-tiddlylink 5 | list-before: 6 | caption: {{$:/language/fishing/learn}} 7 | description: {{$:/language/fishing/learntip}} 8 | condition: [tag[?]!tag[.]!has[review]] [tag[.]] [tag[?]has[review]!has[grade]] 9 | 10 | 11 | <$list 12 | filter="[!is[blank]] ~[list[$:/temp/fishing]first[]!is[blank]!has[grade]]" 13 | > 14 | <$navigator 15 | story="$:/StoryList" 16 | history="$:/HistoryList" 17 | relinkOnRename="yes" 18 | > 19 | <$fieldmangler> 20 | <$action-sendmessage 21 | $message="tm-add-tag" 22 | $param="?" 23 | /> 24 | <$list 25 | filter="[tag[?]!tag[.]!has[review]]" 26 | variable="ignore" 27 | > 28 | <$action-learn 29 | $grade="-1" 30 | /> 31 | 32 | <$list 33 | filter="[tag[.]] [tag[?]has[review]!has[grade]]" 34 | variable="ignore" 35 | > 36 | <$action-sendmessage 37 | $message="tm-add-tag" 38 | $param="." 39 | /> 40 | <$action-setfield 41 | interval={{{ [get[interval]!is[blank]else[0]add[1]] }}} 42 | due={{{ [get[interval]!is[blank]else[0]add[1]due[]] }}} 43 | review=<> 44 | /> 45 | 46 | <$list 47 | filter="[list[$:/temp/fishing]match]" 48 | variable="ignore" 49 | > 50 | <$action-deletetiddler 51 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 52 | /> 53 | <$action-setfield 54 | $tiddler="$:/temp/fishing" 55 | text="" 56 | type="" 57 | list={{{ [subfilter{$:/temp/fishing!!fishingrod}subfilter{$:/temp/fishing!!fishingpond}subfilter{$:/temp/fishing!!fishingorder}first[]format:titlelist[]] }}} 58 | /> 59 | <$action-setfield 60 | $tiddler={{{ [list[$:/temp/fishing]first[]addprefix[$:/state/folded/]] }}} 61 | text={{{ [list[$:/temp/fishing]first[]has[grade]then[hide]else[show]] }}} 62 | /> 63 | <$action-sendmessage 64 | $message="tm-close-tiddler" 65 | /> 66 | <$action-navigate 67 | $to={{{ [list[$:/temp/fishing]first[]] }}} 68 | /> 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /ui/viewtemplate/button.tid: -------------------------------------------------------------------------------- 1 | title: $:/plugins/oflg/fishing/ui/ViewTemplate/button 2 | code-body: yes 3 | 4 | \define fishing-button-icon() 5 | <$list 6 | filter="[all[current]!has[custom-icon]]" 7 | variable="no-custom-icon" 8 | > 9 | <$transclude 10 | tiddler={{!!icon}} 11 | /> 12 | 13 | \end 14 | 15 | \define fishing-button-caption() 16 | <$list 17 | filter="[all[current]!has[custom-caption]]" 18 | variable="no-custom-caption" 19 | > 20 | <$wikify 21 | name="caption-text" 22 | text={{!!caption}} 23 | mode="inline" 24 | output="text" 25 | > 26 | <> 27 | 28 | 29 | \end 30 | 31 | \define fishing-button-tooltip() 32 | {{!!description}} <$macrocall 33 | $name="displayshortcuts" 34 | $output="text/plain" 35 | shortcuts={{!!key}} 36 | prefix="` - [" 37 | separator="] [" 38 | suffix="]`" 39 | /> 40 | \end 41 | 42 | \define fishing-button() 43 | <$list 44 | filter={{!!condition}} 45 | variable="list-condition" 46 | > 47 | <$wikify 48 | name="tooltip-text" 49 | text=<> 50 | mode="inline" 51 | output="text" 52 | > 53 | <$list 54 | filter="[all[current]!has[popup]]" 55 | variable="no-popup" 56 | > 57 | <$set 58 | name=disabled 59 | filter={{!!condition-disabled}} 60 | > 61 | <$button 62 | class="tc-btn-invisible $(buttonClasses)$" 63 | tooltip=<> 64 | aria-label=<> 65 | actions={{!!actions}} 66 | disabled=<> 67 | > 68 | <> 69 | <> 70 | <$transclude 71 | tiddler=<> 72 | field="text" 73 | /> 74 | 75 | 76 | 77 | <$list 78 | filter="[all[current]has[popup]]" 79 | variable="popup" 80 | > 81 | <$set 82 | name="popup-state" 83 | value=<> 84 | > 85 | <$set 86 | name=disabled 87 | filter={{!!condition-disabled}} 88 | > 89 | <$button 90 | popup=<> 91 | class="tc-popup-keep tc-btn-invisible $(buttonClasses)$" 92 | selectedClass="tc-selected" 93 | tooltip=<> 94 | actions={{!!actions}} 95 | disabled=<> 96 | > 97 | <> 98 | <> 99 | <$transclude 100 | tiddler=<> 101 | field="text" 102 | /> 103 | 104 | 105 | <$reveal 106 | state=<> 107 | type="popup" 108 | position={{{ [{!!position}] ~[[below]] }}} 109 | animate="yes" 110 | tag="span" 111 | > 112 |
116 | <$transclude 117 | tiddler={{!!popup}} 118 | mode="inline" 119 | /> 120 |
121 | 122 | 123 | 124 | 125 | 126 | \end 127 | 128 | \define fishing-button-outer() 129 | <$set 130 | name="buttonClasses" 131 | value={{!!button-classes}} 132 | > 133 | <> 134 | 135 | \end 136 | 137 | <> -------------------------------------------------------------------------------- /macros/questions/select.tid: -------------------------------------------------------------------------------- 1 | tags: $:/tags/Macro 2 | title: $:/plugins/oflg/fishing/macros/questions/select 3 | code-body: yes 4 | 5 | \whitespace trim 6 | 7 | \define ?s(option,answer:"") 8 | 9 | <$list 10 | filter="[<__option__>trim[]splitregexp[\n]]" 11 | variable="optioncontent" 12 | counter="optionid" 13 | > 14 | <$let 15 | selectid={{{ [<__answer__>split[]count[]match[1]then[id]else] }}} 16 | > 17 | <$reveal 18 | state=<> 19 | type="nomatch" 20 | text="show" 21 | animate="yes" 22 | > 23 | 24 | <$reveal 25 | default={{{ [<__answer__>split[]count[]] }}} 26 | type="lteq" 27 | text="1" 28 | > 29 | <$radio 30 | tiddler="$:/temp/fishing" 31 | index=<> 32 | value=<> 33 | default="" 34 | > 35 | <> 36 | 37 | 38 | <$reveal 39 | default={{{ [<__answer__>split[]count[]] }}} 40 | type="gt" 41 | text="1" 42 | > 43 | <$checkbox 44 | tiddler="$:/temp/fishing" 45 | index=<> 46 | checked=<> 47 | unchecked="" 48 | default="" 49 | > 50 | <> 51 | 52 | 53 | 54 | <$reveal 55 | state=<> 56 | type="match" 57 | text="show" 58 | animate="yes" 59 | > 60 | 61 | <$button 62 | disabled="yes" 63 | class="tc-btn-invisible" 64 | > 65 | <$reveal 66 | default={{{ [<__answer__>split[]search-replace[A],[1]search-replace[B],[2]search-replace[C],[3]search-replace[D],[4]search-replace[E],[5]search-replace[F],[6]search-replace[G],[7]search-replace[H],[8]search-replace[I],[9]matchthen[1]else[0]] =[[$:/temp/fishing]getindexmatchthen[1]else[0]] +[join[]] }}} 67 | type="match" 68 | text="00" 69 | animate="yes" 70 | > 71 | {{$:/core/images/blank}} 72 | 73 | <$reveal 74 | default={{{ [<__answer__>split[]search-replace[A],[1]search-replace[B],[2]search-replace[C],[3]search-replace[D],[4]search-replace[E],[5]search-replace[F],[6]search-replace[G],[7]search-replace[H],[8]search-replace[I],[9]matchthen[1]else[0]] =[[$:/temp/fishing]getindexmatchthen[1]else[0]] +[join[]] }}} 75 | type="match" 76 | text="01" 77 | animate="yes" 78 | > 79 | {{$:/core/images/close-button}} 80 | 81 | <$reveal 82 | default={{{ [<__answer__>split[]search-replace[A],[1]search-replace[B],[2]search-replace[C],[3]search-replace[D],[4]search-replace[E],[5]search-replace[F],[6]search-replace[G],[7]search-replace[H],[8]search-replace[I],[9]matchthen[1]else[0]] =[[$:/temp/fishing]getindexmatchthen[1]else[0]] +[join[]] }}} 83 | type="match" 84 | text="10" 85 | animate="yes" 86 | > 87 | {{$:/core/images/warning}} 88 | 89 | <$reveal 90 | default={{{ [<__answer__>split[]search-replace[A],[1]search-replace[B],[2]search-replace[C],[3]search-replace[D],[4]search-replace[E],[5]search-replace[F],[6]search-replace[G],[7]search-replace[H],[8]search-replace[I],[9]matchthen[1]else[0]] =[[$:/temp/fishing]getindexmatchthen[1]else[0]] +[join[]] }}} 91 | type="match" 92 | text="11" 93 | animate="yes" 94 | > 95 | {{$:/core/images/done-button}} 96 | 97 | <> 98 | 99 | 100 | 101 | \end -------------------------------------------------------------------------------- /widgets/action-exportdata.js: -------------------------------------------------------------------------------- 1 | /*\ 2 | Action widget to export fsrs data. 3 | \*/ 4 | (function () { 5 | 6 | /*jslint node: true, browser: true */ 7 | /*global $tw: false */ 8 | "use strict"; 9 | 10 | var Widget = require("$:/core/modules/widgets/widget.js").widget; 11 | 12 | var ExportdataWidget = function (parseTreeNode, options) { 13 | this.initialise(parseTreeNode, options); 14 | }; 15 | 16 | /* 17 | Inherit from the base widget class 18 | */ 19 | ExportdataWidget.prototype = new Widget(); 20 | 21 | /* 22 | Render this widget into the DOM 23 | */ 24 | ExportdataWidget.prototype.render = function (parent, nextSibling) { 25 | this.computeAttributes(); 26 | this.execute(); 27 | }; 28 | 29 | /* 30 | Compute the internal state of the widget 31 | */ 32 | ExportdataWidget.prototype.execute = function () { 33 | this.actionTiddler = this.getAttribute("$tiddler", "$:/temp/fishing/fsrsdata"); 34 | this.actionTimestamp = this.getAttribute("$timestamp", "yes") === "yes"; 35 | }; 36 | 37 | /* 38 | Refresh the widget by ensuring our attributes are up to date 39 | */ 40 | ExportdataWidget.prototype.refresh = function (changedTiddlers) { 41 | var changedAttributes = this.computeAttributes(); 42 | if (changedAttributes["$tiddler"] || changedAttributes["$timestamp"]) { 43 | this.refreshSelf(); 44 | return true; 45 | } 46 | return this.refreshChildren(changedTiddlers); 47 | }; 48 | 49 | /* 50 | Invoke the action associated with this widget 51 | */ 52 | ExportdataWidget.prototype.invokeAction = function (triggeringWidget, event) { 53 | var title = this.actionTiddler; 54 | 55 | var tiddlerArry = $tw.wiki.filterTiddlers("[has[history]]"); 56 | 57 | var data = {}; 58 | 59 | var globalData = $tw.wiki.getTiddlerData('$:/plugins/oflg/fishing/data'); 60 | 61 | data.globalData = globalData; 62 | 63 | data.cardsData = []; 64 | 65 | function getJson(jsonString) { 66 | jsonString = jsonString || "[]"; 67 | var result = []; 68 | try { 69 | result = JSON.parse(jsonString); 70 | } catch (error) { 71 | console.log("JSON error : " + error); 72 | console.log(jsonString); 73 | } 74 | return result; 75 | } 76 | 77 | for (var f = 0; f < tiddlerArry.length; f++) { 78 | 79 | var tiddlerData = $tw.wiki.getTiddler(tiddlerArry[f]).fields; 80 | 81 | var tiddlerDue = String(tiddlerData.due), 82 | tiddlerInterval = Number(tiddlerData.interval), 83 | tiddlerDifficulty = Number(tiddlerData.difficulty), 84 | tiddlerStability = Number(tiddlerData.stability), 85 | tiddlerRetrievability = Number(tiddlerData.retrievability), 86 | tiddlerGrade = Number(tiddlerData.grade), 87 | tiddlerLapses = Number(tiddlerData.lapses), 88 | tiddlerReps = Number(tiddlerData.reps), 89 | tiddlerReview = String(tiddlerData.review), 90 | tiddlerHistory = String(tiddlerData.history); 91 | 92 | var tiddlerHistoryArry = getJson(tiddlerHistory); 93 | 94 | if (typeof tiddlerGrade === 'number' && !isNaN(tiddlerGrade)) { 95 | 96 | tiddlerHistoryArry.push({ 97 | due: tiddlerDue, 98 | interval: tiddlerInterval, 99 | difficulty: tiddlerDifficulty, 100 | stability: tiddlerStability, 101 | retrievability: tiddlerRetrievability, 102 | grade: tiddlerGrade, 103 | lapses: tiddlerLapses, 104 | reps: tiddlerReps, 105 | review: tiddlerReview 106 | }); 107 | } 108 | 109 | if (tiddlerHistoryArry.length > 0) { 110 | 111 | data.cardsData.push(tiddlerHistoryArry); 112 | } 113 | } 114 | 115 | var creationFields = this.actionTimestamp ? $tw.wiki.getCreationFields() : undefined, 116 | modificationFields = this.actionTimestamp ? $tw.wiki.getModificationFields() : undefined; 117 | 118 | $tw.wiki.addTiddler( 119 | new $tw.Tiddler($tw.wiki.getCreationFields(), { title, text: JSON.stringify(data) }, modificationFields) 120 | ); 121 | 122 | return true;// Action was invoked 123 | }; 124 | 125 | exports["action-exportdata"] = ExportdataWidget; 126 | })(); -------------------------------------------------------------------------------- /macros/fsrs.js: -------------------------------------------------------------------------------- 1 | /*\ 2 | Use Free Spaced Repetition Scheduler: https://github.com/open-spaced-repetition/free-spaced-repetition-scheduler 3 | \*/ 4 | (function () { 5 | 6 | /*jslint node: true, browser: true */ 7 | /*global $tw: false */ 8 | "use strict"; 9 | 10 | exports.name = "fsrs"; 11 | 12 | exports.params = [ 13 | { name: "title" }, 14 | { name: "grade" } 15 | ]; 16 | 17 | /* 18 | Run the macro 19 | */ 20 | exports.run = function (title, grade) { 21 | grade = (grade == "0" || grade == "1" || grade == "2") ? Number(grade) : -1;//Ratings for review have 0, 1, 2. Other ratings mean learn new tiddler. 22 | 23 | var globalData = $tw.wiki.getTiddlerData('$:/plugins/oflg/fishing/data'); 24 | 25 | function faultToleranceValue(value, defaultValue) { 26 | return (typeof value === 'number' && !isNaN(value)) ? value : defaultValue; 27 | } 28 | 29 | var increaseFactor = 60, 30 | difficultyDecay = -0.7, 31 | stabilityDecay = -0.2, 32 | requestRetention = faultToleranceValue(globalData.requestRetention, 0.9), 33 | totalCase = faultToleranceValue(globalData.totalCase, 0), 34 | totalDiff = faultToleranceValue(globalData.totalDiff, 0), 35 | totalReview = faultToleranceValue(globalData.totalReview, 0), 36 | defaultDifficulty = faultToleranceValue(globalData.defaultDifficulty, 5), 37 | defaultStability = faultToleranceValue(globalData.defaultStability, 2), 38 | stabilityDataArry = globalData.stabilityDataArry || []; 39 | 40 | requestRetention = requestRetention >= 0.75 && requestRetention <= 0.95 ? requestRetention : 0.9; 41 | 42 | var due, interval, difficulty, stability, retrievability, lapses, reps, review, history; 43 | 44 | review = new Date().toISOString().replace(/\-|T|:|\.|Z/g, ""); 45 | 46 | if (grade == -1) {// learn new tiddler 47 | var addDay = Math.round(defaultStability * Math.log(requestRetention) / Math.log(0.9)); 48 | 49 | due = $tw.wiki.filterTiddlers("[[" + addDay + "]due[]]")[0]; 50 | interval = 0; 51 | difficulty = defaultDifficulty; 52 | stability = defaultStability; 53 | retrievability = 1; 54 | grade = -1; 55 | reps = 1; 56 | lapses = 0; 57 | history = "[]"; 58 | } else {// review tiddler after learn 59 | var lastFieldsData = $tw.wiki.getTiddler(title).fields; 60 | 61 | var lastDue = String(lastFieldsData.due), 62 | lastInterval = Number(lastFieldsData.interval), 63 | lastDifficulty = Number(lastFieldsData.difficulty), 64 | lastStability = Number(lastFieldsData.stability), 65 | lastRetrievability = Number(lastFieldsData.retrievability), 66 | lastGrade = Number(lastFieldsData.grade), 67 | lastLapses = Number(lastFieldsData.lapses), 68 | lastReps = Number(lastFieldsData.reps), 69 | lastReview = String(lastFieldsData.review), 70 | lastHistory = JSON.parse(lastFieldsData.history); 71 | 72 | interval = Number($tw.wiki.filterTiddlers("[[" + lastReview + "]interval[]]")[0]); 73 | retrievability = Math.exp(Math.log(0.9) * interval / lastStability); 74 | difficulty = Math.min(Math.max(lastDifficulty + retrievability - grade + 0.2, 1), 10); 75 | 76 | if (grade == 0) { 77 | stability = defaultStability * Math.exp(-0.3 * (lastLapses + 1)); 78 | 79 | if (lastReps > 1) { 80 | totalDiff = totalDiff - retrievability; 81 | } 82 | lapses = lastLapses + 1; 83 | reps = 1; 84 | } else {//grade == 1 || grade == 2 85 | stability = lastStability * (1 + increaseFactor * Math.pow(difficulty, difficultyDecay) * Math.pow(lastStability, stabilityDecay) * (Math.exp(1 - retrievability) - 1)); 86 | 87 | if (lastReps > 1) { 88 | totalDiff = totalDiff + 1 - retrievability; 89 | } 90 | lapses = lastLapses; 91 | reps = lastReps + 1; 92 | } 93 | 94 | totalCase = totalCase + 1; 95 | totalReview = totalReview + 1; 96 | 97 | var addDay = Math.round(stability * Math.log(requestRetention) / Math.log(0.9)); 98 | 99 | due = $tw.wiki.filterTiddlers("[[" + addDay + "]due[]]")[0]; 100 | 101 | lastHistory.push({ 102 | due: lastDue, 103 | interval: lastInterval, 104 | difficulty: lastDifficulty, 105 | stability: lastStability, 106 | retrievability: lastRetrievability, 107 | grade: lastGrade, 108 | lapses: lastLapses, 109 | reps: lastReps, 110 | review: lastReview 111 | }); 112 | 113 | history = JSON.stringify(lastHistory); 114 | 115 | // Adaptive defaultDifficulty 116 | if (totalCase > 100) { 117 | defaultDifficulty = 1 / Math.pow(totalReview, 0.3) * Math.pow(Math.log(requestRetention) / Math.max(Math.log(requestRetention + totalDiff / totalCase), 0), 1 / difficultyDecay) * 5 + (1 - 1 / Math.pow(totalReview, 0.3)) * defaultDifficulty; 118 | 119 | totalDiff = 0; 120 | totalCase = 0; 121 | } 122 | 123 | // Adaptive defaultStability 124 | if (lastReps === 1 && lastLapses === 0) { 125 | stabilityDataArry.push({ 126 | interval: interval, 127 | retrievability: grade === "0" ? 0 : 1 128 | }); 129 | 130 | if (stabilityDataArry.length > 0 && stabilityDataArry.length % 50 === 0) { 131 | var intervalSetArry = []; 132 | 133 | var sumRI2S = 0, 134 | sumI2S = 0; 135 | for (var s = 0; s < stabilityDataArry.length; s++) { 136 | var ivl = stabilityDataArry[s].interval; 137 | 138 | if (intervalSetArry.indexOf(ivl) === -1) { 139 | 140 | intervalSetArry.push(ivl); 141 | 142 | var filterArry = stabilityDataArry.filter(function (fi) { 143 | return fi.interval === ivl; 144 | }); 145 | 146 | var retrievabilitySum = filterArry.reduce(function (sum, e) { 147 | return sum + e.retrievability; 148 | }, 0); 149 | 150 | if (retrievabilitySum > 0) { 151 | sumRI2S = sumRI2S + ivl * Math.log(retrievabilitySum / filterArry.length) * filterArry.length; 152 | sumI2S = sumI2S + ivl * ivl * filterArry.length; 153 | } 154 | } 155 | } 156 | defaultStability = (Math.max(Math.log(0.9) / (sumRI2S / sumI2S), 0.1) + defaultStability) / 2; 157 | } 158 | } 159 | } 160 | 161 | var tiddlerData = { 162 | due: due, 163 | interval: interval, 164 | difficulty: difficulty, 165 | stability: stability, 166 | retrievability: retrievability, 167 | lapses: lapses, 168 | reps: reps, 169 | grade: grade, 170 | review: review, 171 | history: history 172 | }; 173 | 174 | globalData = { 175 | requestRetention: requestRetention, 176 | increaseFactor: increaseFactor, 177 | difficultyDecay: difficultyDecay, 178 | stabilityDecay: stabilityDecay, 179 | totalCase: totalCase, 180 | totalDiff: totalDiff, 181 | totalReview: totalReview, 182 | defaultDifficulty: defaultDifficulty, 183 | defaultStability: defaultStability, 184 | stabilityDataArry: stabilityDataArry 185 | }; 186 | 187 | return { tiddlerData: tiddlerData, globalData: globalData };// Action was invoked 188 | }; 189 | 190 | })(); --------------------------------------------------------------------------------