55 lines
2.2 KiB
JavaScript
55 lines
2.2 KiB
JavaScript
"use strict";
|
|
var __extends = (this && this.__extends) || (function () {
|
|
var extendStatics = function (d, b) {
|
|
extendStatics = Object.setPrototypeOf ||
|
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
return extendStatics(d, b);
|
|
};
|
|
return function (d, b) {
|
|
if (typeof b !== "function" && b !== null)
|
|
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
extendStatics(d, b);
|
|
function __() { this.constructor = d; }
|
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
};
|
|
})();
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.CHTMLmglyph = void 0;
|
|
var Wrapper_js_1 = require("../Wrapper.js");
|
|
var mglyph_js_1 = require("../../common/Wrappers/mglyph.js");
|
|
var mglyph_js_2 = require("../../../core/MmlTree/MmlNodes/mglyph.js");
|
|
var CHTMLmglyph = (function (_super) {
|
|
__extends(CHTMLmglyph, _super);
|
|
function CHTMLmglyph() {
|
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
}
|
|
CHTMLmglyph.prototype.toCHTML = function (parent) {
|
|
var chtml = this.standardCHTMLnode(parent);
|
|
if (this.charWrapper) {
|
|
this.charWrapper.toCHTML(chtml);
|
|
return;
|
|
}
|
|
var _a = this.node.attributes.getList('src', 'alt'), src = _a.src, alt = _a.alt;
|
|
var styles = {
|
|
width: this.em(this.width),
|
|
height: this.em(this.height)
|
|
};
|
|
if (this.valign) {
|
|
styles.verticalAlign = this.em(this.valign);
|
|
}
|
|
var img = this.html('img', { src: src, style: styles, alt: alt, title: alt });
|
|
this.adaptor.append(chtml, img);
|
|
};
|
|
CHTMLmglyph.kind = mglyph_js_2.MmlMglyph.prototype.kind;
|
|
CHTMLmglyph.styles = {
|
|
'mjx-mglyph > img': {
|
|
display: 'inline-block',
|
|
border: 0,
|
|
padding: 0
|
|
}
|
|
};
|
|
return CHTMLmglyph;
|
|
}((0, mglyph_js_1.CommonMglyphMixin)(Wrapper_js_1.CHTMLWrapper)));
|
|
exports.CHTMLmglyph = CHTMLmglyph;
|
|
//# sourceMappingURL=mglyph.js.map
|