mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-13 15:32:51 +00:00
Added HTML.label()
This commit is contained in:
parent
b05e7e82da
commit
a98ff0350f
13
js/HTML.js
13
js/HTML.js
@ -42,7 +42,7 @@ var utils = require("./Utils.js");
|
|||||||
Constructs an HTMLParseTree from a tree of nodes. A single node or an array of nodes can be passed.
|
Constructs an HTMLParseTree from a tree of nodes. A single node or an array of nodes can be passed.
|
||||||
|
|
||||||
As a shortcut, the constructor can be called as an ordinary function without the new keyword, in which case
|
As a shortcut, the constructor can be called as an ordinary function without the new keyword, in which case
|
||||||
it automatically returns the `text/html` rendering of the tree.
|
it by default returns the `text/html` rendering of the tree.
|
||||||
*/
|
*/
|
||||||
var HTML = function(tree,type) {
|
var HTML = function(tree,type) {
|
||||||
if(this instanceof HTML) {
|
if(this instanceof HTML) {
|
||||||
@ -110,6 +110,17 @@ HTML.macro = function(name,params,children,dependencies) {
|
|||||||
return m;
|
return m;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Static method to construct a label
|
||||||
|
*/
|
||||||
|
HTML.label = function(type,value,classes) {
|
||||||
|
classes = (classes || []).slice(0);
|
||||||
|
classes.push("label");
|
||||||
|
return HTML.elem("span",{
|
||||||
|
"class": classes
|
||||||
|
},value);
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Static method to construct a split label
|
Static method to construct a split label
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user