From 3583f2b32f6b6e494c50b57d027cbe48cb5d18dc Mon Sep 17 00:00:00 2001 From: halwan-bot Date: Thu, 2 Sep 2021 22:07:13 +0300 Subject: [PATCH] Enhancements --- .../controllers/content.home.controller.js | 2 +- .../controllers/content.media.controller.js | 2 +- control/content/index.html | 2 +- .../controllers/design.home.controller.js | 4 ++-- .../controllers/settings.home.controller.js | 4 ++-- control/settings/templates/home.html | 2 +- widget/assets/css/media.css | 6 ++++++ widget/assets/css/widget.app.css | 11 ++++++++++- widget/controllers/widget.home.controller.js | 18 ++++++++++-------- widget/controllers/widget.media.controller.js | 14 ++++++++------ .../widget.nowplaying.controller.js | 7 +++---- widget/templates/layouts/item-1.html | 2 +- widget/templates/layouts/list-1.html | 2 +- widget/templates/layouts/list-2.html | 4 ++-- widget/templates/layouts/list-3.html | 6 ++++-- widget/templates/layouts/list-4.html | 2 +- 16 files changed, 54 insertions(+), 34 deletions(-) diff --git a/control/content/controllers/content.home.controller.js b/control/content/controllers/content.home.controller.js index 219562e..022e4ed 100644 --- a/control/content/controllers/content.home.controller.js +++ b/control/content/controllers/content.home.controller.js @@ -30,7 +30,7 @@ listLayout: "list-1", itemLayout: "item-1", backgroundImage: "", - skipMediaPage: false + skipMediaPage: true } } }; diff --git a/control/content/controllers/content.media.controller.js b/control/content/controllers/content.media.controller.js index faa1401..eca7e3e 100644 --- a/control/content/controllers/content.media.controller.js +++ b/control/content/controllers/content.media.controller.js @@ -47,7 +47,7 @@ listLayout: "list-1", itemLayout: "item-1", backgroundImage: "", - skipMediaPage: false + skipMediaPage: true } }); } diff --git a/control/content/index.html b/control/content/index.html index 713440d..4181aa5 100644 --- a/control/content/index.html +++ b/control/content/index.html @@ -46,7 +46,7 @@ - +
diff --git a/control/design/controllers/design.home.controller.js b/control/design/controllers/design.home.controller.js index 46a527c..9344458 100644 --- a/control/design/controllers/design.home.controller.js +++ b/control/design/controllers/design.home.controller.js @@ -22,7 +22,7 @@ listLayout: "list-1", itemLayout: "item-1", backgroundImage: "", - skipMediaPage: false + skipMediaPage: true } } }; @@ -38,7 +38,7 @@ background.loadbackground(DesignHome.mediaInfo.data.design.backgroundImage); } if(!DesignHome.mediaInfo.data.design.skipMediaPage) - DesignHome.mediaInfo.data.design.skipMediaPage=false; + DesignHome.mediaInfo.data.design.skipMediaPage = true; /*Buildfire DB Service*/ DesignHome._mediaCenter = new DB(COLLECTIONS.MediaCenter); diff --git a/control/settings/controllers/settings.home.controller.js b/control/settings/controllers/settings.home.controller.js index 51001ef..d8888b1 100644 --- a/control/settings/controllers/settings.home.controller.js +++ b/control/settings/controllers/settings.home.controller.js @@ -24,10 +24,10 @@ }); GlobalPlayListSettings.get().then(result => { - if (result && result.data && typeof result.data.globalPlaylistLimit !== 'undefined') { + if (result && result.data) { $scope.inputs.globalPlaylistLimit = result.data.globalPlaylistLimit; } else { - $scope.inputs.globalPlaylistLimit = 0; + $scope.inputs.globalPlaylistLimit = undefined; }; }) diff --git a/control/settings/templates/home.html b/control/settings/templates/home.html index 507c42d..b9fd9ae 100644 --- a/control/settings/templates/home.html +++ b/control/settings/templates/home.html @@ -57,7 +57,7 @@ Global Playlist Limit - Limit how many items a user can add to the global playlist, 0 = unlimited + Limit how many items a user can add to the global playlist, empty means no limit.

diff --git a/widget/assets/css/media.css b/widget/assets/css/media.css index 7643381..a0333f4 100644 --- a/widget/assets/css/media.css +++ b/widget/assets/css/media.css @@ -24,6 +24,12 @@ h5{ padding: 1rem 0; padding-top: 0; } + +#listLayout2::after, +#listLayout2::before { + border-top: none !important ; +} + .list-item{ cursor: pointer; } diff --git a/widget/assets/css/widget.app.css b/widget/assets/css/widget.app.css index 0e01d4c..1c7648a 100644 --- a/widget/assets/css/widget.app.css +++ b/widget/assets/css/widget.app.css @@ -993,7 +993,16 @@ input[type=range]::-ms-track { background-repeat: no-repeat; background-position: center; height: 80vh; - } +} + +.list-layout-1 #emptyContainer, +.list-layout-4 #emptyContainer { + height: 80vh; +} +.list-layout-2 #emptyContainer, +.list-layout-3 #emptyContainer { + height: 85vh; +} .list-layout .layout-1 .col-xs-6:nth-child(odd) { clear: both !important; diff --git a/widget/controllers/widget.home.controller.js b/widget/controllers/widget.home.controller.js index 83d991f..cf47f8e 100644 --- a/widget/controllers/widget.home.controller.js +++ b/widget/controllers/widget.home.controller.js @@ -8,6 +8,7 @@ var WidgetHome = this; WidgetHome.deepLink = false; $rootScope.loadingData = true; + $rootScope.autoPlay = true; const isLauncher = window.location.href.includes('launcherPlugin'); const slideElement = document.querySelector(".slide"); @@ -79,8 +80,8 @@ $rootScope.forceAutoPlay = false; // MediaCenterInfo.data.content.forceAutoPlay; $rootScope.skipMediaPage = MediaCenterInfo.data.design.skipMediaPage - $rootScope.autoPlay = MediaCenterInfo.data.content.autoPlay; - $rootScope.autoPlayDelay = MediaCenterInfo.data.content.autoPlayDelay; + $rootScope.autoPlay = typeof MediaCenterInfo.data.content.autoPlay !== 'undefined' ? MediaCenterInfo.data.content.autoPlay : true; + $rootScope.autoPlayDelay = typeof MediaCenterInfo.data.content.autoPlayDelay !== 'undefined' ? MediaCenterInfo.data.content.autoPlayDelay : { label: "Off", value: 0 }; }, function fail() { MediaCenterInfo = _infoData; @@ -196,8 +197,8 @@ $rootScope.forceAutoPlay = false; // WidgetHome.media.data.content.forceAutoPlay $rootScope.skipMediaPage = WidgetHome.media.data.design.skipMediaPage; - $rootScope.autoPlay = WidgetHome.media.data.content.autoPlay; - $rootScope.autoPlayDelay = WidgetHome.media.data.content.autoPlayDelay; + $rootScope.autoPlay = typeof MediaCenterInfo.data.content.autoPlay !== 'undefined' ? MediaCenterInfo.data.content.autoPlay : true; + $rootScope.autoPlayDelay = typeof WidgetHome.media.data.content.autoPlayDelay !== 'undefined' ? WidgetHome.media.data.content.autoPlayDelay : { label: "Off", value: 0 }; if (view && event.data.content && event.data.content.images) { view.loadItems(event.data.content.images); @@ -243,7 +244,7 @@ const globalPlaylistTag = 'MediaContent' + ($rootScope.user && $rootScope.user._id ? $rootScope.user._id : Buildfire.context.deviceId ? Buildfire.context.deviceId : 'globalPlaylist'); if (event) { if (event.tag === "GlobalPlayListSettings") { - if (event.data && typeof event.data.globalPlaylistLimit !== 'undefined') { + if (event.data) { $rootScope.globalPlaylistLimit = event.data.globalPlaylistLimit; } } else if (event.tag === globalPlaylistTag) { @@ -315,7 +316,7 @@ $event.stopImmediatePropagation(); let itemPage = false; - if (!index) { + if (!index && index !== 0) { itemPage = true; for (let i = 0; i < WidgetHome.items.length; i++) { if (WidgetHome.items[i].id === item.id) { @@ -328,6 +329,7 @@ GlobalPlaylist.delete(item.id).then(() => { delete $rootScope.globalPlaylistItems.playlist[item.id]; WidgetHome.items.splice(index, 1); + if (!$scope.$$phase && !$scope.$root.$$phase) $scope.$apply(); buildfire.dialog.toast({ message: `Item removed from playlist`, type: 'success', @@ -434,10 +436,10 @@ const getGlobalPlaylistLimit = () => { GlobalPlaylist.getGlobalPlaylistLimit().then((result) => { - if (result && result.data && typeof result.data.globalPlaylistLimit !== 'undefined') { + if (result && result.data) { $rootScope.globalPlaylistLimit = result.data.globalPlaylistLimit; } else { - $rootScope.globalPlaylistLimit = 0; + $rootScope.globalPlaylistLimit = undefined; }; }); }; diff --git a/widget/controllers/widget.media.controller.js b/widget/controllers/widget.media.controller.js index 04f85a2..89954fc 100644 --- a/widget/controllers/widget.media.controller.js +++ b/widget/controllers/widget.media.controller.js @@ -99,6 +99,7 @@ if (state === 'play') { // The video started playing // Make sure the audio is turned off Buildfire.services.media.audioPlayer.pause(); + $scope.videoPlayed = true; } }; @@ -131,6 +132,8 @@ myType=videoUrlToSend.split('.').pop(); } + $scope.videoPlayed = false; + WidgetMedia.videoPlayerConfig.sources = [{ src: $sce.trustAsResourceUrl(videoUrlToSend), type: 'video/' + myType //"video/mp4" @@ -270,7 +273,6 @@ } break; case COLLECTIONS.MediaCenter: - buildfire.spinner.show(); var old = WidgetMedia.media.data.design.itemLayout; WidgetMedia.media = event; $rootScope.backgroundImage = WidgetMedia.media.data.design.backgroundImage; @@ -279,9 +281,9 @@ $rootScope.forceAutoPlay = false; // WidgetMedia.media.data.content.forceAutoPlay; // $rootScope.skipMediaPage = WidgetMedia.media.data.design.skipMediaPage; - $rootScope.autoPlay = WidgetMedia.media.data.content.autoPlay; - $rootScope.autoPlayDelay = WidgetMedia.media.data.content.autoPlayDelay; - + $rootScope.autoPlay = typeof WidgetMedia.media.data.content.autoPlay !== 'undefined' ? WidgetMedia.media.data.content.autoPlay : true; + $rootScope.autoPlayDelay = typeof WidgetMedia.media.data.content.autoPlayDelay !== 'undefined' ? WidgetMedia.media.data.content.autoPlayDelay : { label: "Off", value: 0 }; + // Update Data in media contoller $rootScope.refreshItems(); @@ -301,7 +303,7 @@ const globalPlaylistTag = 'MediaContent' + ($rootScope.user && $rootScope.user._id ? $rootScope.user._id : Buildfire.context.deviceId ? Buildfire.context.deviceId : 'globalPlaylist'); if (event) { if (event.tag === "GlobalPlayListSettings") { - if (event.data && typeof event.data.globalPlaylistLimit !== 'undefined') { + if (event.data) { $rootScope.globalPlaylistLimit = event.data.globalPlaylistLimit; } } else if (event.tag === globalPlaylistTag) { @@ -345,9 +347,9 @@ $rootScope.playNextItem(); } - // let interval; WidgetMedia.toggleShowVideo = function (forceShow) { WidgetMedia.showVideo = forceShow ? true : !WidgetMedia.showVideo; + if (!$scope.$$phase && !$scope.$root.$$phase) $scope.$apply(); }; diff --git a/widget/controllers/widget.nowplaying.controller.js b/widget/controllers/widget.nowplaying.controller.js index 80afd41..835dd71 100644 --- a/widget/controllers/widget.nowplaying.controller.js +++ b/widget/controllers/widget.nowplaying.controller.js @@ -651,7 +651,6 @@ break; case COLLECTIONS.MediaCenter: if (event.data) { - buildfire.spinner.show(); $rootScope.design = event.data.design; // $rootScope.allowShare = event.data.content.allowShare; // $rootScope.allowSource = event.data.content.allowSource; @@ -661,8 +660,8 @@ NowPlaying.transferPlaylist = false; // event.data.content.forceAutoPlay; $rootScope.skipMediaPage = event.data.design.skipMediaPage; - $rootScope.autoPlay = event.data.content.autoPlay; - $rootScope.autoPlayDelay = event.data.content.autoPlayDelay; + $rootScope.autoPlay = typeof event.data.content.autoPlay !== 'undefined' ? event.data.content.autoPlay : true + $rootScope.autoPlayDelay = typeof event.data.content.autoPlayDelay !== 'undefined' ? event.data.content.autoPlayDelay : { label: "Off", value: 0 }; $rootScope.globalPlaylist = event.data.content.globalPlaylist; // Update Data in media contoller @@ -680,7 +679,7 @@ const globalPlaylistTag = 'MediaContent' + ($rootScope.user && $rootScope.user._id ? $rootScope.user._id : Buildfire.context.deviceId ? Buildfire.context.deviceId : 'globalPlaylist'); if (event) { if (event.tag === "GlobalPlayListSettings") { - if (event.data && typeof event.data.globalPlaylistLimit !== 'undefined') { + if (event.data) { $rootScope.globalPlaylistLimit = event.data.globalPlaylistLimit; } } else if (event.tag === globalPlaylistTag) { diff --git a/widget/templates/layouts/item-1.html b/widget/templates/layouts/item-1.html index 0c8d851..d084692 100644 --- a/widget/templates/layouts/item-1.html +++ b/widget/templates/layouts/item-1.html @@ -10,7 +10,7 @@ load-image="16x9" style="max-height: {{(WidgetMedia.deviceWidth*9)/16+'px'}} !important;" crop-width="1280" crop-height="720" crop-type="crop" data-final-src="{{WidgetMedia.item.data.topImage}}" /> - +
diff --git a/widget/templates/layouts/list-1.html b/widget/templates/layouts/list-1.html index 209aa56..1337679 100644 --- a/widget/templates/layouts/list-1.html +++ b/widget/templates/layouts/list-1.html @@ -1,4 +1,4 @@ -
+
diff --git a/widget/templates/layouts/list-2.html b/widget/templates/layouts/list-2.html index 6c2a4c4..9a9db74 100644 --- a/widget/templates/layouts/list-2.html +++ b/widget/templates/layouts/list-2.html @@ -1,4 +1,4 @@ -
+
@@ -9,7 +9,7 @@
-
+
@@ -32,7 +32,9 @@
-

{{item.data.summary}}

+
+

{{item.data.summary}}

+
{{item.data.mediaDate | jsDate | date:"MMMM dd, yyyy"}}
diff --git a/widget/templates/layouts/list-4.html b/widget/templates/layouts/list-4.html index 4fd98a9..c8d102b 100644 --- a/widget/templates/layouts/list-4.html +++ b/widget/templates/layouts/list-4.html @@ -1,4 +1,4 @@ -
+