@osovitny/anatoly 2.1.11 → 2.1.13

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.
@@ -704,6 +704,20 @@
704
704
  text: enumeration[key]
705
705
  }); });
706
706
  };
707
+ Convert.stringToArray = function (str, separator) {
708
+ if (separator === void 0) { separator = ','; }
709
+ if (str) {
710
+ return str.split(separator).filter(function (element) { return element; });
711
+ }
712
+ return [];
713
+ };
714
+ Convert.stringToIntArray = function (str, separator) {
715
+ if (separator === void 0) { separator = ','; }
716
+ if (str) {
717
+ return str.split(separator).filter(function (element) { return element; }).map(function (value) { return parseInt(value); });
718
+ }
719
+ return [];
720
+ };
707
721
  return Convert;
708
722
  }());
709
723
 
@@ -1650,8 +1664,15 @@
1650
1664
  _this.baseUrl = '/api/appContext';
1651
1665
  return _this;
1652
1666
  }
1667
+ //Session
1668
+ AppContextService.prototype.getCurrentFromSession = function () {
1669
+ return this.sessionStorage.getObject(this.storageKeyName);
1670
+ };
1671
+ AppContextService.prototype.setCurrentFromSession = function (value) {
1672
+ this.sessionStorage.setObject(this.storageKeyName, value);
1673
+ };
1653
1674
  AppContextService.prototype.updateCurrentIfExpired = function () {
1654
- var context = this.sessionStorage.getObject(this.storageKeyName);
1675
+ var context = this.getCurrentFromSession();
1655
1676
  if (!context) {
1656
1677
  return;
1657
1678
  }
@@ -1681,10 +1702,10 @@
1681
1702
  var _this = this;
1682
1703
  if (success === void 0) { success = null; }
1683
1704
  if (getCachedIfExist === void 0) { getCachedIfExist = true; }
1684
- var current = this.current;
1685
- if (getCachedIfExist && current != null) {
1705
+ var context = this.getCurrentFromSession();
1706
+ if (getCachedIfExist && context != null) {
1686
1707
  if (success) {
1687
- success(current);
1708
+ success(context);
1688
1709
  }
1689
1710
  return;
1690
1711
  }
@@ -1719,10 +1740,10 @@
1719
1740
  //current
1720
1741
  get: function () {
1721
1742
  this.updateCurrentIfExpired();
1722
- return this.sessionStorage.getObject(this.storageKeyName);
1743
+ return this.getCurrentFromSession();
1723
1744
  },
1724
1745
  set: function (value) {
1725
- this.sessionStorage.setObject(this.storageKeyName, value);
1746
+ this.setCurrentFromSession(value);
1726
1747
  },
1727
1748
  enumerable: false,
1728
1749
  configurable: true
@@ -2827,7 +2848,7 @@
2827
2848
  Upload:
2828
2849
  https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
2829
2850
  */
2830
- imageUploadURL: "/api/HtmlEditor/UploadImage",
2851
+ imageUploadURL: "/api/htmlEditor/uploadImage",
2831
2852
  imageAllowedTypes: ["jpeg", "jpg", "png"],
2832
2853
  imageUploadParams: { uploadType: "", uploadParentId: "" },
2833
2854
  };