1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-25 23:03:15 +00:00

Add alt attribute to image widget

This commit is contained in:
Jermolene 2014-08-20 10:00:34 +01:00
parent 1973df0809
commit fbf307c648
2 changed files with 6 additions and 1 deletions

View File

@ -105,6 +105,9 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
if(this.imageTooltip) {
domNode.setAttribute("title",this.imageTooltip);
}
if(this.imageAlt) {
domNode.setAttribute("alt",this.imageAlt);
}
// Insert element
parent.insertBefore(domNode,nextSibling);
this.domNodes.push(domNode);
@ -120,6 +123,7 @@ ImageWidget.prototype.execute = function() {
this.imageHeight = this.getAttribute("height");
this.imageClass = this.getAttribute("class");
this.imageTooltip = this.getAttribute("tooltip");
this.imageAlt = this.getAttribute("alt");
};
/*

View File

@ -1,6 +1,6 @@
title: ImageWidget
created: 20140416160234142
modified: 20140611160234142
modified: 20140820100234142
tags: widget
! Introduction
@ -16,6 +16,7 @@ Any content of the `<$image>` widget is ignored.
|width |The width of the image as a number |
|height |The height of the image |
|tooltip |The tooltip to be displayed over the image |
|alt |The alternative text to be associated with the image |
|class |CSS classes to be assigned to the `<img>` element |
! External Images and the ''_canonical_uri'' field