44305363+kraskrom@4056: // widget_image.ysl2 44305363+kraskrom@4056: 44305363+kraskrom@4056: widget_desc("Image") { 44305363+kraskrom@4056: longdesc 44305363+kraskrom@4056: || 44305363+kraskrom@4056: If Image widget is a svg:image element, then href content is replaced by 44305363+kraskrom@4056: value of given variable. 44305363+kraskrom@4056: || 44305363+kraskrom@4056: 44305363+kraskrom@4056: shortdesc > Image display 44305363+kraskrom@4056: } 44305363+kraskrom@4056: 44305363+kraskrom@4056: widget_class("Image") 44305363+kraskrom@4056: || 44305363+kraskrom@4056: frequency = 5; 44305363+kraskrom@4056: dispatch(value, oldval, index) { 44305363+kraskrom@4056: if (index == 0) { 44305363+kraskrom@4056: this.given_url = value; 44305363+kraskrom@4056: this.ready = true; 44305363+kraskrom@4056: this.request_animate(); 44305363+kraskrom@4056: } 44305363+kraskrom@4056: } 44305363+kraskrom@4056: || 44305363+kraskrom@4056: 44305363+kraskrom@4056: widget_defs("Image") { 44305363+kraskrom@4056: | given_url: "", 44305363+kraskrom@4056: | ready: false, 44305363+kraskrom@4056: | animate: function(){ 44305363+kraskrom@4056: | this.element.setAttribute('href', this.given_url); 44305363+kraskrom@4056: | }, 44305363+kraskrom@4056: | 44305363+kraskrom@4056: | init: function() { 44305363+kraskrom@4056: | this.animate(); 44305363+kraskrom@4056: | }, 44305363+kraskrom@4056: }