Compare commits

..

8 Commits

Author SHA1 Message Date
d1c0501461 3.0.16 2021-12-10 18:03:47 +01:00
f5d33bdebe fix(core): update 2021-12-10 18:03:46 +01:00
2b9c9225a5 3.0.15 2020-12-08 22:31:35 +00:00
5ce55190fe fix(core): update 2020-12-08 22:31:35 +00:00
8fb071f57b 3.0.14 2020-12-08 22:29:20 +00:00
3278ef7425 fix(core): update 2020-12-08 22:29:19 +00:00
11282daa38 3.0.13 2020-12-07 23:11:14 +00:00
1fe7dd8d06 fix(core): update 2020-12-07 23:11:13 +00:00
7 changed files with 19370 additions and 3552 deletions

22866
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/websetup",
"version": "3.0.12",
"version": "3.0.16",
"private": false,
"description": "setup basic page properties",
"main": "dist_ts/index.js",
@ -16,17 +16,17 @@
"websafe"
],
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tsbundle": "^1.0.78",
"@gitzone/tstest": "^1.0.52",
"@pushrocks/tapbundle": "^3.2.9",
"@gitzone/tsbuild": "^2.1.28",
"@gitzone/tsbundle": "^1.0.88",
"@gitzone/tstest": "^1.0.60",
"@pushrocks/tapbundle": "^3.2.15",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {
"@pushrocks/smartdelay": "^2.0.10",
"@pushrocks/smartpromise": "^3.1.3",
"@tsclass/tsclass": "^3.0.29"
"@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartpromise": "^3.1.6",
"@tsclass/tsclass": "^3.0.37"
},
"files": [
"ts/**/*",

View File

@ -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';
tap.test('first test', async () => {

View File

@ -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';

View File

@ -9,7 +9,7 @@ export interface IMetaObject {
// handles
twitterHandle?: string;
facebookhandle?: string;
facebookHandle?: string;
// links
companyWebsiteLink?: string;

View 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 {
}

View File

@ -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();
}
}