mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-25 23:03:15 +00:00
parent
cd412d8ccb
commit
f02352f6a1
|
@ -183,7 +183,14 @@ LinkWidget.prototype.execute = function() {
|
||||||
this.isShadow = this.wiki.isShadowTiddler(this.to);
|
this.isShadow = this.wiki.isShadowTiddler(this.to);
|
||||||
this.hideMissingLinks = (this.getVariable("tv-show-missing-links") || "yes") === "no";
|
this.hideMissingLinks = (this.getVariable("tv-show-missing-links") || "yes") === "no";
|
||||||
// Make the child widgets
|
// Make the child widgets
|
||||||
this.makeChildWidgets();
|
var templateTree;
|
||||||
|
if(this.parseTreeNode.children && this.parseTreeNode.children.length > 0) {
|
||||||
|
templateTree = this.parseTreeNode.children;
|
||||||
|
} else {
|
||||||
|
// Default template is a link to the title
|
||||||
|
templateTree = [{type: "text", text: this.to}];
|
||||||
|
}
|
||||||
|
this.makeChildWidgets(templateTree);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
caption: link
|
caption: link
|
||||||
created: 20131024141900000
|
created: 20131024141900000
|
||||||
modified: 20171212063130159
|
modified: 20190610195105615
|
||||||
tags: Widgets
|
tags: Widgets
|
||||||
title: LinkWidget
|
title: LinkWidget
|
||||||
type: text/vnd.tiddlywiki
|
type: text/vnd.tiddlywiki
|
||||||
|
@ -9,6 +9,10 @@ The `link` widget generates links to tiddlers. (Use the HTML `<a>` element to ge
|
||||||
|
|
||||||
! Content and Attributes
|
! Content and Attributes
|
||||||
|
|
||||||
|
The content of the link widget is rendered within the `<a>` tag representing the link. If the content is empty then the title of the target tiddler is rendered as the default.
|
||||||
|
|
||||||
|
For example, `<$link to="HelloThere"/>` is equivalent to `<$link to="HelloThere">HelloThere</$link>` and `<$link/>` is equivalent to `<$link to=<<currentTiddler>>><$view field="title"/></$link>`.
|
||||||
|
|
||||||
|!Attribute |!Description |
|
|!Attribute |!Description |
|
||||||
|to |The title of the target tiddler for the link (defaults to the [[current tiddler|Current Tiddler]]) |
|
|to |The title of the target tiddler for the link (defaults to the [[current tiddler|Current Tiddler]]) |
|
||||||
|aria-label |Optional accessibility label |
|
|aria-label |Optional accessibility label |
|
||||||
|
@ -19,7 +23,7 @@ The `link` widget generates links to tiddlers. (Use the HTML `<a>` element to ge
|
||||||
|class|Optional CSS classes //in addition to// the default classes (see below)|
|
|class|Optional CSS classes //in addition to// the default classes (see below)|
|
||||||
|overrideClass|<<.from-version "5.1.16">> Optional CSS classes //instead of// the default classes |
|
|overrideClass|<<.from-version "5.1.16">> Optional CSS classes //instead of// the default classes |
|
||||||
|
|
||||||
The content of the link widget is rendered within the `<a>` tag. The draggable functionality is equivalent to using the DraggableWidget with the ''tiddler'' attribute set to the link target.
|
The draggable functionality is equivalent to using the DraggableWidget with the ''tiddler'' attribute set to the link target.
|
||||||
|
|
||||||
The default value of the tooltip attribute is supplied by the <<.vlink tv-wikilink-tooltip>> variable.
|
The default value of the tooltip attribute is supplied by the <<.vlink tv-wikilink-tooltip>> variable.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user