@osovitny/anatoly 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +5 -0
  2. package/bundles/osovitny-anatoly.umd.js +860 -1491
  3. package/bundles/osovitny-anatoly.umd.js.map +1 -1
  4. package/bundles/osovitny-anatoly.umd.min.js +2 -2
  5. package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
  6. package/esm2015/lib/billing/billing.module.js +33 -35
  7. package/esm2015/lib/billing/components/buyaccess/buyaccess-button.component.js +26 -76
  8. package/esm2015/lib/billing/components/subscriptions/subscribe-plan-button.component.js +19 -53
  9. package/esm2015/lib/billing/components/subscriptions/upgrade-plan-button.component.js +27 -56
  10. package/esm2015/lib/billing/index.js +8 -5
  11. package/esm2015/lib/billing/services/base-billing-api.service.js +17 -80
  12. package/esm2015/lib/core/consts.js +2 -6
  13. package/esm2015/lib/core/core.module.js +25 -27
  14. package/esm2015/lib/core/index.js +8 -11
  15. package/esm2015/lib/core/services/appcontext.service.js +12 -63
  16. package/esm2015/lib/core/services/base-api.service.js +11 -94
  17. package/esm2015/lib/core/services/base-go.service.js +9 -31
  18. package/esm2015/lib/core/services/base-gridedit.service.js +19 -123
  19. package/esm2015/lib/identity/components/signin-button.component.js +13 -21
  20. package/esm2015/lib/identity/components/signout-button.component.js +13 -21
  21. package/esm2015/lib/identity/components/signup-button.component.js +13 -21
  22. package/esm2015/lib/identity/identity.module.js +21 -23
  23. package/esm2015/lib/identity/index.js +6 -5
  24. package/esm2015/lib/ui/components/base-edit.component.js +8 -47
  25. package/esm2015/lib/ui/components/base.component.js +1 -21
  26. package/esm2015/lib/ui/components/content-header/content-header.component.js +13 -22
  27. package/esm2015/lib/ui/components/html-editor/html-editor.component.js +56 -202
  28. package/esm2015/lib/ui/components/html-editor/html-editor.consts.js +47 -0
  29. package/esm2015/lib/ui/components/validation/form-validation-summary.component.js +13 -25
  30. package/esm2015/lib/ui/components/validation/item-validation-summary.component.js +16 -24
  31. package/esm2015/lib/ui/components/validation/validation-summary.component.js +9 -42
  32. package/esm2015/lib/ui/index.js +11 -10
  33. package/esm2015/lib/ui/ui.module.js +45 -43
  34. package/esm2015/osovitny-anatoly.js +2 -6
  35. package/esm2015/public-api.js +5 -9
  36. package/esm5/lib/billing/billing.module.js +30 -33
  37. package/esm5/lib/billing/components/buyaccess/buyaccess-button.component.js +25 -78
  38. package/esm5/lib/billing/components/subscriptions/subscribe-plan-button.component.js +17 -52
  39. package/esm5/lib/billing/components/subscriptions/upgrade-plan-button.component.js +25 -55
  40. package/esm5/lib/billing/index.js +8 -5
  41. package/esm5/lib/billing/services/base-billing-api.service.js +18 -97
  42. package/esm5/lib/core/consts.js +2 -6
  43. package/esm5/lib/core/core.module.js +22 -25
  44. package/esm5/lib/core/index.js +8 -11
  45. package/esm5/lib/core/services/appcontext.service.js +14 -78
  46. package/esm5/lib/core/services/base-api.service.js +17 -150
  47. package/esm5/lib/core/services/base-go.service.js +7 -29
  48. package/esm5/lib/core/services/base-gridedit.service.js +24 -160
  49. package/esm5/lib/identity/components/signin-button.component.js +11 -20
  50. package/esm5/lib/identity/components/signout-button.component.js +11 -20
  51. package/esm5/lib/identity/components/signup-button.component.js +11 -20
  52. package/esm5/lib/identity/identity.module.js +18 -21
  53. package/esm5/lib/identity/index.js +6 -5
  54. package/esm5/lib/ui/components/base-edit.component.js +16 -86
  55. package/esm5/lib/ui/components/base.component.js +5 -38
  56. package/esm5/lib/ui/components/content-header/content-header.component.js +12 -25
  57. package/esm5/lib/ui/components/html-editor/html-editor.component.js +60 -245
  58. package/esm5/lib/ui/components/html-editor/html-editor.consts.js +47 -0
  59. package/esm5/lib/ui/components/validation/form-validation-summary.component.js +13 -30
  60. package/esm5/lib/ui/components/validation/item-validation-summary.component.js +15 -25
  61. package/esm5/lib/ui/components/validation/validation-summary.component.js +13 -54
  62. package/esm5/lib/ui/index.js +11 -10
  63. package/esm5/lib/ui/ui.module.js +42 -41
  64. package/esm5/osovitny-anatoly.js +2 -6
  65. package/esm5/public-api.js +5 -9
  66. package/fesm2015/osovitny-anatoly.js +802 -1253
  67. package/fesm2015/osovitny-anatoly.js.map +1 -1
  68. package/fesm5/osovitny-anatoly.js +863 -1514
  69. package/fesm5/osovitny-anatoly.js.map +1 -1
  70. package/lib/billing/index.d.ts +4 -0
  71. package/lib/core/index.d.ts +4 -4
  72. package/lib/identity/index.d.ts +3 -0
  73. package/lib/ui/components/html-editor/html-editor.component.d.ts +4 -7
  74. package/lib/ui/components/html-editor/html-editor.consts.d.ts +1 -0
  75. package/lib/ui/index.d.ts +7 -3
  76. package/osovitny-anatoly.metadata.json +1 -1
  77. package/package.json +3 -7
@@ -1,9 +1,10 @@
1
- import { Injectable, NgModule, Component, Input } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
1
+ import { __decorate } from 'tslib';
2
+ import { Injectable, NgModule, Input, Component, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
3
3
  import { HttpClient, HttpClientModule, HttpClientXsrfModule, HttpClientJsonpModule } from '@angular/common/http';
4
4
  import { map } from 'rxjs/operators';
5
5
  import { BehaviorSubject } from 'rxjs';
6
6
  import { ActivatedRoute, Router } from '@angular/router';
7
+ import { CommonModule } from '@angular/common';
7
8
  import { ReactiveFormsModule, FormsModule } from '@angular/forms';
8
9
  import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
9
10
  import { GridModule } from '@progress/kendo-angular-grid';
@@ -11,10 +12,6 @@ import { PopupModule } from '@progress/kendo-angular-popup';
11
12
  import { ButtonsModule } from '@progress/kendo-angular-buttons';
12
13
  import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
13
14
 
14
- /**
15
- * @fileoverview added by tsickle
16
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
17
- */
18
15
  var anatoly$1;
19
16
  (function (anatoly) {
20
17
  var consts;
@@ -24,282 +21,88 @@ var anatoly$1;
24
21
  consts.apiUrl = "/api/";
25
22
  })(consts = anatoly.consts || (anatoly.consts = {}));
26
23
  })(anatoly$1 || (anatoly$1 = {}));
27
- ((/** @type {?} */ (window))).anatoly = anatoly$1;
24
+ window.anatoly = anatoly$1;
28
25
 
29
- /**
30
- * @fileoverview added by tsickle
31
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
32
- */
33
- class BaseApiService {
34
- /**
35
- * @param {?} http
36
- */
26
+ /*
27
+ <file>
28
+ Authors:
29
+ Vadim Osovitny
30
+
31
+ Created:
32
+ 13 Nov 2017
33
+
34
+ Version:
35
+ 1.0
36
+
37
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
38
+ </file>
39
+ */
40
+ let BaseApiService = class BaseApiService {
37
41
  constructor(http) {
38
42
  this.http = http;
39
43
  this.baseUrl = anatoly.consts.apiUrl;
40
44
  }
41
- /**
42
- * @private
43
- * @param {?=} data
44
- * @return {?}
45
- */
46
45
  serializeParams(data) {
47
46
  return data ? ('?' + $.param(data)) : '';
48
47
  }
49
48
  //webApi
50
- /**
51
- * @template T
52
- * @param {?} action
53
- * @param {?=} data
54
- * @return {?}
55
- */
56
49
  get(action, data) {
57
- /** @type {?} */
58
50
  var url = this.baseUrl + `${action}${this.serializeParams(data)}`;
59
- return this.http.get(url).pipe(map((/**
60
- * @param {?} res
61
- * @return {?}
62
- */
63
- res => (/** @type {?} */ (res)))));
64
- }
65
- /**
66
- * @param {?} action
67
- * @param {?=} data
68
- * @return {?}
69
- */
51
+ return this.http.get(url).pipe(map(res => res));
52
+ }
70
53
  post(action, data) {
71
- /** @type {?} */
72
54
  var url = this.baseUrl + `${action}`;
73
55
  return this.http.post(url, data, { responseType: 'text' });
74
56
  }
75
- /**
76
- * @param {?} action
77
- * @param {?=} data
78
- * @return {?}
79
- */
80
57
  postQS(action, data) {
81
- /** @type {?} */
82
58
  var url = this.baseUrl + `${action}${this.serializeParams(data)}`;
83
59
  return this.http.post(url, null, { responseType: 'text' });
84
60
  }
85
61
  //gets
86
- /**
87
- * @template T
88
- * @param {?=} data
89
- * @return {?}
90
- */
91
62
  getAll(data) {
92
- return this.get('getall', data).pipe(map((/**
93
- * @param {?} res
94
- * @return {?}
95
- */
96
- res => (/** @type {?} */ (res)))));
97
- }
98
- /**
99
- * @param {?} fileName
100
- * @param {?} jsonVersion
101
- * @return {?}
102
- */
63
+ return this.get('getall', data).pipe(map(res => res));
64
+ }
103
65
  getJsonFile(fileName, jsonVersion) {
104
66
  if (!jsonVersion) {
105
67
  jsonVersion = "1.0";
106
68
  }
107
- /** @type {?} */
108
69
  var url = anatoly.consts.jsonUrl + fileName + '?' + jsonVersion;
109
- return this.http.get(url).pipe(map((/**
110
- * @param {?} res
111
- * @return {?}
112
- */
113
- res => (/** @type {?} */ (res)))));
114
- }
115
- /**
116
- * @return {?}
117
- */
70
+ return this.http.get(url).pipe(map(res => res));
71
+ }
118
72
  getNewGuid() {
119
- /** @type {?} */
120
73
  var url = this.baseUrl + 'getNewGuid';
121
74
  return this.http.get(url, { responseType: 'text' });
122
75
  }
