<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>_attachments/html.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,25 +1,3 @@
-function escapeHTML(st) {                                       
-  return(                                                                 
-    st &amp;&amp; st.replace(/&amp;/g,'&amp;amp;').                                         
-      replace(/&gt;/g,'&amp;gt;').                                           
-      replace(/&lt;/g,'&amp;lt;').                                           
-      replace(/&quot;/g,'&amp;quot;')                                         
-  );                                                                     
-};
-
-function safeHTML(st, len) {
-  return st ? escapeHTML(st.substring(0,len)) : '';
-}
-
-function linkify(body, term) {
-  return body.replace(/https?\:\/\/\S+/g,function(a) {
-    return '&lt;a target=&quot;_blank&quot; href=&quot;'+a+'&quot;&gt;'+a+'&lt;/a&gt;';
-  }).replace(/\@([\w\-]+)/g,function(user,name) {
-    return '&lt;a target=&quot;_blank&quot; href=&quot;http://twitter.com/'+name+'&quot;&gt;'+user+'&lt;/a&gt;';
-  }).replace(/\#([\w\-]+)/g,function(word,term) {
-    return '&lt;a href=&quot;#'+encodeURIComponent(term)+'&quot;&gt;'+word+'&lt;/a&gt;';
-  });
-};
 
 function refreshView(app, cname) {
   app.view(&quot;channels&quot;,{
@@ -82,26 +60,24 @@ function joinChannel(app, cname) {
   // this is where we hang on the continuous _changes api
   // get the raw xhr
   refreshView(app, cname);
-  connectToChanges(app, cname, refreshView);
+  connectToChanges(app, function() {
+    refreshView(app, cname);
+  });
 };
 
-function changeXHR(app, cname, db_info, fun) {
-  var c_xhr = jQuery.ajaxSettings.xhr();
-  c_xhr.open(&quot;GET&quot;, app.db.uri+&quot;_changes?continuous=true&amp;since=&quot;+db_info.update_seq, true);
-  c_xhr.send(&quot;&quot;);
-  c_xhr.onreadystatechange = function() {
-    fun(app, cname);
+function connectToChanges(app, fun) {
+  function resetHXR(x) {
+    x.abort();
+    connectToChanges(app, fun);    
   };
-  return c_xhr;
-}
-
-function connectToChanges(app, cname, fun) {
-  app.db.info({success: function(db_info) {
-    var x = changeXHR(app, cname, db_info, fun);
-    setInterval(function() {
-      x.abort();
-      x = changeXHR(app, cname, db_info, fun);
-    },1000 * 60);
+  app.db.info({success: function(db_info) {  
+    var c_xhr = jQuery.ajaxSettings.xhr();
+    c_xhr.open(&quot;GET&quot;, app.db.uri+&quot;_changes?continuous=true&amp;since=&quot;+db_info.update_seq, true);
+    c_xhr.send(&quot;&quot;);
+    c_xhr.onreadystatechange = fun;
+    setTimeout(function() {
+      resetHXR(c_xhr);      
+    }, 1000 * 60);
   }});
-}
+};
 </diff>
      <filename>_attachments/app.js</filename>
    </modified>
    <modified>
      <diff>@@ -41,6 +41,7 @@
   &lt;script src=&quot;/_utils/script/jquery.couch.js&quot;&gt;&lt;/script&gt;
   &lt;script src=&quot;/_utils/script/jquery.cookies.js&quot;&gt;&lt;/script&gt;
   &lt;script src=&quot;vendor/couchapp/jquery.couchapp.js&quot;&gt;&lt;/script&gt;
+  &lt;script src=&quot;html.js&quot;&gt;&lt;/script&gt;
   &lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;
   &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
   var c_xhr;</diff>
      <filename>_attachments/channel.html</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,7 @@
   &lt;script src=&quot;/_utils/script/jquery.js&quot;&gt;&lt;/script&gt;
   &lt;script src=&quot;/_utils/script/jquery.couch.js&quot;&gt;&lt;/script&gt;
   &lt;script src=&quot;vendor/couchapp/jquery.couchapp.js&quot;&gt;&lt;/script&gt;
+  &lt;script src=&quot;html.js&quot;&gt;&lt;/script&gt;
   &lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;
   
   &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;</diff>
      <filename>_attachments/index.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 function(doc) {
   // !code helpers/md5.js
-  // !code _attachments/app.js
+  // !code _attachments/html.js
   
   if (doc.channel &amp;&amp; doc.message) {
     var mess = doc.message;</diff>
      <filename>views/channels/map.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>63d4b98be331832712ca499435b83aa053534611</id>
    </parent>
  </parents>
  <author>
    <name>Chris Anderson</name>
    <email>jchris@grabb.it</email>
  </author>
  <url>http://github.com/jchris/toast/commit/b2ac7ef5bbb0f90e2ad66bc6b276167bd20ef1be</url>
  <id>b2ac7ef5bbb0f90e2ad66bc6b276167bd20ef1be</id>
  <committed-date>2009-05-30T07:28:35-07:00</committed-date>
  <authored-date>2009-05-30T07:28:35-07:00</authored-date>
  <message>the better hxr continuous stuff</message>
  <tree>efc328eb967bcaa4f18c1cb55b2e648fbcd14115</tree>
  <committer>
    <name>Chris Anderson</name>
    <email>jchris@grabb.it</email>
  </committer>
</commit>
