Merge pull request #85 from dario-chiappetta/master

Disabled auto-correction in login from, fixed Offline Copy in IE11
This commit is contained in:
Giulio Cesare Solaroli 2015-09-01 12:22:54 +02:00
commit e2d7716389
3 changed files with 21 additions and 4 deletions

View File

@ -125,6 +125,21 @@ MochiKit.Base.update(Clipperz.PM.PIN, {
localStorage.removeItem(this.FAILURE_COUNT);
},
'isLocalStorageSupported': function() {
var result;
var test = 'test';
try {
localStorage.setItem(test, test);
localStorage.removeItem(test);
result = true;
} catch(e) {
result = false;
}
return result;
},
//-------------------------------------------------------------------------
__syntaxFix__: "syntax fix"

View File

@ -110,10 +110,10 @@ Clipperz.PM.UI.Components.Pages.LoginPageClass = React.createClass({
},
loginForm: function () {
return React.DOM.form({'key':'form', 'className':'loginForm credentials', 'autoComplete':'off', 'onChange':this.handleChange, 'onSubmit':this.handleCredentialSubmit}, [
return React.DOM.form({'key':'form', 'className':'loginForm credentials', 'autoComplete':'off', 'autoCorrect':'off', 'autoCapitalize':'off', 'onChange':this.handleChange, 'onSubmit':this.handleCredentialSubmit}, [
React.DOM.div({'key':'fields'},[
React.DOM.label({'key':'username-label', 'htmlFor' :'name'}, "username"),
React.DOM.input({'key':'username', 'type':'text', 'name':'name', 'ref':'username', 'placeholder':"username", 'autoCapitalize':'none'}),
React.DOM.input({'key':'username', 'type':'text', 'name':'name', 'ref':'username', 'placeholder':"username", 'autoComplete':'off', 'autoCorrect':'off', 'autoCapitalize':'off', 'spellCheck': false}),
React.DOM.label({'key':'passphrase-label', 'htmlFor' :'passphrase'}, "passphrase"),
React.DOM.input({'key':'passphrase', 'type':'password', 'name':'passphrase', 'ref':'passphrase', 'placeholder':"passphrase"})
]),

View File

@ -154,7 +154,7 @@ MochiKit.Base.update(Clipperz.PM.UI.MainController.prototype, {
// PIN is set using this command:
// Clipperz.PM.PIN.setCredentialsWithPIN('1234', {'username':'joe', 'passphrase':'clipperz'});
return Clipperz.PM.PIN.isSet() ? 'PIN' : 'CREDENTIALS';
return (Clipperz.PM.PIN.isLocalStorageSupported() && Clipperz.PM.PIN.isSet()) ? 'PIN' : 'CREDENTIALS';
},
//=========================================================================
@ -351,7 +351,9 @@ console.log("THE BROWSER IS OFFLINE");
deferredResult.addCallback(MochiKit.Async.wait, 0.1);
deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection');
deferredResult.addMethod(user, 'login');
deferredResult.addMethod(Clipperz.PM.PIN, 'resetFailedAttemptCount');
if (Clipperz.PM.PIN.isLocalStorageSupported()) {
deferredResult.addMethod(Clipperz.PM.PIN, 'resetFailedAttemptCount');
}
deferredResult.addMethod(this, 'setUser', user);
deferredResult.addMethod(this, 'runApplication');
deferredResult.addMethod(this.overlay(), 'done', "", 1);