@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.
@@ -1,39 +1,39 @@
1
- var axis = {};
1
+ var cartesian = {};
2
2
 
3
- var axis = axis || {};
3
+ var cartesian = cartesian || {};
4
4
  (function () {
5
- axis.tenancy = axis.tenancy || {};
5
+ cartesian.tenancy = cartesian.tenancy || {};
6
6
 
7
- axis.tenancy.isEnabled = false;
8
- axis.tenancy.headerAttribute = 'Axis-Host';
9
- axis.tenancy.ignoreFeatureCheckForHostUsers = false;
7
+ cartesian.tenancy.isEnabled = false;
8
+ cartesian.tenancy.headerAttribute = 'Cartesian-Host';
9
+ cartesian.tenancy.ignoreFeatureCheckForHostUsers = false;
10
10
 
11
- axis.tenancy.sides = {
11
+ cartesian.tenancy.sides = {
12
12
  TENANT: 1,
13
13
  HOST: 2,
14
14
  };
15
15
 
16
- axis.tenancy.tenantIdCookieName = "Axis.TenantId";
16
+ cartesian.tenancy.tenantIdCookieName = "Cartesian.TenantId";
17
17
 
18
- axis.tenancy.setTenantIdCookie = function (tenantId) {
18
+ cartesian.tenancy.setTenantIdCookie = function (tenantId) {
19
19
  if (tenantId) {
20
- axis.utils.setCookieValue(
21
- axis.tenancy.tenantIdCookieName,
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
- axis.appPath,
25
- axis.domain
24
+ cartesian.appPath,
25
+ cartesian.domain
26
26
  );
27
27
  } else {
28
- axis.utils.deleteCookie(
29
- axis.tenancy.tenantIdCookieName,
30
- axis.appPath
28
+ cartesian.utils.deleteCookie(
29
+ cartesian.tenancy.tenantIdCookieName,
30
+ cartesian.appPath
31
31
  );
32
32
  }
33
33
  };
34
34
 
35
- axis.tenancy.getTenantIdCookie = function () {
36
- var value = axis.utils.getCookieValue(axis.tenancy.tenantIdCookieName);
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 axis = axis || {};
45
+ var cartesian = cartesian || {};
46
46
  (function () {
47
47
 
48
- axis.localization = axis.localization || {};
48
+ cartesian.localization = cartesian.localization || {};
49
49
 
50
- axis.localization.languages = [];
50
+ cartesian.localization.languages = [];
51
51
 
52
- axis.localization.currentLanguage = {};
52
+ cartesian.localization.currentLanguage = {};
53
53
 
54
- axis.localization.sources = [];
54
+ cartesian.localization.sources = [];
55
55
 
56
- axis.localization.values = {};
56
+ cartesian.localization.values = {};
57
57
 
58
- axis.localization.localize = function (key, sourceName) {
59
- sourceName = sourceName || axis.localization.defaultSourceName;
58
+ cartesian.localization.localize = function (key, sourceName) {
59
+ sourceName = sourceName || cartesian.localization.defaultSourceName;
60
60
 
61
- var source = axis.localization.values[sourceName];
61
+ var source = cartesian.localization.values[sourceName];
62
62
 
63
63
  if (!source) {
64
- axis.log.warn("Could not find localization source: " + sourceName);
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 axis.utils.formatString.apply(this, copiedArguments);
77
+ return cartesian.utils.formatString.apply(this, copiedArguments);
78
78
  };
79
79
 
80
- axis.localization.getSource = function (sourceName) {
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 axis.localization.localize.apply(this, copiedArguments);
84
+ return cartesian.localization.localize.apply(this, copiedArguments);
85
85
  };
86
86
  };
87
87
 
88
- axis.localization.isCurrentCulture = function (name) {
88
+ cartesian.localization.isCurrentCulture = function (name) {
89
89
  return (
90
- axis.localization.currentCulture &&
91
- axis.localization.currentCulture.name &&
92
- axis.localization.currentCulture.name.indexOf(name) == 0
90
+ cartesian.localization.currentCulture &&
91
+ cartesian.localization.currentCulture.name &&
92
+ cartesian.localization.currentCulture.name.indexOf(name) == 0
93
93
  );
94
94
  };
95
95
 
96
- axis.localization.defaultSourceName = undefined;
97
- axis.localization.axisWeb = axis.localization.getSource("AxisWeb");
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 Axis.
101
- var axis = axis || {};
100
+ // Implements Authorization API that simplifies usage of authorization scripts generated by Cartesian.
101
+ var cartesian = cartesian || {};
102
102
  (function () {
103
- axis.auth = axis.auth || {};
103
+ cartesian.auth = cartesian.auth || {};
104
104
 
105
- axis.auth.allPermissions = axis.auth.allPermissions || {};
105
+ cartesian.auth.allPermissions = cartesian.auth.allPermissions || {};
106
106
 
107
- axis.auth.grantedPermissions = axis.auth.grantedPermissions || {};
107
+ cartesian.auth.grantedPermissions = cartesian.auth.grantedPermissions || {};
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
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 (axis.auth.isGranted(arguments[i])) {
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
- axis.auth.areAllGranted = function () {
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 (!axis.auth.isGranted(arguments[i])) {
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
- axis.auth.tokenCookieName = "Axis.AuthToken";
159
+ cartesian.auth.tokenCookieName = "Cartesian.AuthToken";
160
160
 
161
- axis.auth.setToken = function (authToken, expireDate) {
162
- axis.utils.setCookieValue(
163
- axis.auth.tokenCookieName,
161
+ cartesian.auth.setToken = function (authToken, expireDate) {
162
+ cartesian.utils.setCookieValue(
163
+ cartesian.auth.tokenCookieName,
164
164
  authToken,
165
165
  expireDate,
166
- axis.appPath,
167
- axis.domain
166
+ cartesian.appPath,
167
+ cartesian.domain
168
168
  );
169
169
  };
170
170
 
171
- axis.auth.getToken = function () {
172
- return axis.utils.getCookieValue(axis.auth.tokenCookieName);
171
+ cartesian.auth.getToken = function () {
172
+ return cartesian.utils.getCookieValue(cartesian.auth.tokenCookieName);
173
173
  };
174
174
 
175
- axis.auth.clearToken = function () {
176
- axis.auth.setToken();
175
+ cartesian.auth.clearToken = function () {
176
+ cartesian.auth.setToken();
177
177
  };
178
178
 
179
- axis.auth.refreshTokenCookieName = "Axis.AuthRefreshToken";
179
+ cartesian.auth.refreshTokenCookieName = "Cartesian.AuthRefreshToken";
180
180
 
181
- axis.auth.setRefreshToken = function (refreshToken, expireDate) {
182
- axis.utils.setCookieValue(
183
- axis.auth.refreshTokenCookieName,
181
+ cartesian.auth.setRefreshToken = function (refreshToken, expireDate) {
182
+ cartesian.utils.setCookieValue(
183
+ cartesian.auth.refreshTokenCookieName,
184
184
  refreshToken,
185
185
  expireDate,
186
- axis.appPath,
187
- axis.domain
186
+ cartesian.appPath,
187
+ cartesian.domain
188
188
  );
189
189
  };
190
190
 
191
- axis.auth.getRefreshToken = function () {
192
- return axis.utils.getCookieValue(axis.auth.refreshTokenCookieName);
191
+ cartesian.auth.getRefreshToken = function () {
192
+ return cartesian.utils.getCookieValue(cartesian.auth.refreshTokenCookieName);
193
193
  };
194
194
 
195
- axis.auth.clearRefreshToken = function () {
196
- axis.auth.setRefreshToken();
195
+ cartesian.auth.clearRefreshToken = function () {
196
+ cartesian.auth.setRefreshToken();
197
197
  };
198
198
  })();
199
199
 
200
- var axis = axis || {};
200
+ var cartesian = cartesian || {};
201
201
  (function () {
202
- //Implements Features API that simplifies usage of feature scripts generated by Axis.
203
- axis.features = axis.features || {};
202
+ //Implements Features API that simplifies usage of feature scripts generated by Cartesian.
203
+ cartesian.features = cartesian.features || {};
204
204
 
205
- axis.features.allFeatures = axis.features.allFeatures || {};
205
+ cartesian.features.allFeatures = cartesian.features.allFeatures || {};
206
206
 
207
- axis.features.get = function (name) {
208
- return axis.features.allFeatures[name];
207
+ cartesian.features.get = function (name) {
208
+ return cartesian.features.allFeatures[name];
209
209
  };
210
210
 
211
- axis.features.getValue = function (name) {
212
- var feature = axis.features.get(name);
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
- axis.features.isEnabled = function (name) {
221
- var value = axis.features.getValue(name);
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 axis = axis || {};
226
+ var cartesian = cartesian || {};
227
227
  (function (define) {
228
228
  define(["jquery"], function ($) {
229
229
  // Notification - Defines Notification API, not implements it
230
- axis.notifications = axis.notifications || {};
230
+ cartesian.notifications = cartesian.notifications || {};
231
231
 
232
- axis.notifications.severity = {
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
- axis.notifications.userNotificationState = {
240
+ cartesian.notifications.userNotificationState = {
241
241
  UNREAD: 0,
242
242
  READ: 1,
243
243
  };
244
244
 
245
- axis.notifications.getUserNotificationStateAsString = function (
245
+ cartesian.notifications.getUserNotificationStateAsString = function (
246
246
  userNotificationState
247
247
  ) {
248
248
  switch (userNotificationState) {
249
- case axis.notifications.userNotificationState.READ:
249
+ case cartesian.notifications.userNotificationState.READ:
250
250
  return "READ";
251
- case axis.notifications.userNotificationState.UNREAD:
251
+ case cartesian.notifications.userNotificationState.UNREAD:
252
252
  return "UNREAD";
253
253
  default:
254
- axis.log.warn(
254
+ cartesian.log.warn(
255
255
  "Unknown user notification state value: " + userNotificationState
256
256
  );
257
257
  return "?";
258
258
  }
259
259
  };
260
260
 
261
- axis.notifications.getUiNotifyFuncBySeverity = function (severity) {
261
+ cartesian.notifications.getUiNotifyFuncBySeverity = function (severity) {
262
262
  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:
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 axis.notify.info;
273
+ return cartesian.notify.info;
274
274
  }
275
275
  };
276
276
 
277
- axis.notifications.messageFormatters = {};
277
+ cartesian.notifications.messageFormatters = {};
278
278
 
279
- axis.notifications.messageFormatters[
280
- "Axis.Notifications.MessageNotificationData"
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
- axis.notifications.messageFormatters[
289
- "Axis.Notifications.LocalizableMessageNotificationData"
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 = axis.localization.localize(
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
- axis.notifications.getFormattedMessageFromUserNotification = function (
325
+ cartesian.notifications.getFormattedMessageFromUserNotification = function (
326
326
  userNotification
327
327
  ) {
328
328
  var formatter =
329
- axis.notifications.messageFormatters[
329
+ cartesian.notifications.messageFormatters[
330
330
  userNotification.notification.data.type
331
331
  ];
332
332
  if (!formatter) {
333
- axis.log.warn(
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 (!axis.utils.isFunction(formatter)) {
341
- axis.log.warn(
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
- axis.notifications.showUiNotifyForUserNotification = function (
351
+ cartesian.notifications.showUiNotifyForUserNotification = function (
352
352
  userNotification,
353
353
  options
354
354
  ) {
355
- var message = axis.notifications.getFormattedMessageFromUserNotification(
355
+ var message = cartesian.notifications.getFormattedMessageFromUserNotification(
356
356
  userNotification
357
357
  );
358
- var uiNotifyFunc = axis.notifications.getUiNotifyFuncBySeverity(
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
- axis.notify = axis.notify || {};
365
+ cartesian.notify = cartesian.notify || {};
366
366
 
367
- axis.notify.success = function (message, title, options) {
368
- axis.log.warn("axis.notify.success is not implemented!");
367
+ cartesian.notify.success = function (message, title, options) {
368
+ cartesian.log.warn("cartesian.notify.success is not implemented!");
369
369
  };
370
370
 
371
- axis.notify.info = function (message, title, options) {
372
- axis.log.warn("axis.notify.info is not implemented!");
371
+ cartesian.notify.info = function (message, title, options) {
372
+ cartesian.log.warn("cartesian.notify.info is not implemented!");
373
373
  };
374
374
 
375
- axis.notify.warn = function (message, title, options) {
376
- axis.log.warn("axis.notify.warn is not implemented!");
375
+ cartesian.notify.warn = function (message, title, options) {
376
+ cartesian.log.warn("cartesian.notify.warn is not implemented!");
377
377
  };
378
378
 
379
- axis.notify.error = function (message, title, options) {
380
- axis.log.warn("axis.notify.error is not implemented!");
379
+ cartesian.notify.error = function (message, title, options) {
380
+ cartesian.log.warn("cartesian.notify.error is not implemented!");
381
381
  };
382
382
 
383
- return axis;
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.axis = factory(window.jQuery);
392
+ window.cartesian = factory(window.jQuery);
393
393
  }
394
394
  }
395
395
  );
396
396
 
397
- var axis = axis || {};
397
+ var cartesian = cartesian || {};
398
398
  (function () {
399
- axis.log = axis.log || {};
399
+ cartesian.log = cartesian.log || {};
400
400
 
401
- axis.log.levels = {
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
- axis.log.level = axis.log.levels.DEBUG;
409
+ cartesian.log.level = cartesian.log.levels.DEBUG;
410
410
 
411
- axis.log.log = function (logObject, logLevel) {
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 < axis.log.level) {
416
+ if (logLevel != undefined && logLevel < cartesian.log.level) {
417
417
  return;
418
418
  }
419
419
  };
420
420
 
421
- axis.log.debug = function (logObject) {
422
- axis.log.log("DEBUG: ", axis.log.levels.DEBUG);
423
- axis.log.log(logObject, axis.log.levels.DEBUG);
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
- axis.log.info = function (logObject) {
427
- axis.log.log("INFO: ", axis.log.levels.INFO);
428
- axis.log.log(logObject, axis.log.levels.INFO);
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
- axis.log.warn = function (logObject) {
432
- axis.log.log("WARN: ", axis.log.levels.WARN);
433
- axis.log.log(logObject, axis.log.levels.WARN);
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
- axis.log.error = function (logObject) {
437
- axis.log.log("ERROR: ", axis.log.levels.ERROR);
438
- axis.log.log(logObject, axis.log.levels.ERROR);
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
- axis.log.fatal = function (logObject) {
442
- axis.log.log("FATAL: ", axis.log.levels.FATAL);
443
- axis.log.log(logObject, axis.log.levels.FATAL);
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 axis = axis || {};
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
- axis.message = axis.message || {};
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
- axis.log.warn(
459
- "axis.message can not return promise since jQuery is not defined!"
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
- axis.message.info = function (message, title, options) {
470
- axis.log.warn("axis.message.info is not implemented!");
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
- axis.message.success = function (message, title, options) {
475
- axis.log.warn("axis.message.success is not implemented!");
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
- axis.message.warn = function (message, title, options) {
480
- axis.log.warn("axis.message.warn is not implemented!");
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
- axis.message.error = function (message, title, options) {
485
- axis.log.warn("axis.message.error is not implemented!");
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
- axis.message.confirm = function (message, title, callback, options) {
490
- axis.log.warn("axis.message.confirm is not implemented!");
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
- axis.log.warn(
497
- "axis.message can not return promise since jQuery is not defined!"
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 axis;
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.axis = factory(window.jQuery);
516
+ window.cartesian = factory(window.jQuery);
517
517
  }
518
518
  }
519
519
  );
520
520
 
521
- var axis = axis || {};
521
+ var cartesian = cartesian || {};
522
522
  (function () {
523
- axis.ui = axis.ui || {};
523
+ cartesian.ui = cartesian.ui || {};
524
524
 
525
525
  // 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!");
526
+ cartesian.ui.block = function (elm) {
527
+ cartesian.log.warn("cartesian.ui.block is not implemented!");
528
528
  };
529
529
 
530
- axis.ui.unblock = function (elm) {
531
- axis.log.warn("axis.ui.unblock is not implemented!");
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
- axis.ui.setBusy = function (elm, text, delay) {
536
- axis.log.warn("axis.ui.setBusy is not implemented!");
535
+ cartesian.ui.setBusy = function (elm, text, delay) {
536
+ cartesian.log.warn("cartesian.ui.setBusy is not implemented!");
537
537
  };
538
538
 
539
- axis.ui.clearBusy = function (elm, delay) {
540
- axis.log.warn("axis.ui.clearBusy is not implemented!");
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 axis = axis || {};
544
+ var cartesian = cartesian || {};
545
545
  (function () {
546
- axis.event = (function () {
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 axis = axis || {};
600
+ var cartesian = cartesian || {};
601
601
  (function (define) {
602
602
  define(["jquery"], function ($) {
603
- axis.utils = axis.utils || {};
603
+ cartesian.utils = cartesian.utils || {};
604
604
 
605
605
  /* Creates a name namespace.
606
606
  * Example:
607
- * var taskService = axis.utils.createNamespace(axis, 'services.task');
608
- * taskService will be equal to axis.services.task
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
- axis.utils.createNamespace = function (root, ns) {
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
- * axis.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string'
627
+ * cartesian.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string'
628
628
  ************************************************************/
629
- axis.utils.replaceAll = function (str, search, replacement) {
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
- * axis.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana'
636
+ * cartesian.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana'
637
637
  ************************************************************/
638
- axis.utils.formatString = function () {
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 = axis.utils.replaceAll(str, placeHolder, arguments[i]);
647
+ str = cartesian.utils.replaceAll(str, placeHolder, arguments[i]);
648
648
  }
649
649
 
650
650
  return str;
651
651
  };
652
652
 
653
- axis.utils.toPascalCase = function (str) {
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
- axis.utils.toCamelCase = function (str) {
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
- axis.utils.truncateString = function (str, maxLength) {
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
- axis.utils.truncateStringWithPostfix = function (str, maxLength, postfix) {
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
- axis.utils.isFunction = function (obj) {
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
- axis.utils.buildQueryString = function (
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 ABP.
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
- axis.utils.setCookieValue = function (
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 ABP.
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
- axis.utils.getCookieValue = function (key) {
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 ABP.
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
- axis.utils.deleteCookie = function (key, path) {
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
- axis.utils.getDomain = function (url) {
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 axis;
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.axis = factory(window.jQuery);
890
+ window.cartesian = factory(window.jQuery);
891
891
  }
892
892
  }
893
893
  );
894
894
 
895
- var axis = axis || {};
895
+ var cartesian = cartesian || {};
896
896
  (function () {
897
- axis.timing = axis.timing || {};
897
+ cartesian.timing = cartesian.timing || {};
898
898
 
899
- axis.timing.utcClockProvider = (function () {
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
- axis.timing.localClockProvider = (function () {
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
- axis.timing.unspecifiedClockProvider = (function () {
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
- axis.timing.convertToUserTimezone = function (date) {
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(axis.timing.timeZoneInfo.server.currentUtcOffsetInMilliseconds);
988
+ parseInt(cartesian.timing.timeZoneInfo.server.currentUtcOffsetInMilliseconds);
989
989
  return new Date(targetTime);
990
990
  };
991
991
  })();
992
992
 
993
- var axis = axis || {};
993
+ var cartesian = cartesian || {};
994
994
  (function () {
995
- axis.clock = axis.clock || {};
995
+ cartesian.clock = cartesian.clock || {};
996
996
 
997
- axis.clock.now = function () {
998
- if (axis.clock.provider) {
999
- return axis.clock.provider.now();
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
- axis.clock.normalize = function (date) {
1006
- if (axis.clock.provider) {
1007
- return axis.clock.provider.normalize(date);
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
- axis.clock.provider = axis.timing.unspecifiedClockProvider;
1013
+ cartesian.clock.provider = cartesian.timing.unspecifiedClockProvider;
1014
1014
  })();
1015
1015
 
1016
- var axis = axis || {};
1016
+ var cartesian = cartesian || {};
1017
1017
  (function () {
1018
- axis.security = axis.security || {};
1019
- axis.security.antiForgery = axis.security.antiForgery || {};
1018
+ cartesian.security = cartesian.security || {};
1019
+ cartesian.security.antiForgery = cartesian.security.antiForgery || {};
1020
1020
 
1021
- axis.security.antiForgery.tokenCookieName = "XSRF-TOKEN";
1022
- axis.security.antiForgery.tokenHeaderName = "X-XSRF-TOKEN";
1021
+ cartesian.security.antiForgery.tokenCookieName = "XSRF-TOKEN";
1022
+ cartesian.security.antiForgery.tokenHeaderName = "X-XSRF-TOKEN";
1023
1023
 
1024
- axis.security.antiForgery.getToken = function () {
1025
- return axis.utils.getCookieValue(axis.security.antiForgery.tokenCookieName);
1024
+ cartesian.security.antiForgery.getToken = function () {
1025
+ return cartesian.utils.getCookieValue(cartesian.security.antiForgery.tokenCookieName);
1026
1026
  };
1027
1027
 
1028
- axis.security.antiForgery.shouldSendToken = function (settings) {
1028
+ cartesian.security.antiForgery.shouldSendToken = function (settings) {
1029
1029
  if (settings.crossDomain === undefined || settings.crossDomain === null) {
1030
1030
  return (
1031
- axis.utils.getDomain(location.href) ===
1032
- axis.utils.getDomain(settings.url)
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 axis = axis || {};
1040
+ var cartesian = cartesian || {};
1041
1041
  (function () {
1042
1042
  // Current application root path (including virtual directory if exists).
1043
- axis.appPath = axis.appPath || "/";
1044
- axis.pageLoadTime = new Date();
1043
+ cartesian.appPath = cartesian.appPath || "/";
1044
+ cartesian.pageLoadTime = new Date();
1045
1045
 
1046
- // Converts given path to absolute path using axis.appPath variable.
1047
- axis.toAbsAppPath = function (path) {
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 axis.appPath + path;
1051
+ return cartesian.appPath + path;
1052
1052
  };
1053
1053
  })();
1054
1054
 
1055
- var axis = axis || {};
1055
+ var cartesian = cartesian || {};
1056
1056
  (function () {
1057
- axis.session = axis.session || {};
1057
+ cartesian.session = cartesian.session || {};
1058
1058
 
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
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
- axis.session.isHostAdmin = function () {
1066
- if (axis.session.hostId && axis.session.isAdmin) {
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
- axis.session.isTenantAdmin = function () {
1074
- if (axis.session.tenantId && axis.session.isAdmin) {
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
- axis.session.isUserLogged = function () {
1082
- if (axis.session.userId) {
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
- axis.session.isHostSide = function () {
1089
- if(axis.session.side === axis.tenancy.sides.HOST) {
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
- axis.session.isTenantSide = function () {
1097
- if(axis.session.side === axis.tenancy.sides.TENANT) {
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 axis = axis || {};
1106
+ var cartesian = cartesian || {};
1107
1107
  (function () {
1108
- // Implements Settings API that simplifies usage of setting scripts generated by Axis.
1109
- axis.setting = axis.setting || {};
1108
+ // Implements Settings API that simplifies usage of setting scripts generated by Cartesian.
1109
+ cartesian.setting = cartesian.setting || {};
1110
1110
 
1111
- axis.setting.values = axis.setting.values || {};
1111
+ cartesian.setting.values = cartesian.setting.values || {};
1112
1112
 
1113
- axis.setting.get = function (name) {
1114
- return axis.setting.values[name];
1113
+ cartesian.setting.get = function (name) {
1114
+ return cartesian.setting.values[name];
1115
1115
  };
1116
1116
 
1117
- axis.setting.getBoolean = function (name) {
1118
- var value = axis.setting.get(name);
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
- axis.setting.getInt = function (name) {
1123
- return parseInt(axis.setting.values[name]);
1122
+ cartesian.setting.getInt = function (name) {
1123
+ return parseInt(cartesian.setting.values[name]);
1124
1124
  };
1125
1125
  })();