From a6c4763d6d63ac0776153539ff3129d03bfe2cf9 Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 27 Aug 2012 22:45:35 +0200 Subject: [PATCH 01/26] Update Userscript with @grant --- couchpotato/core/plugins/userscript/main.py | 2 +- .../core/plugins/userscript/template.js | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/couchpotato/core/plugins/userscript/main.py b/couchpotato/core/plugins/userscript/main.py index 9c5f05f0..e5999ab3 100644 --- a/couchpotato/core/plugins/userscript/main.py +++ b/couchpotato/core/plugins/userscript/main.py @@ -15,7 +15,7 @@ log = CPLog(__name__) class Userscript(Plugin): - version = 2 + version = 3 def __init__(self): addApiView('userscript.get//', self.getUserScript, static = True) diff --git a/couchpotato/core/plugins/userscript/template.js b/couchpotato/core/plugins/userscript/template.js index 8b07272b..c30fad5b 100644 --- a/couchpotato/core/plugins/userscript/template.js +++ b/couchpotato/core/plugins/userscript/template.js @@ -1,6 +1,7 @@ // ==UserScript== // @name CouchPotato UserScript // @description Add movies like a real CouchPotato +// @grant none // @version {{version}} // @match {{host}}* @@ -44,21 +45,19 @@ function create() { return A; } -if (typeof GM_addStyle == 'undefined'){ - GM_addStyle = function(css) { - var head = document.getElementsByTagName('head')[0], - style = document.createElement('style'); - if (!head) - return; +var addStyle = function(css) { + var head = document.getElementsByTagName('head')[0], + style = document.createElement('style'); + if (!head) + return; - style.type = 'text/css'; - style.textContent = css; - head.appendChild(style); - } + style.type = 'text/css'; + style.textContent = css; + head.appendChild(style); } // Styles -GM_addStyle('\ +addStyle('\ #cp_popup { font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif; -moz-border-radius: 6px 0px 0px 6px; -webkit-border-radius: 6px 0px 0px 6px; border-radius: 6px 0px 0px 6px; -moz-box-shadow: 0 0 20px rgba(0,0,0,0.5); -webkit-box-shadow: 0 0 20px rgba(0,0,0,0.5); box-shadow: 0 0 20px rgba(0,0,0,0.5); position:fixed; z-index:9999; bottom:0; right:0; font-size:15px; margin: 20px 0; display: block; background:#4E5969; } \ #cp_popup.opened { width: 492px; } \ #cp_popup a#add_to { cursor:pointer; text-align:center; text-decoration:none; color: #000; display:block; padding:5px 0 5px 5px; } \ From 2d5481b89e30be4a66f3f4834b740fedf05e1c4e Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 27 Aug 2012 23:04:04 +0200 Subject: [PATCH 02/26] Remove unused host in javascript api --- couchpotato/templates/_desktop.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/couchpotato/templates/_desktop.html b/couchpotato/templates/_desktop.html index 0c228dca..80a095e3 100644 --- a/couchpotato/templates/_desktop.html +++ b/couchpotato/templates/_desktop.html @@ -43,7 +43,7 @@ - +