mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-10 20:43:00 +00:00
Add storyviews list filter and use it in view switcher
This commit is contained in:
29
core/modules/widgets/storyviews.js
Normal file
29
core/modules/widgets/storyviews.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/storyviews.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator for returning the names of the story views in this wiki
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.storyviews = function(source,operator,options) {
|
||||
var results = [],
|
||||
storyviews = {};
|
||||
$tw.modules.applyMethods("storyview",storyviews);
|
||||
$tw.utils.each(storyviews,function(info,name) {
|
||||
results.push(name);
|
||||
});
|
||||
results.sort();
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user