@osovitny/anatoly 1.2.0 → 1.2.1

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 (144) hide show
  1. package/ng-package.json +7 -0
  2. package/package.json +2 -13
  3. package/src/lib/billing/billing.module.ts +62 -0
  4. package/src/lib/billing/components/buyaccess/buyaccess-button.component.html +15 -0
  5. package/src/lib/billing/components/buyaccess/buyaccess-button.component.ts +70 -0
  6. package/src/lib/billing/components/subscriptions/subscribe-plan-button.component.html +21 -0
  7. package/src/lib/billing/components/subscriptions/subscribe-plan-button.component.ts +60 -0
  8. package/src/lib/billing/components/subscriptions/upgrade-plan-button.component.html +3 -0
  9. package/src/lib/billing/components/subscriptions/upgrade-plan-button.component.ts +47 -0
  10. package/{lib/billing/index.d.ts → src/lib/billing/index.ts} +6 -1
  11. package/src/lib/billing/services/base-billing-api.service.ts +56 -0
  12. package/src/lib/core/consts.ts +7 -0
  13. package/src/lib/core/core.module.ts +45 -0
  14. package/{lib/core/index.d.ts → src/lib/core/index.ts} +6 -1
  15. package/src/lib/core/services/appcontext.service.ts +81 -0
  16. package/src/lib/core/services/base-api.service.ts +87 -0
  17. package/src/lib/core/services/base-go.service.ts +33 -0
  18. package/src/lib/core/services/base-gridedit.service.ts +124 -0
  19. package/src/lib/identity/components/signin-button.component.html +1 -0
  20. package/src/lib/identity/components/signin-button.component.ts +27 -0
  21. package/src/lib/identity/components/signout-button.component.html +1 -0
  22. package/src/lib/identity/components/signout-button.component.ts +27 -0
  23. package/src/lib/identity/components/signup-button.component.html +1 -0
  24. package/src/lib/identity/components/signup-button.component.ts +28 -0
  25. package/src/lib/identity/identity.module.ts +41 -0
  26. package/{lib/identity/index.d.ts → src/lib/identity/index.ts} +4 -1
  27. package/src/lib/ui/components/base-edit.component.ts +77 -0
  28. package/src/lib/ui/components/base.component.ts +45 -0
  29. package/src/lib/ui/components/content-header/content-header.component.html +4 -0
  30. package/src/lib/ui/components/content-header/content-header.component.ts +32 -0
  31. package/src/lib/ui/components/html-editor/base-html-editor.component.ts +97 -0
  32. package/src/lib/ui/components/html-editor/forms-html-editor.component.html +14 -0
  33. package/src/lib/ui/components/html-editor/forms-html-editor.component.ts +35 -0
  34. package/src/lib/ui/components/html-editor/html-editor.component.html +6 -0
  35. package/src/lib/ui/components/html-editor/html-editor.component.ts +51 -0
  36. package/src/lib/ui/components/html-editor/html-editor.defaultoptions.ts +38 -0
  37. package/src/lib/ui/components/validation/form-validation-summary.component.html +4 -0
  38. package/src/lib/ui/components/validation/form-validation-summary.component.ts +36 -0
  39. package/src/lib/ui/components/validation/item-validation-summary.component.html +5 -0
  40. package/src/lib/ui/components/validation/item-validation-summary.component.ts +32 -0
  41. package/src/lib/ui/components/validation/validation-summary.component.ts +74 -0
  42. package/src/lib/ui/index.js +13 -0
  43. package/src/lib/ui/index.js.map +1 -0
  44. package/{lib/ui/index.d.ts → src/lib/ui/index.ts} +7 -1
  45. package/src/lib/ui/ui.module.ts +83 -0
  46. package/{public-api.d.ts → src/public-api.ts} +4 -4
  47. package/tsconfig.lib.json +32 -0
  48. package/tsconfig.lib.prod.json +6 -0
  49. package/tslint.json +17 -0
  50. package/typings/osovitny-ui/index.d.ts +24 -0
  51. package/bundles/osovitny-anatoly.umd.js +0 -1434
  52. package/bundles/osovitny-anatoly.umd.js.map +0 -1
  53. package/bundles/osovitny-anatoly.umd.min.js +0 -16
  54. package/bundles/osovitny-anatoly.umd.min.js.map +0 -1
  55. package/esm2015/lib/billing/billing.module.js +0 -60
  56. package/esm2015/lib/billing/components/buyaccess/buyaccess-button.component.js +0 -73
  57. package/esm2015/lib/billing/components/subscriptions/subscribe-plan-button.component.js +0 -63
  58. package/esm2015/lib/billing/components/subscriptions/upgrade-plan-button.component.js +0 -55
  59. package/esm2015/lib/billing/index.js +0 -9
  60. package/esm2015/lib/billing/services/base-billing-api.service.js +0 -53
  61. package/esm2015/lib/core/consts.js +0 -11
  62. package/esm2015/lib/core/core.module.js +0 -45
  63. package/esm2015/lib/core/index.js +0 -9
  64. package/esm2015/lib/core/services/appcontext.service.js +0 -72
  65. package/esm2015/lib/core/services/base-api.service.js +0 -71
  66. package/esm2015/lib/core/services/base-go.service.js +0 -36
  67. package/esm2015/lib/core/services/base-gridedit.service.js +0 -98
  68. package/esm2015/lib/identity/components/signin-button.component.js +0 -30
  69. package/esm2015/lib/identity/components/signout-button.component.js +0 -30
  70. package/esm2015/lib/identity/components/signup-button.component.js +0 -31
  71. package/esm2015/lib/identity/identity.module.js +0 -41
  72. package/esm2015/lib/identity/index.js +0 -7
  73. package/esm2015/lib/ui/components/base-edit.component.js +0 -63
  74. package/esm2015/lib/ui/components/base.component.js +0 -37
  75. package/esm2015/lib/ui/components/content-header/content-header.component.js +0 -35
  76. package/esm2015/lib/ui/components/html-editor/html-editor.component.js +0 -121
  77. package/esm2015/lib/ui/components/html-editor/html-editor.consts.js +0 -47
  78. package/esm2015/lib/ui/components/validation/form-validation-summary.component.js +0 -39
  79. package/esm2015/lib/ui/components/validation/item-validation-summary.component.js +0 -37
  80. package/esm2015/lib/ui/components/validation/validation-summary.component.js +0 -60
  81. package/esm2015/lib/ui/index.js +0 -12
  82. package/esm2015/lib/ui/ui.module.js +0 -74
  83. package/esm2015/osovitny-anatoly.js +0 -5
  84. package/esm2015/public-api.js +0 -5
  85. package/esm5/lib/billing/billing.module.js +0 -63
  86. package/esm5/lib/billing/components/buyaccess/buyaccess-button.component.js +0 -75
  87. package/esm5/lib/billing/components/subscriptions/subscribe-plan-button.component.js +0 -65
  88. package/esm5/lib/billing/components/subscriptions/upgrade-plan-button.component.js +0 -56
  89. package/esm5/lib/billing/index.js +0 -9
  90. package/esm5/lib/billing/services/base-billing-api.service.js +0 -56
  91. package/esm5/lib/core/consts.js +0 -11
  92. package/esm5/lib/core/core.module.js +0 -48
  93. package/esm5/lib/core/index.js +0 -9
  94. package/esm5/lib/core/services/appcontext.service.js +0 -76
  95. package/esm5/lib/core/services/base-api.service.js +0 -72
  96. package/esm5/lib/core/services/base-go.service.js +0 -37
  97. package/esm5/lib/core/services/base-gridedit.service.js +0 -104
  98. package/esm5/lib/identity/components/signin-button.component.js +0 -32
  99. package/esm5/lib/identity/components/signout-button.component.js +0 -32
  100. package/esm5/lib/identity/components/signup-button.component.js +0 -32
  101. package/esm5/lib/identity/identity.module.js +0 -44
  102. package/esm5/lib/identity/index.js +0 -7
  103. package/esm5/lib/ui/components/base-edit.component.js +0 -67
  104. package/esm5/lib/ui/components/base.component.js +0 -39
  105. package/esm5/lib/ui/components/content-header/content-header.component.js +0 -38
  106. package/esm5/lib/ui/components/html-editor/html-editor.component.js +0 -124
  107. package/esm5/lib/ui/components/html-editor/html-editor.consts.js +0 -47
  108. package/esm5/lib/ui/components/validation/form-validation-summary.component.js +0 -42
  109. package/esm5/lib/ui/components/validation/item-validation-summary.component.js +0 -39
  110. package/esm5/lib/ui/components/validation/validation-summary.component.js +0 -65
  111. package/esm5/lib/ui/index.js +0 -12
  112. package/esm5/lib/ui/ui.module.js +0 -77
  113. package/esm5/osovitny-anatoly.js +0 -5
  114. package/esm5/public-api.js +0 -5
  115. package/fesm2015/osovitny-anatoly.js +0 -1171
  116. package/fesm2015/osovitny-anatoly.js.map +0 -1
  117. package/fesm5/osovitny-anatoly.js +0 -1226
  118. package/fesm5/osovitny-anatoly.js.map +0 -1
  119. package/lib/billing/billing.module.d.ts +0 -2
  120. package/lib/billing/components/buyaccess/buyaccess-button.component.d.ts +0 -16
  121. package/lib/billing/components/subscriptions/subscribe-plan-button.component.d.ts +0 -15
  122. package/lib/billing/components/subscriptions/upgrade-plan-button.component.d.ts +0 -9
  123. package/lib/billing/services/base-billing-api.service.d.ts +0 -9
  124. package/lib/core/consts.d.ts +0 -5
  125. package/lib/core/core.module.d.ts +0 -2
  126. package/lib/core/services/appcontext.service.d.ts +0 -14
  127. package/lib/core/services/base-api.service.d.ts +0 -18
  128. package/lib/core/services/base-go.service.d.ts +0 -7
  129. package/lib/core/services/base-gridedit.service.d.ts +0 -19
  130. package/lib/identity/components/signin-button.component.d.ts +0 -4
  131. package/lib/identity/components/signout-button.component.d.ts +0 -4
  132. package/lib/identity/components/signup-button.component.d.ts +0 -4
  133. package/lib/identity/identity.module.d.ts +0 -2
  134. package/lib/ui/components/base-edit.component.d.ts +0 -14
  135. package/lib/ui/components/base.component.d.ts +0 -7
  136. package/lib/ui/components/content-header/content-header.component.d.ts +0 -5
  137. package/lib/ui/components/html-editor/html-editor.component.d.ts +0 -19
  138. package/lib/ui/components/html-editor/html-editor.consts.d.ts +0 -1
  139. package/lib/ui/components/validation/form-validation-summary.component.d.ts +0 -6
  140. package/lib/ui/components/validation/item-validation-summary.component.d.ts +0 -6
  141. package/lib/ui/components/validation/validation-summary.component.d.ts +0 -6
  142. package/lib/ui/ui.module.d.ts +0 -2
  143. package/osovitny-anatoly.d.ts +0 -4
  144. package/osovitny-anatoly.metadata.json +0 -1
