From cc1096950694acc85fde9d8f3b225d8823f629c8 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 10 May 2014 15:53:27 +0200 Subject: [PATCH] Keep log filter Pre-fill in issue when possible --- couchpotato/core/plugins/log/static/log.css | 48 +++++++++++++++------ couchpotato/core/plugins/log/static/log.js | 9 ++-- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/couchpotato/core/plugins/log/static/log.css b/couchpotato/core/plugins/log/static/log.css index 63165128..d7112163 100644 --- a/couchpotato/core/plugins/log/static/log.css +++ b/couchpotato/core/plugins/log/static/log.css @@ -81,6 +81,8 @@ font-size: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1); position: relative; + overflow: hidden; + padding: 0 3px; } .page.log .container .time.highlight { background: rgba(255, 255, 255, 0.1); @@ -91,12 +93,12 @@ vertical-align: middle; } - .page.log [data-filter=INFO] .error, - .page.log [data-filter=INFO] .debug, - .page.log [data-filter=ERROR] .debug, - .page.log [data-filter=ERROR] .info, - .page.log [data-filter=DEBUG] .info, - .page.log [data-filter=DEBUG] .error { + .page.log[data-filter=INFO] .error, + .page.log[data-filter=INFO] .debug, + .page.log[data-filter=ERROR] .debug, + .page.log[data-filter=ERROR] .info, + .page.log[data-filter=DEBUG] .info, + .page.log[data-filter=DEBUG] .error { display: none; } @@ -111,7 +113,7 @@ } .page.log .container .error { color: #FFA4A4; } - .page.log .container .debug span { opacity: .4; } + .page.log .container .debug span { opacity: .6; } .do_report { position: absolute; @@ -158,22 +160,42 @@ font-size: 12px; } -.page.log .container ::-webkit-selection { +.page.log .container .time:not(.highlight) ::-webkit-selection { background-color: #000; color: #FFF; } -.page.log .container ::-moz-selection { +.page.log .container .time:not(.highlight) ::-moz-selection { background-color: #000; color: #FFF; } -.page.log .container ::-ms-selection { +.page.log .container .time:not(.highlight) ::-ms-selection { background-color: #000; color: #FFF; } -.page.log .container ::selection { - background-color: #000; - color: #FFF; +.page.log .container .time.highlight ::selection { + background-color: transparent; + color: inherit; +} + +.page.log .container .time.highlight ::-webkit-selection { + background-color: transparent; + color: inherit; +} + +.page.log .container .time.highlight ::-moz-selection { + background-color: transparent; + color: inherit; +} + +.page.log .container .time.highlight ::-ms-selection { + background-color: transparent; + color: inherit; +} + +.page.log .container .time.highlight ::selection { + background-color: transparent; + color: inherit; } diff --git a/couchpotato/core/plugins/log/static/log.js b/couchpotato/core/plugins/log/static/log.js index 1e18c5b1..6560aefc 100644 --- a/couchpotato/core/plugins/log/static/log.js +++ b/couchpotato/core/plugins/log/static/log.js @@ -65,7 +65,7 @@ Running on: ...\n\ 'events': { 'change': function () { var type_filter = this.getSelected()[0].get('value'); - self.log.set('data-filter', type_filter); + self.el.set('data-filter', type_filter); self.scrollToBottom(); } } @@ -197,7 +197,8 @@ Running on: ...\n\ }, showReport: function(text){ - var self = this; + var self = this, + body = self.report_text.replace('{issue}', text); var overlay = new Element('div.report', { 'method': 'post', @@ -231,7 +232,7 @@ Running on: ...\n\ }) ), new Element('textarea', { - 'text': self.report_text.replace('{issue}', text), + 'text': body, 'events': { 'click': function(){ this.select(); @@ -241,7 +242,7 @@ Running on: ...\n\ new Element('a.button', { 'target': '_blank', 'text': 'Create a new issue on GitHub with the text above', - 'href': 'https://github.com/RuudBurger/CouchPotatoServer/issues/new?body=Paste the text here' + 'href': 'https://github.com/RuudBurger/CouchPotatoServer/issues/new?body=' + (body.length < 2000 ? encodeURIComponent(body) : 'Paste the text here') }) ) );