Skip to content

Commit

Permalink
Enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
halwan-bot committed Sep 2, 2021
1 parent 43be5c4 commit 3583f2b
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 34 deletions.
2 changes: 1 addition & 1 deletion control/content/controllers/content.home.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
listLayout: "list-1",
itemLayout: "item-1",
backgroundImage: "",
skipMediaPage: false
skipMediaPage: true
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion control/content/controllers/content.media.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
listLayout: "list-1",
itemLayout: "item-1",
backgroundImage: "",
skipMediaPage: false
skipMediaPage: true
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion control/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<!-- <link href="assets/css/control.content.css" rel="stylesheet"> -->
<link rel="stylesheet" href="../content/assets/css/reset.css">
<link rel="stylesheet" href="../content/assets/css/bf_base.css">
<link rel="stylesheet" href="../content/assets/css/sortable.css">
<!-- <link rel="stylesheet" href="../content/assets/css/sortable.css"> -->
</head>
<body style="overflow:auto; overflow:initial;">
<div class="main_view">
Expand Down
4 changes: 2 additions & 2 deletions control/design/controllers/design.home.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
listLayout: "list-1",
itemLayout: "item-1",
backgroundImage: "",
skipMediaPage: false
skipMediaPage: true
}
}
};
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions control/settings/controllers/settings.home.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
})

Expand Down
2 changes: 1 addition & 1 deletion control/settings/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
Global Playlist Limit
<span class="customTooltipBox btn-primary">
<span class="customTooltipText">
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.
</span>
</span>
</p>
Expand Down
6 changes: 6 additions & 0 deletions widget/assets/css/media.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ h5{
padding: 1rem 0;
padding-top: 0;
}

#listLayout2::after,
#listLayout2::before {
border-top: none !important ;
}

.list-item{
cursor: pointer;
}
Expand Down
11 changes: 10 additions & 1 deletion widget/assets/css/widget.app.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 10 additions & 8 deletions widget/controllers/widget.home.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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',
Expand Down Expand Up @@ -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;
};
});
};
Expand Down
14 changes: 8 additions & 6 deletions widget/controllers/widget.media.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};

Expand Down Expand Up @@ -131,6 +132,8 @@
myType=videoUrlToSend.split('.').pop();
}

$scope.videoPlayed = false;

WidgetMedia.videoPlayerConfig.sources = [{
src: $sce.trustAsResourceUrl(videoUrlToSend),
type: 'video/' + myType //"video/mp4"
Expand Down Expand Up @@ -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;
Expand All @@ -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();

Expand All @@ -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) {
Expand Down Expand Up @@ -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();
};

Expand Down
7 changes: 3 additions & 4 deletions widget/controllers/widget.nowplaying.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion widget/templates/layouts/item-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -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}}" />
<img ng-if="!WidgetMedia.item.data.topImage" src="../../../styles/media/holder-16x9.png" style="width:100%;">
<img ng-if="!WidgetMedia.item.data.topImage && !WidgetMedia.showVideo" src="../../../styles/media/holder-16x9.png" style="width:100%;">
<div id="myVideo" ng-include="'templates/layouts/video-player.html'"></div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion widget/templates/layouts/list-1.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="holder padding-zero">
<div class="holder padding-zero list-layout-1">
<div class="media-center-plugin layout1 text-overlay">
<div class="plugin-banner clearfix">
<div ng-style="WidgetHome.data.content.images.length > 0 ? {'min-height': (9 * deviceWidth / 16) + 'px' } : {}" id="carousel" build-fire-carousel=""></div>
Expand Down
4 changes: 2 additions & 2 deletions widget/templates/layouts/list-2.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="holder padding-zero pb15">
<div class="holder padding-zero pb15 list-layout-2">
<div class="media-center-plugin layout3 text-overlay">
<div class="media-center-banner clearfix">
<div ng-style="WidgetHome.data.content.images.length > 0 ? {'min-height': (9 * deviceWidth / 16) + 'px' } : {}" id="carousel" build-fire-carousel=""></div>
Expand All @@ -9,7 +9,7 @@
</div>

<div id="emptyContainer" class="padded" ng-if="!loadingData && (!WidgetHome.items || (WidgetHome.items && WidgetHome.items.length === 0))"></div>
<div class="list-layout"
<div class="list-layout" id="listLayout2"
infinite-scroll="WidgetHome.loadMore()"
infinite-scroll-distance="1"
data-infinite-container=".infinite-scroll-parent"
Expand Down
6 changes: 4 additions & 2 deletions widget/templates/layouts/list-3.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="holder padding-zero pb15">
<div class="holder padding-zero pb15 list-layout-3">
<div class="media-center-plugin layout3 list-3 text-overlay">
<div class="plugin-banner clearfix text-overlay">
<div ng-style="WidgetHome.data.content.images.length > 0 ? {'min-height': (9 * deviceWidth / 16) + 'px' } : {}" id="carousel" build-fire-carousel=""></div>
Expand Down Expand Up @@ -32,7 +32,9 @@
</div>
</div>
</div>
<p class="margin-bottom-zero" style="font-size:13px;">{{item.data.summary}}</p>
<div class="summary">
<p class="margin-bottom-zero">{{item.data.summary}}</p>
</div>
<span class="list-item-date" data-ng-if="item.data.mediaDate" style="font-size:11px; font-style:italic; margin-top:-4px;">{{item.data.mediaDate | jsDate | date:"MMMM dd, yyyy"}}</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion widget/templates/layouts/list-4.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="holder padding-zero">
<div class="holder padding-zero list-layout-4">
<div class="media-center-plugin list-layout layout4 text-overlay">
<div class="media-center-banner clearfix text-overlay">
<div ng-style="WidgetHome.data.content.images.length > 0 ? {'min-height': (9 * deviceWidth / 16) + 'px' } : {}" id="carousel" build-fire-carousel=""></div>
Expand Down

0 comments on commit 3583f2b

Please sign in to comment.