From 8b2cd62211cc599e70858b23232add72f6f58119 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 30 Nov 2013 12:49:28 +0100 Subject: [PATCH 1/3] Don't save stash on pull --- couchpotato/core/_base/updater/main.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/couchpotato/core/_base/updater/main.py b/couchpotato/core/_base/updater/main.py index aecf0c4..648c2c4 100644 --- a/couchpotato/core/_base/updater/main.py +++ b/couchpotato/core/_base/updater/main.py @@ -183,9 +183,6 @@ class GitUpdater(BaseUpdater): def doUpdate(self): try: - log.debug('Stashing local changes') - self.repo.saveStash() - log.info('Updating to latest version') self.repo.pull() From 54af80d5ad6c4d3aa2977a4b4febaf0987874910 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 30 Nov 2013 12:51:35 +0100 Subject: [PATCH 2/3] Don't wait for shutdown of scheduler --- couchpotato/core/_base/scheduler/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/core/_base/scheduler/main.py b/couchpotato/core/_base/scheduler/main.py index 87b0533..773213b 100644 --- a/couchpotato/core/_base/scheduler/main.py +++ b/couchpotato/core/_base/scheduler/main.py @@ -37,7 +37,7 @@ class Scheduler(Plugin): def stop(self): if self.started: log.debug('Stopping scheduler') - self.sched.shutdown() + self.sched.shutdown(wait = False) log.debug('Scheduler stopped') self.started = False From 8aec5cf605fff0d329d656313d95c5ba9ab29a1c Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 30 Nov 2013 14:59:52 +0100 Subject: [PATCH 3/3] Better (custom) formhints --- .../static/scripts/library/mootools_more.js | 265 +-------------------- couchpotato/static/scripts/page/settings.js | 56 ++--- couchpotato/static/style/settings.css | 54 +++-- 3 files changed, 70 insertions(+), 305 deletions(-) diff --git a/couchpotato/static/scripts/library/mootools_more.js b/couchpotato/static/scripts/library/mootools_more.js index d51c4c1..77b3a7a 100644 --- a/couchpotato/static/scripts/library/mootools_more.js +++ b/couchpotato/static/scripts/library/mootools_more.js @@ -1,6 +1,6 @@ // MooTools: the javascript framework. -// Load this file's selection again by visiting: http://mootools.net/more/7a819726f7f5e85fc48bef295ff78dbe -// Or build this file again with packager using: packager build More/Events.Pseudos More/Date More/Date.Extras More/Element.Forms More/Element.Position More/Element.Shortcuts More/Fx.Scroll More/Fx.Slide More/Sortables More/Request.JSONP More/Request.Periodical More/Tips +// Load this file's selection again by visiting: http://mootools.net/more/0f75cfbac1aabbedaba7630beef8d10c +// Or build this file again with packager using: packager build More/Events.Pseudos More/Date More/Date.Extras More/Element.Forms More/Element.Position More/Element.Shortcuts More/Fx.Scroll More/Fx.Slide More/Sortables More/Request.JSONP More/Request.Periodical /* --- @@ -3161,264 +3161,3 @@ Request.implement({ }); - -/* ---- - -script: Tips.js - -name: Tips - -description: Class for creating nice tips that follow the mouse cursor when hovering an element. - -license: MIT-style license - -authors: - - Valerio Proietti - - Christoph Pojer - - Luis Merino - -requires: - - Core/Options - - Core/Events - - Core/Element.Event - - Core/Element.Style - - Core/Element.Dimensions - - /MooTools.More - -provides: [Tips] - -... -*/ - -(function(){ - -var read = function(option, element){ - return (option) ? (typeOf(option) == 'function' ? option(element) : element.get(option)) : ''; -}; - -this.Tips = new Class({ - - Implements: [Events, Options], - - options: {/* - id: null, - onAttach: function(element){}, - onDetach: function(element){}, - onBound: function(coords){},*/ - onShow: function(){ - this.tip.setStyle('display', 'block'); - }, - onHide: function(){ - this.tip.setStyle('display', 'none'); - }, - title: 'title', - text: function(element){ - return element.get('rel') || element.get('href'); - }, - showDelay: 100, - hideDelay: 100, - className: 'tip-wrap', - offset: {x: 16, y: 16}, - windowPadding: {x:0, y:0}, - fixed: false, - waiAria: true - }, - - initialize: function(){ - var params = Array.link(arguments, { - options: Type.isObject, - elements: function(obj){ - return obj != null; - } - }); - this.setOptions(params.options); - if (params.elements) this.attach(params.elements); - this.container = new Element('div', {'class': 'tip'}); - - if (this.options.id){ - this.container.set('id', this.options.id); - if (this.options.waiAria) this.attachWaiAria(); - } - }, - - toElement: function(){ - if (this.tip) return this.tip; - - this.tip = new Element('div', { - 'class': this.options.className, - styles: { - position: 'absolute', - top: 0, - left: 0 - } - }).adopt( - new Element('div', {'class': 'tip-top'}), - this.container, - new Element('div', {'class': 'tip-bottom'}) - ); - - return this.tip; - }, - - attachWaiAria: function(){ - var id = this.options.id; - this.container.set('role', 'tooltip'); - - if (!this.waiAria){ - this.waiAria = { - show: function(element){ - if (id) element.set('aria-describedby', id); - this.container.set('aria-hidden', 'false'); - }, - hide: function(element){ - if (id) element.erase('aria-describedby'); - this.container.set('aria-hidden', 'true'); - } - }; - } - this.addEvents(this.waiAria); - }, - - detachWaiAria: function(){ - if (this.waiAria){ - this.container.erase('role'); - this.container.erase('aria-hidden'); - this.removeEvents(this.waiAria); - } - }, - - attach: function(elements){ - $$(elements).each(function(element){ - var title = read(this.options.title, element), - text = read(this.options.text, element); - - element.set('title', '').store('tip:native', title).retrieve('tip:title', title); - element.retrieve('tip:text', text); - this.fireEvent('attach', [element]); - - var events = ['enter', 'leave']; - if (!this.options.fixed) events.push('move'); - - events.each(function(value){ - var event = element.retrieve('tip:' + value); - if (!event) event = function(event){ - this['element' + value.capitalize()].apply(this, [event, element]); - }.bind(this); - - element.store('tip:' + value, event).addEvent('mouse' + value, event); - }, this); - }, this); - - return this; - }, - - detach: function(elements){ - $$(elements).each(function(element){ - ['enter', 'leave', 'move'].each(function(value){ - element.removeEvent('mouse' + value, element.retrieve('tip:' + value)).eliminate('tip:' + value); - }); - - this.fireEvent('detach', [element]); - - if (this.options.title == 'title'){ // This is necessary to check if we can revert the title - var original = element.retrieve('tip:native'); - if (original) element.set('title', original); - } - }, this); - - return this; - }, - - elementEnter: function(event, element){ - clearTimeout(this.timer); - this.timer = (function(){ - this.container.empty(); - - ['title', 'text'].each(function(value){ - var content = element.retrieve('tip:' + value); - var div = this['_' + value + 'Element'] = new Element('div', { - 'class': 'tip-' + value - }).inject(this.container); - if (content) this.fill(div, content); - }, this); - this.show(element); - this.position((this.options.fixed) ? {page: element.getPosition()} : event); - }).delay(this.options.showDelay, this); - }, - - elementLeave: function(event, element){ - clearTimeout(this.timer); - this.timer = this.hide.delay(this.options.hideDelay, this, element); - this.fireForParent(event, element); - }, - - setTitle: function(title){ - if (this._titleElement){ - this._titleElement.empty(); - this.fill(this._titleElement, title); - } - return this; - }, - - setText: function(text){ - if (this._textElement){ - this._textElement.empty(); - this.fill(this._textElement, text); - } - return this; - }, - - fireForParent: function(event, element){ - element = element.getParent(); - if (!element || element == document.body) return; - if (element.retrieve('tip:enter')) element.fireEvent('mouseenter', event); - else this.fireForParent(event, element); - }, - - elementMove: function(event, element){ - this.position(event); - }, - - position: function(event){ - if (!this.tip) document.id(this); - - var size = window.getSize(), scroll = window.getScroll(), - tip = {x: this.tip.offsetWidth, y: this.tip.offsetHeight}, - props = {x: 'left', y: 'top'}, - bounds = {y: false, x2: false, y2: false, x: false}, - obj = {}; - - for (var z in props){ - obj[props[z]] = event.page[z] + this.options.offset[z]; - if (obj[props[z]] < 0) bounds[z] = true; - if ((obj[props[z]] + tip[z] - scroll[z]) > size[z] - this.options.windowPadding[z]){ - obj[props[z]] = event.page[z] - this.options.offset[z] - tip[z]; - bounds[z+'2'] = true; - } - } - - this.fireEvent('bound', bounds); - this.tip.setStyles(obj); - }, - - fill: function(element, contents){ - if (typeof contents == 'string') element.set('html', contents); - else element.adopt(contents); - }, - - show: function(element){ - if (!this.tip) document.id(this); - if (!this.tip.getParent()) this.tip.inject(document.body); - this.fireEvent('show', [this.tip, element]); - }, - - hide: function(element){ - if (!this.tip) document.id(this); - this.fireEvent('hide', [this.tip, element]); - } - -}); - -})(); - diff --git a/couchpotato/static/scripts/page/settings.js b/couchpotato/static/scripts/page/settings.js index d4c65e3..27bd4ae 100644 --- a/couchpotato/static/scripts/page/settings.js +++ b/couchpotato/static/scripts/page/settings.js @@ -268,20 +268,10 @@ Page.Settings = new Class({ if((typeOf(group.description) == 'array')){ var hint = new Element('span.hint.more_hint', { - 'html': group.description[0], - 'title': group.description[1] - }); - var tip = new Tips(hint, { - 'fixed': true, - 'offset': {'x': 0, 'y': 0}, - 'onShow': function(tip, hint){ - tip.setStyles({ - 'margin-top': hint.getSize().y, - 'visibility': 'hidden', - 'display': 'block' - }).fade('in'); - } + 'html': group.description[0] }); + + createTooltip(group.description[1]).inject(hint, 'top'); } else { var hint = new Element('span.hint', { @@ -369,21 +359,10 @@ var OptionBase = new Class({ if((typeOf(self.options.description) == 'array')){ var hint = new Element('p.formHint.more_hint', { - 'html': self.options.description[0], - 'title': self.options.description[1] + 'html': self.options.description[0] }).inject(self.el); - var tip = new Tips(hint, { - 'fixed': true, - 'offset': {'x': 0, 'y': 0}, - 'onShow': function(tip, hint){ - tip.setStyles({ - 'margin-left': 13, - 'margin-top': hint.getSize().y+3, - 'visibility': 'hidden', - 'display': 'block' - }).fade('in'); - } - }); + + createTooltip(self.options.description[1]).inject(hint, 'top'); } else { var hint = new Element('p.formHint', { @@ -1456,4 +1435,25 @@ Option.Combined = new Class({ self.saveCombined(); } -}); \ No newline at end of file +}); + +var createTooltip = function(description){ + + var tip = new Element('div.tooltip', { + 'events': { + 'mouseenter': function(){ + tip.addClass('shown') + }, + 'mouseleave': function(){ + tip.removeClass('shown') + } + } + }).adopt( + new Element('a.icon2.info'), + new Element('div.tip', { + 'html': description + }) + ); + + return tip; +} diff --git a/couchpotato/static/style/settings.css b/couchpotato/static/style/settings.css index f3df286..82e5135 100644 --- a/couchpotato/static/style/settings.css +++ b/couchpotato/static/style/settings.css @@ -128,7 +128,7 @@ .page .ctrlHolder.focused:first-child, .page .ctrlHolder:first-child{ background-color: transparent; } .page .ctrlHolder .formHint { - width: 47%; + width: 46%; margin: -18px 0; color: #fff !important; display: inline-block; @@ -720,18 +720,44 @@ min-height: 210px; } -.tip-wrap { - background: #FFF; - color: #000; - padding: 10px; - width: 300px; - z-index: 200; + +.tooltip { + position: absolute; + right: 0px; + width: 30px; + height: 30px; } - .more_hint:after { - position: relative; - font-family: 'Elusive-Icons'; - content: "\e089"; - display: inline-block; - top: 1px; - left: 6px; + + .tooltip > a { + opacity: .3; + font-size: 11px; + cursor: pointer; + } + + .tooltip:hover > a { + opacity: 1; + } + + .tooltip div { + background: #FFF; + color: #000; + padding: 10px; + width: 380px; + z-index: 200; + position: absolute; + transition: all .4s cubic-bezier(0.9,0,0.1,1); + margin-top: 40px; + right: 0; + opacity: 0; + visibility: hidden; } + + .tooltip.shown div { + margin-top: 10px; + opacity: 1; + visibility: visible; + } + + .tooltip div a { + color: #5b9bd1; + }