summaryrefslogtreecommitdiffstats
path: root/settings/js/apps.js
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <JanCBorchardt@fsfe.org>2011-08-13 04:04:48 +0200
committerJan-Christoph Borchardt <JanCBorchardt@fsfe.org>2011-08-13 05:13:34 +0200
commit4a5ee765cf5030c7d92d88687e886079f6bafb1e (patch)
tree0b87acdf2f21f56dc1b97b063121899f3cae87bc /settings/js/apps.js
parent67156f87e3757fbd5e692e7d6b2209cfafc6c3cf (diff)
downloadnextcloud-server-4a5ee765cf5030c7d92d88687e886079f6bafb1e.tar.gz
nextcloud-server-4a5ee765cf5030c7d92d88687e886079f6bafb1e.zip
merged admin, help and settings to settings
Diffstat (limited to 'settings/js/apps.js')
-rw-r--r--settings/js/apps.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js
new file mode 100644
index 00000000000..069681e1cd1
--- /dev/null
+++ b/settings/js/apps.js
@@ -0,0 +1,38 @@
+$(document).ready(function(){
+ $('#leftcontent li').each(function(index,li){
+ var app=$.parseJSON($(this).children('span').text());
+ $(li).data('app',app);
+ });
+ $('#leftcontent li').click(function(){
+ var app=$(this).data('app');
+ $('#rightcontent p').show();
+ $('#rightcontent span.name').text(app.name);
+ $('#rightcontent span.version').text(app.version);
+ $('#rightcontent p.description').text(app.description);
+ $('#rightcontent span.author').text(app.author);
+ $('#rightcontent span.licence').text(app.licence);
+
+ $('#rightcontent input.enable').show();
+ $('#rightcontent input.enable').val((app.active)?t('admin','Disable'):t('admin','Enable'));
+ $('#rightcontent input.enable').data('appid',app.id);
+ $('#rightcontent input.enable').data('active',app.active);
+ });
+ $('#rightcontent input.enable').click(function(){
+ var app=$(this).data('appid');
+ var active=$(this).data('active');
+ if(app){
+ if(active){
+ $.post(OC.filePath('admin','ajax','disableapp.php'),{appid:app});
+ $('#leftcontent li[data-id="'+app+'"]').removeClass('active');
+ }else{
+ $.post(OC.filePath('admin','ajax','enableapp.php'),{appid:app});
+ $('#leftcontent li[data-id="'+app+'"]').addClass('active');
+ }
+ active=!active;
+ $(this).data('active',active);
+ $(this).val((active)?t('admin','Disable'):t('admin','Enable'));
+ var appData=$('#leftcontent li[data-id="'+app+'"]');
+ appData.active=active;
+ }
+ });
+});