Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sandeepchhapola/pluginPluginMedia…
Browse files Browse the repository at this point in the history
…CenterRSS
  • Loading branch information
rishabhdixit committed Aug 19, 2016
2 parents 722f74a + fbb5fec commit aadc0a7
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 17 deletions.
13 changes: 9 additions & 4 deletions control/design/controllers/design.home.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
(function (angular) {
angular
.module('mediaCenterRSSPluginDesign')
.controller('DesignHomeCtrl', ['$scope', 'DataStore', 'ImageLibrary', 'TAG_NAMES', 'LAYOUTS', '$timeout',
function ($scope, DataStore, ImageLibrary, TAG_NAMES, LAYOUTS, $timeout) {
.controller('DesignHomeCtrl', ['$scope', 'DataStore', 'ImageLibrary', 'TAG_NAMES', 'LAYOUTS', '$timeout','FEED_IMAGES',
function ($scope, DataStore, ImageLibrary, TAG_NAMES, LAYOUTS, $timeout,FEED_IMAGES) {
/*
* Private variables
*
Expand Down Expand Up @@ -32,6 +32,8 @@
}
, tmrDelay = null;

DesignHome.FEED_IMAGES = FEED_IMAGES;

/*
* DesignHome.isSaved is used to show/hide Success alert message when data saved successfully. Its default value is false.
* @type {boolean}
Expand Down Expand Up @@ -127,9 +129,12 @@
if (DesignHome.data && DesignHome.data.design && !DesignHome.data.design.itemDetailsLayout) {
DesignHome.data.design.itemDetailsLayout = DesignHome.layouts.itemDetailsLayouts[0].name;
}
updateMasterItem(DesignHome.data);
if (!DesignHome.data.design.showImages)
DesignHome.data.design.showImages = FEED_IMAGES.YES;

updateMasterItem(DesignHome.data);
if (tmrDelay)clearTimeout(tmrDelay);
}
}
, error = function (err) {
console.error('Error while getting data', err);
if (tmrDelay)clearTimeout(tmrDelay);
Expand Down
7 changes: 6 additions & 1 deletion control/design/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,10 @@
{name: "Feed_Layout_1"},
{name: "Feed_Layout_2"}
]
});
})

.constant('FEED_IMAGES', {
YES: 'Yes',
NO: 'No'
})
})(window.angular);
20 changes: 20 additions & 0 deletions control/design/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,23 @@
</div>
</div>
</div>
<hr>
<div class="item clearfix row">
<div class="labels col-md-3 padding-right-zero pull-left">
<span>Show feed images</span>
</div>
<div class="main pull-right col-md-9 padding-left-zero row">
<div class="radio radio-primary radio-inline">
<input id="yes" type="radio" ng-model="DesignHome.data.design.showImages"
ng-value="DesignHome.FEED_IMAGES.YES"
name="feedImages" ng-se="">
<label for="yes">Yes</label>
</div>
<div class="radio radio-primary radio-inline">
<input id="no" type="radio" ng-model="DesignHome.data.design.showImages"
ng-value="DesignHome.FEED_IMAGES.NO"
name="feedImages">
<label for="no">No</label>
</div>
</div>
</div>
19 changes: 13 additions & 6 deletions widget/controllers/widget.home.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
(function (angular) {
angular
.module('mediaCenterRSSPluginWidget')
.controller('WidgetHomeCtrl', ['$scope', 'DataStore', 'Buildfire', 'FeedParseService', 'TAG_NAMES', 'ItemDetailsService', 'Location', '$filter', 'Underscore', '$rootScope',
function ($scope, DataStore, Buildfire, FeedParseService, TAG_NAMES, ItemDetailsService, Location, $filter, Underscore, $rootScope) {
.controller('WidgetHomeCtrl', ['$scope', 'DataStore', 'Buildfire', 'FeedParseService', 'TAG_NAMES', 'ItemDetailsService', 'Location', '$filter', 'Underscore', '$rootScope','FEED_IMAGES',
function ($scope, DataStore, Buildfire, FeedParseService, TAG_NAMES, ItemDetailsService, Location, $filter, Underscore, $rootScope,FEED_IMAGES) {

$rootScope.deviceHeight = window.innerHeight;
$rootScope.deviceWidth = window.innerWidth || 320;
Expand Down Expand Up @@ -187,9 +187,14 @@
$rootScope.backgroundImageItem = WidgetHome.data.design.itemDetailsBgImage;
console.log('$rootScope.backgroundImage', $rootScope.backgroundImage);
console.log('$rootScope.backgroundImageItem', $rootScope.backgroundImageItem);
console.log('--------------', WidgetHome.data.design.showImages);
if (WidgetHome.view && event.data.content && event.data.content.carouselImages) {
WidgetHome.view.loadItems(event.data.content.carouselImages);
}
if(!WidgetHome.data.design)
WidgetHome.data.design = {};
if(!WidgetHome.data.design.showImages)
WidgetHome.data.design.showImages = FEED_IMAGES.YES;
if (WidgetHome.data.content && WidgetHome.data.content.rssUrl) {
if (WidgetHome.data.content.rssUrl !== currentRssUrl) {
currentRssUrl = WidgetHome.data.content.rssUrl;
Expand Down Expand Up @@ -221,10 +226,12 @@
currentRssUrl = WidgetHome.data.content.rssUrl;
getFeedData(WidgetHome.data.content.rssUrl);
}
/*if (WidgetHome.data.content.carouselImages) {
$rootScope.$emit("Carousel:LOADED");
}*/
}
if(!WidgetHome.data.design)
WidgetHome.data.design = {};

if (!WidgetHome.data.design.showImages)
WidgetHome.data.design.showImages = FEED_IMAGES.YES;
}
, error = function (err) {
console.error('Error while getting data', err);
};
Expand Down
7 changes: 6 additions & 1 deletion widget/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,10 @@
AUDIO: 'AUDIO',
IMAGE: 'IMAGE',
OTHER: 'OTHER'
});
})

.constant('FEED_IMAGES', {
YES: 'Yes',
NO: 'No'
})
})(window.angular);
4 changes: 2 additions & 2 deletions widget/templates/List_Layout_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
ng-if="$index % 2 == 0">
<div class="list-item col-xs-6 pull-left"
ng-click="WidgetHome.goToItem($index)">
<div
<div ng-if="WidgetHome.data.design.showImages == 'Yes'"
class="list-item-media text-center border-radius-three overflow-hidden">
<div class="list-media-holder" style="cursor: pointer">
<img
Expand All @@ -45,7 +45,7 @@
</div>
<div class="list-item col-xs-6 pull-left"
ng-click="WidgetHome.goToItem($index+1)">
<div
<div ng-if="WidgetHome.data.design.showImages == 'Yes'"
class="list-item-media text-center border-radius-three overflow-hidden">
<div class="list-media-holder" style="cursor: pointer">
<img
Expand Down
2 changes: 1 addition & 1 deletion widget/templates/List_Layout_2.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ng-repeat="item in WidgetHome.items" trigger-ng-repeat-render=""
ng-click="WidgetHome.goToItem($index)" style="cursor: pointer">
<div class="list-item-media text-left overflow-hidden">
<div ng-if="item.imageSrcUrl" class="list-media-holder pull-left">
<div ng-if="item.imageSrcUrl && WidgetHome.data.design.showImages == 'Yes'" class="list-media-holder pull-left">
<img load-image="16x9"
crop-width="220" crop-height="120" crop-type="crop"
data-final-src="{{item.imageSrcUrl}}">
Expand Down
2 changes: 1 addition & 1 deletion widget/templates/List_Layout_3.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
data-infinite-container=".infinite-scroll-parent">
<div ng-show="WidgetHome.isItems" ng-repeat="item in WidgetHome.items"
trigger-ng-repeat-render="" ng-click="WidgetHome.goToItem($index)" style="cursor: pointer">
<div class="plugin-banner clearfix border-bottom-grey">
<div class="plugin-banner clearfix border-bottom-grey" ng-if="WidgetHome.data.design.showImages == 'Yes'">
<div class="plugin-slide text-center" ng-if="item.imageSrcUrl">
<img load-image="16x9"
crop-width="340" crop-height="192" crop-type="crop"
Expand Down
2 changes: 1 addition & 1 deletion widget/templates/List_Layout_4.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div ng-show="WidgetHome.isItems" ng-click="WidgetHome.goToItem($index)" class="list-item col-xs-6 pull-left"
ng-repeat="item in WidgetHome.items"
ng-class-even="list-item-even" ng-class-odd="list-item-odd" trigger-ng-repeat-render="">
<div class="list-item-media text-center overflow-hidden">
<div class="list-item-media text-center overflow-hidden" ng-if="WidgetHome.data.design.showImages == 'Yes'">
<div class="list-media-holder" style="cursor: pointer">
<img ng-if="item.imageSrcUrl" load-image="1x1"
crop-width="200" crop-height="200" crop-type="crop"
Expand Down

0 comments on commit aadc0a7

Please sign in to comment.