mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-04-07 14:06:16 +08:00
Refactoring
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user