mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
OpenPGP Sign/Encrypt improvements (Closes #126)
This commit is contained in:
parent
bb16353c1f
commit
cd6974ecd2
|
@ -476,7 +476,7 @@ module.exports = function (grunt) {
|
|||
// ---
|
||||
|
||||
grunt.registerTask('default', ['less', 'concat', 'cssmin', 'jshint', 'rlmin']);
|
||||
grunt.registerTask('build', ['default', 'rlmin', 'rainloop', 'compress:build', 'md5:build', 'rainloop-clear']);
|
||||
grunt.registerTask('build', ['default', 'rainloop', 'compress:build', 'md5:build', 'rainloop-clear']);
|
||||
grunt.registerTask('fast', ['less', 'concat']);
|
||||
|
||||
// aliases
|
||||
|
|
|
@ -37,6 +37,7 @@ Enums.KeyState = {
|
|||
'MessageList': 'message-list',
|
||||
'MessageView': 'message-view',
|
||||
'Compose': 'compose',
|
||||
'PopupComposeOpenPGP': 'compose-open-pgp',
|
||||
'PopupAsk': 'popup-ask'
|
||||
};
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@ function PopupsComposeOpenPgpViewModel()
|
|||
this.encrypt = ko.observable(true);
|
||||
|
||||
this.password = ko.observable('');
|
||||
this.password.focus = ko.observable(true);
|
||||
this.password.focus = ko.observable(false);
|
||||
this.buttonFocus = ko.observable(false);
|
||||
|
||||
this.from = ko.observable('');
|
||||
this.to = ko.observableArray([]);
|
||||
|
@ -129,6 +130,8 @@ function PopupsComposeOpenPgpViewModel()
|
|||
return !this.submitRequest() && (this.sign() || this.encrypt());
|
||||
});
|
||||
|
||||
this.sDefaultKeyScope = Enums.KeyState.PopupComposeOpenPGP;
|
||||
|
||||
Knoin.constructorEnd(this);
|
||||
}
|
||||
|
||||
|
@ -140,6 +143,7 @@ PopupsComposeOpenPgpViewModel.prototype.clearPopup = function ()
|
|||
|
||||
this.password('');
|
||||
this.password.focus(false);
|
||||
this.buttonFocus(false);
|
||||
|
||||
this.from('');
|
||||
this.to([]);
|
||||
|
@ -150,11 +154,42 @@ PopupsComposeOpenPgpViewModel.prototype.clearPopup = function ()
|
|||
this.resultCallback = null;
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onBuild = function ()
|
||||
{
|
||||
key('tab,shift+tab', Enums.KeyState.PopupComposeOpenPGP, _.bind(function () {
|
||||
|
||||
switch (true)
|
||||
{
|
||||
case this.password.focus():
|
||||
this.buttonFocus(true);
|
||||
break;
|
||||
case this.buttonFocus():
|
||||
this.password.focus(true);
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}, this));
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onHide = function ()
|
||||
{
|
||||
this.clearPopup();
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onFocus = function ()
|
||||
{
|
||||
if (this.sign())
|
||||
{
|
||||
this.password.focus(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonFocus(true);
|
||||
}
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onShow = function (fCallback, sText, sFromEmail, sTo, sCc, sBcc)
|
||||
{
|
||||
this.clearPopup();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "RainLoop",
|
||||
"title": "RainLoop Webmail",
|
||||
"version": "1.6.4",
|
||||
"release": "891",
|
||||
"release": "893",
|
||||
"description": "Simple, modern & fast web-based email client",
|
||||
"homepage": "http://rainloop.net",
|
||||
"main": "Gruntfile.js",
|
||||
|
|
|
@ -31,19 +31,19 @@
|
|||
<label class="i18n control-label" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/LABEL_PASSWORD"></label>
|
||||
<div class="controls">
|
||||
<input class="inputPassword input-large" type="password" autocomplete="off"
|
||||
data-bind="value: password, hasfocus: password.focus" />
|
||||
data-bind="value: password, hasfocus: password.focus, onEnter: doCommand" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn buttonDo" data-bind="command: doCommand">
|
||||
<button class="btn buttonDo" data-bind="command: doCommand, hasfocus: buttonFocus">
|
||||
<i data-bind="css: {'icon-key': !submitRequest(), 'icon-spinner animated': submitRequest()}"></i>
|
||||
|
||||
<span class="i18n" data-bind="visible: sign() && !encrypt()" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/BUTTON_SIGN"></span>
|
||||
<span class="i18n" data-bind="visible: !sign() && encrypt()" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/BUTTON_ENCRYPT"></span>
|
||||
<span class="i18n" data-bind="visible: (sign() && encrypt()) || (!sign() && !encrypt())" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/BUTTON_SIGN_AND_ENCRYPT"></span>
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
<div class="popups">
|
||||
<div class="modal hide b-pgp-key g-ui-user-select-none" data-bind="modal: modalVisibility">
|
||||
<div>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-bind="command: cancelCommand">×</button>
|
||||
<h3>
|
||||
PGP
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-horizontal">
|
||||
<br />
|
||||
<div class="control-group">
|
||||
Passphrase
|
||||
<br />
|
||||
<input class="uiInput inputPassphrase" type="password" data-bind="value: passphrase" />
|
||||
</div>
|
||||
<div class="control-group">
|
||||
Secret key
|
||||
<br />
|
||||
<textarea class="input-xxlarge inputKey" data-bind="value: key" rows="10" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn buttonAction" data-bind="command: sendPgp">
|
||||
<i class="icon-lock"></i>
|
||||
|
||||
Decrypt
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -377,6 +377,7 @@ Enums.KeyState = {
|
|||
'MessageList': 'message-list',
|
||||
'MessageView': 'message-view',
|
||||
'Compose': 'compose',
|
||||
'PopupComposeOpenPGP': 'compose-open-pgp',
|
||||
'PopupAsk': 'popup-ask'
|
||||
};
|
||||
|
||||
|
|
2
rainloop/v/0.0.0/static/js/admin.min.js
vendored
2
rainloop/v/0.0.0/static/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -381,6 +381,7 @@ Enums.KeyState = {
|
|||
'MessageList': 'message-list',
|
||||
'MessageView': 'message-view',
|
||||
'Compose': 'compose',
|
||||
'PopupComposeOpenPGP': 'compose-open-pgp',
|
||||
'PopupAsk': 'popup-ask'
|
||||
};
|
||||
|
||||
|
@ -10722,7 +10723,8 @@ function PopupsComposeOpenPgpViewModel()
|
|||
this.encrypt = ko.observable(true);
|
||||
|
||||
this.password = ko.observable('');
|
||||
this.password.focus = ko.observable(true);
|
||||
this.password.focus = ko.observable(false);
|
||||
this.buttonFocus = ko.observable(false);
|
||||
|
||||
this.from = ko.observable('');
|
||||
this.to = ko.observableArray([]);
|
||||
|
@ -10837,6 +10839,8 @@ function PopupsComposeOpenPgpViewModel()
|
|||
return !this.submitRequest() && (this.sign() || this.encrypt());
|
||||
});
|
||||
|
||||
this.sDefaultKeyScope = Enums.KeyState.PopupComposeOpenPGP;
|
||||
|
||||
Knoin.constructorEnd(this);
|
||||
}
|
||||
|
||||
|
@ -10848,6 +10852,7 @@ PopupsComposeOpenPgpViewModel.prototype.clearPopup = function ()
|
|||
|
||||
this.password('');
|
||||
this.password.focus(false);
|
||||
this.buttonFocus(false);
|
||||
|
||||
this.from('');
|
||||
this.to([]);
|
||||
|
@ -10858,11 +10863,42 @@ PopupsComposeOpenPgpViewModel.prototype.clearPopup = function ()
|
|||
this.resultCallback = null;
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onBuild = function ()
|
||||
{
|
||||
key('tab,shift+tab', Enums.KeyState.PopupComposeOpenPGP, _.bind(function () {
|
||||
|
||||
switch (true)
|
||||
{
|
||||
case this.password.focus():
|
||||
this.buttonFocus(true);
|
||||
break;
|
||||
case this.buttonFocus():
|
||||
this.password.focus(true);
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}, this));
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onHide = function ()
|
||||
{
|
||||
this.clearPopup();
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onFocus = function ()
|
||||
{
|
||||
if (this.sign())
|
||||
{
|
||||
this.password.focus(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonFocus(true);
|
||||
}
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onShow = function (fCallback, sText, sFromEmail, sTo, sCc, sBcc)
|
||||
{
|
||||
this.clearPopup();
|
||||
|
|
12
rainloop/v/0.0.0/static/js/app.min.js
vendored
12
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue