mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-12 10:20:26 +00:00
explicitly pass through source params
from the image/link widget to the respective static export macros
This commit is contained in:
parent
0b68428bc5
commit
d1809f352c
@ -52,7 +52,7 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
tiddler = this.wiki.getTiddler(this.imageSource);
|
tiddler = this.wiki.getTiddler(this.imageSource);
|
||||||
if(!tiddler) {
|
if(!tiddler) {
|
||||||
// The source isn't the title of a tiddler, so we'll assume it's a URL
|
// The source isn't the title of a tiddler, so we'll assume it's a URL
|
||||||
src = this.getVariable("tv-get-export-image-link") || this.imageSource;
|
src = this.getVariable("tv-get-export-image-link",{params: [{name: "src",value: this.imageSource}],defaultValue: this.imageSource}) || this.imageSource;
|
||||||
} else {
|
} else {
|
||||||
// Check if it is an image tiddler
|
// Check if it is an image tiddler
|
||||||
if(this.wiki.isImageTiddler(this.imageSource)) {
|
if(this.wiki.isImageTiddler(this.imageSource)) {
|
||||||
|
@ -76,7 +76,7 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
|
|||||||
var wikiLinkTemplateMacro = this.getVariable("tv-wikilink-template"),
|
var wikiLinkTemplateMacro = this.getVariable("tv-wikilink-template"),
|
||||||
wikiLinkTemplate = wikiLinkTemplateMacro ? wikiLinkTemplateMacro.trim() : "#$uri_encoded$",
|
wikiLinkTemplate = wikiLinkTemplateMacro ? wikiLinkTemplateMacro.trim() : "#$uri_encoded$",
|
||||||
wikiLinkText = wikiLinkTemplate.replace("$uri_encoded$",encodeURIComponent(this.to));
|
wikiLinkText = wikiLinkTemplate.replace("$uri_encoded$",encodeURIComponent(this.to));
|
||||||
wikiLinkText = this.getVariable("tv-get-export-link") || wikiLinkText.replace("$uri_doubleencoded$",encodeURIComponent(encodeURIComponent(this.to)));
|
wikiLinkText = this.getVariable("tv-get-export-link",{params: [{name: "to",value: this.to}],defaultValue: this.to}) || wikiLinkText.replace("$uri_doubleencoded$",encodeURIComponent(encodeURIComponent(this.to)));
|
||||||
domNode.setAttribute("href",wikiLinkText);
|
domNode.setAttribute("href",wikiLinkText);
|
||||||
// Set the tooltip
|
// Set the tooltip
|
||||||
// HACK: Performance issues with re-parsing the tooltip prevent us defaulting the tooltip to "<$transclude field='tooltip'><$transclude field='title'/></$transclude>"
|
// HACK: Performance issues with re-parsing the tooltip prevent us defaulting the tooltip to "<$transclude field='tooltip'><$transclude field='title'/></$transclude>"
|
||||||
|
Loading…
Reference in New Issue
Block a user