OcttKB Cross-Repo Sync (HTML to Raw)

This commit is contained in:
2023-12-21 00:31:52 +00:00
parent b25cc0a659
commit cf5ee599b3
66 changed files with 569 additions and 53 deletions

View File

@ -0,0 +1,6 @@
created: 20211229150338458
modified: 20211230150511641
tags: $:/km/keynav
title: $:/config/ShortcutInfo/CloseCurrent
Close the current tiddler in the Story River.

View File

@ -0,0 +1,6 @@
created: 20211229150005548
modified: 20211230150749233
tags: $:/km/keynav
title: $:/config/ShortcutInfo/EditCurrent
Edit the current tiddler in the Story River.

View File

@ -0,0 +1,6 @@
created: 20211229165026605
modified: 20211230152248693
tags: $:/km/keynav
title: $:/config/ShortcutInfo/ShowHistory
Show the tiddler navigation history (minus drafts).

View File

@ -0,0 +1,6 @@
created: 20211229144336924
modified: 20211230150837532
tags: $:/km/keynav
title: $:/config/ShortcutInfo/StoryCurrent
Navigate to the current (most recently viewed) tiddler in the Story River.

View File

@ -0,0 +1,6 @@
created: 20211229144217331
modified: 20211230150856707
tags: $:/km/keynav
title: $:/config/ShortcutInfo/StoryFirst
Navigate to the first (most recent) tiddler in the Story River.

View File

@ -0,0 +1,6 @@
created: 20211229144242848
modified: 20211230150847542
tags: $:/km/keynav
title: $:/config/ShortcutInfo/StoryLast
Navigate to the last (first opened) tiddler in the Story River.

View File

@ -0,0 +1,6 @@
created: 20211229144129425
modified: 20211230150906715
tags: $:/km/keynav
title: $:/config/ShortcutInfo/StoryNext
Navigate to the next tiddler in the Story River.

View File

@ -0,0 +1,6 @@
created: 20211229142706009
modified: 20211230150918103
tags: $:/km/keynav
title: $:/config/ShortcutInfo/StoryPrev
Navigate to the previous tiddler in the Story River.

View File

@ -0,0 +1,6 @@
created: 20211229150435191
modified: 20211230151829028
tags: $:/km/keynav
title: $:/config/shortcuts/CloseCurrent
shift-alt-C

View File

@ -0,0 +1,6 @@
created: 20211229150115436
modified: 20211230151845477
tags: $:/km/keynav
title: $:/config/shortcuts/EditCurrent
shift-alt-E

View File

@ -0,0 +1,6 @@
created: 20211229165346033
modified: 20211230151900807
tags: $:/km/keynav
title: $:/config/shortcuts/ShowHistory
shift-alt-H

View File

@ -0,0 +1,6 @@
created: 20211229144857054
modified: 20211230151914453
tags: $:/km/keynav
title: $:/config/shortcuts/StoryCurrent
shift-alt-Space

View File

@ -0,0 +1,6 @@
created: 20211229144823211
modified: 20211230151929234
tags: $:/km/keynav
title: $:/config/shortcuts/StoryFirst
shift-alt-Up

View File

@ -0,0 +1,6 @@
created: 20211229144841080
modified: 20211230151942807
tags: $:/km/keynav
title: $:/config/shortcuts/StoryLast
shift-alt-Down

View File

@ -0,0 +1,6 @@
created: 20211229144803909
modified: 20211230151955966
tags: $:/km/keynav
title: $:/config/shortcuts/StoryNext
shift-alt-Right

View File

@ -0,0 +1,6 @@
created: 20211229143921111
modified: 20211230150445026
tags: $:/km/keynav
title: $:/config/shortcuts/StoryPrev
shift-alt-Left

View File

