-
I tried to use various methods( $list, $set, $reveal ), but all of them are failed ... The follwing Tiddler had been tagged with
Then I tried to use JS Macro, without success, either (function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "reader-mode";
exports.params = [];
/*
Run the macro
*/
exports.run = function(act) {
var isReadOnly = ""
var statusTid = this.wiki.getTiddler("$:/status/IsReadOnly")
if (statusTid) {
isReadOnly = statusTid.getFieldString("text")
if (isReadOnly == "yes") {
return "readonly-hide-elements"
}
}
return "unhide-elements"
};
})(); The follwing Tiddler had been tagged with
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
JS macros have to have a header, that is needed by the startup mechanism, otherwise the macro won't be available
|
Beta Was this translation helpful? Give feedback.
-
So your js-macro does work, but the readOnly status tiddler doesn't exist, when it is executed. |
Beta Was this translation helpful? Give feedback.
So your js-macro does work, but the readOnly status tiddler doesn't exist, when it is executed.