123
76
  //CRUD function
124
- /**
125
- * @template T
126
- * @param {?} id
127
- * @return {?}
128
- */
129
77
  getById(id) {
130
78
  return this.get('getById', { id: id });
131
79
  }
132
- /**
133
- * @param {?} id
134
- * @return {?}
135
- */
136
80
  remove(id) {
137
81
  return this.postQS('remove', { id: id });
138
82
  }
139
- }
140
- BaseApiService.decorators = [
141
- { type: Injectable }
142
- ];
143
- /** @nocollapse */
83
+ };
144
84
  BaseApiService.ctorParameters = () => [
145
85
  { type: HttpClient }
146
86
  ];
147
- if (false) {
148
- /**
149
- * @type {?}
150
- * @protected
151
- */
152
- BaseApiService.prototype.baseUrl;
153
- /**
154
- * @type {?}
155
- * @protected
156
- */
157
- BaseApiService.prototype.jsonUrl;
158
- /**
159
- * @type {?}
160
- * @protected
161
- */
162
- BaseApiService.prototype.http;
163
- }
164
-
165
- /**
166
- * @fileoverview added by tsickle
167
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
168
- */
169
- class AppContextService extends BaseApiService {
170
- /**
171
- * @param {?} http
172
- */
173
- constructor(http) {
174
- super(http);
175
- this.http = http;
176
- this.current = null;
177
- this.successes = [];
178
- this.subscription = null;
179
- this.baseUrl = anatoly.consts.apiUrl + 'appcontext/';
180
- }
181
- /**
182
- * @param {?} success
183
- * @return {?}
184
- */
185
- getCurrent(success) {
186
- if (typeof success == "undefined") {
187
- return;
188
- }
189
- if (this.current != null) {
190
- success(this.current);
191
- return;
192
- }
193
- this.successes.push(success);
194
- if (this.subscription != null) {
195
- return;
196
- }
197
- this.subscription = this.get('GetCurrentContext', null).subscribe((/**
198
- * @param {?} data
199
- * @return {?}
200
- */
201
- data => {
202
- this.dataReceived(data);
203
- }), (/**
204
- * @param {?} e
205
- * @return {?}
206
- */
207
- e => { }));
208
- }
209
- /**
210
- * @param {?} data
211
- * @return {?}
212
- */
213
- dataReceived(data) {
214
- this.current = data;
215
- for (var i = 0; i < this.successes.length; i++) {
216
- /** @type {?} */
217
- var success = this.successes[i];
218
- success(data);
219
- }
220
- this.successes = [];
221
- this.subscription.unsubscribe();
222
- this.subscription = null;
223
- this.current = null;
224
- }
225
- /**
226
- * @return {?}
227
- */
228
- isUserSignedIn() {
229
- return ((/** @type {?} */ (window))).__context_isUserSignedIn;
230
- }
231
- /**
232
- * @return {?}
233
- */
234
- isUserAdmin() {
235
- return ((/** @type {?} */ (window))).__context_isUserAdmin;
236
- }
237
- }
238
- AppContextService.decorators = [
239
- { type: Injectable }
240
- ];
241
- /** @nocollapse */
242
- AppContextService.ctorParameters = () => [
243
- { type: HttpClient }
244
- ];
245
- if (false) {
246
- /**
247
- * @type {?}
248
- * @private
249
- */
250
- AppContextService.prototype.current;
251
- /**
252
- * @type {?}
253
- * @private
254
- */
255
- AppContextService.prototype.successes;
256
- /**
257
- * @type {?}
258
- * @private
259
- */
260
- AppContextService.prototype.subscription;
261
- /**
262
- * @type {?}
263
- * @protected
264
- */
265
- AppContextService.prototype.http;
266
- }
87
+ BaseApiService = __decorate([
88
+ Injectable()
89
+ ], BaseApiService);
267
90
 