@ -0,0 +1,39 @@
caption: {{$:/language/SideBar/Open/Caption}}
created: 20211229033021108
modified: 20211230152043068
tags: $:/tags/SideBar $:/km/keynav
title: $:/core/ui/SideBar/Open
\whitespace trim
\define lingo-base() $:/language/CloseAll/
\define drop-actions()
<$action-listops $tiddler=<<tv-story-list>> $subfilter="+[insertbefore:currentTiddler<actionTiddler>]"/>
\end
\define placeholder()
<div class="tc-droppable-placeholder"/>
\end
\define droppable-item(button)
\whitespace trim
<$droppable actions=<<drop-actions>> enable=<<tv-allow-drag-and-drop>>>
<<placeholder>>
<div>
$button$
</div>
</$droppable>
\end
<div class="tc-sidebar-tab-open">
<$list filter="[list<tv-story-list>]" history=<<tv-history-list>> storyview="pop">
<div class="tc-sidebar-tab-open-item">
<$macrocall $name="droppable-item" button="""<$button message="tm-close-tiddler" tooltip={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class="tc-btn-invisible tc-btn-mini tc-small-gap-right">{{$:/core/images/close-button}}</$button><$link to={{!!title}}><$view field="title"/></$link><$reveal type="match" state="$:/HistoryList!!current-tiddler" text=<<currentTiddler>>>&#x2713;</$reveal>"""/>
</div>
</$list>
<$tiddler tiddler="">
<div>
<$macrocall $name="droppable-item" button="""<$button message="tm-close-all-tiddlers" class="tc-btn-invisible tc-btn-mini"><<lingo Button>></$button>"""/>
</div>
</$tiddler>
</div>

View File

@ -0,0 +1,18 @@
created: 20211229155304402
key: ((ShowHistory))
maxToShow: 20
modified: 20211230155909304
tags: $:/tags/KeyboardShortcut $:/km/keynav
title: $:/plugins/km/keynav/ShowHistory
<$navigator story="$:/StoryList" history="$:/HistoryList">
<$action-navigate $to="$:/plugins/km/keynav/ShowHistory"/>
</$navigator>
<$set name="history" filter="[{$:/HistoryList}]" select=0>
!!Recent History
Limit: <$edit-text tiddler=<<currentTiddler>> field="maxToShow" tag="input" size=2 default="20" />
<$macrocall $name="cleanHistoryList" history=<<history>> maxShow={{!!maxToShow}} />
</$set>

View File

@ -0,0 +1,46 @@
/*\
title: cleanHistoryList
type: application/javascript
module-type: macro
Get the history list after removing drafts and duplicate sequential references.
\*/
(function(){
"use strict";
exports.name = "cleanHistoryList";
exports.params = [
{name: "history"},
{name: "maxShow"}
];
exports.run = function(history, maxShow) {
history = JSON.parse(history);
//console.log("History List: " + JSON.stringify(history));
//Loop through history removing drafts and duplicates.
var list = [];
var lastTid = '';
var tidLink = '';
var tid = '';
//Loop in reverse to put most recent at top of resulting list
for(let i=history.length-1; i > -1; i--) {
tid = history[i];
//console.log(JSON.stringify(tid));
if(tid.title.startsWith('Draft ')) continue;
tidLink = '[[' + tid.title + ']]';
if(tidLink == lastTid) continue;
list.push(tidLink);
lastTid = tidLink;
if(list.length >= maxShow) break;
}
//format an HTML list and return
var toReturn = '<ul>';
for(let tid of list) {
toReturn += '<li>' + tid + '</li>';
}
toReturn += '</ul>';
return toReturn;
};
})();

View File

@ -0,0 +1,6 @@
created: 20211229152810601
modified: 20211230153855710
module-type: macro
tags: $:/km/keynav
title: $:/plugins/km/keynav/cleanHistoryList
type: application/javascript

View File

@ -0,0 +1,12 @@
created: 20211229150246081
key: ((CloseCurrent))
modified: 20211230152623815
tags: $:/tags/KeyboardShortcut $:/km/keynav
title: $:/plugins/km/keynav/closeCurrent
<$set name="current" filter="[{$:/HistoryList!!current-tiddler}]" select=0>
<$navigator story="$:/StoryList" history="$:/HistoryList">
<$action-sendmessage $message="tm-close-tiddler" $param=<<current>>/>
</$navigator>
</$set>

View File

@ -0,0 +1,12 @@
created: 20211229145450407
key: ((EditCurrent))
modified: 20211230150822130
tags: $:/tags/KeyboardShortcut $:/km/keynav
title: $:/plugins/km/keynav/editCurrent
<$set name="current" filter="[{$:/HistoryList!!current-tiddler}]" select=0>
<$navigator story="$:/StoryList" history="$:/HistoryList">
<$action-sendmessage $message="tm-edit-tiddler" $param=<<current>>/>
</$navigator>
</$set>

View File

