Skip to content

Commit

Permalink
Merge branch 'master' of github.com:RC1140/cr-gpg
Browse files Browse the repository at this point in the history
  • Loading branch information
RC1140 committed Aug 30, 2012
2 parents 9109bc9 + ab9e5e2 commit e91576f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
6 changes: 1 addition & 5 deletions chromeExtension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ if (request.messageType == 'encrypt'){
}else if(request.messageType == 'sign'){
var signing_key = plugin0().gpgGetPreference('default-key').value
var sign_status = plugin0().gpgSignText([signing_key],request.sign.message, 2);
console.log(sign_status);
if (!sign_status.error && sign_status.data.length > 0) {
sendResponse({message: sign_status.data,domid:request.sign.domel});
};

sendResponse({message: sign_status,domid:request.sign.domel});
}else if(request.messageType == 'verify'){
var verify_status = plugin0().gpgVerify(request.verify.message);
sendResponse({message: verify_status ,domid:request.verify.domel})
Expand Down
17 changes: 8 additions & 9 deletions chromeExtension/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ $(document).ready(function(){
});

$('.sign').click(function(){
var signing_key = plugin0().gpgGetPreference('default-key').value;
var sign_status = plugin0().gpgSignText([signing_key],$('#sigmessage').val(), 2);
if(!sign_status.error){
$('#sigmessage').val(sign_status.data);
}else{
$('#sigmessage').val(JSON.stringify(sign_status, undefined, 2));
};

chrome.extension.sendRequest({'messageType':'sign',sign: {'message':$('#sigmessage').val()}}, function(response) {
if(!response.message.error){
$('#sigmessage').val(response.message.data);
}else{
$('#sigmessage').val(JSON.stringify(response.message, undefined, 2));
};
});
});
$('.verify').click(function(){
var verify_status = plugin0().gpgVerify($('#sigmessage').val());
Expand All @@ -36,7 +35,7 @@ $(document).ready(function(){
$('.import').click(function(){
chrome.extension.sendRequest({'messageType':'importkey',import: {'message':$('textarea.message').val()}}, function(response) {
$('textarea.message').val(JSON.stringify(response.message, undefined, 2));
});
});
});
$('textarea').click(function(){
if($(this).text() == 'Enter text here'){
Expand Down

0 comments on commit e91576f

Please sign in to comment.