[Pkg-owncloud-commits] [owncloud] 272/394: minor whitespace & allow special translation for wrong urls

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:12:24 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit 07b589cf5f3ed7a3ccbd6cbd9f38776b58329c67
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date:   Mon Jan 7 17:25:19 2013 +0100

    minor whitespace & allow special translation for wrong urls
---
 apps/files/js/filelist.js |    2 +-
 apps/files/js/files.js    |   38 +++++++++++++++++---------------------
 2 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index a4cb3e6..582864a 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -149,7 +149,7 @@ var FileList={
 			var newname=input.val();
 			if (!Files.isFileNameValid(newname)) {
 				return false;
-            }
+			}
 			if (newname != name) {
 				if (FileList.checkName(name, newname, false)) {
 					newname = name;
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 59b94f0..beaab7a 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -26,19 +26,19 @@ Files={
 		});
 		procesSelection();
 	},
-    isFileNameValid:function (name) {
-        if (name === '.') {
-            $('#notification').text(t('files', "'.' is an invalid file name."));
-            $('#notification').fadeIn();
-            return false;
-        }
-        if (name.length == 0) {
-            $('#notification').text(t('files', "File name cannot be empty."));
-            $('#notification').fadeIn();
-            return false;
-        }
-
-        // check for invalid characters
+	isFileNameValid:function (name) {
+		if (name === '.') {
+			$('#notification').text(t('files', '\'.\' is an invalid file name.'));
+			$('#notification').fadeIn();
+			return false;
+		}
+		if (name.length == 0) {
+			$('#notification').text(t('files', 'File name cannot be empty.'));
+			$('#notification').fadeIn();
+			return false;
+		}
+
+		// check for invalid characters
 		var invalid_characters = ['\\', '/', '<', '>', ':', '"', '|', '?', '*'];
 		for (var i = 0; i < invalid_characters.length; i++) {
 			if (name.indexOf(invalid_characters[i]) != -1) {
@@ -539,16 +539,12 @@ $(document).ready(function() {
 			event.stopPropagation();
 			event.preventDefault();
 			var newname=input.val();
-			if(type != 'web' && !Files.isFileNameValid(newname)){
-				return false;
-			} else if (newname.length == 0) {
-				if(type == 'web') {
-					$('#notification').text(t('files', "URL cannot be empty."));
-				} else {
-					$('#notification').text(t('files', "Name cannot be empty."));
-				}
+			if(type == 'web' && newname.length == 0){
+				$('#notification').text(t('files', "URL cannot be empty."));
 				$('#notification').fadeIn();
 				return false;
+			} else if (type != 'web' && !Files.isFileNameValid(newname)) {
+				return false;
 			} else if( type == 'folder' && $('#dir').val() == '/' && newname == 'Shared') {
 				$('#notification').text(t('files','Invalid folder name. Usage of "Shared" is reserved by Owncloud'));
 				$('#notification').fadeIn();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list