woltlab-compiler
Version:
A compiler for WoltLab-Package Archives and WoltLab-Package Components
43 lines • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const XMLEditor_1 = require("../../Serialization/XMLEditor");
const WoltLabXMLCompiler_1 = require("../WoltLabXMLCompiler");
/**
* Provides the functionality to compile theme-variables.
*/
class ThemeVariableCompiler extends WoltLabXMLCompiler_1.WoltLabXMLCompiler {
/**
* Initializes a new instance of the `ThemeVariableCompiler` class.
*
* @param item
* The item to compile.
*/
constructor(item) {
super(item);
}
/**
* @inheritdoc
*/
get TagName() {
return "variables";
}
/**
* @inheritdoc
*/
get SchemaLocation() {
return "http://www.woltlab.com/XSD/tornado/styleVariables.xsd";
}
/**
* @inheritdoc
*/
CreateDocument() {
let document = super.CreateDocument();
let editor = new XMLEditor_1.XMLEditor(document.documentElement);
for (let name in this.Item) {
editor.AddTextElement("variable", this.Item[name], (variable) => variable.SetAttribute("name", name));
}
return document;
}
}
exports.ThemeVariableCompiler = ThemeVariableCompiler;
//# sourceMappingURL=ThemeVariableCompiler.js.map