var AboutSettingTab = new Class({ tab: '', content: '', initialize: function(){ var self = this; App.addEvent('load', self.addSettings.bind(self)) }, addSettings: function(){ var self = this; self.settings = App.getPage('Settings') self.settings.addEvent('create', function(){ var tab = self.settings.createTab('about', { 'label': 'About', 'name': 'about' }); self.tab = tab.tab; self.content = tab.content; self.createAbout(); }); }, createAbout: function(){ var self = this; var millennium = new Date(2008, 7, 16), today = new Date(), one_day = 1000*60*60*24; self.settings.createGroup({ 'label': 'About CouchPotato' }).inject(self.content).adopt( new Element('dl.info').adopt( new Element('dt[text=Version]'), new Element('dd', {'text': Updater.info()}), new Element('dt[text=Directories]'), new Element('dd', {'text': App.getOption('app_dir')}), new Element('dd', {'text': App.getOption('data_dir')}), new Element('dt[text=Startup Args]'), new Element('dd', {'text': App.getOption('args')}), new Element('dd', {'html': App.getOption('options')}) ), new Element('div.shutdown').adopt( new Element('a.button.red', { 'text': 'Shutdown', 'events': { 'click': App.shutdown.bind(App) } }), new Element('a.button.orange', { 'text': 'Restart', 'events': { 'click': App.restart.bind(App) } }) ), new Element('div.usenet').adopt( new Element('span', { 'text': 'Help support CouchPotato and save some money for yourself by signing up for an account at' }), new Element('a', { 'href': 'https://usenetserver.com/partners/?a_aid=couchpotato&a_bid=3f357c6f', 'text': 'UsenetServer' }), new Element('a', { 'href': 'http://www.newshosting.com/partners/?a_aid=couchpotato&a_bid=a0b022df', 'text': 'Newshosting' }), new Element('span', { 'text': 'For as low as $7.95 per month, you’ll get:' }), new Element('ul').adopt( new Element('li[text=Unlimited downloads]'), new Element('li[text=Uncapped speeds]'), new Element('li[text=Free SSL Encrypted connections]'), new Element('li', { 'text': Math.ceil((today.getTime()-millennium.getTime())/(one_day))+" days retention" }) ) ), new Element('div.donate', { 'html': '
' + '' + '' + '' + '
' + 'I\'m building CouchPotato in my spare time, so if you want to buy me a Pepsi while I\'m coding, that would be awesome!' }) ); } }); window.addEvent('domready', function(){ new AboutSettingTab(); });