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/beta/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/beta/js/Clipperz/CSVProcessor.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/CSVProcessor.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/CSVProcessor.js b/frontend/beta/js/Clipperz/CSVProcessor.js index ec94206..f429468 100644 --- a/frontend/beta/js/Clipperz/CSVProcessor.js +++ b/frontend/beta/js/Clipperz/CSVProcessor.js | |||
@@ -1,118 +1,116 @@ | |||
1 | /* | 1 | /* |
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 |
8 | refer to http://www.clipperz.com. | 7 | 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. |
19 | 18 | ||
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 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | 25 | ||
28 | 26 | ||
29 | Clipperz.CSVProcessor = function(args) { | 27 | Clipperz.CSVProcessor = function(args) { |
30 | args = args || {}; | 28 | args = args || {}; |
31 | 29 | ||
32 | // this._status = undefined; | 30 | // this._status = undefined; |
33 | // this._error_input= undefined; | 31 | // this._error_input= undefined; |
34 | // this._string = undefined; | 32 | // this._string = undefined; |
35 | // this._fields = undefined; | 33 | // this._fields = undefined; |
36 | 34 | ||
37 | this._quoteChar = args['quoteChar'] ||"\042"; | 35 | this._quoteChar = args['quoteChar'] ||"\042"; |
38 | this._eol = args['eol'] ||""; | 36 | this._eol = args['eol'] ||""; |
39 | this._escapeChar = args['escapeChar'] ||"\042"; | 37 | this._escapeChar = args['escapeChar'] ||"\042"; |
40 | this._separatorChar = args['separatorChar'] ||","; | 38 | this._separatorChar = args['separatorChar'] ||","; |
41 | this._binary = args['binary'] ||false; | 39 | this._binary = args['binary'] ||false; |
42 | this._alwaysQuote = args['alwaysQuote'] ||false; | 40 | this._alwaysQuote = args['alwaysQuote'] ||false; |
43 | 41 | ||
44 | return this; | 42 | return this; |
45 | } | 43 | } |
46 | 44 | ||
47 | //============================================================================= | 45 | //============================================================================= |
48 | 46 | ||
49 | Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | 47 | Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { |
50 | 48 | ||
51 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
52 | 50 | ||
53 | 'quoteChar': function() { | 51 | 'quoteChar': function() { |
54 | return this._quoteChar; | 52 | return this._quoteChar; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'eol': function() { | 57 | 'eol': function() { |
60 | return this._eol; | 58 | return this._eol; |
61 | }, | 59 | }, |
62 | 60 | ||
63 | //------------------------------------------------------------------------- | 61 | //------------------------------------------------------------------------- |
64 | 62 | ||
65 | 'escapeChar': function() { | 63 | 'escapeChar': function() { |
66 | return this._escapeChar; | 64 | return this._escapeChar; |
67 | }, | 65 | }, |
68 | 66 | ||
69 | //------------------------------------------------------------------------- | 67 | //------------------------------------------------------------------------- |
70 | 68 | ||
71 | 'separatorChar': function() { | 69 | 'separatorChar': function() { |
72 | return this._separatorChar; | 70 | return this._separatorChar; |
73 | }, | 71 | }, |
74 | 72 | ||
75 | 'setSeparatorChar': function(aValue) { | 73 | 'setSeparatorChar': function(aValue) { |
76 | this._separatorChar = aValue; | 74 | this._separatorChar = aValue; |
77 | }, | 75 | }, |
78 | 76 | ||
79 | //------------------------------------------------------------------------- | 77 | //------------------------------------------------------------------------- |
80 | 78 | ||
81 | 'binary': function() { | 79 | 'binary': function() { |
82 | return this._binary; | 80 | return this._binary; |
83 | }, | 81 | }, |
84 | 82 | ||
85 | //------------------------------------------------------------------------- | 83 | //------------------------------------------------------------------------- |
86 | 84 | ||
87 | 'alwaysQuote': function() { | 85 | 'alwaysQuote': function() { |
88 | return this._alwaysQuote; | 86 | return this._alwaysQuote; |
89 | }, | 87 | }, |
90 | 88 | ||
91 | //------------------------------------------------------------------------- | 89 | //------------------------------------------------------------------------- |
92 | /* | 90 | /* |
93 | 'parse': function(aValue) { | 91 | 'parse': function(aValue) { |
94 | var result; | 92 | var result; |
95 | var lines; | 93 | var lines; |
96 | var parameter; | 94 | var parameter; |
97 | 95 | ||
98 | //MochiKit.Logging.logDebug(">>> CSVProcessor.parse"); | 96 | //MochiKit.Logging.logDebug(">>> CSVProcessor.parse"); |
99 | result = []; | 97 | result = []; |
100 | 98 | ||
101 | lines = aValue.replace(/\r?\n/g, "\n").replace(/^\n* /g, "").replace(/\n$/g, "");; | 99 | lines = aValue.replace(/\r?\n/g, "\n").replace(/^\n* /g, "").replace(/\n$/g, "");; |
102 | parameter = { | 100 | parameter = { |
103 | line: lines | 101 | line: lines |
104 | } | 102 | } |
105 | 103 | ||
106 | do { | 104 | do { |
107 | var fields; | 105 | var fields; |
108 | 106 | ||
109 | fields = this.parseLine(parameter); | 107 | fields = this.parseLine(parameter); |
110 | 108 | ||
111 | if (fields != null) { | 109 | if (fields != null) { |
112 | result.push(fields); | 110 | result.push(fields); |
113 | } | 111 | } |
114 | 112 | ||
115 | parameter.line = parameter.line.replace(/^\n* /g, "").replace(/\n$/g, ""); | 113 | parameter.line = parameter.line.replace(/^\n* /g, "").replace(/\n$/g, ""); |
116 | 114 | ||
117 | //MochiKit.Logging.logDebug("line: '" + parameter.line + "'"); | 115 | //MochiKit.Logging.logDebug("line: '" + parameter.line + "'"); |
118 | } while (parameter.line != ""); | 116 | } while (parameter.line != ""); |