mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
minor cleanup
This commit is contained in:
parent
376b386b31
commit
4ff068db0a
12 changed files with 63 additions and 28 deletions
|
@ -44,8 +44,8 @@ define(
|
|||
|
||||
onRender: function () {
|
||||
|
||||
var defaultQuality = Config.GetValue(Config.Keys.DefaultQualityProfileId);
|
||||
var defaultRoot = Config.GetValue(Config.Keys.DefaultRootFolderId);
|
||||
var defaultQuality = Config.getValue(Config.Keys.DefaultQualityProfileId);
|
||||
var defaultRoot = Config.getValue(Config.Keys.DefaultRootFolderId);
|
||||
|
||||
if (QualityProfiles.get(defaultQuality)) {
|
||||
this.ui.qualityProfile.val(defaultQuality);
|
||||
|
@ -84,7 +84,7 @@ define(
|
|||
},
|
||||
|
||||
_qualityProfileChanged: function () {
|
||||
Config.SetValue(Config.Keys.DefaultQualityProfileId, this.ui.qualityProfile.val());
|
||||
Config.setValue(Config.Keys.DefaultQualityProfileId, this.ui.qualityProfile.val());
|
||||
},
|
||||
|
||||
_rootFolderChanged: function () {
|
||||
|
@ -93,7 +93,7 @@ define(
|
|||
App.modalRegion.show(this.rootFolderLayout);
|
||||
}
|
||||
else {
|
||||
Config.SetValue(Config.Keys.DefaultRootFolderId, rootFolderValue);
|
||||
Config.setValue(Config.Keys.DefaultRootFolderId, rootFolderValue);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ define(
|
|||
|
||||
render: function () {
|
||||
var size = this.model.get(this.column.get('name'));
|
||||
this.$el.html(FormatHelpers.Bytes(size));
|
||||
this.$el.html(FormatHelpers.bytes(size));
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ define(
|
|||
var date = this.model.get(this.column.get('name'));
|
||||
|
||||
if (date) {
|
||||
this.$el.html("<span title='" + Moment(date).format('LLLL') + "' >" + FormatHelpers.DateHelper(date) + "</span");
|
||||
this.$el.html("<span title='" + Moment(date).format('LLLL') + "' >" + FormatHelpers.dateHelper(date) + "</span");
|
||||
}
|
||||
|
||||
return this;
|
||||
|
|
|
@ -12,7 +12,7 @@ define(
|
|||
DefaultRootFolderId: 'DefaultRootFolderId'
|
||||
},
|
||||
|
||||
GetValue: function (key, defaultValue) {
|
||||
getValue: function (key, defaultValue) {
|
||||
|
||||
var storeValue = localStorage.getItem(key);
|
||||
|
||||
|
@ -23,11 +23,11 @@ define(
|
|||
return storeValue.toString();
|
||||
},
|
||||
|
||||
SetValue: function (key, value) {
|
||||
setValue: function (key, value) {
|
||||
|
||||
console.log('Config: [{0}] => [{1}] '.format(key, value));
|
||||
|
||||
if (this.GetValue(key) === value.toString()) {
|
||||
if (this.getValue(key) === value.toString()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ define(
|
|||
}
|
||||
|
||||
var date = Moment(input);
|
||||
var result = '<span title="' + date.format('LLLL') + '">' + FormatHelpers.DateHelper(input) + '</span>';
|
||||
var result = '<span title="' + date.format('LLLL') + '">' + FormatHelpers.dateHelper(input) + '</span>';
|
||||
|
||||
return new Handlebars.SafeString(result);
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@ define(
|
|||
'Shared/FormatHelpers'
|
||||
], function (Handlebars, FormatHelpers) {
|
||||
Handlebars.registerHelper('Bytes', function (size) {
|
||||
return new Handlebars.SafeString(FormatHelpers.Bytes(size));
|
||||
return new Handlebars.SafeString(FormatHelpers.bytes(size));
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('Pad2', function (input) {
|
||||
|
@ -13,7 +13,7 @@ define(
|
|||
});
|
||||
|
||||
Handlebars.registerHelper('Number', function (input) {
|
||||
return FormatHelpers.Number(input);
|
||||
return FormatHelpers.number(input);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -19,11 +19,11 @@ define(
|
|||
|
||||
itemViewOptions: function () {
|
||||
return {
|
||||
episodeCollection: this.episodeCollection,
|
||||
episodeCollection: this.episodeCollection
|
||||
};
|
||||
},
|
||||
|
||||
appendHtml: function(collectionView, itemView, index){
|
||||
appendHtml: function(collectionView, itemView){
|
||||
var childrenContainer = $(collectionView.childrenContainer || collectionView.el);
|
||||
childrenContainer.prepend(itemView.el);
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ define(
|
|||
|
||||
return {
|
||||
|
||||
Bytes: function (sourceSize) {
|
||||
bytes: function (sourceSize) {
|
||||
var size = Number(sourceSize);
|
||||
return Filesize(size, 1, false);
|
||||
},
|
||||
|
||||
DateHelper: function (sourceDate) {
|
||||
dateHelper: function (sourceDate) {
|
||||
if (!sourceDate) {
|
||||
return '';
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ define(
|
|||
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
||||
},
|
||||
|
||||
Number: function (input) {
|
||||
number: function (input) {
|
||||
if (!input) {
|
||||
return '';
|
||||
}
|
||||
|
|
|
@ -6,17 +6,27 @@ define(
|
|||
|
||||
return {
|
||||
|
||||
startsWith: function(str, starts){
|
||||
if (starts === '') return true;
|
||||
if (str == null || starts == null) return false;
|
||||
str = String(str); starts = String(starts);
|
||||
startsWith: function (str, starts) {
|
||||
if (starts === '') {
|
||||
return true;
|
||||
}
|
||||
if (str == null || starts == null) {
|
||||
return false;
|
||||
}
|
||||
str = String(str);
|
||||
starts = String(starts);
|
||||
return str.length >= starts.length && str.slice(0, starts.length) === starts;
|
||||
},
|
||||
|
||||
endsWith: function(str, ends){
|
||||
if (ends === '') return true;
|
||||
if (str == null || ends == null) return false;
|
||||
str = String(str); ends = String(ends);
|
||||
endsWith: function (str, ends) {
|
||||
if (ends === '') {
|
||||
return true;
|
||||
}
|
||||
if (str == null || ends == null) {
|
||||
return false;
|
||||
}
|
||||
str = String(str);
|
||||
ends = String(ends);
|
||||
return str.length >= ends.length && str.slice(str.length - ends.length) === ends;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ define(
|
|||
},
|
||||
|
||||
setActive: function () {
|
||||
var storedKey = Config.GetValue(this.menu.menuKey, this.menu.defaultAction);
|
||||
var storedKey = Config.getValue(this.menu.menuKey, this.menu.defaultAction);
|
||||
|
||||
this.collection.each(function (model) {
|
||||
if (model.get('key').toLocaleLowerCase() === storedKey.toLowerCase()) {
|
||||
|
|
|
@ -37,7 +37,7 @@ define(
|
|||
|
||||
onClick: function () {
|
||||
|
||||
Config.SetValue(this.model.get('menuKey'), this.model.get('key'));
|
||||
Config.setValue(this.model.get('menuKey'), this.model.get('key'));
|
||||
this.invokeCallback();
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue