diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-09 17:53:57 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-09 17:53:57 +0200 |
commit | 926b3c9b7be2c3f0d71a64a60006d373f689da39 (patch) | |
tree | 20957e2f0454879f73da01d0dea131cb702f3632 /apps/files/js | |
parent | 48b5c1d5f934fb4f6c58bf196b81ee8089217e52 (diff) | |
parent | 223adc3167d82d8bcd88b19aae78b1da2773e729 (diff) | |
download | nextcloud-server-926b3c9b7be2c3f0d71a64a60006d373f689da39.tar.gz nextcloud-server-926b3c9b7be2c3f0d71a64a60006d373f689da39.zip |
Merge branch 'master' into activities-api
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/file-upload.js | 20 | ||||
-rw-r--r-- | apps/files/js/fileactions.js | 15 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 10 | ||||
-rw-r--r-- | apps/files/js/files.js | 31 |
4 files changed, 29 insertions, 47 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index b52221ac1fc..f1ef485fc3d 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -42,26 +42,6 @@ function supportAjaxUploadWithProgress() { OC.Upload = { _uploads: [], /** - * cancels a single upload, - * @deprecated because it was only used when a file currently beeing uploaded was deleted. Now they are added after - * they have been uploaded. - * @param {string} dir - * @param {string} filename - * @returns {unresolved} - */ - cancelUpload:function(dir, filename) { - var self = this; - var deleted = false; - //FIXME _selections - jQuery.each(this._uploads, function(i, jqXHR) { - if (selection.dir === dir && selection.uploads[filename]) { - deleted = self.deleteSelectionUpload(selection, filename); - return false; // end searching through selections - } - }); - return deleted; - }, - /** * deletes the jqHXR object from a data selection * @param {object} data */ diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 67d3d5ead8d..e14e52eb6ca 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -177,20 +177,7 @@ $(document).ready(function () { FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () { return OC.imagePath('core', 'actions/delete'); }, function (filename) { - if (OC.Upload.cancelUpload($('#dir').val(), filename)) { - if (filename.substr) { - filename = [filename]; - } - $.each(filename, function (index, file) { - var filename = $('tr').filterAttr('data-file', file); - filename.hide(); - filename.find('input[type="checkbox"]').removeAttr('checked'); - filename.removeClass('selected'); - }); - procesSelection(); - } else { - FileList.do_delete(filename); - } + FileList.do_delete(filename); $('.tipsy').remove(); }); diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 4fc1b95a0ab..a9297996778 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -804,7 +804,7 @@ $(document).ready(function(){ data.context.attr('data-mime',file.mime).attr('data-id',file.id); var permissions = data.context.data('permissions'); - if(permissions != file.permissions) { + if(permissions !== file.permissions) { data.context.attr('data-permissions', file.permissions); data.context.data('permissions', file.permissions); } @@ -895,6 +895,10 @@ $(document).ready(function(){ $(window).trigger('beforeunload'); }); + function decodeQuery(query){ + return query.replace(/\+/g, ' '); + } + function parseHashQuery(){ var hash = window.location.hash, pos = hash.indexOf('?'), @@ -911,11 +915,11 @@ $(document).ready(function(){ dir = '/'; // try and parse from URL hash first if (query){ - params = OC.parseQueryString(query); + params = OC.parseQueryString(decodeQuery(query)); } // else read from query attributes if (!params){ - params = OC.parseQueryString(location.search); + params = OC.parseQueryString(decodeQuery(location.search)); } return (params && params.dir) || '/'; } diff --git a/apps/files/js/files.js b/apps/files/js/files.js index ec688eaf63e..37b66858840 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -63,6 +63,15 @@ Files={ } var encryptedFiles = $('#encryptedFiles').val(); + var initStatus = $('#encryptionInitStatus').val(); + if (initStatus === '0') { // enc not initialized, but should be + OC.Notification.show(t('files_encryption', 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again')); + return; + } + if (initStatus === '1') { // encryption tried to init but failed + OC.Notification.showHtml(t('files_encryption', 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.')); + return; + } if (encryptedFiles === '1') { OC.Notification.show(t('files_encryption', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.')); return; @@ -89,6 +98,8 @@ Files={ lastWidth: 0, initBreadCrumbs: function () { + var $controls = $('#controls'); + Files.lastWidth = 0; Files.breadcrumbs = []; @@ -109,7 +120,10 @@ Files={ }); // event handlers for breadcrumb items - $('#controls .crumb a').on('click', onClickBreadcrumb); + $controls.find('.crumb a').on('click', onClickBreadcrumb); + + // setup drag and drop + $controls.find('.crumb:not(.last)').droppable(crumbDropOptions); }, resizeBreadcrumbs: function (width, firstRun) { @@ -167,11 +181,8 @@ $(document).ready(function() { $('#file_action_panel').attr('activeAction', false); - $('div.crumb:not(.last)').droppable(crumbDropOptions); - $('ul#apps>li:first-child').data('dir',''); - if($('div.crumb').length){ - $('ul#apps>li:first-child').droppable(crumbDropOptions); - } + // allow dropping on the "files" app icon + $('ul#apps li:first-child').data('dir','').droppable(crumbDropOptions); // Triggers invisible file input $('#upload a').on('click', function() { @@ -358,7 +369,7 @@ $(document).ready(function() { } }); } - + //scroll to and highlight preselected file if (getURLParameter('scrollto')) { FileList.scrollTo(getURLParameter('scrollto')); @@ -636,7 +647,7 @@ function lazyLoadPreview(path, mime, ready, width, height) { // get mime icon url getMimeIcon(mime, function(iconURL) { ready(iconURL); // set mimeicon URL - + // now try getting a preview thumbnail URL if ( ! width ) { width = $('#filestable').data('preview-x'); @@ -645,9 +656,9 @@ function lazyLoadPreview(path, mime, ready, width, height) { height = $('#filestable').data('preview-y'); } if( $('#publicUploadButtonMock').length ) { - var previewURL = OC.Router.generate('core_ajax_public_preview', {file: encodeURIComponent(path), x:width, y:height, t:$('#dirToken').val()}); + var previewURL = OC.Router.generate('core_ajax_public_preview', {file: path, x:width, y:height, t:$('#dirToken').val()}); } else { - var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height}); + var previewURL = OC.Router.generate('core_ajax_preview', {file: path, x:width, y:height}); } $.get(previewURL, function() { previewURL = previewURL.replace('(', '%28'); |