Refactoring

This commit is contained in:
OVSharova
2021-09-16 01:35:51 +03:00
parent cb4e35774c
commit bef78882d0
12 changed files with 152 additions and 456 deletions

View File

@ -37,13 +37,6 @@
common.utils = new(function(){
return {
openLink: function(url) {
if (url) {
var newDocumentPage = window.open(url, '_blank');
if (newDocumentPage)
newDocumentPage.focus();
}
},
htmlEncode: function(value) {
return $('<div/>').text(value).html();
},
@ -56,22 +49,6 @@
_user.group && (_user.fullname = (_user.group).toString() + AscCommon.UserInfoParser.getSeparator() + _user.fullname);
_user.guest = !_user.name;
return _user;
},
fixedDigits: function(num, digits, fill) {
(fill===undefined) && (fill = '0');
var strfill = "",
str = num.toString();
for (var i=str.length; i<digits; i++) strfill += fill;
return strfill + str;
},
getKeyByValue: function(obj, value) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop)) {
if(obj[prop] === value)
return prop;
}
}
}
};
})();