aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/file-upload.js15
-rw-r--r--apps/files/js/fileactions.js2
-rw-r--r--apps/files/js/files.js14
-rw-r--r--apps/files/js/keyboardshortcuts.js6
4 files changed, 26 insertions, 11 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 0eddd7e9cd7..49e464b810a 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -1,6 +1,6 @@
$(document).ready(function() {
- file_upload_param = {
+ var file_upload_param = {
dropZone: $('#content'), // restrict dropZone to content div
//singleFileUploads is on by default, so the data.files array will always have length 1
add: function(e, data) {
@@ -142,7 +142,7 @@ $(document).ready(function() {
$('#uploadprogressbar').progressbar('value',100);
$('#uploadprogressbar').fadeOut();
}
- }
+ };
var file_upload_handler = function() {
$('#file_upload_start').fileupload(file_upload_param);
};
@@ -163,13 +163,14 @@ $(document).ready(function() {
// warn user not to leave the page while upload is in progress
$(window).bind('beforeunload', function(e) {
- if ($.assocArraySize(uploadingFiles) > 0)
+ if ($.assocArraySize(uploadingFiles) > 0) {
return t('files','File upload is in progress. Leaving the page now will cancel the upload.');
+ }
});
//add multiply file upload attribute to all browsers except konqueror (which crashes when it's used)
if(navigator.userAgent.search(/konqueror/i)==-1){
- $('#file_upload_start').attr('multiple','multiple')
+ $('#file_upload_start').attr('multiple','multiple');
}
//if the breadcrumb is to long, start by replacing foldernames with '...' except for the current folder
@@ -302,8 +303,7 @@ $(document).ready(function() {
}
localName = getUniqueName(localName);
//IE < 10 does not fire the necessary events for the progress bar.
- if($('html.lte9').length > 0) {
- } else {
+ if($('html.lte9').length === 0) {
$('#uploadprogressbar').progressbar({value:0});
$('#uploadprogressbar').fadeIn();
}
@@ -311,8 +311,7 @@ $(document).ready(function() {
var eventSource=new OC.EventSource(OC.filePath('files','ajax','newfile.php'),{dir:$('#dir').val(),source:name,filename:localName});
eventSource.listen('progress',function(progress){
//IE < 10 does not fire the necessary events for the progress bar.
- if($('html.lte9').length > 0) {
- } else {
+ if($('html.lte9').length === 0) {
$('#uploadprogressbar').progressbar('value',progress);
}
});
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 5027211b536..097fe521aa6 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -198,7 +198,7 @@ FileActions.register('all', 'Rename', OC.PERMISSION_UPDATE, function () {
FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) {
- var dir = $('#dir').val()
+ var dir = $('#dir').val();
if (dir !== '/') {
dir = dir + '/';
}
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index e1c53184dd1..4eb949c2eef 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -81,9 +81,23 @@ Files={
if (usedSpacePercent > 90) {
OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)', {usedSpacePercent: usedSpacePercent}));
}
+ },
+
+ displayEncryptionWarning: function() {
+
+ if (!OC.Notification.isHidden()) {
+ return;
+ }
+
+ var encryptedFiles = $('#encryptedFiles').val();
+ 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;
+ }
}
};
$(document).ready(function() {
+ Files.displayEncryptionWarning();
Files.bindKeyboardShortcuts(document, jQuery);
$('#fileList tr').each(function(){
//little hack to set unescape filenames in attribute
diff --git a/apps/files/js/keyboardshortcuts.js b/apps/files/js/keyboardshortcuts.js
index cc2b5d42139..9d6c3ae8c33 100644
--- a/apps/files/js/keyboardshortcuts.js
+++ b/apps/files/js/keyboardshortcuts.js
@@ -131,7 +131,9 @@ var Files = Files || {};
return;
}
var preventDefault = false;
- if ($.inArray(event.keyCode, keys) === -1) keys.push(event.keyCode);
+ if ($.inArray(event.keyCode, keys) === -1) {
+ keys.push(event.keyCode);
+ }
if (
$.inArray(keyCodes.n, keys) !== -1 && ($.inArray(keyCodes.cmdFirefox, keys) !== -1 || $.inArray(keyCodes.cmdOpera, keys) !== -1 || $.inArray(keyCodes.leftCmdWebKit, keys) !== -1 || $.inArray(keyCodes.rightCmdWebKit, keys) !== -1 || $.inArray(keyCodes.ctrl, keys) !== -1 || event.ctrlKey)) {
preventDefault = true; //new file/folder prevent browser from responding
@@ -165,4 +167,4 @@ var Files = Files || {};
removeA(keys, event.keyCode);
});
};
-})(Files); \ No newline at end of file
+})(Files);