<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>website/static/demos/jquery.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -703,42 +703,21 @@ intervalB : Behavior Int
 
 &lt;chapter title=&quot;DOM Manipulation&quot;&gt;
 
-&lt;article title=&quot;Creating DOM elements&quot;&gt;
+&lt;article title=&quot;Time-varying DOM Elements&quot;&gt;
 
 &lt;programlisting&gt;
-TAG :: { attribute-name: attribute-value, ...} * HTMLElement * ... -&gt; HTMLElement
-TAG :: HTMLElement * ... -&gt; HTMLElement // no attributes
+TAG :: Behavior { attribute-name: attribute-value, ...} * Behavior HTMLElement * ... -&gt; Behavior HTMLElement
+TAG :: Behavior HTMLElement * ... -&gt; Behavior HTMLElement // no attributes
 &lt;/programlisting&gt;
 
-&lt;p&gt;Flapjax defines functions for building DOM elements compositionally.  For each HTML element, Flapjax defines a function
-with the same name, that constructs the corresponding element.&lt;/p&gt;
-
-&lt;example&gt;
-&lt;programlisting&gt;
-var anchor = A({href: 'http://www.flapjax-lang.org/'},'Flapjax');
-
-var list = UL(LI('Reactive Programming'),
-              LI('JavaScript Framework'),
-              LI({style: { 'font-weight': 'bold' }}, 'No Download Required!'));
-&lt;/programlisting&gt;
-&lt;/example&gt;
-
-&lt;/article&gt;
-
-&lt;article title=&quot;Time-varying DOM elements&quot;&gt;
-
-&lt;programlisting&gt;
-TAGB :: Behavior { attribute-name: attribute-value, ...} * Behavior HTMLElement * ... -&gt; Behavior HTMLElement
-TAGB :: Behavior HTMLElement * ... -&gt; Behavior HTMLElement // no attributes
-&lt;/programlisting&gt;
-
-&lt;p&gt;Flapjax includes support for DOM elements with time-varying components. For each HTML Element, Flapjax defines a
-function with the same name, suffixed with &amp;quot;B&amp;quot;, that constructions the corresponding element.&lt;/p&gt;
+&lt;p&gt;Flapjax includes support for DOM elements with time-varying components. For
+each HTML Element, Flapjax defines a function with the same name that
+constructions the corresponding element.&lt;/p&gt;
 
 &lt;example&gt;
 &lt;programlisting&gt;
 var secondsB = timerE(1000).collectE(0,function(_,x) { return x + 1; }).startsWith(0);