268
- /**
269
- * @fileoverview added by tsickle
270
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
271
- */
272
- class AnatolyCoreModule {
273
- }
274
- AnatolyCoreModule.decorators = [
275
- { type: NgModule, args: [{
276
- imports: [
277
- CommonModule,
278
- HttpClientModule,
279
- HttpClientXsrfModule,
280
- HttpClientJsonpModule
281
- ],
282
- exports: [
283
- CommonModule,
284
- HttpClientModule,
285
- HttpClientXsrfModule,
286
- HttpClientJsonpModule
287
- ],
288
- declarations: [],
289
- providers: [
290
- AppContextService
291
- ]
292
- },] }
293
- ];
294
-
295
- /**
296
- * @fileoverview added by tsickle
297
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
298
- */
299
- class BaseGridEditService extends BehaviorSubject {
300
- /**
301
- * @param {?} http
302
- */
91
+ /*
92
+ <file>
93
+ Authors:
94
+ Vadim Osovitny
95
+
96
+ Created:
97
+ 29 Apr 2018
98
+
99
+ Version:
100
+ 1.0
101
+
102
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
103
+ </file>
104
+ */
105
+ let BaseGridEditService = class BaseGridEditService extends BehaviorSubject {
303
106
  constructor(http) {
304
107
  super([]);
305
108
  this.http = http;
@@ -307,49 +110,26 @@ class BaseGridEditService extends BehaviorSubject {
307
110
  this.baseUrl = anatoly.consts.apiUrl;
308
111
  this.baseReadUrl = this.baseUrl + "getAll";
309
112
  }
310
- /**
311
- * @private
312
- * @param {?=} data
313
- * @return {?}
314
- */
315
113
  serializeParams(data) {
316
114
  return data ? ('?' + $.param(data)) : '';
317
115
  }
318
- /**
319
- * @private
320
- * @return {?}
321
- */
322
116
  reset() {
323
117
  this.data = [];
324
118
  }
325
- /**
326
- * @param {?} dataItem
327
- * @return {?}
328
- */
329
119
  resetItem(dataItem) {
330
120
  if (!dataItem) {
331
121
  return;
332
122
  }
333
123
  //find orignal data item
334
- /** @type {?} */
335
- const originalDataItem = this.data.find((/**
336
- * @param {?} item
337
- * @return {?}
338
- */
339
- item => item.Id === dataItem.Id));
124
+ const originalDataItem = this.data.find(item => item.Id === dataItem.Id);
340
125
  //revert changes
341
126
  Object.assign(originalDataItem, dataItem);
342
127
  super.next(this.data);
343
128
  }
344
- /**
345
- * @param {?=} params
346
- * @return {?}
347
- */
348
129
  read(params) {
349
130
  if (this.data.length) {
350
131
  return super.next(this.data);
351
132
  }
352
- /** @type {?} */
353
133
  var url = this.baseReadUrl;
354
134
  if (typeof params === 'undefined') {
355
135
  params = this.savedReadParams;
@@ -362,654 +142,560 @@ class BaseGridEditService extends BehaviorSubject {
362
142
  // .map(res => <any[]>res)
363
143
  // .do(data => { this.data = data; }).subscribe(data => { super.next(data); });
364
144
  //}
365
- this.http.get(url).pipe(map((/**
366
- * @param {?} res
367
- * @return {?}
368
- */
369
- res => (/** @type {?} */ (res))))).subscribe((/**
370
- * @param {?} data
371
- * @return {?}
372
- */
373
- data => { super.next(data); }));
374
- }
375
- /**
376
- * @param {?} data
377
- * @param {?} isNew
378
- * @param {?=} sucess
379
- * @return {?}
380
- */
145
+ this.http.get(url).pipe(map(res => res)).subscribe(data => { super.next(data); });
146
+ }
381
147
  save(data, isNew, sucess) {
382
- /** @type {?} */
383
148
  const action = isNew ? 'add' : 'update';
384
149
  this.reset();
385
- this.post(action, data).subscribe((/**
386
- * @return {?}
387
- */
388
- () => {
389
- }), (/**
390
- * @return {?}
391
- */
392
- () => {
150
+ this.post(action, data).subscribe(() => {
151
+ }, () => {
393
152
  this.read();
394
- }), (/**
395
- * @return {?}
396
- */
397
- () => {
153
+ }, () => {
398
154
  this.read();
399
155
  if (sucess)
400
156
  sucess();
401
- }));
157
+ });
402
158
  }
403
- /**
404
- * @param {?} data
405
- * @param {?=} sucess
406
- * @return {?}
407
- */
408
159
  remove(data, sucess) {
409
160
  this.reset();
410
- this.post('remove', data).subscribe((/**
411
- * @return {?}
412
- */
413
- () => {
414
- }), (/**
415
- * @return {?}
416
- */
417
- () => {
161
+ this.post('remove', data).subscribe(() => {
162
+ }, () => {
418
163
  this.read();
419
- }), (/**
420
- * @return {?}
421
- */
422
- () => {
164
+ }, () => {
423
165
  this.read();
424
166
  if (sucess)
425
167
  sucess();
426
- }));
168
+ });
427
169
  }
428
- /**
429
- * @param {?} action
430
- * @param {?=} data
431
- * @return {?}
432
- */
433
170
  post(action, data) {
434
- /** @type {?} */
435
171
  var url = this.baseUrl + `${action}${this.serializeParams(data)}`;
436
- return this.http.post(url, data).pipe(map((/**
437
- * @param {?} res
438
- * @return {?}
439
- */
440
- res => (/** @type {?} */ (res)))));
172
+ return this.http.post(url, data).pipe(map(res => res));
441
173
  }
442
- }
443
- BaseGridEditService.decorators = [
444
- { type: Injectable }
445
- ];
446
- /** @nocollapse */
174
+ };
447
175
  BaseGridEditService.ctorParameters = () => [
448
176
  { type: HttpClient }
449
177
  ];
450
- if (false) {
451
- /**
452
- * @type {?}
453
- * @protected
454
- */
455
- BaseGridEditService.prototype.baseUrl;
456
- /**
457
- * @type {?}
458
- * @protected
459
- */
460
- BaseGridEditService.prototype.baseReadUrl;
461
- /**
462
- * @type {?}
463
- * @protected
464
- */
465
- BaseGridEditService.prototype.savedReadParams;
466
- /**
467
- * @type {?}
468
- * @private
469
- */
470
- BaseGridEditService.prototype.data;
471
- /**
472
- * @type {?}
473
- * @protected
474
- */
475
- BaseGridEditService.prototype.http;
476
- }
178
+ BaseGridEditService = __decorate([
179
+ Injectable()
180
+ ], BaseGridEditService);
477
181
 
478
- /**
479
- * @fileoverview added by tsickle
480
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
481
- */
482
- class BaseGoService {
483
- /**
484
- * @param {?} route
485
- * @param {?} router
486
- */
182
+ /*
183
+ <file>
184
+ Authors:
185
+ Vadim Osovitny
186
+
187
+ Created:
188
+ 17 Jun 2018
189
+
190
+ Version:
191
+ 1.0
192
+
193
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
194
+ </file>
195
+ */
196
+ let BaseGoService = class BaseGoService {
487
197
  constructor(route, router) {
488
198
  this.route = route;
489
199
  this.router = router;
490
200
  }
491
- /**
492
- * @return {?}
493
- */
494
201
  locationReload() {
495
202
  //this.router.navigate([this.route.url]);
496
- ((/** @type {?} */ (window))).location.reload();
203
+ window.location.reload();
497
204
  }
498
- }
499
- BaseGoService.decorators = [
500
- { type: Injectable }
501
- ];
502
- /** @nocollapse */
205
+ };
503
206
  BaseGoService.ctorParameters = () => [
504
207
  { type: ActivatedRoute },
505
208
  { type: Router }
506
209
  ];
507
- if (false) {
508
- /**
509
- * @type {?}
510
- * @protected
511
- */
512
- BaseGoService.prototype.route;
513
- /**
514
- * @type {?}
515
- * @protected
516
- */
517
- BaseGoService.prototype.router;
518
- }
519
-
520
- /**
521
- * @fileoverview added by tsickle
522
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
523
- */
524
-
525
- /**
526
- * @fileoverview added by tsickle
527
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
528
- */
529
- class SignInButtonComponent {
530
- constructor() { }
531
- }
532
- SignInButtonComponent.decorators = [
533
- { type: Component, args: [{
534
- selector: 'anatoly-signin-button',
535
- template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
536
- }] }
537
- ];
538
- /** @nocollapse */
539
- SignInButtonComponent.ctorParameters = () => [];
540
- SignInButtonComponent.propDecorators = {
541
- classbtn: [{ type: Input }]
542
- };
543
- if (false) {
544
- /** @type {?} */
545
- SignInButtonComponent.prototype.classbtn;
546
- }
547
-
548
- /**
549
- * @fileoverview added by tsickle
550
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
551
- */
552
- class SignUpButtonComponent {
553
- constructor() {
554
- }
555
- }
556
- SignUpButtonComponent.decorators = [
557
- { type: Component, args: [{
558
- selector: 'anatoly-signup-button',
559
- template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
560
- }] }
561
- ];
562
- /** @nocollapse */
563
- SignUpButtonComponent.ctorParameters = () => [];
564
- SignUpButtonComponent.propDecorators = {
565
- classbtn: [{ type: Input }]
566
- };
567
- if (false) {
568
- /** @type {?} */
569
- SignUpButtonComponent.prototype.classbtn;
570
- }
210
+ BaseGoService = __decorate([
211
+ Injectable()
212
+ ], BaseGoService);
571
213
 
572
- /**
573
- * @fileoverview added by tsickle
574
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
575
- */
576
- class SignOutButtonComponent {
577
- constructor() { }
578
- }
579
- SignOutButtonComponent.decorators = [
580
- { type: Component, args: [{
581
- selector: 'anatoly-signout-button',
582
- template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
583
- }] }
584
- ];
585
- /** @nocollapse */
586
- SignOutButtonComponent.ctorParameters = () => [];
587
- SignOutButtonComponent.propDecorators = {
588
- classbtn: [{ type: Input }]
589
- };
590
- if (false) {
591
- /** @type {?} */
592
- SignOutButtonComponent.prototype.classbtn;
593
- }
594
-
595
- /**
596
- * @fileoverview added by tsickle
597
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
598
- */
599
- class AnatolyIdentityModule {
600
- }
601
- AnatolyIdentityModule.decorators = [
602
- { type: NgModule, args: [{
603
- imports: [],
604
- exports: [
605
- SignInButtonComponent,
606
- SignUpButtonComponent,
607
- SignOutButtonComponent
608
- ],
609
- declarations: [
610
- SignInButtonComponent,
611
- SignUpButtonComponent,
612
- SignOutButtonComponent
613
- ],
614
- providers: []
615
- },] }
616
- ];
617
-
618
- /**
619
- * @fileoverview added by tsickle
620
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
621
- */
622
-
623
- /**
624
- * @fileoverview added by tsickle
625
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
626
- */
627
- class SubscribePlanButtonComponent {
628
- /**
629
- * @param {?} appcontext
630
- */
631
- constructor(appcontext) {
632
- this.appcontext = appcontext;
633
- this.contextUpdated = false;
634
- this.isUserSignedIn = false;
635
- this.currentPlan = 0;
636
- this.currentPlanTitle = "";
637
- this.requestedPlan = 0;
638
- this.requestedPlanTitle = "";
214
+ /*
215
+ <file>
216
+ Authors:
217
+ Vadim Osovitny
218
+
219
+ Created:
220
+ 13 Nov 2017
221
+
222
+ Version:
223
+ 1.0
224
+
225
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
226
+ </file>
227
+ */
228
+ let AppContextService = class AppContextService extends BaseApiService {
229
+ constructor(http) {
230
+ super(http);
231
+ this.http = http;
232
+ this.current = null;
233
+ this.successes = [];
234
+ this.subscription = null;
235
+ this.baseUrl = anatoly.consts.apiUrl + 'appcontext/';
639
236
  }
640
- /**
641
- * @return {?}
642
- */
643
- ngOnInit() {
644
- if (!this.appcontext.isUserSignedIn()) {
645
- this.contextUpdated = true;
237
+ getCurrent(success) {
238
+ if (typeof success == "undefined") {
646
239
  return;
647
240
  }
648
- this.appcontext.getCurrent((/**
649
- * @param {?} current
650
- * @return {?}
651
- */
652
- (current) => {
653
- this.isUserSignedIn = current.isUserSignedIn;
654
- if (this.isUserSignedIn) {
655
- this.currentPlan = current.account.billingPlan;
656
- this.currentPlanTitle = current.account.billingPlanAsString;
657
- this.requestedPlan = current.account.requestedBillingPlan;
658
- this.requestedPlanTitle = current.account.requestedBillingPlanAsString;
659
- }
660
- this.contextUpdated = true;
661
- }));
241
+ if (this.current != null) {
242
+ success(this.current);
243
+ return;
244
+ }
245
+ this.successes.push(success);
246
+ if (this.subscription != null) {
247
+ return;
248
+ }
249
+ this.subscription = this.get('GetCurrentContext', null).subscribe(data => {
250
+ this.dataReceived(data);
251
+ }, e => { });
662
252
  }
663
- }
664
- SubscribePlanButtonComponent.decorators = [
665
- { type: Component, args: [{
666
- selector: 'anatoly-subscribe-plan-button',
667
- template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"requestedPlan != null && requestedPlan != 0 && plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n [currentplantitle]=\"currentPlanTitle\"\r\n [requestedplan]=plan\r\n [requestedplantitle]=\"plantitle\">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n"
668
- }] }
669
- ];
670
- /** @nocollapse */
671
- SubscribePlanButtonComponent.ctorParameters = () => [
672
- { type: AppContextService }
253
+ dataReceived(data) {
254
+ this.current = data;
255
+ for (var i = 0; i < this.successes.length; i++) {
256
+ var success = this.successes[i];
257
+ success(data);
258
+ }
259
+ this.successes = [];
260
+ this.subscription.unsubscribe();
261
+ this.subscription = null;
262
+ this.current = null;
263
+ }
264
+ isUserSignedIn() {
265
+ return window.__context_isUserSignedIn;
266
+ }
267
+ isUserAdmin() {
268
+ return window.__context_isUserAdmin;
269
+ }
270
+ };
271
+ AppContextService.ctorParameters = () => [
272
+ { type: HttpClient }
673
273
  ];
674
- SubscribePlanButtonComponent.propDecorators = {
675
- plan: [{ type: Input }],
676
- plantitle: [{ type: Input }]
274
+ AppContextService = __decorate([
275
+ Injectable()
276
+ ], AppContextService);
277
+
278
+ /*
279
+ <file>
280
+ Authors:
281
+ Vadim Osovitny
282
+
283
+ Created:
284
+ 10 Nov 2017
285
+
286
+ Version:
287
+ 1.0
288
+
289
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
290
+ </file>
291
+ */
292
+ let AnatolyCoreModule = class AnatolyCoreModule {
677
293
  };
678
- if (false) {
679
- /** @type {?} */
680
- SubscribePlanButtonComponent.prototype.contextUpdated;
681
- /** @type {?} */
682
- SubscribePlanButtonComponent.prototype.isUserSignedIn;
683
- /** @type {?} */
684
- SubscribePlanButtonComponent.prototype.currentPlan;
685
- /** @type {?} */
686
- SubscribePlanButtonComponent.prototype.currentPlanTitle;
687
- /** @type {?} */
688
- SubscribePlanButtonComponent.prototype.requestedPlan;
689
- /** @type {?} */
690
- SubscribePlanButtonComponent.prototype.requestedPlanTitle;
691
- /** @type {?} */
692
- SubscribePlanButtonComponent.prototype.plan;
693
- /** @type {?} */
694
- SubscribePlanButtonComponent.prototype.plantitle;
695
- /**
696
- * @type {?}
697
- * @private
698
- */
699
- SubscribePlanButtonComponent.prototype.appcontext;
700
- }
294
+ AnatolyCoreModule = __decorate([
295
+ NgModule({
296
+ imports: [
297
+ CommonModule,
298
+ HttpClientModule,
299
+ HttpClientXsrfModule,
300
+ HttpClientJsonpModule
301
+ ],
302
+ exports: [
303
+ CommonModule,
304
+ HttpClientModule,
305
+ HttpClientXsrfModule,
306
+ HttpClientJsonpModule
307
+ ],
308
+ declarations: [],
309
+ providers: [
310
+ AppContextService
311
+ ]
312
+ })
313
+ ], AnatolyCoreModule);
701
314
 
702
- /**
703
- * @fileoverview added by tsickle
704
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
705
- */
706
- class BaseBillingApiService extends BaseApiService {
707
- /**
708
- * @param {?} http
709
- */
315
+ // Base
316
+
317
+ /*
318
+ <file>
319
+ Authors:
320
+ Vadim Osovitny
321
+
322
+ Created:
323
+ 12 Nov 2017
324
+
325
+ Version:
326
+ 1.0
327
+
328
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
329
+ </file>
330
+ */
331
+ let BaseBillingApiService = class BaseBillingApiService extends BaseApiService {
710
332
  constructor(http) {
711
333
  super(http);
712
334
  this.http = http;
713
335
  this.baseUrl += 'billing/';
714
336
  }
715
- /**
716
- * @param {?} requestedPlan
717
- * @param {?=} success
718
- * @param {?=} error
719
- * @return {?}
720
- */
721
337
  requestNewSubscription(requestedPlan, success, error) {
722
338
  this.postQS('requestNewSubscription', { requestedPlan: requestedPlan })
723
- .subscribe((/**
724
- * @param {?} data
725
- * @return {?}
726
- */
727
- data => { }), (/**
728
- * @param {?} e
729
- * @return {?}
730
- */
731
- e => { if (error)
732
- error(); }), (/**
733
- * @return {?}
734
- */
735
- () => { if (success)
736
- success(); }));
737
- }
738
- /**
739
- * @param {?=} success
740
- * @param {?=} error
741
- * @return {?}
742
- */
339
+ .subscribe(data => { }, e => { if (error)
340
+ error(); }, () => { if (success)
341
+ success(); });
342
+ }
743
343
  cancelRequestedSubscription(success, error) {
744
344
  this.postQS('cancelRequestedSubscription', null)
745
- .subscribe((/**
746
- * @param {?} data
747
- * @return {?}
748
- */
749
- data => { }), (/**
750
- * @param {?} e
751
- * @return {?}
752
- */
753
- e => { if (error)
754
- error(); }), (/**
755
- * @return {?}
756
- */
757
- () => { if (success)
758
- success(); }));
759
- }
760
- /**
761
- * @param {?} requestedPlan
762
- * @param {?=} success
763
- * @param {?=} error
764
- * @return {?}
765
- */
345
+ .subscribe(data => { }, e => { if (error)
346
+ error(); }, () => { if (success)
347
+ success(); });
348
+ }
766
349
  buyAccess(requestedPlan, success, error) {
767
350
  this.postQS('buyAccess', { requestedPlan: requestedPlan })
768
- .subscribe((/**
769
- * @param {?} data
770
- * @return {?}
771
- */
772
- data => { }), (/**
773
- * @param {?} e
774
- * @return {?}
775
- */
776
- e => { if (error)
777
- error(); }), (/**
778
- * @return {?}
779
- */
780
- () => { if (success)
781
- success(); }));
351
+ .subscribe(data => { }, e => { if (error)
352
+ error(); }, () => { if (success)
353
+ success(); });
782
354
  }
783
- }
784
- BaseBillingApiService.decorators = [
785
- { type: Injectable }
786
- ];
787
- /** @nocollapse */
355
+ };
788
356
  BaseBillingApiService.ctorParameters = () => [
789
357
  { type: HttpClient }
790
358
  ];
791
- if (false) {
792
- /**
793
- * @type {?}
794
- * @protected
795
- */
796
- BaseBillingApiService.prototype.http;
797
- }
359
+ BaseBillingApiService = __decorate([
360
+ Injectable()
361
+ ], BaseBillingApiService);
798
362
 
799
- /**
800
- * @fileoverview added by tsickle
801
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
802
- */
803
- class UpgradePlanButtonComponent {
804
- /**
805
- * @param {?} api
806
- */
807
- constructor(api) {
363
+ /*
364
+ <file>
365
+ Authors:
366
+ Vadim Osovitny
367
+
368
+ Created:
369
+ 14 Aug 2018
370
+
371
+ Version:
372
+ 1.0
373
+
374
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
375
+ </file>
376
+ */
377
+ let BuyAccessButtonComponent = class BuyAccessButtonComponent {
378
+ constructor(appcontext, api) {
379
+ this.appcontext = appcontext;
808
380
  this.api = api;
381
+ this.contextUpdated = false;
382
+ this.isUserSignedIn = false;
383
+ this.currentPlan = 0;
384
+ this.currentPlanTitle = "";
809
385
  }
810
- /**
811
- * @return {?}
812
- */
813
- onUpgradePlan() {
814
- /** @type {?} */
815
- const text = `Current plan: ${this.currentplantitle} New plan: ${this.requestedplantitle}`;
816
- /** @type {?} */
386
+ ngOnInit() {
387
+ if (!this.appcontext.isUserSignedIn()) {
388
+ this.contextUpdated = true;
389
+ return;
390
+ }
391
+ this.appcontext.getCurrent((current) => {
392
+ this.isUserSignedIn = current.isUserSignedIn;
393
+ if (this.isUserSignedIn) {
394
+ this.currentPlan = current.account.billingPlan;
395
+ this.currentPlanTitle = current.account.billingPlanAsString;
396
+ }
397
+ this.contextUpdated = true;
398
+ });
399
+ }
400
+ onBuyPlan() {
401
+ const text = `Requested plan: ${this.plantitle} `;
817
402
  var that = this;
818
- osovitny.ui.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', (/**
819
- * @return {?}
820
- */
821
- () => {
822
- that.api.requestNewSubscription(that.requestedplan, (/**
823
- * @return {?}
824
- */
825
- () => {
826
- osovitny.ui.alertSuccess('Your request for changing plan has been sent.', null, (/**
827
- * @return {?}
828
- */
829
- () => {
830
- ((/** @type {?} */ (window))).location.reload();
831
- }));
832
- }));
833
- }));
403
+ osovitny.ui.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', () => {
404
+ that.api.buyAccess(that.plan, () => {
405
+ osovitny.ui.alertSuccess('Access Granted', null, () => {
406
+ window.location.reload();
407
+ });
408
+ });
409
+ });
834
410
  }
835
- }
836
- UpgradePlanButtonComponent.decorators = [
837
- { type: Component, args: [{
838
- selector: 'anatoly-upgrade-plan-button',
839
- template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n"
840
- }] }
841
- ];
842
- /** @nocollapse */
843
- UpgradePlanButtonComponent.ctorParameters = () => [
411
+ };
412
+ BuyAccessButtonComponent.ctorParameters = () => [
413
+ { type: AppContextService },
844
414
  { type: BaseBillingApiService }
845
415
  ];
846
- UpgradePlanButtonComponent.propDecorators = {
847
- currentplantitle: [{ type: Input }],
848
- requestedplan: [{ type: Input }],
849
- requestedplantitle: [{ type: Input }]
850
- };
851
- if (false) {
852
- /** @type {?} */
853
- UpgradePlanButtonComponent.prototype.currentplantitle;
854
- /** @type {?} */
855
- UpgradePlanButtonComponent.prototype.requestedplan;
856
- /** @type {?} */
857
- UpgradePlanButtonComponent.prototype.requestedplantitle;
858
- /**
859
- * @type {?}
860
- * @private
861
- */
862
- UpgradePlanButtonComponent.prototype.api;
863
- }
416
+ __decorate([
417
+ Input()
418
+ ], BuyAccessButtonComponent.prototype, "plan", void 0);
419
+ __decorate([
420
+ Input()
421
+ ], BuyAccessButtonComponent.prototype, "plantitle", void 0);
422
+ BuyAccessButtonComponent = __decorate([
423
+ Component({
424
+ selector: 'anatoly-buyaccess-button',
425
+ template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n"
426
+ })
427
+ ], BuyAccessButtonComponent);
864
428
 
865
- /**
866
- * @fileoverview added by tsickle
867
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
868
- */
869
- class BuyAccessButtonComponent {
870
- /**
871
- * @param {?} appcontext
872
- * @param {?} api
873
- */
874
- constructor(appcontext, api) {
429
+ /*
430
+ <file>
431
+ Authors:
432
+ Vadim Osovitny
433
+
434
+ Created:
435
+ 1 Jun 2018
436
+
437
+ Version:
438
+ 1.0
439
+
440
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
441
+ </file>
442
+ */
443
+ let SubscribePlanButtonComponent = class SubscribePlanButtonComponent {
444
+ constructor(appcontext) {
875
445
  this.appcontext = appcontext;
876
- this.api = api;
877
446
  this.contextUpdated = false;
878
447
  this.isUserSignedIn = false;
879
448
  this.currentPlan = 0;
880
449
  this.currentPlanTitle = "";
450
+ this.requestedPlan = 0;
451
+ this.requestedPlanTitle = "";
881
452
  }
882
- /**
883
- * @return {?}
884
- */
885
453
  ngOnInit() {
886
454
  if (!this.appcontext.isUserSignedIn()) {
887
455
  this.contextUpdated = true;
888
456
  return;
889
457
  }
890
- this.appcontext.getCurrent((/**
891
- * @param {?} current
892
- * @return {?}
893
- */
894
- (current) => {
458
+ this.appcontext.getCurrent((current) => {
895
459
  this.isUserSignedIn = current.isUserSignedIn;
896
460
  if (this.isUserSignedIn) {
897
461
  this.currentPlan = current.account.billingPlan;
898
462
  this.currentPlanTitle = current.account.billingPlanAsString;
463
+ this.requestedPlan = current.account.requestedBillingPlan;
464
+ this.requestedPlanTitle = current.account.requestedBillingPlanAsString;
899
465
  }
900
466
  this.contextUpdated = true;
901
- }));
467
+ });
468
+ }
469
+ };
470
+ SubscribePlanButtonComponent.ctorParameters = () => [
471
+ { type: AppContextService }
472
+ ];
473
+ __decorate([
474
+ Input()
475
+ ], SubscribePlanButtonComponent.prototype, "plan", void 0);
476
+ __decorate([
477
+ Input()
478
+ ], SubscribePlanButtonComponent.prototype, "plantitle", void 0);
479
+ SubscribePlanButtonComponent = __decorate([
480
+ Component({
481
+ selector: 'anatoly-subscribe-plan-button',
482
+ template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"requestedPlan != null && requestedPlan != 0 && plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n [currentplantitle]=\"currentPlanTitle\"\r\n [requestedplan]=plan\r\n [requestedplantitle]=\"plantitle\">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n"
483
+ })
484
+ ], SubscribePlanButtonComponent);
485
+
486
+ /*
487
+ <file>
488
+ Authors:
489
+ Vadim Osovitny
490
+
491
+ Created:
492
+ 12 Nov 2017
493
+
494
+ Version:
495
+ 1.0
496
+
497
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
498
+ </file>
499
+ */
500
+ let UpgradePlanButtonComponent = class UpgradePlanButtonComponent {
501
+ constructor(api) {
502
+ this.api = api;
902
503
  }
903
- /**
904
- * @return {?}
905
- */
906
- onBuyPlan() {
907
- /** @type {?} */
908
- const text = `Requested plan: ${this.plantitle} `;
909
- /** @type {?} */
504
+ onUpgradePlan() {
505
+ const text = `Current plan: ${this.currentplantitle} New plan: ${this.requestedplantitle}`;
910
506
  var that = this;
911
- osovitny.ui.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', (/**
912
- * @return {?}
913
- */
914
- () => {
915
- that.api.buyAccess(that.plan, (/**
916
- * @return {?}
917
- */
918
- () => {
919
- osovitny.ui.alertSuccess('Access Granted', null, (/**
920
- * @return {?}
921
- */
922
- () => {
923
- ((/** @type {?} */ (window))).location.reload();
924
- }));
925
- }));
926
- }));
507
+ osovitny.ui.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', () => {
508
+ that.api.requestNewSubscription(that.requestedplan, () => {
509
+ osovitny.ui.alertSuccess('Your request for changing plan has been sent.', null, () => {
510
+ window.location.reload();
511
+ });
512
+ });
513
+ });
927
514
  }
928
- }
929
- BuyAccessButtonComponent.decorators = [
930
- { type: Component, args: [{
931
- selector: 'anatoly-buyaccess-button',
932
- template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n"
933
- }] }
934
- ];
935
- /** @nocollapse */
936
- BuyAccessButtonComponent.ctorParameters = () => [
937
- { type: AppContextService },
515
+ };
516
+ UpgradePlanButtonComponent.ctorParameters = () => [
938
517
  { type: BaseBillingApiService }
939
518
  ];
940
- BuyAccessButtonComponent.propDecorators = {
941
- plan: [{ type: Input }],
942
- plantitle: [{ type: Input }]
519
+ __decorate([
520
+ Input()
521
+ ], UpgradePlanButtonComponent.prototype, "currentplantitle", void 0);
522
+ __decorate([
523
+ Input()
524
+ ], UpgradePlanButtonComponent.prototype, "requestedplan", void 0);
525
+ __decorate([
526
+ Input()
527
+ ], UpgradePlanButtonComponent.prototype, "requestedplantitle", void 0);
528
+ UpgradePlanButtonComponent = __decorate([
529
+ Component({
530
+ selector: 'anatoly-upgrade-plan-button',
531
+ template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n"
532
+ })
533
+ ], UpgradePlanButtonComponent);
534
+
535
+ /*
536
+ <file>
537
+ Authors:
538
+ Vadim Osovitny
539
+
540
+ Created:
541
+ 4 Jul 2018
542
+
543
+ Version:
544
+ 1.0
545
+
546
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
547
+ </file>
548
+ */
549
+ let SignInButtonComponent = class SignInButtonComponent {
550
+ constructor() { }
943
551
  };
944
- if (false) {
945
- /** @type {?} */
946
- BuyAccessButtonComponent.prototype.contextUpdated;
947
- /** @type {?} */
948
- BuyAccessButtonComponent.prototype.isUserSignedIn;
949
- /** @type {?} */
950
- BuyAccessButtonComponent.prototype.currentPlan;
951
- /** @type {?} */
952
- BuyAccessButtonComponent.prototype.currentPlanTitle;
953
- /** @type {?} */
954
- BuyAccessButtonComponent.prototype.plan;
955
- /** @type {?} */
956
- BuyAccessButtonComponent.prototype.plantitle;
957
- /**
958
- * @type {?}
959
- * @private
960
- */
961
- BuyAccessButtonComponent.prototype.appcontext;
962
- /**
963
- * @type {?}
964
- * @private
965
- */
966
- BuyAccessButtonComponent.prototype.api;
967
- }
552
+ __decorate([
553
+ Input()
554
+ ], SignInButtonComponent.prototype, "classbtn", void 0);
555
+ SignInButtonComponent = __decorate([
556
+ Component({
557
+ selector: 'anatoly-signin-button',
558
+ template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
559
+ })
560
+ ], SignInButtonComponent);
968
561
 
969
- /**
970
- * @fileoverview added by tsickle
971
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
972
- */
973
- class AnatolyBillingModule {
974
- }
975
- AnatolyBillingModule.decorators = [
976
- { type: NgModule, args: [{
977
- imports: [
978
- CommonModule,
979
- HttpClientModule,
980
- HttpClientXsrfModule,
981
- HttpClientJsonpModule,
982
- AnatolyIdentityModule
983
- ],
984
- exports: [
985
- CommonModule,
986
- HttpClientModule,
987
- HttpClientXsrfModule,
988
- HttpClientJsonpModule,
989
- SubscribePlanButtonComponent,
990
- UpgradePlanButtonComponent,
991
- BuyAccessButtonComponent
992
- ],
993
- declarations: [
994
- SubscribePlanButtonComponent,
995
- UpgradePlanButtonComponent,
996
- BuyAccessButtonComponent
997
- ],
998
- providers: [
999
- BaseBillingApiService
1000
- ]
1001
- },] }
1002
- ];
562
+ /*
563
+ <file>
564
+ Authors:
565
+ Vadim Osovitny
566
+
567
+ Created:
568
+ 4 Jul 2018
569
+
570
+ Version:
571
+ 1.0
572
+
573
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
574
+ </file>
575
+ */
576
+ let SignOutButtonComponent = class SignOutButtonComponent {
577
+ constructor() { }
578
+ };
579
+ __decorate([
580
+ Input()
581
+ ], SignOutButtonComponent.prototype, "classbtn", void 0);
582
+ SignOutButtonComponent = __decorate([
583
+ Component({
584
+ selector: 'anatoly-signout-button',
585
+ template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
586
+ })
587
+ ], SignOutButtonComponent);
1003
588
 
1004
- /**
1005
- * @fileoverview added by tsickle
1006
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1007
- */
589
+ /*
590
+ <file>
591
+ Authors:
592
+ Vadim Osovitny
593
+
594
+ Created:
595
+ 4 Jul 2018
596
+
597
+ Version:
598
+ 1.0
599
+
600
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
601
+ </file>
602
+ */
603
+ let SignUpButtonComponent = class SignUpButtonComponent {
604
+ constructor() {
605
+ }
606
+ };
607
+ __decorate([
608
+ Input()
609
+ ], SignUpButtonComponent.prototype, "classbtn", void 0);
610
+ SignUpButtonComponent = __decorate([
611
+ Component({
612
+ selector: 'anatoly-signup-button',
613
+ template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
614
+ })
615
+ ], SignUpButtonComponent);
616
+
617
+ /*
618
+ <file>
619
+ Authors:
620
+ Vadim Osovitny
621
+
622
+ Created:
623
+ 4 Jul 2018
624
+
625
+ Version:
626
+ 1.0
627
+
628
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
629
+ </file>
630
+ */
631
+ let AnatolyIdentityModule = class AnatolyIdentityModule {
632
+ };
633
+ AnatolyIdentityModule = __decorate([
634
+ NgModule({
635
+ imports: [],
636
+ exports: [
637
+ SignInButtonComponent,
638
+ SignUpButtonComponent,
639
+ SignOutButtonComponent
640
+ ],
641
+ declarations: [
642
+ SignInButtonComponent,
643
+ SignUpButtonComponent,
644
+ SignOutButtonComponent
645
+ ],
646
+ providers: []
647
+ })
648
+ ], AnatolyIdentityModule);
649
+
650
+ // Components
651
+
652
+ /*
653
+ <file>
654
+ Authors:
655
+ Vadim Osovitny
656
+
657
+ Created:
658
+ 10 Nov 2017
659
+
660
+ Version:
661
+ 1.0
662
+
663
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
664
+ </file>
665
+ */
666
+ let AnatolyBillingModule = class AnatolyBillingModule {
667
+ };
668
+ AnatolyBillingModule = __decorate([
669
+ NgModule({
670
+ imports: [
671
+ CommonModule,
672
+ HttpClientModule,
673
+ HttpClientXsrfModule,
674
+ HttpClientJsonpModule,
675
+ AnatolyIdentityModule
676
+ ],
677
+ exports: [
678
+ CommonModule,
679
+ HttpClientModule,
680
+ HttpClientXsrfModule,
681
+ HttpClientJsonpModule,
682
+ SubscribePlanButtonComponent,
683
+ UpgradePlanButtonComponent,
684
+ BuyAccessButtonComponent
685
+ ],
686
+ declarations: [
687
+ SubscribePlanButtonComponent,
688
+ UpgradePlanButtonComponent,
689
+ BuyAccessButtonComponent
690
+ ],
691
+ providers: [
692
+ BaseBillingApiService
693
+ ]
694
+ })
695
+ ], AnatolyBillingModule);
696
+
697
+ // Components
1008
698
 
1009
- /**
1010
- * @fileoverview added by tsickle
1011
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1012
- */
1013
699
  /*
1014
700
  <file>
1015
701
  Authors:
@@ -1027,71 +713,54 @@ AnatolyBillingModule.decorators = [
1027
713
  class BaseComponent {
1028
714
  constructor() {
1029
715
  }
1030
- /**
1031
- * @return {?}
1032
- */
1033
716
  getQSId() {
1034
- /** @type {?} */
1035
717
  var id = osovitny.utils.getValueByNameInQS("id");
1036
718
  if (typeof id === 'undefined' || id == '')
1037
719
  return null;
1038
720
  return id;
1039
721
  }
1040
- /**
1041
- * @return {?}
1042
- */
1043
722
  showLoading() {
1044
- /** @type {?} */
1045
723
  var panelLoading = $('#pnlLoading');
1046
724
  panelLoading.show();
1047
725
  }
1048
- /**
1049
- * @return {?}
1050
- */
1051
726
  hideLoading() {
1052
- /** @type {?} */
1053
727
  var panelLoading = $('#pnlLoading');
1054
728
  panelLoading.hide();
1055
729
  }
1056
- /**
1057
- * @param {?} e
1058
- * @return {?}
1059
- */
1060
730
  handleError(e) {
1061
731
  this.hideLoading();
1062
732
  osovitny.ui.errorOccurred();
1063
733
  }
1064
734
  }
1065
735
 
1066
- /**
1067
- * @fileoverview added by tsickle
1068
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1069
- */
736
+ /*
737
+ <file>
738
+ Authors:
739
+ Vadim Osovitny
740
+
741
+ Created:
742
+ 20 Nov 2017
743
+
744
+ Version:
745
+ 1.0
746
+
747
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
748
+ </file>
749
+ */
1070
750
  class BaseEditComponent extends BaseComponent {
1071
751
  constructor() {
1072
752
  super();
1073
753
  this.formSubmitted = false;
1074
754
  }
1075
- /**
1076
- * @return {?}
1077
- */
1078
755
  isActionAdding() {
1079
- /** @type {?} */
1080
756
  var id = osovitny.utils.getValueByNameInQS("id");
1081
757
  if (typeof id === 'undefined' || id == '')
1082
758
  return true;
1083
759
  return false;
1084
760
  }
1085
- /**
1086
- * @return {?}
1087
- */
1088
761
  getEntityId() {
1089
762
  return this.getQSId();
1090
763
  }
1091
- /**
1092
- * @param {?} name
1093
- * @return {?}
1094
- */
1095
764
  isItemInvalid(name) {
1096
765
  if (typeof name === 'undefined' || name == '') {
1097
766
  return false;
@@ -1102,105 +771,93 @@ class BaseEditComponent extends BaseComponent {
1102
771
  }
1103
772
  return false;
1104
773
  }
1105
- /**
1106
- * @param {?} name
1107
- * @return {?}
1108
- */
1109
774
  getFormValue(name) {
1110
775
  return this.formGroup.controls[name].value;
1111
776
  }
1112
- /**
1113
- * @param {?} name
1114
- * @param {?} value
1115
- * @return {?}
1116
- */
1117
777
  setFormValue(name, value) {
1118
778
  this.formGroup.controls[name].setValue(value);
1119
779
  }
1120
- /**
1121
- * @param {?} groupName
1122
- * @param {?} name
1123
- * @return {?}
1124
- */
1125
780
  getFormGroupValue(groupName, name) {
1126
781
  return this.formGroup.controls[groupName].get(name).value;
1127
782
  }
1128
- /**
1129
- * @param {?} groupName
1130
- * @param {?} name
1131
- * @param {?} value
1132
- * @return {?}
1133
- */
1134
783
  setFormGroupValue(groupName, name, value) {
1135
784
  this.formGroup.controls[groupName].get(name).setValue(value);
1136
785
  }
1137
786
  }
1138
- BaseEditComponent.propDecorators = {
1139
- formGroup: [{ type: Input }],
1140
- formSubmitted: [{ type: Input }]
787
+ __decorate([
788
+ Input()
789
+ ], BaseEditComponent.prototype, "formGroup", void 0);
790
+ __decorate([
791
+ Input()
792
+ ], BaseEditComponent.prototype, "formSubmitted", void 0);
793
+
794
+ /*
795
+ <file>
796
+ Authors:
797
+ Anatoly Osovitny
798
+
799
+ Created:
800
+ 23 Apr 2018
801
+
802
+ Version:
803
+ 1.0
804
+
805
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
806
+ </file>
807
+ */
808
+ let ContentHeaderComponent = class ContentHeaderComponent {
809
+ ngOnInit() {
810
+ if (this.title == null) {
811
+ this.title = '';
812
+ }
813
+ }
1141
814
  };
1142
- if (false) {
1143
- /** @type {?} */
1144
- BaseEditComponent.prototype.formGroup;
1145
- /** @type {?} */
1146
- BaseEditComponent.prototype.formSubmitted;
1147
- }
815
+ __decorate([
816
+ Input()
817
+ ], ContentHeaderComponent.prototype, "title", void 0);
818
+ ContentHeaderComponent = __decorate([
819
+ Component({
820
+ selector: 'anatoly-content-header',
821
+ template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
822
+ })
823
+ ], ContentHeaderComponent);
1148
824
 
1149
- /**
1150
- * @fileoverview added by tsickle
1151
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1152
- */
825
+ /*
826
+ <file>
827
+ Authors:
828
+ Vadim Osovitny
829
+
830
+ Created:
831
+ 8 Dec 2017
832
+
833
+ Version:
834
+ 1.0
835
+
836
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
837
+ </file>
838
+ */
1153
839
  class ValidationSummaryComponent extends BaseEditComponent {
1154
840
  constructor() {
1155
841
  super();
1156
842
  }
1157
- /**
1158
- * @return {?}
1159
- */
1160
843
  getFormValidationMessages() {
1161
- /** @type {?} */
1162
844
  let messages = [];
1163
- Object.keys(this.formGroup.controls).forEach((/**
1164
- * @param {?} k
1165
- * @return {?}
1166
- */
1167
- k => {
1168
- /** @type {?} */
845
+ Object.keys(this.formGroup.controls).forEach(k => {
1169
846
  var control = this.formGroup.controls[k];
1170
- if (((/** @type {?} */ (control))).controls != null) {
1171
- Object.keys(((/** @type {?} */ (control))).controls).forEach((/**
1172
- * @param {?} k
1173
- * @return {?}
1174
- */
1175
- k => {
1176
- /** @type {?} */
1177
- var child = ((/** @type {?} */ (control))).controls[k];
1178
- this.getValidationMessages(child, k).forEach((/**
1179
- * @param {?} m
1180
- * @return {?}
1181
- */
1182
- m => messages.push(m)));
1183
- }));
847
+ if (control.controls != null) {
848
+ Object.keys(control.controls).forEach(k => {
849
+ var child = control.controls[k];
850
+ this.getValidationMessages(child, k).forEach(m => messages.push(m));
851
+ });
1184
852
  }
1185
853
  else {
1186
- this.getValidationMessages(control, k).forEach((/**
1187
- * @param {?} m
1188
- * @return {?}
1189
- */
1190
- m => messages.push(m)));
854
+ this.getValidationMessages(control, k).forEach(m => messages.push(m));
1191
855
  }
1192
- }));
856
+ });
1193
857
  return messages;
1194
858
  }
1195
- /**
1196
- * @param {?} state
1197
- * @param {?=} thingName
1198
- * @return {?}
1199
- */
1200
859
  getValidationMessages(state, thingName) {
1201
- /** @type {?} */
1202
860
  let thing = state.path || thingName;
1203
- /** @type {?} */
1204
861
  let messages = [];
1205
862
  if (state.errors) {
1206
863
  for (let errorName in state.errors) {
@@ -1223,108 +880,136 @@ class ValidationSummaryComponent extends BaseEditComponent {
1223
880
  }
1224
881
  }
1225
882
 
1226
- /**
1227
- * @fileoverview added by tsickle
1228
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1229
- */
1230
- class FormValidationSummaryComponent extends ValidationSummaryComponent {
883
+ /*
884
+ <file>
885
+ Authors:
886
+ Vadim Osovitny
887
+
888
+ Created:
889
+ 7 Dec 2017
890
+
891
+ Version:
892
+ 1.0
893
+
894
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
895
+ </file>
896
+ */
897
+ let FormValidationSummaryComponent = class FormValidationSummaryComponent extends ValidationSummaryComponent {
1231
898
  constructor() {
1232
899
  super();
1233
900
  this.visible = false;
1234
901
  }
1235
- /**
1236
- * @return {?}
1237
- */
1238
902
  getErrors() {
1239
- /** @type {?} */
1240
903
  var messages = this.getFormValidationMessages();
1241
904
  return messages;
1242
905
  }
1243
- }
1244
- FormValidationSummaryComponent.decorators = [
1245
- { type: Component, args: [{
1246
- selector: 'anatoly-form-validation-summary',
1247
- template: "<div class=\"callout callout-danger\" *ngIf=\"visible\">\r\n <h4 class=\"box-title\">There are problems with the form</h4>\r\n <p *ngFor=\"let error of getErrors()\"><span class=\"help-block \" style=\"color:white\">{{error}}</span></p>\r\n</div>\r\n"
1248
- }] }
1249
- ];
1250
- /** @nocollapse */
1251
- FormValidationSummaryComponent.ctorParameters = () => [];
1252
- FormValidationSummaryComponent.propDecorators = {
1253
- visible: [{ type: Input }]
1254
906
  };
1255
- if (false) {
1256
- /** @type {?} */
1257
- FormValidationSummaryComponent.prototype.visible;
1258
- }
907
+ __decorate([
908
+ Input()
909
+ ], FormValidationSummaryComponent.prototype, "visible", void 0);
910
+ FormValidationSummaryComponent = __decorate([
911
+ Component({
912
+ selector: 'anatoly-form-validation-summary',
913
+ template: "<div class=\"callout callout-danger\" *ngIf=\"visible\">\r\n <h4 class=\"box-title\">There are problems with the form</h4>\r\n <p *ngFor=\"let error of getErrors()\"><span class=\"help-block \" style=\"color:white\">{{error}}</span></p>\r\n</div>\r\n"
914
+ })
915
+ ], FormValidationSummaryComponent);
1259
916
 
1260
- /**
1261
- * @fileoverview added by tsickle
1262
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1263
- */
1264
- class ItemValidationSummaryComponent extends ValidationSummaryComponent {
917
+ /*
918
+ <file>
919
+ Authors:
920
+ Vadim Osovitny
921
+
922
+ Created:
923
+ 6 Dec 2017
924
+
925
+ Version:
926
+ 1.0
927
+
928
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
929
+ </file>
930
+ */
931
+ let ItemValidationSummaryComponent = class ItemValidationSummaryComponent extends ValidationSummaryComponent {
1265
932
  constructor() {
1266
933
  super();
1267
934
  }
1268
- }
1269
- ItemValidationSummaryComponent.decorators = [
1270
- { type: Component, args: [{
1271
- selector: 'anatoly-item-validation-summary',
1272
- template: "<ul class=\"list-unstyled\" *ngIf=\"isItemInvalid(key)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(key), title)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>"
1273
- }] }
1274
- ];
1275
- /** @nocollapse */
1276
- ItemValidationSummaryComponent.ctorParameters = () => [];
1277
- ItemValidationSummaryComponent.propDecorators = {
1278
- key: [{ type: Input }],
1279
- title: [{ type: Input }]
1280
935
  };
1281
- if (false) {
1282
- /** @type {?} */
1283
- ItemValidationSummaryComponent.prototype.key;
1284
- /** @type {?} */
1285
- ItemValidationSummaryComponent.prototype.title;
1286
- }
936
+ __decorate([
937
+ Input()
938
+ ], ItemValidationSummaryComponent.prototype, "key", void 0);
939
+ __decorate([
940
+ Input()
941
+ ], ItemValidationSummaryComponent.prototype, "title", void 0);
942
+ ItemValidationSummaryComponent = __decorate([
943
+ Component({
944
+ selector: 'anatoly-item-validation-summary',
945
+ template: "<ul class=\"list-unstyled\" *ngIf=\"isItemInvalid(key)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(key), title)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>"
946
+ })
947
+ ], ItemValidationSummaryComponent);
1287
948
 
1288
- /**
1289
- * @fileoverview added by tsickle
1290
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1291
- */
1292
- class HtmlEditorComponent extends BaseEditComponent {
949
+ const ɵ0 = function (images) {
950
+ //let editor = this;
951
+ //alert("image.beforeUpload uploadType: " + editor.opts.imageUploadParams.uploadType + "_" + editor.opts.imageUploadParams.uploadParentId)
952
+ }, ɵ1 = function () {
953
+ }, ɵ2 = function () {
954
+ let editor = this;
955
+ //alert('contentChanged');
956
+ };
957
+ const DefaultEditorOptions = {
958
+ placeholderText: 'Edit Your Content Here',
959
+ charCounterCount: true,
960
+ heightMin: 100,
961
+ toolbarInline: false,
962
+ toolbarButtons: {
963
+ 'moreText': {
964
+ 'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript',
965
+ 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle']
966
+ },
967
+ 'moreParagraph': {
968
+ 'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify',
969
+ 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
970
+ },
971
+ 'moreRich': {
972
+ 'buttons': ['insertLink', 'insertImage', 'insertTable', 'emoticons', 'fontAwesome',
973
+ 'specialCharacters', 'embedly']
974
+ },
975
+ 'moreMisc': {
976
+ 'buttons': ['selectAll', 'clearFormatting', 'html', 'undo', 'redo', 'fullscreen'],
977
+ 'align': 'right',
978
+ }
979
+ },
980
+ /*
981
+ Upload:
982
+ https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
983
+ */
984
+ imageUploadURL: '/api/HtmlEditor/UploadImage',
985
+ imageAllowedTypes: ['jpeg', 'jpg', 'png'],
986
+ imageUploadParams: { uploadType: '', uploadParentId: '' },
987
+ //Events
988
+ events: {
989
+ 'image.beforeUpload': ɵ0,
990
+ 'initialized': ɵ1,
991
+ 'contentChanged': ɵ2
992
+ }
993
+ };
994
+
995
+ /*
996
+ <file>
997
+ Authors:
998
+ Anatoly Osovitny
999
+ Vadim Osovitny
1000
+
1001
+ Created:
1002
+ 12 Dec 2017
1003
+
1004
+ Version:
1005
+ 1.0
1006
+
1007
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
1008
+ </file>
1009
+ */
1010
+ let HtmlEditorComponent = class HtmlEditorComponent extends BaseEditComponent {
1293
1011
  constructor() {
1294
1012
  super(...arguments);
1295
- this._defaultEditorOptions = {
1296
- placeholderText: 'Edit Your Content Here',
1297
- charCounterCount: true,
1298
- heightMin: 100,
1299
- toolbarInline: false,
1300
- toolbarButtons: [
1301
- 'fullscreen', 'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', '|',
1302
- 'fontFamily', 'fontSize', 'color', 'inlineStyle', 'paragraphStyle', '|',
1303
- 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', '-',
1304
- 'insertLink', 'insertImage', 'insertTable', '|',
1305
- 'emoticons', 'specialCharacters', 'insertHR', 'selectAll', 'clearFormatting', '|',
1306
- 'print', 'help', 'html', '|', 'undo', 'redo'
1307
- ],
1308
- /*
1309
- Upload:
1310
- https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
1311
- */
1312
- imageUploadURL: '/api/HtmlEditor/UploadImage',
1313
- imageAllowedTypes: ['jpeg', 'jpg', 'png'],
1314
- imageUploadParams: { uploadType: '', uploadParentId: '' },
1315
- //Events
1316
- events: {
1317
- 'image.beforeUpload': (/**
1318
- * @param {?} images
1319
- * @return {?}
1320
- */
1321
- function (images) {
1322
- /** @type {?} */
1323
- let editor = this;
1324
- alert("v3 image.beforeUpload editor.opts.imageUploadParams.uploadType" + editor.opts.imageUploadParams.uploadType);
1325
- })
1326
- }
1327
- };
1328
1013
  this._editorInitialized = false;
1329
1014
  //General params
1330
1015
  this.editorId = '';
@@ -1334,289 +1019,153 @@ class HtmlEditorComponent extends BaseEditComponent {
1334
1019
  this.isFormBased = '1';
1335
1020
  this.editorFormKey = 'html';
1336
1021
  }
1337
- /**
1338
- * @return {?}
1339
- */
1340
1022
  ngOnInit() {
1341
- /** @type {?} */
1342
1023
  var opt = this.editorOptions;
1343
1024
  if (typeof this.editorOptions == "string") {
1344
1025
  opt = JSON.parse(this.editorOptions);
1345
1026
  }
1346
- /** @type {?} */
1347
- var newOptions = $.extend({}, this._defaultEditorOptions, opt);
1348
- /** @type {?} */
1349
- var key = ((/** @type {?} */ (window))).__froalaEditor_Key;
1027
+ var newOptions = $.extend({}, DefaultEditorOptions, opt);
1028
+ var key = window.__froalaEditor_Key;
1350
1029
  if (key) {
1351
1030
  newOptions = $.extend({}, JSON.parse('{ "key": "' + key + '" }'), newOptions);
1352
1031
  }
1353
1032
  this.options = newOptions;
1354
1033
  }
1355
- /**
1356
- * @return {?}
1357
- */
1358
- ngAfterViewInit() {
1359
- this.initializeEditor();
1360
- }
1361
- /**
1362
- * @param {?} control
1363
- * @return {?}
1364
- */
1365
- initializeControl(control) {
1366
- this._control = control;
1367
- }
1368
- /**
1369
- * @private
1370
- * @return {?}
1371
- */
1372
- initializeEditor() {
1034
+ doAfterEditorInitialized(action) {
1035
+ var that = this;
1036
+ var timeOut = 500;
1373
1037
  if (this._editorInitialized) {
1374
- return;
1375
- }
1376
- if (this._control) {
1377
- this._control.initialize();
1378
- //v2 BEGIN
1379
- /** @type {?} */
1380
- var jQueryEditor = this.getJQueryEditor();
1381
- /** @type {?} */
1382
- var that = this;
1383
- jQueryEditor.on('froalaEditor.image.beforeUpload', (/**
1384
- * @param {?} e
1385
- * @param {?} editor
1386
- * @param {?} images
1387
- * @return {?}
1388
- */
1389
- function (e, editor, images) {
1390
- /** @type {?} */
1391
- var options = that.options;
1392
- editor.opts.imageUploadParams.uploadType = options.imageUploadParams.uploadType;
1393
- editor.opts.imageUploadParams.uploadParentId = options.imageUploadParams.uploadParentId;
1394
- }));
1395
- //v2 END
1396
- this._editorInitialized = true;
1038
+ timeOut = 100;
1397
1039
  }
1040
+ setTimeout(function () { action(that); }, timeOut);
1398
1041
  }
1399
- /**
1400
- * @private
1401
- * @return {?}
1402
- */
1403
- getJQueryEditor() {
1404
- /** @type {?} */
1405
- var jQueryEditor = $('.htmleditor-' + this.editorId);
1406
- return jQueryEditor;
1407
- }
1408
- /**
1409
- * @private
1410
- * @return {?}
1411
- */
1412
1042
  getEditor() {
1413
1043
  if (this._control)
1414
1044
  return this._control.getEditor();
1415
1045
  return null;
1416
1046
  }
1417
1047
  //Public Funcs
1418
- /**
1419
- * @param {?} uploadType
1420
- * @param {?} uploadParentId
1421
- * @return {?}
1422
- */
1048
+ initializeControl(control) {
1049
+ this._control = control;
1050
+ this._control.initialize();
1051
+ this._editorInitialized = true;
1052
+ }
1423
1053
  setUploadParams(uploadType, uploadParentId) {
1424
- /** @type {?} */
1425
- var that = this;
1426
- /** @type {?} */
1427
- var timeOut = 1000;
1428
- if (this._editorInitialized) {
1429
- timeOut = 0;
1430
- }
1431
- setTimeout((/**
1432
- * @return {?}
1433
- */
1434
- function () {
1435
- /** @type {?} */
1436
- var newOptions = { imageUploadParams: { uploadType: '', uploadParentId: '' } };
1437
- newOptions.imageUploadParams.uploadType = uploadType;
1438
- newOptions.imageUploadParams.uploadParentId = uploadParentId;
1439
- that.options = $.extend({}, that.options, newOptions);
1440
- }), timeOut);
1441
- }
1442
- /**
1443
- * @param {?} content
1444
- * @return {?}
1445
- */
1054
+ this.doAfterEditorInitialized(function (that) {
1055
+ var editor = that.getEditor();
1056
+ if (typeof (editor) == "undefined" || editor == null) {
1057
+ return;
1058
+ }
1059
+ editor.opts.imageUploadParams.uploadType = uploadType;
1060
+ editor.opts.imageUploadParams.uploadParentId = uploadParentId;
1061
+ });
1062
+ }
1446
1063
  setHtml(content) {
1447
1064
  if (this.isFormBased == "1") {
1448
1065
  return;
1449
1066
  }
1450
- this.initializeEditor();
1451
- //v2
1452
- /** @type {?} */
1453
- var editor = this.getJQueryEditor();
1454
- if (typeof (editor) == "undefined" || editor == null) {
1455
- return;
1456
- }
1457
- editor.froalaEditor('html.set', content);
1458
- /*
1459
- //v3
1460
- var editor = this.getEditor();
1461
- if (typeof (editor) == "undefined" || editor == null) {
1462
- return;
1463
- }
1464
-
1465
- editor.html.set(content);
1466
- */
1067
+ this.doAfterEditorInitialized(function (that) {
1068
+ var editor = that.getEditor();
1069
+ if (typeof (editor) == "undefined" || editor == null) {
1070
+ return;
1071
+ }
1072
+ editor.html.set(content);
1073
+ });
1467
1074
  }
1468
- /**
1469
- * @return {?}
1470
- */
1471
1075
  getHtml() {
1472
1076
  if (this.isFormBased == "1") {
1473
- return;
1474
- }
1475
- //v2
1476
- /** @type {?} */
1477
- var editor = this.getJQueryEditor();
1478
- if (typeof (editor) == "undefined" || editor == null) {
1479
- return "";
1077
+ return null;
1480
1078
  }
1481
- return editor.froalaEditor('html.get');
1482
- /*
1483
- //v3
1484
1079
  var editor = this.getEditor();
1485
1080
  if (typeof (editor) == "undefined" || editor == null) {
1486
- return "";
1081
+ return;
1487
1082
  }
1488
-
1489
1083
  return editor.html.get(false);
1490
- */
1491
1084
  }
1492
- }
1493
- HtmlEditorComponent.decorators = [
1494
- { type: Component, args: [{
1495
- selector: 'anatoly-html-editor',
1496
- template: "<div [ngSwitch]=\"isFormBased\">\r\n <ng-template ngSwitchCase=\"0\">\r\n <label>{{ editorLabelText }}</label>\r\n <textarea id=\"htmleditor-{{editorId}}\" class=\"htmleditor-{{editorId}}\" \r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"1\">\r\n <div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isItemInvalid(editorFormKey) }\">\r\n <label class=\"control-label\">{{ editorLabelText }}</label>\r\n <textarea id=\"htmleditor-{{editorId}}\" class=\"htmleditor-{{editorId}}\"\r\n [formControlName]=\"editorFormKey\"\r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]=\"formGroup\"\r\n [formSubmitted]=\"formSubmitted\"\r\n [key]=\"editorFormKey\"\r\n [title]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</div>\r\n"
1497
- }] }
1498
- ];
1499
- HtmlEditorComponent.propDecorators = {
1500
- editorId: [{ type: Input }],
1501
- editorLabelText: [{ type: Input }],
1502
- editorOptions: [{ type: Input }],
1503
- isFormBased: [{ type: Input }],
1504
- editorFormKey: [{ type: Input }]
1505
1085
  };
1506
- if (false) {
1507
- /**
1508
- * @type {?}
1509
- * @private
1510
- */
1511
- HtmlEditorComponent.prototype._defaultEditorOptions;
1512
- /**
1513
- * @type {?}
1514
- * @private
1515
- */
1516
- HtmlEditorComponent.prototype._control;
1517
- /**
1518
- * @type {?}
1519
- * @private
1520
- */
1521
- HtmlEditorComponent.prototype._editorInitialized;
1522
- /** @type {?} */
1523
- HtmlEditorComponent.prototype.options;
1524
- /** @type {?} */
1525
- HtmlEditorComponent.prototype.editorId;
1526
- /** @type {?} */
1527
- HtmlEditorComponent.prototype.editorLabelText;
1528
- /** @type {?} */
1529
- HtmlEditorComponent.prototype.editorOptions;
1530
- /** @type {?} */
1531
- HtmlEditorComponent.prototype.isFormBased;
1532
- /** @type {?} */
1533
- HtmlEditorComponent.prototype.editorFormKey;
1534
- }
1086
+ __decorate([
1087
+ Input()
1088
+ ], HtmlEditorComponent.prototype, "editorId", void 0);
1089
+ __decorate([
1090
+ Input()
1091
+ ], HtmlEditorComponent.prototype, "editorLabelText", void 0);
1092
+ __decorate([
1093
+ Input()
1094
+ ], HtmlEditorComponent.prototype, "editorOptions", void 0);
1095
+ __decorate([
1096
+ Input()
1097
+ ], HtmlEditorComponent.prototype, "isFormBased", void 0);
1098
+ __decorate([
1099
+ Input()
1100
+ ], HtmlEditorComponent.prototype, "editorFormKey", void 0);
1101
+ HtmlEditorComponent = __decorate([
1102
+ Component({
1103
+ selector: 'anatoly-html-editor',
1104
+ template: "<div [ngSwitch]=\"isFormBased\">\r\n <ng-template ngSwitchCase=\"0\">\r\n <label>{{ editorLabelText }}</label>\r\n <textarea id=\"htmleditor-{{editorId}}\" class=\"htmleditor-{{editorId}}\" \r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"1\">\r\n <div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isItemInvalid(editorFormKey) }\">\r\n <label class=\"control-label\">{{ editorLabelText }}</label>\r\n <textarea id=\"htmleditor-{{editorId}}\" class=\"htmleditor-{{editorId}}\"\r\n [formControlName]=\"editorFormKey\"\r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]=\"formGroup\"\r\n [formSubmitted]=\"formSubmitted\"\r\n [key]=\"editorFormKey\"\r\n [title]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</div>\r\n"
1105
+ })
1106
+ ], HtmlEditorComponent);
1535
1107
 
1536
- /**
1537
- * @fileoverview added by tsickle
1538
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1539
- */
1540
- class ContentHeaderComponent {
1541
- /**
1542
- * @return {?}
1543
- */
1544
- ngOnInit() {
1545
- if (this.title == null) {
1546
- this.title = '';
1547
- }
1548
- }
1549
- }
1550
- ContentHeaderComponent.decorators = [
1551
- { type: Component, args: [{
1552
- selector: 'anatoly-content-header',
1553
- template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
1554
- }] }
1555
- ];
1556
- ContentHeaderComponent.propDecorators = {
1557
- title: [{ type: Input }]
1108
+ /*
1109
+ <file>
1110
+ Authors:
1111
+ Vadim Osovitny
1112
+
1113
+ Created:
1114
+ 3 Jun 2018
1115
+
1116
+ Version:
1117
+ 1.0
1118
+
1119
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
1120
+ </file>
1121
+ */
1122
+ let AnatolyUIModule = class AnatolyUIModule {
1558
1123
  };
1559
- if (false) {
1560
- /** @type {?} */
1561
- ContentHeaderComponent.prototype.title;
1562
- }
1124
+ AnatolyUIModule = __decorate([
1125
+ NgModule({
1126
+ imports: [
1127
+ CommonModule,
1128
+ ReactiveFormsModule,
1129
+ FormsModule,
1130
+ HttpClientModule,
1131
+ HttpClientXsrfModule,
1132
+ HttpClientJsonpModule,
1133
+ FroalaEditorModule.forRoot(),
1134
+ FroalaViewModule.forRoot(),
1135
+ GridModule,
1136
+ PopupModule,
1137
+ ButtonsModule,
1138
+ DropDownsModule
1139
+ ],
1140
+ exports: [
1141
+ CommonModule,
1142
+ HttpClientModule,
1143
+ HttpClientXsrfModule,
1144
+ HttpClientJsonpModule,
1145
+ ItemValidationSummaryComponent,
1146
+ FormValidationSummaryComponent,
1147
+ HtmlEditorComponent,
1148
+ ContentHeaderComponent
1149
+ ],
1150
+ declarations: [
1151
+ ItemValidationSummaryComponent,
1152
+ FormValidationSummaryComponent,
1153
+ HtmlEditorComponent,
1154
+ ContentHeaderComponent
1155
+ ],
1156
+ providers: [],
1157
+ schemas: [
1158
+ CUSTOM_ELEMENTS_SCHEMA,
1159
+ NO_ERRORS_SCHEMA
1160
+ ]
1161
+ })
1162
+ ], AnatolyUIModule);
1563
1163
 
1564
- /**
1565
- * @fileoverview added by tsickle
1566
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1567
- */
1568
- class AnatolyUIModule {
1569
- }
1570
- AnatolyUIModule.decorators = [
1571
- { type: NgModule, args: [{
1572
- imports: [
1573
- CommonModule,
1574
- ReactiveFormsModule,
1575
- FormsModule,
1576
- HttpClientModule,
1577
- HttpClientXsrfModule,
1578
- HttpClientJsonpModule,
1579
- FroalaEditorModule.forRoot(),
1580
- FroalaViewModule.forRoot(),
1581
- GridModule,
1582
- PopupModule,
1583
- ButtonsModule,
1584
- DropDownsModule
1585
- ],
1586
- exports: [
1587
- CommonModule,
1588
- HttpClientModule,
1589
- HttpClientXsrfModule,
1590
- HttpClientJsonpModule,
1591
- ItemValidationSummaryComponent,
1592
- FormValidationSummaryComponent,
1593
- HtmlEditorComponent,
1594
- ContentHeaderComponent
1595
- ],
1596
- declarations: [
1597
- ItemValidationSummaryComponent,
1598
- FormValidationSummaryComponent,
1599
- HtmlEditorComponent,
1600
- ContentHeaderComponent
1601
- ],
1602
- providers: []
1603
- },] }
1604
- ];
1605
-
1606
- /**
1607
- * @fileoverview added by tsickle
1608
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1609
- */
1610
-
1611
- /**
1612
- * @fileoverview added by tsickle
1613
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1614
- */
1164
+ // Base Components
1615
1165
 
1616
1166
  /**
1617
- * @fileoverview added by tsickle
1618
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1167
+ * Generated bundle index. Do not edit.
1619
1168
  */
1620
1169
 
1621
- export { AnatolyBillingModule, AnatolyCoreModule, AnatolyIdentityModule, AnatolyUIModule, AppContextService, BaseApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, HtmlEditorComponent };
1170
+ export { AnatolyBillingModule, AnatolyCoreModule, AnatolyIdentityModule, AnatolyUIModule, AppContextService, BaseApiService, BaseBillingApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, BuyAccessButtonComponent, ContentHeaderComponent, FormValidationSummaryComponent, HtmlEditorComponent, ItemValidationSummaryComponent, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, SubscribePlanButtonComponent, UpgradePlanButtonComponent, ValidationSummaryComponent };
1622
1171
  //# sourceMappingURL=osovitny-anatoly.js.map