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