-var spanB = SPANB(&quot;We've been running for &quot;,secondsB,&quot; seconds&quot;);
+var spanB = SPAN(&quot;We've been running for &quot;,secondsB,&quot; seconds&quot;);
 &lt;/programlisting&gt;
 
 &lt;p&gt;Note that this example intersperses a behavior (&lt;code&gt;spanB&lt;/code&gt;) with constant values.&lt;/p&gt;</diff>
      <filename>doc/doc.html</filename>
    </modified>
    <modified>
      <diff>@@ -1283,7 +1283,7 @@ var mapWithKeys = function(obj, f) {
 
 
 var insertAfter = function(parent, newChild, refChild) {
-  if (refChild.nextSibling) {
+  if (typeof refChild != &quot;undefined&quot; &amp;&amp; refChild.nextSibling) {
     parent.insertBefore(newChild, refChild.nextSibling);
   }
   else {
@@ -1607,7 +1607,6 @@ extractValueStaticB = function (domObj, triggerE) {
   var result;
 
   switch (objD.type)  {
-    
     //TODO: checkbox.value instead of status?
   case 'checkbox': 
     result = startsWith(
@@ -1728,6 +1727,7 @@ extractValueStaticB = function (domObj, triggerE) {
       filterRepeatsE(
           actualTriggerE.mapE(getter),getter()),
       getter());
+    break;
   default:
     throw ('extractValueStaticB: unknown value type &quot;' + objD.type + '&quot;');
   }</diff>
      <filename>fx/flapjax-impl.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,3 @@
-// Behavior contract is either a higher-order behavior or a flat (constant) 
-// value
-// remove condE it is stupid
-// DOM contract list
-// dictionary contract (on $O)
-
 {
   
 function isHtml(x) {</diff>
      <filename>fx/flapjax.jsi</filename>
    </modified>
    <modified>
      <diff>@@ -86,7 +86,7 @@ contact mjames@gmail.com
       #stop.disable, #play.disable { display:none; }
     &lt;/style&gt;
     
-    &lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
+    &lt;script type=&quot;text/javascript&quot; src=&quot;/demos/jquery.js&quot;&gt;&lt;/script&gt;
     &lt;script type=&quot;text/javascript&quot; src=&quot;/fx/flapjax.js&quot;&gt;&lt;/script&gt;
     
     &lt;script type=&quot;text/javascript&quot;&gt;</diff>
      <filename>website/static/demos/carousel.html</filename>
    </modified>
    <modified>
      <diff>@@ -31,8 +31,7 @@ function collapsedItemsB(linksE,maxLength) {
   .startsWith([ ])
   .liftB(function (items) {
       return items.length == 0 ? 'Type to start' : UL(items);
-  })
-  .switchB();
+  });
 };
 
 function loader() {</diff>
      <filename>website/static/demos/delicious3.html</filename>
    </modified>
    <modified>
      <diff>@@ -33,8 +33,7 @@ function collapsedItemsB(linksE,maxLength) {
   .startsWith([ ])
   .liftB(function (items) {
       return items.length == 0 ? 'Type to start' : UL(items);
-  })
-  .switchB();
+  });
 };
 
 var historyE = function(nextE) {
@@ -57,8 +56,7 @@ var historyE = function(nextE) {
       return map(function(item) { return item.anchor; },items);
     })
     .startsWith('No requests yet.')
-    .liftB(function (anchors) { return DIV(anchors); })
-    .switchB();
+    .liftB(function (anchors) { return DIV(anchors); });
   
   var oldE = linksE.mapE(function(items) {
       return mergeE.apply(this,</diff>
      <filename>website/static/demos/delicious4.html</filename>
    </modified>
    <modified>
      <diff>@@ -125,12 +125,12 @@ function loader() {
   var extra = 10;
   var backgroundBarB =
   insertValueB(
-    'menu',
     startsWith(
       mergeE(
         menuMouseLeaveE.constantE( (minSize + extra) + 'px'),
         menuMouseOverE.constantE( (maxSize + extra) + 'px')),
       (minSize + extra) + 'px'),
+    'menu',
     'style', 'height');
   
 }
@@ -145,6 +145,6 @@ function loader() {
 &lt;div class=&quot;menuBox&quot;&gt;Last item has a lot of text and it overflows nicely&lt;/div&gt;
 
 &lt;/div&gt;
-&lt;span id=&quot;msgs&quot;/&gt;
+&lt;span id=&quot;msgs&quot;&gt;&lt;/span&gt;
 &lt;/body&gt;
 &lt;/html&gt;</diff>
      <filename>website/static/demos/fisheye.html</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,7 @@ function load(ignored_arg) {
 // autoSave :: String * EventStream save 
 //          -&gt; { input: TEXTAREA, savedE: EventStream }
 function autoSave(initial,saveE) {
-  var input = TEXTAREA_(initial);
+  var input = TEXTAREA(initial);
 
   var savedE = 
     getWebServiceObjectE(saveE.snapshotE($B(input)).mapE(save));
@@ -91,7 +91,7 @@ Last Saved: &lt;span id='savedTime'&gt;&lt;/span&gt;
 
 &lt;form&gt;
 &lt;span id=&quot;inputPlaceholder&quot;&gt;&lt;/span&gt;&lt;br/&gt;
-&lt;input type='button' id='saveButton' value='Save Now'&gt;&lt;/input&gt;
+&lt;input type='button' id='saveButton' value='Save Now'/&gt;
 &lt;/form&gt;
 
 &lt;p&gt;The currently saved draft is:&lt;/p&gt;</diff>
      <filename>website/static/demos/persistent_drafts.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;html&gt;
 
 &lt;head&gt;
-&lt;title&gt;Flapjax: Ping&lt;/title&gt;
+&lt;title&gt;Flapjax: Flying Boxes&lt;/title&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;/fx/flapjax.js&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;
 
@@ -87,7 +87,7 @@ function start() {
 &lt;body onload=&quot;javascript:start()&quot;&gt;
 
 &lt;marquee direction=&quot;down&quot;&gt;
-&lt;font face=&quot;cursive&quot; size=&quot;50&quot;&gt;TODO: Boxes are not balls&lt;/font&gt;
+&lt;font face=&quot;cursive&quot; size=&quot;50&quot;&gt;direction=down&lt;/font&gt;
 &lt;/marquee&gt;
 
 </diff>
      <filename>website/static/demos/ping.html</filename>
    </modified>
    <modified>
      <diff>@@ -120,15 +120,21 @@ function renderBehavior(b) {
     return tuple(Math.floor((next.fst - prev.fst) / 10), next.snd) }));
 
 
-   var asSpans = withWidths.mapE(theRealMap(function(p) {
-    return SPAN(SPAN({ style: { width: p.fst,
-                                border: &quot;1px solid black&quot;,
-                                margin: &quot;0px&quot;,
-                                padding: &quot;5px&quot;,
-                                float: &quot;left&quot;,
-                                overflow: &quot;hidden&quot;,
-                                backgroundColor: &quot;pink&quot; } }, 
-                     p.snd)) }));
+   var asSpans = withWidths.mapE(function(lst) {
+    var left = 0;
+    return theRealMap(function(p) {
+      var myLeft = left;
+      left = left + p.fst;
+      return SPAN(SPAN({ style: { width: p.fst,
+                                  border: &quot;1px solid black&quot;,
+                                  left: myLeft,
+                                  margin: &quot;0px&quot;,
+                                  padding: &quot;5px&quot;,
+                                  position: &quot;absolute&quot;,
+                                  overflow: &quot;hidden&quot;,
+                                  backgroundColor: &quot;pink&quot; } }, 
+                       p.snd))})
+      (lst)});
 
   return asSpans.startsWith(empty).liftB(function(lst) {
     return DIV.apply(this, listToArray(lst)) }) }
@@ -196,7 +202,7 @@ function compile(srcE) {
   return srcE.mapE(function(src) {
     if (src.doNotCompile) {
       return oneE(src.txt) }
-    else { console.log(src.txt);
+    else { 
       return getWebServiceObjectE(oneE({
         url : &quot;/fxserver/compile_expr&quot;,
         request: &quot;rawPost&quot;,
@@ -206,11 +212,15 @@ function compile(srcE) {
 
 
 function interact(compileB) {
-  var input = DIV({ style: { minWidth: &quot;90%&quot;, 
+  var input = DIV({ contentEditable: true });
+  var inputWrapper = DIV({ style: { minWidth: &quot;90%&quot;, position: &quot;absolute&quot;,
+                                    display: &quot;inline&quot; }},
+                         input);
+  /* var input = DIV({ style: { minWidth: &quot;90%&quot;, 
                              position: &quot;absolute&quot;, 
                              display: &quot;inline&quot; }, 
                      contentEditable: true}, &quot;&quot;);
-
+  */
   
   var srcE = $E(input, &quot;keypress&quot;).filterE(isAltEnterPressed)
              .snapshotE(compileB).mapE(function(doNotCompile) {
@@ -238,7 +248,7 @@ function interact(compileB) {
     DIV({ style: { fontSize: valE.constantE(&quot;14pt&quot;).startsWith(&quot;24pt&quot;), 
                    position: &quot;relative&quot;, 
                    width: &quot;100%&quot;,  } },
-        &quot;&gt; &quot;, input),
+        &quot;&gt; &quot;, inputWrapper),
     outputE.startsWith(constantB(&quot;&quot;)).switchB(),
     nextE.startsWith(&quot;&quot;));
 </diff>
      <filename>website/static/demos/repl.js</filename>
    </modified>
    <modified>
      <diff>@@ -65,7 +65,7 @@ startSec = Math.floor(start / 1000)
 now = timerB(1000)
 nowSec = Math.floor(now / 1000)
 clickE = $E(&quot;reset&quot;, &quot;click&quot;)
-clickSecE = clicks.snapshotE(nowSec)
+clickSecE = clickE.snapshotE(nowSec)
 diff = nowSec - clickSecE.startsWith(startSec)
 -- click Reset --
 showTime(diff * 25)</diff>
      <filename>website/static/demos/timer.html</filename>
    </modified>
    <modified>
      <diff>@@ -98,7 +98,7 @@ function loader() {
   insertValueB(notB(readyForSubmitB), 'submitter', 'disabled');
   
   insertDomB(
-    DIVB(
+    DIV(
       {id: 'follower',
         style: 
         {color: '#FFFFFF',</diff>
      <filename>website/static/demos/validator.html</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>fx/prototype.js</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>5c954033d58cfea81458e1e0e04cbbc78b51e0a9</id>
    </parent>
  </parents>
  <author>
    <name>Arjun Guha</name>
    <email>arjun@cs.brown.edu</email>
  </author>
  <url>http://github.com/arjunguha/flapjax/commit/4400bf1c66412d887386465e60b9b86d227c1e01</url>
  <id>4400bf1c66412d887386465e60b9b86d227c1e01</id>
  <committed-date>2009-10-31T13:59:47-07:00</committed-date>
  <authored-date>2009-10-31T09:30:53-07:00</authored-date>
  <message>Bugfixes to Flapjax.  Updates to demos for latest Flapjax.  Added jQuery.</message>
  <tree>8f504bbb4fcf0d99caf598aadfe6d7ffacefbd9a</tree>
  <committer>
    <name>Arjun Guha</name>
    <email>arjun@cs.brown.edu</email>
  </committer>
</commit>
