From fb462e83ccde5c46565c23545c5eb894acbd6fd3 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 6 Sep 2013 12:27:40 +0200 Subject: no longer enforce log out, but provide useful errors/warnings instead --- apps/files/js/files.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apps/files/js') diff --git a/apps/files/js/files.js b/apps/files/js/files.js index d729077ea72..63c3544b53d 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -90,6 +90,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.show(t('files_encryption', 'Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can 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; -- cgit v1.2.3 From 1962bed261c0124e2d0372bb093c16a510a8f102 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 20 Sep 2013 21:52:40 +0200 Subject: Replace plus sign with space in files app URL #4932 Some apps create URLs to the files app and encode the spaces of a directory using plus signs. This fix ensures that plus signs are properly converted back to spaces when parsing the URL on the JS side. --- apps/files/js/filelist.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'apps/files/js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 4fc1b95a0ab..3c99e3876c7 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -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) || '/'; } -- cgit v1.2.3 From 9d2595a7c59048fc6ed3777a888e03d43a8f03f9 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 4 Oct 2013 11:11:24 +0200 Subject: Shortened notification message that was too long The message for invalid private key was too long and didn't fit in the notification box. This fix reduces the message to fit properly by removing the extra information. --- apps/files/js/files.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files/js') diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 55ee89e17a2..899bc6469e5 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -69,7 +69,7 @@ Files={ return; } if (initStatus === '1') { // encryption tried to init but failed - OC.Notification.show(t('files_encryption', 'Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.')); + 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') { -- cgit v1.2.3 From 6a4563f203d8decb07bee3a82e111d876255e516 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 7 Oct 2013 11:07:33 +0200 Subject: Fix breadcrumb to reinit dnd after ajax nav #5064 Now correctly reinitializing the breadcrumb drop zone after ajax navigation. This also fixes dropping onto the "files" app icon. --- apps/files/js/files.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'apps/files/js') diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 899bc6469e5..53858d65c65 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -98,6 +98,8 @@ Files={ lastWidth: 0, initBreadCrumbs: function () { + var $controls = $('#controls'); + Files.lastWidth = 0; Files.breadcrumbs = []; @@ -118,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) { @@ -176,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() { -- cgit v1.2.3 From 8899543b7f69ae831db09e29955b4365317c6235 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Fri, 20 Sep 2013 14:28:33 +0200 Subject: use !== comparison --- apps/files/js/filelist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files/js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 3c99e3876c7..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); } -- cgit v1.2.3 From 0683372200aaf989b596e34a9864cd0c6dd980a8 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Fri, 20 Sep 2013 14:58:52 +0200 Subject: canceling individual uploads is currently impossible because there is no placeholder --- apps/files/js/file-upload.js | 20 -------------------- apps/files/js/fileactions.js | 15 +-------------- 2 files changed, 1 insertion(+), 34 deletions(-) (limited to 'apps/files/js') 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 @@ -41,26 +41,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(); }); -- cgit v1.2.3 From 4ccbace68df0150cdadaa8e680a7cb2639e8c628 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Fri, 20 Sep 2013 14:59:17 +0200 Subject: remove double uri encoding --- apps/files/js/files.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/files/js') diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 899bc6469e5..bffb354fce6 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -367,7 +367,7 @@ $(document).ready(function() { } }); } - + //scroll to and highlight preselected file if (getURLParameter('scrollto')) { FileList.scrollTo(getURLParameter('scrollto')); @@ -645,7 +645,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'); @@ -654,9 +654,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'); -- cgit v1.2.3