diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php new file mode 100644 index 0000000000..32aac10b71 --- /dev/null +++ b/apps/files_versions/ajax/getVersions.php @@ -0,0 +1,61 @@ + \ No newline at end of file diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php index b0aa8fdc98..05a5db55da 100644 --- a/apps/files_versions/history.php +++ b/apps/files_versions/history.php @@ -28,17 +28,22 @@ OC_Util::addStyle('files_versions','versions'); if ( isset( $_GET['path'] ) ) { $path = $_GET['path']; - $path = strip_tags( $path); + $path = strip_tags( $path ); // roll back to old version if button clicked if( isset( $_GET['revert'] ) ) { - \OCA_Versions\Storage::rollback( $path, $_GET['revert'] ); + + if( \OCA_Versions\Storage::rollback( $path, $_GET['revert'] ) ) { + + echo ""; + + } } // show the history only if there is something to show if( OCA_Versions\Storage::isversioned( $path ) ) { - $count=5; //show the newest revisions + $count=999; //show the newest revisions $versions=OCA_Versions\Storage::getversions( $path, $count); $tmpl = new OC_Template( 'files_versions', 'history', 'user' ); diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index 325ef823a9..a9e60a0cfa 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -9,29 +9,35 @@ $(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) { + } + } + }); + }); }); function createVersionsDropdown(filename, files) { var historyUrl = '../apps/files_versions/history.php?path='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename); - //alert( historyUrl ); + var html = '