Diffstat (limited to 'frontend/beta/js/Clipperz/KeePassExportProcessor.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/KeePassExportProcessor.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/KeePassExportProcessor.js b/frontend/beta/js/Clipperz/KeePassExportProcessor.js index ba56b8e..74d36ca 100644 --- a/frontend/beta/js/Clipperz/KeePassExportProcessor.js +++ b/frontend/beta/js/Clipperz/KeePassExportProcessor.js @@ -1,120 +1,117 @@ /* Copyright 2008-2011 Clipperz Srl -This file is part of Clipperz's Javascript Crypto Library. -Javascript Crypto Library provides web developers with an extensive -and efficient set of cryptographic functions. The library aims to -obtain maximum execution speed while preserving modularity and -reusability. +This file is part of Clipperz Community Edition. +Clipperz Community Edition is an online password manager. For further information about its features and functionalities please -refer to http://www.clipperz.com +refer to http://www.clipperz.com. -* Javascript Crypto Library is free software: you can redistribute +* 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. -* Javascript Crypto Library is distributed in the hope that it will +* 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. 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 Javascript Crypto Library. If not, see + License along with Clipperz Community Edition. 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, { //------------------------------------------------------------------------- /* 'parse': function(aValue) { var result; //MochiKit.Logging.logDebug(">>> KeePassExportProcessor.parse"); result = []; //MochiKit.Logging.logDebug("--- KeePassExportProcessor.parse - result: " + Clipperz.Base.serializeJSON(result)); //MochiKit.Logging.logDebug("<<< KeePassExportProcessor.parse"); return result; }, */ //------------------------------------------------------------------------- 'deferredParse_core': function(aContext) { var deferredResult; //MochiKit.Logging.logDebug(">>> KeePassExportProcessor.deferredParse_core"); //MochiKit.Logging.logDebug("--- KeePassExportProcessor.deferredParse_core - (1) aContext.line: " + aContext.line.replace(/\n/g, "\\n").substring(0,50)); //MochiKit.Logging.logDebug("--- KeePassExportProcessor.deferredParse_core - aContext: " + Clipperz.Base.serializeJSON(aContext).substring(0,50)); //MochiKit.Logging.logDebug("--- KeePassExportProcessor.deferredParse_core - (2) aContext.line: " + aContext.line.replace(/\n/g, "\\n").substring(0,50)); //console.log("deferredParse_core - aContext", aContext); //MochiKit.Logging.logDebug("--- KeePassExportProcessor.deferredParse_core - (3) aContext.line: " + aContext.line.replace(/\n/g, "\\n").substring(0,50)); if (aContext.line == "") { deferredResult = MochiKit.Async.succeed(aContext.result); } else { var record; record = this.parseRecord(aContext); if (record != null) { aContext.result.push(record); } //MochiKit.Logging.logDebug("--> KeePassExportProcessor.deferredParse_core - aContext.line: " + aContext.line.replace(/\n/g, "\\n").substring(0,50)); aContext.line = aContext.line.replace(/^\n*/g, "").replace(/\n$/g, ""); //MochiKit.Logging.logDebug("<-- KeePassExportProcessor.deferredParse_core - aContext.line: " + aContext.line.replace(/\n/g, "\\n").substring(0,50)); deferredResult = new MochiKit.Async.Deferred(); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("KeePassExportProcessor.deferredParse_core - 1.1 " + res); return res;}); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'importProcessorProgressUpdate', {status:'processing', size:aContext.size, progress:(aContext.size - aContext.line.length)}); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("KeePassExportProcessor.deferredParse_core - 1.2 " + res); return res;}); deferredResult.addCallback(MochiKit.Async.wait, 0.2); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("KeePassExportProcessor.deferredParse_core - 1.3 " + res); return res;}); //deferredResult.addBoth(function(res) {console.log("KeePassExportProcessor.deferredParse_core - 1.3 ", res); return res;}); deferredResult.addCallback(MochiKit.Base.method(this, 'deferredParse_core')) //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("KeePassExportProcessor.deferredParse_core - 1.4 " + res); return res;}); deferredResult.callback(aContext); } //MochiKit.Logging.logDebug("<<< KeePassExportProcessor.deferredParse_core"); return deferredResult; }, //......................................................................... 'deferredParse': function(aValue) { var deferredResult; var lines; var context; //MochiKit.Logging.logDebug(">>> KeePassExportProcessor.deferredParse"); //MochiKit.Logging.logDebug("--- KeePassExportProcessor.deferredParse - aValue: " + aValue.length); lines = aValue.replace(/\r?\n/g, "\n"); //MochiKit.Logging.logDebug("--- KeePassExportProcessor.deferredParse - lines: " + lines.length); context = { line: lines, size: lines.length, result: [] } //MochiKit.Logging.logDebug("--- KeePassExportProcessor.deferredParse - context: " + Clipperz.Base.serializeJSON(context).substring(0,50)); //console.log("--- KeePassExportProcessor.deferredParse - context: ", context); deferredResult = new MochiKit.Async.Deferred(); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("KeePassExportProcessor.deferredParse - 1 " + res); return res;}); //deferredResult.addBoth(function(res) {console.log("KeePassExportProcessor.deferredParse - 1 ", res); return res;}); deferredResult.addCallback(MochiKit.Base.method(this, 'deferredParse_core')); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("KeePassExportProcessor.deferredParse - 2 " + res); return res;}); deferredResult.callback(context); |