mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
39 lines
1.0 KiB
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
|
|
|
|
import { UserReportConfig } from './../configurations';
|
|
import { ResourceLoaderService } from './../services/resource-loader.service';
|
|
|
|
@Component({
|
|
selector: 'sqx-user-report',
|
|
template: ''
|
|
})
|
|
export class UserReportComponent implements OnDestroy, OnInit {
|
|
private loadingTimer: any;
|
|
|
|
constructor(config: UserReportConfig, changeDetector: ChangeDetectorRef,
|
|
private readonly resourceLoader: ResourceLoaderService
|
|
) {
|
|
changeDetector.detach();
|
|
|
|
window['_urq'] = window['_urq'] || [];
|
|
window['_urq'].push(['initSite', config.siteId]);
|
|
}
|
|
|
|
public ngOnDestroy() {
|
|
clearTimeout(this.loadingTimer);
|
|
}
|
|
|
|
public ngOnInit() {
|
|
this.loadingTimer =
|
|
setTimeout(() => {
|
|
this.resourceLoader.loadScript('https://cdn.userreport.com/userreport.js');
|
|
}, 4000);
|
|
}
|
|
}
|