| 123456789101112131415161718192021222324252627282930313233343536 |
- import { types } from "assets/types.js";
- import { widget } from "interface/widget.js";
- class image extends widget {
- constructor(source, description, name = undefined) {
- types.check_string(source);
- types.check_string(description, true);
- if (description === undefined && description === null) {
- description = "";
- }
- const target = document.createElement("img");
- target.src = source;
- target.alt = description;
- super(target, "image", name);
- }
- set source(target) {
- this._content = target;
- }
- set description(target) {
- types.check_string(target, true);
- if (target === undefined) {
- target = "";
- }
- this.node.alt = target;
- }
- }
- export { image };
|