},
isFileNameValid:function (name) {
if (name === '.') {
- $('#notification').text(t('files', '\'.\' is an invalid file name.'));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files', '\'.\' is an invalid file name.'));
return false;
}
if (name.length == 0) {
- $('#notification').text(t('files', 'File name cannot be empty.'));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files', 'File name cannot be empty.'));
return false;
}
return false;
}
}
- OC.Notification.hide();
+ OC.Notification.hide();
return true;
},
displayStorageWarnings: function() {
var usedSpacePercent = $('#usedSpacePercent').val();
if (usedSpacePercent > 98) {
- OC.Notification.show(t('files', 'Your storage is full, files can not be updated or synced anymore!'));
- return;
+ OC.Notification.show(t('files', 'Your storage is full, files can not be updated or synced anymore!'));
+ return;
}
if (usedSpacePercent > 90) {
- OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)', {usedSpacePercent: usedSpacePercent}));
+ OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)', {usedSpacePercent: usedSpacePercent}));
}
}
};
$('.download').click('click',function(event) {
var files=getSelectedFiles('name').join(';');
var dir=$('#dir').val()||'/';
- OC.Notification.show(t('files','generating ZIP-file, it may take some time.'));
+ OC.Notification.show(t('files','generating ZIP-file, it may take some time.'));
// use special download URL if provided, e.g. for public shared files
if ( (downloadURL = document.getElementById("downloadURL")) ) {
window.location=downloadURL.value+"&download&files="+files;
uploadtext.text(t('files', '{count} files uploading', {count: currentUploads}));
}
delete uploadingFiles[dirName][fileName];
- OC.Notification.show(t('files', 'Upload cancelled.'));
+ OC.Notification.show(t('files', 'Upload cancelled.'));
}
});
//TODO test with filenames containing slashes
FileList.loadingDone(file.name, file.id);
} else {
Files.cancelUpload(this.files[0].name);
- OC.Notification.show(t('files', response.data.message));
+ OC.Notification.show(t('files', response.data.message));
$('#fileList > tr').not('[data-mime]').fadeOut();
$('#fileList > tr').not('[data-mime]').remove();
}
.error(function(jqXHR, textStatus, errorThrown) {
if(errorThrown === 'abort') {
Files.cancelUpload(this.files[0].name);
- OC.Notification.show(t('files', 'Upload cancelled.'));
+ OC.Notification.show(t('files', 'Upload cancelled.'));
}
});
uploadingFiles[uniqueName] = jqXHR;
FileList.loadingDone(file.name, file.id);
} else {
//TODO Files.cancelUpload(/*where do we get the filename*/);
- OC.Notification.show(t('files', response.data.message));
+ OC.Notification.show(t('files', response.data.message));
$('#fileList > tr').not('[data-mime]').fadeOut();
$('#fileList > tr').not('[data-mime]').remove();
}
} else if (type != 'web' && !Files.isFileNameValid(newname)) {
return false;
} else if( type == 'folder' && $('#dir').val() == '/' && newname == 'Shared') {
- OC.Notification.show(t('files','Invalid folder name. Usage of \'Shared\' is reserved by Owncloud'));
+ OC.Notification.show(t('files','Invalid folder name. Usage of \'Shared\' is reserved by Owncloud'));
return false;
}
if (FileList.lastAction) {
resizeBreadcrumbs(true);
- // display storage warnings
- setTimeout ( "Files.displayStorageWarnings()", 100 );
- OC.Notification.setDefault(Files.displayStorageWarnings);
+ // display storage warnings
+ setTimeout ( "Files.displayStorageWarnings()", 100 );
+ OC.Notification.setDefault(Files.displayStorageWarnings);
});
function scanFiles(force,dir){