$(document).ready(function(){ if (typeof FileActions !== 'undefined') { // Add versions button to 'files/index.php' FileActions.register( 'file' , t('files_versions', 'Versions') , OC.PERMISSION_UPDATE , function() { // Specify icon for hitory button return OC.imagePath('core','actions/history'); } ,function(filename){ // Action to perform when clicked if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback var file = $('#dir').val()+'/'+filename; // Check if drop down is already visible for a different file if (($('#dropdown').length > 0) && $('#dropdown').hasClass('drop-versions') ) { if (file != $('#dropdown').data('file')) { $('#dropdown').hide('blind', function() { $('#dropdown').remove(); $('tr').removeClass('mouseOver'); createVersionsDropdown(filename, file); }); } } else { createVersionsDropdown(filename, file); } } ); } }); function goToVersionPage(url){ window.location.assign(url); } function createVersionsDropdown(filename, files) { var historyUrl = OC.linkTo('files_versions', 'history.php') + '?path='+encodeURIComponent( $( '#dir' ).val() ).replace( /%2F/g, '/' )+'/'+encodeURIComponent( filename ); var html = '