author | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
commit | 07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (unidiff) | |
tree | f7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/gamma/js/Clipperz/CSVProcessor.js | |
parent | 767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff) | |
download | clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.zip clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.gz clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.bz2 |
Updated Copyright claims
- updated reference dates;
- removed reference to Community Edition;
- normalized logging using Clipperz.log[Warn|Error|Debug]
Diffstat (limited to 'frontend/gamma/js/Clipperz/CSVProcessor.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/CSVProcessor.js | 78 |
1 files changed, 38 insertions, 40 deletions
diff --git a/frontend/gamma/js/Clipperz/CSVProcessor.js b/frontend/gamma/js/Clipperz/CSVProcessor.js index 0b18731..1288ed7 100644 --- a/frontend/gamma/js/Clipperz/CSVProcessor.js +++ b/frontend/gamma/js/Clipperz/CSVProcessor.js | |||
@@ -2,6 +2,5 @@ | |||
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
@@ -9,10 +8,10 @@ refer to http://www.clipperz.com. | |||
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
@@ -20,4 +19,3 @@ refer to http://www.clipperz.com. | |||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
@@ -97,3 +95,3 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
97 | 95 | ||
98 | //MochiKit.Logging.logDebug(">>> CSVProcessor.parse"); | 96 | //Clipperz.logDebug(">>> CSVProcessor.parse"); |
99 | result = []; | 97 | result = []; |
@@ -116,6 +114,6 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
116 | 114 | ||
117 | //MochiKit.Logging.logDebug("line: '" + parameter.line + "'"); | 115 | //Clipperz.logDebug("line: '" + parameter.line + "'"); |
118 | } while (parameter.line != ""); | 116 | } while (parameter.line != ""); |
119 | //MochiKit.Logging.logDebug("--- CSVProcessor.parse - result: " + Clipperz.Base.serializeJSON(result)); | 117 | //Clipperz.logDebug("--- CSVProcessor.parse - result: " + Clipperz.Base.serializeJSON(result)); |
120 | //MochiKit.Logging.logDebug("<<< CSVProcessor.parse"); | 118 | //Clipperz.logDebug("<<< CSVProcessor.parse"); |
121 | 119 | ||
@@ -218,3 +216,3 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
218 | 216 | ||
219 | //MochiKit.Logging.logDebug("#################################### '" + aParameter.line + "'"); | 217 | //Clipperz.logDebug("#################################### '" + aParameter.line + "'"); |
220 | if (aParameter.line == "") { | 218 | if (aParameter.line == "") { |
@@ -242,8 +240,8 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
242 | if (aParameter.line.length < 1) { | 240 | if (aParameter.line.length < 1) { |
243 | //MochiKit.Logging.logDebug("---> 1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 241 | //Clipperz.logDebug("---> 1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
244 | if (inQuotes == true) { | 242 | if (inQuotes == true) { |
245 | //MochiKit.Logging.logDebug("---> 1.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 243 | //Clipperz.logDebug("---> 1.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
246 | throw new Error("CSV Parsing error; end of string, missing closing double-quote..."); | 244 | throw new Error("CSV Parsing error; end of string, missing closing double-quote..."); |
247 | } else { | 245 | } else { |
248 | //MochiKit.Logging.logDebug("---> 1.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 246 | //Clipperz.logDebug("---> 1.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
249 | done = true; | 247 | done = true; |
@@ -251,11 +249,11 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
251 | } else if (escapedQuoteBeginRegexp.test(aParameter.line)) { | 249 | } else if (escapedQuoteBeginRegexp.test(aParameter.line)) { |
252 | //MochiKit.Logging.logDebug("---> 2.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 250 | //Clipperz.logDebug("---> 2.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
253 | result += this.quoteChar(); | 251 | result += this.quoteChar(); |
254 | aParameter.line = aParameter.line.substr(2, aParameter.line.length - 1); | 252 | aParameter.line = aParameter.line.substr(2, aParameter.line.length - 1); |
255 | //MochiKit.Logging.logDebug("<--- 2.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 253 | //Clipperz.logDebug("<--- 2.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
256 | } else if (singleQuoteBeginRegexp.test(aParameter.line)) { | 254 | } else if (singleQuoteBeginRegexp.test(aParameter.line)) { |
257 | //MochiKit.Logging.logDebug("---> 3: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 255 | //Clipperz.logDebug("---> 3: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
258 | if (inQuotes == true) { | 256 | if (inQuotes == true) { |
259 | if (aParameter.line.length == 1) { | 257 | if (aParameter.line.length == 1) { |
260 | //MochiKit.Logging.logDebug("---> 3.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 258 | //Clipperz.logDebug("---> 3.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
261 | aParameter.line = ''; | 259 | aParameter.line = ''; |
@@ -263,6 +261,6 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
263 | } else if (singleQuoteCommaEndRegexp.test(aParameter.line)) { | 261 | } else if (singleQuoteCommaEndRegexp.test(aParameter.line)) { |
264 | //MochiKit.Logging.logDebug("---> 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 262 | //Clipperz.logDebug("---> 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
265 | aParameter.line = aParameter.line.substr(2, aParameter.line.length - 1); | 263 | aParameter.line = aParameter.line.substr(2, aParameter.line.length - 1); |
266 | done = true; | 264 | done = true; |
267 | //MochiKit.Logging.logDebug("<--- 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 265 | //Clipperz.logDebug("<--- 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
268 | } else if (singleQuoteNewLineEndRegexp.test(aParameter.line)) { | 266 | } else if (singleQuoteNewLineEndRegexp.test(aParameter.line)) { |
@@ -274,8 +272,8 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
274 | } else { | 272 | } else { |
275 | //MochiKit.Logging.logDebug("---> 4: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 273 | //Clipperz.logDebug("---> 4: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
276 | if (result == "") { | 274 | if (result == "") { |
277 | //MochiKit.Logging.logDebug("---> 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 275 | //Clipperz.logDebug("---> 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
278 | inQuotes = true; | 276 | inQuotes = true; |
279 | aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); | 277 | aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); |
280 | //MochiKit.Logging.logDebug("<--- 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 278 | //Clipperz.logDebug("<--- 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
281 | } else { | 279 | } else { |
@@ -285,13 +283,13 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
285 | } else if (commaBeginRegexp.test(aParameter.line)) { | 283 | } else if (commaBeginRegexp.test(aParameter.line)) { |
286 | //MochiKit.Logging.logDebug("---> 5: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 284 | //Clipperz.logDebug("---> 5: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
287 | if (inQuotes) { | 285 | if (inQuotes) { |
288 | //MochiKit.Logging.logDebug("---> 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 286 | //Clipperz.logDebug("---> 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
289 | result += aParameter.line.substr(0 ,1); | 287 | result += aParameter.line.substr(0 ,1); |
290 | aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); | 288 | aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); |
291 | //MochiKit.Logging.logDebug("<--- 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 289 | //Clipperz.logDebug("<--- 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
292 | } else { | 290 | } else { |
293 | //MochiKit.Logging.logDebug("---> 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 291 | //Clipperz.logDebug("---> 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
294 | aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); | 292 | aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); |
295 | if (newlineRegexp.test(aParameter.line) || aParameter.line == "") { | 293 | if (newlineRegexp.test(aParameter.line) || aParameter.line == "") { |
296 | //MochiKit.Logging.logDebug("######"); | 294 | //Clipperz.logDebug("######"); |
297 | aParameter.isThereAnEmptyFinalField = true; | 295 | aParameter.isThereAnEmptyFinalField = true; |
@@ -299,9 +297,9 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
299 | done = true; | 297 | done = true; |
300 | //MochiKit.Logging.logDebug("<--- 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 298 | //Clipperz.logDebug("<--- 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
301 | } | 299 | } |
302 | } else if (validRegexp.test(aParameter.line)) { | 300 | } else if (validRegexp.test(aParameter.line)) { |
303 | //MochiKit.Logging.logDebug("---> 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 301 | //Clipperz.logDebug("---> 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
304 | result += aParameter.line.substr(0, 1); | 302 | result += aParameter.line.substr(0, 1); |
305 | aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); | 303 | aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); |
306 | //MochiKit.Logging.logDebug("<--- 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); | 304 | //Clipperz.logDebug("<--- 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); |
307 | } else if (newlineRegexp.test(aParameter.line)) { | 305 | } else if (newlineRegexp.test(aParameter.line)) { |
@@ -326,3 +324,3 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
326 | } catch(exception) { | 324 | } catch(exception) { |
327 | MochiKit.Logging.logError(exception.message); | 325 | Clipperz.logError(exception.message); |
328 | // result = null; | 326 | // result = null; |
@@ -333,5 +331,5 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | |||
333 | //if (result != null) { | 331 | //if (result != null) { |
334 | //MochiKit.Logging.logDebug("<=== result: '" + result.replace(/\n/g, "\\n") + "'"); | 332 | //Clipperz.logDebug("<=== result: '" + result.replace(/\n/g, "\\n") + "'"); |
335 | //} else { | 333 | //} else { |
336 | //MochiKit.Logging.logDebug("<=== result: NULL"); | 334 | //Clipperz.logDebug("<=== result: NULL"); |
337 | //} | 335 | //} |