summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/KeePassExportProcessor.js
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js/Clipperz/KeePassExportProcessor.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/KeePassExportProcessor.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/gamma/js/Clipperz/KeePassExportProcessor.js b/frontend/gamma/js/Clipperz/KeePassExportProcessor.js
index a3c10c8..e35d729 100644
--- a/frontend/gamma/js/Clipperz/KeePassExportProcessor.js
+++ b/frontend/gamma/js/Clipperz/KeePassExportProcessor.js
@@ -1,118 +1,116 @@
/*
-Copyright 2008-2011 Clipperz Srl
+Copyright 2008-2013 Clipperz Srl
-This file is part of Clipperz Community Edition.
-Clipperz Community Edition is an online password manager.
+This file is part of Clipperz, the online password manager.
For further information about its features and functionalities please
refer to http://www.clipperz.com.
-* Clipperz Community Edition is free software: you can redistribute
- it and/or modify it under the terms of the GNU Affero General Public
- License as published by the Free Software Foundation, either version
- 3 of the License, or (at your option) any later version.
+* Clipperz is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
-* Clipperz Community Edition is distributed in the hope that it will
- be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* Clipperz is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public
- License along with Clipperz Community Edition. If not, see
- <http://www.gnu.org/licenses/>.
+ License along with Clipperz. If not, see http://www.gnu.org/licenses/.
*/
if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
Clipperz.KeePassExportProcessor = function(args) {
args = args || {};
return this;
}
//=============================================================================
Clipperz.KeePassExportProcessor.prototype = MochiKit.Base.update(null, {
//-------------------------------------------------------------------------
'deferredParse_core': function(aContext) {
var deferredResult;
if (aContext.line == "") {
deferredResult = MochiKit.Async.succeed(aContext.result);
} else {
var record;
record = this.parseRecord(aContext);
if (record != null) {
aContext.result.push(record);
}
aContext.line = aContext.line.replace(/^\n*/g, "").replace(/\n$/g, "");
deferredResult = new Clipperz.Async.Deferred("KeePassExportProcessor.deferredParse_core");
deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'importProcessorProgressUpdate', {status:'processing', size:aContext.size, progress:(aContext.size - aContext.line.length)});
deferredResult.addCallback(MochiKit.Async.wait, 0.2);
deferredResult.addMethod(this, 'deferredParse_core');
deferredResult.callback(aContext);
}
return deferredResult;
},
//.........................................................................
'deferredParse': function(aValue) {
var deferredResult;
var lines;
var context;
lines = aValue.replace(/\r?\n/g, "\n");
context = {
line: lines,
size: lines.length,
result: []
}
deferredResult = new Clipperz.Async.Deferred("KeePassExportProcessor.deferredResult");
deferredResult.addMethod(this, 'deferredParse_core');
deferredResult.callback(context);
return deferredResult;
},
//-------------------------------------------------------------------------
'parseRecord': function(aContext) {
var result;
var recordLabelRegexp;
var fieldLabelRegexp;
var fieldValueRegexp;
var fullLineRegexp;
/*
[Record name]
Group Tree:
UserName:
URL:
Password:
Notes: test
UUID: 525f62430079bae48b79ed2961924b05
Icon: 0
Creation Time: 2007-06-26 17:56:03
Last Access: 2007-10-25 16:23:51
Last Modification: 2007-10-25 16:23:51
Expires: 2999-12-28 23:59:59
[Record name] ==> Title
Group: General ==> Group
Group Tree: ==> Group Tree
UserName: ==> UserName
URL: ==> URL
Password: ==> Password
Notes: test ==> Notes
UUID: 525f62430079bae48b79ed2961924b05 ==> UUID
Icon: 0 ==> Icon
Creation Time: 2007-06-26 17:56:03 ==> Creation Time