Some more info in About tab
This commit is contained in:
@@ -31,6 +31,10 @@ var CouchPotato = new Class({
|
||||
|
||||
self.c.addEvent('click:relay(a:not([target=_blank]))', self.pushState.bind(self));
|
||||
},
|
||||
|
||||
getOption: function(name){
|
||||
return this.options[name];
|
||||
},
|
||||
|
||||
pushState: function(e){
|
||||
var self = this;
|
||||
|
||||
@@ -25,7 +25,7 @@ var AboutSettingTab = new Class({
|
||||
|
||||
self.createAbout();
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
@@ -39,6 +39,16 @@ var AboutSettingTab = new Class({
|
||||
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',
|
||||
@@ -92,5 +102,5 @@ var AboutSettingTab = new Class({
|
||||
});
|
||||
|
||||
window.addEvent('domready', function(){
|
||||
window.About = new AboutSettingTab();
|
||||
new AboutSettingTab();
|
||||
});
|
||||
@@ -675,71 +675,3 @@ Option.Directory = new Class({
|
||||
return self.input.get('text');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
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();
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Profiles
|
||||
*/
|
||||
createAbout: function(){
|
||||
var self = this;
|
||||
|
||||
var non_core_profiles = Object.filter(self.profiles, function(profile){ return !profile.isCore() });
|
||||
var count = Object.getLength(non_core_profiles);
|
||||
|
||||
self.settings.createGroup({
|
||||
'label': 'About CouchPotato'
|
||||
}).inject(self.content).adopt(
|
||||
new Element('a.button.red', {
|
||||
'text': 'Shutdown',
|
||||
'events': {
|
||||
'click': function(){
|
||||
Api.request('app.shutdown');
|
||||
}
|
||||
}
|
||||
}),
|
||||
new Element('a.button.orange', {
|
||||
'text': 'Restart',
|
||||
'events': {
|
||||
'click': function(){
|
||||
Api.request('app.restart');
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
window.About = new AboutSettingTab();
|
||||
|
||||
Reference in New Issue
Block a user