Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
f2bd7145b3 | |||
6d9789df45 | |||
0be8a6f60d | |||
a3793572e7 | |||
6ace59d1d1 | |||
b6ddf6a87b | |||
b999627ba5 | |||
5e8a91f302 | |||
2fc0613fa6 | |||
2283cdb633 | |||
c0db06fc18 | |||
4557000629 | |||
78997e1e5a | |||
4d5564e8d4 | |||
11d89adc4b | |||
a99fd6374c | |||
ba287cdb76 | |||
5318408037 | |||
16ef41ae20 |
@ -3,14 +3,14 @@ image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
|||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .npmci_cache/
|
- .npmci_cache/
|
||||||
key: "$CI_BUILD_STAGE"
|
key: '$CI_BUILD_STAGE'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- security
|
- security
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- metadata
|
- metadata
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
@ -18,60 +18,65 @@ stages:
|
|||||||
mirror:
|
mirror:
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci git mirror
|
- npmci git mirror
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
snyk:
|
snyk:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:snyk
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install -g snyk
|
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --ignore-scripts
|
||||||
- npmci command snyk test
|
- npmci command snyk test
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
|
|
||||||
testLTS:
|
testStable:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci npm test
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
testBuild:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command npm run build
|
- npmci command npm run build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci npm publish
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# metadata stage
|
# metadata stage
|
||||||
@ -81,31 +86,35 @@ codequality:
|
|||||||
allow_failure: true
|
allow_failure: true
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g tslint typescript
|
- npmci command npm install -g tslint typescript
|
||||||
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- priv
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci trigger
|
- npmci trigger
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmci
|
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
|
- npmci node install lts
|
||||||
- npmci command npm install -g @gitzone/tsdoc
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command tsdoc
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
only:
|
only:
|
||||||
@ -113,5 +122,5 @@ pages:
|
|||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
29
.vscode/launch.json
vendored
Normal file
29
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "current file",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [
|
||||||
|
"${relativeFile}"
|
||||||
|
],
|
||||||
|
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"protocol": "inspector",
|
||||||
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "test.ts",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [
|
||||||
|
"test/test.ts"
|
||||||
|
],
|
||||||
|
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"protocol": "inspector",
|
||||||
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": ["/npmextra.json"],
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"npmci": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for npmci"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for gitzone",
|
||||||
|
"properties": {
|
||||||
|
"projectType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["website", "element", "service", "npm"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
2
dist_bundle/bundle.js
Normal file
2
dist_bundle/bundle.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
var tsbundle=function(t){"use strict";const e=async(t,e)=>{const n=document.createElement("meta");n.name=t,n.content=e,document.getElementsByTagName("head")[0].appendChild(n)},n=async(t,e)=>{const n=document.querySelector("link[rel='canonical']")?document.querySelector("link[rel='canonical']"):document.createElement("link");return n.setAttribute("rel",t),n.setAttribute("href",e),document.head.appendChild(n),n},a=async(t,e)=>{const n=document.createElement("meta");return n.setAttribute("property",t),n.content=e,document.getElementsByTagName("head")[0].appendChild(n),n},o=async t=>{const e=[],n={"@context":"https://schema.org","@type":"Corporation",name:t.name,alternateName:t.name.replace(" GmbH",""),url:t.contact.website,logo:t.contact.logoUrl,contactPoint:{"@type":"ContactPoint",telephone:t.contact.phone,contactType:"customer service",areaServed:"DE",availableLanguage:["en","German"]},sameAs:[]};t.contact.facebookUrl&&n.sameAs.push(t.contact.facebookUrl),t.contact.twitterUrl&&n.sameAs.push(t.contact.twitterUrl);const o=document.createElement("script");return o.type="application/ld+json",o.text=JSON.stringify(n),document.querySelector("head").appendChild(o),e.push(o),e.push(await a("og:type","business.business")),e.push(await a("og:title",t.name)),e.push(await a("og:url",t.contact.website)),e.push(await a("og:image",t.contact.logoUrl)),e.push(await a("business:contact_data:street_address",`${t.contact.address.streetName} ${t.contact.address.houseNumber}`)),e.push(await a("business:contact_data:locality",t.contact.address.postalCode)),e.push(await a("business:contact_data:region",t.contact.address.city)),e.push(await a("business:contact_data:postal_code",t.contact.address.postalCode)),e.push(await a("business:contact_data:country_name",t.contact.address.country)),e};return t.WebSetup=class{constructor(t){this.options=t}async setup(){await(async t=>{document.title=t.title,e("description",t.description),e("google","notranslate"),e("revisit-after","1 days"),t.canonicalDomain&&n("canonical",t.canonicalDomain),t.ldCompany&&o(t.ldCompany)})(this.options.metaObject),this.options.googleAnalyticsCode&&await(async t=>{var e,n,a,o,s,c;e=window,n=document,a="script",o="analytics",e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=(new Date).getTime(),s=n.createElement(a),c=n.getElementsByTagName(a)[0],s.async=1,s.src="//www.google-analytics.com/analytics.js",s.crossorigin="anonymous",c.parentNode.insertBefore(s,c),window.analytics("create",t,"auto"),window.analytics("send","pageview"),console.log("Loaded Google Analytics. You may view our privacy policy at https://lossless.gmbh")})(this.options.googleAnalyticsCode),this.options.fsCode&&await(async t=>{var e,n,a,o,s,c,i,r;window._fs_debug=!1,window._fs_host="fullstory.com",window._fs_org=t,window._fs_namespace="FS",e=window,n=document,a=window._fs_namespace,o="script",s="user",a in e?e.console&&e.console.log&&e.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].'):((i=e[a]=function(t,e,n){i.q?i.q.push([t,e,n]):i._api(t,e,n)}).q=[],(c=n.createElement(o)).async=1,c.src="https://"+window._fs_host+"/s/fs.js",c.crossorigin="anonymous",(r=n.getElementsByTagName(o)[0]).parentNode.insertBefore(c,r),i.identify=function(t,e,n){i(s,{uid:t},n),e&&i(s,e,n)},i.setUserVars=function(t,e){i(s,t,e)},i.event=function(t,e,n){i("event",{n:t,p:e},n)},i.shutdown=function(){i("rec",!1)},i.restart=function(){i("rec",!0)},i.consent=function(t){i("consent",!arguments.length||t)},i.identifyAccount=function(t,e){c="account",(e=e||{}).acctId=t,i(c,e)},i.clearUserCookie=function(){})})(this.options.fsCode)}},t}({});
|
||||||
|
//# sourceMappingURL=bundle.js.map
|
1
dist_bundle/bundle.js.map
Normal file
1
dist_bundle/bundle.js.map
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"bundle.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@ -4,6 +4,7 @@
|
|||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
},
|
},
|
||||||
"gitzone": {
|
"gitzone": {
|
||||||
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "pushrocks",
|
"gitscope": "pushrocks",
|
||||||
|
2985
package-lock.json
generated
2985
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
31
package.json
31
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/websetup",
|
"name": "@pushrocks/websetup",
|
||||||
"version": "2.0.2",
|
"version": "2.0.12",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "setup basic page properties",
|
"description": "setup basic page properties",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -9,27 +9,32 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"build": "(tsbuild --web)",
|
"build": "(tsbuild --web && npm run bundle)",
|
||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)",
|
||||||
|
"bundle": "tsbundle --production --from ./ts/index.ts --to ./dist_bundle/bundle.js"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"lossless",
|
"lossless",
|
||||||
"websafe"
|
"websafe"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.1.17",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tsbundle": "^1.0.50",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@gitzone/tstest": "^1.0.28",
|
||||||
"tslint": "^5.11.0",
|
"@pushrocks/tapbundle": "^3.2.0",
|
||||||
|
"tslint": "^6.0.0",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {
|
||||||
|
"@tsclass/tsclass": "^3.0.12"
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/*",
|
"ts/**/*",
|
||||||
"ts_web/*",
|
"ts_web/**/*",
|
||||||
"dist/*",
|
"dist/**/*",
|
||||||
"dist_web/*",
|
"dist_web/**/*",
|
||||||
"assets/*",
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
11
readme.md
11
readme.md
@ -8,7 +8,7 @@ setup basic page properties
|
|||||||
* [docs (typedoc)](https://pushrocks.gitlab.io/websetup/)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/websetup/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/pushrocks/websetup/commits/master)
|
[](https://gitlab.com/pushrocks/websetup/commits/master)
|
||||||
[](https://gitlab.com/pushrocks/websetup/commits/master)
|
[](https://gitlab.com/pushrocks/websetup/commits/master)
|
||||||
[](https://www.npmjs.com/package/@pushrocks/websetup)
|
[](https://www.npmjs.com/package/@pushrocks/websetup)
|
||||||
[](https://snyk.io/test/npm/@pushrocks/websetup)
|
[](https://snyk.io/test/npm/@pushrocks/websetup)
|
||||||
@ -18,9 +18,14 @@ setup basic page properties
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
|
|
||||||
For further information read the linked docs at the top of this readme.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
[](https://maintainedby.lossless.com)
|
[](https://maintainedby.lossless.com)
|
||||||
|
@ -1,18 +1,105 @@
|
|||||||
|
import * as plugins from '../websetup.plugins';
|
||||||
|
|
||||||
export interface IMetaObject {
|
export interface IMetaObject {
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
canonicalDomain?: string;
|
||||||
|
ldCompany?: plugins.tsclass.business.ICompany;
|
||||||
|
ldProduct?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const setupMetaInformation = async (metaObjectArg: IMetaObject) => {
|
export const setupMetaInformation = async (metaObjectArg: IMetaObject) => {
|
||||||
document.title = metaObjectArg.title;
|
document.title = metaObjectArg.title;
|
||||||
addMetaTag('description', metaObjectArg.description);
|
addMetaTag('description', metaObjectArg.description);
|
||||||
addMetaTag('google', 'notranslate');
|
addMetaTag('google', 'notranslate');
|
||||||
addMetaTag('revisited-after', '1 days');
|
addMetaTag('revisit-after', '1 days');
|
||||||
|
metaObjectArg.canonicalDomain ? addLinkTag('canonical', metaObjectArg.canonicalDomain) : null;
|
||||||
|
|
||||||
|
if (metaObjectArg.ldCompany) {
|
||||||
|
addCompanyInfo(metaObjectArg.ldCompany);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const addMetaTag = async (linkNameArg: string, contentArg: string) => {
|
const addMetaTag = async (metaNameArg: string, contentArg: string) => {
|
||||||
const metaElement = document.createElement('meta');
|
const metaElement = document.createElement('meta');
|
||||||
metaElement.name = linkNameArg;
|
metaElement.name = metaNameArg;
|
||||||
metaElement.content = contentArg;
|
metaElement.content = contentArg;
|
||||||
document.getElementsByTagName('head')[0].appendChild(metaElement);
|
document.getElementsByTagName('head')[0].appendChild(metaElement);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const addLinkTag = async (relArg, hrefArg): Promise<Element> => {
|
||||||
|
const link = !!document.querySelector("link[rel='canonical']")
|
||||||
|
? document.querySelector("link[rel='canonical']")
|
||||||
|
: document.createElement('link');
|
||||||
|
link.setAttribute('rel', relArg);
|
||||||
|
link.setAttribute('href', hrefArg);
|
||||||
|
document.head.appendChild(link);
|
||||||
|
return link;
|
||||||
|
};
|
||||||
|
|
||||||
|
const addOpenGraphProperty = async (
|
||||||
|
propertyNameArg: string,
|
||||||
|
contentArg: string
|
||||||
|
): Promise<Element> => {
|
||||||
|
const openGraphElement = document.createElement('meta');
|
||||||
|
openGraphElement.setAttribute('property', propertyNameArg);
|
||||||
|
openGraphElement.content = contentArg;
|
||||||
|
document.getElementsByTagName('head')[0].appendChild(openGraphElement);
|
||||||
|
return openGraphElement;
|
||||||
|
};
|
||||||
|
|
||||||
|
const addCompanyInfo = async (
|
||||||
|
companyDataArg: plugins.tsclass.business.ICompany
|
||||||
|
): Promise<Element[]> => {
|
||||||
|
const returnElementArray: Element[] = [];
|
||||||
|
|
||||||
|
// lets care about linked data
|
||||||
|
const companyLd = {
|
||||||
|
'@context': 'https://schema.org',
|
||||||
|
'@type': 'Corporation',
|
||||||
|
name: companyDataArg.name,
|
||||||
|
alternateName: companyDataArg.name.replace(' GmbH', ''),
|
||||||
|
url: companyDataArg.contact.website,
|
||||||
|
logo: companyDataArg.contact.logoUrl,
|
||||||
|
contactPoint: {
|
||||||
|
'@type': 'ContactPoint',
|
||||||
|
telephone: companyDataArg.contact.phone,
|
||||||
|
contactType: 'customer service',
|
||||||
|
areaServed: 'DE',
|
||||||
|
availableLanguage: ['en', 'German']
|
||||||
|
},
|
||||||
|
sameAs: []
|
||||||
|
};
|
||||||
|
|
||||||
|
if (companyDataArg.contact.facebookUrl) {
|
||||||
|
companyLd.sameAs.push(companyDataArg.contact.facebookUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (companyDataArg.contact.twitterUrl) {
|
||||||
|
companyLd.sameAs.push(companyDataArg.contact.twitterUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
const jsonLdElement = document.createElement('script');
|
||||||
|
jsonLdElement.type = 'application/ld+json';
|
||||||
|
jsonLdElement.text = JSON.stringify(companyLd);
|
||||||
|
document.querySelector('head').appendChild(jsonLdElement);
|
||||||
|
returnElementArray.push(jsonLdElement);
|
||||||
|
|
||||||
|
// lets care about open graph
|
||||||
|
returnElementArray.push(await addOpenGraphProperty('og:type', 'business.business'));
|
||||||
|
returnElementArray.push(await addOpenGraphProperty('og:title', companyDataArg.name));
|
||||||
|
returnElementArray.push(await addOpenGraphProperty('og:url', companyDataArg.contact.website));
|
||||||
|
returnElementArray.push(await addOpenGraphProperty('og:image', companyDataArg.contact.logoUrl));
|
||||||
|
returnElementArray.push(
|
||||||
|
await addOpenGraphProperty(
|
||||||
|
'business:contact_data:street_address',
|
||||||
|
`${companyDataArg.contact.address.streetName} ${companyDataArg.contact.address.houseNumber}`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
returnElementArray.push(await addOpenGraphProperty('business:contact_data:locality', companyDataArg.contact.address.postalCode));
|
||||||
|
returnElementArray.push(await addOpenGraphProperty('business:contact_data:region', companyDataArg.contact.address.city));
|
||||||
|
returnElementArray.push(await addOpenGraphProperty('business:contact_data:postal_code', companyDataArg.contact.address.postalCode));
|
||||||
|
returnElementArray.push(await addOpenGraphProperty('business:contact_data:country_name', companyDataArg.contact.address.country));
|
||||||
|
|
||||||
|
return returnElementArray;
|
||||||
|
};
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
declare global {
|
declare global {
|
||||||
// tslint:disable-next-line: interface-name
|
// tslint:disable-next-line: interface-name
|
||||||
interface Window {
|
interface Window {
|
||||||
|
_fs_debug: boolean;
|
||||||
_fs_host: any;
|
_fs_host: any;
|
||||||
|
_fs_org: string;
|
||||||
|
_fs_namespace: string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export const setupFullStory = async (fsCodeArg: string) => {
|
export const setupFullStory = async (fsCodeArg: string) => {
|
||||||
@ -13,7 +16,7 @@ export const setupFullStory = async (fsCodeArg: string) => {
|
|||||||
window['_fs_org'] = fsCodeArg;
|
window['_fs_org'] = fsCodeArg;
|
||||||
// tslint:disable-next-line: no-string-literal
|
// tslint:disable-next-line: no-string-literal
|
||||||
window['_fs_namespace'] = 'FS';
|
window['_fs_namespace'] = 'FS';
|
||||||
(function(m, n, e, t, l, o, g, y) {
|
((m, n, e, t, l, o, g, y) => {
|
||||||
if (e in m) {
|
if (e in m) {
|
||||||
if (m.console && m.console.log) {
|
if (m.console && m.console.log) {
|
||||||
m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');
|
m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');
|
||||||
@ -28,6 +31,7 @@ export const setupFullStory = async (fsCodeArg: string) => {
|
|||||||
o = n.createElement(t);
|
o = n.createElement(t);
|
||||||
o.async = 1;
|
o.async = 1;
|
||||||
o.src = 'https://' + window._fs_host + '/s/fs.js';
|
o.src = 'https://' + window._fs_host + '/s/fs.js';
|
||||||
|
o.crossorigin = 'anonymous';
|
||||||
y = n.getElementsByTagName(t)[0];
|
y = n.getElementsByTagName(t)[0];
|
||||||
y.parentNode.insertBefore(o, y);
|
y.parentNode.insertBefore(o, y);
|
||||||
// tslint:disable-next-line: only-arrow-functions
|
// tslint:disable-next-line: only-arrow-functions
|
||||||
|
@ -22,6 +22,7 @@ export const setupGoogleAnalytics = async (gaCode: string) => {
|
|||||||
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
|
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
|
||||||
a.async = 1;
|
a.async = 1;
|
||||||
a.src = g;
|
a.src = g;
|
||||||
|
a.crossorigin = 'anonymous';
|
||||||
m.parentNode.insertBefore(a, m);
|
m.parentNode.insertBefore(a, m);
|
||||||
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'analytics');
|
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'analytics');
|
||||||
|
|
||||||
|
@ -1,2 +1,5 @@
|
|||||||
const removeme = {};
|
import * as tsclass from '@tsclass/tsclass';
|
||||||
export { removeme };
|
|
||||||
|
export {
|
||||||
|
tsclass
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user