@ -0,0 +1,20 @@
caption: readme
created: 20220102193630923
modified: 20220102202241769
revision: 4
tags: $:/km/keynav
title: $:/plugins/km/keynav/readme
type: text/vnd.tiddlywiki
The ~KeyNav plugin implements a set of shortcuts using the built-in keyboard shortcut mechanism in ~TiddlyWiki. It has the following keyboard functions:
* ''~StoryFirst:'' Navigate to the top of the Story River (Shift+Alt+Up)
* ''~StoryLast:'' Navigate to the bottom of the Story River (Shift+Alt+Down)
* ''~StoryPrev:'' Navigate to the previous tiddler in the Story River (Shift+Alt+Left)
* ''~StoryNext:'' Navigate to the next tiddler in the Story River (Shift+Alt+Right)
* ''~StoryCurrent:'' Navigate to the current tiddler in the Story River (ie. if you scrolled away, this shortcut will bring you back) (Shift+Alt+Space)
* ''~EditCurrent:'' Edit the current tiddler, aka the most recent one in the history list (Shift+Alt+E)
* ''~CloseCurrent:'' Close the current tiddler (Shift+Alt+C)
* ''~ShowHistory:'' View the recent history, including system tiddlers (Shift+Alt+H)
The key combinations can be changed using the "Keyboard Shortcuts" tab in the Control Panel.

View File

@ -0,0 +1,12 @@
created: 20211229032003700
key: ((StoryCurrent))
modified: 20211230150954378
tags: $:/tags/KeyboardShortcut $:/km/keynav
title: $:/plugins/km/keynav/storyCurrent
<$set name="story" filter="[list[$:/StoryList]join[,]]" select=0>
<$set name="current" filter="[{$:/HistoryList!!current-tiddler}]" select=0>
<!-- This macro call add a navigator widget that will be configured to navigate to the tiddler in the desired position in the story river -->
<$macrocall $name="storynav" storylist=<<story>> current=<<current>> position="current" />
</$set>
</$set>

View File

@ -0,0 +1,12 @@
created: 20211229031533358
key: ((StoryFirst))
modified: 20211230151041569
tags: $:/tags/KeyboardShortcut $:/km/keynav
title: $:/plugins/km/keynav/storyFirst
<$set name="story" filter="[list[$:/StoryList]join[,]]" select=0>
<$set name="current" filter="[{$:/HistoryList!!current-tiddler}]" select=0>
<!-- This macro call add a navigator widget that will be configured to navigate to the tiddler in the desired position in the story river -->
<$macrocall $name="storynav" storylist=<<story>> current=<<current>> position="first" />
</$set>
</$set>

View File

@ -0,0 +1,12 @@
created: 20211229031901058
key: ((StoryLast))
modified: 20211230151019840
tags: $:/tags/KeyboardShortcut $:/km/keynav
title: $:/plugins/km/keynav/storyLast
<$set name="story" filter="[list[$:/StoryList]join[,]]" select=0>
<$set name="current" filter="[{$:/HistoryList!!current-tiddler}]" select=0>
<!-- This macro call add a navigator widget that will be configured to navigate to the tiddler in the desired position in the story river -->
<$macrocall $name="storynav" storylist=<<story>> current=<<current>> position="last" />
</$set>
</$set>

View File

@ -0,0 +1,13 @@
created: 20211228233244219
key: ((StoryNext))
modified: 20211230151133988
tags: $:/tags/KeyboardShortcut $:/km/keynav
title: $:/plugins/km/keynav/storyNext
type: text/vnd.tiddlywiki
<$set name="story" filter="[list[$:/StoryList]join[,]]" select=0>
<$set name="current" filter="[{$:/HistoryList!!current-tiddler}]" select=0>
<!-- This macro call add a navigator widget that will be configured to navigate to the tiddler in the desired position in the story river -->
<$macrocall $name="storynav" storylist=<<story>> current=<<current>> position="next" />
</$set>
</$set>

View File

@ -0,0 +1,12 @@
created: 20211228015554785
key: ((StoryPrev))
modified: 20211230151155944
tags: $:/tags/KeyboardShortcut $:/km/keynav
title: $:/plugins/km/keynav/storyPrev
<$set name="story" filter="[list[$:/StoryList]join[,]]" select=0>
<$set name="current" filter="[{$:/HistoryList!!current-tiddler}]" select=0>
<!-- This macro call add a navigator widget that will be configured to navigate to the tiddler in the desired position in the story river -->
<$macrocall $name="storynav" storylist=<<story>> current=<<current>> position="prev" />
</$set>
</$set>

View File

