<head>
  <script>
    $(function() {
      $("section.source")
    });
  </script>
  <style type="text/css" media="screen">
    body {
      font-family: 'Helvetica Neue';
      color: #333;
    }

    .hidden {
      display: none;
    }

    a {
      color: #0f4bf0;
    }

    header h1 {
      border-top: 4px solid #333;
      font-size: 2.0em;
    }

    header .version {
      font-size: 0.6em;
    }

    .main > header {
      margin-bottom: 40px;
    }

    article {
      margin-bottom: 10px;
      padding-bottom: 30px;
    }

    article header h2 {
      border-top: 3px solid #333;
      font-size: 2em;
      padding-top: 5px;
      margin-bottom: 0px;
    }

    article > section {
      margin-bottom: 30px;
    }

    article section h3 {
      font-size: 1em;
    }

    article section header h3 {
      padding-top: 2px;
      font-size: 1.2em;
      margin-bottom: 5px;
      border-top: 2px solid #333;
    }

    article section header h4 {
      font-size: 0.9em;
      font-family: courier;
      margin: 2px 0 5px 0;
    }

    @-webkit-keyframes highlight {
      from {
        background-color: #Ffff66;
      }

      to {
        background-color: white;
      }
    }
    .extends {
      margin-top: 0px;
      font-size: 0.8em;
    }

    section.method:target {
      -webkit-animation-duration: 1s;
      -webkit-animation-name: highlight;
    }

    section header .type, section header .related {
      margin-top: 0px;
      font-size: 0.8em;
    }
    section header .endpoint {
      margin-top: -.8em;
      font-size: 0.8em;
    }

    section.params h4, section.source h4 {
      margin-top: 5px;
      margin-bottom: 2px;
      font-size: 0.9em;
    }

    section.params ul {
      margin-top: 2px;
    }

    a.show-source {
      font-size: 0.8em;
    }

    .wrap {
      width: 1050px;
      margin: 0 auto;
    }

    .main {
      width: 760px;
      float: left;
    }

    p {
      line-height: 1.4em;
    }

    nav {
      padding-top: 15px;
      float: left;
      width: 250px;
      margin-right: 30px;
      text-align: right;
      font-size: 0.8em;
    }

    nav ul {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    nav ul h3 {
      margin-bottom: 5px;
      border-top: 2px solid #CCC;
      padding-top: 2px;
    }
    
    nav ul h4 {
      margin-bottom: 5px;
      padding-top: 2px;
    }

    nav ul ul li {
      padding: 2px 0;
    }

    pre {
      background-color: rgba(0,0,0,0.1);
      padding: 8px;
      overflow-x: auto;
      overflow-y: auto;
    }

    code .keyword, code .special {
      font-weight: bold;
      color: black;
    }

    code .string, code .regexp {
      color: green
    }

    code .class { 
      color: blue
    }

    code .number {
      color: red
    }

    code .comment {
      color: grey;
      font-style: italic;
    }
    
    .em {
      font-style: italic;
      color: gray;
      font-size: 12px;
    }
    
    .bold {
      font-weight: bold;
    }
    
    section.params li p {
      display: inline;
    }
    
    .source-button {
      padding: 0.5em 1em;
      background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #555438), color-stop(1, #4e4d33));
      background: -webkit-linear-gradient(top, #555438 0%, #4e4d33 100%);
      background: -moz-linear-gradient(top, #555438 0%, #4e4d33 100%);
      background: linear-gradient(top, #555438 0%, #4e4d33 100%);
      border: 1px solid #41412b;
      font: 11px/normal helvetica, arial, freesans, clean, sans-serif;
      color: #fff;
      text-decoration: none;
      text-shadow: 1px 1px 0px #6d6c47;
      font-weight: bold;
      -webkit-border-radius: 3px;
      -moz-border-radius: 3px;
      border-radius: 3px;
      cursor: pointer;
      float: right;
    }
  </style>
</head>
<body>
  <div class='wrap'>
    <nav>
      <ul>
        {{#modules}}
          <li>
            <a href='{{name}}.html'>
              <h3>{{name}}</h3>
            </a>

            <ul>
              {{#methods}}
                <li><a href='#{{parent}}-{{name}}'>{{name}}</a></li>
              {{/methods}}
            </ul>
            
            {{#has_globals}}
              <a href='#{{name}}-globals'>
                <h4>Module Globals</h4>
              </a>
            {{/has_globals}}
            
            <ul>
              {{#helpers}}
                <li><a href='#{{parent}}+{{name}}'>{{name}}</a></li>
              {{/helpers}}
            </ul>
            
            {{#has_inherited}}
              <a href='#{{name}}-inherited'>
                <h4>Inherited</h4>
              </a>
            {{/has_inherited}}
            
            <ul>
              {{#inherited}}
                <li><a href='#{{parent}}^{{name}}'>{{name}}</a></li>
              {{/inherited}}
            </ul>
          </li>
        {{/modules}}
      </ul>
    </nav>

    <div class='main'>
      {{#module}}
        <article id='{{name}}'>
          <header>
            <h2>{{name}}</h2>
            {{#is_extends}}
              <p class='extends'>extends <a href="{{extends}}.html#{{extends}}">{{extends}}</a></p>
            {{/is_extends}}
          </header>

          <section>
            {{{full_description}}}
          </section>

          {{#methods}}
            <section class='method' id='{{parent}}-{{name}}'>
              <header>
                <h3>{{name}}</h3>
                <h4>{{signature}}</h4>
                <p class='type'>{{type}}</p>
                {{#has_endpoint}}
                  <p class='endpoint'>{{endpoint}}</p>
                {{/has_endpoint}}
                {{#related}}
                  <p class='related'>See: <a href='{{href}}.html#{{href}}'>{{name}}</a></p>
                {{/related}}
              </header>

              <section class='params'>
                {{#has_params}}
                  <h4>Params</h4>
                {{/has_params}}
                <ul>
                  {{#params}}
                    <li><span class="bold">{{name}}</span> - <span class="em">{{types}}</span> {{{description}}}</li>
                  {{/params}}
                </ul>
              </section>

              <section class='params'>
                {{#has_returns}}
                  <h4>Returns</h4>
                  {{#returns}}
                    <p><span class="em">{{types}}</span> {{description}}</p>
                  {{/returns}}
                {{/has_returns}}
              </section>

              <section>
                {{{full_description}}}
              </section>

              <section class='source'>
                <div class="source-button">View Source</div>
                <h4>Source (<a href="{{url}}#L{{line}}">{{filename}}:{{line}}</a>)</h4>
                <pre class='hidden' data-id='{{parent}}-{{name}}'><code>{{code}}</code></pre>
              </section>
              
            </section>
          {{/methods}}
          
          {{#has_globals}}
            <header id='{{name}}-globals'>
              <h3>{{name}} Module Globals</h3>
            </header>
          {{/has_globals}}
          
          {{#helpers}}
            <section class='method' id='{{parent}}+{{name}}'>
              <header>
                <h3>{{name}}</h3>
                <h4>{{signature}}</h4>
                <p class='type'>{{type}}</p>
                {{#related}}
                  <p class='related'>See: <a href='#{{href}}'>{{name}}</a></p>
                {{/related}}
              </header>

              <section class='params'>
                {{#has_params}}
                  <h4>Params</h4>
                {{/has_params}}
                <ul>
                  {{#params}}
                    <li><span class="bold">{{name}}</span> - <span class="em">{{types}}</span> {{{description}}}</li>
                  {{/params}}
                </ul>
              </section>

              <section class='params'>
                {{#has_returns}}
                  <h4>Returns</h4>
                  {{#returns}}
                    <p><span class="em">{{types}}</span> {{{description}}}</p>
                  {{/returns}}
                {{/has_returns}}
              </section>

              <section>
                {{{full_description}}}
              </section>

              <section class='source'>
                <h4>Source</h4>
                <pre class='hidden' data-id='{{parent}}+{{name}}'><code>{{code}}</code></pre>
              </section>
              
            </section>
          {{/helpers}}
          
          {{#has_inherited}}
            <header id='{{name}}-inherited'>
              <h3>Inherited Methods</h3>
            </header>
          {{/has_inherited}}
          
          {{#inherited}}
            <section class='method' id='{{parent}}^{{name}}'>
              <header>
                <h3>{{name}}</h3>
                <h4>{{signature}}</h4>
                <p class='type'>{{type}}</p>
                {{#related}}
                  <p class='related'>See: <a href='#{{href}}'>{{name}}</a></p>
                {{/related}}
              </header>

              <section class='params'>
                {{#has_params}}
                  <h4>Params</h4>
                {{/has_params}}
                <ul>
                  {{#params}}
                    <li><span class="bold">{{name}}</span> - <span class="em">{{types}}</span> {{{description}}}</li>
                  {{/params}}
                </ul>
              </section>

              <section class='params'>
                {{#has_returns}}
                  <h4>Returns</h4>
                  {{#returns}}
                    <p><span class="em">{{types}}</span> {{{description}}}</p>
                  {{/returns}}
                {{/has_returns}}
              </section>

              <section>
                {{{full_description}}}
              </section>

              <section class='source'>
                <h4>Source</h4>
                <pre class='hidden' data-id='{{parent}}^{{name}}'><code>{{code}}</code></pre>
              </section>
              
            </section>
          {{/inherited}}
        </article>
      {{/module}}
    </div>
  </div>
  <script>
    (function (hijs) {
    //
    // hijs - JavaScript Syntax Highlighter
    //
    // Copyright (c) 2010 Alexis Sellier
    //

    // All elements which match this will be syntax highlighted.
    var selector = hijs || 'code';

    var keywords = ('var function if else for while break switch case do new null in with void '
                   +'continue delete return this true false throw catch typeof with instanceof').split(' '),
        special  = ('eval window document undefined NaN Infinity parseInt parseFloat '
                   +'encodeURI decodeURI encodeURIComponent decodeURIComponent').split(' ');

    // Syntax definition
    // The key becomes the class name of the <span>
    // around the matched block of code.
    var syntax = [
      ['comment', /(\/\*(?:[^*\n]|\*+[^\/*])*\*+\/)/g],
      ['comment', /(\/\/[^\n]*)/g],
      ['string' , /("(?:(?!")[^\\\n]|\\.)*"|'(?:(?!')[^\\\n]|\\.)*')/g],
      ['regexp' , /(\/.+\/[mgi]*)(?!\s*\w)/g],
      ['class'  , /\b([A-Z][a-zA-Z]+)\b/g],
      ['number' , /\b([0-9]+(?:\.[0-9]+)?)\b/g],
      ['keyword', new(RegExp)('\\b(' + keywords.join('|') + ')\\b', 'g')],
      ['special', new(RegExp)('\\b(' + special.join('|') + ')\\b', 'g')]
    ];
    var nodes, table = {};

    if (/^[a-z]+$/.test(selector)) {
        nodes = document.getElementsByTagName(selector);
    } else if (/^\.[\w-]+$/.test(selector)) {
        nodes = document.getElementsByClassName(selector.slice(1));
    } else if (document.querySelectorAll) {
        nodes = document.querySelectorAll(selector);
    } else {
        nodes = [];
    }

    for (var i = 0, children; i < nodes.length; i++) {
        children = nodes[i].childNodes;

        for (var j = 0, str; j < children.length; j++) {
            code = children[j];

            if (code.length >= 0) { // It's a text node
                // Don't highlight command-line snippets
                if (! /^\$/.test(code.nodeValue.trim())) {
                    syntax.forEach(function (s) {
                        var k = s[0], v = s[1];
                        code.nodeValue = code.nodeValue.replace(v, function (_, m) {
                            return '\u00ab' + encode(k) + '\u00b7'
                                            + encode(m) +
                                   '\u00b7' + encode(k) + '\u00bb';
                        });
                    });
                }
            }
        }
    }
    for (var i = 0; i < nodes.length; i++) {
        nodes[i].innerHTML =
            nodes[i].innerHTML.replace(/\u00ab(.+?)\u00b7(.+?)\u00b7\1\u00bb/g, function (_, name, value) {
                value = value.replace(/\u00ab[^\u00b7]+\u00b7/g, '').replace(/\u00b7[^\u00bb]+\u00bb/g, '');
                return '<span class="' + decode(name) + '">' + escape(decode(value)) + '</span>';
        });
    }

    function escape(str) {
        return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');
    }

    // Encode ASCII characters to, and from Braille
    function encode (str, encoded) {
        table[encoded = str.split('').map(function (s) {
            if (s.charCodeAt(0) > 127) { return s }
            return String.fromCharCode(s.charCodeAt(0) + 0x2800);
        }).join('')] = str;
        return encoded;
    }
    function decode (str) {
        if (str in table) {
            return table[str];
        } else {
            return str.trim().split('').map(function (s) {
                if (s.charCodeAt(0) - 0x2800 > 127) { return s }
                return String.fromCharCode(s.charCodeAt(0) - 0x2800);
            }).join('');
        }
    }

    })(window.hijs);
  </script>
</body>
