angular-mailru-counter 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,169 @@
1
+ import { __decorate, __param } from 'tslib';
2
+ import { isPlatformBrowser, DOCUMENT, CommonModule } from '@angular/common';
3
+ import { Inject, PLATFORM_ID, RendererFactory2, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule } from '@angular/core';
4
+
5
+ let AngularMailRuCounterService = class AngularMailRuCounterService {
6
+ constructor(config, documentRef, platformId, rendererFactory) {
7
+ this.config = config;
8
+ this.documentRef = documentRef;
9
+ this.platformId = platformId;
10
+ this.rendererFactory = rendererFactory;
11
+ this.doc = this.documentRef;
12
+ this.renderer = this.rendererFactory.createRenderer(null, null);
13
+ }
14
+ /**
15
+ * Initialize Mail.ru Counter tracking script
16
+ * - Adds the script to page's head
17
+ * - Tracks first page view
18
+ */
19
+ initialize(counterId = this.config.counterId) {
20
+ if (this.isLoaded()) {
21
+ console.warn('Tried to initialize a Mail.Ru Counter instance while another is already active. Please call `remove()` before initializing a new instance.');
22
+ return;
23
+ }
24
+ this.config.enabled = true;
25
+ this.addMailRuCounterScript(counterId);
26
+ }
27
+ /** Remove the Mail.ru Counter tracking script */
28
+ remove() {
29
+ this.removeMailRuCounterScript();
30
+ this.config.enabled = false;
31
+ }
32
+ /**
33
+ * Track a goal
34
+ *
35
+ * See {@link https://target.my.com/help/advertisers/sourcetopmailru/en#goals MyTarget docs - Set goals for the counter}
36
+ * @param goal The name of the goal that is being tracked
37
+ * @param value A fixed number attached to a specific goal
38
+ */
39
+ trackGoal(goal, value) {
40
+ if (!isPlatformBrowser(this.platformId)) {
41
+ return;
42
+ }
43
+ if (!this.isLoaded()) {
44
+ console.warn('Tried to track an event without initializing a Mail.Ru Counter instance. Call `initialize()` first.');
45
+ return;
46
+ }
47
+ _tmr.push(Object.assign({ type: 'reachGoal', id: this.config.counterId, goal }, (value && Number.isInteger(value) && { value })));
48
+ }
49
+ /**
50
+ * Adds Mail.ru Counter tracking script to the application
51
+ * @param counterId Mail.ru Counter ID to use
52
+ */
53
+ addMailRuCounterScript(counterId) {
54
+ if (!isPlatformBrowser(this.platformId)) {
55
+ return;
56
+ }
57
+ const counterCode = `
58
+ var _tmr = window._tmr || (window._tmr = []);
59
+ _tmr.push({id: "${counterId}", type: "pageView", start: (new Date()).getTime()});
60
+ (function (d, w, id) {
61
+ if (d.getElementById(id)) return;
62
+ var ts = d.createElement("script"); ts.type = "text/javascript"; ts.async = true; ts.id = id;
63
+ ts.src = "https://top-fwz1.mail.ru/js/code.js";
64
+ var f = function () {var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ts, s);};
65
+ if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); }
66
+ })(document, window, "topmailru-code");`;
67
+ const scriptElement = this.renderer.createElement('script');
68
+ this.renderer.setAttribute(scriptElement, 'id', 'mail-ru-counter-script');
69
+ this.renderer.setAttribute(scriptElement, 'type', 'text/javascript');
70
+ this.renderer.setProperty(scriptElement, 'innerHTML', counterCode);
71
+ this.renderer.appendChild(this.doc.head, scriptElement);
72
+ }
73
+ /** Remove Mail.ru Counter tracking script from the application */
74
+ removeMailRuCounterScript() {
75
+ if (!isPlatformBrowser(this.platformId)) {
76
+ return;
77
+ }
78
+ const mailRuCounterElement = this.doc.getElementById('mail-ru-counter-script');
79
+ if (mailRuCounterElement) {
80
+ mailRuCounterElement.remove();
81
+ }
82
+ }
83
+ /** Checks if the script element is present */
84
+ isLoaded() {
85
+ if (isPlatformBrowser(this.platformId)) {
86
+ const mailRuCounterElement = this.doc.getElementById('mail-ru-counter-script');
87
+ return !!mailRuCounterElement;
88
+ }
89
+ return false;
90
+ }
91
+ };
92
+ AngularMailRuCounterService.ctorParameters = () => [
93
+ { type: undefined, decorators: [{ type: Inject, args: ['config',] }] },
94
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
95
+ { type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
96
+ { type: RendererFactory2 }
97
+ ];
98
+ AngularMailRuCounterService.ɵprov = ɵɵdefineInjectable({ factory: function AngularMailRuCounterService_Factory() { return new AngularMailRuCounterService(ɵɵinject("config"), ɵɵinject(DOCUMENT), ɵɵinject(PLATFORM_ID), ɵɵinject(RendererFactory2)); }, token: AngularMailRuCounterService, providedIn: "root" });
99
+ AngularMailRuCounterService = __decorate([
100
+ Injectable({
101
+ providedIn: 'root',
102
+ }),
103
+ __param(0, Inject('config')),
104
+ __param(1, Inject(DOCUMENT)),
105
+ __param(2, Inject(PLATFORM_ID))
106
+ ], AngularMailRuCounterService);
107
+
108
+ var AngularMailRuCounterModule_1;
109
+ let AngularMailRuCounterModule = AngularMailRuCounterModule_1 = class AngularMailRuCounterModule {
110
+ constructor(angularMailRuCounter, platformId) {
111
+ this.angularMailRuCounter = angularMailRuCounter;
112
+ if (!AngularMailRuCounterModule_1.config) {
113
+ throw Error('angular-mailru-counter not configured correctly. Pass the `counterId` property to the `forRoot()` function');
114
+ }
115
+ if (AngularMailRuCounterModule_1.config.enabled && isPlatformBrowser(platformId)) {
116
+ this.angularMailRuCounter.initialize();
117
+ }
118
+ }
119
+ /**
120
+ * Initialize the Angular Mail.ru Counter Module
121
+ *
122
+ * Add your Mail.ru Counter ID as parameter
123
+ */
124
+ static forRoot(config) {
125
+ this.config = config;
126
+ const counterId = config.counterId;
127
+ this.verifyCounterId(counterId);
128
+ return {
129
+ ngModule: AngularMailRuCounterModule_1,
130
+ providers: [
131
+ AngularMailRuCounterService,
132
+ { provide: 'config', useValue: config },
133
+ ],
134
+ };
135
+ }
136
+ /**
137
+ * Verifies the Counter ID that was passed into the configuration.
138
+ * - Checks if Counter was initialized
139
+ * @param counterId Counter ID to verify
140
+ */
141
+ static verifyCounterId(counterId) {
142
+ if (counterId === null || counterId === undefined || counterId.length === 0) {
143
+ throw Error('Invalid Mail.ru Counter ID. Did you pass the ID into the forRoot() function?');
144
+ }
145
+ }
146
+ };
147
+ AngularMailRuCounterModule.config = null;
148
+ AngularMailRuCounterModule.ctorParameters = () => [
149
+ { type: AngularMailRuCounterService },
150
+ { type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
151
+ ];
152
+ AngularMailRuCounterModule = AngularMailRuCounterModule_1 = __decorate([
153
+ NgModule({
154
+ declarations: [],
155
+ imports: [CommonModule],
156
+ }),
157
+ __param(1, Inject(PLATFORM_ID))
158
+ ], AngularMailRuCounterModule);
159
+
160
+ /**
161
+ * Public API Surface of angular-mailru-counter
162
+ */
163
+
164
+ /**
165
+ * Generated bundle index. Do not edit.
166
+ */
167
+
168
+ export { AngularMailRuCounterModule, AngularMailRuCounterService };
169
+ //# sourceMappingURL=angular-mailru-counter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-mailru-counter.js","sources":["ng://angular-mailru-counter/lib/angular-mail-ru-counter.service.ts","ng://angular-mailru-counter/lib/angular-mail-ru-counter.module.ts","ng://angular-mailru-counter/public-api.ts","ng://angular-mailru-counter/angular-mailru-counter.ts"],"sourcesContent":["import {DOCUMENT, isPlatformBrowser} from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n Renderer2,\n RendererFactory2,\n} from '@angular/core';\nimport {AngularMailRuCounterConfiguration} from './angular-mail-ru-counter.models';\n\ndeclare const _tmr: any;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AngularMailRuCounterService {\n private renderer: Renderer2;\n private doc: Document;\n\n constructor(\n @Inject('config') private config: AngularMailRuCounterConfiguration,\n @Inject(DOCUMENT) private documentRef: any,\n @Inject(PLATFORM_ID) private platformId: Object,\n private rendererFactory: RendererFactory2,\n ) {\n this.doc = this.documentRef as Document;\n this.renderer = this.rendererFactory.createRenderer(null, null);\n }\n\n /**\n * Initialize Mail.ru Counter tracking script\n * - Adds the script to page's head\n * - Tracks first page view\n */\n initialize(counterId: string = this.config.counterId): void {\n if (this.isLoaded()) {\n console.warn(\n 'Tried to initialize a Mail.Ru Counter instance while another is already active. Please call `remove()` before initializing a new instance.',\n );\n\n return;\n }\n\n this.config.enabled = true;\n this.addMailRuCounterScript(counterId);\n }\n\n /** Remove the Mail.ru Counter tracking script */\n remove(): void {\n this.removeMailRuCounterScript();\n this.config.enabled = false;\n }\n\n /**\n * Track a goal\n *\n * See {@link https://target.my.com/help/advertisers/sourcetopmailru/en#goals MyTarget docs - Set goals for the counter}\n * @param goal The name of the goal that is being tracked\n * @param value A fixed number attached to a specific goal\n */\n trackGoal(goal: string, value?: number): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n if (!this.isLoaded()) {\n console.warn(\n 'Tried to track an event without initializing a Mail.Ru Counter instance. Call `initialize()` first.',\n );\n\n return;\n }\n\n _tmr.push({\n type: 'reachGoal',\n id: this.config.counterId,\n goal,\n ...(value && Number.isInteger(value) && {value}),\n });\n }\n\n /**\n * Adds Mail.ru Counter tracking script to the application\n * @param counterId Mail.ru Counter ID to use\n */\n private addMailRuCounterScript(counterId: string): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n const counterCode = `\n var _tmr = window._tmr || (window._tmr = []);\n _tmr.push({id: \"${counterId}\", type: \"pageView\", start: (new Date()).getTime()});\n (function (d, w, id) {\n if (d.getElementById(id)) return;\n var ts = d.createElement(\"script\"); ts.type = \"text/javascript\"; ts.async = true; ts.id = id;\n ts.src = \"https://top-fwz1.mail.ru/js/code.js\";\n var f = function () {var s = d.getElementsByTagName(\"script\")[0]; s.parentNode.insertBefore(ts, s);};\n if (w.opera == \"[object Opera]\") { d.addEventListener(\"DOMContentLoaded\", f, false); } else { f(); }\n })(document, window, \"topmailru-code\");`;\n\n const scriptElement = this.renderer.createElement('script');\n\n this.renderer.setAttribute(scriptElement, 'id', 'mail-ru-counter-script');\n this.renderer.setAttribute(scriptElement, 'type', 'text/javascript');\n this.renderer.setProperty(scriptElement, 'innerHTML', counterCode);\n this.renderer.appendChild(this.doc.head, scriptElement);\n }\n\n /** Remove Mail.ru Counter tracking script from the application */\n private removeMailRuCounterScript(): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n const mailRuCounterElement = this.doc.getElementById('mail-ru-counter-script');\n\n if (mailRuCounterElement) {\n mailRuCounterElement.remove();\n }\n }\n\n /** Checks if the script element is present */\n private isLoaded(): boolean {\n if (isPlatformBrowser(this.platformId)) {\n const mailRuCounterElement = this.doc.getElementById(\n 'mail-ru-counter-script',\n );\n\n return !!mailRuCounterElement;\n }\n\n return false;\n }\n}\n","import {CommonModule, isPlatformBrowser} from '@angular/common';\nimport {Inject, ModuleWithProviders, NgModule, PLATFORM_ID} from '@angular/core';\nimport {AngularMailRuCounterConfiguration} from './angular-mail-ru-counter.models';\nimport {AngularMailRuCounterService} from './angular-mail-ru-counter.service';\n\n@NgModule({\n declarations: [],\n imports: [CommonModule],\n})\nexport class AngularMailRuCounterModule {\n private static config: AngularMailRuCounterConfiguration | null = null;\n\n constructor(\n private angularMailRuCounter: AngularMailRuCounterService,\n @Inject(PLATFORM_ID) platformId: Object,\n ) {\n if (!AngularMailRuCounterModule.config) {\n throw Error(\n 'angular-mailru-counter not configured correctly. Pass the `counterId` property to the `forRoot()` function',\n );\n }\n\n if (AngularMailRuCounterModule.config.enabled && isPlatformBrowser(platformId)) {\n this.angularMailRuCounter.initialize();\n }\n }\n\n /**\n * Initialize the Angular Mail.ru Counter Module\n *\n * Add your Mail.ru Counter ID as parameter\n */\n static forRoot(\n config: AngularMailRuCounterConfiguration,\n ): ModuleWithProviders<AngularMailRuCounterModule> {\n this.config = config;\n\n const counterId = config.counterId;\n\n this.verifyCounterId(counterId);\n\n return {\n ngModule: AngularMailRuCounterModule,\n providers: [\n AngularMailRuCounterService,\n {provide: 'config', useValue: config},\n ],\n };\n }\n\n /**\n * Verifies the Counter ID that was passed into the configuration.\n * - Checks if Counter was initialized\n * @param counterId Counter ID to verify\n */\n private static verifyCounterId(counterId: string): void {\n if (counterId === null || counterId === undefined || counterId.length === 0) {\n throw Error(\n 'Invalid Mail.ru Counter ID. Did you pass the ID into the forRoot() function?',\n );\n }\n }\n}\n","/**\n * Public API Surface of angular-mailru-counter\n */\n\nexport * from './lib/angular-mail-ru-counter.service';\nexport * from './lib/angular-mail-ru-counter.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {AngularMailRuCounterConfiguration as ɵa} from './lib/angular-mail-ru-counter.models';"],"names":[],"mappings":";;;;IAea,2BAA2B,GAAxC,MAAa,2BAA2B;IAIpC,YAC8B,MAAyC,EACzC,WAAgB,EACb,UAAkB,EACvC,eAAiC;QAHf,WAAM,GAAN,MAAM,CAAmC;QACzC,gBAAW,GAAX,WAAW,CAAK;QACb,eAAU,GAAV,UAAU,CAAQ;QACvC,oBAAe,GAAf,eAAe,CAAkB;QAEzC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,WAAuB,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KACnE;;;;;;IAOD,UAAU,CAAC,YAAoB,IAAI,CAAC,MAAM,CAAC,SAAS;QAChD,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;YACjB,OAAO,CAAC,IAAI,CACR,4IAA4I,CAC/I,CAAC;YAEF,OAAO;SACV;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;KAC1C;;IAGD,MAAM;QACF,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACjC,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;KAC/B;;;;;;;;IASD,SAAS,CAAC,IAAY,EAAE,KAAc;QAClC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YACrC,OAAO;SACV;QAED,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YAClB,OAAO,CAAC,IAAI,CACR,qGAAqG,CACxG,CAAC;YAE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AK,CAAC,EAAE;YACzE,MAAM,KAAK,CACP,8EAA8E,CACjF,CAAC;SACL;KACJ;EACJ;AApDkB,iCAAM,GAA6C,IAAI,CAAC;;YAGrC,2BAA2B;YACxB,MAAM,uBAAtC,MAAM,SAAC,WAAW;;AALd,0BAA0B;IAJtC,QAAQ,CAAC;QACN,YAAY,EAAE,EAAE;QAChB,OAAO,EAAE,CAAC,YAAY,CAAC;KAC1B,CAAC;IAMO,WAAA,MAAM,CAAC,WAAW,CAAC,CAAA;GALf,0BAA0B,CAqDtC;;AC9DD;;;;ACAA;;;;;;"}
@@ -0,0 +1,164 @@
1
+ import { __assign, __decorate, __param } from 'tslib';
2
+ import { isPlatformBrowser, DOCUMENT, CommonModule } from '@angular/common';
3
+ import { Inject, PLATFORM_ID, RendererFactory2, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule } from '@angular/core';
4
+
5
+ var AngularMailRuCounterService = /** @class */ (function () {
6
+ function AngularMailRuCounterService(config, documentRef, platformId, rendererFactory) {
7
+ this.config = config;
8
+ this.documentRef = documentRef;
9
+ this.platformId = platformId;
10
+ this.rendererFactory = rendererFactory;
11
+ this.doc = this.documentRef;
12
+ this.renderer = this.rendererFactory.createRenderer(null, null);
13
+ }
14
+ /**
15
+ * Initialize Mail.ru Counter tracking script
16
+ * - Adds the script to page's head
17
+ * - Tracks first page view
18
+ */
19
+ AngularMailRuCounterService.prototype.initialize = function (counterId) {
20
+ if (counterId === void 0) { counterId = this.config.counterId; }
21
+ if (this.isLoaded()) {
22
+ console.warn('Tried to initialize a Mail.Ru Counter instance while another is already active. Please call `remove()` before initializing a new instance.');
23
+ return;
24
+ }
25
+ this.config.enabled = true;
26
+ this.addMailRuCounterScript(counterId);
27
+ };
28
+ /** Remove the Mail.ru Counter tracking script */
29
+ AngularMailRuCounterService.prototype.remove = function () {
30
+ this.removeMailRuCounterScript();
31
+ this.config.enabled = false;
32
+ };
33
+ /**
34
+ * Track a goal
35
+ *
36
+ * See {@link https://target.my.com/help/advertisers/sourcetopmailru/en#goals MyTarget docs - Set goals for the counter}
37
+ * @param goal The name of the goal that is being tracked
38
+ * @param value A fixed number attached to a specific goal
39
+ */
40
+ AngularMailRuCounterService.prototype.trackGoal = function (goal, value) {
41
+ if (!isPlatformBrowser(this.platformId)) {
42
+ return;
43
+ }
44
+ if (!this.isLoaded()) {
45
+ console.warn('Tried to track an event without initializing a Mail.Ru Counter instance. Call `initialize()` first.');
46
+ return;
47
+ }
48
+ _tmr.push(__assign({ type: 'reachGoal', id: this.config.counterId, goal: goal }, (value && Number.isInteger(value) && { value: value })));
49
+ };
50
+ /**
51
+ * Adds Mail.ru Counter tracking script to the application
52
+ * @param counterId Mail.ru Counter ID to use
53
+ */
54
+ AngularMailRuCounterService.prototype.addMailRuCounterScript = function (counterId) {
55
+ if (!isPlatformBrowser(this.platformId)) {
56
+ return;
57
+ }
58
+ var counterCode = "\n var _tmr = window._tmr || (window._tmr = []);\n _tmr.push({id: \"" + counterId + "\", type: \"pageView\", start: (new Date()).getTime()});\n (function (d, w, id) {\n if (d.getElementById(id)) return;\n var ts = d.createElement(\"script\"); ts.type = \"text/javascript\"; ts.async = true; ts.id = id;\n ts.src = \"https://top-fwz1.mail.ru/js/code.js\";\n var f = function () {var s = d.getElementsByTagName(\"script\")[0]; s.parentNode.insertBefore(ts, s);};\n if (w.opera == \"[object Opera]\") { d.addEventListener(\"DOMContentLoaded\", f, false); } else { f(); }\n })(document, window, \"topmailru-code\");";
59
+ var scriptElement = this.renderer.createElement('script');
60
+ this.renderer.setAttribute(scriptElement, 'id', 'mail-ru-counter-script');
61
+ this.renderer.setAttribute(scriptElement, 'type', 'text/javascript');
62
+ this.renderer.setProperty(scriptElement, 'innerHTML', counterCode);
63
+ this.renderer.appendChild(this.doc.head, scriptElement);
64
+ };
65
+ /** Remove Mail.ru Counter tracking script from the application */
66
+ AngularMailRuCounterService.prototype.removeMailRuCounterScript = function () {
67
+ if (!isPlatformBrowser(this.platformId)) {
68
+ return;
69
+ }
70
+ var mailRuCounterElement = this.doc.getElementById('mail-ru-counter-script');
71
+ if (mailRuCounterElement) {
72
+ mailRuCounterElement.remove();
73
+ }
74
+ };
75
+ /** Checks if the script element is present */
76
+ AngularMailRuCounterService.prototype.isLoaded = function () {
77
+ if (isPlatformBrowser(this.platformId)) {
78
+ var mailRuCounterElement = this.doc.getElementById('mail-ru-counter-script');
79
+ return !!mailRuCounterElement;
80
+ }
81
+ return false;
82
+ };
83
+ AngularMailRuCounterService.ctorParameters = function () { return [
84
+ { type: undefined, decorators: [{ type: Inject, args: ['config',] }] },
85
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
86
+ { type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
87
+ { type: RendererFactory2 }
88
+ ]; };
89
+ AngularMailRuCounterService.ɵprov = ɵɵdefineInjectable({ factory: function AngularMailRuCounterService_Factory() { return new AngularMailRuCounterService(ɵɵinject("config"), ɵɵinject(DOCUMENT), ɵɵinject(PLATFORM_ID), ɵɵinject(RendererFactory2)); }, token: AngularMailRuCounterService, providedIn: "root" });
90
+ AngularMailRuCounterService = __decorate([
91
+ Injectable({
92
+ providedIn: 'root',
93
+ }),
94
+ __param(0, Inject('config')),
95
+ __param(1, Inject(DOCUMENT)),
96
+ __param(2, Inject(PLATFORM_ID))
97
+ ], AngularMailRuCounterService);
98
+ return AngularMailRuCounterService;
99
+ }());
100
+
101
+ var AngularMailRuCounterModule = /** @class */ (function () {
102
+ function AngularMailRuCounterModule(angularMailRuCounter, platformId) {
103
+ this.angularMailRuCounter = angularMailRuCounter;
104
+ if (!AngularMailRuCounterModule_1.config) {
105
+ throw Error('angular-mailru-counter not configured correctly. Pass the `counterId` property to the `forRoot()` function');
106
+ }
107
+ if (AngularMailRuCounterModule_1.config.enabled && isPlatformBrowser(platformId)) {
108
+ this.angularMailRuCounter.initialize();
109
+ }
110
+ }
111
+ AngularMailRuCounterModule_1 = AngularMailRuCounterModule;
112
+ /**
113
+ * Initialize the Angular Mail.ru Counter Module
114
+ *
115
+ * Add your Mail.ru Counter ID as parameter
116
+ */
117
+ AngularMailRuCounterModule.forRoot = function (config) {
118
+ this.config = config;
119
+ var counterId = config.counterId;
120
+ this.verifyCounterId(counterId);
121
+ return {
122
+ ngModule: AngularMailRuCounterModule_1,
123
+ providers: [
124
+ AngularMailRuCounterService,
125
+ { provide: 'config', useValue: config },
126
+ ],
127
+ };
128
+ };
129
+ /**
130
+ * Verifies the Counter ID that was passed into the configuration.
131
+ * - Checks if Counter was initialized
132
+ * @param counterId Counter ID to verify
133
+ */
134
+ AngularMailRuCounterModule.verifyCounterId = function (counterId) {
135
+ if (counterId === null || counterId === undefined || counterId.length === 0) {
136
+ throw Error('Invalid Mail.ru Counter ID. Did you pass the ID into the forRoot() function?');
137
+ }
138
+ };
139
+ var AngularMailRuCounterModule_1;
140
+ AngularMailRuCounterModule.config = null;
141
+ AngularMailRuCounterModule.ctorParameters = function () { return [
142
+ { type: AngularMailRuCounterService },
143
+ { type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
144
+ ]; };
145
+ AngularMailRuCounterModule = AngularMailRuCounterModule_1 = __decorate([
146
+ NgModule({
147
+ declarations: [],
148
+ imports: [CommonModule],
149
+ }),
150
+ __param(1, Inject(PLATFORM_ID))
151
+ ], AngularMailRuCounterModule);
152
+ return AngularMailRuCounterModule;
153
+ }());
154
+
155
+ /**
156
+ * Public API Surface of angular-mailru-counter
157
+ */
158
+
159
+ /**
160
+ * Generated bundle index. Do not edit.
161
+ */
162
+
163
+ export { AngularMailRuCounterModule, AngularMailRuCounterService };
164
+ //# sourceMappingURL=angular-mailru-counter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-mailru-counter.js","sources":["ng://angular-mailru-counter/lib/angular-mail-ru-counter.service.ts","ng://angular-mailru-counter/lib/angular-mail-ru-counter.module.ts","ng://angular-mailru-counter/public-api.ts","ng://angular-mailru-counter/angular-mailru-counter.ts"],"sourcesContent":["import {DOCUMENT, isPlatformBrowser} from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n Renderer2,\n RendererFactory2,\n} from '@angular/core';\nimport {AngularMailRuCounterConfiguration} from './angular-mail-ru-counter.models';\n\ndeclare const _tmr: any;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AngularMailRuCounterService {\n private renderer: Renderer2;\n private doc: Document;\n\n constructor(\n @Inject('config') private config: AngularMailRuCounterConfiguration,\n @Inject(DOCUMENT) private documentRef: any,\n @Inject(PLATFORM_ID) private platformId: Object,\n private rendererFactory: RendererFactory2,\n ) {\n this.doc = this.documentRef as Document;\n this.renderer = this.rendererFactory.createRenderer(null, null);\n }\n\n /**\n * Initialize Mail.ru Counter tracking script\n * - Adds the script to page's head\n * - Tracks first page view\n */\n initialize(counterId: string = this.config.counterId): void {\n if (this.isLoaded()) {\n console.warn(\n 'Tried to initialize a Mail.Ru Counter instance while another is already active. Please call `remove()` before initializing a new instance.',\n );\n\n return;\n }\n\n this.config.enabled = true;\n this.addMailRuCounterScript(counterId);\n }\n\n /** Remove the Mail.ru Counter tracking script */\n remove(): void {\n this.removeMailRuCounterScript();\n this.config.enabled = false;\n }\n\n /**\n * Track a goal\n *\n * See {@link https://target.my.com/help/advertisers/sourcetopmailru/en#goals MyTarget docs - Set goals for the counter}\n * @param goal The name of the goal that is being tracked\n * @param value A fixed number attached to a specific goal\n */\n trackGoal(goal: string, value?: number): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n if (!this.isLoaded()) {\n console.warn(\n 'Tried to track an event without initializing a Mail.Ru Counter instance. Call `initialize()` first.',\n );\n\n return;\n }\n\n _tmr.push({\n type: 'reachGoal',\n id: this.config.counterId,\n goal,\n ...(value && Number.isInteger(value) && {value}),\n });\n }\n\n /**\n * Adds Mail.ru Counter tracking script to the application\n * @param counterId Mail.ru Counter ID to use\n */\n private addMailRuCounterScript(counterId: string): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n const counterCode = `\n var _tmr = window._tmr || (window._tmr = []);\n _tmr.push({id: \"${counterId}\", type: \"pageView\", start: (new Date()).getTime()});\n (function (d, w, id) {\n if (d.getElementById(id)) return;\n var ts = d.createElement(\"script\"); ts.type = \"text/javascript\"; ts.async = true; ts.id = id;\n ts.src = \"https://top-fwz1.mail.ru/js/code.js\";\n var f = function () {var s = d.getElementsByTagName(\"script\")[0]; s.parentNode.insertBefore(ts, s);};\n if (w.opera == \"[object Opera]\") { d.addEventListener(\"DOMContentLoaded\", f, false); } else { f(); }\n })(document, window, \"topmailru-code\");`;\n\n const scriptElement = this.renderer.createElement('script');\n\n this.renderer.setAttribute(scriptElement, 'id', 'mail-ru-counter-script');\n this.renderer.setAttribute(scriptElement, 'type', 'text/javascript');\n this.renderer.setProperty(scriptElement, 'innerHTML', counterCode);\n this.renderer.appendChild(this.doc.head, scriptElement);\n }\n\n /** Remove Mail.ru Counter tracking script from the application */\n private removeMailRuCounterScript(): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n const mailRuCounterElement = this.doc.getElementById('mail-ru-counter-script');\n\n if (mailRuCounterElement) {\n mailRuCounterElement.remove();\n }\n }\n\n /** Checks if the script element is present */\n private isLoaded(): boolean {\n if (isPlatformBrowser(this.platformId)) {\n const mailRuCounterElement = this.doc.getElementById(\n 'mail-ru-counter-script',\n );\n\n return !!mailRuCounterElement;\n }\n\n return false;\n }\n}\n","import {CommonModule, isPlatformBrowser} from '@angular/common';\nimport {Inject, ModuleWithProviders, NgModule, PLATFORM_ID} from '@angular/core';\nimport {AngularMailRuCounterConfiguration} from './angular-mail-ru-counter.models';\nimport {AngularMailRuCounterService} from './angular-mail-ru-counter.service';\n\n@NgModule({\n declarations: [],\n imports: [CommonModule],\n})\nexport class AngularMailRuCounterModule {\n private static config: AngularMailRuCounterConfiguration | null = null;\n\n constructor(\n private angularMailRuCounter: AngularMailRuCounterService,\n @Inject(PLATFORM_ID) platformId: Object,\n ) {\n if (!AngularMailRuCounterModule.config) {\n throw Error(\n 'angular-mailru-counter not configured correctly. Pass the `counterId` property to the `forRoot()` function',\n );\n }\n\n if (AngularMailRuCounterModule.config.enabled && isPlatformBrowser(platformId)) {\n this.angularMailRuCounter.initialize();\n }\n }\n\n /**\n * Initialize the Angular Mail.ru Counter Module\n *\n * Add your Mail.ru Counter ID as parameter\n */\n static forRoot(\n config: AngularMailRuCounterConfiguration,\n ): ModuleWithProviders<AngularMailRuCounterModule> {\n this.config = config;\n\n const counterId = config.counterId;\n\n this.verifyCounterId(counterId);\n\n return {\n ngModule: AngularMailRuCounterModule,\n providers: [\n AngularMailRuCounterService,\n {provide: 'config', useValue: config},\n ],\n };\n }\n\n /**\n * Verifies the Counter ID that was passed into the configuration.\n * - Checks if Counter was initialized\n * @param counterId Counter ID to verify\n */\n private static verifyCounterId(counterId: string): void {\n if (counterId === null || counterId === undefined || counterId.length === 0) {\n throw Error(\n 'Invalid Mail.ru Counter ID. Did you pass the ID into the forRoot() function?',\n );\n }\n }\n}\n","/**\n * Public API Surface of angular-mailru-counter\n */\n\nexport * from './lib/angular-mail-ru-counter.service';\nexport * from './lib/angular-mail-ru-counter.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {AngularMailRuCounterConfiguration as ɵa} from './lib/angular-mail-ru-counter.models';"],"names":[],"mappings":";;;;;IAmBI,qCAC8B,MAAyC,EACzC,WAAgB,EACb,UAAkB,EACvC,eAAiC;QAHf,WAAM,GAAN,MAAM,CAAmC;QACzC,gBAAW,GAAX,WAAW,CAAK;QACb,eAAU,GAAV,UAAU,CAAQ;QACvC,oBAAe,GAAf,eAAe,CAAkB;QAEzC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,WAAuB,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KACnE;;;;;;IAOD,gDAAU,GAAV,UAAW,SAAyC;QAAzC,0BAAA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AC;SACL;QAED,IAAI,4BAA0B,CAAC,MAAM,CAAC,OAAO,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE;YAC5E,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,CAAC;SAC1C;KACJ;mCAhBQ,0BAA0B;;;;;;IAuB5B,kCAAO,GAAd,UACI,MAAyC;QAEzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAEnC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAEhC,OAAO;YACH,QAAQ,EAAE,4BAA0B;YACpC,SAAS,EAAE;gBACP,2BAA2B;gBAC3B,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAC;aACxC;SACJ,CAAC;KACL;;;;;;IAOc,0CAAe,GAA9B,UAA+B,SAAiB;QAC5C,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACzE,MAAM,KAAK,CACP,8EAA8E,CACjF,CAAC;SACL;KACJ;;IAnDc,iCAAM,GAA6C,IAAI,CAAC;;gBAGrC,2BAA2B;gBACxB,MAAM,uBAAtC,MAAM,SAAC,WAAW;;IALd,0BAA0B;QAJtC,QAAQ,CAAC;YACN,YAAY,EAAE,EAAE;YAChB,OAAO,EAAE,CAAC,YAAY,CAAC;SAC1B,CAAC;QAMO,WAAA,MAAM,CAAC,WAAW,CAAC,CAAA;OALf,0BAA0B,CAqDtC;IAAD,iCAAC;CArDD;;ACTA;;;;ACAA;;;;;;"}
@@ -0,0 +1,6 @@
1
+ export interface AngularMailRuCounterConfiguration {
2
+ /** Whether to start tracking immediately. Default is `false` */
3
+ enabled?: boolean;
4
+ /** Your Mail.ru Counter ID */
5
+ counterId: string;
6
+ }
@@ -0,0 +1,20 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { AngularMailRuCounterConfiguration } from './angular-mail-ru-counter.models';
3
+ import { AngularMailRuCounterService } from './angular-mail-ru-counter.service';
4
+ export declare class AngularMailRuCounterModule {
5
+ private angularMailRuCounter;
6
+ private static config;
7
+ constructor(angularMailRuCounter: AngularMailRuCounterService, platformId: Object);
8
+ /**
9
+ * Initialize the Angular Mail.ru Counter Module
10
+ *
11
+ * Add your Mail.ru Counter ID as parameter
12
+ */
13
+ static forRoot(config: AngularMailRuCounterConfiguration): ModuleWithProviders<AngularMailRuCounterModule>;
14
+ /**
15
+ * Verifies the Counter ID that was passed into the configuration.
16
+ * - Checks if Counter was initialized
17
+ * @param counterId Counter ID to verify
18
+ */
19
+ private static verifyCounterId;
20
+ }
@@ -0,0 +1,36 @@
1
+ import { RendererFactory2 } from '@angular/core';
2
+ import { AngularMailRuCounterConfiguration } from './angular-mail-ru-counter.models';
3
+ export declare class AngularMailRuCounterService {
4
+ private config;
5
+ private documentRef;
6
+ private platformId;
7
+ private rendererFactory;
8
+ private renderer;
9
+ private doc;
10
+ constructor(config: AngularMailRuCounterConfiguration, documentRef: any, platformId: Object, rendererFactory: RendererFactory2);
11
+ /**
12
+ * Initialize Mail.ru Counter tracking script
13
+ * - Adds the script to page's head
14
+ * - Tracks first page view
15
+ */
16
+ initialize(counterId?: string): void;
17
+ /** Remove the Mail.ru Counter tracking script */
18
+ remove(): void;
19
+ /**
20
+ * Track a goal
21
+ *
22
+ * See {@link https://target.my.com/help/advertisers/sourcetopmailru/en#goals MyTarget docs - Set goals for the counter}
23
+ * @param goal The name of the goal that is being tracked
24
+ * @param value A fixed number attached to a specific goal
25
+ */
26
+ trackGoal(goal: string, value?: number): void;
27
+ /**
28
+ * Adds Mail.ru Counter tracking script to the application
29
+ * @param counterId Mail.ru Counter ID to use
30
+ */
31
+ private addMailRuCounterScript;
32
+ /** Remove Mail.ru Counter tracking script from the application */
33
+ private removeMailRuCounterScript;
34
+ /** Checks if the script element is present */
35
+ private isLoaded;
36
+ }
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "angular-mailru-counter",
3
+ "version": "1.0.0",
4
+ "peerDependencies": {
5
+ "@angular/core": ">=9.0.0"
6
+ },
7
+ "description": "An Angular library to simplify the use of a Mail.ru counter.",
8
+ "keywords": [
9
+ "angular",
10
+ "mail.ru",
11
+ "counter"
12
+ ],
13
+ "license": "Apache-2.0",
14
+ "authors": [],
15
+ "repository": "https://github.com/dima716/angular-mailru-counter",
16
+ "bugs": "",
17
+ "homepage": "https://github.com/dima716/angular-mailru-counter",
18
+ "main": "bundles/angular-mailru-counter.umd.js",
19
+ "module": "fesm5/angular-mailru-counter.js",
20
+ "es2015": "fesm2015/angular-mailru-counter.js",
21
+ "esm5": "esm5/angular-mailru-counter.js",
22
+ "esm2015": "esm2015/angular-mailru-counter.js",
23
+ "fesm5": "fesm5/angular-mailru-counter.js",
24
+ "fesm2015": "fesm2015/angular-mailru-counter.js",
25
+ "typings": "angular-mailru-counter.d.ts",
26
+ "metadata": "angular-mailru-counter.metadata.json",
27
+ "sideEffects": false,
28
+ "dependencies": {
29
+ "tslib": "^1.10.0"
30
+ }
31
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Public API Surface of angular-mailru-counter
3
+ */
4
+ export * from './lib/angular-mail-ru-counter.service';
5
+ export * from './lib/angular-mail-ru-counter.module';