namespace folksprak.words.widgets { /** */ export class class_widget_correlation extends class_widget { /** */ private classes : Array; /** */ private language_from : string; /** */ private expression_from : string; /** */ private language_to : string; /** */ private expression_to : string; /** */ public constructor ( language_from : string, expression_from : string, language_to : string, expression_to : string, classes : Array = [] ) { super(); this.language_from = language_from; this.expression_from = expression_from; this.language_to = language_to; this.expression_to = expression_to; this.classes = classes; } /** */ public render() : HTMLElement { const dom_span : HTMLSpanElement = (document.createElement('span')); dom_span.setAttribute ( 'class', ['widget', 'widget-correlation'].concat(this.classes).join(' ') ); dom_span.textContent = lib_string.coin ( '[{{language_from}}] {{expression_from}} ~ [{{language_to}}] {{expression_to}}', { 'language_from': this.language_from, 'expression_from': this.expression_from, 'language_to': this.language_to, 'expression_to': this.expression_to, } ); return dom_span; } } }