3 changed files with 6 additions and 78 deletions
@ -1,78 +0,0 @@ |
|||||
/** |
|
||||
* Defines an extension that can be added to the jpclw-framework |
|
||||
*/ |
|
||||
class CompelExtension { |
|
||||
/** |
|
||||
* @type {string} |
|
||||
*/ |
|
||||
name; |
|
||||
/** |
|
||||
* @type {string} |
|
||||
*/ |
|
||||
diplayTitle; |
|
||||
/** |
|
||||
* @type {Array<SStoreDefinition>} |
|
||||
*/ |
|
||||
stylings; |
|
||||
/** |
|
||||
* @type {Array<SStoreDefinition>} |
|
||||
*/ |
|
||||
functions; |
|
||||
/** |
|
||||
* Predefined components. Usually of a higher (constructed) kind. |
|
||||
* @type {Object} |
|
||||
*/ |
|
||||
components; |
|
||||
/** |
|
||||
* Extensions for/to the Page or the framework in general. |
|
||||
* @type {Object} |
|
||||
*/ |
|
||||
frameworkControls; |
|
||||
/** |
|
||||
* Additional elements for the builder (likely referencing components) |
|
||||
* @type {Object} |
|
||||
*/ |
|
||||
builderElements; |
|
||||
|
|
||||
/** |
|
||||
* Additional helper functions |
|
||||
* @type {{*:Function}} |
|
||||
*/ |
|
||||
helperFun; |
|
||||
|
|
||||
/** |
|
||||
* functions that are supposed to be executed after install, |
|
||||
* to extend it that way. |
|
||||
* @type {Array<Function>} |
|
||||
*/ |
|
||||
funAfterInstall |
|
||||
|
|
||||
/** |
|
||||
* defines how jpc-like-websites is to be extended and executes that extension |
|
||||
*/ |
|
||||
install() { |
|
||||
if (this.helperFun) { |
|
||||
helperFun.extensions = Object.assign(helperFun.extensions, this.helperFun); |
|
||||
} |
|
||||
|
|
||||
if (this.builderElements) { |
|
||||
builder.extensions = Object.assign(builder.extensions, this.builderElements); |
|
||||
} |
|
||||
|
|
||||
if (this.frameworkControls) { |
|
||||
Page.extensions = Object.assign(Page.extensions, this.frameworkControls); |
|
||||
} |
|
||||
|
|
||||
if (this.stylings) { |
|
||||
for (const key of Object.keys(this.stylings)) { |
|
||||
Page.registerStyling(key, this.stylings[key]); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
if (this.funAfterInstall) { |
|
||||
for (const fun of this.funAfterInstall) { |
|
||||
fun(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
Loading…
Reference in new issue