diff --git a/couchpotato/core/_base/_core.py b/couchpotato/core/_base/_core.py index 4726056..30925f4 100644 --- a/couchpotato/core/_base/_core.py +++ b/couchpotato/core/_base/_core.py @@ -284,6 +284,11 @@ config = [{ 'description': 'Let 3rd party app do stuff. Docs', }, { + 'name': 'dereferer', + 'default': 'http://www.dereferer.org/?', + 'description': 'Derefer links to external sites, keep empty for no dereferer. Example: http://www.dereferer.org/? or http://www.nullrefer.com/?.', + }, + { 'name': 'use_proxy', 'default': 0, 'type': 'bool', diff --git a/couchpotato/core/media/movie/_base/static/list.js b/couchpotato/core/media/movie/_base/static/list.js index e811cd3..6177da4 100644 --- a/couchpotato/core/media/movie/_base/static/list.js +++ b/couchpotato/core/media/movie/_base/static/list.js @@ -41,7 +41,6 @@ var MovieList = new Class({ self.movie_list = new Element('div', { 'events': { 'click:relay(.movie)': function(e, el){ - (e).stopPropagation(); el.retrieve('klass').onClick(e); }, 'mouseenter:relay(.movie)': function(e, el){ @@ -52,9 +51,6 @@ var MovieList = new Class({ (e).stopPropagation(); el.retrieve('klass').onMouseleave(e); }, - 'click:relay(.movie .action)': function(e){ - (e).stopPropagation(); - }, 'change:relay(.movie input)': function(e, el){ (e).stopPropagation(); el = el.getParent(); diff --git a/couchpotato/core/media/movie/_base/static/movie.js b/couchpotato/core/media/movie/_base/static/movie.js index 06380bd..a1a3b60 100644 --- a/couchpotato/core/media/movie/_base/static/movie.js +++ b/couchpotato/core/media/movie/_base/static/movie.js @@ -298,7 +298,7 @@ var Movie = new Class({ onClick: function(e){ var self = this; - if(e.target.get('tag') != 'input'){ + if(e.target.getParents('.actions').length == 0 && e.target != self.select_checkbox){ (e).stopPropagation(); self.openDetails(); } diff --git a/couchpotato/static/scripts/combined.base.min.js b/couchpotato/static/scripts/combined.base.min.js index 26bfc22..815d8d3 100644 --- a/couchpotato/static/scripts/combined.base.min.js +++ b/couchpotato/static/scripts/combined.base.min.js @@ -420,7 +420,10 @@ var CouchPotato = new Class({ openDerefered: function(e, el) { var self = this; e.stop(); - var url = "http://www.dereferer.org/?" + el.get("href"); + var url = el.get("href"); + if (self.getOption("dereferer")) { + url = self.getOption("dereferer") + el.get("href"); + } if (el.get("target") == "_blank" || e.meta && self.isMac() || e.control && !self.isMac()) window.open(url); else window.location = url; }, createUserscriptButtons: function() { diff --git a/couchpotato/static/scripts/combined.plugins.min.js b/couchpotato/static/scripts/combined.plugins.min.js index cc1cdfe..fa0bf8d 100644 --- a/couchpotato/static/scripts/combined.plugins.min.js +++ b/couchpotato/static/scripts/combined.plugins.min.js @@ -457,7 +457,6 @@ var MovieList = new Class({ }) : null, self.movie_list = new Element("div", { events: { "click:relay(.movie)": function(e, el) { - e.stopPropagation(); el.retrieve("klass").onClick(e); }, "mouseenter:relay(.movie)": function(e, el) { @@ -468,9 +467,6 @@ var MovieList = new Class({ e.stopPropagation(); el.retrieve("klass").onMouseleave(e); }, - "click:relay(.movie .action)": function(e) { - e.stopPropagation(); - }, "change:relay(.movie input)": function(e, el) { e.stopPropagation(); el = el.getParent(); @@ -1936,7 +1932,7 @@ var Movie = new Class({ }, onClick: function(e) { var self = this; - if (e.target.get("tag") != "input") { + if (e.target.getParents(".actions").length == 0 && e.target != self.select_checkbox) { e.stopPropagation(); self.openDetails(); } diff --git a/couchpotato/static/scripts/couchpotato.js b/couchpotato/static/scripts/couchpotato.js index 91327d0..76a7fd0 100644 --- a/couchpotato/static/scripts/couchpotato.js +++ b/couchpotato/static/scripts/couchpotato.js @@ -371,7 +371,10 @@ var self = this; (e).stop(); - var url = 'http://www.dereferer.org/?' + el.get('href'); + var url = el.get('href'); + if(self.getOption('dereferer')){ + url = self.getOption('dereferer') + el.get('href'); + } if(el.get('target') == '_blank' || (e.meta && self.isMac()) || (e.control && !self.isMac())) window.open(url); diff --git a/couchpotato/templates/index.html b/couchpotato/templates/index.html index 17ccaac..90bf959 100644 --- a/couchpotato/templates/index.html +++ b/couchpotato/templates/index.html @@ -80,6 +80,7 @@ App.setup({ 'dev': dev, 'base_url': {{ json_encode(Env.get('web_base')) }}, + 'dereferer': {{ json_encode(Env.setting('dereferer')) }}, 'args': {{ json_encode(Env.get('args', unicode = True)) }}, 'options': {{ json_encode(('%s' % Env.get('options'))) }}, 'app_dir': {{ json_encode(Env.get('app_dir', unicode = True)) }},