[personal profile] kpreid

I'm on Google Wave (by way of my participation in GSoC 2009). Tell me what's worth my time to do with it.

My ID is apparently kpreid.switchb.org@googlewave.com. (kpreid was taken, hmph.)

(no subject)

Date: 2010-04-17 06:40 (UTC)
From: [identity profile] darius.livejournal.com
Great.

I've been learning Javascript lately but haven't got around to Caja yet. (My first Javascript program, whee: http://wry.me/toys/palindromedary/ )

(no subject)

Date: 2010-04-17 12:53 (UTC)
From: [identity profile] kpreid.livejournal.com
diff --git a/palindrome.html b/palindrome.html
index 250be6c..5577ad8 100644
--- a/palindrome.html
+++ b/palindrome.html
@@ -10,7 +10,7 @@
   <script src="palindrome.jpp.js"></script>
   <script src="dom.js"></script>
 
-  <form name="palin" method="get" action="palin.html">
+  <form name="palin" method="get" action="">
   <p>I&#8217;m
   a <a href="http://www.ursulakleguin.com/Poetry-Palindromedary.html">palindromedary</a>,
   and I so love palindromes that I&#8217;ll make one out of whatever
@@ -24,11 +24,10 @@
     <div id="footer" style="font-size:
     smaller"><a href="http://github.com/darius/js-playground">Source
     code</a> on GitHub.
-      <p><em>Copyright &#169; 2010 <a href="http://wry.me/blog/">Darius Bacon</a><br/></em></div></div>
+      <p><em>Copyright &#169; 2010 <a href="http://wry.me/blog/">Darius Bacon</a><br/></em></div>
   <script type="text/javascript">
 
-    var palin = document.forms.palin;
-    var input = palin.elements.input;
+    var input = $("textfield");
     input.focus();
 
     function makeYum() {
@@ -48,9 +47,11 @@
         output.replaceChild(completed, output.firstChild);
     }
     function updateOutputSoon(event) {
-        setTimeout(updateOutput, 10);
+        setTimeout(updateOutput, 0);
     }
-    registerEventHandler($("textfield"), "keypress", updateOutputSoon);
+    registerEventHandler(input, "change", updateOutputSoon);
+    registerEventHandler(input, "keyup", updateOutputSoon);
+    registerEventHandler(input, "keydown", updateOutputSoon);
 
   </script>
   <script src="count_big.js"></script>
  1. Action refers to this page, so hitting return isn't a 404.
  2. Stray /div tag.
  3. No need to use anything but IDs.
  4. No specific delay is needed; the important thing is doing things after this event's handling has finished.
  5. This helps respond to the delete key (using keydown) as well as responding at least after blur if non-keyboard-based input is used. (I haven't found a way to respond to all modifications immediately.)

(no subject)

Date: 2010-04-17 18:33 (UTC)
From: [identity profile] darius.livejournal.com
Thank you!