mirror of
http://git.whoc.org.uk/git/password-manager.git
synced 2025-10-29 18:37:35 +01:00
Fixed minor issues reported by user after official release of /delta
This commit is contained in:
@@ -291,7 +291,7 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, {
|
||||
'deleteAccount': function() {
|
||||
var deferredResult;
|
||||
|
||||
deferredResult = new MochiKit.Async.Deferred("User.deleteAccount", {trace: true});
|
||||
deferredResult = new MochiKit.Async.Deferred("User.deleteAccount", {trace:false});
|
||||
deferredResult.addCallback(MochiKit.Base.method(this.connection(), 'message'), 'deleteUser');
|
||||
deferredResult.addCallback(MochiKit.Base.method(this, 'resetAllLocalData'));
|
||||
deferredResult.callback();
|
||||
@@ -302,7 +302,7 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, {
|
||||
'resetAllLocalData': function() {
|
||||
var deferredResult;
|
||||
|
||||
deferredResult = new MochiKit.Async.Deferred("User.resetAllLocalData", {trace: true});
|
||||
deferredResult = new MochiKit.Async.Deferred("User.resetAllLocalData", {trace:false});
|
||||
deferredResult.addCallback(MochiKit.Base.method(this, 'deleteAllCleanTextData'));
|
||||
deferredResult.addCallback(MochiKit.Base.method(this, function() {
|
||||
this.resetConnection();
|
||||
|
||||
288
frontend/delta/js/Clipperz/PM/DefaultCards.js
Normal file
288
frontend/delta/js/Clipperz/PM/DefaultCards.js
Normal file
@@ -0,0 +1,288 @@
|
||||
/*
|
||||
|
||||
Copyright 2008-2015 Clipperz Srl
|
||||
|
||||
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 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 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. If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
*/
|
||||
|
||||
Clipperz.PM.DefaultCards = [{
|
||||
"label": "Bank account (SAMPLE) finance samples",
|
||||
"data": {
|
||||
"directLogins": {},
|
||||
"notes": ""
|
||||
},
|
||||
"currentVersion": {
|
||||
"fields": {
|
||||
"a0aecf62b2d09b682efe2fce23c696499af420b1c7913350449c5946bc689fb5": {
|
||||
"label": "Bank",
|
||||
"value": "Deutsche Bank",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"d553591a24b729ad620516baf8231f3b26284e7eb9ed66f87c258602bf429e75": {
|
||||
"label": "Branch n. ",
|
||||
"value": "774942",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"0e4efb8fa7453b3d2503119a4ab5f77ac25345131897d7efb96127bf830a4cc9": {
|
||||
"label": "IBAN",
|
||||
"value": "DE89370400440532015007",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"48a914d71133ba50b62ab721a610f51ca65a0d9a9bc5f99fdb39eb8c1f5efd7b": {
|
||||
"label": "Web",
|
||||
"value": "https://www.db.com",
|
||||
"actionType": "URL",
|
||||
"hidden": null
|
||||
},
|
||||
"33af93bf7e3ba12265cea9248ee610ed8669fa853f6b3c1e3578e4517360f1e3": {
|
||||
"label": "User ID",
|
||||
"value": "76238784",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"2b62204b2de9e56e6ecfb4338d2dca9b87e6540b767a8a7f98b4afeb7859cad8": {
|
||||
"label": "Password",
|
||||
"value": "?)E%[9=GcgzaAftgP[LSEK7JJv",
|
||||
"actionType": "PASSWORD",
|
||||
"hidden": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"reference": "e0c9c6835696cb7c318549871d53109902a3605e0420bc4a2de18332d792a521"
|
||||
}, {
|
||||
"label": "Bitcoin wallet (SAMPLE) bitcoin finance",
|
||||
"data": {
|
||||
"directLogins": {},
|
||||
"notes": ""
|
||||
},
|
||||
"currentVersion": {
|
||||
"fields": {
|
||||
"3ad0d7f4f945461ec693e822f03102d627aec57445009f8842b639c6067a2e58": {
|
||||
"label": "Type",
|
||||
"value": "paper wallet",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"d2f2a2b2c2df814e5662e336c7c54a48875b80c8858190afd7edec67ccc35b2f": {
|
||||
"label": "Wallet address",
|
||||
"value": "1Q7u3cnwo4tAQoBixPSrS5C39E6VaMHWKb ",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"809e4718e7e6517994a612ffa0ea8aeca9be9bb3f76b7fbf8188e1aaed5a6c69": {
|
||||
"label": "Private key [HEX]",
|
||||
"value": "2ce5820302fd6d8cf756e436484b76fcba11d5664e7bbc643b1bc29994b6bfe5",
|
||||
"actionType": "PASSWORD",
|
||||
"hidden": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"reference": "34dc4fcad391d9dc794d1454461c9571edd9252604cec8bd8749f69f4c3c2796"
|
||||
}, {
|
||||
"label": "Credit card (SAMPLE) cards finance samples",
|
||||
"data": {
|
||||
"directLogins": {},
|
||||
"notes": ""
|
||||
},
|
||||
"currentVersion": {
|
||||
"fields": {
|
||||
"fcf42bfb358e51cd3b38c5f6603d7078dc5438a71cd680090593f219755eeedb": {
|
||||
"label": "Card circuit",
|
||||
"value": "American Express",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"e8dca8f4b4691c6eb2cce504b92e9668db2cb51279c190891db5e8e547389d93": {
|
||||
"label": "Card n.",
|
||||
"value": "8464 2366 1074 7732",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"548acc6e8addd28ab86f16db04102184a31bb0de7f4d6f3e641b6d1431b77fbc": {
|
||||
"label": "Cardholder name",
|
||||
"value": "Joe Clipperz",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"5088bcc13c39d6956128cf6ca88858238b96c882c99562deb40ce92dcce28a17": {
|
||||
"label": "Expire on",
|
||||
"value": "06/18",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"267ef52c9da17fa412945d64ea5d9cdfd90edc0ffcd39c896081185877c18cb0": {
|
||||
"label": "CVV2",
|
||||
"value": "853",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"571ce776861c51914933ea1ff7670e8dbdd5fa6f8add9d89420f3e93b33d0e61": {
|
||||
"label": "PIN",
|
||||
"value": "2744",
|
||||
"actionType": "PASSWORD",
|
||||
"hidden": true
|
||||
},
|
||||
"3356ea6c5e08149aebe8713e52e07f4ae887d3a37fc794cb522e1f0d1d3830e2": {
|
||||
"label": "Card website",
|
||||
"value": "https://www.americanexpress.com",
|
||||
"actionType": "URL",
|
||||
"hidden": null
|
||||
},
|
||||
"49f051d6974a5053dd56e07ba6316e774992d817875f705f9b792da41b8ae81a": {
|
||||
"label": "User ID",
|
||||
"value": "jclipperz",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"dc63ebdadb6337d696ab6b35a95aa3efb452b5c80eecb499f80bdc5fe053aac7": {
|
||||
"label": "Password",
|
||||
"value": "]Gj2ss{+Grg$fBbg}#E})5Re8G",
|
||||
"actionType": "PASSWORD",
|
||||
"hidden": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"reference": "57cd76e6394ad853db42a41124e712b14bb3b7efd47e9ff8c56a05e41e1ab831"
|
||||
}, {
|
||||
"label": "Email account (SAMPLE) personal samples",
|
||||
"data": {
|
||||
"directLogins": {},
|
||||
"notes": ""
|
||||
},
|
||||
"currentVersion": {
|
||||
"fields": {
|
||||
"1df133740d37f98bd096a36ee09370f1786031f8f477aa179d4bd2b4470010ad": {
|
||||
"label": "Provider",
|
||||
"value": "Google Gmail",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"ce5ca8805dfe6da30a30aa030158f52609d9b939bd32be902fd49c1c10d6ec6c": {
|
||||
"label": "Email address",
|
||||
"value": "joe.clipperz@gmail.com",
|
||||
"actionType": "EMAIL",
|
||||
"hidden": null
|
||||
},
|
||||
"344f6510501901b7e6f35aa449958c0c50422f1f5c1d00071670e4df598ffbcd": {
|
||||
"label": "Web",
|
||||
"value": "https://mail.google.com",
|
||||
"actionType": "URL",
|
||||
"hidden": null
|
||||
},
|
||||
"bebb291e4d84149e6f60003a8da92ff30fed62d62f4894a31c222e7c82e660ac": {
|
||||
"label": "User",
|
||||
"value": "joe.clipperz",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"a14c4607164c288bbfb64788f740047b5d2b125b752d5a7666b78a8a1c994329": {
|
||||
"label": "password",
|
||||
"value": "]Gj2ss{+Grg$fBbg}#E})5Re8G",
|
||||
"actionType": "PASSWORD",
|
||||
"hidden": true
|
||||
},
|
||||
"16916013430075588cb1983f1bbb7cff75811e06d0a81b987581b2a12454c746": {
|
||||
"label": "IMAP",
|
||||
"value": "imap.gmail.com:993",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"082853916a0f66cae73308e7e5f99f0a540cfd89b20aa76abbc4e0ec2726ccc4": {
|
||||
"label": "SMTP",
|
||||
"value": "smtp.gmail.com:465",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"reference": "b9bca4fefae5175cecd5474cfb6c17cb7e53a01681aabfa882e2c6c92351958b"
|
||||
}, {
|
||||
"label": "Facebook (SAMPLE) social samples",
|
||||
"data": {
|
||||
"directLogins": {},
|
||||
"notes": ""
|
||||
},
|
||||
"currentVersion": {
|
||||
"fields": {
|
||||
"7a742214b8769b828958e2c6d095a7d71df4ade2e1736c54d2f2d5137f52762a": {
|
||||
"label": "URL",
|
||||
"value": "https://www.facebook.com",
|
||||
"actionType": "URL",
|
||||
"hidden": null
|
||||
},
|
||||
"e1d87357afa8a0b0e981aae7bfbfb5f1248be0e218a040bf4d2f283ef169cd4f": {
|
||||
"label": "Email",
|
||||
"value": "joe.clipperz@gmail.com",
|
||||
"actionType": "EMAIL",
|
||||
"hidden": null
|
||||
},
|
||||
"e91ad9bbacb439ca65e6e11cc9dee70ed5fa8d31f6be3c4a5ec02264fe5140ed": {
|
||||
"label": "Username",
|
||||
"value": "joeclipperz",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"af7da5ef0e3380f05b5501996153c3297c70276a45940e90ed0f7c568b33dbaf": {
|
||||
"label": "Password",
|
||||
"value": ">fA2UEpL6}<6&cSvrcfqfdNjvf",
|
||||
"actionType": "PASSWORD",
|
||||
"hidden": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"reference": "76bbdd6b73c3b7e4843e152abab9af6c56ddcaf62c93dc84c45472c975e0b814"
|
||||
}, {
|
||||
"label": "Passport (SAMPLE) documents personal samples",
|
||||
"data": {
|
||||
"directLogins": {},
|
||||
"notes": ""
|
||||
},
|
||||
"currentVersion": {
|
||||
"fields": {
|
||||
"a7113badb94eba0de86752a8aa17e9de1c02cb8a537b1e702639073ee8fd2db2": {
|
||||
"label": "Passport n.",
|
||||
"value": "83A4568HL25-66",
|
||||
"actionType": "NONE",
|
||||
"hidden": false
|
||||
},
|
||||
"712b23e8ab1b325379142e2bd50a5d950553c1da1188686b827786923e984660": {
|
||||
"label": "Issued by",
|
||||
"value": "British Embassy in Berlin",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"e7ceb7f25709c195297ae64205d98d654e190290b7dc1b4e379c088a8b64bab1": {
|
||||
"label": "Issue date",
|
||||
"value": "11/09/2014",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
},
|
||||
"79441bc252208b632f1d51dd86ea62de20341c47eec3771ea40611ecff93edad": {
|
||||
"label": "Expiry date",
|
||||
"value": "10/09/2019",
|
||||
"actionType": "NONE",
|
||||
"hidden": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"reference": "132697670c9553c95855e205a8fdd1a93f826836eb76f9657f69e81be262c077"
|
||||
}]
|
||||
@@ -291,7 +291,8 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
|
||||
'userDetails': someParameters['user']['header'],
|
||||
'statistics': someParameters['user']['statistics'],
|
||||
'userDetailsVersion': someParameters['user']['version'],
|
||||
'records': {}
|
||||
'records': {},
|
||||
'accountInfo': Clipperz.PM.Proxy.Offline.DataStore.defaultAccountInfo
|
||||
}
|
||||
} else {
|
||||
throw "user already exists";
|
||||
@@ -882,4 +883,26 @@ console.log("Proxy.Offline.DataStore.updateOneTimePasswords: userOTPs:", aConnec
|
||||
|
||||
Clipperz.PM.Proxy.Offline.DataStore['exception'] = {
|
||||
'ReadOnly': new MochiKit.Base.NamedError("Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly")
|
||||
};
|
||||
|
||||
Clipperz.PM.Proxy.Offline.DataStore.defaultAccountInfo = {
|
||||
'features': [
|
||||
'UPDATE_CREDENTIALS',
|
||||
'EDIT_CARD',
|
||||
'CARD_DETAILS',
|
||||
'ADD_CARD',
|
||||
'DELETE_CARD',
|
||||
'OFFLINE_COPY',
|
||||
'LIST_CARDS'
|
||||
],
|
||||
'paymentVerificationPending': false,
|
||||
'currentSubscriptionType': 'EARLY_ADOPTER',
|
||||
'isExpiring': false,
|
||||
'latestActiveLevel': 'EARLY_ADOPTER',
|
||||
'payments': [],
|
||||
'featureSet': 'FULL',
|
||||
'latestActiveThreshold': '-1.00000000',
|
||||
'referenceDate': 'Fri, 03 April 2015 08:17:46 UTC',
|
||||
'isExpired': false,
|
||||
'expirationDate': 'Mon, 01 January 4001 00:00:00 UTC'
|
||||
};
|
||||
@@ -58,10 +58,33 @@ Clipperz.PM.UI.Components.Cards.ViewClass = React.createClass({
|
||||
handlePasswordFieldAction: function (aField) {
|
||||
var self = this;
|
||||
var newState = {}
|
||||
|
||||
|
||||
newState[aField['_reference']] = !this.state[aField['_reference']];
|
||||
|
||||
|
||||
return function () {
|
||||
var fieldReference = aField['_reference'];
|
||||
var currentTimeout;
|
||||
|
||||
if (newState[fieldReference]) {
|
||||
currentTimeout = setTimeout(function(){
|
||||
var newState;
|
||||
|
||||
newState = {};
|
||||
newState[fieldReference] = false;
|
||||
|
||||
self.setState(newState);
|
||||
}, Clipperz.PM.UI.Components.Cards.ViewClass.automaticRescrambleTimeout);
|
||||
}
|
||||
|
||||
if (self.state['currentTimeout']) {
|
||||
clearTimeout(self.state['currentTimeout']);
|
||||
delete self.state['currentTimeout'];
|
||||
}
|
||||
|
||||
if (currentTimeout) {
|
||||
newState['currentTimeout'] = currentTimeout;
|
||||
}
|
||||
|
||||
self.setState(newState);
|
||||
};
|
||||
},
|
||||
@@ -193,7 +216,12 @@ Clipperz.PM.UI.Components.Cards.ViewClass = React.createClass({
|
||||
React.DOM.div({'className':'fieldEditAction'}, null),
|
||||
React.DOM.div({'className':'fieldValues'}, [
|
||||
React.DOM.div({'className':'fieldLabel'}, aField['label']),
|
||||
React.DOM.div({'className':Clipperz.PM.UI.Components.classNames(cardFieldValueClasses)}, aField['value']),
|
||||
React.DOM.textarea({
|
||||
'readOnly': true,
|
||||
'onClick': function(e) { e.target.select(); },
|
||||
'className':Clipperz.PM.UI.Components.classNames(cardFieldValueClasses),
|
||||
'value': aField['value']
|
||||
}),
|
||||
]),
|
||||
React.DOM.div({'className':'fieldAction'}, [
|
||||
React.DOM.span({'className':Clipperz.PM.UI.Components.classNames(cardFieldActionClasses), 'onClick':this.handleFieldAction(aField)}, aField['actionType'].toLowerCase() == 'password' ? 'view password' : aField['actionType'].toLowerCase())
|
||||
@@ -258,4 +286,6 @@ Clipperz.PM.UI.Components.Cards.ViewClass = React.createClass({
|
||||
//=========================================================================
|
||||
});
|
||||
|
||||
Clipperz.PM.UI.Components.Cards.ViewClass.automaticRescrambleTimeout = 5000;
|
||||
|
||||
Clipperz.PM.UI.Components.Cards.View = React.createFactory(Clipperz.PM.UI.Components.Cards.ViewClass);
|
||||
|
||||
@@ -79,9 +79,7 @@ Clipperz.PM.UI.Components.ExtraFeatures.DataImportClass = React.createClass({
|
||||
]),
|
||||
React.DOM.div({'className': 'content' + ' ' + currentStep + ' ' + this.importContext().inputFormat()}, [
|
||||
React.DOM.div({'className': 'step' + ' ' + currentStep}, [
|
||||
new this.componentWithName(this.importContext().currentStep())({
|
||||
'importContext': this.importContext(),
|
||||
}),
|
||||
new this.componentWithName(this.importContext().currentStep())({'importContext': this.importContext()}),
|
||||
]),
|
||||
this.renderNavbar(currentStep),
|
||||
React.DOM.div({'className': 'buttons' + ' ' + currentStep}, [
|
||||
|
||||
@@ -28,7 +28,13 @@ Clipperz.PM.UI.Components.ExtraFeatures.DataImport.ImportClass = React.createCla
|
||||
//=========================================================================
|
||||
|
||||
importHandler: function (anEvent) {
|
||||
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'importCards', this.props.importContext.state('recordsToImport'));
|
||||
var recordsToImport = this.props.importContext.state('recordsToImport');
|
||||
|
||||
if (this.props.importContext.state('useImportTag') && this.props.importContext.state('importTag')) {
|
||||
this.props.importContext.enhanceJsonDataWithImportTag(recordsToImport, this.props.importContext.state('importTag'))
|
||||
}
|
||||
|
||||
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'importCards', recordsToImport);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
|
||||
@@ -28,7 +28,7 @@ Clipperz.PM.UI.Components.ExtraFeatures.DataImport.PreviewClass = React.createCl
|
||||
|
||||
getInitialState: function() {
|
||||
var recordsToImport;
|
||||
|
||||
|
||||
recordsToImport = MochiKit.Iter.reduce(
|
||||
function (acc, item) { acc[item['reference']] = item; return acc; },
|
||||
MochiKit.Base.filter(
|
||||
@@ -47,6 +47,53 @@ Clipperz.PM.UI.Components.ExtraFeatures.DataImport.PreviewClass = React.createCl
|
||||
|
||||
//=========================================================================
|
||||
|
||||
selectRecordsToImport: function(records) {
|
||||
var newRecordsToImport;
|
||||
var i;
|
||||
|
||||
newRecordsToImport = {};
|
||||
for (i in records) {
|
||||
newRecordsToImport[records[i]['reference']] = records[i];
|
||||
}
|
||||
|
||||
this.setState({'recordsToImport': newRecordsToImport});
|
||||
this.props.importContext.setState('recordsToImport', MochiKit.Base.values(newRecordsToImport));
|
||||
},
|
||||
|
||||
selectAll: function() {
|
||||
this.selectRecordsToImport(this.props.importContext.state('jsonData'));
|
||||
},
|
||||
|
||||
selectNone: function() {
|
||||
this.selectRecordsToImport({});
|
||||
},
|
||||
|
||||
selectNotArchived: function() {
|
||||
this.selectRecordsToImport(MochiKit.Base.filter(function (aRecord) {
|
||||
return !Clipperz.PM.DataModel.Record.labelContainsArchiveTag(aRecord['label']);
|
||||
}, this.props.importContext.state('jsonData')));
|
||||
},
|
||||
|
||||
selectArchived: function() {
|
||||
this.selectRecordsToImport(MochiKit.Base.filter(function (aRecord) {
|
||||
return Clipperz.PM.DataModel.Record.labelContainsArchiveTag(aRecord['label']);
|
||||
}, this.props.importContext.state('jsonData')));
|
||||
},
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
handleImportTagTextChange: function() {
|
||||
var newTag = this.refs['importTagText'].getDOMNode().value;
|
||||
|
||||
this.props.importContext.setState('importTag', newTag);
|
||||
},
|
||||
|
||||
handleImportTagCheckboxChange: function() {
|
||||
this.props.importContext.setState('useImportTag', ! this.props.importContext.state('useImportTag'));
|
||||
},
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
toggleRecordToImport: function(record) {
|
||||
var newRecordsToImport;
|
||||
var recordPosition;
|
||||
@@ -76,6 +123,10 @@ Clipperz.PM.UI.Components.ExtraFeatures.DataImport.PreviewClass = React.createCl
|
||||
tagList = MochiKit.Base.keys(tagObject);
|
||||
tagList = MochiKit.Base.filter(function(aTag) { return !Clipperz.PM.DataModel.Record.isSpecialTag(aTag); }, tagList);
|
||||
|
||||
if (this.props.importContext.state('useImportTag') && this.props.importContext.state('importTag')) {
|
||||
tagList.push(this.props.importContext.state('importTag'));
|
||||
}
|
||||
|
||||
if (tagList.length > 0) {
|
||||
result = React.DOM.ul({'className': 'tagList'},
|
||||
MochiKit.Base.map(function(aTag){
|
||||
@@ -123,7 +174,32 @@ Clipperz.PM.UI.Components.ExtraFeatures.DataImport.PreviewClass = React.createCl
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var inputFormat = this.props.importContext.inputFormat();
|
||||
|
||||
return React.DOM.div({'className': 'preview'},
|
||||
React.DOM.div({'className': 'selectButtons'},
|
||||
React.DOM.span({}, "Select:"),
|
||||
React.DOM.a({'onClick': this.selectAll}, "All"),
|
||||
React.DOM.a({'onClick': this.selectNone}, "None"),
|
||||
(inputFormat == 'JSON') ? React.DOM.a({'onClick': this.selectNotArchived}, "Not Archived") : null,
|
||||
(inputFormat == 'JSON') ? React.DOM.a({'onClick': this.selectArchived}, "Archived") : null
|
||||
),
|
||||
React.DOM.div({'className': 'tagButtons'},
|
||||
React.DOM.input({
|
||||
'type': 'checkbox',
|
||||
'id': 'tagCheckbox',
|
||||
'checked': this.props.importContext.state('useImportTag'),
|
||||
'onChange': this.handleImportTagCheckboxChange
|
||||
}),
|
||||
React.DOM.label({'htmlFor': 'tagCheckbox'}, "Apply the following tag to imported cards:"),
|
||||
React.DOM.input({
|
||||
'ref': 'importTagText',
|
||||
'type': 'text',
|
||||
'value': this.props.importContext.state('importTag'),
|
||||
'disabled': ! this.props.importContext.state('useImportTag'),
|
||||
'onChange': this.handleImportTagTextChange
|
||||
})
|
||||
),
|
||||
React.DOM.ul({}, MochiKit.Base.map(MochiKit.Base.method(this, 'renderCard'), this.props.importContext.state('jsonData')))
|
||||
);
|
||||
},
|
||||
|
||||
@@ -120,7 +120,7 @@ Clipperz.PM.UI.Components.ExtraFeatures.PassphraseClass = React.createClass({
|
||||
|
||||
React.DOM.p({}, [
|
||||
React.DOM.input({'key':'confirm', 'id':'changePassphraseConfirmCheckbox', 'className':'confirmCheckbox', 'type':'checkbox', 'name':'confirm', 'ref':'confirm'}),
|
||||
React.DOM.label({'htmlFor':'changePassphraseConfirmCheckbox'}, "I understand that Clipperz will not be able to help me recovering a lost passphrase.")
|
||||
React.DOM.label({'htmlFor':'changePassphraseConfirmCheckbox'}, "I understand that Clipperz is unable to recover a lost passphrase.")
|
||||
]),
|
||||
]),
|
||||
React.DOM.button({'key':'button', 'type':'submit', 'disabled':!this.shouldEnableChangePassphraseButton(), 'className':'button'}, "Change passphrase"),
|
||||
|
||||
@@ -189,13 +189,13 @@ Clipperz.PM.UI.Components.Pages.RegistrationPageClass = React.createClass({
|
||||
render_TERMS_OF_SERVICE: function () {
|
||||
return React.DOM.div({'key':'termsOfService'}, [
|
||||
React.DOM.div({'key':'termsOfService_choice_1', 'className':'checkboxBlock'}, [
|
||||
React.DOM.label({'key':'termsOfService_label_1', 'htmlFor':'no_password_recovery'}, "I understand that Clipperz will not be able to recover a lost passphrase."),
|
||||
React.DOM.input({'key':'no_password_recovery', 'type':'checkbox', 'name':'no_password_recovery', 'ref':'no_password_recovery'}),
|
||||
React.DOM.p({'key':'termsOfService_description_1'}, "I understand that Clipperz will not be able to recover a lost passphrase.")
|
||||
React.DOM.label({'key':'termsOfService_label_1', 'htmlFor':'no_password_recovery'}, "I understand that Clipperz is unable to recover a lost passphrase."),
|
||||
React.DOM.input({'key':'no_password_recovery', 'type':'checkbox', 'name':'no_password_recovery', 'ref':'no_password_recovery', 'id':'no_password_recovery'}),
|
||||
React.DOM.p({'key':'termsOfService_description_1'}, "I understand that Clipperz is unable to recover a lost passphrase.")
|
||||
]),
|
||||
React.DOM.div({'key':'termsOfService_choice_2', 'className':'checkboxBlock'}, [
|
||||
React.DOM.label({'key':'termsOfService_label_2', 'htmlFor':'agree_terms_of_service'}, "I have read and agreed to the Terms of Service."),
|
||||
React.DOM.input({'key':'agree_terms_of_service', 'type':'checkbox', 'name':'agree_terms_of_service', 'ref':'agree_terms_of_service'}),
|
||||
React.DOM.input({'key':'agree_terms_of_service', 'type':'checkbox', 'name':'agree_terms_of_service', 'ref':'agree_terms_of_service', 'id':'agree_terms_of_service'}),
|
||||
React.DOM.p({'key':'termsOfService_description_2'}, [
|
||||
React.DOM.span({'key':'termsOfService_description_2_p1'}, "I have read and agreed to the "),
|
||||
React.DOM.a({'key':'termsOfService_description_2_p2', 'href':'https://clipperz.com/terms_service/', target:'_blank'}, "Terms of Service.")
|
||||
|
||||
@@ -32,6 +32,8 @@ Clipperz.PM.UI.ImportContext = function(anInputComponent) {
|
||||
'isInputStringValid': false,
|
||||
'inputFormat': 'UNDEFINED',
|
||||
'currentStep': 'Input',
|
||||
'useImportTag': true,
|
||||
'importTag': Clipperz.PM.UI.ImportContext.getDefaultImportTag()
|
||||
};
|
||||
|
||||
return this;
|
||||
@@ -185,17 +187,20 @@ MochiKit.Base.update(Clipperz.PM.UI.ImportContext.prototype, {
|
||||
},
|
||||
|
||||
enhanceJsonDataWithCardReferences: function (someJsonData) {
|
||||
var now = new XDate();
|
||||
var dateString = now.toString('yyyyMMdd');
|
||||
|
||||
return MochiKit.Base.map(function (item) {
|
||||
item['reference'] = Clipperz.PM.Crypto.randomKey();
|
||||
// item['label'] = "COPY - " + item['label'];
|
||||
item['label'] = item['label'] + ' ' + Clipperz.PM.DataModel.Record.tagChar + "Import_" + dateString;
|
||||
return item;
|
||||
}, someJsonData);
|
||||
},
|
||||
|
||||
enhanceJsonDataWithImportTag: function(someJsonData, aTag) {
|
||||
return MochiKit.Base.map(function (item) {
|
||||
item['label'] = item['label'] + ' ' + Clipperz.PM.DataModel.Record.tagChar + aTag;
|
||||
return item;
|
||||
}, someJsonData);
|
||||
},
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
startCsvWizard: function (csvData) {
|
||||
@@ -447,3 +452,10 @@ MochiKit.Base.update(Clipperz.PM.UI.ImportContext.prototype, {
|
||||
//=============================================================================
|
||||
__syntaxFix__: "syntax fix"
|
||||
});
|
||||
|
||||
Clipperz.PM.UI.ImportContext.getDefaultImportTag = function() {
|
||||
var now = new XDate();
|
||||
var dateString = now.toString('yyyyMMdd');
|
||||
|
||||
return "Import_" + dateString;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ console.log("THE BROWSER IS OFFLINE");
|
||||
deferredResult.addMethod(this, 'setUser', user);
|
||||
deferredResult.addMethod(this, 'runApplication');
|
||||
deferredResult.addMethod(this.overlay(), 'done', "", 1);
|
||||
deferredResult.addErrback(MochiKit.Base.method(this, 'genericErrorHandler', someCredentials));
|
||||
deferredResult.addErrback(MochiKit.Base.method(this, 'genericErrorHandler', someCredentials, "login failed"));
|
||||
deferredResult.addErrback(MochiKit.Base.bind(function (anEvent, anError) {
|
||||
if (anError['isPermanent'] != true) {
|
||||
this.pages()['loginPage'].setProps({disabled:false, 'mode':this.loginMode()});
|
||||
@@ -381,7 +381,8 @@ console.log("THE BROWSER IS OFFLINE");
|
||||
MochiKit.Base.partial(MochiKit.Async.succeed, credentials['passphrase'])
|
||||
);
|
||||
deferredResult.addMethod(this, 'doLogin', credentials);
|
||||
deferredResult.addErrback(MochiKit.Base.method(this, 'genericErrorHandler', credentials));
|
||||
deferredResult.addMethod(this,'importCards', Clipperz.PM.DefaultCards);
|
||||
deferredResult.addErrback(MochiKit.Base.method(this, 'genericErrorHandler', credentials, "registration failed"));
|
||||
deferredResult.addErrback(MochiKit.Base.bind(function (anError) {
|
||||
if (anError['isPermanent'] != true) {
|
||||
this.pages()['registrationPage'].setProps({disabled:false});
|
||||
@@ -636,7 +637,7 @@ console.log("THE BROWSER IS OFFLINE");
|
||||
rangeFilter = MochiKit.Base.operator.identity;
|
||||
} else if (aFilter['type'] == 'RECENT') {
|
||||
filterCriteria = MochiKit.Base.operator.truth;
|
||||
sortCriteria = Clipperz.Base.reverseComparator(MochiKit.Base.keyComparator('accessDate'));
|
||||
sortCriteria = Clipperz.Base.reverseComparator(MochiKit.Base.keyComparator('_accessDate'));
|
||||
rangeFilter = function (someCards) { return someCards.slice(0, 10)};
|
||||
} else if (aFilter['type'] == 'SEARCH') {
|
||||
filterCriteria = this.regExpFilterGenerator(Clipperz.PM.DataModel.Record.regExpForSearch(aFilter['value']));
|
||||
@@ -832,12 +833,13 @@ console.log("THE BROWSER IS OFFLINE");
|
||||
*/
|
||||
//=========================================================================
|
||||
|
||||
genericErrorHandler: function (anEvent, anError) {
|
||||
genericErrorHandler: function (anEvent, aMessage, anError) {
|
||||
var errorMessage;
|
||||
var result;
|
||||
|
||||
result = anError;
|
||||
errorMessage = "login failed";
|
||||
// errorMessage = "login failed";
|
||||
errorMessage = aMessage;
|
||||
|
||||
if (anError['isPermanent'] === true) {
|
||||
this.pages()['errorPage'].setProps({message:anError.message});
|
||||
@@ -925,7 +927,7 @@ console.log("THE BROWSER IS OFFLINE");
|
||||
//console.log("ADD ITEM TO HISTORY");
|
||||
//console.log("ADD ITEM TO HISTORY - window", window);
|
||||
//console.log("ADD ITEM TO HISTORY - window.history", window.history);
|
||||
window.history.pushState({'fromPage': fromPage, 'toPage': toPage});
|
||||
window.history.pushState({'fromPage': fromPage, 'toPage': toPage}, "");
|
||||
//# window.history.pushState();
|
||||
//console.log("ADDED ITEM TO HISTORY");
|
||||
} else {
|
||||
@@ -956,7 +958,6 @@ console.log("THE BROWSER IS OFFLINE");
|
||||
|
||||
userInfo: function () {
|
||||
var result;
|
||||
|
||||
result = {};
|
||||
|
||||
result['checkPassphraseCallback'] = MochiKit.Base.bind(this.checkPassphrase,this);
|
||||
@@ -1011,7 +1012,7 @@ console.log("THE BROWSER IS OFFLINE");
|
||||
|
||||
//console.log("messageBox - this.user()", this.user());
|
||||
if (this.featureSet() == 'EXPIRED') {
|
||||
message = "Exprired subscription";
|
||||
message = "Expired subscription";
|
||||
level = 'ERROR';
|
||||
}
|
||||
|
||||
@@ -1102,6 +1103,8 @@ console.log("THE BROWSER IS OFFLINE");
|
||||
resetPanels: function () {
|
||||
this._isSelectionPanelOpen = false;
|
||||
this._isSettingsPanelOpen = false;
|
||||
|
||||
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'closeSettingsPanel');
|
||||
},
|
||||
|
||||
featureAvailableForStyles: function (listOfSupportedStyles) {
|
||||
@@ -1344,6 +1347,15 @@ console.log("THE BROWSER IS OFFLINE");
|
||||
MochiKit.Base.method(this.overlay(), 'show', "importing …", true),
|
||||
MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'toggleSettingsPanel'),
|
||||
// MochiKit.Base.method(this.pages()[this.currentPage()], 'setProps', {'mode':'view', 'showGlobalMask':false}),
|
||||
function () { return data; },
|
||||
MochiKit.Base.method(this,'importCards'),
|
||||
MochiKit.Base.method(this.overlay(), 'done', "finished", 1),
|
||||
MochiKit.Base.method(this.pages()[this.currentPage()], 'setProps', {'mode':'view', 'showGlobalMask':false}),
|
||||
], {trace:false});
|
||||
},
|
||||
|
||||
importCards: function(data) {
|
||||
return Clipperz.Async.callbacks("MainController.importCards", [
|
||||
function () { return data; },
|
||||
MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this.user(), 'createNewRecordFromJSON')),
|
||||
|
||||
@@ -1358,8 +1370,6 @@ console.log("THE BROWSER IS OFFLINE");
|
||||
MochiKit.Base.method(this.user(), 'saveChanges'),
|
||||
MochiKit.Base.partial(MochiKit.Base.method(this, 'resetRecordsInfo')),
|
||||
MochiKit.Base.partial(MochiKit.Base.method(this, 'refreshUI', null)),
|
||||
MochiKit.Base.method(this.overlay(), 'done', "finished", 1),
|
||||
MochiKit.Base.method(this.pages()[this.currentPage()], 'setProps', {'mode':'view', 'showGlobalMask':false}),
|
||||
], {trace:false});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user