diff options
author | thlo <smarttv640@gmail.com> | 2013-07-24 20:32:03 +0200 |
---|---|---|
committer | thlo <t.lohmar@gmx.de> | 2013-07-24 20:32:03 +0200 |
commit | 0ecc9a2ca4c3604ef2590fef5b3072417689a7d3 (patch) | |
tree | 3e8d88ad1c84e9f537d1fa8853ddd00f200760d0 /smarttv-client/Javascript/Data.js | |
parent | d8688559455cc3cd86f41e816568d099f07f3800 (diff) | |
download | vdr-plugin-smarttvweb-0ecc9a2ca4c3604ef2590fef5b3072417689a7d3.tar.gz vdr-plugin-smarttvweb-0ecc9a2ca4c3604ef2590fef5b3072417689a7d3.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-x | smarttv-client/Javascript/Data.js | 35 |
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) {
|