mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-26 10:00:34 +00:00
36 lines
772 B
JavaScript
36 lines
772 B
JavaScript
/*\
|
|
title: js/macros/slider.js
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true */
|
|
"use strict";
|
|
|
|
var utils = require("../Utils.js");
|
|
|
|
exports.macro = {
|
|
name: "slider",
|
|
types: ["text/html","text/plain"],
|
|
params: {
|
|
name: {byPos: 0, type: "text", optional: false},
|
|
targetTiddler: {byPos: 1, type: "tiddler", optional: false},
|
|
label: {byPos: 2, type: "text", optional: false},
|
|
tooltip: {byPos: 3, type: "text", optional: true}
|
|
},
|
|
handler: function(type,tiddler,store,params) {
|
|
if(type === "text/html") {
|
|
return utils.stitchSlider(type,
|
|
params.label,
|
|
params.tooltip,
|
|
store.renderTiddler(type,params.targetTiddler));
|
|
} else if(type === "text/plain") {
|
|
return store.renderTiddler(type,params.target);
|
|
}
|
|
return null;
|
|
}
|
|
};
|
|
|
|
})();
|
|
|