Changeset 47
- Timestamp:
- 07/26/06 14:55:50 (2 years ago)
- Files:
-
- 10kz/scripts/crypto-ui-injector.user.js (modified) (7 diffs)
- 10kz/shell/perl.jm3 (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
10kz/scripts/crypto-ui-injector.user.js
r46 r47 123 123 124 124 function sign_message() { 125 //debugger;126 //top.js._CM_OnSendButtonKeyDown();127 //return true;128 129 130 125 var snd = document.getElementById('snd'); 131 126 snd = !snd ? document.getElementById('nc_0') : snd; … … 164 159 165 160 p.addEventListener("keypress", function(event) { 166 handle_enter(this, event);161 broker_remote_read(this, event); 167 162 }, true); 168 163 … … 190 185 link_button.setAttribute( "href", "#" ); 191 186 link_button.addEventListener("click", function(event) { 192 log( " XXXsign_message(): listener firing" );193 handle_enter(document.getElementById( "passphrase" ), "manual");187 log( "sign_message(): listener firing" ); 188 broker_remote_read( document.getElementById( "passphrase" ), "manual"); 194 189 }, true); 195 190 var instruction = document.createTextNode( " Sign " ); … … 346 341 } 347 342 348 function handle_enter( myfield, e ) {343 function broker_remote_read( myfield, e ) { 349 344 var mode = myfield.getAttribute( "mode" ) ? myfield.getAttribute( "mode" ) : "decrypt"; 350 345 … … 503 498 dec.appendChild( document.createTextNode( "Decrypt" )); 504 499 dec.addEventListener('click', function(event) { 505 log( " XXXdecrypt listener firing" );500 log( "decrypt listener firing" ); 506 501 decrypt_message(event, ct); 507 502 }, true); 508 503 509 504 var f = document.createElement("form"); 510 f.setAttribute("style", "padding: 0.5em; background-color: #dddddd; border: 2px solid red; margin-bottom: 1.0em;");505 f.setAttribute("style", "padding: 0.5em; background-color: #dddddd; border: 2px solid red; width: 95%; margin-bottom: 1.0em;"); 511 506 f.setAttribute( "id", "jm3_status_pane" ); 512 507 … … 514 509 p.setAttribute( "mode", "decrypt" ); 515 510 p.addEventListener("keypress", function(event) { 516 handle_enter(this, event);511 broker_remote_read(this, event); 517 512 }, true); 518 513 519 f.appendChild( document.createTextNode( "This is a secret message (woo, scary!). To read it, enter your passphrase: "));514 f.appendChild( document.createTextNode( "This is an encrypted message (wooo, scary!). To read it, enter your passphrase: ")); 520 515 f.appendChild( p ); 521 516 f.appendChild( dec ); … … 539 534 var injection_point = buttons[i]; 540 535 541 /* lookfor the "Discard" to insertBefore -- inserting before Send does odd things */536 /* search for the "Discard" to insertBefore -- inserting before Send does odd things */ 542 537 if (injection_point.getAttribute('id')=='x') { 543 538 10kz/shell/perl.jm3
r45 r47 9 9 10 10 $debug = 0; 11 if( $debug ) { 12 open LOG, ">/tmp/10kz.log" or print "\n\nCouldn't open logfile for writing: $!\n"; 13 print LOG "*** starting new crypto session: ***\n"; 14 my $pwd = `pwd`; 15 print LOG "pwd: $pwd\n"; 16 } 11 17 12 18 # FIXME: ugh, unless we perl-ify the other shell scripts, we need a way to share the configure.sh info between perl + shell … … 15 21 16 22 #print header; 17 if( $debug == 1 ) { print header('text/XMl'); } else {23 #if( $debug == 1 ) { print header('text/XMl'); } else { 18 24 print header('text/plain'); 19 }25 #} 20 26 21 27 if (param()) { … … 50 56 if( $mode eq "sign" ) { $cmd = $sign_cmd; } 51 57 if( $mode eq "decrypt" ) { $cmd = $decrypt_cmd; } 52 if( $debug == 1 ) { print "$cmd\n"; }53 if( $debug == 1 ) { print "$plaintext\n"; }58 if( $debug == 1 ) { print LOG "\$cmd: $cmd\n"; } 59 if( $debug == 1 ) { print LOG "\$plaintext: $plaintext\n"; } 54 60 55 61 # FIXME: need to tee off stderr here so we can capture and optionally grovel through GPG's egregiously bad error messages … … 71 77 } 72 78 73 74 if( $debug == 1 ) { print "out: $out\n"; } 79 if( $debug == 1 ) { 80 print LOG "err: $err\n"; 81 print LOG "out: $out\n"; 82 } 75 83 76 84 if( -f "$pt.asc" ) {