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/Base.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/Base.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/Base.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/Base.js b/frontend/beta/js/Clipperz/Base.js index 1c0504b..cf40314 100644 --- a/frontend/beta/js/Clipperz/Base.js +++ b/frontend/beta/js/Clipperz/Base.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 | if (typeof(Clipperz.Base) == 'undefined') { Clipperz.Base = {}; } | 25 | if (typeof(Clipperz.Base) == 'undefined') { Clipperz.Base = {}; } |
28 | 26 | ||
29 | Clipperz.Base.VERSION = "0.1"; | 27 | Clipperz.Base.VERSION = "0.1"; |
30 | Clipperz.Base.NAME = "Clipperz.Base"; | 28 | Clipperz.Base.NAME = "Clipperz.Base"; |
31 | 29 | ||
32 | MochiKit.Base.update(Clipperz.Base, { | 30 | MochiKit.Base.update(Clipperz.Base, { |
33 | 31 | ||
34 | //------------------------------------------------------------------------- | 32 | //------------------------------------------------------------------------- |
35 | 33 | ||
36 | '__repr__': function () { | 34 | '__repr__': function () { |
37 | return "[" + this.NAME + " " + this.VERSION + "]"; | 35 | return "[" + this.NAME + " " + this.VERSION + "]"; |
38 | }, | 36 | }, |
39 | 37 | ||
40 | //------------------------------------------------------------------------- | 38 | //------------------------------------------------------------------------- |
41 | 39 | ||
42 | 'toString': function () { | 40 | 'toString': function () { |
43 | return this.__repr__(); | 41 | return this.__repr__(); |
44 | }, | 42 | }, |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'trim': function (aValue) { | 46 | 'trim': function (aValue) { |
49 | return aValue.replace(/^\s+|\s+$/g, ""); | 47 | return aValue.replace(/^\s+|\s+$/g, ""); |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | 51 | ||
54 | 'stringToByteArray': function (aValue) { | 52 | 'stringToByteArray': function (aValue) { |
55 | varresult; | 53 | varresult; |
56 | var i, c; | 54 | var i, c; |
57 | 55 | ||
58 | result = []; | 56 | result = []; |
59 | 57 | ||
60 | c = aValue.length; | 58 | c = aValue.length; |
61 | for (i=0; i<c; i++) { | 59 | for (i=0; i<c; i++) { |
62 | result[i] = aValue.charCodeAt(i); | 60 | result[i] = aValue.charCodeAt(i); |
63 | } | 61 | } |
64 | 62 | ||
65 | return result; | 63 | return result; |
66 | }, | 64 | }, |
67 | 65 | ||
68 | //......................................................................... | 66 | //......................................................................... |
69 | 67 | ||
70 | 'byteArrayToString': function (anArrayOfBytes) { | 68 | 'byteArrayToString': function (anArrayOfBytes) { |
71 | varresult; | 69 | varresult; |
72 | var i, c; | 70 | var i, c; |
73 | 71 | ||
74 | result = ""; | 72 | result = ""; |
75 | 73 | ||
76 | c = anArrayOfBytes.length; | 74 | c = anArrayOfBytes.length; |
77 | for (i=0; i<c; i++) { | 75 | for (i=0; i<c; i++) { |
78 | result += String.fromCharCode(anArrayOfBytes[i]); | 76 | result += String.fromCharCode(anArrayOfBytes[i]); |
79 | } | 77 | } |
80 | 78 | ||
81 | return result; | 79 | return result; |
82 | }, | 80 | }, |
83 | 81 | ||
84 | //------------------------------------------------------------------------- | 82 | //------------------------------------------------------------------------- |
85 | 83 | ||
86 | 'getValueForKeyInFormContent': function (aFormContent, aKey) { | 84 | 'getValueForKeyInFormContent': function (aFormContent, aKey) { |
87 | return aFormContent[1][MochiKit.Base.find(aFormContent[0], aKey)]; | 85 | return aFormContent[1][MochiKit.Base.find(aFormContent[0], aKey)]; |
88 | }, | 86 | }, |
89 | 87 | ||
90 | //------------------------------------------------------------------------- | 88 | //------------------------------------------------------------------------- |
91 | 89 | ||
92 | 'indexOfObjectInArray': function(anObject, anArray) { | 90 | 'indexOfObjectInArray': function(anObject, anArray) { |
93 | varresult; | 91 | varresult; |
94 | vari, c; | 92 | vari, c; |
95 | 93 | ||
96 | result = -1; | 94 | result = -1; |
97 | 95 | ||
98 | c = anArray.length; | 96 | c = anArray.length; |
99 | for (i=0; ((i<c) && (result < 0)); i++) { | 97 | for (i=0; ((i<c) && (result < 0)); i++) { |
100 | if (anArray[i] === anObject) { | 98 | if (anArray[i] === anObject) { |
101 | result = i; | 99 | result = i; |
102 | } | 100 | } |
103 | } | 101 | } |
104 | 102 | ||
105 | return result; | 103 | return result; |
106 | }, | 104 | }, |
107 | 105 | ||
108 | 'removeObjectAtIndexFromArray': function(anIndex, anArray) { | 106 | 'removeObjectAtIndexFromArray': function(anIndex, anArray) { |
109 | anArray.splice(anIndex, 1); | 107 | anArray.splice(anIndex, 1); |
110 | }, | 108 | }, |
111 | 109 | ||
112 | 'removeObjectFromArray': function(anObject, anArray) { | 110 | 'removeObjectFromArray': function(anObject, anArray) { |
113 | varobjectIndex; | 111 | varobjectIndex; |
114 | 112 | ||
115 | objectIndex = Clipperz.Base.indexOfObjectInArray(anObject, anArray); | 113 | objectIndex = Clipperz.Base.indexOfObjectInArray(anObject, anArray); |
116 | if (objectIndex > -1) { | 114 | if (objectIndex > -1) { |
117 | Clipperz.Base.removeObjectAtIndexFromArray(objectIndex, anArray); | 115 | Clipperz.Base.removeObjectAtIndexFromArray(objectIndex, anArray); |
118 | } else { | 116 | } else { |