@cartesianui/js 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/{axis.d.ts → cartesian.d.ts} +5 -5
- package/{axis.js → cartesian.js} +267 -267
- package/cartesian.message.swal.min.js +1 -0
- package/cartesian.min.js +1 -0
- package/cartesian.moment.min.js +1 -0
- package/cartesian.notification.swal.min.js +1 -0
- package/cartesian.ui.freeze.min.js +1 -0
- package/package.json +48 -48
- package/axis.message.swal.min.js +0 -1
- package/axis.min.js +0 -1
- package/axis.moment.min.js +0 -1
- package/axis.notification.swal.min.js +0 -1
- package/axis.ui.freeze.min.js +0 -1
package/{axis.js → cartesian.js}
RENAMED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
var
|
|
1
|
+
var cartesian = {};
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var cartesian = cartesian || {};
|
|
4
4
|
(function () {
|
|
5
|
-
|
|
5
|
+
cartesian.tenancy = cartesian.tenancy || {};
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
cartesian.tenancy.isEnabled = false;
|
|
8
|
+
cartesian.tenancy.headerAttribute = 'Cartesian-Host';
|
|
9
|
+
cartesian.tenancy.ignoreFeatureCheckForHostUsers = false;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
cartesian.tenancy.sides = {
|
|
12
12
|
TENANT: 1,
|
|
13
13
|
HOST: 2,
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
cartesian.tenancy.tenantIdCookieName = "Cartesian.TenantId";
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
cartesian.tenancy.setTenantIdCookie = function (tenantId) {
|
|
19
19
|
if (tenantId) {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
cartesian.utils.setCookieValue(
|
|
21
|
+
cartesian.tenancy.tenantIdCookieName,
|
|
22
22
|
tenantId.toString(),
|
|
23
23
|
new Date(new Date().getTime() + 5 * 365 * 86400000), //5 years
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
cartesian.appPath,
|
|
25
|
+
cartesian.domain
|
|
26
26
|
);
|
|
27
27
|
} else {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
cartesian.utils.deleteCookie(
|
|
29
|
+
cartesian.tenancy.tenantIdCookieName,
|
|
30
|
+
cartesian.appPath
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
var value =
|
|
35
|
+
cartesian.tenancy.getTenantIdCookie = function () {
|
|
36
|
+
var value = cartesian.utils.getCookieValue(cartesian.tenancy.tenantIdCookieName);
|
|
37
37
|
if (!value) {
|
|
38
38
|
return null;
|
|
39
39
|
}
|
|
@@ -42,26 +42,26 @@ var axis = axis || {};
|
|
|
42
42
|
};
|
|
43
43
|
})();
|
|
44
44
|
|
|
45
|
-
var
|
|
45
|
+
var cartesian = cartesian || {};
|
|
46
46
|
(function () {
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
cartesian.localization = cartesian.localization || {};
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
cartesian.localization.languages = [];
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
cartesian.localization.currentLanguage = {};
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
cartesian.localization.sources = [];
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
cartesian.localization.values = {};
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
sourceName = sourceName ||
|
|
58
|
+
cartesian.localization.localize = function (key, sourceName) {
|
|
59
|
+
sourceName = sourceName || cartesian.localization.defaultSourceName;
|
|
60
60
|
|
|
61
|
-
var source =
|
|
61
|
+
var source = cartesian.localization.values[sourceName];
|
|
62
62
|
|
|
63
63
|
if (!source) {
|
|
64
|
-
|
|
64
|
+
cartesian.log.warn("Could not find localization source: " + sourceName);
|
|
65
65
|
return key;
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -74,67 +74,67 @@ var axis = axis || {};
|
|
|
74
74
|
copiedArguments.splice(1, 1);
|
|
75
75
|
copiedArguments[0] = value;
|
|
76
76
|
|
|
77
|
-
return
|
|
77
|
+
return cartesian.utils.formatString.apply(this, copiedArguments);
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
cartesian.localization.getSource = function (sourceName) {
|
|
81
81
|
return function (key) {
|
|
82
82
|
var copiedArguments = Array.prototype.slice.call(arguments, 0);
|
|
83
83
|
copiedArguments.splice(1, 0, sourceName);
|
|
84
|
-
return
|
|
84
|
+
return cartesian.localization.localize.apply(this, copiedArguments);
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
cartesian.localization.isCurrentCulture = function (name) {
|
|
89
89
|
return (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
cartesian.localization.currentCulture &&
|
|
91
|
+
cartesian.localization.currentCulture.name &&
|
|
92
|
+
cartesian.localization.currentCulture.name.indexOf(name) == 0
|
|
93
93
|
);
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
cartesian.localization.defaultSourceName = undefined;
|
|
97
|
+
cartesian.localization.web = cartesian.localization.getSource("web");
|
|
98
98
|
})();
|
|
99
99
|
|
|
100
|
-
// Implements Authorization API that simplifies usage of authorization scripts generated by
|
|
101
|
-
var
|
|
100
|
+
// Implements Authorization API that simplifies usage of authorization scripts generated by Cartesian.
|
|
101
|
+
var cartesian = cartesian || {};
|
|
102
102
|
(function () {
|
|
103
|
-
|
|
103
|
+
cartesian.auth = cartesian.auth || {};
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
cartesian.auth.allPermissions = cartesian.auth.allPermissions || {};
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
cartesian.auth.grantedPermissions = cartesian.auth.grantedPermissions || {};
|
|
108
108
|
|
|
109
|
-
//Deprecated. Use
|
|
110
|
-
|
|
111
|
-
return
|
|
109
|
+
//Deprecated. Use cartesian.auth.isGranted instead.
|
|
110
|
+
cartesian.auth.hasPermission = function (permissionName) {
|
|
111
|
+
return cartesian.auth.isGranted.apply(this, arguments);
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
//Deprecated. Use
|
|
115
|
-
|
|
116
|
-
return
|
|
114
|
+
//Deprecated. Use cartesian.auth.isAnyGranted instead.
|
|
115
|
+
cartesian.auth.hasAnyOfPermissions = function () {
|
|
116
|
+
return cartesian.auth.isAnyGranted.apply(this, arguments);
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
//Deprecated. Use
|
|
120
|
-
|
|
121
|
-
return
|
|
119
|
+
//Deprecated. Use cartesian.auth.areAllGranted instead.
|
|
120
|
+
cartesian.auth.hasAllOfPermissions = function () {
|
|
121
|
+
return cartesian.auth.areAllGranted.apply(this, arguments);
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
cartesian.auth.isGranted = function (permissionName) {
|
|
125
125
|
return (
|
|
126
|
-
(
|
|
127
|
-
(
|
|
126
|
+
(cartesian.auth.allPermissions[permissionName] !== undefined && cartesian.auth.grantedPermissions[permissionName] !== undefined ) ||
|
|
127
|
+
(cartesian.auth.allPermissions.indexOf(permissionName) !== -1 && cartesian.auth.grantedPermissions.indexOf(permissionName) !== -1)
|
|
128
128
|
);
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
cartesian.auth.isAnyGranted = function () {
|
|
132
132
|
if (!arguments || arguments.length <= 0) {
|
|
133
133
|
return true;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
for (var i = 0; i < arguments.length; i++) {
|
|
137
|
-
if (
|
|
137
|
+
if (cartesian.auth.isGranted(arguments[i])) {
|
|
138
138
|
return true;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
@@ -142,13 +142,13 @@ var axis = axis || {};
|
|
|
142
142
|
return false;
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
cartesian.auth.areAllGranted = function () {
|
|
146
146
|
if (!arguments || arguments.length <= 0) {
|
|
147
147
|
return true;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
for (var i = 0; i < arguments.length; i++) {
|
|
151
|
-
if (!
|
|
151
|
+
if (!cartesian.auth.isGranted(arguments[i])) {
|
|
152
152
|
return false;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -156,60 +156,60 @@ var axis = axis || {};
|
|
|
156
156
|
return true;
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
cartesian.auth.tokenCookieName = "Cartesian.AuthToken";
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
cartesian.auth.setToken = function (authToken, expireDate) {
|
|
162
|
+
cartesian.utils.setCookieValue(
|
|
163
|
+
cartesian.auth.tokenCookieName,
|
|
164
164
|
authToken,
|
|
165
165
|
expireDate,
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
cartesian.appPath,
|
|
167
|
+
cartesian.domain
|
|
168
168
|
);
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
return
|
|
171
|
+
cartesian.auth.getToken = function () {
|
|
172
|
+
return cartesian.utils.getCookieValue(cartesian.auth.tokenCookieName);
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
cartesian.auth.clearToken = function () {
|
|
176
|
+
cartesian.auth.setToken();
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
cartesian.auth.refreshTokenCookieName = "Cartesian.AuthRefreshToken";
|
|
180
180
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
cartesian.auth.setRefreshToken = function (refreshToken, expireDate) {
|
|
182
|
+
cartesian.utils.setCookieValue(
|
|
183
|
+
cartesian.auth.refreshTokenCookieName,
|
|
184
184
|
refreshToken,
|
|
185
185
|
expireDate,
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
cartesian.appPath,
|
|
187
|
+
cartesian.domain
|
|
188
188
|
);
|
|
189
189
|
};
|
|
190
190
|
|
|
191
|
-
|
|
192
|
-
return
|
|
191
|
+
cartesian.auth.getRefreshToken = function () {
|
|
192
|
+
return cartesian.utils.getCookieValue(cartesian.auth.refreshTokenCookieName);
|
|
193
193
|
};
|
|
194
194
|
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
cartesian.auth.clearRefreshToken = function () {
|
|
196
|
+
cartesian.auth.setRefreshToken();
|
|
197
197
|
};
|
|
198
198
|
})();
|
|
199
199
|
|
|
200
|
-
var
|
|
200
|
+
var cartesian = cartesian || {};
|
|
201
201
|
(function () {
|
|
202
|
-
//Implements Features API that simplifies usage of feature scripts generated by
|
|
203
|
-
|
|
202
|
+
//Implements Features API that simplifies usage of feature scripts generated by Cartesian.
|
|
203
|
+
cartesian.features = cartesian.features || {};
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
cartesian.features.allFeatures = cartesian.features.allFeatures || {};
|
|
206
206
|
|
|
207
|
-
|
|
208
|
-
return
|
|
207
|
+
cartesian.features.get = function (name) {
|
|
208
|
+
return cartesian.features.allFeatures[name];
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
-
|
|
212
|
-
var feature =
|
|
211
|
+
cartesian.features.getValue = function (name) {
|
|
212
|
+
var feature = cartesian.features.get(name);
|
|
213
213
|
if (feature == undefined) {
|
|
214
214
|
return undefined;
|
|
215
215
|
}
|
|
@@ -217,19 +217,19 @@ var axis = axis || {};
|
|
|
217
217
|
return feature.value;
|
|
218
218
|
};
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
var value =
|
|
220
|
+
cartesian.features.isEnabled = function (name) {
|
|
221
|
+
var value = cartesian.features.getValue(name);
|
|
222
222
|
return value == "true" || value == "True";
|
|
223
223
|
};
|
|
224
224
|
})();
|
|
225
225
|
|
|
226
|
-
var
|
|
226
|
+
var cartesian = cartesian || {};
|
|
227
227
|
(function (define) {
|
|
228
228
|
define(["jquery"], function ($) {
|
|
229
229
|
// Notification - Defines Notification API, not implements it
|
|
230
|
-
|
|
230
|
+
cartesian.notifications = cartesian.notifications || {};
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
cartesian.notifications.severity = {
|
|
233
233
|
INFO: 0,
|
|
234
234
|
SUCCESS: 1,
|
|
235
235
|
WARN: 2,
|
|
@@ -237,47 +237,47 @@ var axis = axis || {};
|
|
|
237
237
|
FATAL: 4,
|
|
238
238
|
};
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
cartesian.notifications.userNotificationState = {
|
|
241
241
|
UNREAD: 0,
|
|
242
242
|
READ: 1,
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
-
|
|
245
|
+
cartesian.notifications.getUserNotificationStateAsString = function (
|
|
246
246
|
userNotificationState
|
|
247
247
|
) {
|
|
248
248
|
switch (userNotificationState) {
|
|
249
|
-
case
|
|
249
|
+
case cartesian.notifications.userNotificationState.READ:
|
|
250
250
|
return "READ";
|
|
251
|
-
case
|
|
251
|
+
case cartesian.notifications.userNotificationState.UNREAD:
|
|
252
252
|
return "UNREAD";
|
|
253
253
|
default:
|
|
254
|
-
|
|
254
|
+
cartesian.log.warn(
|
|
255
255
|
"Unknown user notification state value: " + userNotificationState
|
|
256
256
|
);
|
|
257
257
|
return "?";
|
|
258
258
|
}
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
-
|
|
261
|
+
cartesian.notifications.getUiNotifyFuncBySeverity = function (severity) {
|
|
262
262
|
switch (severity) {
|
|
263
|
-
case
|
|
264
|
-
return
|
|
265
|
-
case
|
|
266
|
-
return
|
|
267
|
-
case
|
|
268
|
-
return
|
|
269
|
-
case
|
|
270
|
-
return
|
|
271
|
-
case
|
|
263
|
+
case cartesian.notifications.severity.SUCCESS:
|
|
264
|
+
return cartesian.notify.success;
|
|
265
|
+
case cartesian.notifications.severity.WARN:
|
|
266
|
+
return cartesian.notify.warn;
|
|
267
|
+
case cartesian.notifications.severity.ERROR:
|
|
268
|
+
return cartesian.notify.error;
|
|
269
|
+
case cartesian.notifications.severity.FATAL:
|
|
270
|
+
return cartesian.notify.error;
|
|
271
|
+
case cartesian.notifications.severity.INFO:
|
|
272
272
|
default:
|
|
273
|
-
return
|
|
273
|
+
return cartesian.notify.info;
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
-
|
|
277
|
+
cartesian.notifications.messageFormatters = {};
|
|
278
278
|
|
|
279
|
-
|
|
280
|
-
"
|
|
279
|
+
cartesian.notifications.messageFormatters[
|
|
280
|
+
"Cartesian.Notifications.MessageNotificationData"
|
|
281
281
|
] = function (userNotification) {
|
|
282
282
|
return (
|
|
283
283
|
userNotification.notification.data.message ||
|
|
@@ -285,13 +285,13 @@ var axis = axis || {};
|
|
|
285
285
|
);
|
|
286
286
|
};
|
|
287
287
|
|
|
288
|
-
|
|
289
|
-
"
|
|
288
|
+
cartesian.notifications.messageFormatters[
|
|
289
|
+
"Cartesian.Notifications.LocalizableMessageNotificationData"
|
|
290
290
|
] = function (userNotification) {
|
|
291
291
|
var message =
|
|
292
292
|
userNotification.notification.data.message ||
|
|
293
293
|
userNotification.notification.data.properties.Message;
|
|
294
|
-
var localizedMessage =
|
|
294
|
+
var localizedMessage = cartesian.localization.localize(
|
|
295
295
|
message.name,
|
|
296
296
|
message.sourceName
|
|
297
297
|
);
|
|
@@ -322,23 +322,23 @@ var axis = axis || {};
|
|
|
322
322
|
return localizedMessage;
|
|
323
323
|
};
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
cartesian.notifications.getFormattedMessageFromUserNotification = function (
|
|
326
326
|
userNotification
|
|
327
327
|
) {
|
|
328
328
|
var formatter =
|
|
329
|
-
|
|
329
|
+
cartesian.notifications.messageFormatters[
|
|
330
330
|
userNotification.notification.data.type
|
|
331
331
|
];
|
|
332
332
|
if (!formatter) {
|
|
333
|
-
|
|
333
|
+
cartesian.log.warn(
|
|
334
334
|
"No message formatter defined for given data type: " +
|
|
335
335
|
userNotification.notification.data.type
|
|
336
336
|
);
|
|
337
337
|
return "?";
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
if (!
|
|
341
|
-
|
|
340
|
+
if (!cartesian.utils.isFunction(formatter)) {
|
|
341
|
+
cartesian.log.warn(
|
|
342
342
|
"Message formatter should be a function! It is invalid for data type: " +
|
|
343
343
|
userNotification.notification.data.type
|
|
344
344
|
);
|
|
@@ -348,39 +348,39 @@ var axis = axis || {};
|
|
|
348
348
|
return formatter(userNotification);
|
|
349
349
|
};
|
|
350
350
|
|
|
351
|
-
|
|
351
|
+
cartesian.notifications.showUiNotifyForUserNotification = function (
|
|
352
352
|
userNotification,
|
|
353
353
|
options
|
|
354
354
|
) {
|
|
355
|
-
var message =
|
|
355
|
+
var message = cartesian.notifications.getFormattedMessageFromUserNotification(
|
|
356
356
|
userNotification
|
|
357
357
|
);
|
|
358
|
-
var uiNotifyFunc =
|
|
358
|
+
var uiNotifyFunc = cartesian.notifications.getUiNotifyFuncBySeverity(
|
|
359
359
|
userNotification.notification.severity
|
|
360
360
|
);
|
|
361
361
|
uiNotifyFunc(message, undefined, options);
|
|
362
362
|
};
|
|
363
363
|
|
|
364
364
|
// Notify - Defines Notification API, not implements it
|
|
365
|
-
|
|
365
|
+
cartesian.notify = cartesian.notify || {};
|
|
366
366
|
|
|
367
|
-
|
|
368
|
-
|
|
367
|
+
cartesian.notify.success = function (message, title, options) {
|
|
368
|
+
cartesian.log.warn("cartesian.notify.success is not implemented!");
|
|
369
369
|
};
|
|
370
370
|
|
|
371
|
-
|
|
372
|
-
|
|
371
|
+
cartesian.notify.info = function (message, title, options) {
|
|
372
|
+
cartesian.log.warn("cartesian.notify.info is not implemented!");
|
|
373
373
|
};
|
|
374
374
|
|
|
375
|
-
|
|
376
|
-
|
|
375
|
+
cartesian.notify.warn = function (message, title, options) {
|
|
376
|
+
cartesian.log.warn("cartesian.notify.warn is not implemented!");
|
|
377
377
|
};
|
|
378
378
|
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
cartesian.notify.error = function (message, title, options) {
|
|
380
|
+
cartesian.log.warn("cartesian.notify.error is not implemented!");
|
|
381
381
|
};
|
|
382
382
|
|
|
383
|
-
return
|
|
383
|
+
return cartesian;
|
|
384
384
|
});
|
|
385
385
|
})(
|
|
386
386
|
typeof define === "function" && define.amd
|
|
@@ -389,16 +389,16 @@ var axis = axis || {};
|
|
|
389
389
|
if (typeof module !== "undefined" && module.exports) {
|
|
390
390
|
module.exports = factory(require("jquery"));
|
|
391
391
|
} else {
|
|
392
|
-
window.
|
|
392
|
+
window.cartesian = factory(window.jQuery);
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
);
|
|
396
396
|
|
|
397
|
-
var
|
|
397
|
+
var cartesian = cartesian || {};
|
|
398
398
|
(function () {
|
|
399
|
-
|
|
399
|
+
cartesian.log = cartesian.log || {};
|
|
400
400
|
|
|
401
|
-
|
|
401
|
+
cartesian.log.levels = {
|
|
402
402
|
DEBUG: 1,
|
|
403
403
|
INFO: 2,
|
|
404
404
|
WARN: 3,
|
|
@@ -406,57 +406,57 @@ var axis = axis || {};
|
|
|
406
406
|
FATAL: 5,
|
|
407
407
|
};
|
|
408
408
|
|
|
409
|
-
|
|
409
|
+
cartesian.log.level = cartesian.log.levels.DEBUG;
|
|
410
410
|
|
|
411
|
-
|
|
411
|
+
cartesian.log.log = function (logObject, logLevel) {
|
|
412
412
|
if (!window.console || !window.console.log) {
|
|
413
413
|
return;
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
-
if (logLevel != undefined && logLevel <
|
|
416
|
+
if (logLevel != undefined && logLevel < cartesian.log.level) {
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
419
|
};
|
|
420
420
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
421
|
+
cartesian.log.debug = function (logObject) {
|
|
422
|
+
cartesian.log.log("DEBUG: ", cartesian.log.levels.DEBUG);
|
|
423
|
+
cartesian.log.log(logObject, cartesian.log.levels.DEBUG);
|
|
424
424
|
};
|
|
425
425
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
426
|
+
cartesian.log.info = function (logObject) {
|
|
427
|
+
cartesian.log.log("INFO: ", cartesian.log.levels.INFO);
|
|
428
|
+
cartesian.log.log(logObject, cartesian.log.levels.INFO);
|
|
429
429
|
};
|
|
430
430
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
431
|
+
cartesian.log.warn = function (logObject) {
|
|
432
|
+
cartesian.log.log("WARN: ", cartesian.log.levels.WARN);
|
|
433
|
+
cartesian.log.log(logObject, cartesian.log.levels.WARN);
|
|
434
434
|
};
|
|
435
435
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
436
|
+
cartesian.log.error = function (logObject) {
|
|
437
|
+
cartesian.log.log("ERROR: ", cartesian.log.levels.ERROR);
|
|
438
|
+
cartesian.log.log(logObject, cartesian.log.levels.ERROR);
|
|
439
439
|
};
|
|
440
440
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
441
|
+
cartesian.log.fatal = function (logObject) {
|
|
442
|
+
cartesian.log.log("FATAL: ", cartesian.log.levels.FATAL);
|
|
443
|
+
cartesian.log.log(logObject, cartesian.log.levels.FATAL);
|
|
444
444
|
};
|
|
445
445
|
})();
|
|
446
446
|
|
|
447
|
-
var
|
|
447
|
+
var cartesian = cartesian || {};
|
|
448
448
|
(function (define) {
|
|
449
449
|
define(["jquery"], function ($) {
|
|
450
450
|
|
|
451
451
|
// Messages API - Defines Messages API, not implements it
|
|
452
|
-
|
|
452
|
+
cartesian.message = cartesian.message || {};
|
|
453
453
|
|
|
454
454
|
var showMessage = function (message, title, options) {
|
|
455
455
|
alert((title || "") + " " + message);
|
|
456
456
|
|
|
457
457
|
if (!$) {
|
|
458
|
-
|
|
459
|
-
"
|
|
458
|
+
cartesian.log.warn(
|
|
459
|
+
"cartesian.message can not return promise since jQuery is not defined!"
|
|
460
460
|
);
|
|
461
461
|
return null;
|
|
462
462
|
}
|
|
@@ -466,35 +466,35 @@ var axis = axis || {};
|
|
|
466
466
|
});
|
|
467
467
|
};
|
|
468
468
|
|
|
469
|
-
|
|
470
|
-
|
|
469
|
+
cartesian.message.info = function (message, title, options) {
|
|
470
|
+
cartesian.log.warn("cartesian.message.info is not implemented!");
|
|
471
471
|
return showMessage(message, title, options);
|
|
472
472
|
};
|
|
473
473
|
|
|
474
|
-
|
|
475
|
-
|
|
474
|
+
cartesian.message.success = function (message, title, options) {
|
|
475
|
+
cartesian.log.warn("cartesian.message.success is not implemented!");
|
|
476
476
|
return showMessage(message, title, options);
|
|
477
477
|
};
|
|
478
478
|
|
|
479
|
-
|
|
480
|
-
|
|
479
|
+
cartesian.message.warn = function (message, title, options) {
|
|
480
|
+
cartesian.log.warn("cartesian.message.warn is not implemented!");
|
|
481
481
|
return showMessage(message, title, options);
|
|
482
482
|
};
|
|
483
483
|
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
cartesian.message.error = function (message, title, options) {
|
|
485
|
+
cartesian.log.warn("cartesian.message.error is not implemented!");
|
|
486
486
|
return showMessage(message, title, options);
|
|
487
487
|
};
|
|
488
488
|
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
cartesian.message.confirm = function (message, title, callback, options) {
|
|
490
|
+
cartesian.log.warn("cartesian.message.confirm is not implemented!");
|
|
491
491
|
|
|
492
492
|
var result = confirm(message);
|
|
493
493
|
callback && callback(result);
|
|
494
494
|
|
|
495
495
|
if (!$) {
|
|
496
|
-
|
|
497
|
-
"
|
|
496
|
+
cartesian.log.warn(
|
|
497
|
+
"cartesian.message can not return promise since jQuery is not defined!"
|
|
498
498
|
);
|
|
499
499
|
return null;
|
|
500
500
|
}
|
|
@@ -504,7 +504,7 @@ var axis = axis || {};
|
|
|
504
504
|
});
|
|
505
505
|
};
|
|
506
506
|
|
|
507
|
-
return
|
|
507
|
+
return cartesian;
|
|
508
508
|
});
|
|
509
509
|
})(
|
|
510
510
|
typeof define === "function" && define.amd
|
|
@@ -513,37 +513,37 @@ var axis = axis || {};
|
|
|
513
513
|
if (typeof module !== "undefined" && module.exports) {
|
|
514
514
|
module.exports = factory(require("jquery"));
|
|
515
515
|
} else {
|
|
516
|
-
window.
|
|
516
|
+
window.cartesian = factory(window.jQuery);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
);
|
|
520
520
|
|
|
521
|
-
var
|
|
521
|
+
var cartesian = cartesian || {};
|
|
522
522
|
(function () {
|
|
523
|
-
|
|
523
|
+
cartesian.ui = cartesian.ui || {};
|
|
524
524
|
|
|
525
525
|
// UI Block - Defines UI Block API, not implements it
|
|
526
|
-
|
|
527
|
-
|
|
526
|
+
cartesian.ui.block = function (elm) {
|
|
527
|
+
cartesian.log.warn("cartesian.ui.block is not implemented!");
|
|
528
528
|
};
|
|
529
529
|
|
|
530
|
-
|
|
531
|
-
|
|
530
|
+
cartesian.ui.unblock = function (elm) {
|
|
531
|
+
cartesian.log.warn("cartesian.ui.unblock is not implemented!");
|
|
532
532
|
};
|
|
533
533
|
|
|
534
534
|
// UI BUSY - Defines UI Busy API, not implements it
|
|
535
|
-
|
|
536
|
-
|
|
535
|
+
cartesian.ui.setBusy = function (elm, text, delay) {
|
|
536
|
+
cartesian.log.warn("cartesian.ui.setBusy is not implemented!");
|
|
537
537
|
};
|
|
538
538
|
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
cartesian.ui.clearBusy = function (elm, delay) {
|
|
540
|
+
cartesian.log.warn("cartesian.ui.clearBusy is not implemented!");
|
|
541
541
|
};
|
|
542
542
|
})();
|
|
543
543
|
|
|
544
|
-
var
|
|
544
|
+
var cartesian = cartesian || {};
|
|
545
545
|
(function () {
|
|
546
|
-
|
|
546
|
+
cartesian.event = (function () {
|
|
547
547
|
var _callbacks = {};
|
|
548
548
|
|
|
549
549
|
var on = function (eventName, callback) {
|
|
@@ -597,18 +597,18 @@ var axis = axis || {};
|
|
|
597
597
|
})();
|
|
598
598
|
})();
|
|
599
599
|
|
|
600
|
-
var
|
|
600
|
+
var cartesian = cartesian || {};
|
|
601
601
|
(function (define) {
|
|
602
602
|
define(["jquery"], function ($) {
|
|
603
|
-
|
|
603
|
+
cartesian.utils = cartesian.utils || {};
|
|
604
604
|
|
|
605
605
|
/* Creates a name namespace.
|
|
606
606
|
* Example:
|
|
607
|
-
* var taskService =
|
|
608
|
-
* taskService will be equal to
|
|
607
|
+
* var taskService = cartesian.utils.createNamespace(cartesian, 'services.task');
|
|
608
|
+
* taskService will be equal to cartesian.services.task
|
|
609
609
|
* first argument (root) must be defined first
|
|
610
610
|
************************************************************/
|
|
611
|
-
|
|
611
|
+
cartesian.utils.createNamespace = function (root, ns) {
|
|
612
612
|
var parts = ns.split(".");
|
|
613
613
|
for (var i = 0; i < parts.length; i++) {
|
|
614
614
|
if (typeof root[parts[i]] == "undefined") {
|
|
@@ -624,18 +624,18 @@ var axis = axis || {};
|
|
|
624
624
|
/* Find and replaces a string (search) to another string (replacement) in
|
|
625
625
|
* given string (str).
|
|
626
626
|
* Example:
|
|
627
|
-
*
|
|
627
|
+
* cartesian.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string'
|
|
628
628
|
************************************************************/
|
|
629
|
-
|
|
629
|
+
cartesian.utils.replaceAll = function (str, search, replacement) {
|
|
630
630
|
var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
631
631
|
return str.replace(new RegExp(fix, "g"), replacement);
|
|
632
632
|
};
|
|
633
633
|
|
|
634
634
|
/* Formats a string just like string.format in C#.
|
|
635
635
|
* Example:
|
|
636
|
-
*
|
|
636
|
+
* cartesian.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana'
|
|
637
637
|
************************************************************/
|
|
638
|
-
|
|
638
|
+
cartesian.utils.formatString = function () {
|
|
639
639
|
if (arguments.length < 1) {
|
|
640
640
|
return null;
|
|
641
641
|
}
|
|
@@ -644,13 +644,13 @@ var axis = axis || {};
|
|
|
644
644
|
|
|
645
645
|
for (var i = 1; i < arguments.length; i++) {
|
|
646
646
|
var placeHolder = "{" + (i - 1) + "}";
|
|
647
|
-
str =
|
|
647
|
+
str = cartesian.utils.replaceAll(str, placeHolder, arguments[i]);
|
|
648
648
|
}
|
|
649
649
|
|
|
650
650
|
return str;
|
|
651
651
|
};
|
|
652
652
|
|
|
653
|
-
|
|
653
|
+
cartesian.utils.toPascalCase = function (str) {
|
|
654
654
|
if (!str || !str.length) {
|
|
655
655
|
return str;
|
|
656
656
|
}
|
|
@@ -662,7 +662,7 @@ var axis = axis || {};
|
|
|
662
662
|
return str.charAt(0).toUpperCase() + str.substr(1);
|
|
663
663
|
};
|
|
664
664
|
|
|
665
|
-
|
|
665
|
+
cartesian.utils.toCamelCase = function (str) {
|
|
666
666
|
if (!str || !str.length) {
|
|
667
667
|
return str;
|
|
668
668
|
}
|
|
@@ -674,7 +674,7 @@ var axis = axis || {};
|
|
|
674
674
|
return str.charAt(0).toLowerCase() + str.substr(1);
|
|
675
675
|
};
|
|
676
676
|
|
|
677
|
-
|
|
677
|
+
cartesian.utils.truncateString = function (str, maxLength) {
|
|
678
678
|
if (!str || !str.length || str.length <= maxLength) {
|
|
679
679
|
return str;
|
|
680
680
|
}
|
|
@@ -682,7 +682,7 @@ var axis = axis || {};
|
|
|
682
682
|
return str.substr(0, maxLength);
|
|
683
683
|
};
|
|
684
684
|
|
|
685
|
-
|
|
685
|
+
cartesian.utils.truncateStringWithPostfix = function (str, maxLength, postfix) {
|
|
686
686
|
postfix = postfix || "...";
|
|
687
687
|
|
|
688
688
|
if (!str || !str.length || str.length <= maxLength) {
|
|
@@ -696,7 +696,7 @@ var axis = axis || {};
|
|
|
696
696
|
return str.substr(0, maxLength - postfix.length) + postfix;
|
|
697
697
|
};
|
|
698
698
|
|
|
699
|
-
|
|
699
|
+
cartesian.utils.isFunction = function (obj) {
|
|
700
700
|
if ($) {
|
|
701
701
|
//Prefer to use jQuery if possible
|
|
702
702
|
return $.isFunction(obj);
|
|
@@ -711,7 +711,7 @@ var axis = axis || {};
|
|
|
711
711
|
* where name is query string parameter name and value is it's value.
|
|
712
712
|
* includeQuestionMark is true by default.
|
|
713
713
|
*/
|
|
714
|
-
|
|
714
|
+
cartesian.utils.buildQueryString = function (
|
|
715
715
|
parameterInfos,
|
|
716
716
|
includeQuestionMark
|
|
717
717
|
) {
|
|
@@ -783,14 +783,14 @@ var axis = axis || {};
|
|
|
783
783
|
|
|
784
784
|
/**
|
|
785
785
|
* Sets a cookie value for given key.
|
|
786
|
-
* This is a simple implementation created to be used by
|
|
786
|
+
* This is a simple implementation created to be used by Cartesian.
|
|
787
787
|
* Please use a complete cookie library if you need.
|
|
788
788
|
* @param {string} key
|
|
789
789
|
* @param {string} value
|
|
790
790
|
* @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session.
|
|
791
791
|
* @param {string} path (optional)
|
|
792
792
|
*/
|
|
793
|
-
|
|
793
|
+
cartesian.utils.setCookieValue = function (
|
|
794
794
|
key,
|
|
795
795
|
value,
|
|
796
796
|
expireDate,
|
|
@@ -820,12 +820,12 @@ var axis = axis || {};
|
|
|
820
820
|
|
|
821
821
|
/**
|
|
822
822
|
* Gets a cookie with given key.
|
|
823
|
-
* This is a simple implementation created to be used by
|
|
823
|
+
* This is a simple implementation created to be used by Cartesian.
|
|
824
824
|
* Please use a complete cookie library if you need.
|
|
825
825
|
* @param {string} key
|
|
826
826
|
* @returns {string} Cookie value or null
|
|
827
827
|
*/
|
|
828
|
-
|
|
828
|
+
cartesian.utils.getCookieValue = function (key) {
|
|
829
829
|
var equalities = document.cookie.split("; ");
|
|
830
830
|
for (var i = 0; i < equalities.length; i++) {
|
|
831
831
|
if (!equalities[i]) {
|
|
@@ -847,12 +847,12 @@ var axis = axis || {};
|
|
|
847
847
|
|
|
848
848
|
/**
|
|
849
849
|
* Deletes cookie for given key.
|
|
850
|
-
* This is a simple implementation created to be used by
|
|
850
|
+
* This is a simple implementation created to be used by Cartesian.
|
|
851
851
|
* Please use a complete cookie library if you need.
|
|
852
852
|
* @param {string} key
|
|
853
853
|
* @param {string} path (optional)
|
|
854
854
|
*/
|
|
855
|
-
|
|
855
|
+
cartesian.utils.deleteCookie = function (key, path) {
|
|
856
856
|
var cookieValue = encodeURIComponent(key) + "=";
|
|
857
857
|
|
|
858
858
|
cookieValue =
|
|
@@ -872,13 +872,13 @@ var axis = axis || {};
|
|
|
872
872
|
* @param {string} url
|
|
873
873
|
* @returns {string}
|
|
874
874
|
*/
|
|
875
|
-
|
|
875
|
+
cartesian.utils.getDomain = function (url) {
|
|
876
876
|
var domainRegex = /(https?:){0,1}\/\/((?:[\w\d-]+\.)+[\w\d]{2,})/i;
|
|
877
877
|
var matches = domainRegex.exec(url);
|
|
878
878
|
return matches && matches[2] ? matches[2] : "";
|
|
879
879
|
};
|
|
880
880
|
|
|
881
|
-
return
|
|
881
|
+
return cartesian;
|
|
882
882
|
});
|
|
883
883
|
})(
|
|
884
884
|
typeof define === "function" && define.amd
|
|
@@ -887,16 +887,16 @@ var axis = axis || {};
|
|
|
887
887
|
if (typeof module !== "undefined" && module.exports) {
|
|
888
888
|
module.exports = factory(require("jquery"));
|
|
889
889
|
} else {
|
|
890
|
-
window.
|
|
890
|
+
window.cartesian = factory(window.jQuery);
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
);
|
|
894
894
|
|
|
895
|
-
var
|
|
895
|
+
var cartesian = cartesian || {};
|
|
896
896
|
(function () {
|
|
897
|
-
|
|
897
|
+
cartesian.timing = cartesian.timing || {};
|
|
898
898
|
|
|
899
|
-
|
|
899
|
+
cartesian.timing.utcClockProvider = (function () {
|
|
900
900
|
var toUtc = function (date) {
|
|
901
901
|
return Date.UTC(
|
|
902
902
|
date.getUTCFullYear(),
|
|
@@ -930,7 +930,7 @@ var axis = axis || {};
|
|
|
930
930
|
};
|
|
931
931
|
})();
|
|
932
932
|
|
|
933
|
-
|
|
933
|
+
cartesian.timing.localClockProvider = (function () {
|
|
934
934
|
var toLocal = function (date) {
|
|
935
935
|
return new Date(
|
|
936
936
|
date.getFullYear(),
|
|
@@ -963,7 +963,7 @@ var axis = axis || {};
|
|
|
963
963
|
};
|
|
964
964
|
})();
|
|
965
965
|
|
|
966
|
-
|
|
966
|
+
cartesian.timing.unspecifiedClockProvider = (function () {
|
|
967
967
|
var now = function () {
|
|
968
968
|
return new Date();
|
|
969
969
|
};
|
|
@@ -980,56 +980,56 @@ var axis = axis || {};
|
|
|
980
980
|
};
|
|
981
981
|
})();
|
|
982
982
|
|
|
983
|
-
|
|
983
|
+
cartesian.timing.convertToUserTimezone = function (date) {
|
|
984
984
|
var localTime = date.getTime();
|
|
985
985
|
var utcTime = localTime + date.getTimezoneOffset() * 60000;
|
|
986
986
|
var targetTime =
|
|
987
987
|
parseInt(utcTime) +
|
|
988
|
-
parseInt(
|
|
988
|
+
parseInt(cartesian.timing.timeZoneInfo.server.currentUtcOffsetInMilliseconds);
|
|
989
989
|
return new Date(targetTime);
|
|
990
990
|
};
|
|
991
991
|
})();
|
|
992
992
|
|
|
993
|
-
var
|
|
993
|
+
var cartesian = cartesian || {};
|
|
994
994
|
(function () {
|
|
995
|
-
|
|
995
|
+
cartesian.clock = cartesian.clock || {};
|
|
996
996
|
|
|
997
|
-
|
|
998
|
-
if (
|
|
999
|
-
return
|
|
997
|
+
cartesian.clock.now = function () {
|
|
998
|
+
if (cartesian.clock.provider) {
|
|
999
|
+
return cartesian.clock.provider.now();
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
1002
|
return new Date();
|
|
1003
1003
|
};
|
|
1004
1004
|
|
|
1005
|
-
|
|
1006
|
-
if (
|
|
1007
|
-
return
|
|
1005
|
+
cartesian.clock.normalize = function (date) {
|
|
1006
|
+
if (cartesian.clock.provider) {
|
|
1007
|
+
return cartesian.clock.provider.normalize(date);
|
|
1008
1008
|
}
|
|
1009
1009
|
|
|
1010
1010
|
return date;
|
|
1011
1011
|
};
|
|
1012
1012
|
|
|
1013
|
-
|
|
1013
|
+
cartesian.clock.provider = cartesian.timing.unspecifiedClockProvider;
|
|
1014
1014
|
})();
|
|
1015
1015
|
|
|
1016
|
-
var
|
|
1016
|
+
var cartesian = cartesian || {};
|
|
1017
1017
|
(function () {
|
|
1018
|
-
|
|
1019
|
-
|
|
1018
|
+
cartesian.security = cartesian.security || {};
|
|
1019
|
+
cartesian.security.antiForgery = cartesian.security.antiForgery || {};
|
|
1020
1020
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1021
|
+
cartesian.security.antiForgery.tokenCookieName = "XSRF-TOKEN";
|
|
1022
|
+
cartesian.security.antiForgery.tokenHeaderName = "X-XSRF-TOKEN";
|
|
1023
1023
|
|
|
1024
|
-
|
|
1025
|
-
return
|
|
1024
|
+
cartesian.security.antiForgery.getToken = function () {
|
|
1025
|
+
return cartesian.utils.getCookieValue(cartesian.security.antiForgery.tokenCookieName);
|
|
1026
1026
|
};
|
|
1027
1027
|
|
|
1028
|
-
|
|
1028
|
+
cartesian.security.antiForgery.shouldSendToken = function (settings) {
|
|
1029
1029
|
if (settings.crossDomain === undefined || settings.crossDomain === null) {
|
|
1030
1030
|
return (
|
|
1031
|
-
|
|
1032
|
-
|
|
1031
|
+
cartesian.utils.getDomain(location.href) ===
|
|
1032
|
+
cartesian.utils.getDomain(settings.url)
|
|
1033
1033
|
);
|
|
1034
1034
|
}
|
|
1035
1035
|
|
|
@@ -1037,64 +1037,64 @@ var axis = axis || {};
|
|
|
1037
1037
|
};
|
|
1038
1038
|
})();
|
|
1039
1039
|
|
|
1040
|
-
var
|
|
1040
|
+
var cartesian = cartesian || {};
|
|
1041
1041
|
(function () {
|
|
1042
1042
|
// Current application root path (including virtual directory if exists).
|
|
1043
|
-
|
|
1044
|
-
|
|
1043
|
+
cartesian.appPath = cartesian.appPath || "/";
|
|
1044
|
+
cartesian.pageLoadTime = new Date();
|
|
1045
1045
|
|
|
1046
|
-
// Converts given path to absolute path using
|
|
1047
|
-
|
|
1046
|
+
// Converts given path to absolute path using cartesian.appPath variable.
|
|
1047
|
+
cartesian.toAbsAppPath = function (path) {
|
|
1048
1048
|
if (path.indexOf("/") == 0) {
|
|
1049
1049
|
path = path.substring(1);
|
|
1050
1050
|
}
|
|
1051
|
-
return
|
|
1051
|
+
return cartesian.appPath + path;
|
|
1052
1052
|
};
|
|
1053
1053
|
})();
|
|
1054
1054
|
|
|
1055
|
-
var
|
|
1055
|
+
var cartesian = cartesian || {};
|
|
1056
1056
|
(function () {
|
|
1057
|
-
|
|
1057
|
+
cartesian.session = cartesian.session || {};
|
|
1058
1058
|
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1059
|
+
cartesian.session.userId = false;
|
|
1060
|
+
cartesian.session.isAdmin = false;
|
|
1061
|
+
cartesian.session.hostId = false;
|
|
1062
|
+
cartesian.session.tenantId = false;
|
|
1063
|
+
cartesian.session.side = cartesian.tenancy.sides.TENANT; //1: Tenant, 2: Host
|
|
1064
1064
|
|
|
1065
|
-
|
|
1066
|
-
if (
|
|
1065
|
+
cartesian.session.isHostAdmin = function () {
|
|
1066
|
+
if (cartesian.session.hostId && cartesian.session.isAdmin) {
|
|
1067
1067
|
return true;
|
|
1068
1068
|
}
|
|
1069
1069
|
|
|
1070
1070
|
return false;
|
|
1071
1071
|
};
|
|
1072
1072
|
|
|
1073
|
-
|
|
1074
|
-
if (
|
|
1073
|
+
cartesian.session.isTenantAdmin = function () {
|
|
1074
|
+
if (cartesian.session.tenantId && cartesian.session.isAdmin) {
|
|
1075
1075
|
return true;
|
|
1076
1076
|
}
|
|
1077
1077
|
|
|
1078
1078
|
return false;
|
|
1079
1079
|
};
|
|
1080
1080
|
|
|
1081
|
-
|
|
1082
|
-
if (
|
|
1081
|
+
cartesian.session.isUserLogged = function () {
|
|
1082
|
+
if (cartesian.session.userId) {
|
|
1083
1083
|
return true;
|
|
1084
1084
|
}
|
|
1085
1085
|
return false;
|
|
1086
1086
|
};
|
|
1087
1087
|
|
|
1088
|
-
|
|
1089
|
-
if(
|
|
1088
|
+
cartesian.session.isHostSide = function () {
|
|
1089
|
+
if(cartesian.session.side === cartesian.tenancy.sides.HOST) {
|
|
1090
1090
|
return true;
|
|
1091
1091
|
}
|
|
1092
1092
|
|
|
1093
1093
|
return false;
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
|
-
|
|
1097
|
-
if(
|
|
1096
|
+
cartesian.session.isTenantSide = function () {
|
|
1097
|
+
if(cartesian.session.side === cartesian.tenancy.sides.TENANT) {
|
|
1098
1098
|
return true;
|
|
1099
1099
|
}
|
|
1100
1100
|
|
|
@@ -1103,23 +1103,23 @@ var axis = axis || {};
|
|
|
1103
1103
|
|
|
1104
1104
|
})();
|
|
1105
1105
|
|
|
1106
|
-
var
|
|
1106
|
+
var cartesian = cartesian || {};
|
|
1107
1107
|
(function () {
|
|
1108
|
-
// Implements Settings API that simplifies usage of setting scripts generated by
|
|
1109
|
-
|
|
1108
|
+
// Implements Settings API that simplifies usage of setting scripts generated by Cartesian.
|
|
1109
|
+
cartesian.setting = cartesian.setting || {};
|
|
1110
1110
|
|
|
1111
|
-
|
|
1111
|
+
cartesian.setting.values = cartesian.setting.values || {};
|
|
1112
1112
|
|
|
1113
|
-
|
|
1114
|
-
return
|
|
1113
|
+
cartesian.setting.get = function (name) {
|
|
1114
|
+
return cartesian.setting.values[name];
|
|
1115
1115
|
};
|
|
1116
1116
|
|
|
1117
|
-
|
|
1118
|
-
var value =
|
|
1117
|
+
cartesian.setting.getBoolean = function (name) {
|
|
1118
|
+
var value = cartesian.setting.get(name);
|
|
1119
1119
|
return value == "true" || value == "True";
|
|
1120
1120
|
};
|
|
1121
1121
|
|
|
1122
|
-
|
|
1123
|
-
return parseInt(
|
|
1122
|
+
cartesian.setting.getInt = function (name) {
|
|
1123
|
+
return parseInt(cartesian.setting.values[name]);
|
|
1124
1124
|
};
|
|
1125
1125
|
})();
|