Fix other interface classes naming convention

This commit is contained in:
barsdeveloper
2022-02-27 13:02:21 +01:00
parent e8946745d6
commit b48b1228f4
29 changed files with 535 additions and 535 deletions

View File

@@ -2,10 +2,10 @@ import Configuration from "../Configuration"
import html from "./html"
import sanitizeText from "./sanitizeText"
import SelectorElement from "../element/SelectorElement"
import Template from "./Template"
import ITemplate from "./ITemplate"
/** @typedef {import("../Blueprint").default} Blueprint */
export default class BlueprintTemplate extends Template {
export default class BlueprintTemplate extends ITemplate {
header(element) {
return html`
<div class="ueb-viewport-header">

46
js/template/Template.js → js/template/ITemplate.js Executable file → Normal file
View File

@@ -1,23 +1,23 @@
/**
* @typedef {import("../element/IElement").default} IElement
*/
export default class Template {
/**
* Computes the html content of the target element.
* @param {IElement} entity Element of the graph
* @returns The result html
*/
render(entity) {
return ""
}
/**
* Applies the style to the element.
* @param {IElement} element Element of the graph
*/
apply(element) {
// TODO replace with the safer element.setHTML(...) when it will be available
element.innerHTML = this.render(element)
}
}
/**
* @typedef {import("../element/IElement").default} IElement
*/
export default class ITemplate {
/**
* Computes the html content of the target element.
* @param {IElement} entity Element of the graph
* @returns The result html
*/
render(entity) {
return ""
}
/**
* Applies the style to the element.
* @param {IElement} element Element of the graph
*/
apply(element) {
// TODO replace with the safer element.setHTML(...) when it will be available
element.innerHTML = this.render(element)
}
}

View File

@@ -1,11 +1,11 @@
import LinkElement from "../element/LinkElement"
import html from "./html"
import Template from "./Template"
import ITemplate from "./ITemplate"
/**
* @typedef {import("../element/LinkMessageElement").default} LinkMessageElement
*/
export default class LinkMessageTemplate extends Template {
export default class LinkMessageTemplate extends ITemplate {
/**
* Computes the html content of the target element.

View File

@@ -1,13 +1,13 @@
import html from "./html"
import sanitizeText from "./sanitizeText"
import Template from "./Template"
import ITemplate from "./ITemplate"
import Configuration from "../Configuration"
/**
* @typedef {import("../element/LinkElement").default} LinkElement
* @typedef {import("../element/LinkMessageElement").default} LinkMessageElement
*/
export default class LinkTemplate extends Template {
export default class LinkTemplate extends ITemplate {
static pixelToUnit(pixels, pixelFullSize) {
return pixels * 100 / pixelFullSize

View File

@@ -1,12 +1,12 @@
import Utility from "../Utility"
import html from "./html"
import sanitizeText from "./sanitizeText"
import Template from "./Template"
import ITemplate from "./ITemplate"
/**
* @typedef {import("../element/PinElement").default} PinElement
*/
export default class PinTemplate extends Template {
export default class PinTemplate extends ITemplate {
/**
* Computes the html content of the pin.

View File

@@ -1,10 +1,10 @@
import sanitizeText from "./sanitizeText"
import Template from "./Template"
import ITemplate from "./ITemplate"
/**
* @typedef {import("../element/ISelectableDraggableElement").default} ISelectableDraggableElement
*/
export default class SelectableDraggableTemplate extends Template {
export default class SelectableDraggableTemplate extends ITemplate {
/**
* Returns the html elements rendered from this template.

View File

@@ -1,10 +1,10 @@
import sanitizeText from "./sanitizeText"
import Template from "./Template"
import ITemplate from "./ITemplate"
/**
* @typedef {import("../element/SelectorElement").default} SelectorElement
*/
export default class SelectorTemplate extends Template {
export default class SelectorTemplate extends ITemplate {
/**
* Applies the style to the element.