Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
2b9c9225a5 | |||
5ce55190fe | |||
8fb071f57b | |||
3278ef7425 | |||
11282daa38 | |||
1fe7dd8d06 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/websetup",
|
"name": "@pushrocks/websetup",
|
||||||
"version": "3.0.12",
|
"version": "3.0.15",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/websetup",
|
"name": "@pushrocks/websetup",
|
||||||
"version": "3.0.12",
|
"version": "3.0.15",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "setup basic page properties",
|
"description": "setup basic page properties",
|
||||||
"main": "dist_ts/index.js",
|
"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.metatag';
|
||||||
export * from './websetup.classes.tag.opengraphtag';
|
export * from './websetup.classes.tag.opengraphtag';
|
||||||
export * from './websetup.classes.tag.jsonldtag';
|
export * from './websetup.classes.tag.jsonldtag';
|
||||||
|
export * from './websetup.classes.title';
|
||||||
|
@ -9,7 +9,7 @@ export interface IMetaObject {
|
|||||||
|
|
||||||
// handles
|
// handles
|
||||||
twitterHandle?: string;
|
twitterHandle?: string;
|
||||||
facebookhandle?: string;
|
facebookHandle?: string;
|
||||||
|
|
||||||
// links
|
// links
|
||||||
companyWebsiteLink?: string;
|
companyWebsiteLink?: string;
|
||||||
|
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 {
|
export interface IWebSetupConstructorOptions {
|
||||||
metaObject: interfaces.IMetaObject;
|
metaObject: interfaces.IMetaObject;
|
||||||
|
smartssrWaitForReadySignal?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -13,12 +14,21 @@ export interface IWebSetupConstructorOptions {
|
|||||||
export class WebSetup {
|
export class WebSetup {
|
||||||
public tagManager: TagManager = new TagManager();
|
public tagManager: TagManager = new TagManager();
|
||||||
public options: IWebSetupConstructorOptions;
|
public options: IWebSetupConstructorOptions;
|
||||||
|
|
||||||
|
// private deferreds
|
||||||
private readyDeferred = plugins.smartpromise.defer();
|
private readyDeferred = plugins.smartpromise.defer();
|
||||||
|
private readyForSmartssrDeferred = plugins.smartpromise.defer();
|
||||||
|
|
||||||
|
// public promises
|
||||||
public readyPromise = this.readyDeferred.promise;
|
public readyPromise = this.readyDeferred.promise;
|
||||||
|
public readyForSmartssrPromise = this.readyForSmartssrDeferred.promise;
|
||||||
constructor(optionsArg: IWebSetupConstructorOptions) {
|
constructor(optionsArg: IWebSetupConstructorOptions) {
|
||||||
this.options = optionsArg;
|
this.options = optionsArg;
|
||||||
this.setup().then(() => {
|
this.setup().then(() => {
|
||||||
this.readyDeferred.resolve();
|
this.readyDeferred.resolve();
|
||||||
|
if (!this.options.smartssrWaitForReadySignal) {
|
||||||
|
this.readyForSmartssrDeferred.resolve();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,5 +58,19 @@ export class WebSetup {
|
|||||||
return subLevel;
|
return subLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* flashes the title with the given text
|
||||||
|
* @param flashTextArg
|
||||||
|
*/
|
||||||
public flashTitle(flashTextArg: string) {}
|
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