diff --git a/package.json b/package.json index 4372b69..22d7a59 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "dependencies": { "angular": "^1.7.9", "angular-router-browserify": "0.0.2", + "angular-vs-repeat": "2.0.13", "axios": "^0.19.2", "body-parser": "^1.19.0", "diskdb": "^0.1.17", diff --git a/web/app.js b/web/app.js index a81b421..bc4dfeb 100644 --- a/web/app.js +++ b/web/app.js @@ -3,8 +3,9 @@ require('angular-router-browserify')(angular) require('./ext/lazyload')(angular) require('./ext/dragdrop') require('./ext/angularjs-scroll-glue') +require('angular-vs-repeat'); -var app = angular.module('myApp', ['ngRoute', 'angularLazyImg', 'dndLists', 'luegg.directives']) +var app = angular.module('myApp', ['ngRoute', 'vs-repeat', 'angularLazyImg', 'dndLists', 'luegg.directives']) app.service('plex', require('./services/plex')) app.service('dizquetv', require('./services/dizquetv')) diff --git a/web/directives/channel-config.js b/web/directives/channel-config.js index a21fde0..3f045b0 100644 --- a/web/directives/channel-config.js +++ b/web/directives/channel-config.js @@ -113,6 +113,7 @@ module.exports = function ($timeout, $location, dizquetv) { setTimeout( () => { scope.channel.programs.splice(dropIndex + index, 0, program); updateChannelDuration() + scope.$apply(); }, 1); return true; } @@ -375,15 +376,16 @@ module.exports = function ($timeout, $location, dizquetv) { } let ems = Math.pow( Math.min(24*60*60*1000, program.duration), 0.7 ); - ems = ems / Math.pow(5*60*1000., 0.7); - ems = Math.max( 0.25 , ems); - let top = Math.max(0.0, (1.75 - ems) / 2.0) ; + ems = 1.3; + let top = 0.01; if (top == 0.0) { top = "1px"; } else { top = top + "em"; } + + return { 'width': '0.5em', 'height': ems + 'em', @@ -869,6 +871,7 @@ module.exports = function ($timeout, $location, dizquetv) { scope.hasFlex = false; for (let i = 0, l = scope.channel.programs.length; i < l; i++) { scope.channel.programs[i].start = new Date(scope.channel.startTime.valueOf() + scope.channel.duration) + scope.channel.programs[i].$index = i; scope.channel.duration += scope.channel.programs[i].duration scope.channel.programs[i].stop = new Date(scope.channel.startTime.valueOf() + scope.channel.duration) if (scope.channel.programs[i].isOffline) { @@ -906,6 +909,9 @@ module.exports = function ($timeout, $location, dizquetv) { scope.error.programs = "No programs have been selected. Select at least one program." else { channel.startTime.setMilliseconds( scope.millisecondsOffset); + for (let i = 0; i < scope.channel.programs.length; i++) { + delete scope.channel.programs[i].$index; + } scope.onDone(JSON.parse(angular.toJson(channel))) } $timeout(() => { scope.error = {} }, 3500) diff --git a/web/public/templates/channel-config.html b/web/public/templates/channel-config.html index 902bc13..7d177cd 100644 --- a/web/public/templates/channel-config.html +++ b/web/public/templates/channel-config.html @@ -340,22 +340,10 @@
-
-
Showing programs {{minProgramIndex+1}} to {{minProgramIndex+100}}
-
- -
-
- {{ dateForGuide(channel.startTime) }} -
- -
- ⋮ -
-
-
-
+
+ +
@@ -371,20 +359,12 @@ Redirect to channel: {{x.channel}}
-
-
-
- {{ dateForGuide(channel.programs[minProgramIndex + 100 - 1].stop)}} -
- -
- ⋮ -
-
+
{{ dateForGuide(channel.programs[channel.programs.length-1].stop)}}