Skip to content

Commit

Permalink
cleanup and added decryption support to the GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWillner committed Feb 21, 2011
1 parent 17755c5 commit 56f5a25
Show file tree
Hide file tree
Showing 31 changed files with 395 additions and 1,658 deletions.
38 changes: 18 additions & 20 deletions index.html
Expand Up @@ -6,19 +6,21 @@
<style type="text/css" media="screen">@import "layout/jqtouch.min.css";</style>
<style type="text/css" media="screen">@import "layout/themes/jqt/theme.min.css";</style>
<style type="text/css" media="screen">@import "layout/gpgmail.css";</style>

<script src="scripts/jquery/jquery.1.4.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="scripts/jqtouch/jqtouch.min.js" type="text/javascript" charset="utf-8"></script>
<script src="scripts/jqtouch/gpgmail.js" type="text/javascript" charset="utf-8"></script>

<script src="scripts/db/gpgmail.js" type="text/javascript" charset="utf-8" defer="defer"></script>

<script src="scripts/openpgp/rsa.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/openpgp/aes-enc.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/openpgp/base64.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/openpgp/mouse.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/openpgp/PGencode.js" type="text/javascript" charset="utf-8" defer="defer"></script>

<script src="scripts/hanewin/rsa.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/hanewin/aes-enc.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/hanewin/base64.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/hanewin/mouse.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/hanewin/PGencode.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/hanewin/PGdecode.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/openpgp/gpgmail.js" type="text/javascript" charset="utf-8" defer="defer"></script>
<script src="scripts/openpgp/core.js" type="text/javascript" charset="utf-8" defer="defer"></script>
</head>
<body>
<div id="about" class="selectable">
Expand All @@ -42,27 +44,24 @@
</p>
<p>work in progress...<br />this method is not implemented yet.</p>
<p><br /><br /><a href="#" class="grayButton goback">Close</a></p>
</div>
</div>
<div id="encrypt">
<div class="toolbar">
<h1>Encrypt</h1>
<a href="#" class="back">Back</a>
<a class="button" id="clearencrypt" href="#" onClick="document.forms['encrypt'].reset();">clear</a>
</div>
<form name="encrypt" action="javascript:encrypt();">
<input type="hidden" name="pkey" value="CACbaJ6iH9FMXYQqGqo0scwp9AaTRHXN4C7+eLyUxjHm3SUdOgdjyLQepqaJhanCX6nwTqDB9jCHt0GBxK2/lSo4J+0q5zE9MZ6GrtmGSo/y96+eF8PvEh+GKvNhO7zOLs0Hm2id4AzXVBjVEOJeJLENDUs8shAJ4OXtkrvVp0wF/LGm5d9LFJpNDs+AcRXjx7fOannZlXx1rHNTAz9dWXBeEkYzT6+Uj2gDkGqdHXMsMW90rweTRPr7YYuHQuHEnDygen6+4KUjtgDwKo7z5LAzySBvl3mJKQf730bSH3E/tDCni4qAdOLRbXWtLHVqjgYO77KrLCLM+0vJk1gnyBN/AAURB/9u5GBYBvVR7kMtSInQGYmrfEWRw1al26vrUALCE026g6j5ZbyHb9qk37+qOhFy85oqX4m2hpCcPXURr27tp01QKPZOCeiGuaBoBnc+MwRlsCBZIVu94Iazq/KhwN9XmLiW3rFgfqpsToHvu25x20FqDjrKnT54DUORAZAGhCyCpERPcZHWNYe6P3OfTihsHh5pT0o74p+JlED48OV6/GFGNYGGVwQCtt9iZTmx1bOA9nRRxMWdck867J/+ATEFxJBDiEoqpjMlVuRUT53DqLuyGztL+cCJ6XAQ3szPgQ//3nC/980mrygwbpqjnW8EmfDaCXtBIQA22O6qrfKt+z/m" />
<input type="hidden" name="keyid" value="89117214f14b6dac" />
<input type="hidden" name="pkey" value="CAC2PVFmVlYbpNDPU+nfc8U/fu/SFs21AEOmUU1SAf8Eh1a7vHs42TpKUyS9VhgnEetFOapfnUhCpWF+HunJ5Fx5jgeqNpogNp7tToLjHWXbYyv57WB9YDAwC2AMt+rX/Hh7T1CQtoMX5oSGbe0p2UlAF77TeSmH0n3Se9U7qPGD8E3/qYcoi2Gs877JEAAfXqkNhQuglv7mJyMRL69yglOntLzBXTspso9qdkc2uH1VCQpJG/hwBIcrf8D3/Iiu5GiG1BQ7g6ujdURE+yc76f8KKfIbfmmkutED0YjvZTkXiq6JeHLygoIAj1yZ5dBFDtR/6qW/0Dh72aHGWBM88rLrAAMFCACb1H1XxpJwiLOiEHeeYICOSyE1uPONJPXnCG+nR3rP8u9jV5k8j2h6lE9lJLt7VHqjnmyKgvLFTLUgn5mNSmFgSU7B+FlxdWrTLzpk3aJAWjLPAIQUOaxakjkVgTk8ggX++nDya7UAJ/g20YpxEXV2UaFeh2wO0/EuS84jWnKXjBuKsvzm97FXN1eF75/dyD0awBN7dW8ckgjrrrA+uVVFtdI+XqqVBk8C0ZIHCaRAOHLlN2CallDm1FbOZpTE3H+untHx5PuYaocpFz1adCpXYn+SQ0HkqFWLONz5u1WxkJ9gn1VS5HpLbNhgKap9d92/U41BoEsbgzIxSC5tQNO5" />
<input type="hidden" name="keyid" value="c71fa5a9b200c2a6" />
<input type="hidden" name="pktype" value="ELGAMAL" />
<ul class="edit rounded">
<li>
<select id="receiver" multiple="multiple" name="receiver">
<!-- <optgroup label="Receiver">-->
<option value ="89117214f14b6dac">Alexander Willner</option>
<option value ="07eae49adbcbe671">GPGMail Project Team</option>
<!-- </optgroup>-->
</select>
</li>
<!--<li><input type="text" name="name" placeholder="Receiver (via URL, search, copy&paste, ...)" id="some_name" /></li>-->
<li><textarea placeholder="Your unencrypted message here" name="text" id="text"></textarea></li>
<li>Sign message <span class="toggle"><input type="checkbox" /></span></li>
<li><input type="password" name="sign_password" placeholder="Password to sign..." value="" id="sign_password" /></li>
Expand All @@ -79,13 +78,13 @@ <h1>Decrypt</h1>
<a class="button" id="cleardecrypt" href="#" onClick="document.forms['decrypt'].reset();">clear</a>
</div>
<form name="decrypt" action="javascript:decrypt();">
<ul class="edit rounded">
<ul class="edit rounded">
<li><textarea placeholder="Your encrypted message here" name="text2" id="text2"></textarea></li>
<li>Verify signature <span class="toggle"><input type="checkbox" /></span></li>
<li><input type="password" name="validate_password" value="" placeholder="Password to decrypt..." id="validate_password" /></li>
<li><input type="text" disabled="disabled" name="howLongDecrypt" placeholder="time needed for decryption" value="" id="howLongDecrypt" /></li>
</ul>
<a style="margin:0 10px;" href="#notimplemented" class="grayButton fade">Decrypt</a>
<a style="margin:0 10px;" href="#" onClick="document.forms['decrypt'].submit();" class="grayButton">Decrypt</a>
</form>
</div>
<div id="addkey">
Expand All @@ -99,7 +98,7 @@ <h2 style="color:#fff;">Search</h2>
<li><input type="text" name="searchstring" placeholder="String" value="" id="searchstring" /></li>
</ul>
<h2 style="color:#fff;">Download</h2>

