Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
2b9c9225a5 | |||
5ce55190fe | |||
8fb071f57b | |||
3278ef7425 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/websetup",
|
||||
"version": "3.0.13",
|
||||
"version": "3.0.15",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/websetup",
|
||||
"version": "3.0.13",
|
||||
"version": "3.0.15",
|
||||
"private": false,
|
||||
"description": "setup basic page properties",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -2,3 +2,4 @@ export * from './websetup.classes.websetup';
|
||||
export * from './websetup.classes.tag.metatag';
|
||||
export * from './websetup.classes.tag.opengraphtag';
|
||||
export * from './websetup.classes.tag.jsonldtag';
|
||||
export * from './websetup.classes.title';
|
||||
|
9
ts/websetup.classes.title.ts
Normal file
9
ts/websetup.classes.title.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import * as plugins from './websetup.plugins';
|
||||
|
||||
/**
|
||||
* a title proxy class
|
||||
* --> to be used in the future when flashing titles is supported
|
||||
*/
|
||||
export class Title {
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ import { TagLevel } from './websetup.classes.taglevel';
|
||||
|
||||
export interface IWebSetupConstructorOptions {
|
||||
metaObject: interfaces.IMetaObject;
|
||||
smartssrWaitForReadySignal?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -13,12 +14,21 @@ export interface IWebSetupConstructorOptions {
|
||||
export class WebSetup {
|
||||
public tagManager: TagManager = new TagManager();
|
||||
public options: IWebSetupConstructorOptions;
|
||||
|
||||
// private deferreds
|
||||
private readyDeferred = plugins.smartpromise.defer();
|
||||
private readyForSmartssrDeferred = plugins.smartpromise.defer();
|
||||
|
||||
// public promises
|
||||
public readyPromise = this.readyDeferred.promise;
|
||||
public readyForSmartssrPromise = this.readyForSmartssrDeferred.promise;
|
||||
constructor(optionsArg: IWebSetupConstructorOptions) {
|
||||
this.options = optionsArg;
|
||||
this.setup().then(() => {
|
||||
this.readyDeferred.resolve();
|
||||
if (!this.options.smartssrWaitForReadySignal) {
|
||||
this.readyForSmartssrDeferred.resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -48,5 +58,19 @@ export class WebSetup {
|
||||
return subLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* flashes the title with the given text
|
||||
* @param flashTextArg
|
||||
*/
|
||||
public flashTitle(flashTextArg: string) {}
|
||||
|
||||
/**
|
||||
* informs smartssr that the page is ready to be rendered
|
||||
*/
|
||||
public informReadyForSmartssr() {
|
||||
if (!this.options.smartssrWaitForReadySignal) {
|
||||
console.error(`You have not indicated that you inform smartssr by a dedicated signal! Please consider doing so!`);
|
||||
}
|
||||
this.readyForSmartssrDeferred.resolve();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user