summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorSam Tuke <samtuke@owncloud.com>2012-06-21 14:53:58 +0100
committerSam Tuke <samtuke@owncloud.com>2012-06-21 14:54:24 +0100
commit7c3f6f61db5b93c3393ab4b3b99c3e6906ed27be (patch)
tree107c613d2edcc314036d08cae680bf1eccb53650 /apps/files_versions
parentf5740a6f925ddcd78a563ab38db88f05d6a77317 (diff)
downloadnextcloud-server-7c3f6f61db5b93c3393ab4b3b99c3e6906ed27be.tar.gz
nextcloud-server-7c3f6f61db5b93c3393ab4b3b99c3e6906ed27be.zip
Fixed missing jQuery event object - expire interface now works with Firefox
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/js/settings-personal.js78
1 files changed, 33 insertions, 45 deletions
diff --git a/apps/files_versions/js/settings-personal.js b/apps/files_versions/js/settings-personal.js
index d9456f3f2af..6ea8c1a950f 100644
--- a/apps/files_versions/js/settings-personal.js
+++ b/apps/files_versions/js/settings-personal.js
@@ -1,51 +1,39 @@
-// $(document).ready(function(){
-// $('#versions').change( function(){
-// OC.msg.startSaving('#calendar .msg')
-// // Serialize the data
-// var post = $( '#timezone' ).serialize();
-// $.post( OC.filePath('calendar', 'ajax/settings', 'settimezone.php'), post, function(data){
-// //OC.msg.finishedSaving('#calendar .msg', data);
-// });
-// return false;
-// });
-// });
+// TODO: allow the button to be clicked only once
-$(document).ready(function(){
+$( document ).ready(function(){
//
- $('#expireAllBtn').click(function(){
+ $( '#expireAllBtn' ).click(
- // Prevent page from reloading
- event.preventDefault();
+ function( event ) {
- // Show loading gif
- $('.expireAllLoading').show();
-
- $.getJSON(
- OC.filePath('files_versions','ajax','expireAll.php'),
- function(result){
- if (result.status == 'success') {
- $('.expireAllLoading').hide();
- $('#expireAllBtn').html('Expiration successful');
- } else {
-
- // Cancel loading
- $('#expireAllBtn').html('Expiration failed');
-
- // Show Dialog
- OC.dialogs.alert(
- 'Something went wrong, your files may not have been expired',
- 'An error has occurred',
- function(){
- $('#expireAllBtn').html(t('files_versions', 'Expire all versions')+'<img style="display: none;" class="loading" src="'+OC.filePath('core','img','loading.gif')+'" />');
- }
-
- );
-
- }
- }
+ // Prevent page from reloading
+ event.preventDefault();
- );
-
- });
-
+ // Show loading gif
+ $('.expireAllLoading').show();
+
+ $.getJSON(
+ OC.filePath('files_versions','ajax','expireAll.php'),
+ function(result){
+ if (result.status == 'success') {
+ $('.expireAllLoading').hide();
+ $('#expireAllBtn').html('Expiration successful');
+ } else {
+
+ // Cancel loading
+ $('#expireAllBtn').html('Expiration failed');
+
+ // Show Dialog
+ OC.dialogs.alert(
+ 'Something went wrong, your files may not have been expired',
+ 'An error has occurred',
+ function(){
+ $('#expireAllBtn').html(t('files_versions', 'Expire all versions')+'<img style="display: none;" class="loading" src="'+OC.filePath('core','img','loading.gif')+'" />');
+ }
+ );
+ }
+ }
+ );
+ }
+ );
}); \ No newline at end of file