From c693ee2adb1b8b251d7905791eeca0946c31c68b Mon Sep 17 00:00:00 2001 From: Sam Tuke Date: Thu, 26 Apr 2012 16:48:43 +0100 Subject: added available version names to files dropdown menu via new ajax script --- apps/files_versions/js/versions.js | 89 ++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 28 deletions(-) (limited to 'apps/files_versions/js') diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index 325ef823a9c..5018b75f154 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -9,9 +9,28 @@ $(document).ready(function(){ createVersionsDropdown(filename, file) - //window.location='../apps/files_versions/history.php?path='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename); - - + $.ajax({ + type: 'GET', + url: OC.linkTo('files_versions', 'ajax/getVersions.php'), + dataType: 'json', + data: {source: file}, + async: false, + success: function(versions) { + if (versions) { + + // icon = OC.imagePath('core', 'actions/shared'); + // $.each(users, function(index, row) { + // if (row.uid_shared_with == 'public') { + // icon = OC.imagePath('core', 'actions/public'); + // } + // }); + // } else { + // icon = OC.imagePath('core', 'actions/share'); + } + shared_status[file]= { timestamp: new Date().getTime(), icon: icon }; + } + }); + }); }); @@ -21,17 +40,14 @@ function createVersionsDropdown(filename, files) { //alert( historyUrl ); var html = '