summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/js
diff options
context:
space:
mode:
authorSam Tuke <sam@donttravelempty.com>2012-05-11 13:17:37 +0100
committerSam Tuke <sam@donttravelempty.com>2012-05-15 18:21:51 +0100
commita00c5ac78ccbd581ba043d173d3f85aaf21b03dd (patch)
tree291e891f2012ea8ca3103595dd15da15eb587dce /apps/files_versions/js
parent2ad6b5048e05fd5c28600845bbabde3a3f4537f7 (diff)
downloadnextcloud-server-a00c5ac78ccbd581ba043d173d3f85aaf21b03dd.tar.gz
nextcloud-server-a00c5ac78ccbd581ba043d173d3f85aaf21b03dd.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.js47
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() {