_.defaults(allOptions, defaultOptions);
var _build = function (text, vars) {
- var vars = vars || [];
+ vars = vars || [];
return text.replace(/{([^{}]*)}/g,
function (a, b) {
var r = (vars[b]);
$.each(files, function(idx, entry) {
entry.icon = OC.MimeType.getIconUrl(entry.mimetype);
+ var simpleSize, sizeColor;
if (typeof(entry.size) !== 'undefined' && entry.size >= 0) {
- var simpleSize = humanFileSize(parseInt(entry.size, 10), true);
- var sizeColor = Math.round(160 - Math.pow((entry.size / (1024 * 1024)), 2));
+ simpleSize = humanFileSize(parseInt(entry.size, 10), true);
+ sizeColor = Math.round(160 - Math.pow((entry.size / (1024 * 1024)), 2));
} else {
simpleSize = t('files', 'Pending');
+ sizeColor = 80;
}
var $row = self.$listTmpl.octemplate({
type: entry.type,
};
$.fn.octemplate = function(vars, options) {
- var vars = vars ? vars : {};
+ vars = vars || {};
if(this.length) {
var _template = Object.create(Template);
return _template.init(vars, options, this);