Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding in yes/no booleans

  • Loading branch information...
commit 8d4378ab055ac50f1e576c5e6dd43b49401617b2 1 parent f436ada
@dpritchett authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 docs/chatbox.html
  2. +2 −2 public/chatbox.coffee
View
4 docs/chatbox.html
@@ -15,14 +15,14 @@
<p>This class is going to be referred to by some inline JS on <code>index.html</code>
as well as from within the onload business above.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nb">window</span><span class="p">.</span><span class="nx">chatbox</span> <span class="o">=</span>
- <span class="nv">flag: </span><span class="kc">false</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-8">#</a> </div> <p>The <code>toggler()</code> facilitates zebra striping of the chatbox.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">toggler: </span><span class="o">-&gt;</span>
+ <span class="nv">flag: </span><span class="kc">no</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-8">#</a> </div> <p>The <code>toggler()</code> facilitates zebra striping of the chatbox.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">toggler: </span><span class="o">-&gt;</span>
<span class="nx">@flag</span> <span class="o">=</span> <span class="o">not</span> <span class="nx">@flag</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-9">#</a> </div> <p>This <code>packet</code> will be reused for our JSON communications with the server.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">packet:</span>
<span class="nv">name: </span> <span class="s1">&#39;default_name&#39;</span>
<span class="nv">content: </span> <span class="s1">&#39;&#39;</span>
<span class="nv">date: </span> <span class="s1">&#39;&#39;</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-10">#</a> </div> <p>Display an alert in a colored box that fades in and then out.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">alertUser: </span><span class="p">(</span><span class="nx">alertText</span><span class="p">)</span> <span class="o">-&gt;</span>
<span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#alerts&#39;</span><span class="p">).</span><span class="nx">empty</span><span class="p">()</span> <span class="p">.</span>
<span class="nx">append</span><span class="p">(</span><span class="nx">alertText</span><span class="p">)</span> <span class="p">.</span>
- <span class="nx">stop</span><span class="p">(</span><span class="kc">true</span><span class="p">,</span> <span class="kc">true</span><span class="p">)</span> <span class="p">.</span>
+ <span class="nx">stop</span><span class="p">(</span><span class="kc">yes</span><span class="p">,</span> <span class="kc">yes</span><span class="p">)</span> <span class="p">.</span>
<span class="nx">fadeIn</span><span class="p">(</span><span class="mi">500</span><span class="p">,</span>
<span class="o">-&gt;</span> <span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#alerts&#39;</span><span class="p">).</span><span class="nx">fadeOut</span><span class="p">(</span><span class="mi">3000</span><span class="p">))</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-11">#</a> </div> <p>Write a line to the chatbox on the page.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">spitLine: </span><span class="p">(</span><span class="nx">contents</span><span class="p">,</span> <span class="nx">username</span><span class="p">)</span> <span class="o">-&gt;</span>
<span class="k">if</span> <span class="nx">username</span><span class="o">?</span>
View
4 public/chatbox.coffee
@@ -33,7 +33,7 @@ $(document).ready ->
window.chatbox =
- flag: false
+ flag: no
# The `toggler()` facilitates zebra striping of the chatbox.
toggler: ->
@@ -49,7 +49,7 @@ window.chatbox =
alertUser: (alertText) ->
$('#alerts').empty() .
append(alertText) .
- stop(true, true) .
+ stop(yes, yes) .
fadeIn(500,
-> $('#alerts').fadeOut(3000))
Please sign in to comment.
Something went wrong with that request. Please try again.