mirror of
https://gitlab.com/octtspacc/OcttKB
synced 2025-01-24 19:51:15 +01:00
34 lines
778 B
JavaScript
34 lines
778 B
JavaScript
/*\
|
|
module-type: wikimethod
|
|
|
|
Introduces some utility methods used by Relink.
|
|
|
|
\*/
|
|
|
|
var utils = require("./utils.js");
|
|
|
|
exports.getTiddlerRelinkReferences = function(title) {
|
|
return utils.getIndexer(this).lookup(title);
|
|
};
|
|
|
|
exports.getTiddlerRelinkBackreferences = function(title) {
|
|
return utils.getIndexer(this).reverseLookup(title);
|
|
};
|
|
|
|
exports.getRelinkableTitles = function() {
|
|
var toUpdate = "$:/config/flibbles/relink/to-update";
|
|
var wiki = this;
|
|
return this.getCacheForTiddler(toUpdate, "relink-toUpdate", function() {
|
|
var tiddler = wiki.getTiddler(toUpdate);
|
|
if (tiddler) {
|
|
return wiki.compileFilter(tiddler.fields.text);
|
|
} else {
|
|
return wiki.allTitles;
|
|
}
|
|
})();
|
|
};
|
|
|
|
exports.getRelinkOrphans = function() {
|
|
return utils.getIndexer(this).orphans();
|
|
};
|