diff --git a/couchpotato/core/media/movie/_base/static/details.js b/couchpotato/core/media/movie/_base/static/details.js index 034347c..436f909 100644 --- a/couchpotato/core/media/movie/_base/static/details.js +++ b/couchpotato/core/media/movie/_base/static/details.js @@ -3,6 +3,7 @@ var MovieDetails = new Class({ Extends: BlockBase, sections: null, + buttons: null, initialize: function(parent, options){ var self = this; @@ -19,10 +20,11 @@ var MovieDetails = new Class({ }).grab( new Element('a.close.icon-left-arrow') ), - self.content = new Element('div.content').grab( + self.content = new Element('div.content').adopt( new Element('h1', { 'text': parent.getTitle() + (parent.get('year') ? ' (' + parent.get('year') + ')' : '') - }) + }), + self.buttons = new Element('div.buttons') ) ); @@ -43,6 +45,12 @@ var MovieDetails = new Class({ ); }, + addButton: function(button){ + var self = this; + + self.buttons.grab(button); + }, + close: function(){ var self = this; diff --git a/couchpotato/core/media/movie/_base/static/movie.actions.js b/couchpotato/core/media/movie/_base/static/movie.actions.js index ae8c359..dd5b797 100644 --- a/couchpotato/core/media/movie/_base/static/movie.actions.js +++ b/couchpotato/core/media/movie/_base/static/movie.actions.js @@ -151,7 +151,8 @@ MA.Release = new Class({ new Element('span.size', {'text': 'Size'}), new Element('span.age', {'text': 'Age'}), new Element('span.score', {'text': 'Score'}), - new Element('span.provider', {'text': 'Provider'}) + new Element('span.provider', {'text': 'Provider'}), + new Element('span.actions') ).inject(self.release_container); if(self.movie.data.releases) @@ -185,27 +186,33 @@ MA.Release = new Class({ new Element('span.age', {'text': self.get(release, 'age')}), new Element('span.score', {'text': self.get(release, 'score')}), new Element('span.provider', { 'text': provider, 'title': provider }), - info.detail_url ? new Element('a.info.icon2', { - 'href': info.detail_url, - 'target': '_blank' - }) : new Element('a'), - new Element('a.download.icon2', { - 'events': { - 'click': function(e){ - (e).preventDefault(); - if(!this.hasClass('completed')) - self.download(release); + new Element('span.actions').adopt( + info.detail_url ? new Element('a.icon-info', { + 'href': info.detail_url, + 'target': '_blank' + }) : new Element('a'), + new Element('a.icon-download', { + 'events': { + 'click': function(e){ + (e).preventDefault(); + if(!this.hasClass('completed')) + self.download(release); + } } - } - }), - new Element('a.delete.icon2', { - 'events': { - 'click': function(e){ - (e).preventDefault(); - self.ignore(release); + }), + new Element('a', { + 'class': release.status == 'ignored' ? 'icon-redo' : 'icon-cancel', + 'events': { + 'click': function(e){ + (e).preventDefault(); + self.ignore(release); + + this.toggleClass('icon-redo'); + this.toggleClass('icon-cancel'); + } } - } - }) + }) + ) ).inject(self.release_container); if(release.status == 'ignored' || release.status == 'failed' || release.status == 'snatched'){ @@ -224,9 +231,12 @@ MA.Release = new Class({ release.el.set('class', 'item ' + new_status); - var status_el = release.el.getElement('.release_status'); - status_el.set('class', 'release_status ' + new_status); - status_el.set('text', new_status); + release.el.getElement(':last-child') + .set('class', notification.data.status == 'ignored' ? 'icon-redo' : 'icon-cancel'); + + var status_el = release.el.getElement('.status'); + status_el.set('class', 'status ' + new_status); + status_el.set('text', new_status); if(!q && (new_status == 'snatched' || new_status == 'seeding' || new_status == 'done')) q = self.addQuality(release.quality_id); @@ -317,13 +327,13 @@ MA.Release = new Class({ self.trynext_container = new Element('div.buttons.trynext').inject(self.movie.info_container); self.trynext_container.adopt( - has_available ? [new Element('a.icon2.readd', { + has_available ? [new Element('a.icon-redo', { 'text': has_snatched ? 'Download another release' : 'Download the best release', 'events': { 'click': self.tryNextRelease.bind(self) } }), - new Element('a.icon2.download', { + new Element('a.icon-download', { 'text': 'pick one yourself', 'events': { 'click': function(){ @@ -331,7 +341,7 @@ MA.Release = new Class({ } } })] : null, - new Element('a.icon2.completed', { + new Element('a.icon-ok', { 'text': 'mark this movie done', 'events': { 'click': self.markMovieDone.bind(self) @@ -350,7 +360,7 @@ MA.Release = new Class({ var self = this; var release_el = self.release_container.getElement('#release_'+release._id), - icon = release_el.getElement('.download.icon2'); + icon = release_el.getElement('.icon-download'); if(icon) icon.addClass('icon spinner').removeClass('download'); @@ -442,13 +452,7 @@ MA.Trailer = new Class({ .grab(self.player_container); } - return self.player_container; - }, - - watch: function(){ - var self = this; - - var data_url = 'https://www.googleapis.com/youtube/v3/search?q="{title}" {year} trailer&maxResults=1&type=video&videoDefinition=high&videoEmbeddable=true&part=snippet&key=AIzaSyAT3li1KjfLidaL6Vt8T92MRU7n4VOrjYk' + var data_url = 'https://www.googleapis.com/youtube/v3/search?q="{title}" {year} trailer&maxResults=1&type=video&videoDefinition=high&videoEmbeddable=true&part=snippet&key=AIzaSyAT3li1KjfLidaL6Vt8T92MRU7n4VOrjYk'; var url = data_url.substitute({ 'title': encodeURI(self.getTitle()), 'year': self.get('year') @@ -459,31 +463,17 @@ MA.Trailer = new Class({ 'onComplete': function(json){ self.player = new YT.Player(id, { - 'height': height, - 'width': size.x, + 'height': '100%', + 'width': '100%', 'videoId': json.items[0].id.videoId, 'playerVars': { - 'autoplay': 1, 'showsearch': 0, + 'showinfo': 0, 'wmode': 'transparent', 'iv_load_policy': 3 } }); - var quality_set = false; - var change_quality = function(state){ - if(!quality_set && (state.data == 1 || state.data || 2)){ - try { - self.player.setPlaybackQuality('hd720'); - quality_set = true; - } - catch(e){ - - } - } - }; - self.player.addEventListener('onStateChange', change_quality); - } }).send(); diff --git a/couchpotato/core/media/movie/_base/static/movie.js b/couchpotato/core/media/movie/_base/static/movie.js index 078a45b..e01ed16 100644 --- a/couchpotato/core/media/movie/_base/static/movie.js +++ b/couchpotato/core/media/movie/_base/static/movie.js @@ -25,9 +25,6 @@ var Movie = new Class({ self.parent(self, options); self.addEvents(); - - if(data.identifiers.imdb == 'tt1228705') - self.openDetails(); }, openDetails: function(){ @@ -41,8 +38,15 @@ var Movie = new Class({ // Add action items self.actions.each(function(action, nr){ var details = action.getDetails(); - if(details) + if(details){ self.details.addSection(action.getLabel(), details); + } + else { + var button = action.getButton(); + if(button){ + //self.details.addButton(button.clone(true).cloneEvents(button)); + } + } }); } @@ -252,8 +256,8 @@ var Movie = new Class({ // Add releases self.updateReleases(); - self.options.actions.each(function(action){ - var action = new action(self), + self.options.actions.each(function(a){ + var action = new a(self), button = action.getButton(); if(button) self.actions_el.grab(button); diff --git a/couchpotato/core/media/movie/_base/static/movie.scss b/couchpotato/core/media/movie/_base/static/movie.scss index c9a22ca..77244ae 100644 --- a/couchpotato/core/media/movie/_base/static/movie.scss +++ b/couchpotato/core/media/movie/_base/static/movie.scss @@ -73,6 +73,7 @@ float: left; margin-bottom: $padding; position: relative; + cursor: pointer; &:nth-child(4n+4){ @include span(last); @@ -203,6 +204,7 @@ background: $background_color; z-index: 200; border-radius: 3px 0 0 3px; + overflow-y: auto; h1 { margin: 0; @@ -225,24 +227,77 @@ margin-bottom: $padding/2; } - .item span { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - text-align: center; - } + .item { + + &:not(.head):hover { + background: $theme_off; + } + + span { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + text-align: center; + padding: $padding/3 0; + } + + .name { + @include flex(1 auto); + text-align: left; + } + + &.ignored { + span:not(.actions) { + opacity: .3; + } + + .name { + text-decoration: line-through; + } + } - .item .name { - @include flex(1 auto); - text-align: left; + .actions { + padding: 0; + + a { + display: inline-block; + vertical-align: top; + padding: $padding/3; + min-width: 26px; + color: $text_color; + cursor: pointer; + + &:hover { + color: $primary_color; + } + } + } } + .status { min-width: 70px; max-width: 70px; } .quality { min-width: 60px; max-width: 60px; } .size { min-width: 40px; max-width: 40px; } .age { min-width: 40px; max-width: 40px; } .score { min-width: 45px; max-width: 45px; } .provider { min-width: 110px; max-width: 110px; } + .actions { min-width: 80px; max-width: 80px; } + + } + .trailer_container { + position: relative; + padding-bottom: 56.25%; + height: 0; + overflow: hidden; + max-width: 100%; + + iframe, object, embed { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } } } diff --git a/couchpotato/core/media/movie/_base/static/wanted.js b/couchpotato/core/media/movie/_base/static/wanted.js index f3b0a96..9d34910 100644 --- a/couchpotato/core/media/movie/_base/static/wanted.js +++ b/couchpotato/core/media/movie/_base/static/wanted.js @@ -32,7 +32,7 @@ var MoviesWanted = new Class({ self.list = new MovieList({ 'identifier': 'wanted', 'status': 'active', - 'actions': [MA.IMDB, MA.Trailer, MA.Release, MA.Edit, MA.Refresh, MA.Readd, MA.Delete], + 'actions': [MA.IMDB, MA.Release, MA.Trailer, MA.Edit, MA.Refresh, MA.Readd, MA.Delete], 'add_new': true, 'menu': [self.manual_search, self.scan_folder], 'on_empty_element': App.createUserscriptButtons().addClass('empty_wanted') diff --git a/couchpotato/core/media/movie/providers/automation/trakt/static/trakt.js b/couchpotato/core/media/movie/providers/automation/trakt/static/trakt.js index 9dcd78b..4d757b7 100644 --- a/couchpotato/core/media/movie/providers/automation/trakt/static/trakt.js +++ b/couchpotato/core/media/movie/providers/automation/trakt/static/trakt.js @@ -17,7 +17,7 @@ var TraktAutomation = new Class({ var trakt_set = 0; fieldset.getElements('input[type=text]').each(function(el){ - trakt_set += +(el.get('value') != ''); + trakt_set += +(el.get('value') !== ''); }); new Element('.ctrlHolder').adopt( @@ -58,7 +58,7 @@ var TraktAutomation = new Class({ }) ).inject(fieldset); - }) + }); } diff --git a/couchpotato/static/fonts/config.json b/couchpotato/static/fonts/config.json index 2add417..f710c3e 100644 --- a/couchpotato/static/fonts/config.json +++ b/couchpotato/static/fonts/config.json @@ -43,12 +43,48 @@ "src": "fontawesome" }, { + "uid": "12f4ece88e46abd864e40b35e05b11cd", + "css": "ok", + "code": 59408, + "src": "fontawesome" + }, + { + "uid": "5211af474d3a9848f67f945e2ccaf143", + "css": "cancel", + "code": 59406, + "src": "fontawesome" + }, + { + "uid": "3d4ea8a78dc34efe891f3a0f3d961274", + "css": "info", + "code": 59403, + "src": "fontawesome" + }, + { + "uid": "9a76bc135eac17d2c8b8ad4a5774fc87", + "css": "download", + "code": 59404, + "src": "fontawesome" + }, + { + "uid": "f48ae54adfb27d8ada53d0fd9e34ee10", + "css": "delete", + "code": 59405, + "src": "fontawesome" + }, + { "uid": "e99461abfef3923546da8d745372c995", "css": "settings", "code": 59393, "src": "fontawesome" }, { + "uid": "bc71f4c6e53394d5ba46b063040014f1", + "css": "redo", + "code": 59407, + "src": "fontawesome" + }, + { "uid": "4109c474ff99cad28fd5a2c38af2ec6f", "css": "filter", "code": 59396, diff --git a/couchpotato/static/fonts/icons.eot b/couchpotato/static/fonts/icons.eot index 2dc6375..a404b48 100644 Binary files a/couchpotato/static/fonts/icons.eot and b/couchpotato/static/fonts/icons.eot differ diff --git a/couchpotato/static/fonts/icons.svg b/couchpotato/static/fonts/icons.svg index 3d4b867..0aae891 100644 --- a/couchpotato/static/fonts/icons.svg +++ b/couchpotato/static/fonts/icons.svg @@ -1,7 +1,7 @@ -Copyright (C) 2014 by original authors @ fontello.com +Copyright (C) 2015 by original authors @ fontello.com @@ -17,6 +17,12 @@ + + + + + + \ No newline at end of file diff --git a/couchpotato/static/fonts/icons.ttf b/couchpotato/static/fonts/icons.ttf index 6010281..e3a0cde 100644 Binary files a/couchpotato/static/fonts/icons.ttf and b/couchpotato/static/fonts/icons.ttf differ diff --git a/couchpotato/static/fonts/icons.woff b/couchpotato/static/fonts/icons.woff index 4debfbc..3df54f1 100644 Binary files a/couchpotato/static/fonts/icons.woff and b/couchpotato/static/fonts/icons.woff differ diff --git a/couchpotato/static/style/fonts.scss b/couchpotato/static/style/fonts.scss index 50717f5..3681505 100644 --- a/couchpotato/static/style/fonts.scss +++ b/couchpotato/static/style/fonts.scss @@ -1,11 +1,11 @@ /* Fonts */ @font-face { font-family: 'icons'; - src: url('../fonts/icons.eot?74719534'); - src: url('../fonts/icons.eot?74719534#iefix') format('embedded-opentype'), - url('../fonts/icons.woff?74719534') format('woff'), - url('../fonts/icons.ttf?74719534') format('truetype'), - url('../fonts/icons.svg?74719534#icons') format('svg'); + src: url('../fonts/icons.eot?74719538'); + src: url('../fonts/icons.eot?74719538#iefix') format('embedded-opentype'), + url('../fonts/icons.woff?74719538') format('woff'), + url('../fonts/icons.ttf?74719538') format('truetype'), + url('../fonts/icons.svg?74719538#icons') format('svg'); font-weight: normal; font-style: normal; } @@ -30,6 +30,12 @@ .icon-emo-cry:before { content: '\e808'; } .icon-emo-coffee:before { content: '\e809'; } .icon-emo-sunglasses:before { content: '\e80a'; } +.icon-info:before { content: '\e80b'; } +.icon-download:before { content: '\e80c'; } +.icon-delete:before { content: '\e80d'; } +.icon-cancel:before { content: '\e80e'; } +.icon-redo:before { content: '\e80f'; } +.icon-ok:before { content: '\e810'; } @font-face { font-family: 'OpenSans';