@ -0,0 +1,66 @@
/*\
title: storynav
type: application/javascript
module-type: macro
Get tiddler at the indicated position in the story list.
\*/
(function(){
"use strict";
exports.name = "storynav";
exports.params = [
{name: "storylist"},
{name: "current"},
{name: "position"}
];
exports.run = function(storylist, current, position) {
//console.log("Story List: " + storylist);
//storylist=storylist.replaceAll("[[","");
//storylist=storylist.replaceAll("]]","");
storylist = storylist.split(",");
//console.log("Story List: " + storylist);
//console.log("Current: " + current);
//console.log("Position: " + position);
var tiddler = "none";
var len = storylist.length;
var idx = 0;
//console.log("Length: " + len);
if(len == 1) {
tiddler = current;
} else if(position == "prev") {
for (tiddler of storylist) {
//console.log("Evaluating tiddler: " + tiddler + " vs " + current);
if(tiddler == current) {
if(idx >= len-1) tiddler = storylist[0];
else tiddler = storylist[idx+1]
break;
}
idx++;
}
} else if(position == "next") {
for (tiddler of storylist) {
//console.log("Evaluating tiddler: " + tiddler + " vs " + current);
if(tiddler == current) {
if(idx == 0) tiddler = storylist[len-1];
else tiddler = storylist[idx-1]
break;
}
idx++;
}
} else if(position == "first") {
tiddler = storylist[0];
} else if(position == "last") {
//console.log("HIT position = last. Jumping to last tiddler in story.");
tiddler = storylist[len-1];
} else {
tiddler = current;
}
//console.log('Navigate to: "' + tiddler + '"');
//console.log('Returning: ' + '<$navigator story="$:/StoryList" history="$:/HistoryList"><$action-navigate $to="""' + tiddler + '""" $scroll="yes" /></$navigator>\n\n' + tiddler);
//IMPORTANT - Macro just returns wikitext to be interpreted.
//return tiddler;
return '<$navigator story="$:/StoryList" history="$:/HistoryList"><$action-navigate $to="""' + tiddler + '""" $scroll="yes" /></$navigator>\n\n' + tiddler;
};
})();

View File

@ -0,0 +1,6 @@
created: 20211228025130627
modified: 20211230172735290
module-type: macro
tags: $:/km/keynav
title: $:/plugins/km/keynav/storynav
type: application/javascript

View File

@ -0,0 +1,22 @@
created: 20211230144549509
modified: 20220102211445416
tags: $:/km/keynav
title: KeyboardNavigation
type: text/vnd.tiddlywiki
The ~KeyNav plugin implements a series of shortcuts to enable navigating the Story River without resorting to the mouse. Shortcuts are implemented using the built-in keyboard shortcut mechanism in ~TiddlyWiki. The plugin has the following keyboard functions:
* ''~StoryFirst:'' Navigate to the top of the Story River (Shift+Alt+Up)
* ''~StoryLast:'' Navigate to the bottom of the Story River (Shift+Alt+Down)
* ''~StoryPrev:'' Navigate to the previous tiddler in the Story River (Shift+Alt+Left)
* ''~StoryNext:'' Navigate to the next tiddler in the Story River (Shift+Alt+Right)
* ''~StoryCurrent:'' Navigate to the current tiddler in the Story River (ie. if you scrolled away, this shortcut will bring you back) (Shift+Alt+Space)
* ''~EditCurrent:'' Edit the current tiddler, aka the most recent one in the history list (Shift+Alt+E)
* ''~CloseCurrent:'' Close the current tiddler (Shift+Alt+C)
* ''~ShowHistory:'' View the recent history, including system tiddlers (Shift+Alt+H)
The key combinations can be changed using the "Keyboard Shortcuts" tab in the Control Panel.
As with other ~TiddlyWiki plugins, you can import the plugin directly by dragging the <<tag $:/km/keynav>> tag pill tagging this tiddler.
Or alternatively, you can download and include the plugin in the plugins folder under a ~NodeJS ~TiddlyWiki wiki folder (ie. mytiddlywiki/plugins/keynav).

View File

@ -0,0 +1,14 @@
{
"created": "20211230162900488",
"dependents": "",
"description": "Provides keyboard shortcuts for navigating the Story River without a mouse.",
"modified": "20211230170357014",
"name": "KeyNav",
"plugin-type": "plugin",
"tags": "",
"title": "$:/plugins/km/keynav",
"version": "0.0.3",
"list": "readme",
"revision": "0",
"bag": "default"
}