Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added docs and YUI script collection

  • Loading branch information...
commit 83ae15c86bca8b1ad215cc2e8291d02841775d47 1 parent fdc65f3
@niftylettuce authored
View
186 docs/docco.css
@@ -0,0 +1,186 @@
+/*--------------------- Layout and Typography ----------------------------*/
+body {
+ font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
+ font-size: 15px;
+ line-height: 22px;
+ color: #252519;
+ margin: 0; padding: 0;
+}
+a {
+ color: #261a3b;
+}
+ a:visited {
+ color: #261a3b;
+ }
+p {
+ margin: 0 0 15px 0;
+}
+h1, h2, h3, h4, h5, h6 {
+ margin: 0px 0 15px 0;
+}
+ h1 {
+ margin-top: 40px;
+ }
+#container {
+ position: relative;
+}
+#background {
+ position: fixed;
+ top: 0; left: 525px; right: 0; bottom: 0;
+ background: #f5f5ff;
+ border-left: 1px solid #e5e5ee;
+ z-index: -1;
+}
+#jump_to, #jump_page {
+ background: white;
+ -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
+ -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
+ font: 10px Arial;
+ text-transform: uppercase;
+ cursor: pointer;
+ text-align: right;
+}
+#jump_to, #jump_wrapper {
+ position: fixed;
+ right: 0; top: 0;
+ padding: 5px 10px;
+}
+ #jump_wrapper {
+ padding: 0;
+ display: none;
+ }
+ #jump_to:hover #jump_wrapper {
+ display: block;
+ }
+ #jump_page {
+ padding: 5px 0 3px;
+ margin: 0 0 25px 25px;
+ }
+ #jump_page .source {
+ display: block;
+ padding: 5px 10px;
+ text-decoration: none;
+ border-top: 1px solid #eee;
+ }
+ #jump_page .source:hover {
+ background: #f5f5ff;
+ }
+ #jump_page .source:first-child {
+ }
+table td {
+ border: 0;
+ outline: 0;
+}
+ td.docs, th.docs {
+ max-width: 450px;
+ min-width: 450px;
+ min-height: 5px;
+ padding: 10px 25px 1px 50px;
+ overflow-x: hidden;
+ vertical-align: top;
+ text-align: left;
+ }
+ .docs pre {
+ margin: 15px 0 15px;
+ padding-left: 15px;
+ }
+ .docs p tt, .docs p code {
+ background: #f8f8ff;
+ border: 1px solid #dedede;
+ font-size: 12px;
+ padding: 0 0.2em;
+ }
+ .pilwrap {
+ position: relative;
+ }
+ .pilcrow {
+ font: 12px Arial;
+ text-decoration: none;
+ color: #454545;
+ position: absolute;
+ top: 3px; left: -20px;
+ padding: 1px 2px;
+ opacity: 0;
+ -webkit-transition: opacity 0.2s linear;
+ }
+ td.docs:hover .pilcrow {
+ opacity: 1;
+ }
+ td.code, th.code {
+ padding: 14px 15px 16px 25px;
+ width: 100%;
+ vertical-align: top;
+ background: #f5f5ff;
+ border-left: 1px solid #e5e5ee;
+ }
+ pre, tt, code {
+ font-size: 12px; line-height: 18px;
+ font-family: Monaco, Consolas, "Lucida Console", monospace;
+ margin: 0; padding: 0;
+ }
+
+
+/*---------------------- Syntax Highlighting -----------------------------*/
+td.linenos { background-color: #f0f0f0; padding-right: 10px; }
+span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
+body .hll { background-color: #ffffcc }
+body .c { color: #408080; font-style: italic } /* Comment */
+body .err { border: 1px solid #FF0000 } /* Error */
+body .k { color: #954121 } /* Keyword */
+body .o { color: #666666 } /* Operator */
+body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
+body .cp { color: #BC7A00 } /* Comment.Preproc */
+body .c1 { color: #408080; font-style: italic } /* Comment.Single */
+body .cs { color: #408080; font-style: italic } /* Comment.Special */
+body .gd { color: #A00000 } /* Generic.Deleted */
+body .ge { font-style: italic } /* Generic.Emph */
+body .gr { color: #FF0000 } /* Generic.Error */
+body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+body .gi { color: #00A000 } /* Generic.Inserted */
+body .go { color: #808080 } /* Generic.Output */
+body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
+body .gs { font-weight: bold } /* Generic.Strong */
+body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+body .gt { color: #0040D0 } /* Generic.Traceback */
+body .kc { color: #954121 } /* Keyword.Constant */
+body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
+body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
+body .kp { color: #954121 } /* Keyword.Pseudo */
+body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
+body .kt { color: #B00040 } /* Keyword.Type */
+body .m { color: #666666 } /* Literal.Number */
+body .s { color: #219161 } /* Literal.String */
+body .na { color: #7D9029 } /* Name.Attribute */
+body .nb { color: #954121 } /* Name.Builtin */
+body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
+body .no { color: #880000 } /* Name.Constant */
+body .nd { color: #AA22FF } /* Name.Decorator */
+body .ni { color: #999999; font-weight: bold } /* Name.Entity */
+body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
+body .nf { color: #0000FF } /* Name.Function */
+body .nl { color: #A0A000 } /* Name.Label */
+body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
+body .nt { color: #954121; font-weight: bold } /* Name.Tag */
+body .nv { color: #19469D } /* Name.Variable */
+body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
+body .w { color: #bbbbbb } /* Text.Whitespace */
+body .mf { color: #666666 } /* Literal.Number.Float */
+body .mh { color: #666666 } /* Literal.Number.Hex */
+body .mi { color: #666666 } /* Literal.Number.Integer */
+body .mo { color: #666666 } /* Literal.Number.Oct */
+body .sb { color: #219161 } /* Literal.String.Backtick */
+body .sc { color: #219161 } /* Literal.String.Char */
+body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
+body .s2 { color: #219161 } /* Literal.String.Double */
+body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
+body .sh { color: #219161 } /* Literal.String.Heredoc */
+body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
+body .sx { color: #954121 } /* Literal.String.Other */
+body .sr { color: #BB6688 } /* Literal.String.Regex */
+body .s1 { color: #219161 } /* Literal.String.Single */
+body .ss { color: #19469D } /* Literal.String.Symbol */
+body .bp { color: #954121 } /* Name.Builtin.Pseudo */
+body .vc { color: #19469D } /* Name.Variable.Class */
+body .vg { color: #19469D } /* Name.Variable.Global */
+body .vi { color: #19469D } /* Name.Variable.Instance */
+body .il { color: #666666 } /* Literal.Number.Integer.Long */
View
35 docs/server.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html> <html> <head> <title>server.js</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 &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="server.html"> server.js </a> <a class="source" href="settings.html"> settings.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> server.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <pre><code>easteregg.in - where you go to get your website's easter eggs
+Copyright (c) 2011 Nick Baugh (niftylettuce@gmail.com)
+MIT Licensed
+</code></pre> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Built with <a href="http://expressling.com/">Expressling</a></p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <ul>
+<li>Maintainer: <a href="https://twitter.com/#!/niftylettuce">@niftylettuce</a></li>
+<li>Twitter: <a href="https://twitter.com/#!/eastereggin">@eastereggin</a></li>
+<li>Facebook: <a href="https://www.facebook.com/eastereggin">https://www.facebook.com/eastereggin</a></li>
+<li>Website: <a href="http://easteregg.in/">http://easteregg.in/</a></li>
+<li>Github: <a href="https://github.com/niftylettuce/expressling/">https://github.com/niftylettuce/expressling/</a></li>
+</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <h1>Expressling</h1> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <h2>Express</h2> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">express</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;express&#39;</span><span class="p">)</span>
+ <span class="p">,</span> <span class="nx">app</span> <span class="o">=</span> <span class="nx">express</span><span class="p">.</span><span class="nx">createServer</span><span class="p">()</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <h2>Common</h2> </td> <td class="code"> <div class="highlight"><pre> <span class="p">,</span> <span class="nx">fs</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;fs&#39;</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <h2>Config</h2>
+
+<p>Based on your project's needs, you should configure <code>package.json</code>
+ accordingly to the <a href="http://npmjs.org">npm</a> packages used.</p>
+
+<ul>
+<li><a href="http://wiki.commonjs.org/wiki/Packages/1.0">http://wiki.commonjs.org/wiki/Packages/1.0</a></li>
+</ul> </td> <td class="code"> <div class="highlight"><pre> <span class="p">,</span> <span class="nx">config</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./config.json&#39;</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <h2>Settings</h2> </td> <td class="code"> <div class="highlight"><pre> <span class="p">,</span> <span class="nx">settings</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./settings&#39;</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <h2>Environment</h2> </td> <td class="code"> <div class="highlight"><pre> <span class="p">,</span> <span class="nx">env</span> <span class="o">=</span> <span class="nx">process</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">NODE_ENV</span> <span class="o">||</span> <span class="s1">&#39;development&#39;</span>
+ <span class="p">,</span> <span class="nx">port</span> <span class="o">=</span> <span class="nx">process</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">PORT</span> <span class="o">||</span> <span class="nx">config</span><span class="p">[</span><span class="nx">env</span><span class="p">].</span><span class="nx">port</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <h1>Load settings</h1> </td> <td class="code"> <div class="highlight"><pre><span class="nx">settings</span><span class="p">.</span><span class="nx">bootApplication</span><span class="p">(</span><span class="nx">app</span><span class="p">);</span>
+<span class="nx">settings</span><span class="p">.</span><span class="nx">bootRoutes</span><span class="p">(</span><span class="nx">app</span><span class="p">);</span>
+<span class="nx">settings</span><span class="p">.</span><span class="nx">bootErrorConfig</span><span class="p">(</span><span class="nx">app</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <h1>Start server</h1> </td> <td class="code"> <div class="highlight"><pre><span class="nx">app</span><span class="p">.</span><span class="nx">listen</span><span class="p">(</span><span class="nx">port</span><span class="p">);</span>
+<span class="kd">var</span> <span class="nx">appPort</span> <span class="o">=</span> <span class="nx">port</span> <span class="o">+</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="c1">// stringify that int!</span>
+ <span class="nx">appEnv</span> <span class="o">=</span> <span class="nx">env</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">();</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <h1>Colorful status</h1> </td> <td class="code"> <div class="highlight"><pre><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;&#39;</span>
+ <span class="o">+</span> <span class="s1">&#39;\n EASTEREGG.IN SERVER LISTENING ON PORT &#39;</span><span class="p">.</span><span class="nx">rainbow</span>
+ <span class="o">+</span> <span class="s2">&quot; &quot;</span><span class="p">.</span><span class="nx">white</span><span class="p">.</span><span class="nx">inverse</span>
+ <span class="o">+</span> <span class="nx">appPort</span><span class="p">.</span><span class="nx">white</span><span class="p">.</span><span class="nx">inverse</span>
+ <span class="o">+</span> <span class="s2">&quot; &quot;</span><span class="p">.</span><span class="nx">white</span><span class="p">.</span><span class="nx">inverse</span>
+ <span class="o">+</span> <span class="s1">&#39; IN &#39;</span><span class="p">.</span><span class="nx">rainbow</span>
+ <span class="o">+</span> <span class="s2">&quot; &quot;</span><span class="p">.</span><span class="nx">white</span><span class="p">.</span><span class="nx">inverse</span>
+ <span class="o">+</span> <span class="nx">appEnv</span><span class="p">.</span><span class="nx">white</span><span class="p">.</span><span class="nx">inverse</span>
+ <span class="o">+</span> <span class="s2">&quot; &quot;</span><span class="p">.</span><span class="nx">white</span><span class="p">.</span><span class="nx">inverse</span>
+ <span class="o">+</span> <span class="s1">&#39; MODE &#39;</span><span class="p">.</span><span class="nx">rainbow</span>
+<span class="p">);</span>
+
+</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
165 docs/settings.html
@@ -0,0 +1,165 @@
+<!DOCTYPE html> <html> <head> <title>settings.js</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 &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="server.html"> server.js </a> <a class="source" href="settings.html"> settings.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> settings.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h1>Settings</h1> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <h2>Express</h2> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">express</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;express&#39;</span><span class="p">)</span>
+ <span class="p">,</span> <span class="nx">port</span> <span class="o">=</span> <span class="mi">3000</span>
+ <span class="p">,</span> <span class="nx">cacheAge</span> <span class="o">=</span> <span class="mi">24</span> <span class="o">*</span> <span class="mi">60</span> <span class="o">*</span> <span class="mi">60</span> <span class="o">*</span> <span class="mi">1000</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <h2>Common</h2> </td> <td class="code"> <div class="highlight"><pre> <span class="p">,</span> <span class="nx">fs</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;fs&#39;</span><span class="p">)</span>
+ <span class="p">,</span> <span class="nx">colors</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;colors&#39;</span><span class="p">)</span>
+ <span class="p">,</span> <span class="nx">gzippo</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;gzippo&#39;</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <h1>Good and bad</h1>
+
+<p><strong>TODO:</strong> this should be added to Marak's <code>colors</code>
+ (e.g. 'mystring'.bad -- which would prepend the red ✗)</p>
+
+<p>Don't use error/success since that <em>could</em> conflict with callbacks.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="p">,</span> <span class="nx">good</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">.</span><span class="nx">green</span>
+ <span class="p">,</span> <span class="nx">bad</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">.</span><span class="nx">red</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <h2>Stylesheets</h2> </td> <td class="code"> <div class="highlight"><pre> <span class="p">,</span> <span class="nx">stylus</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;stylus&#39;</span><span class="p">)</span>
+ <span class="p">,</span> <span class="nx">nib</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;nib&#39;</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <h2>Logs</h2> </td> <td class="code"> <div class="highlight"><pre> <span class="p">,</span> <span class="nx">logs</span> <span class="o">=</span> <span class="p">{</span>
+ <span class="nx">set</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
+ <span class="nx">string</span><span class="o">:</span> <span class="s1">&#39;\\n &#39;</span> <span class="o">+</span> <span class="s1">&#39;:date&#39;</span><span class="p">.</span><span class="nx">bold</span><span class="p">.</span><span class="nx">underline</span> <span class="o">+</span> <span class="s1">&#39;\\n\\n&#39;</span> <span class="o">+</span> <span class="s1">&#39; IP: &#39;</span><span class="p">.</span><span class="nx">cyan</span><span class="p">.</span><span class="nx">bold</span>
+ <span class="o">+</span> <span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="s1">&#39;:remote-addr&#39;</span><span class="p">.</span><span class="nx">white</span> <span class="o">+</span> <span class="s1">&#39;\\n&#39;</span> <span class="o">+</span> <span class="s1">&#39; Method: &#39;</span><span class="p">.</span><span class="nx">red</span><span class="p">.</span><span class="nx">bold</span>
+ <span class="o">+</span> <span class="s1">&#39;:method&#39;</span><span class="p">.</span><span class="nx">white</span> <span class="o">+</span> <span class="s1">&#39;\\n&#39;</span> <span class="o">+</span> <span class="s1">&#39; URL: &#39;</span><span class="p">.</span><span class="nx">blue</span><span class="p">.</span><span class="nx">bold</span> <span class="o">+</span> <span class="s1">&#39;:url&#39;</span><span class="p">.</span><span class="nx">white</span>
+ <span class="o">+</span> <span class="s1">&#39;\\n&#39;</span> <span class="o">+</span> <span class="s1">&#39; Status: &#39;</span><span class="p">.</span><span class="nx">yellow</span><span class="p">.</span><span class="nx">bold</span> <span class="o">+</span> <span class="s1">&#39;:status&#39;</span><span class="p">.</span><span class="nx">white</span> <span class="o">+</span> <span class="s1">&#39;\\n&#39;</span>
+ <span class="o">+</span> <span class="s1">&#39; User Agent: &#39;</span><span class="p">.</span><span class="nx">magenta</span><span class="p">.</span><span class="nx">bold</span> <span class="o">+</span> <span class="s1">&#39;:user-agent&#39;</span><span class="p">.</span><span class="nx">white</span>
+ <span class="p">}</span>
+ <span class="p">,</span> <span class="nx">css</span> <span class="o">=</span> <span class="p">{</span>
+ <span class="nx">count</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
+ <span class="nx">debug</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
+ <span class="nx">set</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
+ <span class="nx">string</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="s1">&#39;&#39;</span>
+ <span class="o">+</span> <span class="s1">&#39;\n&#39;</span> <span class="o">+</span> <span class="nx">good</span> <span class="o">+</span> <span class="s1">&#39; Stylus has detected changes and compiled new assets&#39;</span>
+ <span class="o">+</span> <span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">count</span> <span class="o">+</span> <span class="s1">&#39; times so far&#39;</span> <span class="o">+</span> <span class="s1">&#39;\n&#39;</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">}</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <h2>Set cache busting for development purposes as a view middleware helper</h2>
+
+<p>This gets turned off in production mode, see below</p>
+
+<p>(e.g. <code>views/layout.jade</code> uses this for appending .css/.js w/?v=timestamp)</p> </td> <td class="code"> <div class="highlight"><pre> <span class="p">,</span> <span class="nx">cacheBusting</span> <span class="o">=</span> <span class="kc">true</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <h2>Stylus Compiler</h2> </td> <td class="code"> <div class="highlight"><pre> <span class="p">,</span> <span class="nx">compress</span> <span class="o">=</span> <span class="kc">false</span> <span class="c1">// this is set to true in prod</span>
+ <span class="p">,</span> <span class="nx">linenos</span> <span class="o">=</span> <span class="kc">true</span> <span class="c1">// this is set to false in prod</span>
+ <span class="p">,</span> <span class="nx">compiler</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">str</span><span class="p">,</span> <span class="nx">path</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="nx">css</span><span class="p">.</span><span class="nx">set</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">css</span><span class="p">.</span><span class="nx">count</span><span class="o">++</span><span class="p">;</span>
+ <span class="kd">var</span> <span class="nx">cssString</span> <span class="o">=</span> <span class="nx">css</span><span class="p">.</span><span class="nx">string</span><span class="p">();</span>
+ <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">cssString</span><span class="p">);</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="nx">stylus</span><span class="p">(</span><span class="nx">str</span><span class="p">)</span>
+ <span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;filename&#39;</span><span class="p">,</span> <span class="nx">path</span><span class="p">)</span>
+ <span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;compress&#39;</span><span class="p">,</span> <span class="nx">compress</span><span class="p">)</span>
+ <span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">)</span>
+ <span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;force&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">)</span>
+ <span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;firebug&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">)</span>
+ <span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;linenos&#39;</span><span class="p">,</span> <span class="nx">linenos</span><span class="p">)</span>
+ <span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">nib</span><span class="p">());</span>
+ <span class="p">};</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <h2>Application Configuration</h2> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">bootApplication</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">app</span><span class="p">,</span> <span class="nx">db</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <h3>Default Settings</h3> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">app</span><span class="p">.</span><span class="nx">configure</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;views&#39;</span><span class="p">,</span> <span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/views&#39;</span><span class="p">);</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;view engine&#39;</span><span class="p">,</span> <span class="s1">&#39;jade&#39;</span><span class="p">);</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">express</span><span class="p">.</span><span class="nx">bodyParser</span><span class="p">());</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">express</span><span class="p">.</span><span class="nx">methodOverride</span><span class="p">());</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">express</span><span class="p">.</span><span class="nx">cookieParser</span><span class="p">());</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">express</span><span class="p">.</span><span class="nx">favicon</span><span class="p">(</span><span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/public/favicon.ico&#39;</span><span class="p">));</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">app</span><span class="p">.</span><span class="nx">router</span><span class="p">);</span>
+ <span class="p">});</span></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <h3>Development Settings</h3>
+
+<pre><code>For a quick start
+$ node server.js
+Or if you have installed nodemon via:
+$ npm install -g nodemon
+$ nodemon
+Then point your browser to &lt;http://localhost:8080/&gt;.
+</code></pre> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">app</span><span class="p">.</span><span class="nx">configure</span><span class="p">(</span><span class="s1">&#39;development&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">stylus</span><span class="p">.</span><span class="nx">middleware</span><span class="p">({</span>
+ <span class="nx">src</span><span class="o">:</span> <span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/views&#39;</span><span class="p">,</span>
+ <span class="nx">dest</span><span class="o">:</span> <span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/public&#39;</span><span class="p">,</span>
+ <span class="nx">debug</span><span class="o">:</span> <span class="nx">css</span><span class="p">.</span><span class="nx">debug</span><span class="p">,</span>
+ <span class="nx">compile</span><span class="o">:</span> <span class="nx">compiler</span>
+ <span class="p">}));</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">express</span><span class="p">.</span><span class="kr">static</span><span class="p">(</span><span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/public&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">maxAge</span><span class="o">:</span> <span class="nx">cacheAge</span> <span class="p">}));</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;showStackError&#39;</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
+ <span class="k">if</span><span class="p">(</span><span class="nx">logs</span><span class="p">.</span><span class="nx">set</span><span class="p">)</span> <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">express</span><span class="p">.</span><span class="nx">logger</span><span class="p">(</span><span class="nx">logs</span><span class="p">.</span><span class="nx">string</span><span class="p">));</span>
+ <span class="p">});</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <h3>Staging Settings</h3>
+
+<p><strong>TODO</strong>: Build out the configuration for this mode.
+<code>$ NODE_ENV=staging node server.js</code>
+Then point your browser to <a href="http://localhost:8081/">http://localhost:8081/</a>.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">&#182;</a> </div> <h3>Production Settings</h3>
+
+<p><code>$ NODE_ENV=production node server.js</code>
+Then point your browser to <a href="http://localhost:6789">http://localhost:6789</a>.
+ (we're using port 6789 for production with apache mod_proxy for now)</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">app</span><span class="p">.</span><span class="nx">configure</span><span class="p">(</span><span class="s1">&#39;production&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">&#182;</a> </div> <h2>Use express-uglify to minify JavaScript in production mode</h2>
+
+<p>app.use(require('express-uglify').middleware({ src: __dirname + '/public' }));</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">cacheBusting</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
+ <span class="nx">compress</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
+ <span class="nx">linenos</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">stylus</span><span class="p">.</span><span class="nx">middleware</span><span class="p">({</span>
+ <span class="nx">src</span><span class="o">:</span> <span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/views&#39;</span><span class="p">,</span>
+ <span class="nx">dest</span><span class="o">:</span> <span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/public&#39;</span><span class="p">,</span>
+ <span class="nx">debug</span><span class="o">:</span> <span class="nx">css</span><span class="p">.</span><span class="nx">debug</span><span class="p">,</span>
+ <span class="nx">compile</span><span class="o">:</span> <span class="nx">compiler</span>
+ <span class="p">}));</span></pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">&#182;</a> </div> <p>Enable gzip compression is for production mode only</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="nx">gzippo</span><span class="p">.</span><span class="nx">staticGzip</span><span class="p">(</span><span class="nx">__dirname</span> <span class="o">+</span> <span class="s1">&#39;/public&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">maxAge</span><span class="o">:</span> <span class="nx">cacheAge</span> <span class="p">}));</span></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">&#182;</a> </div> <p>Disable stack error output</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">app</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;showStackError&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">&#182;</a> </div> <p>Enable view caching</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">app</span><span class="p">.</span><span class="nx">enable</span><span class="p">(</span><span class="s1">&#39;view cache&#39;</span><span class="p">);</span>
+ <span class="p">});</span></pre></div> </td> </tr> <tr id="section-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">&#182;</a> </div> <h3>Dynamic View Helpers</h3> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">app</span><span class="p">.</span><span class="nx">dynamicHelpers</span><span class="p">({</span>
+ <span class="nx">request</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">req</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nx">req</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">,</span> <span class="nx">base</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">&#182;</a> </div> <p>Return the app's mount-point so that urls can adjust</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">return</span> <span class="s1">&#39;/&#39;</span> <span class="o">===</span> <span class="nx">app</span><span class="p">.</span><span class="nx">route</span> <span class="o">?</span> <span class="s1">&#39;&#39;</span> <span class="o">:</span> <span class="nx">app</span><span class="p">.</span><span class="nx">route</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">,</span> <span class="nx">cacheBusting</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nx">cacheBusting</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">&#182;</a> </div> <h2>Error Configuration</h2> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">bootErrorConfig</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">app</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-22"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-22">&#182;</a> </div> <p>Since this is the last non-error-handling middleware use()d,
+ we assume 404, as nothing else responded.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">req</span><span class="p">,</span> <span class="nx">res</span><span class="p">,</span> <span class="nx">next</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-23"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-23">&#182;</a> </div> <p>The status option, or res.statusCode = 404 are equivalent,
+ however with the option we get the "status" local available as well</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">res</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="s1">&#39;404&#39;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">layout</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
+ <span class="nx">status</span><span class="o">:</span> <span class="mi">404</span><span class="p">,</span>
+ <span class="nx">title</span><span class="o">:</span> <span class="s1">&#39;Page not found :(&#39;</span>
+ <span class="p">});</span>
+ <span class="p">});</span></pre></div> </td> </tr> <tr id="section-24"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-24">&#182;</a> </div> <pre><code>Error-handling middleware, take the same form as regular middleware,
+however they require an arity of 4, aka the signature (err, req, res, next)
+when connect has an error, it will invoke ONLY error-handling middleware.
+
+If we were to next() here any remaining non-error-handling middleware would
+then be executed, or if we next(err) to continue passing the error, only
+error-handling middleware would remain being executed, however here we
+simply respond with an error page.
+</code></pre> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">app</span><span class="p">.</span><span class="nx">use</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">req</span><span class="p">,</span> <span class="nx">res</span><span class="p">,</span> <span class="nx">next</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-25"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-25">&#182;</a> </div> <p>We may use properties of the error object here and next(err)
+appropriately, or if we possibly recovered from the error, simply next().</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">res</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="s1">&#39;500&#39;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">layout</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
+ <span class="nx">status</span><span class="o">:</span> <span class="nx">err</span><span class="p">.</span><span class="nx">status</span> <span class="o">||</span> <span class="mi">500</span><span class="p">,</span>
+ <span class="nx">error</span><span class="o">:</span> <span class="nx">err</span><span class="p">,</span>
+ <span class="nx">showStack</span><span class="o">:</span> <span class="nx">app</span><span class="p">.</span><span class="nx">settings</span><span class="p">.</span><span class="nx">showStackError</span><span class="p">,</span>
+ <span class="nx">title</span><span class="o">:</span> <span class="s1">&#39;Something went wrong, oops!&#39;</span>
+ <span class="p">});</span>
+ <span class="p">});</span>
+
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-26"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-26">&#182;</a> </div> <h2>Load Routes</h2> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">bootRoutes</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">app</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">walk</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;walk&#39;</span><span class="p">)</span>
+ <span class="p">,</span> <span class="nx">path</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;path&#39;</span><span class="p">)</span>
+ <span class="p">,</span> <span class="nx">files</span> <span class="o">=</span> <span class="p">[]</span>
+ <span class="p">,</span> <span class="nx">dir</span> <span class="o">=</span> <span class="nx">path</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="nx">__dirname</span><span class="p">,</span> <span class="s1">&#39;routes&#39;</span><span class="p">)</span>
+ <span class="p">,</span> <span class="nx">walker</span> <span class="o">=</span> <span class="nx">walk</span><span class="p">.</span><span class="nx">walk</span><span class="p">(</span><span class="nx">dir</span><span class="p">,</span> <span class="p">{</span> <span class="nx">followLinks</span><span class="o">:</span> <span class="kc">false</span> <span class="p">});</span>
+
+ <span class="nx">walker</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;file&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">root</span><span class="p">,</span> <span class="nx">stat</span><span class="p">,</span> <span class="nx">next</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">files</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">root</span> <span class="o">+</span> <span class="s1">&#39;/&#39;</span> <span class="o">+</span> <span class="nx">stat</span><span class="p">.</span><span class="nx">name</span><span class="p">);</span>
+ <span class="nx">next</span><span class="p">();</span>
+ <span class="p">});</span>
+
+ <span class="nx">walker</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;end&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">files</span><span class="p">.</span><span class="nx">forEach</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">file</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">require</span><span class="p">(</span><span class="nx">file</span><span class="p">)(</span><span class="nx">app</span><span class="p">);</span>
+ <span class="p">});</span></pre></div> </td> </tr> <tr id="section-27"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-27">&#182;</a> </div> <p>Always keep this route last</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">exports</span><span class="p">.</span><span class="nx">bootExtras</span><span class="p">(</span><span class="nx">app</span><span class="p">);</span>
+ <span class="p">});</span>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-28"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-28">&#182;</a> </div> <h2>Extras</h2> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">bootExtras</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">app</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">app</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;*&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">req</span><span class="p">,</span> <span class="nx">res</span><span class="p">,</span> <span class="nx">next</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">req</span><span class="p">.</span><span class="nx">url</span>
+ <span class="p">,</span> <span class="nx">ua</span> <span class="o">=</span> <span class="nx">req</span><span class="p">.</span><span class="nx">headers</span><span class="p">[</span><span class="s1">&#39;user-agent&#39;</span><span class="p">];</span></pre></div> </td> </tr> <tr id="section-29"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-29">&#182;</a> </div> <h2>Block access to hidden files and directories that begin with a period</h2> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">url</span><span class="p">.</span><span class="nx">match</span><span class="p">(</span><span class="sr">/(^|\/)\./</span><span class="p">))</span> <span class="p">{</span>
+ <span class="nx">res</span><span class="p">.</span><span class="nx">end</span><span class="p">(</span><span class="s2">&quot;Not allowed&quot;</span><span class="p">);</span>
+ <span class="p">}</span></pre></div> </td> </tr> <tr id="section-30"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-30">&#182;</a> </div> <h2>Better website experience for IE users</h2>
+
+<p>Force the latest IE version, in cases when it may fall back to IE7 mode</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span><span class="p">(</span><span class="nx">ua</span> <span class="o">&amp;&amp;</span> <span class="nx">ua</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;MSIE&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="sr">/htm?l/</span><span class="p">.</span><span class="nx">test</span><span class="p">(</span><span class="nx">ua</span><span class="p">))</span> <span class="p">{</span>
+ <span class="nx">res</span><span class="p">.</span><span class="nx">setHeader</span><span class="p">(</span><span class="s1">&#39;X-UA-Compatible&#39;</span><span class="p">,</span> <span class="s1">&#39;IE=Edge,chrome=1&#39;</span><span class="p">);</span>
+ <span class="p">}</span></pre></div> </td> </tr> <tr id="section-31"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-31">&#182;</a> </div> <h2>CORS</h2>
+
+<p><a href="http://github.com/rails/rails/commit/123eb25#commitcomment-118920">http://github.com/rails/rails/commit/123eb25#commitcomment-118920</a>
+ Use ChromeFrame if it's installed, for a better experience with IE folks
+ Control cross domain using CORS http://enable-cors.org</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">res</span><span class="p">.</span><span class="nx">setHeader</span><span class="p">(</span><span class="s1">&#39;Access-Control-Allow-Origin&#39;</span><span class="p">,</span> <span class="s1">&#39;*&#39;</span><span class="p">);</span>
+ <span class="nx">res</span><span class="p">.</span><span class="nx">setHeader</span><span class="p">(</span><span class="s2">&quot;Access-Control-Allow-Headers&quot;</span><span class="p">,</span> <span class="s2">&quot;X-Requested-With&quot;</span><span class="p">);</span>
+ <span class="nx">next</span><span class="p">();</span>
+ <span class="p">});</span>
+<span class="p">};</span>
+
+</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
4 public/ddg/asteroids.js
@@ -0,0 +1,4 @@
+function easterEggAsteroids() {
+ YAHOO.util.Get.script("http://cdn.easteregg.in/outcomes/asteroids/asteroids.min.js");
+}
+YAHOO.util.Event.onDOMReady(easterEggAsteroids);
View
8 public/ddg/cornify.js
@@ -0,0 +1,8 @@
+function easterEggCornify() {
+ YAHOO.util.Get.script("http://cdn.easteregg.in/outcomes/cornify/cornify.js", {
+ onSuccess: function() {
+ cornify_add();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggCornify);
View
186 public/ddg/docs/docco.css
@@ -0,0 +1,186 @@
+/*--------------------- Layout and Typography ----------------------------*/
+body {
+ font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
+ font-size: 15px;
+ line-height: 22px;
+ color: #252519;
+ margin: 0; padding: 0;
+}
+a {
+ color: #261a3b;
+}
+ a:visited {
+ color: #261a3b;
+ }
+p {
+ margin: 0 0 15px 0;
+}
+h1, h2, h3, h4, h5, h6 {
+ margin: 0px 0 15px 0;
+}
+ h1 {
+ margin-top: 40px;
+ }
+#container {
+ position: relative;
+}
+#background {
+ position: fixed;
+ top: 0; left: 525px; right: 0; bottom: 0;
+ background: #f5f5ff;
+ border-left: 1px solid #e5e5ee;
+ z-index: -1;
+}
+#jump_to, #jump_page {
+ background: white;
+ -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
+ -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
+ font: 10px Arial;
+ text-transform: uppercase;
+ cursor: pointer;
+ text-align: right;
+}
+#jump_to, #jump_wrapper {
+ position: fixed;
+ right: 0; top: 0;
+ padding: 5px 10px;
+}
+ #jump_wrapper {
+ padding: 0;
+ display: none;
+ }
+ #jump_to:hover #jump_wrapper {
+ display: block;
+ }
+ #jump_page {
+ padding: 5px 0 3px;
+ margin: 0 0 25px 25px;
+ }
+ #jump_page .source {
+ display: block;
+ padding: 5px 10px;
+ text-decoration: none;
+ border-top: 1px solid #eee;
+ }
+ #jump_page .source:hover {
+ background: #f5f5ff;
+ }
+ #jump_page .source:first-child {
+ }
+table td {
+ border: 0;
+ outline: 0;
+}
+ td.docs, th.docs {
+ max-width: 450px;
+ min-width: 450px;
+ min-height: 5px;
+ padding: 10px 25px 1px 50px;
+ overflow-x: hidden;
+ vertical-align: top;
+ text-align: left;
+ }
+ .docs pre {
+ margin: 15px 0 15px;
+ padding-left: 15px;
+ }
+ .docs p tt, .docs p code {
+ background: #f8f8ff;
+ border: 1px solid #dedede;
+ font-size: 12px;
+ padding: 0 0.2em;
+ }
+ .pilwrap {
+ position: relative;
+ }
+ .pilcrow {
+ font: 12px Arial;
+ text-decoration: none;
+ color: #454545;
+ position: absolute;
+ top: 3px; left: -20px;
+ padding: 1px 2px;
+ opacity: 0;
+ -webkit-transition: opacity 0.2s linear;
+ }
+ td.docs:hover .pilcrow {
+ opacity: 1;
+ }
+ td.code, th.code {
+ padding: 14px 15px 16px 25px;
+ width: 100%;
+ vertical-align: top;
+ background: #f5f5ff;
+ border-left: 1px solid #e5e5ee;
+ }
+ pre, tt, code {
+ font-size: 12px; line-height: 18px;
+ font-family: Monaco, Consolas, "Lucida Console", monospace;
+ margin: 0; padding: 0;
+ }
+
+
+/*---------------------- Syntax Highlighting -----------------------------*/
+td.linenos { background-color: #f0f0f0; padding-right: 10px; }
+span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
+body .hll { background-color: #ffffcc }
+body .c { color: #408080; font-style: italic } /* Comment */
+body .err { border: 1px solid #FF0000 } /* Error */
+body .k { color: #954121 } /* Keyword */
+body .o { color: #666666 } /* Operator */
+body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
+body .cp { color: #BC7A00 } /* Comment.Preproc */
+body .c1 { color: #408080; font-style: italic } /* Comment.Single */
+body .cs { color: #408080; font-style: italic } /* Comment.Special */
+body .gd { color: #A00000 } /* Generic.Deleted */
+body .ge { font-style: italic } /* Generic.Emph */
+body .gr { color: #FF0000 } /* Generic.Error */
+body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+body .gi { color: #00A000 } /* Generic.Inserted */
+body .go { color: #808080 } /* Generic.Output */
+body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
+body .gs { font-weight: bold } /* Generic.Strong */
+body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+body .gt { color: #0040D0 } /* Generic.Traceback */
+body .kc { color: #954121 } /* Keyword.Constant */
+body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
+body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
+body .kp { color: #954121 } /* Keyword.Pseudo */
+body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
+body .kt { color: #B00040 } /* Keyword.Type */
+body .m { color: #666666 } /* Literal.Number */
+body .s { color: #219161 } /* Literal.String */
+body .na { color: #7D9029 } /* Name.Attribute */
+body .nb { color: #954121 } /* Name.Builtin */
+body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
+body .no { color: #880000 } /* Name.Constant */
+body .nd { color: #AA22FF } /* Name.Decorator */
+body .ni { color: #999999; font-weight: bold } /* Name.Entity */
+body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
+body .nf { color: #0000FF } /* Name.Function */
+body .nl { color: #A0A000 } /* Name.Label */
+body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
+body .nt { color: #954121; font-weight: bold } /* Name.Tag */
+body .nv { color: #19469D } /* Name.Variable */
+body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
+body .w { color: #bbbbbb } /* Text.Whitespace */
+body .mf { color: #666666 } /* Literal.Number.Float */
+body .mh { color: #666666 } /* Literal.Number.Hex */
+body .mi { color: #666666 } /* Literal.Number.Integer */
+body .mo { color: #666666 } /* Literal.Number.Oct */
+body .sb { color: #219161 } /* Literal.String.Backtick */
+body .sc { color: #219161 } /* Literal.String.Char */
+body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
+body .s2 { color: #219161 } /* Literal.String.Double */
+body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
+body .sh { color: #219161 } /* Literal.String.Heredoc */
+body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
+body .sx { color: #954121 } /* Literal.String.Other */
+body .sr { color: #BB6688 } /* Literal.String.Regex */
+body .s1 { color: #219161 } /* Literal.String.Single */
+body .ss { color: #19469D } /* Literal.String.Symbol */
+body .bp { color: #954121 } /* Name.Builtin.Pseudo */
+body .vc { color: #19469D } /* Name.Variable.Class */
+body .vg { color: #19469D } /* Name.Variable.Global */
+body .vi { color: #19469D } /* Name.Variable.Instance */
+body .il { color: #666666 } /* Literal.Number.Integer.Long */
View
143 public/ddg/docs/index.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html> <html> <head> <title>index.js</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> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> index.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h1>Index of outcomes</h1>
+
+<p>This is a collection of 11 outcomes converted to YUI onDOMReady snippets.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>JSHint Global Variables</p> </td> <td class="code"> <div class="highlight"><pre><span class="cm">/*globals YAHOO load_protest cornify_add Snake*/</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>&ast; = requires jQuery</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <h2>Cornify</h2>
+
+<p>If query = "cornify", then embed this &lt;script&gt; after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/cornify.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">easterEggCornify</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;http://cdn.easteregg.in/outcomes/cornify/cornify.js&quot;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">onSuccess</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">cornify_add</span><span class="p">();</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">easterEggCornify</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <h2>Snowy</h2>
+
+<p>If query = "snowy", then embed this &lt;script&gt; tag after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/snowy.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">easterEggSnowy</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;http://cdn.easteregg.in/outcomes/snowy/snow.min.js&quot;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">onSuccess</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">$snowyStyle</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;style&quot;</span><span class="p">)</span>
+ <span class="p">,</span> <span class="nx">$snowFlurry</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;div&#39;</span><span class="p">)</span>
+ <span class="p">,</span> <span class="nx">$head</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;head&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+ <span class="p">,</span> <span class="nx">$body</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;body&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span>
+ <span class="nx">$snowyStyle</span><span class="p">.</span><span class="nx">rel</span> <span class="o">=</span> <span class="s1">&#39;stylesheet&#39;</span><span class="p">;</span>
+ <span class="nx">$snowyStyle</span><span class="p">.</span><span class="nx">href</span> <span class="o">=</span> <span class="s1">&#39;http://cdn.easteregg.in/outcomes/snowy/snowy.css&#39;</span><span class="p">;</span>
+ <span class="nx">$snowyStyle</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s1">&#39;text/css&#39;</span><span class="p">;</span>
+ <span class="nx">$snowyStyle</span><span class="p">.</span><span class="nx">media</span> <span class="o">=</span> <span class="s1">&#39;screen&#39;</span><span class="p">;</span>
+ <span class="nx">$snowFlurry</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="s1">&#39;snow_flurry&#39;</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>Add the stylesheet to the &lt;head&gt; element</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">$head</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">$snowyStyle</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Prepend the &lt;canvas&gt; snowflakes to the &lt;body&gt; element</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">$body</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">$snowFlurry</span><span class="p">,</span> <span class="nx">$body</span><span class="p">);</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">easterEggSnowy</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <h2>Invert Colors*</h2>
+
+<p>If query = "invert colors", then embed this &lt;script&gt; tag after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/invert-colors.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">easterEggInvertColors</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js&quot;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">onSuccess</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">$</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">$</span><span class="p">){</span>
+ <span class="nx">$</span><span class="p">.</span><span class="nx">getScript</span><span class="p">(</span><span class="s2">&quot;http://cdn.easteregg.in/outcomes/invert-colors/invert-colors.js&quot;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">$</span><span class="p">(</span><span class="s2">&quot;body&quot;</span><span class="p">).</span><span class="nx">invert</span><span class="p">();</span>
+ <span class="p">});</span>
+ <span class="p">});</span>
+ <span class="nx">$</span><span class="p">.</span><span class="nx">noConflict</span><span class="p">();</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">easterEggInvertColors</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <h2>Raptorize*</h2>
+
+<p>If query = "raptorize", then embed this &lt;script&gt; tag after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/raptorize.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">easterEggRaptorize</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js&quot;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">onSuccess</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">$</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">$</span><span class="p">){</span>
+ <span class="nx">$</span><span class="p">.</span><span class="nx">getScript</span><span class="p">(</span><span class="s2">&quot;http://cdn.easteregg.in/outcomes/raptorize/jquery.raptorize.1.0.js&quot;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">$</span><span class="p">(</span><span class="s2">&quot;body&quot;</span><span class="p">).</span><span class="nx">raptorize</span><span class="p">({</span><span class="nx">delayTime</span><span class="o">:</span> <span class="mi">0</span><span class="p">});</span>
+ <span class="p">});</span>
+ <span class="p">});</span>
+ <span class="nx">$</span><span class="p">.</span><span class="nx">noConflict</span><span class="p">();</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">easterEggRaptorize</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <h2>Kathack*</h2>
+
+<p>If query = "kathack", then embed this &lt;script&gt; tag after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/kathack.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">kathack</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js&quot;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">onSuccess</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">$</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">$</span><span class="p">){</span>
+ <span class="nx">$</span><span class="p">.</span><span class="nx">getScript</span><span class="p">(</span><span class="s2">&quot;http://cdn.easteregg.in/outcomes/kathack/kh.js&quot;</span><span class="p">);</span>
+ <span class="p">});</span>
+ <span class="nx">$</span><span class="p">.</span><span class="nx">noConflict</span><span class="p">();</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">kathack</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <h2>Secret Message</h2>
+
+<p>If query = "gabriel weinburg", then embed this &lt;script&gt; after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/secret-message.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">easterEggSecretMessage</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;http://yui.yahooapis.com/combo?2.7.0/build/yahoo-dom-event/yahoo-dom-event.js&amp;2.7.0/build/animation/animation-min.js&quot;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">onSuccess</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">Secret</span><span class="p">.</span><span class="nx">fnMessage</span><span class="p">(</span><span class="s2">&quot;yegg was here&quot;</span><span class="p">);</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">easterEggSecretMessage</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <h2>Asteroids</h2>
+
+<p>If query = "asteroids", then embed this &lt;script&gt; after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/asteroids.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">easterEggAsteroids</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;http://cdn.easteregg.in/outcomes/asteroids/asteroids.min.js&quot;</span><span class="p">);</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">easterEggAsteroids</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">&#182;</a> </div> <h2>Snake*</h2>
+
+<p>If query = "snake", then embed this &lt;script&gt; after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/snake.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">easterEggSnake</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js&quot;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">onSuccess</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">$</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">$</span><span class="p">){</span>
+ <span class="nx">$</span><span class="p">.</span><span class="nx">getScript</span><span class="p">(</span><span class="s2">&quot;http://cdn.easteregg.in/outcomes/snake/snake3.js&quot;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">snake</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">width</span><span class="o">:</span> <span class="mi">20</span><span class="p">,</span> <span class="nx">timeout</span><span class="o">:</span> <span class="mi">100</span> <span class="p">}</span>
+ <span class="p">,</span> <span class="nx">snakes</span> <span class="o">=</span> <span class="p">[];</span></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">&#182;</a> </div> <p><strong>TODO:</strong> This can be <strong><a href="http://elliottkember.com/snake.html">customized</a></strong> into a complex snake game</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">snakes</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="k">new</span> <span class="nx">Snake</span><span class="p">({</span>
+ <span class="nx">width</span><span class="o">:</span> <span class="nx">snake</span><span class="p">.</span><span class="nx">width</span><span class="p">,</span>
+ <span class="nx">timeout</span><span class="o">:</span> <span class="nx">snake</span><span class="p">.</span><span class="nx">timeout</span>
+ <span class="p">}));</span>
+ <span class="p">});</span>
+ <span class="p">});</span>
+ <span class="nx">$</span><span class="p">.</span><span class="nx">noConflict</span><span class="p">();</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">easterEggSnake</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">&#182;</a> </div> <h2>Nifty*</h2>
+
+<p>If query = "niftylettuce", then embed this &lt;script&gt; tag after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/nifty.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">easterEggNifty</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js&quot;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">onSuccess</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">$</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">$</span><span class="p">){</span>
+ <span class="nx">$</span><span class="p">.</span><span class="nx">getScript</span><span class="p">(</span><span class="s2">&quot;http://cdn.easteregg.in/outcomes/niftylettuce/niftylettuce.js&quot;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">$</span><span class="p">(</span><span class="s2">&quot;body&quot;</span><span class="p">).</span><span class="nx">niftylettuce</span><span class="p">({</span><span class="nx">delayTime</span><span class="o">:</span> <span class="mi">0</span><span class="p">});</span>
+ <span class="p">});</span>
+ <span class="p">});</span>
+ <span class="nx">$</span><span class="p">.</span><span class="nx">noConflict</span><span class="p">();</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">easterEggNifty</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">&#182;</a> </div> <h2>Unicorn Pooper</h2>
+
+<p>If query = "unicorn pooper", then embed this &lt;script&gt; tag after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/unicorn-pooper.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">easterEggUnicornPooper</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;http://cdn.easteregg.in/outcomes/unicorn-pooper/unicorn.js?&quot;</span><span class="p">);</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">easterEggUnicornPooper</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">&#182;</a> </div> <h2>Occupy the Internet</h2>
+
+<p>If query = "occupy the internet", then embed this &lt;script&gt; tag after YUI has loaded:
+<code>&lt;script type="text/javascript" src="http://cdn.easteregg.in/ddg/occupy-the-internet.js" defer&gt;&lt;/script&gt;</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">easterEggOccupyTheInternet</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="s2">&quot;http://occupyinter.net/embed.json?callback=_ee_occupy&quot;</span><span class="p">,</span> <span class="p">{</span>
+ <span class="nx">onSuccess</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nb">window</span><span class="p">.</span><span class="nx">_ee_occupy</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;body&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">].</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">html</span><span class="p">);</span>
+ <span class="nx">load_protest</span><span class="p">();</span>
+ <span class="p">};</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+<span class="p">}</span>
+<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">onDOMReady</span><span class="p">(</span><span class="nx">easterEggOccupyTheInternet</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">&#182;</a> </div> <h3>Enjoy :)</h3> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
191 public/ddg/index.js
@@ -0,0 +1,191 @@
+
+// # Index of outcomes
+// This is a collection of 11 outcomes converted to YUI onDOMReady snippets.
+
+// JSHint Global Variables
+/*globals YAHOO load_protest cornify_add Snake*/
+
+// &ast; = requires jQuery
+
+// ## Cornify
+// If query = "cornify", then embed this &lt;script&gt; after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/cornify.js" defer></script>`
+function easterEggCornify() {
+ YAHOO.util.Get.script("http://cdn.easteregg.in/outcomes/cornify/cornify.js", {
+ onSuccess: function() {
+ cornify_add();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggCornify);
+
+
+// ## Snowy
+// If query = "snowy", then embed this &lt;script&gt; tag after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/snowy.js" defer></script>`
+function easterEggSnowy() {
+ YAHOO.util.Get.script("http://cdn.easteregg.in/outcomes/snowy/snow.min.js", {
+ onSuccess: function() {
+ var $snowyStyle = document.createElement("style")
+ , $snowFlurry = document.createElement('div')
+ , $head = document.getElementsByTagName('head')[0]
+ , $body = document.getElementsByTagName('body')[0];
+ $snowyStyle.rel = 'stylesheet';
+ $snowyStyle.href = 'http://cdn.easteregg.in/outcomes/snowy/snowy.css';
+ $snowyStyle.type = 'text/css';
+ $snowyStyle.media = 'screen';
+ $snowFlurry.id = 'snow_flurry';
+ // Add the stylesheet to the &lt;head&gt; element
+ $head.appendChild($snowyStyle);
+ // Prepend the &lt;canvas&gt; snowflakes to the &lt;body&gt; element
+ $body.insertBefore($snowFlurry, $body);
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggSnowy);
+
+
+// ## Invert Colors*
+// If query = "invert colors", then embed this &lt;script&gt; tag after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/invert-colors.js" defer></script>`
+function easterEggInvertColors() {
+ YAHOO.util.Get.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js", {
+ onSuccess: function() {
+ $(function($){
+ $.getScript("http://cdn.easteregg.in/outcomes/invert-colors/invert-colors.js", function() {
+ $("body").invert();
+ });
+ });
+ $.noConflict();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggInvertColors);
+
+
+// ## Raptorize*
+// If query = "raptorize", then embed this &lt;script&gt; tag after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/raptorize.js" defer></script>`
+function easterEggRaptorize() {
+ YAHOO.util.Get.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js", {
+ onSuccess: function() {
+ $(function($){
+ $.getScript("http://cdn.easteregg.in/outcomes/raptorize/jquery.raptorize.1.0.js", function() {
+ $("body").raptorize({delayTime: 0});
+ });
+ });
+ $.noConflict();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggRaptorize);
+
+
+
+// ## Kathack*
+// If query = "kathack", then embed this &lt;script&gt; tag after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/kathack.js" defer></script>`
+function kathack() {
+ YAHOO.util.Get.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js", {
+ onSuccess: function() {
+ $(function($){
+ $.getScript("http://cdn.easteregg.in/outcomes/kathack/kh.js");
+ });
+ $.noConflict();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(kathack);
+
+
+// ## Secret Message
+// If query = "gabriel weinburg", then embed this &lt;script&gt; after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/secret-message.js" defer></script>`
+function easterEggSecretMessage() {
+ YAHOO.util.Get.script("http://yui.yahooapis.com/combo?2.7.0/build/yahoo-dom-event/yahoo-dom-event.js&2.7.0/build/animation/animation-min.js", {
+ onSuccess: function() {
+ Secret.fnMessage("yegg was here");
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggSecretMessage);
+
+
+// ## Asteroids
+// If query = "asteroids", then embed this &lt;script&gt; after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/asteroids.js" defer></script>`
+function easterEggAsteroids() {
+ YAHOO.util.Get.script("http://cdn.easteregg.in/outcomes/asteroids/asteroids.min.js");
+}
+YAHOO.util.Event.onDOMReady(easterEggAsteroids);
+
+
+// ## Snake*
+// If query = "snake", then embed this &lt;script&gt; after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/snake.js" defer></script>`
+function easterEggSnake() {
+ YAHOO.util.Get.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js", {
+ onSuccess: function() {
+ $(function($){
+ $.getScript("http://cdn.easteregg.in/outcomes/snake/snake3.js", function() {
+ var snake = { width: 20, timeout: 100 }
+ , snakes = [];
+ // **TODO:** This can be **[customized][1]** into a complex snake game
+ // [1]: http://elliottkember.com/snake.html
+ snakes.push(new Snake({
+ width: snake.width,
+ timeout: snake.timeout
+ }));
+ });
+ });
+ $.noConflict();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggSnake);
+
+
+// ## Nifty*
+// If query = "niftylettuce", then embed this &lt;script&gt; tag after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/nifty.js" defer></script>`
+function easterEggNifty() {
+ YAHOO.util.Get.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js", {
+ onSuccess: function() {
+ $(function($){
+ $.getScript("http://cdn.easteregg.in/outcomes/niftylettuce/niftylettuce.js", function() {
+ $("body").niftylettuce({delayTime: 0});
+ });
+ });
+ $.noConflict();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggNifty);
+
+
+// ## Unicorn Pooper
+// If query = "unicorn pooper", then embed this &lt;script&gt; tag after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/unicorn-pooper.js" defer></script>`
+function easterEggUnicornPooper() {
+ YAHOO.util.Get.script("http://cdn.easteregg.in/outcomes/unicorn-pooper/unicorn.js?");
+}
+YAHOO.util.Event.onDOMReady(easterEggUnicornPooper);
+
+
+// ## Occupy the Internet
+// If query = "occupy the internet", then embed this &lt;script&gt; tag after YUI has loaded:
+// `<script type="text/javascript" src="http://cdn.easteregg.in/ddg/occupy-the-internet.js" defer></script>`
+function easterEggOccupyTheInternet() {
+ YAHOO.util.Get.script("http://occupyinter.net/embed.json?callback=_ee_occupy", {
+ onSuccess: function() {
+ window._ee_occupy = function(data) {
+ document.getElementsByTagName('body')[0].appendChild(data.html);
+ load_protest();
+ };
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggOccupyTheInternet);
+
+
+// ### Enjoy :)
View
13 public/ddg/invert-colors.js
@@ -0,0 +1,13 @@
+function easterEggInvertColors() {
+ YAHOO.util.Get.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js", {
+ onSuccess: function() {
+ $(function($){
+ $.getScript("http://cdn.easteregg.in/outcomes/invert-colors/invert-colors.js", function() {
+ $("body").invert();
+ });
+ });
+ $.noConflict();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggInvertColors);
View
11 public/ddg/kathack.js
@@ -0,0 +1,11 @@
+function kathack() {
+ YAHOO.util.Get.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js", {
+ onSuccess: function() {
+ $(function($){
+ $.getScript("http://cdn.easteregg.in/outcomes/kathack/kh.js");
+ });
+ $.noConflict();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(kathack);
View
13 public/ddg/nifty.js
@@ -0,0 +1,13 @@
+function easterEggNifty() {
+ YAHOO.util.Get.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js", {
+ onSuccess: function() {
+ $(function($){
+ $.getScript("http://cdn.easteregg.in/outcomes/niftylettuce/niftylettuce.js", function() {
+ $("body").niftylettuce({delayTime: 0});
+ });
+ });
+ $.noConflict();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggNifty);
View
11 public/ddg/occupy-the-internet.js
@@ -0,0 +1,11 @@
+function easterEggOccupyTheInternet() {
+ YAHOO.util.Get.script("http://occupyinter.net/embed.json?callback=_ee_occupy", {
+ onSuccess: function() {
+ window._ee_occupy = function(data) {
+ document.getElementsByTagName('body')[0].appendChild(data.html);
+ load_protest();
+ };
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggOccupyTheInternet);
View
13 public/ddg/raptorize.js
@@ -0,0 +1,13 @@
+function easterEggRaptorize() {
+ YAHOO.util.Get.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js", {
+ onSuccess: function() {
+ $(function($){
+ $.getScript("http://cdn.easteregg.in/outcomes/raptorize/jquery.raptorize.1.0.js", function() {
+ $("body").raptorize({delayTime: 0});
+ });
+ });
+ $.noConflict();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggRaptorize);
View
8 public/ddg/secret-message.js
@@ -0,0 +1,8 @@
+function easterEggSecretMessage() {
+ YAHOO.util.Get.script("http://yui.yahooapis.com/combo?2.7.0/build/yahoo-dom-event/yahoo-dom-event.js&2.7.0/build/animation/animation-min.js", {
+ onSuccess: function() {
+ Secret.fnMessage("yegg was here");
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggSecretMessage);
View
19 public/ddg/snake.js
@@ -0,0 +1,19 @@
+function easterEggSnake() {
+ YAHOO.util.Get.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js", {
+ onSuccess: function() {
+ $(function($){
+ $.getScript("http://cdn.easteregg.in/outcomes/snake/snake3.js", function() {
+ var snake = { width: 20, timeout: 100 }
+ , snakes = [];
+ // TODO: This can be customed as much as you want
+ snakes.push(new Snake({
+ width: snake.width,
+ timeout: snake.timeout
+ }));
+ });
+ });
+ $.noConflict();
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggSnake);
View
20 public/ddg/snowy.js
@@ -0,0 +1,20 @@
+function easterEggSnowy() {
+ YAHOO.util.Get.script("http://cdn.easteregg.in/outcomes/snowy/snow.min.js", {
+ onSuccess: function() {
+ var $snowyStyle = document.createElement("style")
+ , $snowFlurry = document.createElement('div')
+ , $head = document.getElementsByTagName('head')[0]
+ , $body = document.getElementsByTagName('body')[0];
+ $snowyStyle.rel = 'stylesheet';
+ $snowyStyle.href = 'http://cdn.easteregg.in/outcomes/snowy/snowy.css';
+ $snowyStyle.type = 'text/css';
+ $snowyStyle.media = 'screen';
+ $snowFlurry.id = 'snow_flurry';
+ // Add the stylesheet to the <head> section
+ $head.appendChild($snowyStyle);
+ // Prepend the <canvas> snowflakes to <body>
+ $body.insertBefore($snowFlurry, $body);
+ }
+ });
+}
+YAHOO.util.Event.onDOMReady(easterEggSnowy);
View
4 public/ddg/unicorn-pooper.js
@@ -0,0 +1,4 @@
+function easterEggUnicornPooper() {
+ YAHOO.util.Get.script("http://cdn.easteregg.in/outcomes/unicorn-pooper/unicorn.js?");
+}
+YAHOO.util.Event.onDOMReady(easterEggUnicornPooper);
Please sign in to comment.
Something went wrong with that request. Please try again.