summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorSam Tuke <sam@donttravelempty.com>2012-04-25 17:37:45 +0100
committerSam Tuke <sam@donttravelempty.com>2012-04-25 17:37:45 +0100
commitc00762b49b46019e47963b91185b7c131bdd3f87 (patch)
treecc386e0cb95e74cbc7065366c35cac7b698fdf3e /apps/files_versions
parent7d9587bab339fac0f8789d57180520a7d8e0a85c (diff)
downloadnextcloud-server-c00762b49b46019e47963b91185b7c131bdd3f87.tar.gz
nextcloud-server-c00762b49b46019e47963b91185b7c131bdd3f87.zip
added dropdown js menu for file versions, improved readability of history.php
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/history.php2
-rw-r--r--apps/files_versions/js/versions.js60
2 files changed, 60 insertions, 2 deletions
diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php
index 7f03ce0e694..312cc734323 100644
--- a/apps/files_versions/history.php
+++ b/apps/files_versions/history.php
@@ -35,7 +35,7 @@ if ( isset( $_GET['path'] ) ) {
}
// show the history only if there is something to show
- if( OCA_Versions\Storage::isversioned( $path) ) {
+ if( OCA_Versions\Storage::isversioned( $path ) ) {
$count=5; //show the newest revisions
$versions=OCA_Versions\Storage::getversions( $path, $count);
diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js
index 19838cf6ad8..74a7c85070c 100644
--- a/apps/files_versions/js/versions.js
+++ b/apps/files_versions/js/versions.js
@@ -2,8 +2,66 @@ $(document).ready(function(){
// Add history button to files/index.php
FileActions.register('file','History',function(){return OC.imagePath('core','actions/history')},function(filename){
- window.location='../apps/files_versions/history.php?path='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+
+ if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
+
+ var file = $('#dir').val()+'/'+filename;
+
+ createDropdown(filename, file)
+
+ //window.location='../apps/files_versions/history.php?path='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+
+
});
});
+function createDropdown(filename, files) {
+
+ var html = '<div id="dropdown" class="drop" data-file="'+files+'">';
+ html += '<div id="private">';
+ html += '<select data-placeholder="File Version" id="share_with" class="chzen-select">';
+ html += '<option value=""></option>';
+ html += '</select>';
+ html += '<ul id="shared_list"></ul>';
+ html += '</div>';
+ html += '<div id="public">';
+ html += '<input type="button" name="makelink" id="makelink" value="Revert file" />';
+ html += '<input type="button" name="makelink" id="makelink" value="More..." />';
+ //html += '<input type="checkbox" name="public_link_write" id="public_link_write" value="1" /><label for="public_link_write">allow upload</label>';
+ html += '<br />';
+ html += '<input id="link" style="display:none; width:90%;" />';
+ html += '</div>';
+
+ if (filename) {
+ $('tr').filterAttr('data-file',filename).addClass('mouseOver');
+ $(html).appendTo($('tr').filterAttr('data-file',filename).find('td.filename'));
+ } else {
+ $(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_sharing', 'ajax/getitem.php'), { source: files }, function(users) {
+// if (users) {
+// $.each(users, function(index, row) {
+// if (row.uid_shared_with == 'public') {
+// showPublicLink(row.token, '/'+filename);
+// } else if (isNaN(index)) {
+// addUser(row.uid_shared_with, row.permissions, index.substr(0, index.lastIndexOf('-')));
+// } else {
+// addUser(row.uid_shared_with, row.permissions, false);
+// }
+// });
+// }
+// });
+
+ $('#dropdown').show('blind');
+ $('#share_with').chosen();
+
+} \ No newline at end of file