-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
622 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
### | ||
CoffeeScript Compiler v0.9.2 | ||
CoffeeScript Compiler v0.9.3 | ||
Released under the MIT License | ||
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
switch day | ||
when "Mon" then goToWork() | ||
when "Tue" then goToThePark() | ||
when "Thu" then goIceFishing() | ||
when "Mon" then go work | ||
when "Tue" then go relax | ||
when "Thu" then go iceFishing | ||
when "Fri", "Sat" | ||
if day is bingoDay | ||
goToBingo() | ||
goDancing() | ||
when "Sun" then goToChurch() | ||
else goToWork() | ||
go bingo | ||
go dancing | ||
when "Sun" then go church | ||
else go work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> <html> <head> <title>browser.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="browser.html"> browser.coffee </a> <a class="source" href="cake.html"> cake.coffee </a> <a class="source" href="coffee-script.html"> coffee-script.coffee </a> <a class="source" href="command.html"> command.coffee </a> <a class="source" href="grammar.html"> grammar.coffee </a> <a class="source" href="helpers.html"> helpers.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="lexer.html"> lexer.coffee </a> <a class="source" href="nodes.html"> nodes.coffee </a> <a class="source" href="optparse.html"> optparse.coffee </a> <a class="source" href="repl.html"> repl.coffee </a> <a class="source" href="rewriter.html"> rewriter.coffee </a> <a class="source" href="scope.html"> scope.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> browser.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-1">#</a> </div> <p>Activate CoffeeScript in the browser by having it compile and evaluate | ||
all script tags with a content-type of <code>text/coffeescript</code>. | ||
This happens on page load.</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">if</span> <span class="nb">document</span><span class="o">?</span><span class="p">.</span><span class="nx">getElementsByTagName</span> | ||
<span class="nv">grind = </span><span class="p">(</span><span class="nx">coffee</span><span class="p">)</span> <span class="o">-></span> | ||
<span class="nx">setTimeout</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">compile</span> <span class="nx">coffee</span> | ||
<span class="nv">grindRemote = </span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="o">-></span> | ||
<span class="nv">xhr = </span><span class="k">new</span> <span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">ActiveXObject</span> <span class="o">or</span> <span class="nx">XMLHttpRequest</span><span class="p">)(</span><span class="s1">'Microsoft.XMLHTTP'</span><span class="p">)</span> | ||
<span class="nx">xhr</span><span class="p">.</span><span class="nx">open</span> <span class="s1">'GET'</span><span class="p">,</span> <span class="nx">url</span><span class="p">,</span> <span class="kc">true</span> | ||
<span class="nx">xhr</span><span class="p">.</span><span class="nx">overrideMimeType</span> <span class="s1">'text/plain'</span> <span class="k">if</span> <span class="s1">'overrideMimeType'</span> <span class="k">of</span> <span class="nx">xhr</span> | ||
<span class="nv">xhr.onreadystatechange = </span><span class="o">-></span> | ||
<span class="nx">grind</span> <span class="nx">xhr</span><span class="p">.</span><span class="nx">responseText</span> <span class="k">if</span> <span class="nx">xhr</span><span class="p">.</span><span class="nx">readyState</span> <span class="o">is</span> <span class="mi">4</span> | ||
<span class="nx">xhr</span><span class="p">.</span><span class="nx">send</span> <span class="kc">null</span> | ||
<span class="nv">processScripts = </span><span class="o">-></span> | ||
<span class="k">for</span> <span class="nx">script</span> <span class="k">in</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span> <span class="s1">'script'</span> | ||
<span class="k">if</span> <span class="nx">script</span><span class="p">.</span><span class="nx">type</span> <span class="o">is</span> <span class="s1">'text/coffeescript'</span> | ||
<span class="k">if</span> <span class="nx">script</span><span class="p">.</span><span class="nx">src</span> | ||
<span class="nx">grindRemote</span> <span class="nx">script</span><span class="p">.</span><span class="nx">src</span> | ||
<span class="k">else</span> | ||
<span class="nx">grind</span> <span class="nx">script</span><span class="p">.</span><span class="nx">innerHTML</span> | ||
<span class="kc">null</span> | ||
<span class="k">if</span> <span class="nb">window</span><span class="p">.</span><span class="nx">addEventListener</span> | ||
<span class="nx">addEventListener</span> <span class="s1">'DOMContentLoaded'</span><span class="p">,</span> <span class="nx">processScripts</span><span class="p">,</span> <span class="kc">false</span> | ||
<span class="k">else</span> | ||
<span class="nx">attachEvent</span> <span class="s1">'onload'</span><span class="p">,</span> <span class="nx">processScripts</span> | ||
|
||
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.