summaryrefslogtreecommitdiff
path: root/smarttv-client/Javascript/Data.js
diff options
context:
space:
mode:
authorthlo <t.lohmar@gmx.de>2013-07-24 20:32:03 +0200
committerthlo <t.lohmar@gmx.de>2013-07-24 20:32:03 +0200
commit66d5e7f95f2f1c3c51bd73f86466a8bd2f16fbc7 (patch)
tree3e8d88ad1c84e9f537d1fa8853ddd00f200760d0 /smarttv-client/Javascript/Data.js
parentc47e5227a1d1f47f74c67bc6b2d70b5f57e34339 (diff)
downloadvdr-plugin-smarttvweb-66d5e7f95f2f1c3c51bd73f86466a8bd2f16fbc7.tar.gz
vdr-plugin-smarttvweb-66d5e7f95f2f1c3c51bd73f86466a8bd2f16fbc7.tar.bz2
Widget updates:
- Multi-Server Support - Number key personalization for recordings - Timezone fix - Fix in YouTube Handling - Fix in Helpbar - Other misc fixes
Diffstat (limited to 'smarttv-client/Javascript/Data.js')
-rwxr-xr-xsmarttv-client/Javascript/Data.js35
1 files changed, 15 insertions, 20 deletions
diff --git a/smarttv-client/Javascript/Data.js b/smarttv-client/Javascript/Data.js
index 5eee3f2..d2673fe 100755
--- a/smarttv-client/Javascript/Data.js
+++ b/smarttv-client/Javascript/Data.js
@@ -4,7 +4,8 @@ var Data =
folderList : [],
createAccessMap : false,
directAccessMap : {},
- sortType : 0
+ sortType : 0,
+ maxSort : 3
};
Array.prototype.remove = function(from, to) {
@@ -18,7 +19,7 @@ Data.reset = function() {
this.assets = new Item;
this.folderList = [];
this.createAccessMap = false;
- this.sortType = 0;
+ this.sortType = Config.sortType;
// this.folderList.push({item : this.assets, id: 0});
Main.log("Data.reset: folderList.push. this.folderList.length= " + this.folderList.length);
};
@@ -38,7 +39,7 @@ Data.completed= function(sort) {
};
Data.nextSortType = function () {
- Data.sortType = (Data.sortType +1) %3;
+ Data.sortType = (Data.sortType +1) % Data.maxSort;
this.assets.sortPayload(Data.sortType);
};
@@ -252,23 +253,6 @@ Item.prototype.print = function(level) {
}
};
-/*
-Item.prototype.sortPayload = function() {
- for (var i = 0; i < this.childs.length; i++) {
- if (this.childs[i].isFolder == true) {
- this.childs[i].sortPayload();
- }
- }
- this.childs.sort(function(a,b) {
- if (a.title == b.title) {
- return (b.payload.start - a.payload.start);
- }
- else {
- return ((a.title < b.title) ? -1 : 1);
- }
- });
-};
-*/
Item.prototype.sortPayload = function(sel) {
for (var i = 0; i < this.childs.length; i++) {
if (this.childs[i].isFolder == true) {
@@ -299,6 +283,17 @@ Item.prototype.sortPayload = function(sel) {
}
});
break;
+ case 3:
+ this.childs.sort(function(a,b) {
+ if (a.title == b.title) {
+ return (b.payload.start -a.payload.start);
+ }
+ else {
+ return ((a.title < b.title) ? -1 : 1);
+
+ }
+ });
+ break;
case 0:
default:
this.childs.sort(function(a,b) {