|
|
@ -675,3 +675,71 @@ 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(); |
|
|
|