$(document).ready(function(){ // Add history button to files/index.php 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) { // 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 }; } }); }); }); function createVersionsDropdown(filename, files) { var historyUrl = '../apps/files_versions/history.php?path='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename); //alert( historyUrl ); var html = '