Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
d1c0501461 | |||
f5d33bdebe | |||
2b9c9225a5 | |||
5ce55190fe | |||
8fb071f57b | |||
3278ef7425 | |||
11282daa38 | |||
1fe7dd8d06 |
22866
package-lock.json
generated
22866
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/websetup",
|
"name": "@pushrocks/websetup",
|
||||||
"version": "3.0.12",
|
"version": "3.0.16",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "setup basic page properties",
|
"description": "setup basic page properties",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -16,17 +16,17 @@
|
|||||||
"websafe"
|
"websafe"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.25",
|
"@gitzone/tsbuild": "^2.1.28",
|
||||||
"@gitzone/tsbundle": "^1.0.78",
|
"@gitzone/tsbundle": "^1.0.88",
|
||||||
"@gitzone/tstest": "^1.0.52",
|
"@gitzone/tstest": "^1.0.60",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^3.2.15",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartpromise": "^3.1.3",
|
"@pushrocks/smartpromise": "^3.1.6",
|
||||||
"@tsclass/tsclass": "^3.0.29"
|
"@tsclass/tsclass": "^3.0.37"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, tap, webhelpers } from '@pushrocks/tapbundle';
|
||||||
|
webhelpers.enable();
|
||||||
|
|
||||||
import * as websetup from '../ts/index';
|
import * as websetup from '../ts/index';
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
tap.test('first test', async () => {
|
||||||
|
@ -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