diff options
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/admin.js | 4 | ||||
-rw-r--r-- | settings/js/apps.js | 15 | ||||
-rw-r--r-- | settings/js/log.js | 20 | ||||
-rw-r--r-- | settings/js/personal.js | 4 |
4 files changed, 36 insertions, 7 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js index a3585f7e1c2..4f295ab6f5d 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -1,5 +1,7 @@ $(document).ready(function(){ $('#loglevel').change(function(){ - $.post(OC.filePath('settings','ajax','setloglevel.php'), { level: $(this).val() } ); + $.post(OC.filePath('settings','ajax','setloglevel.php'), { level: $(this).val() },function(){ + OC.Log.reload(); + } ); }) });
\ No newline at end of file diff --git a/settings/js/apps.js b/settings/js/apps.js index e2f882c6fec..df5300911aa 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -13,8 +13,11 @@ $(document).ready(function(){ var app=$(this).data('app'); $('#rightcontent p').show(); $('#rightcontent span.name').text(app.name); + $('#rightcontent small.externalapp').text(app.internallabel); $('#rightcontent span.version').text(app.version); $('#rightcontent p.description').text(app.description); + $('#rightcontent img.preview').attr('src',app.preview); + $('#rightcontent small.externalapp').attr('style','visibility:visible'); $('#rightcontent span.author').text(app.author); $('#rightcontent span.licence').text(app.licence); @@ -28,10 +31,18 @@ $(document).ready(function(){ var active=$(this).data('active'); if(app){ if(active){ - $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:app}); + $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:app},function(result){ + if(!result || result.status!='success'){ + OC.dialogs.alert('Error','Error while disabling app'); + } + },'json'); $('#leftcontent li[data-id="'+app+'"]').removeClass('active'); }else{ - $.post(OC.filePath('settings','ajax','enableapp.php'),{appid:app}); + $.post(OC.filePath('settings','ajax','enableapp.php'),{appid:app},function(result){ + if(!result || result.status!='success'){ + OC.dialogs.alert('Error','Error while enabling app'); + } + },'json'); $('#leftcontent li[data-id="'+app+'"]').addClass('active'); } active=!active; diff --git a/settings/js/log.js b/settings/js/log.js index ae83f0a6283..6063c7d9a9f 100644 --- a/settings/js/log.js +++ b/settings/js/log.js @@ -5,15 +5,26 @@ */ OC.Log={ + reload:function(count){ + if(!count){ + count=OC.Log.loaded; + } + OC.Log.loaded=0; + $('#log tbody').empty(); + OC.Log.getMore(count); + }, levels:['Debug','Info','Warning','Error','Fatal'], - loaded:50,//are initially loaded - getMore:function(){ - $.get(OC.filePath('settings','ajax','getlog.php'),{offset:OC.Log.loaded},function(result){ + loaded:3,//are initially loaded + getMore:function(count){ + if(!count){ + count=10; + } + $.get(OC.filePath('settings','ajax','getlog.php'),{offset:OC.Log.loaded,count:count},function(result){ if(result.status=='success'){ OC.Log.addEntries(result.data); + $('html, body').animate({scrollTop: $(document).height()}, 800); } }); - OC.Log.loaded+=50; }, addEntries:function(entries){ for(var i=0;i<entries.length;i++){ @@ -36,6 +47,7 @@ OC.Log={ row.append(timeTd); $('#log').append(row); } + OC.Log.loaded += entries.length; } } diff --git a/settings/js/personal.js b/settings/js/personal.js index 8108da433c8..77d103c53b6 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -33,7 +33,11 @@ $(document).ready(function(){ }); $('#lostpassword #email').blur(function(event){ + if ($(this).val() == this.defaultValue){ + return; + } event.preventDefault(); + this.defaultValue = $(this).val(); OC.msg.startSaving('#lostpassword .msg'); var post = $( "#lostpassword" ).serialize(); $.post( 'ajax/lostpassword.php', post, function(data){ |