More permalink tweaks

And more documentation this time!
This commit is contained in:
Jermolene
2014-05-29 23:17:21 +01:00
parent 412cde6f53
commit 3f25db0abe
2 changed files with 20 additions and 3 deletions
+8 -3
View File
@@ -61,8 +61,8 @@ defaultToCurrentStory: If true, the current story is retained as the default, in
*/
function openStartupTiddlers(options) {
options = options || {};
// Decode the hash portion of our URL
var target,
// Work out the target tiddler and the story filter. "null" means "unspecified"
var target = null,
storyFilter = null;
if($tw.locationHash.length > 1) {
var hash = $tw.locationHash.substr(1),
@@ -80,9 +80,14 @@ function openStartupTiddlers(options) {
var currStoryList = $tw.wiki.getTiddlerList(DEFAULT_STORY_TITLE);
storyFilter = $tw.utils.stringifyList(currStoryList);
} else {
storyFilter = "";
if(target && target !== "") {
storyFilter = "";
} else {
storyFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE);
}
}
}
// Process the story filter to get the story list
var storyList = $tw.wiki.filterTiddlers(storyFilter);
// If the target tiddler isn't included then splice it in at the top
if(target && storyList.indexOf(target) === -1) {