mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-07-04 19:23:29 +00:00
Revert changes to image widget
This commit is contained in:
parent
df2a3fdefd
commit
a8770d7645
|
@ -43,7 +43,6 @@ ImageWidget.prototype = new Widget();
|
||||||
Render this widget into the DOM
|
Render this widget into the DOM
|
||||||
*/
|
*/
|
||||||
ImageWidget.prototype.render = function(parent,nextSibling) {
|
ImageWidget.prototype.render = function(parent,nextSibling) {
|
||||||
var self = this;
|
|
||||||
this.parentDomNode = parent;
|
this.parentDomNode = parent;
|
||||||
this.computeAttributes();
|
this.computeAttributes();
|
||||||
this.execute();
|
this.execute();
|
||||||
|
@ -59,24 +58,9 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
|
||||||
if(this.wiki.isImageTiddler(this.imageSource)) {
|
if(this.wiki.isImageTiddler(this.imageSource)) {
|
||||||
var type = tiddler.fields.type,
|
var type = tiddler.fields.type,
|
||||||
text = tiddler.fields.text,
|
text = tiddler.fields.text,
|
||||||
_canonical_uri = tiddler.fields._canonical_uri,
|
_canonical_uri = tiddler.fields._canonical_uri;
|
||||||
imageTemplateFilter = this.getVariable("tv-image-template-filter");
|
|
||||||
// If present, use var-tv-image-template-filter to generate a URL;
|
|
||||||
if(imageTemplateFilter) {
|
|
||||||
src = this.wiki.filterTiddlers(imageTemplateFilter,{
|
|
||||||
getVariable: function(name) {
|
|
||||||
switch(name) {
|
|
||||||
case "currentTiddler":
|
|
||||||
return "" + this.imageSource;
|
|
||||||
case "extension":
|
|
||||||
return "" + ($tw.config.contentTypeInfo[type] || {extension: ""}).extension;
|
|
||||||
default:
|
|
||||||
return self.getVariable(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},this.wiki.makeTiddlerIterator([this.imageSource]))[0];
|
|
||||||
// If the tiddler has body text then it doesn't need to be lazily loaded
|
// If the tiddler has body text then it doesn't need to be lazily loaded
|
||||||
} else if(text) {
|
if(text) {
|
||||||
// Render the appropriate element for the image type
|
// Render the appropriate element for the image type
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "application/pdf":
|
case "application/pdf":
|
||||||
|
|
Loading…
Reference in New Issue
Block a user