diff options
author | Sam Tuke <sam@donttravelempty.com> | 2012-05-11 13:17:37 +0100 |
---|---|---|
committer | Sam Tuke <sam@donttravelempty.com> | 2012-05-11 13:17:37 +0100 |
commit | 03fad9776427e4fad1615dc0d76d26b1efc7c421 (patch) | |
tree | b662bfbbe5bc141c34386465f1649790c468c482 /apps/files_versions/js | |
parent | 61d535984df81d5531350cd7895769793722d69e (diff) | |
download | nextcloud-server-03fad9776427e4fad1615dc0d76d26b1efc7c421.tar.gz nextcloud-server-03fad9776427e4fad1615dc0d76d26b1efc7c421.zip |
fixed some include path issues
imroved wording of history page revert instructions
cleaned up js call to ajax getVersions.php
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() { |