diff options
Diffstat (limited to 'apps/files_versions/js')
-rw-r--r-- | apps/files_versions/js/versions.js | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index 0508ab4cdec..2c92dfa3c65 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -14,28 +14,17 @@ $(document).ready(function(){ FileActions.register('file','History',function(){return OC.imagePath('core','actions/history')},function(filename){ if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback - + var file = $('#dir').val()+'/'+filename; createVersionsDropdown(filename, file) - $.ajax({ - type: 'GET', - url: OC.linkTo('files_versions', 'ajax/getVersions.php'), - dataType: 'json', - data: {source: file}, - async: false, - success: function(versions) { - if (versions) { - } - } - }); - }); } }); function createVersionsDropdown(filename, files) { + var historyUrl = '../apps/files_versions/history.php?path='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename); var html = '<div id="dropdown" class="drop" data-file="'+files+'">'; @@ -56,24 +45,26 @@ function createVersionsDropdown(filename, files) { $(html).appendTo($('thead .share')); } -// $.getJSON(OC.linkTo('files_sharing', 'ajax/userautocomplete.php'), function(users) { -// if (users) { -// $.each(users, function(index, row) { -// $(row).appendTo('#share_with'); -// }); -// $('#share_with').trigger('liszt:updated'); -// } -// }); - $.getJSON(OC.linkTo('files_versions', 'ajax/getVersions.php'), { source: files }, function(versions) { - if (versions) { + $.ajax({ + type: 'GET', + url: OC.linkTo('files_versions', 'ajax/getVersions.php'), + dataType: 'json', + data: { source: files }, + async: false, + success: function( versions ) { + + //alert("helo "+OC.linkTo('files_versions', 'ajax/getVersions.php')); - $.each( versions, function(index, row ) { - - addVersion( row ); - }); + if (versions) { + + $.each( versions, function(index, row ) { + + addVersion( row ); + }); + + } } - }); function revertFile() { |