mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-07-07 04:24:22 +00:00
26 lines
407 B
JavaScript
26 lines
407 B
JavaScript
|
/*\
|
||
|
title: $:/editions/tw5.com/if-macro.js
|
||
|
type: application/javascript
|
||
|
module-type: macro
|
||
|
\*/
|
||
|
(function(){
|
||
|
|
||
|
/*jslint node: true, browser: true */
|
||
|
/*global $tw: false */
|
||
|
"use strict";
|
||
|
|
||
|
exports.name = ".if";
|
||
|
|
||
|
exports.params = [
|
||
|
{ name: "cond" },
|
||
|
{ name: "then" },
|
||
|
{ name: "else" }
|
||
|
];
|
||
|
|
||
|
exports.run = function(cond, then, elze) {
|
||
|
then = then || "";
|
||
|
elze = elze || "";
|
||
|
return cond ? then : elze;
|
||
|
};
|
||
|
|
||
|
})();
|