mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-13 13:57:25 +00:00
checkin of updates to latest version of widget tree format, includes tiddler, slider and tabs macros
This commit is contained in:
30
plugins/tiddlywiki/tw2parser/entry.js
Normal file
30
plugins/tiddlywiki/tw2parser/entry.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/*\
|
||||
title: $:/macros/tiddlywiki/entry.js
|
||||
type: application/javascript
|
||||
module-type: macro
|
||||
\*/
|
||||
(function(){
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
/*
|
||||
Information about this macro
|
||||
returns value of key in a data json tiddler
|
||||
note that macros are not connected with the refresh mechanism -use with caution.
|
||||
*/
|
||||
exports.name = "entryof";
|
||||
|
||||
exports.params = [
|
||||
{ name: "key" }, { name: "map" }
|
||||
];
|
||||
/*
|
||||
Run the macro
|
||||
*/
|
||||
exports.run = function(key,map) {
|
||||
try{
|
||||
return JSON.parse(map)[key];
|
||||
} catch(e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user