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