@@ -1,1226 +0,0 @@
1
- import { __decorate, __extends } from 'tslib';
2
- import { Injectable, NgModule, Input, Component, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
3
- import { HttpClient, HttpClientModule, HttpClientXsrfModule, HttpClientJsonpModule } from '@angular/common/http';
4
- import { map } from 'rxjs/operators';
5
- import { BehaviorSubject } from 'rxjs';
6
- import { ActivatedRoute, Router } from '@angular/router';
7
- import { CommonModule } from '@angular/common';
8
- import { ReactiveFormsModule, FormsModule } from '@angular/forms';
9
- import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
10
- import { GridModule } from '@progress/kendo-angular-grid';
11
- import { PopupModule } from '@progress/kendo-angular-popup';
12
- import { ButtonsModule } from '@progress/kendo-angular-buttons';
13
- import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
14
-
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;
25
-
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
- var BaseApiService = /** @class */ (function () {
41
- function BaseApiService(http) {
42
- this.http = http;
43
- this.baseUrl = anatoly.consts.apiUrl;
44
- }
45
- BaseApiService.prototype.serializeParams = function (data) {
46
- return data ? ('?' + $.param(data)) : '';
47
- };
48
- //webApi
49
- BaseApiService.prototype.get = function (action, data) {
50
- var url = this.baseUrl + ("" + action + this.serializeParams(data));
51
- return this.http.get(url).pipe(map(function (res) { return res; }));
52
- };
53
- BaseApiService.prototype.post = function (action, data) {
54
- var url = this.baseUrl + ("" + action);
55
- return this.http.post(url, data, { responseType: 'text' });
56
- };
57
- BaseApiService.prototype.postQS = function (action, data) {
58
- var url = this.baseUrl + ("" + action + this.serializeParams(data));
59
- return this.http.post(url, null, { responseType: 'text' });
60
- };
61
- //gets
62
- BaseApiService.prototype.getAll = function (data) {
63
- return this.get('getall', data).pipe(map(function (res) { return res; }));
64
- };
65
- BaseApiService.prototype.getJsonFile = function (fileName, jsonVersion) {
66
- if (!jsonVersion) {
67
- jsonVersion = "1.0";
68
- }
69
- var url = anatoly.consts.jsonUrl + fileName + '?' + jsonVersion;
70
- return this.http.get(url).pipe(map(function (res) { return res; }));
71
- };
72
- BaseApiService.prototype.getNewGuid = function () {
73
- var url = this.baseUrl + 'getNewGuid';
74
- return this.http.get(url, { responseType: 'text' });
75
- };
76
- //CRUD function
77
- BaseApiService.prototype.getById = function (id) {
78
- return this.get('getById', { id: id });
79
- };
80
- BaseApiService.prototype.remove = function (id) {
81
- return this.postQS('remove', { id: id });
82
- };
83
- BaseApiService.ctorParameters = function () { return [
84
- { type: HttpClient }
85
- ]; };
86
- BaseApiService = __decorate([
87
- Injectable()
88
- ], BaseApiService);
89
- return BaseApiService;
90
- }());
91
-
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
- /*
223
- <file>
224
- Authors:
225
- Vadim Osovitny
226
-
227
- Created:
228
- 13 Nov 2017
229
-
230
- Version:
231
- 1.0
232
-
233
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
234
- </file>
235
- */
236
- var AppContextService = /** @class */ (function (_super) {
237
- __extends(AppContextService, _super);
238
- function AppContextService(http) {
239
- var _this = _super.call(this, http) || this;
240
- _this.http = http;
241
- _this.current = null;
242
- _this.successes = [];
243
- _this.subscription = null;
244
- _this.baseUrl = anatoly.consts.apiUrl + 'appcontext/';
245
- return _this;
246
- }
247
- AppContextService.prototype.getCurrent = function (success) {
248
- var _this = this;
249
- if (typeof success == "undefined") {
250
- return;
251
- }
252
- if (this.current != null) {
253
- success(this.current);
254
- return;
255
- }
256
- this.successes.push(success);
257
- if (this.subscription != null) {
258
- return;
259
- }
260
- this.subscription = this.get('GetCurrentContext', null).subscribe(function (data) {
261
- _this.dataReceived(data);
262
- }, function (e) { });
263
- };
264
- AppContextService.prototype.dataReceived = function (data) {
265
- this.current = data;
266
- for (var i = 0; i < this.successes.length; i++) {
267
- var success = this.successes[i];
268
- success(data);
269
- }
270
- this.successes = [];
271
- this.subscription.unsubscribe();
272
- this.subscription = null;
273
- this.current = null;
274
- };
275
- AppContextService.prototype.isUserSignedIn = function () {
276
- return window.__context_isUserSignedIn;
277
- };
278
- AppContextService.prototype.isUserAdmin = function () {
279
- return window.__context_isUserAdmin;
280
- };
281
- AppContextService.ctorParameters = function () { return [
282
- { type: HttpClient }
283
- ]; };
284
- AppContextService = __decorate([
285
- Injectable()
286
- ], AppContextService);
287
- return AppContextService;
288
- }(BaseApiService));
289
-
290
- /*
291
- <file>
292
- Authors:
293
- Vadim Osovitny
294
-
295
- Created:
296
- 10 Nov 2017
297
-
298
- Version:
299
- 1.0
300
-
301
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
302
- </file>
303
- */
304
- var AnatolyCoreModule = /** @class */ (function () {
305
- function AnatolyCoreModule() {
306
- }
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
- ]
325
- })
326
- ], AnatolyCoreModule);
327
- return AnatolyCoreModule;
328
- }());
329
-
330
- // Base
331
-
332
- /*
333
- <file>
334
- Authors:
335
- Vadim Osovitny
336
-
337
- Created:
338
- 12 Nov 2017
339
-
340
- Version:
341
- 1.0
342
-
343
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
344
- </file>
345
- */
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;
353
- }
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(); });
365
- };
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(); });
371
- };
372
- BaseBillingApiService.ctorParameters = function () { return [
373
- { type: HttpClient }
374
- ]; };
375
- BaseBillingApiService = __decorate([
376
- Injectable()
377
- ], BaseBillingApiService);
378
- return BaseBillingApiService;
379
- }(BaseApiService));
380
-
381
- /*
382
- <file>
383
- Authors:
384
- Vadim Osovitny
385
-
386
- Created:
387
- 14 Aug 2018
388
-
389
- Version:
390
- 1.0
391
-
392
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
393
- </file>
394
- */
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 = "";
403
- }
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
- });
418
- };
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
- });
429
- };
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;
447
- }());
448
-
449
- /*
450
- <file>
451
- Authors:
452
- Vadim Osovitny
453
-
454
- Created:
455
- 1 Jun 2018
456
-
457
- Version:
458
- 1.0
459
-
460
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
461
- </file>
462
- */
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 = "";
472
- }
473
- SubscribePlanButtonComponent.prototype.ngOnInit = function () {
474
- var _this = this;
475
- if (!this.appcontext.isUserSignedIn()) {
476
- this.contextUpdated = true;
477
- return;
478
- }
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
- });
489
- };
490
- SubscribePlanButtonComponent.ctorParameters = function () { return [
491
- { type: AppContextService }
492
- ]; };
493
- __decorate([
494
- Input()
495
- ], SubscribePlanButtonComponent.prototype, "plan", void 0);
496
- __decorate([
497
- 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
- }());
507
-
508
- /*
509
- <file>
510
- Authors:
511
- Vadim Osovitny
512
-
513
- Created:
514
- 12 Nov 2017
515
-
516
- Version:
517
- 1.0
518
-
519
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
520
- </file>
521
- */
522
- var UpgradePlanButtonComponent = /** @class */ (function () {
523
- function UpgradePlanButtonComponent(api) {
524
- this.api = api;
525
- }
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
- });
536
- };
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
- __decorate([
547
- Input()
548
- ], UpgradePlanButtonComponent.prototype, "requestedplantitle", void 0);
549
- UpgradePlanButtonComponent = __decorate([
550
- 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"
553
- })
554
- ], UpgradePlanButtonComponent);
555
- return UpgradePlanButtonComponent;
556
- }());
557
-
558
- /*
559
- <file>
560
- Authors:
561
- Vadim Osovitny
562
-
563
- Created:
564
- 4 Jul 2018
565
-
566
- Version:
567
- 1.0
568
-
569
- Copyright (c) 2018 Osovitny Inc. All rights reserved.
570
- </file>
571
- */
572
- var SignInButtonComponent = /** @class */ (function () {
573
- function SignInButtonComponent() {
574
- }
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
- }());
586
-
587
- /*
588
- <file>
589
- Authors:
590
- Vadim Osovitny
591
-
592
- Created:
593
- 4 Jul 2018
594
-
595
- Version:
596
- 1.0
597
-
598
- Copyright (c) 2018 Osovitny Inc. All rights reserved.
599
- </file>
600
- */
601
- var SignOutButtonComponent = /** @class */ (function () {
602
- function SignOutButtonComponent() {
603
- }
604
- __decorate([
605
- Input()
606
- ], SignOutButtonComponent.prototype, "classbtn", void 0);
607
- SignOutButtonComponent = __decorate([
608
- Component({
609
- selector: 'anatoly-signout-button',
610
- template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
611
- })
612
- ], SignOutButtonComponent);
613
- return SignOutButtonComponent;
614
- }());
615
-
616
- /*
617
- <file>
618
- Authors:
619
- Vadim Osovitny
620
-
621
- Created:
622
- 4 Jul 2018
623
-
624
- Version:
625
- 1.0
626
-
627
- Copyright (c) 2018 Osovitny Inc. All rights reserved.
628
- </file>
629
- */
630
- var SignUpButtonComponent = /** @class */ (function () {
631
- function SignUpButtonComponent() {
632
- }
633
- __decorate([
634
- Input()
635
- ], SignUpButtonComponent.prototype, "classbtn", void 0);
636
- SignUpButtonComponent = __decorate([
637
- Component({
638
- selector: 'anatoly-signup-button',
639
- template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
640
- })
641
- ], SignUpButtonComponent);
642
- return SignUpButtonComponent;
643
- }());
644
-
645
- /*
646
- <file>
647
- Authors:
648
- Vadim Osovitny
649
-
650
- Created:
651
- 4 Jul 2018
652
-
653
- Version:
654
- 1.0
655
-
656
- Copyright (c) 2018 Osovitny Inc. All rights reserved.
657
- </file>
658
- */
659
- var AnatolyIdentityModule = /** @class */ (function () {
660
- function AnatolyIdentityModule() {
661
- }
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
682
-
683
- /*
684
- <file>
685
- Authors:
686
- Vadim Osovitny
687
-
688
- Created:
689
- 10 Nov 2017
690
-
691
- Version:
692
- 1.0
693
-
694
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
695
- </file>
696
- */
697
- var AnatolyBillingModule = /** @class */ (function () {
698
- function AnatolyBillingModule() {
699
- }
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
- ]
726
- })
727
- ], AnatolyBillingModule);
728
- return AnatolyBillingModule;
729
- }());
730
-
731
- // Components
732
-
733
- /*
734
- <file>
735
- Authors:
736
- Vadim Osovitny
737
-
738
- Created:
739
- 28 Aug 2018
740
-
741
- Version:
742
- 1.0
743
-
744
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
745
- </file>
746
- */
747
- var BaseComponent = /** @class */ (function () {
748
- function BaseComponent() {
749
- }
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;
769
- }());
770
-
771
- /*
772
- <file>
773
- Authors:
774
- Vadim Osovitny
775
-
776
- Created:
777
- 20 Nov 2017
778
-
779
- Version:
780
- 1.0
781
-
782
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
783
- </file>
784
- */
785
- var BaseEditComponent = /** @class */ (function (_super) {
786
- __extends(BaseEditComponent, _super);
787
- function BaseEditComponent() {
788
- var _this = _super.call(this) || this;
789
- _this.formSubmitted = false;
790
- return _this;
791
- }
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.get(name)) {
806
- return (this.formSubmitted && this.formGroup.get(name).invalid) ||
807
- (this.formGroup.get(name).touched && this.formGroup.get(name).invalid);
808
- }
809
- return false;
810
- };
811
- BaseEditComponent.prototype.getFormValue = function (name) {
812
- return this.formGroup.controls[name].value;
813
- };
814
- BaseEditComponent.prototype.setFormValue = function (name, value) {
815
- this.formGroup.controls[name].setValue(value);
816
- };
817
- BaseEditComponent.prototype.getFormGroupValue = function (groupName, name) {
818
- return this.formGroup.controls[groupName].get(name).value;
819
- };
820
- BaseEditComponent.prototype.setFormGroupValue = function (groupName, name, value) {
821
- this.formGroup.controls[groupName].get(name).setValue(value);
822
- };
823
- __decorate([
824
- Input()
825
- ], BaseEditComponent.prototype, "formGroup", void 0);
826
- __decorate([
827
- Input()
828
- ], BaseEditComponent.prototype, "formSubmitted", void 0);
829
- return BaseEditComponent;
830
- }(BaseComponent));
831
-
832
- /*
833
- <file>
834
- Authors:
835
- Anatoly Osovitny
836
-
837
- Created:
838
- 23 Apr 2018
839
-
840
- Version:
841
- 1.0
842
-
843
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
844
- </file>
845
- */
846
- var ContentHeaderComponent = /** @class */ (function () {
847
- function ContentHeaderComponent() {
848
- }
849
- ContentHeaderComponent.prototype.ngOnInit = function () {
850
- if (this.title == null) {
851
- this.title = '';
852
- }
853
- };
854
- __decorate([
855
- Input()
856
- ], ContentHeaderComponent.prototype, "title", void 0);
857
- ContentHeaderComponent = __decorate([
858
- Component({
859
- selector: 'anatoly-content-header',
860
- template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
861
- })
862
- ], ContentHeaderComponent);
863
- return ContentHeaderComponent;
864
- }());
865
-
866
- /*
867
- <file>
868
- Authors:
869
- Vadim Osovitny
870
-
871
- Created:
872
- 8 Dec 2017
873
-
874
- Version:
875
- 1.0
876
-
877
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
878
- </file>
879
- */
880
- var ValidationSummaryComponent = /** @class */ (function (_super) {
881
- __extends(ValidationSummaryComponent, _super);
882
- function ValidationSummaryComponent() {
883
- return _super.call(this) || this;
884
- }
885
- ValidationSummaryComponent.prototype.getFormValidationMessages = function () {
886
- var _this = this;
887
- var messages = [];
888
- Object.keys(this.formGroup.controls).forEach(function (k) {
889
- var control = _this.formGroup.controls[k];
890
- if (control.controls != null) {
891
- Object.keys(control.controls).forEach(function (k) {
892
- var child = control.controls[k];
893
- _this.getValidationMessages(child, k).forEach(function (m) { return messages.push(m); });
894
- });
895
- }
896
- else {
897
- _this.getValidationMessages(control, k).forEach(function (m) { return messages.push(m); });
898
- }
899
- });
900
- return messages;
901
- };
902
- ValidationSummaryComponent.prototype.getValidationMessages = function (state, thingName) {
903
- var thing = state.path || thingName;
904
- var messages = [];
905
- if (state.errors) {
906
- for (var errorName in state.errors) {
907
- if (state.errors.hasOwnProperty(errorName)) {
908
- switch (errorName) {
909
- case 'required':
910
- messages.push(thing + " is required");
911
- break;
912
- case 'minlength':
913
- messages.push(thing + " must be at least " + state.errors['minlength'].requiredLength + " characters");
914
- break;
915
- case 'pattern':
916
- messages.push(thing + " contains illegal characters");
917
- break;
918
- }
919
- }
920
- }
921
- }
922
- return messages;
923
- };
924
- return ValidationSummaryComponent;
925
- }(BaseEditComponent));
926
-
927
- /*
928
- <file>
929
- Authors:
930
- Vadim Osovitny
931
-
932
- Created:
933
- 7 Dec 2017
934
-
935
- Version:
936
- 1.0
937
-
938
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
939
- </file>
940
- */
941
- var FormValidationSummaryComponent = /** @class */ (function (_super) {
942
- __extends(FormValidationSummaryComponent, _super);
943
- function FormValidationSummaryComponent() {
944
- var _this = _super.call(this) || this;
945
- _this.visible = false;
946
- return _this;
947
- }
948
- FormValidationSummaryComponent.prototype.getErrors = function () {
949
- var messages = this.getFormValidationMessages();
950
- return messages;
951
- };
952
- __decorate([
953
- Input()
954
- ], FormValidationSummaryComponent.prototype, "visible", void 0);
955
- FormValidationSummaryComponent = __decorate([
956
- Component({
957
- selector: 'anatoly-form-validation-summary',
958
- 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"
959
- })
960
- ], FormValidationSummaryComponent);
961
- return FormValidationSummaryComponent;
962
- }(ValidationSummaryComponent));
963
-
964
- /*
965
- <file>
966
- Authors:
967
- Vadim Osovitny
968
-
969
- Created:
970
- 6 Dec 2017
971
-
972
- Version:
973
- 1.0
974
-
975
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
976
- </file>
977
- */
978
- var ItemValidationSummaryComponent = /** @class */ (function (_super) {
979
- __extends(ItemValidationSummaryComponent, _super);
980
- function ItemValidationSummaryComponent() {
981
- return _super.call(this) || this;
982
- }
983
- __decorate([
984
- Input()
985
- ], ItemValidationSummaryComponent.prototype, "key", void 0);
986
- __decorate([
987
- Input()
988
- ], ItemValidationSummaryComponent.prototype, "title", void 0);
989
- ItemValidationSummaryComponent = __decorate([
990
- Component({
991
- selector: 'anatoly-item-validation-summary',
992
- 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>"
993
- })
994
- ], ItemValidationSummaryComponent);
995
- return ItemValidationSummaryComponent;
996
- }(ValidationSummaryComponent));
997
-
998
- var ɵ0 = function (images) {
999
- //let editor = this;
1000
- //alert("image.beforeUpload uploadType: " + editor.opts.imageUploadParams.uploadType + "_" + editor.opts.imageUploadParams.uploadParentId)
1001
- }, ɵ1 = function () {
1002
- }, ɵ2 = function () {
1003
- var editor = this;
1004
- //alert('contentChanged');
1005
- };
1006
- var DefaultEditorOptions = {
1007
- placeholderText: 'Edit Your Content Here',
1008
- charCounterCount: true,
1009
- heightMin: 100,
1010
- toolbarInline: false,
1011
- toolbarButtons: {
1012
- 'moreText': {
1013
- 'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript',
1014
- 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle']
1015
- },
1016
- 'moreParagraph': {
1017
- 'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify',
1018
- 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
1019
- },
1020
- 'moreRich': {
1021
- 'buttons': ['insertLink', 'insertImage', 'insertTable', 'emoticons', 'fontAwesome',
1022
- 'specialCharacters', 'embedly']
1023
- },
1024
- 'moreMisc': {
1025
- 'buttons': ['selectAll', 'clearFormatting', 'html', 'undo', 'redo', 'fullscreen'],
1026
- 'align': 'right',
1027
- }
1028
- },
1029
- /*
1030
- Upload:
1031
- https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
1032
- */
1033
- imageUploadURL: '/api/HtmlEditor/UploadImage',
1034
- imageAllowedTypes: ['jpeg', 'jpg', 'png'],
1035
- imageUploadParams: { uploadType: '', uploadParentId: '' },
1036
- //Events
1037
- events: {
1038
- 'image.beforeUpload': ɵ0,
1039
- 'initialized': ɵ1,
1040
- 'contentChanged': ɵ2
1041
- }
1042
- };
1043
-
1044
- /*
1045
- <file>
1046
- Authors:
1047
- Anatoly Osovitny
1048
- Vadim Osovitny
1049
-
1050
- Created:
1051
- 12 Dec 2017
1052
-
1053
- Version:
1054
- 1.0
1055
-
1056
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
1057
- </file>
1058
- */
1059
- var HtmlEditorComponent = /** @class */ (function (_super) {
1060
- __extends(HtmlEditorComponent, _super);
1061
- function HtmlEditorComponent() {
1062
- var _this = _super !== null && _super.apply(this, arguments) || this;
1063
- _this._editorInitialized = false;
1064
- //General params
1065
- _this.editorId = '';
1066
- _this.editorLabelText = 'Html';
1067
- _this.editorOptions = {};
1068
- //Form based params
1069
- _this.isFormBased = '1';
1070
- _this.editorFormKey = 'html';
1071
- return _this;
1072
- }
1073
- HtmlEditorComponent.prototype.ngOnInit = function () {
1074
- var opt = this.editorOptions;
1075
- if (typeof this.editorOptions == "string") {
1076
- opt = JSON.parse(this.editorOptions);
1077
- }
1078
- var newOptions = $.extend({}, DefaultEditorOptions, opt);
1079
- var key = window.__froalaEditor_Key;
1080
- if (key) {
1081
- newOptions = $.extend({}, JSON.parse('{ "key": "' + key + '" }'), newOptions);
1082
- }
1083
- this.options = newOptions;
1084
- };
1085
- HtmlEditorComponent.prototype.doAfterEditorInitialized = function (action) {
1086
- var that = this;
1087
- var timeOut = 500;
1088
- if (this._editorInitialized) {
1089
- timeOut = 100;
1090
- }
1091
- setTimeout(function () { action(that); }, timeOut);
1092
- };
1093
- HtmlEditorComponent.prototype.getEditor = function () {
1094
- if (this._control)
1095
- return this._control.getEditor();
1096
- return null;
1097
- };
1098
- //Public Funcs
1099
- HtmlEditorComponent.prototype.initializeControl = function (control) {
1100
- this._control = control;
1101
- this._control.initialize();
1102
- this._editorInitialized = true;
1103
- };
1104
- HtmlEditorComponent.prototype.setUploadParams = function (uploadType, uploadParentId) {
1105
- this.doAfterEditorInitialized(function (that) {
1106
- var editor = that.getEditor();
1107
- if (typeof (editor) == "undefined" || editor == null) {
1108
- return;
1109
- }
1110
- editor.opts.imageUploadParams.uploadType = uploadType;
1111
- editor.opts.imageUploadParams.uploadParentId = uploadParentId;
1112
- });
1113
- };
1114
- HtmlEditorComponent.prototype.setHtml = function (content) {
1115
- if (this.isFormBased == "1") {
1116
- return;
1117
- }
1118
- this.doAfterEditorInitialized(function (that) {
1119
- var editor = that.getEditor();
1120
- if (typeof (editor) == "undefined" || editor == null) {
1121
- return;
1122
- }
1123
- editor.html.set(content);
1124
- });
1125
- };
1126
- HtmlEditorComponent.prototype.getHtml = function () {
1127
- if (this.isFormBased == "1") {
1128
- return null;
1129
- }
1130
- var editor = this.getEditor();
1131
- if (typeof (editor) == "undefined" || editor == null) {
1132
- return;
1133
- }
1134
- return editor.html.get(false);
1135
- };
1136
- __decorate([
1137
- Input()
1138
- ], HtmlEditorComponent.prototype, "editorId", void 0);
1139
- __decorate([
1140
- Input()
1141
- ], HtmlEditorComponent.prototype, "editorLabelText", void 0);
1142
- __decorate([
1143
- Input()
1144
- ], HtmlEditorComponent.prototype, "editorOptions", void 0);
1145
- __decorate([
1146
- Input()
1147
- ], HtmlEditorComponent.prototype, "isFormBased", void 0);
1148
- __decorate([
1149
- Input()
1150
- ], HtmlEditorComponent.prototype, "editorFormKey", void 0);
1151
- HtmlEditorComponent = __decorate([
1152
- Component({
1153
- selector: 'anatoly-html-editor',
1154
- 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"
1155
- })
1156
- ], HtmlEditorComponent);
1157
- return HtmlEditorComponent;
1158
- }(BaseEditComponent));
1159
-
1160
- /*
1161
- <file>
1162
- Authors:
1163
- Vadim Osovitny
1164
-
1165
- Created:
1166
- 3 Jun 2018
1167
-
1168
- Version:
1169
- 1.0
1170
-
1171
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
1172
- </file>
1173
- */
1174
- var AnatolyUIModule = /** @class */ (function () {
1175
- function AnatolyUIModule() {
1176
- }
1177
- AnatolyUIModule = __decorate([
1178
- NgModule({
1179
- imports: [
1180
- CommonModule,
1181
- ReactiveFormsModule,
1182
- FormsModule,
1183
- HttpClientModule,
1184
- HttpClientXsrfModule,
1185
- HttpClientJsonpModule,
1186
- FroalaEditorModule.forRoot(),
1187
- FroalaViewModule.forRoot(),
1188
- GridModule,
1189
- PopupModule,
1190
- ButtonsModule,
1191
- DropDownsModule
1192
- ],
1193
- exports: [
1194
- CommonModule,
1195
- HttpClientModule,
1196
- HttpClientXsrfModule,
1197
- HttpClientJsonpModule,
1198
- ItemValidationSummaryComponent,
1199
- FormValidationSummaryComponent,
1200
- HtmlEditorComponent,
1201
- ContentHeaderComponent
1202
- ],
1203
- declarations: [
1204
- ItemValidationSummaryComponent,
1205
- FormValidationSummaryComponent,
1206
- HtmlEditorComponent,
1207
- ContentHeaderComponent
1208
- ],
1209
- providers: [],
1210
- schemas: [
1211
- CUSTOM_ELEMENTS_SCHEMA,
1212
- NO_ERRORS_SCHEMA
1213
- ]
1214
- })
1215
- ], AnatolyUIModule);
1216
- return AnatolyUIModule;
1217
- }());
1218
-
1219
- // Base Components
1220
-
1221
- /**
1222
- * Generated bundle index. Do not edit.
1223
- */
1224
-
1225
- export { AnatolyBillingModule, AnatolyCoreModule, AnatolyIdentityModule, AnatolyUIModule, AppContextService, BaseApiService, BaseBillingApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, BuyAccessButtonComponent, ContentHeaderComponent, FormValidationSummaryComponent, HtmlEditorComponent, ItemValidationSummaryComponent, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, SubscribePlanButtonComponent, UpgradePlanButtonComponent, ValidationSummaryComponent };
1226
- //# sourceMappingURL=osovitny-anatoly.js.map