@osovitny/anatoly 1.2.2 → 1.2.5

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