diff --git a/couchpotato/static/scripts/couchpotato.js b/couchpotato/static/scripts/couchpotato.js index 00a89458..8fbd00cb 100644 --- a/couchpotato/static/scripts/couchpotato.js +++ b/couchpotato/static/scripts/couchpotato.js @@ -135,7 +135,7 @@ var CouchPotato = new Class({ Api.request('app.shutdown', { 'onComplete': self.blockPage.bind(self) }); - self.checkAvailable(); + self.checkAvailable(1000); }, restart: function(){ @@ -143,32 +143,36 @@ var CouchPotato = new Class({ self.blockPage('Restarting... please wait. If this takes to long, something must have gone wrong.'); Api.request('app.restart'); - self.checkAvailable(); + self.checkAvailable(1000); }, - checkAvailable: function(){ + checkAvailable: function(delay){ var self = this; - Api.request('app.available', { - 'onFailure': function(){ - self.checkAvailable.delay(1000, self); - self.fireEvent('unload'); - }, - 'onSuccess': function(){ - self.unBlockPage(); - self.fireEvent('load'); - } - }); + (function(){ + + Api.request('app.available', { + 'onFailure': function(){ + self.checkAvailable.delay(1000, self); + self.fireEvent('unload'); + }, + 'onSuccess': function(){ + self.unBlockPage(); + self.fireEvent('load'); + } + }); + + }).delay(delay || 0) }, - blockPage: function(message){ + blockPage: function(message, title){ var self = this; if(!self.mask){ var body = $(document.body); self.mask = new Spinner(document.body, { 'message': new Element('div').adopt( - new Element('h1', {'text': 'Unavailable.'}), + new Element('h1', {'text': title || 'Unavailable'}), new Element('div', {'text': message || 'Something must have crashed.. check the logs ;)'}) ) }); diff --git a/couchpotato/static/scripts/page/about.js b/couchpotato/static/scripts/page/about.js index d7767603..20ebcb22 100644 --- a/couchpotato/static/scripts/page/about.js +++ b/couchpotato/static/scripts/page/about.js @@ -85,10 +85,16 @@ var AboutSettingTab = new Class({ }).inject(self.content).adopt( new Element('dl.info').adopt( new Element('dt[text=Version]'), - self.version_text = new Element('dd', { + self.version_text = new Element('dd.version', { 'text': 'Getting version...', 'events': { - 'click': self.checkForUpdate.bind(self) + 'click': self.checkForUpdate.bind(self), + 'mouseenter': function(){ + this.set('text', 'Check for updates') + }, + 'mouseleave': function(){ + self.fillVersion(Updater.getInfo()) + } } }), new Element('dt[text=Directories]'), @@ -137,6 +143,9 @@ var AboutSettingTab = new Class({ Updater.check(function(json){ self.fillVersion(json) }) + + App.blockPage('Please wait. If this takes to long, something must have gone wrong.', 'Checking for updates'); + App.checkAvailable(3000); } }); diff --git a/couchpotato/static/style/page/settings.css b/couchpotato/static/style/page/settings.css index 9077f2b6..1821c412 100644 --- a/couchpotato/static/style/page/settings.css +++ b/couchpotato/static/style/page/settings.css @@ -532,6 +532,7 @@ margin: 0; font-style: italic; } + .page .tab_about .info dd.version { cursor: pointer; } .page .tab_about .group_actions > div { padding: 30px;