<ul class="edit rounded">
<li><input type="text" name="download" placeholder="http://" value="http://" id="download" /></li>
<li style="font-weight:normal;"><input type="checkbox" id="download" name="download" value="download">&nbsp;Do not store locally</li>
Expand All @@ -108,7 +107,7 @@ <h2 style="color:#fff;">Copy & Paste</h2>
<ul class="edit rounded">
<li><textarea placeholder="The public key here" name="publickey" id="publickey"></textarea></li>
</ul>
<a style="margin:0 10px;" href="#notimplemented" class="grayButton fade">Import</a>
<a style="margin:0 10px;" href="#notimplemented" class="grayButton fade">Import</a>
</form>
</div>

Expand Down Expand Up @@ -146,8 +145,7 @@ <h2>Layout</h2>
</li>
</ul>
<h2 style="color:#fff">Secret Keys</h2>
<ul class="edit rounded">
<!-- <li><textarea placeholder="Your secret key here (stored within an HTML 5 database)" ></textarea></li>-->
<ul class="edit rounded">
<li>
<select id="secretkeys" name="Secret Keys" multiple="multiple">
<option value ="89117214f14b6dac" selected="selected">Alexander Willner</option>
Expand Down Expand Up @@ -177,4 +175,4 @@ <h1>GPGMail</h1>
</div>
</div>
</body>
</html>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 29 additions & 9 deletions scripts/jqtouch/gpgmail.js
Expand Up @@ -6,8 +6,11 @@
});
// Some sample Javascript functions:
$(function(){
fixCopyPaste($('#text2'));
fixCopyPaste($('#text'));

// Show a swipe event on swipe test
$('#swipeme').swipe(function(evt, data) {
$('#swipeme').swipe(function(evt, data) {
$(this).html('You swiped <strong>' + data.direction + '</strong>!');
});
$('a[target="_blank"]').click(function() {
Expand All @@ -20,7 +23,7 @@
});
// Page animation callback events
$('#pageevents').
bind('pageAnimationStart', function(e, info){
bind('pageAnimationStart', function(e, info){
$(this).find('.info').append('Started animating ' + info.direction + '&hellip; ');
}).
bind('pageAnimationEnd', function(e, info){
Expand All @@ -43,14 +46,14 @@


/* Option: default sign --------------------------------------------------- */
$(function() {
$('input[name="defaultSign"]').bind('click',function() {
if($(this).is(':checked')) {
dbSetDefaultSign(1);
} else {
$(function() {
$('input[name="defaultSign"]').bind('click',function() {
if($(this).is(':checked')) {
dbSetDefaultSign(1);
} else {
dbSetDefaultSign(0);
}
});
}
});
});
//todo: invoke and use dbIsDefaultSign() here.
/* ------------------------------------------------------------------------ */
Expand All @@ -61,3 +64,20 @@ function addSendButton () {
document.getElementById("sendMailButton").removeAttribute('disabled');
document.getElementById("sendMailButton").style.color = "#fff";
}

function fixCopyPaste(el) {
el.bind('paste', function(e) {
var element = $(this).context;

var text = $(this).val();
var start = element.selectionStart;
var pastedText = e.originalEvent.clipboardData.getData('text/plain');
$(this).val(text.substring(0, element.selectionStart)
+pastedText
+text.substring(element.selectionEnd, text.length));
element.selectionStart = start+pastedText.length;
element.selectionEnd = element.selectionStart;
});
}


0 comments on commit 56f5a25

Please sign in to comment.