Kinda new NSFW thumb, SFW checks fixed, display "sponsored" under promos
This commit is contained in:
parent
e72b279cc4
commit
20fbdf7c30
|
@ -143,8 +143,33 @@ input.add-channel {
|
|||
background-size: calc(100% + 12px);
|
||||
}
|
||||
|
||||
.nsfw_thumb {
|
||||
#video-list .nsfw_thumb {
|
||||
display: none;
|
||||
position: relative;
|
||||
}
|
||||
#video-list .nsfw_thumb:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
background: rgba(255,255,255,0.8) url(../img/nsfw.png);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background-size: cover;
|
||||
|
||||
-webkit-transition: background-color 0.2s ease-in-out;
|
||||
-moz-transition: background-color 0.2s ease-in-out;
|
||||
-ms-transition: background-color 0.2s ease-in-out;
|
||||
-o-transition: background-color 0.2s ease-in-out;
|
||||
transition: background-color 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
#video-list .nsfw_thumb:hover:after {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#video-list .nsfw_thumb.visible {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#vid-list-tooltip {
|
||||
|
@ -309,10 +334,14 @@ body.video-loading #loading {
|
|||
position: relative;
|
||||
}
|
||||
|
||||
#video-container.promo #video-actions {
|
||||
#video-container.promo #video-actions, #promo-actions {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#video-container.promo #promo-actions {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#video-container, #add-channel {
|
||||
height: 670px;
|
||||
max-height: 670px;
|
||||
|
@ -371,7 +400,7 @@ body.video-loading #loading {
|
|||
font-weight: 300;
|
||||
}
|
||||
|
||||
#video-actions {
|
||||
#video-actions, #promo-actions {
|
||||
color:#5f99cf;
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
|
|
BIN
img/nsfw.png
BIN
img/nsfw.png
Binary file not shown.
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 11 KiB |
|
@ -117,6 +117,9 @@ Globals = {
|
|||
<span id="video-sponsored-label" class="sponsored">SPONSORED </span>
|
||||
<span id="video-title"></span>
|
||||
</div>
|
||||
<div id="promo-actions" class="grid-30 right-align">
|
||||
SPONSORED
|
||||
</div>
|
||||
<div id="video-actions" class="grid-30 right-align">
|
||||
<a id="video-comments-link" href="" target="_blank">COMMENTS</a> | <a id="video-tweet-link" href="" target="_blank">TWEET</a> | <a id="video-share-link" href="" target="_blank">SHARE</a>
|
||||
</div>
|
||||
|
|
20
js/tv.js
20
js/tv.js
|
@ -145,14 +145,14 @@ var RedditTV = Class.extend({
|
|||
});
|
||||
$('#settings .settings-sfw input').change(function() {
|
||||
self.Globals.sfw = ($(this).is(':checked')) ? true : false;
|
||||
if(!Globals.sfw){
|
||||
if(!self.Globals.sfw){
|
||||
if(!confirm("Are you over 18?")){
|
||||
$(this).removeClass('active').find('input').prop("checked", true);
|
||||
self.Globals.sfw = true;
|
||||
}
|
||||
}
|
||||
$.jStorage.set('sfw', self.Globals.sfw);
|
||||
showHideNsfwThumbs(Globals.sfw, self.Globals.cur_chan);
|
||||
self.showHideNsfwThumbs(self.Globals.sfw);
|
||||
});
|
||||
$('#settings .settings-fill').click(function() {
|
||||
fillScreen();
|
||||
|
@ -643,19 +643,17 @@ var RedditTV = Class.extend({
|
|||
return (self.Globals.sfw && self.Globals.videos[chan].video[video].over_18);
|
||||
},
|
||||
|
||||
showHideNsfwThumbs: function(sfw, this_chan) {
|
||||
$('.nsfw_thumb').each(function() {
|
||||
$(this).attr('src', self.getThumbnailUrl(this_chan.feed, Number($(this).attr('rel'))));
|
||||
});
|
||||
showHideNsfwThumbs: function(sfw) {
|
||||
$('.nsfw_thumb').toggleClass('visible', !sfw);
|
||||
},
|
||||
|
||||
getThumbnailUrl: function(chan, video_id) {
|
||||
var video = (typeof chan == 'object') ? chan.video[video_id] : self.Globals.videos[chan].video[video_id];
|
||||
|
||||
if (self.sfwCheck(video_id, chan)) {
|
||||
/*if (self.sfwCheck(video_id, chan)) {
|
||||
return 'img/nsfw.png';
|
||||
}
|
||||
else if (video.media.oembed) {
|
||||
}*/
|
||||
if (video.media.oembed) {
|
||||
return video.media.oembed.thumbnail_url !== undefined ?
|
||||
video.media.oembed.thumbnail_url :
|
||||
'img/noimage.png';
|
||||
|
@ -846,8 +844,6 @@ var RedditTV = Class.extend({
|
|||
},
|
||||
|
||||
loadVideoList: function(chan) {
|
||||
console.log('[loadVideoList]', chan);
|
||||
|
||||
var this_chan = chan,
|
||||
$list = $('<span></span>');
|
||||
for(var i in self.Globals.videos[this_chan.feed].video) {
|
||||
|
@ -884,6 +880,8 @@ var RedditTV = Class.extend({
|
|||
});
|
||||
}
|
||||
|
||||
self.showHideNsfwThumbs(self.Globals.sfw);
|
||||
|
||||
$('#video-list')
|
||||
.stop(true, true)
|
||||
.show()
|
||||
|
|
Loading…
Reference in New Issue