Permalink
Browse files

prettier macro formats

  • Loading branch information...
1 parent 2eacce4 commit 4df71cbc93c35abba432946ae850528ce441b32a @nzakas committed Dec 23, 2011
Showing with 19,441 additions and 29 deletions.
  1. +78 −1 build.xml
  2. +36 −13 buildr.properties
  3. +14 −0 buildr.xml
  4. +43 −0 demo.css
  5. +3 −0 docs/api.js
  6. BIN docs/assets/css/external-small.png
  7. BIN docs/assets/css/logo.png
  8. +763 −0 docs/assets/css/main.css
  9. +42 −0 docs/assets/js/api-filter.js
  10. +246 −0 docs/assets/js/api-list.js
  11. +98 −0 docs/assets/js/api-search.js
  12. +384 −0 docs/assets/js/apidocs.js
  13. +38 −0 docs/assets/js/tabs.js
  14. +17 −0 docs/assets/js/yui-prettify.js
  15. +130 −0 docs/assets/vendor/prettify/CHANGES.html
  16. +202 −0 docs/assets/vendor/prettify/COPYING
  17. +203 −0 docs/assets/vendor/prettify/README.html
  18. +1 −0 docs/assets/vendor/prettify/prettify-min.css
  19. +35 −0 docs/assets/vendor/prettify/prettify-min.js
  20. +214 −0 docs/classes/parserlib.util.EventTarget.html
  21. +1,311 −0 docs/classes/parserlib.util.StringReader.html
  22. +430 −0 docs/classes/parserlib.util.SyntaxError.html
  23. +731 −0 docs/classes/parserlib.util.SyntaxUnit.html
  24. +1,655 −0 docs/classes/parserlib.util.TokenStreamBase.html
  25. +838 −0 docs/data.json
  26. +1,014 −0 docs/files/_home_nicholas_share_personal_buildr_tmp_parserlib-core.js.html
  27. +123 −0 docs/index.html
  28. BIN lib/JsTestDriver-1.3.3d.jar
  29. +183 −0 lib/jsdoc-toolkit/README.txt
  30. +33 −0 lib/jsdoc-toolkit/app/frame.js
  31. +102 −0 lib/jsdoc-toolkit/app/frame/Chain.js
  32. +144 −0 lib/jsdoc-toolkit/app/frame/Dumper.js
  33. +84 −0 lib/jsdoc-toolkit/app/frame/Hash.js
  34. +173 −0 lib/jsdoc-toolkit/app/frame/Link.js
  35. +10 −0 lib/jsdoc-toolkit/app/frame/Namespace.js
  36. +134 −0 lib/jsdoc-toolkit/app/frame/Opt.js
  37. +26 −0 lib/jsdoc-toolkit/app/frame/Reflection.js
  38. +93 −0 lib/jsdoc-toolkit/app/frame/String.js
  39. +129 −0 lib/jsdoc-toolkit/app/frame/Testrun.js
  40. +26 −0 lib/jsdoc-toolkit/app/handlers/FOODOC.js
  41. +26 −0 lib/jsdoc-toolkit/app/handlers/XMLDOC.js
  42. +159 −0 lib/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js
  43. +16 −0 lib/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js
  44. +292 −0 lib/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js
  45. +106 −0 lib/jsdoc-toolkit/app/lib/JSDOC.js
  46. +204 −0 lib/jsdoc-toolkit/app/lib/JSDOC/DocComment.js
  47. +294 −0 lib/jsdoc-toolkit/app/lib/JSDOC/DocTag.js
  48. +140 −0 lib/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js
  49. +109 −0 lib/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js
  50. +144 −0 lib/jsdoc-toolkit/app/lib/JSDOC/Lang.js
  51. +146 −0 lib/jsdoc-toolkit/app/lib/JSDOC/Parser.js
  52. +33 −0 lib/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js
  53. +644 −0 lib/jsdoc-toolkit/app/lib/JSDOC/Symbol.js
  54. +243 −0 lib/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js
  55. +41 −0 lib/jsdoc-toolkit/app/lib/JSDOC/TextStream.js
  56. +18 −0 lib/jsdoc-toolkit/app/lib/JSDOC/Token.js
  57. +332 −0 lib/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js
  58. +133 −0 lib/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js
  59. +32 −0 lib/jsdoc-toolkit/app/lib/JSDOC/Util.js
  60. +507 −0 lib/jsdoc-toolkit/app/lib/JSDOC/Walker.js
  61. +111 −0 lib/jsdoc-toolkit/app/main.js
  62. +20 −0 lib/jsdoc-toolkit/app/plugins/commentSrcJson.js
  63. +16 −0 lib/jsdoc-toolkit/app/plugins/frameworkPrototype.js
  64. +10 −0 lib/jsdoc-toolkit/app/plugins/functionCall.js
  65. +62 −0 lib/jsdoc-toolkit/app/plugins/publishSrcHilite.js
  66. +10 −0 lib/jsdoc-toolkit/app/plugins/symbolLink.js
  67. +31 −0 lib/jsdoc-toolkit/app/plugins/tagParamConfig.js
  68. +43 −0 lib/jsdoc-toolkit/app/plugins/tagSynonyms.js
  69. +348 −0 lib/jsdoc-toolkit/app/run.js
  70. +144 −0 lib/jsdoc-toolkit/app/t/TestDoc.js
  71. +13 −0 lib/jsdoc-toolkit/app/t/runner.js
  72. +342 −0 lib/jsdoc-toolkit/app/test.js
  73. +24 −0 lib/jsdoc-toolkit/app/test/addon.js
  74. +14 −0 lib/jsdoc-toolkit/app/test/anon_inner.js
  75. +31 −0 lib/jsdoc-toolkit/app/test/augments.js
  76. +26 −0 lib/jsdoc-toolkit/app/test/augments2.js
  77. +46 −0 lib/jsdoc-toolkit/app/test/borrows.js
  78. +23 −0 lib/jsdoc-toolkit/app/test/borrows2.js
  79. +22 −0 lib/jsdoc-toolkit/app/test/config.js
  80. +18 −0 lib/jsdoc-toolkit/app/test/constructs.js
  81. +10 −0 lib/jsdoc-toolkit/app/test/encoding.js
  82. +12 −0 lib/jsdoc-toolkit/app/test/encoding_other.js
  83. +54 −0 lib/jsdoc-toolkit/app/test/event.js
  84. +14 −0 lib/jsdoc-toolkit/app/test/exports.js
  85. +39 −0 lib/jsdoc-toolkit/app/test/functions_anon.js
  86. +33 −0 lib/jsdoc-toolkit/app/test/functions_nested.js
  87. +13 −0 lib/jsdoc-toolkit/app/test/global.js
  88. +25 −0 lib/jsdoc-toolkit/app/test/globals.js
  89. +10 −0 lib/jsdoc-toolkit/app/test/ignore.js
  90. +16 −0 lib/jsdoc-toolkit/app/test/inner.js
  91. +477 −0 lib/jsdoc-toolkit/app/test/jsdoc_test.js
  92. +33 −0 lib/jsdoc-toolkit/app/test/lend.js
  93. +19 −0 lib/jsdoc-toolkit/app/test/memberof.js
  94. +38 −0 lib/jsdoc-toolkit/app/test/memberof2.js
  95. +33 −0 lib/jsdoc-toolkit/app/test/memberof3.js
  96. +17 −0 lib/jsdoc-toolkit/app/test/memberof_constructor.js
  97. +17 −0 lib/jsdoc-toolkit/app/test/module.js
  98. +25 −0 lib/jsdoc-toolkit/app/test/multi_methods.js
  99. +19 −0 lib/jsdoc-toolkit/app/test/name.js
  100. +23 −0 lib/jsdoc-toolkit/app/test/namespace_nested.js
  101. +13 −0 lib/jsdoc-toolkit/app/test/nocode.js
  102. +20 −0 lib/jsdoc-toolkit/app/test/oblit_anon.js
  103. +20 −0 lib/jsdoc-toolkit/app/test/overview.js
  104. +37 −0 lib/jsdoc-toolkit/app/test/param_inline.js
  105. +8 −0 lib/jsdoc-toolkit/app/test/params_optional.js
  106. +17 −0 lib/jsdoc-toolkit/app/test/prototype.js
  107. +9 −0 lib/jsdoc-toolkit/app/test/prototype_nested.js
  108. +13 −0 lib/jsdoc-toolkit/app/test/prototype_oblit.js
  109. +24 −0 lib/jsdoc-toolkit/app/test/prototype_oblit_constructor.js
  110. +10 −0 lib/jsdoc-toolkit/app/test/public.js
  111. +5 −0 lib/jsdoc-toolkit/app/test/scripts/code.js
  112. +5 −0 lib/jsdoc-toolkit/app/test/scripts/notcode.txt
  113. +42 −0 lib/jsdoc-toolkit/app/test/shared.js
  114. +2 −0 lib/jsdoc-toolkit/app/test/shared2.js
  115. +22 −0 lib/jsdoc-toolkit/app/test/shortcuts.js
  116. +13 −0 lib/jsdoc-toolkit/app/test/static_this.js
  117. +31 −0 lib/jsdoc-toolkit/app/test/synonyms.js
  118. +23 −0 lib/jsdoc-toolkit/app/test/tosource.js
  119. +14 −0 lib/jsdoc-toolkit/app/test/variable_redefine.js
  120. +124 −0 lib/jsdoc-toolkit/changes.txt
  121. +31 −0 lib/jsdoc-toolkit/conf/sample.conf
  122. +36 −0 lib/jsdoc-toolkit/java/build.xml
  123. +36 −0 lib/jsdoc-toolkit/java/build_1.4.xml
  124. BIN lib/jsdoc-toolkit/java/classes/js.jar
  125. +21 −0 lib/jsdoc-toolkit/java/src/JsDebugRun.java
  126. +21 −0 lib/jsdoc-toolkit/java/src/JsRun.java
  127. BIN lib/jsdoc-toolkit/jsdebug.jar
  128. BIN lib/jsdoc-toolkit/jsrun.jar
  129. +52 −0 lib/jsdoc-toolkit/jsrun.sh
  130. +17 −0 lib/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl
  131. +56 −0 lib/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl
  132. +649 −0 lib/jsdoc-toolkit/templates/jsdoc/class.tmpl
  133. +39 −0 lib/jsdoc-toolkit/templates/jsdoc/index.tmpl
  134. +201 −0 lib/jsdoc-toolkit/templates/jsdoc/publish.js
  135. +162 −0 lib/jsdoc-toolkit/templates/jsdoc/static/default.css
  136. +2 −0 lib/jsdoc-toolkit/templates/jsdoc/static/header.html
  137. +19 −0 lib/jsdoc-toolkit/templates/jsdoc/static/index.html
  138. +35 −0 lib/jsdoc-toolkit/templates/jsdoc/symbol.tmpl
  139. +1 −1 macros/csslint.xml
  140. +7 −8 macros/jshint.xml
  141. +52 −6 macros/yuicompressor.xml
  142. +45 −0 macros/yuitest.xml
  143. +11 −0 parserlib-core-min.js
  144. +905 −0 parserlib-core.js
  145. +905 −0 tmp/parserlib-core.js
View
79 build.xml
@@ -1,11 +1,88 @@
<project name="buildr">
<!-- import all properties -->
- <loadproperties srcFile="buildr.properties" />
+ <loadproperties srcfile="buildr.properties" />
<!-- import all macros -->
<import>
<fileset dir="${buildr.macros.dir}" includes="*.xml" />
</import>
+
+ <target name="lint">
+ <csslint>
+ <fileset dir="." includes="*.css" />
+ </csslint>
+ </target>
+
+ <target name="minify-closure">
+
+ <apply executable="java" failonerror="true">
+
+ <fileset dir="." includes="*.js"/>
+ <mapper type="glob" from="*.js" to="./*-min.js"/>
+
+ <arg line="-jar"/>
+ <arg path="${buildr.lib.dir}/${buildr.closure}"/>
+
+ <arg line="--js"/>
+ <srcfile/>
+
+ <arg line="--js_output_file"/>
+ <targetfile/>
+ </apply>
+
+ </target>
+
+ <target name="compress">
+
+ <pathconvert pathsep=";" property="buildr.jsfiles">
+ <fileset dir="." includes="*.js"/>
+ </pathconvert>
+
+ <script language="javascript"> <![CDATA[
+ importPackage(java.io);
+
+ var files = project.getProperty("buildr.jsfiles").split(";");
+
+
+ for (i=0; i < files.length; i++) {
+ gzip = project.createTask("gzip");
+ gzip.setSrc(new File(files[i]));
+ gzip.setDestfile(new File(files[i].replace(".js", ".js.gz")));
+ gzip.perform();
+ }
+
+ ]]> </script>
+ </target>
+
+ <target name="document-jsdoc">
+ <apply executable="java" failonerror="true" parallel="true">
+ <fileset dir="." includes="parserlib-core.js" />
+ <arg line="-jar ${buildr.jsdoc}"/>
+ <arg line="-t=${buildr.jsdoc.templates}" />
+ <arg line="-d=./out" />
+ <srcfile/>
+ </apply>
+ </target>
+
+ <target name="document-jsdoc2">
+ <apply executable="java" failonerror="true" parallel="true">
+ <fileset dir="." includes="parserlib-core.js" />
+ <arg line="-jar ${buildr.jsdoc}"/>
+ <arg line="-t=${buildr.jsdoc.templates}" />
+ <arg line="-d=./out" />
+ <srcfile/>
+ </apply>
+ </target>
+
+ <target name="document-yuidoc">
+ <exec executable="yuidoc" failonerror="true">
+ <arg path="./tmp"/>
+ <arg line="-o" />
+ <arg path="./docs"/>
+ </exec>
+ </target>
+
+
</project>
View
49 buildr.properties
@@ -1,21 +1,44 @@
-buildr.lib.dir = ./lib
-buildr.macros.dir = ./macros
+# Directories
+buildr.lib.dir = ${buildr.basedir}/lib
+buildr.macros.dir = ${buildr.basedir}/macros
-# Utilities
-buildr.rhino = js.jar
+# Closure
buildr.closure = compiler.jar
-buildr.yuicompressor = yuicompressor-2.4.7.jar
+buildr.closure.path = ${buildr.lib.dir}/${buildr.closure}
+
+# CSSEmbed
buildr.cssembed = cssembed-0.4.5.jar
-buildr.props2js = props2js-0.1.0.jar
-buildr.yuitest = yuitest-rhino-cli.js
-buildr.jshint = jshint.js
-buildr.csslint = csslint-rhino.js
+buildr.cssembed.path = ${buildr.lib.dir}/${buildr.cssembed}
-# CSS Lint Default Configuration
+# CSS Lint
+buildr.csslint = csslint-rhino.js
+buildr.csslint.path = ${buildr.lib.dir}/${buildr.csslint}
buildr.csslint.opts = --errors=errors
-# JSHint Default Configuration
+# JSDoc Toolkit
+buildr.jsdoc.dir = ${buildr.lib.dir}/jsdoc-toolkit
+buildr.jsdoc = ${buildr.jsdoc.dir}/jsrun.jar ${buildr.jsdoc.dir}/app/run.js
+buildr.jsdoc.templates = ${buildr.jsdoc.dir}/templates
+
+# JSHint
+buildr.jshint = jshint.js
+buildr.jshint.path = ${buildr.lib.dir}/${buildr.jshint}
buildr.jshint.opts = curly=true,forin=true,latedef=true,noempty=true,undef=true,rhino=false
-# YUI Compressor Default Configuration
-buildr.yuicompressor.opts =
+# Props2Js
+buildr.props2js = props2js-0.1.0.jar
+buildr.props2js.path = ${buildr.lib.dir}/${buildr.props2js}
+
+# Rhino
+buildr.rhino = js.jar
+buildr.rhino.path = ${buildr.lib.dir}/${buildr.rhino}
+
+# YUI Compressor
+buildr.yuicompressor = yuicompressor-2.4.7.jar
+buildr.yuicompressor.path = ${buildr.lib.dir}/${buildr.yuicompressor}
+
+# YUI Test
+buildr.yuitest.rhino = yuitest-rhino-cli.js
+buildr.yuitest.rhino.path = ${buildr.lib.dir}/${buildr.yuitest.rhino}
+
+
View
14 buildr.xml
@@ -0,0 +1,14 @@
+<project name="buildr">
+
+ <!-- set base directory -->
+ <dirname property="buildr.basedir" file="${ant.file.buildr}"/>
+
+ <!-- import all properties -->
+ <loadproperties srcfile="${buildr.basedir}/buildr.properties" />
+
+ <!-- import all macros -->
+ <import>
+ <fileset dir="${buildr.macros.dir}" includes="*.xml" />
+ </import>
+
+</project>
View
43 demo.css
@@ -0,0 +1,43 @@
+@charset "UTF-8";
+
+@import url("booya.css") print,screen;
+@import "whatup.css" screen;
+@import "wicked.css";
+
+@namespace "http://www.w3.org/1999/xhtml";
+@namespace svg "http://www.w3.org/2000/svg";
+
+li.inline #foo {
+ background: rgba(234, 212, 200, 0.5) url("something.png");
+ display: inline;
+ padding-left: 3px;
+ padding-right: 7px;
+ border-right: 1px dotted #066;
+}
+
+li.last.first {
+ display: inline;
+ padding-left: 3px !important;
+ padding-right: 3px;
+ border-right: 0px;
+}
+
+@media print {
+ li.inline {
+ color: black;
+ }
+
+
+@charset "UTF-8";
+
+@page {
+ margin: 10%;
+ counter-increment: page;
+
+ @top-center {
+ font-family: sans-serif;
+ font-weight: bold;
+ font-size: 2em;
+ content: counter(page);
+ }
+}
View
3 docs/api.js
@@ -0,0 +1,3 @@
+YUI.add("yuidoc-meta", function(Y) {
+ Y.YUIDoc = { meta: {"classes":["parserlib.util.EventTarget","parserlib.util.StringReader","parserlib.util.SyntaxError","parserlib.util.SyntaxUnit","parserlib.util.TokenStreamBase"],"modules":[],"allModules":[]} };
+});
View
BIN docs/assets/css/external-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/assets/css/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
763 docs/assets/css/main.css
@@ -0,0 +1,763 @@
+/*
+Font sizes for all selectors other than the body are given in percentages,
+with 100% equal to 13px. To calculate a font size percentage, multiply the
+desired size in pixels by 7.6923076923.
+
+Here's a quick lookup table:
+
+10px - 76.923%
+11px - 84.615%
+12px - 92.308%
+13px - 100%
+14px - 107.692%
+15px - 115.385%
+16px - 123.077%
+17px - 130.769%
+18px - 138.462%
+19px - 146.154%
+20px - 153.846%
+*/
+
+html {
+ background: #fff;
+ color: #333;
+ overflow-y: scroll;
+}
+
+body {
+ font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;
+ margin: 0;
+ padding: 0;
+}
+
+/* -- Links ----------------------------------------------------------------- */
+a {
+ color: #356de4;
+ text-decoration: none;
+}
+
+a:hover { text-decoration: underline; }
+
+/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from
+ sight until it's focused. */
+.jump {
+ position: absolute;
+ padding: 3px 6px;
+ left: -99999px;
+ top: 0;
+}
+
+.jump:focus { left: 40%; }
+
+/* -- Paragraphs ------------------------------------------------------------ */
+p { margin: 1.3em 0; }
+dd p, td p { margin-bottom: 0; }
+dd p:first-child, td p:first-child { margin-top: 0; }
+
+/* -- Headings -------------------------------------------------------------- */
+h1, h2, h3, h4, h5, h6 {
+ color: #D98527;/*was #f80*/
+ font-family: 'Trebuchet MS', sans-serif;
+ font-weight: bold;
+ line-height: 1.1;
+ margin: 1.1em 0 0.5em;
+}
+
+h1 {
+ font-size: 184.6%;
+ color: #30418C;
+ margin: 0.75em 0 0.5em;
+}
+
+h2 {
+ font-size: 153.846%;
+ color: #E48A2B;
+}
+
+h3 { font-size: 138.462%; }
+
+h4 {
+ border-bottom: 1px solid #DBDFEA;
+ color: #E48A2B;
+ font-size: 115.385%;
+ font-weight: normal;
+ padding-bottom: 2px;
+}
+
+h5, h6 { font-size: 107.692%; }
+
+/* -- Code and examples ----------------------------------------------------- */
+code, kbd, pre, samp {
+ font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;
+ font-size: 92.308%;
+ line-height: 1.35;
+}
+
+p code, p kbd, p samp {
+ background: #FCFBFA;
+ border: 1px solid #EFEEED;
+ padding: 0 3px;
+}
+
+a code, a kbd, a samp,
+pre code, pre kbd, pre samp,
+table code, table kbd, table samp,
+.intro code, .intro kbd, .intro samp,
+.toc code, .toc kbd, .toc samp {
+ background: none;
+ border: none;
+ padding: 0;
+}
+
+pre.code, pre.terminal, pre.cmd {
+ overflow-x: auto;
+ *overflow-x: scroll;
+ padding: 0.3em 0.6em;
+}
+
+pre.code {
+ background: #FCFBFA;
+ border: 1px solid #EFEEED;
+ border-left-width: 5px;
+}
+
+pre.terminal, pre.cmd {
+ background: #F0EFFC;
+ border: 1px solid #D0CBFB;
+ border-left: 5px solid #D0CBFB;
+}
+
+/* Don't reduce the font size of <code>/<kbd>/<samp> elements inside <pre>
+ blocks. */
+pre code, pre kbd, pre samp { font-size: 100%; }
+
+/* Used to denote text that shouldn't be selectable, such as line numbers or
+ shell prompts. Guess which browser this doesn't work in. */
+.noselect {
+ -moz-user-select: -moz-none;
+ -khtml-user-select: none;
+ -webkit-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+
+/* -- Lists ----------------------------------------------------------------- */
+dd { margin: 0.2em 0 0.7em 1em; }
+dl { margin: 1em 0; }
+dt { font-weight: bold; }
+
+/* -- Tables ---------------------------------------------------------------- */
+caption, th { text-align: left; }
+
+table {
+ border-collapse: collapse;
+ width: 100%;
+}
+
+td, th {
+ border: 1px solid #fff;
+ padding: 5px 12px;
+ vertical-align: top;
+}
+
+td { background: #E6E9F5; }
+td dl { margin: 0; }
+td dl dl { margin: 1em 0; }
+td pre:first-child { margin-top: 0; }
+
+th {
+ background: #D2D7E6;/*#97A0BF*/
+ border-bottom: none;
+ border-top: none;
+ color: #000;/*#FFF1D5*/
+ font-family: 'Trebuchet MS', sans-serif;
+ font-weight: bold;
+ line-height: 1.3;
+ white-space: nowrap;
+}
+
+
+/* -- Layout and Content ---------------------------------------------------- */
+#doc {
+ margin: auto;
+ min-width: 1024px;
+}
+
+.content { padding: 0 20px 0 25px; }
+
+.sidebar {
+ padding: 0 15px 0 10px;
+}
+#bd {
+ padding: 7px 0 130px;
+ position: relative;
+ width: 99%;
+}
+
+/* -- Table of Contents ----------------------------------------------------- */
+
+/* The #toc id refers to the single global table of contents, while the .toc
+ class refers to generic TOC lists that could be used throughout the page. */
+
+.toc code, .toc kbd, .toc samp { font-size: 100%; }
+.toc li { font-weight: bold; }
+.toc li li { font-weight: normal; }
+
+/* -- Intro and Example Boxes ----------------------------------------------- */
+.intro, .example { margin-bottom: 2em; }
+
+.example {
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+ -moz-box-shadow: 0 0 5px #bfbfbf;
+ -webkit-box-shadow: 0 0 5px #bfbfbf;
+ box-shadow: 0 0 5px #bfbfbf;
+ padding: 1em;
+}
+
+.intro {
+ background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
+}
+
+/* -- Other Styles ---------------------------------------------------------- */
+
+/* These are probably YUI-specific, and should be moved out of Selleck's default
+ theme. */
+
+.button {
+ border: 1px solid #dadada;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ color: #444;
+ display: inline-block;
+ font-family: Helvetica, Arial, sans-serif;
+ font-size: 92.308%;
+ font-weight: bold;
+ padding: 4px 13px 3px;
+ -moz-text-shadow: 1px 1px 0 #fff;
+ -webkit-text-shadow: 1px 1px 0 #fff;
+ text-shadow: 1px 1px 0 #fff;
+ white-space: nowrap;
+
+ background: #EFEFEF; /* old browsers */
+ background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
+}
+
+.button:hover {
+ border-color: #466899;
+ color: #fff;
+ text-decoration: none;
+ -moz-text-shadow: 1px 1px 0 #222;
+ -webkit-text-shadow: 1px 1px 0 #222;
+ text-shadow: 1px 1px 0 #222;
+
+ background: #6396D8; /* old browsers */
+ background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
+}
+
+.newwindow { text-align: center; }
+
+.header .version em {
+ display: block;
+ text-align: right;
+}
+
+
+a.external {
+ background-image: url(external-small.png);
+ background-repeat: no-repeat;
+ background-position: 0 0;
+ padding-left: 16px;
+}
+
+#classdocs .item {
+ border-bottom: 1px solid #466899;
+ margin: 1em 0;
+ padding: 1.5em;
+}
+
+#classdocs .item .params p,
+ #classdocs .item .returns p,{
+ display: inline;
+}
+
+#classdocs .item em code, #classdocs .item em.comment {
+ color: green;
+}
+
+#classdocs .item em.comment a {
+ color: green;
+ text-decoration: underline;
+}
+
+#classdocs .foundat {
+ font-size: 11px;
+ font-style: normal;
+}
+
+.attrs .emits {
+ margin-left: 2em;
+ padding: .5em;
+ border-left: 1px dashed #ccc;
+}
+
+abbr {
+ border-bottom: 1px dashed #ccc;
+ font-size: 80%;
+ cursor: help;
+}
+
+.prettyprint li.L0,
+.prettyprint li.L1,
+.prettyprint li.L2,
+.prettyprint li.L3,
+.prettyprint li.L5,
+.prettyprint li.L6,
+.prettyprint li.L7,
+.prettyprint li.L8 {
+ list-style: decimal;
+}
+
+ul li p {
+ margin-top: 0;
+}
+
+.method .name {
+ font-size: 110%;
+}
+
+#hd {
+ background: -moz-linear-gradient(center top , #DCDBD9 0%, #F6F5F3 100%) repeat scroll 0 0 transparent;
+ border-bottom: 1px solid #DFDFDF;
+ padding: 0 15px 1px 20px;
+ margin-bottom: 15px;
+}
+
+#hd img {
+ margin-right: 10px;
+ vertical-align: middle;
+}
+
+
+/* -- API Docs CSS ---------------------------------------------------------- */
+
+/*
+This file is organized so that more generic styles are nearer the top, and more
+specific styles are nearer the bottom of the file. This allows us to take full
+advantage of the cascade to avoid redundant style rules. Please respect this
+convention when making changes.
+*/
+
+/* -- Generic TabView styles ------------------------------------------------ */
+
+/*
+These styles apply to all API doc tabviews. To change styles only for a
+specific tabview, see the other sections below.
+*/
+
+.yui3-js-enabled .apidocs .tabview {
+ visibility: hidden; /* Hide until the TabView finishes rendering. */
+ _visibility: visible;
+}
+
+.apidocs .tabview.yui3-tabview-content { visibility: visible; }
+.apidocs .tabview .yui3-tabview-panel { background: #fff; }
+
+/* -- Generic Content Styles ------------------------------------------------ */
+
+/* Headings */
+h2, h3, h4, h5, h6 {
+ border: none;
+ color: #30418C;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+.link-docs {
+ float: right;
+ font-size: 15px;
+ margin: 4px 4px 6px;
+ padding: 6px 30px 5px;
+}
+
+.apidocs { zoom: 1; }
+
+/* Generic box styles. */
+.apidocs .box {
+ border: 1px solid;
+ border-radius: 3px;
+ margin: 1em 0;
+ padding: 0 1em;
+}
+
+/* A flag is a compact, capsule-like indicator of some kind. It's used to
+ indicate private and protected items, item return types, etc. in an
+ attractive and unobtrusive way. */
+.apidocs .flag {
+ background: #bababa;
+ border-radius: 3px;
+ color: #fff;
+ font-size: 11px;
+ margin: 0 0.5em;
+ padding: 2px 4px 1px;
+}
+
+/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
+.apidocs .meta {
+ background: #f9f9f9;
+ border-color: #efefef;
+ color: #555;
+ font-size: 11px;
+ padding: 3px 6px;
+}
+
+.apidocs .meta p { margin: 0; }
+
+/* Deprecation warning. */
+.apidocs .box.deprecated,
+.apidocs .flag.deprecated {
+ background: #fdac9f;
+ border: 1px solid #fd7775;
+}
+
+.apidocs .box.deprecated p { margin: 0.5em 0; }
+.apidocs .flag.deprecated { color: #333; }
+
+/* Module/Class intro description. */
+.apidocs .intro {
+ background: #f0f1f8;
+ border-color: #d4d8eb;
+}
+
+/* Loading spinners. */
+#bd.loading .apidocs,
+#api-list.loading .yui3-tabview-panel {
+ background: #fff url(../img/spinner.gif) no-repeat center 70px;
+ min-height: 150px;
+}
+
+#bd.loading .apidocs .content,
+#api-list.loading .yui3-tabview-panel .apis {
+ display: none;
+}
+
+.apidocs .no-visible-items { color: #666; }
+
+/* Generic inline list. */
+.apidocs ul.inline {
+ display: inline;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+
+.apidocs ul.inline li { display: inline; }
+
+/* Comma-separated list. */
+.apidocs ul.commas li:after { content: ','; }
+.apidocs ul.commas li:last-child:after { content: ''; }
+
+/* Keyboard shortcuts. */
+kbd .cmd { font-family: Monaco, Helvetica; }
+
+/* -- Generic Access Level styles ------------------------------------------- */
+.apidocs .item.protected,
+.apidocs .item.private,
+.apidocs .index-item.protected,
+.apidocs .index-item.private {
+ display: none;
+}
+
+.show-protected .item.protected,
+.show-protected .index-item.protected,
+.show-private .item.private,
+.show-private .index-item.private {
+ display: block;
+}
+
+.hide-inherited .item.inherited,
+.hide-inherited .index-item.inherited {
+ display: none;
+}
+
+/* -- Generic Item Index styles --------------------------------------------- */
+.apidocs .index { margin: 1.5em 0 3em; }
+
+.apidocs .index h3 {
+ border-bottom: 1px solid #efefef;
+ color: #333;
+ font-size: 13px;
+ margin: 2em 0 0.6em;
+ padding-bottom: 2px;
+}
+
+.apidocs .index .no-visible-items { margin-top: 2em; }
+
+.apidocs .index-list {
+ border-color: #efefef;
+ font-size: 12px;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ -moz-column-count: 4;
+ -moz-column-gap: 10px;
+ -moz-column-width: 170px;
+ -ms-column-count: 4;
+ -ms-column-gap: 10px;
+ -ms-column-width: 170px;
+ -o-column-count: 4;
+ -o-column-gap: 10px;
+ -o-column-width: 170px;
+ -webkit-column-count: 4;
+ -webkit-column-gap: 10px;
+ -webkit-column-width: 170px;
+ column-count: 4;
+ column-gap: 10px;
+ column-width: 170px;
+}
+
+.apidocs .no-columns .index-list {
+ -moz-column-count: 1;
+ -ms-column-count: 1;
+ -o-column-count: 1;
+ -webkit-column-count: 1;
+ column-count: 1;
+}
+
+.apidocs .index-item { white-space: nowrap; }
+
+.apidocs .index-item .flag {
+ background: none;
+ border: none;
+ color: #afafaf;
+ display: inline;
+ margin: 0 0 0 0.2em;
+ padding: 0;
+}
+
+/* -- Generic API item styles ----------------------------------------------- */
+.apidocs .args {
+ display: inline;
+ margin: 0 0.5em;
+}
+
+.apidocs .flag.chainable { background: #46ca3b; }
+.apidocs .flag.protected { background: #9b86fc; }
+.apidocs .flag.private { background: #fd6b1b; }
+
+.apidocs .item {
+ border-bottom: 1px solid #efefef;
+ margin: 1.5em 0 2em;
+ padding-bottom: 2em;
+}
+
+.apidocs .item h4,
+.apidocs .item h5,
+.apidocs .item h6 {
+ color: #333;
+ font-family: inherit;
+ font-size: 100%;
+}
+
+.apidocs .item .description p,
+.apidocs .item pre.code {
+ margin: 1em 0 0;
+}
+
+.apidocs .item .meta {
+ background: none;
+ border: none;
+ padding: 0;
+}
+
+.apidocs .item .name {
+ display: inline;
+ font-size: 14px;
+}
+
+.apidocs .item .type,
+.apidocs .item .type a,
+.apidocs .returns-inline {
+ color: #555;
+}
+
+.apidocs .item .type,
+.apidocs .returns-inline {
+ font-size: 11px;
+ margin: 0 0 0 0;
+}
+
+.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
+.apidocs .item .type a:hover { border: none; }
+
+/* -- Item Parameter List --------------------------------------------------- */
+.apidocs .params-list {
+ list-style: square;
+ margin: 1em 0 0 2em;
+ padding: 0;
+}
+
+.apidocs .param { margin-bottom: 1em; }
+
+.apidocs .param .type,
+.apidocs .param .type a {
+ color: #666;
+}
+
+.apidocs .param .type {
+ margin: 0 0 0 0.5em;
+ *margin-left: 0.5em;
+}
+
+.apidocs .param-name { font-weight: bold; }
+
+/* -- Item "Emits" block ---------------------------------------------------- */
+.apidocs .item .emits {
+ background: #f9f9f9;
+ border-color: #eaeaea;
+}
+
+/* -- Item "Returns" block -------------------------------------------------- */
+.apidocs .item .returns .type,
+.apidocs .item .returns .type a {
+ font-size: 100%;
+ margin: 0;
+}
+
+/* -- Class Constructor block ----------------------------------------------- */
+.apidocs .constructor .item {
+ border: none;
+ padding-bottom: 0;
+}
+
+/* -- File Source View ------------------------------------------------------ */
+.apidocs .file pre.code,
+#doc .apidocs .file pre.prettyprint {
+ background: inherit;
+ border: none;
+ overflow: visible;
+ padding: 0;
+}
+
+.apidocs .L0,
+.apidocs .L1,
+.apidocs .L2,
+.apidocs .L3,
+.apidocs .L4,
+.apidocs .L5,
+.apidocs .L6,
+.apidocs .L7,
+.apidocs .L8,
+.apidocs .L9 {
+ background: inherit;
+}
+
+/* -- Submodule List -------------------------------------------------------- */
+.apidocs .module-submodule-description {
+ font-size: 12px;
+ margin: 0.3em 0 1em;
+}
+
+.apidocs .module-submodule-description p:first-child { margin-top: 0; }
+
+/* -- Sidebar TabView ------------------------------------------------------- */
+#api-tabview { margin-top: 0.6em; }
+
+#api-tabview-filter,
+#api-tabview-panel {
+ border: 1px solid #dfdfdf;
+}
+
+#api-tabview-filter {
+ border-bottom: none;
+ border-top: none;
+ padding: 0.6em 10px 0 10px;
+}
+
+#api-tabview-panel { border-top: none; }
+#api-filter { width: 97%; }
+
+/* -- Content TabView ------------------------------------------------------- */
+#classdocs .yui3-tabview-panel { border: none; }
+
+/* -- Source File Contents -------------------------------------------------- */
+.prettyprint li.L0,
+.prettyprint li.L1,
+.prettyprint li.L2,
+.prettyprint li.L3,
+.prettyprint li.L5,
+.prettyprint li.L6,
+.prettyprint li.L7,
+.prettyprint li.L8 {
+ list-style: decimal;
+}
+
+/* -- API options ----------------------------------------------------------- */
+#api-options {
+ font-size: 11px;
+ margin-top: 2.2em;
+ position: absolute;
+ right: 1.5em;
+}
+
+/*#api-options label { margin-right: 0.6em; }*/
+
+/* -- API list -------------------------------------------------------------- */
+#api-list {
+ margin-top: 1.5em;
+ *zoom: 1;
+}
+
+.apis {
+ font-size: 12px;
+ line-height: 1.4;
+ list-style: none;
+ margin: 0;
+ padding: 0.5em 0 0.5em 0.4em;
+}
+
+.apis a {
+ border: 1px solid transparent;
+ display: block;
+ margin: 0 0 0 -4px;
+ padding: 1px 4px 0;
+ text-decoration: none;
+ _border: none;
+ _display: inline;
+}
+
+.apis a:hover,
+.apis a:focus {
+ background: #E8EDFC;
+ background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
+ border-color: #AAC0FA;
+ border-radius: 3px;
+ color: #333;
+ outline: none;
+}
+
+.api-list-item a:hover,
+.api-list-item a:focus {
+ font-weight: bold;
+ text-shadow: 1px 1px 1px #fff;
+}
+
+.apis .message { color: #888; }
+.apis .result a { padding: 3px 5px 2px; }
+
+.apis .result .type {
+ right: 4px;
+ top: 7px;
+}
+
+.api-list-item .yui3-highlight {
+ font-weight: bold;
+}
+
View
42 docs/assets/js/api-filter.js
@@ -0,0 +1,42 @@
+YUI.add('api-filter', function (Y) {
+
+Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
+ // -- Initializer ----------------------------------------------------------
+ initializer: function () {
+ this._bindUIACBase();
+ this._syncUIACBase();
+ }
+
+}, {
+ // -- Attributes -----------------------------------------------------------
+ ATTRS: {
+ resultHighlighter: {
+ value: 'phraseMatch'
+ },
+
+ // May be set to "classes" or "modules".
+ queryType: {
+ value: 'classes'
+ },
+
+ source: {
+ valueFn: function() {
+ var self = this;
+ return function(q) {
+ var data = Y.YUIDoc.meta[self.get('queryType')];
+ var out = [];
+ Y.each(data, function(v) {
+ if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
+ out.push(v);
+ }
+ });
+ return out;
+ }
+ }
+ }
+ }
+});
+
+}, '3.4.0', {requires: [
+ 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
+]});
View
246 docs/assets/js/api-list.js
@@ -0,0 +1,246 @@
+YUI.add('api-list', function (Y) {
+
+var Lang = Y.Lang,
+ YArray = Y.Array,
+
+ APIList = Y.namespace('APIList'),
+
+ classesNode = Y.one('#api-classes'),
+ inputNode = Y.one('#api-filter'),
+ modulesNode = Y.one('#api-modules'),
+ tabviewNode = Y.one('#api-tabview'),
+
+ tabs = APIList.tabs = {},
+
+ filter = APIList.filter = new Y.APIFilter({
+ inputNode : inputNode,
+ maxResults: 1000,
+
+ on: {
+ results: onFilterResults
+ }
+ }),
+
+ search = APIList.search = new Y.APISearch({
+ inputNode : inputNode,
+ maxResults: 100,
+
+ on: {
+ clear : onSearchClear,
+ results: onSearchResults
+ }
+ }),
+
+ tabview = APIList.tabview = new Y.TabView({
+ srcNode : tabviewNode,
+ panelNode: '#api-tabview-panel',
+ render : true,
+
+ on: {
+ selectionChange: onTabSelectionChange
+ }
+ }),
+
+ focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
+ circular : true,
+ descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
+ keys : {next: 'down:40', previous: 'down:38'}
+ }).focusManager,
+
+ LIST_ITEM_TEMPLATE =
+ '<li class="api-list-item {typeSingular}">' +
+ '<a href="{rootPath}{typePlural}/{name}.html">{displayName}</a>' +
+ '</li>';
+
+// -- Init ---------------------------------------------------------------------
+
+// Duckpunch FocusManager's key event handling to prevent it from handling key
+// events when a modifier is pressed.
+Y.before(function (e, activeDescendant) {
+ if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) {
+ return new Y.Do.Prevent();
+ }
+}, focusManager, '_focusPrevious', focusManager);
+
+Y.before(function (e, activeDescendant) {
+ if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) {
+ return new Y.Do.Prevent();
+ }
+}, focusManager, '_focusNext', focusManager);
+
+// Create a mapping of tabs in the tabview so we can refer to them easily later.
+tabview.each(function (tab, index) {
+ var name = tab.get('label').toLowerCase();
+
+ tabs[name] = {
+ index: index,
+ name : name,
+ tab : tab
+ };
+});
+
+// Switch tabs on Ctrl/Cmd-Left/Right arrows.
+tabviewNode.on('key', onTabSwitchKey, 'down:37,39');
+
+// Focus the filter input when the `/` key is pressed.
+Y.one(Y.config.doc).on('key', onSearchKey, 'down:83');
+
+// Keep the Focus Manager up to date.
+inputNode.on('focus', function () {
+ focusManager.set('activeDescendant', inputNode);
+});
+
+// -- Private Functions --------------------------------------------------------
+function getFilterResultNode() {
+ return filter.get('queryType') === 'classes' ? classesNode : modulesNode;
+}
+
+// -- Event Handlers -----------------------------------------------------------
+function onFilterResults(e) {
+ var frag = Y.one(Y.config.doc.createDocumentFragment()),
+ resultNode = getFilterResultNode(),
+ typePlural = filter.get('queryType'),
+ typeSingular = typePlural === 'classes' ? 'class' : 'module';
+
+ if (e.results.length) {
+ YArray.each(e.results, function (result) {
+ frag.append(Lang.sub(LIST_ITEM_TEMPLATE, {
+ rootPath : APIList.rootPath,
+ displayName : result.highlighted,
+ name : result.text,
+ typePlural : typePlural,
+ typeSingular: typeSingular
+ }));
+ });
+ } else {
+ frag.append(
+ '<li class="message">' +
+ 'No ' + typePlural + ' found.' +
+ '</li>'
+ );
+ }
+
+ resultNode.empty(true);
+ resultNode.append(frag);
+
+ focusManager.refresh();
+}
+
+function onSearchClear(e) {
+
+ focusManager.refresh();
+}
+
+function onSearchKey(e) {
+ var target = e.target;
+
+ if (target.test('input,select,textarea')
+ || target.get('isContentEditable')) {
+ return;
+ }
+
+ e.preventDefault();
+
+ inputNode.focus();
+ focusManager.refresh();
+}
+
+function onSearchResults(e) {
+ var frag = Y.one(Y.config.doc.createDocumentFragment());
+
+ if (e.results.length) {
+ YArray.each(e.results, function (result) {
+ frag.append(result.display);
+ });
+ } else {
+ frag.append(
+ '<li class="message">' +
+ 'No results found. Maybe you\'ll have better luck with a ' +
+ 'different query?' +
+ '</li>'
+ );
+ }
+
+
+ focusManager.refresh();
+}
+
+function onTabSelectionChange(e) {
+ var tab = e.newVal,
+ name = tab.get('label').toLowerCase();
+
+ tabs.selected = {
+ index: tab.get('index'),
+ name : name,
+ tab : tab
+ };
+
+ switch (name) {
+ case 'classes': // fallthru
+ case 'modules':
+ filter.setAttrs({
+ minQueryLength: 0,
+ queryType : name
+ });
+
+ search.set('minQueryLength', -1);
+
+ // Only send a request if this isn't the initially-selected tab.
+ if (e.prevVal) {
+ filter.sendRequest(filter.get('value'));
+ }
+ break;
+
+ case 'everything':
+ filter.set('minQueryLength', -1);
+ search.set('minQueryLength', 1);
+
+ if (search.get('value')) {
+ search.sendRequest(search.get('value'));
+ } else {
+ inputNode.focus();
+ }
+ break;
+
+ default:
+ // WTF? We shouldn't be here!
+ filter.set('minQueryLength', -1);
+ search.set('minQueryLength', -1);
+ }
+
+ if (focusManager) {
+ setTimeout(function () {
+ focusManager.refresh();
+ }, 1);
+ }
+}
+
+function onTabSwitchKey(e) {
+ var currentTabIndex = tabs.selected.index;
+
+ if (!(e.ctrlKey || e.metaKey)) {
+ return;
+ }
+
+ e.preventDefault();
+
+ switch (e.keyCode) {
+ case 37: // left arrow
+ if (currentTabIndex > 0) {
+ tabview.selectChild(currentTabIndex - 1);
+ inputNode.focus();
+ }
+ break;
+
+ case 39: // right arrow
+ if (currentTabIndex < (Y.Object.size(tabs) - 2)) {
+ tabview.selectChild(currentTabIndex + 1);
+ inputNode.focus();
+ }
+ break;
+ }
+}
+
+}, '3.4.0', {requires: [
+ 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview'
+]});
View
98 docs/assets/js/api-search.js
@@ -0,0 +1,98 @@
+YUI.add('api-search', function (Y) {
+
+var Lang = Y.Lang,
+ Node = Y.Node,
+ YArray = Y.Array;
+
+Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], {
+ // -- Public Properties ----------------------------------------------------
+ RESULT_TEMPLATE:
+ '<li class="result {resultType}">' +
+ '<a href="{url}">' +
+ '<h3 class="title">{name}</h3>' +
+ '<span class="type">{resultType}</span>' +
+ '<div class="description">{description}</div>' +
+ '<span class="className">{class}</span>' +
+ '</a>' +
+ '</li>',
+
+ // -- Initializer ----------------------------------------------------------
+ initializer: function () {
+ this._bindUIACBase();
+ this._syncUIACBase();
+ },
+
+ // -- Protected Methods ----------------------------------------------------
+ _apiResultFilter: function (query, results) {
+ // Filter components out of the results.
+ return YArray.filter(results, function (result) {
+ return result.raw.resultType === 'component' ? false : result;
+ });
+ },
+
+ _apiResultFormatter: function (query, results) {
+ return YArray.map(results, function (result) {
+ var raw = Y.merge(result.raw), // create a copy
+ desc = raw.description || '';
+
+ // Convert description to text and truncate it if necessary.
+ desc = Node.create('<div>' + desc + '</div>').get('text');
+
+ if (desc.length > 65) {
+ desc = Y.Escape.html(desc.substr(0, 65)) + ' &hellip;';
+ } else {
+ desc = Y.Escape.html(desc);
+ }
+
+ raw['class'] || (raw['class'] = '');
+ raw.description = desc;
+
+ // Use the highlighted result name.
+ raw.name = result.highlighted;
+
+ return Lang.sub(this.RESULT_TEMPLATE, raw);
+ }, this);
+ },
+
+ _apiTextLocator: function (result) {
+ return result.displayName || result.name;
+ }
+}, {
+ // -- Attributes -----------------------------------------------------------
+ ATTRS: {
+ resultFormatter: {
+ valueFn: function () {
+ return this._apiResultFormatter;
+ }
+ },
+
+ resultFilters: {
+ valueFn: function () {
+ return this._apiResultFilter;
+ }
+ },
+
+ resultHighlighter: {
+ value: 'phraseMatch'
+ },
+
+ resultListLocator: {
+ value: 'data.results'
+ },
+
+ resultTextLocator: {
+ valueFn: function () {
+ return this._apiTextLocator;
+ }
+ },
+
+ source: {
+ value: '/api/v1/search?q={query}&count={maxResults}'
+ }
+ }
+});
+
+}, '3.4.0', {requires: [
+ 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources',
+ 'escape'
+]});
View
384 docs/assets/js/apidocs.js
@@ -0,0 +1,384 @@
+YUI().use(
+ 'yuidoc-meta',
+ 'api-list', 'controller', 'history-hash', 'node-event-delegate',
+ 'node-load', 'node-screen', 'node-style',
+function (Y) {
+
+// Autodetecting the URL we are serving from
+var parts = location.href.split('/'),
+ url = [],
+ baseNum = parts.length;
+
+Y.each(parts, function(v, k) {
+ switch (v) {
+ case 'classes':
+ case 'modules':
+ case 'files':
+ baseNum = k;
+ break;
+ default:
+ if (k < baseNum) {
+ url.push(v);
+ }
+ break
+ }
+});
+
+url = url.join('/') + '/';
+
+
+var win = Y.config.win,
+
+ bd = Y.one('#bd'),
+ controller = new Y.Controller({ root: url }),
+ contentNode = Y.one('#docs-main'),
+ localStorage = win.localStorage,
+
+ classTabView,
+ selectedTab;
+
+ Y.APIList.rootPath = url;
+
+// Note: In the following routes, an ?xhr query string is appended to each URL
+// requested via XHR. This has no functional purpose, but works around a bug in
+// both WebKit and Gecko browsers that causes XHR requests (and their headers)
+// to override normal requests in the cache when the URLs are the same, even if
+// the request headers differ.
+
+// -- / ------------------------------------------------------------------------
+controller.route('/(index.html)?', function (req) {
+ if (req.path === controller._lastPath) {
+ return;
+ }
+
+ controller._lastPath = req.path;
+
+ bd.addClass('loading');
+ contentNode.load(this.root + '/?xhr', null, this.afterLoad);
+});
+
+// -- /classes/* ---------------------------------------------------------------
+controller.route('/classes/:class.html', function (req, next) {
+ if (req.path === controller._lastPath) {
+ controller.updateTabState();
+ return;
+ }
+
+ bd.addClass('loading');
+ controller._lastPath = req.path;
+
+ contentNode.load(this.root + '/classes/' + req.params['class'] + '.html?xhr',
+ null,
+ function () {
+ controller.afterLoad();
+ controller.initClassTabView();
+ }
+ );
+});
+
+// -- /files/* -----------------------------------------------------------------
+controller.route('/files/*file', function (req, next) {
+ if (req.path === controller._lastPath) {
+ return;
+ }
+
+ controller._lastPath = req.path;
+
+ bd.addClass('loading');
+ contentNode.load(this.root + '/files/' + req.params.file + '?xhr', null,
+ function () {
+ controller.afterLoad();
+ controller.initLineNumbers();
+ });
+});
+
+// -- /modules/* ---------------------------------------------------------------
+controller.route('/modules/:module.html', function (req, next) {
+ if (req.path === controller._lastPath) {
+ return;
+ }
+
+ controller._lastPath = req.path;
+
+ bd.addClass('loading');
+ contentNode.load(this.root + '/modules/' + req.params.module + '.html?xhr',
+ null, this.afterLoad);
+});
+
+// -- Utility Functions --------------------------------------------------------
+controller.afterLoad = function () {
+ var xhrCrumbsNode = Y.one('#xhr-crumbs'),
+ xhrTitleNode = Y.one('#xhr-title');
+
+ // Update the page title.
+ if (xhrTitleNode) {
+ Y.config.doc.title = xhrTitleNode.get('text');
+ }
+
+ // Enable syntax highlighting on the loaded content.
+ prettyPrint();
+
+ bd.removeClass('loading');
+
+ // Tell Chartbeat about the virtual pageview. Yes, pSUPERFLY is the real
+ // Chartbeat class name.
+ pSUPERFLY.virtualPage(controller.getPath(), Y.config.doc.title);
+};
+
+controller.checkVisibility = function (tab) {
+ tab || (tab = selectedTab);
+
+ if (!tab) { return; }
+
+ var panelNode = tab.get('panelNode'),
+ visibleItems;
+
+ // If no items are visible in the tab panel due to the current visibility
+ // settings, display a message to that effect.
+ visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) {
+ if (itemNode.getComputedStyle('display') !== 'none') {
+ return true;
+ }
+ });
+
+ panelNode.all('.no-visible-items').remove();
+
+ if (!visibleItems) {
+ if (Y.one('#index .index-item')) {
+ panelNode.append(
+ '<div class="no-visible-items">' +
+ '<p>' +
+ 'Some items are not shown due to the current visibility ' +
+ 'settings. Use the checkboxes at the upper right of this ' +
+ 'page to change the visibility settings.' +
+ '</p>' +
+ '</div>'
+ );
+ } else {
+ panelNode.append(
+ '<div class="no-visible-items">' +
+ '<p>' +
+ 'This class doesn\'t provide any methods, properties, ' +
+ 'attributes, or events.' +
+ '</p>' +
+ '</div>'
+ );
+ }
+ }
+
+ // Hide index sections without any visible items.
+ Y.all('.index-section').each(function (section) {
+ var items = 0,
+ visibleItems = 0;
+
+ section.all('.index-item').each(function (itemNode) {
+ items += 1;
+
+ if (itemNode.getComputedStyle('display') !== 'none') {
+ visibleItems += 1;
+ }
+ });
+
+ section.toggleClass('hidden', !visibleItems);
+ section.toggleClass('no-columns', visibleItems < 4);
+ });
+};
+
+controller.initClassTabView = function () {
+ if (!Y.all('#classdocs .api-class-tab').size()) {
+ return;
+ }
+
+ if (classTabView) {
+ classTabView.destroy();
+ selectedTab = null;
+ }
+
+ classTabView = new Y.TabView({
+ srcNode: '#classdocs',
+
+ on: {
+ selectionChange: controller.onTabSelectionChange
+ }
+ });
+
+ controller.updateTabState();
+ classTabView.render();
+};
+
+controller.initLineNumbers = function () {
+ var hash = win.location.hash.substring(1),
+ hasLines,
+ node;
+
+ // Add ids for each line number in the file source view.
+ contentNode.all('.linenums>li').each(function (lineNode, index) {
+ lineNode.set('id', 'l' + (index + 1));
+ lineNode.addClass('file-line');
+ hasLines = true;
+ });
+
+ // Scroll to the desired line.
+ if (hasLines && /^l\d+$/.test(hash)) {
+ if ((node = contentNode.one('#' + hash))) {
+ win.scroll(0, node.getY());
+ }
+ }
+};
+
+controller.updateTabState = function (src) {
+ var hash = win.location.hash.substring(1),
+ defaultTab, node, tab, tabPanel;
+
+ if (!classTabView) {
+ return;
+ }
+
+ if (src === 'hashchange' && !hash) {
+ defaultTab = 'index';
+ } else {
+ if (localStorage) {
+ defaultTab = localStorage.getItem('tab_' + controller.getPath()) ||
+ 'index';
+ } else {
+ defaultTab = 'index';
+ }
+ }
+
+ if (hash && (node = Y.one('#classdocs #' + hash))) {
+ if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) {
+ if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) {
+ if (classTabView.get('rendered')) {
+ Y.Widget.getByNode(tab).set('selected', 1);
+ } else {
+ tab.addClass('yui3-tab-selected');
+ }
+ }
+ }
+
+ // Scroll to the desired element if this is a hash URL.
+ if (node) {
+ if (classTabView.get('rendered')) {
+ scrollToNode();
+ } else {
+ classTabView.once('renderedChange', scrollToNode);
+ }
+ }
+ } else {
+ tab = Y.one('#classdocs .api-class-tab.' + defaultTab);
+
+ if (classTabView.get('rendered')) {
+ Y.Widget.getByNode(tab).set('selected', 1);
+ } else {
+ tab.addClass('yui3-tab-selected')
+ }
+ }
+
+ function scrollToNode() {
+ if (node.hasClass('protected')) {
+ Y.one('#api-show-protected').set('checked', true);
+ controller.updateVisibility();
+ }
+
+ if (node.hasClass('private')) {
+ Y.one('#api-show-private').set('checked', true);
+ controller.updateVisibility();
+ }
+
+ setTimeout(function () {
+ // For some reason, unless we re-get the node instance here,
+ // getY() always returns 0.
+ var node = Y.one('#classdocs #' + hash);
+ win.scrollTo(0, node.getY() - 70);
+ }, 1);
+ }
+};
+
+controller.updateVisibility = function () {
+ contentNode.toggleClass('hide-inherited',
+ !Y.one('#api-show-inherited').get('checked'));
+
+ contentNode.toggleClass('show-protected',
+ Y.one('#api-show-protected').get('checked'));
+
+ contentNode.toggleClass('show-private',
+ Y.one('#api-show-private').get('checked'));
+
+ controller.checkVisibility();
+};
+
+// -- Event Handlers -----------------------------------------------------------
+controller.onLinkClick = function (e) {
+ // Allow the native behavior on middle/right-click, or when Ctrl or Command
+ // are pressed.
+ if (e.button !== 1 || e.ctrlKey || e.metaKey) { return; }
+
+ // Opera currently has bugs when using both HTML5 history and hashchange
+ // events. It gets the legacy fallback behavior until we can properly debug
+ // it.
+ if (Y.UA.opera) { return; }
+
+ var path = controller.removeRoot(e.currentTarget.get('href')),
+ pathNoHash = path.replace(/#.*$/, '');
+
+ if (pathNoHash === controller.getPath()) {
+ // Nothing to do.
+ return;
+ }
+
+ if (controller.hasRoute(pathNoHash)) {
+ e.preventDefault();
+
+ controller.save(path);
+
+ // Scroll to the top of the page. The timeout ensures that the scroll
+ // happens after navigation begins, so that the current scroll position
+ // will be restored if the user clicks the back button.
+ setTimeout(function () {
+ Y.config.win.scroll(0, 0);
+ }, 1);
+ }
+};
+
+controller.onOptionClick = function (e) {
+ controller.updateVisibility();
+};
+
+controller.onTabSelectionChange = function (e) {
+ var tab = e.newVal,
+ tabId = tab.get('contentBox').getAttribute('href').substring(1);
+
+ selectedTab = tab;
+
+ // If switching from a previous tab (i.e., this is not the default tab),
+ // replace the history entry with a hash URL that will cause this tab to
+ // be selected if the user navigates away and then returns using the back
+ // or forward buttons.
+ if (e.prevVal && localStorage) {
+ localStorage.setItem('tab_' + controller.getPath(), tabId);
+ }
+
+ controller.checkVisibility(tab);
+};
+
+// -- Init ---------------------------------------------------------------------
+controller.upgrade();
+
+controller.initClassTabView();
+controller.initLineNumbers();
+controller.updateVisibility();
+
+Y.one('#api-options').delegate('click', controller.onOptionClick, 'input');
+
+// Only intercept link clicks in HTML5 browsers. Supporting both in-page hash
+// navigation and hash-based routing would just be too much of a pain, so legacy
+// browsers will have to endure full page refreshes.
+if (controller.html5) {
+ Y.one('#bd').delegate('click', controller.onLinkClick, 'a');
+}
+
+Y.on('hashchange', function (e) {
+ controller.updateTabState('hashchange');
+}, Y.config.win);
+
+});
View
38 docs/assets/js/tabs.js
@@ -0,0 +1,38 @@
+YUI({
+ insertBefore: 'site_styles'
+}).use('tabview', function(Y) {
+ var classdocs = Y.one('#classdocs'),
+ tabviewIndexTable = {};
+ if (classdocs) {
+ if (classdocs.all('li').size()) {
+ var tabview = new Y.TabView({ srcNode: classdocs });
+ tabview.render();
+ classdocs.all('li a').each(function (item, index) {
+ var hash = item.get(['hash']);
+ type = hash.substring(1);
+ if (!tabviewIndexTable[type]) {
+ tabviewIndexTable[type] = index;
+ }
+ })
+ Y.all('.sidebox.on-page').each(function (item, index) {
+ var children = item.all('li a');
+ children.each(function (cItem, cIndex) {
+ return function () {
+ var handleClick = function (e) {
+ var node = Y.one(this),
+ hash = node.get(['hash']),
+ hashValue = hash.substring(1).split('_'),
+ type = hashValue.shift(),
+ ogKey = hashValue.join('_'); // in case the hash had other underscores
+ if (tabviewIndexTable[type] > -1 && tabviewIndexTable[type] !== currentTab) {
+ currentTab = tabviewIndexTable[type];
+ tabview.selectChild(tabviewIndexTable[type]);
+ }
+ }
+ Y.on('click', handleClick, cItem)
+ }()
+ })
+ });
+ }
+ }
+});
View
17 docs/assets/js/yui-prettify.js
@@ -0,0 +1,17 @@
+YUI().use('node', function(Y) {
+ var code = Y.all('.prettyprint.linenums');
+ if (code.size()) {
+ code.each(function(c) {
+ var lis = c.all('ol li'),
+ l = 1;
+ lis.each(function(n) {
+ n.prepend('<a name="LINENUM_' + l + '"></a>');
+ l++;
+ });
+ });
+ var h = location.hash;
+ location.hash = '';
+ h = h.replace('LINE_', 'LINENUM_');
+ location.hash = h;
+ }
+});
View
130 docs/assets/vendor/prettify/CHANGES.html
@@ -0,0 +1,130 @@
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Change Log</title>
+ </head>
+ <body bgcolor="white">
+ <a style="float:right" href="README.html">README</a>
+
+ <h1>Known Issues</h1>
+ <ul>
+ <li>Perl formatting is really crappy. Partly because the author is lazy and
+ partly because Perl is
+ <a href="http://www.perlmonks.org/?node_id=663393">hard</a> to parse.
+ <li>On some browsers, <code>&lt;code&gt;</code> elements with newlines in the text
+ which use CSS to specify <code>white-space:pre</code> will have the newlines
+ improperly stripped if the element is not attached to the document at the time
+ the stripping is done. Also, on IE 6, all newlines will be stripped from
+ <code>&lt;code&gt;</code> elements because of the way IE6 produces
+ <code>innerHTML</code>. Workaround: use <code>&lt;pre&gt;</code> for code with
+ newlines.
+ </ul>
+
+ <h1>Change Log</h1>
+ <h2>29 March 2007</h2>
+ <ul>
+ <li>Added <a href="tests/prettify_test.html#PHP">tests</a> for PHP support
+ to address
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=3"
+ >issue 3</a>.
+ <li>Fixed
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=6"
+ >bug</a>: <code>prettyPrintOne</code> was not halting. This was not
+ reachable through the normal entry point.
+ <li>Fixed
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=4"
+ >bug</a>: recursing into a script block or PHP tag that was not properly
+ closed would not silently drop the content.
+ (<a href="tests/prettify_test.html#issue4">test</a>)
+ <li>Fixed
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=8"
+ >bug</a>: was eating tabs
+ (<a href="tests/prettify_test.html#issue8">test</a>)
+ <li>Fixed entity handling so that the caveat
+ <blockquote>
+ <p>Caveats: please properly escape less-thans. <tt>x&amp;lt;y</tt>
+ instead of <tt>x&lt;y</tt>, and use <tt>&quot;</tt> instead of
+ <tt>&amp;quot;</tt> for string delimiters.</p>
+ </blockquote>
+ is no longer applicable.
+ <li>Added noisefree's C#
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=4"
+ >patch</a>
+ <li>Added a <a href="http://google-code-prettify.googlecode.com/files/prettify-small.zip">distribution</a> that has comments and
+ whitespace removed to reduce download size from 45.5kB to 12.8kB.
+ </ul>
+ <h2>4 Jul 2008</h2>
+ <ul>
+ <li>Added <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=17">language specific formatters</a> that are triggered by the presence
+ of a <code>lang-&lt;language-file-extension&gt;</code></li>
+ <li>Fixed <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=29">bug</a>: python handling of <code>'''string'''</code>
+ <li>Fixed bug: <code>/</code> in regex <code>[charsets] should not end regex</code>
+ </ul>
+ <h2>5 Jul 2008</h2>
+ <ul>
+ <li>Defined language extensions for Lisp and Lua</code>
+ </ul>
+ <h2>14 Jul 2008</h2>
+ <ul>
+ <li>Language handlers for F#, OCAML, SQL</code>
+ <li>Support for <code>nocode</code> spans to allow embedding of line
+ numbers and code annotations which should not be styled or otherwise
+ affect the tokenization of prettified code.
+ See the issue 22
+ <a href="tests/prettify_test.html#issue22">testcase</a>.</code>
+ </ul>
+ <h2>6 Jan 2009</h2>
+ <ul>
+ <li>Language handlers for Visual Basic, Haskell, CSS, and WikiText</li>
+ <li>Added <tt>.mxml</tt> extension to the markup style handler for
+ Flex <a href="http://en.wikipedia.org/wiki/MXML">MXML files</a>. See
+ <a
+ href="http://code.google.com/p/google-code-prettify/issues/detail?id=37"
+ >issue 37</a>.
+ <li>Added <tt>.m</tt> extension to the C style handler so that Objective
+ C source files properly highlight. See
+ <a
+ href="http://code.google.com/p/google-code-prettify/issues/detail?id=58"
+ >issue 58</a>.
+ <li>Changed HTML lexer to use the same embedded source mechanism as the
+ wiki language handler, and changed to use the registered
+ CSS handler for STYLE element content.
+ </ul>
+ <h2>21 May 2009</h2>
+ <ul>
+ <li>Rewrote to improve performance on large files.
+ See <a href="http://mikesamuel.blogspot.com/2009/05/efficient-parsing-in-javascript.html">benchmarks</a>.</li>
+ <li>Fixed bugs with highlighting of Haskell line comments, Lisp
+ number literals, Lua strings, C preprocessor directives,
+ newlines in Wiki code on Windows, and newlines in IE6.</li>
+ </ul>
+ <h2>14 August 2009</h2>
+ <ul>
+ <li>Fixed prettifying of <code>&lt;code&gt;</code> blocks with embedded newlines.
+ </ul>
+ <h2>3 October 2009</h2>
+ <ul>
+ <li>Fixed prettifying of XML/HTML tags that contain uppercase letters.
+ </ul>
+ <h2>19 July 2010</h2>
+ <ul>
+ <li>Added support for line numbers. Bug
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=22"
+ >22</a></li>
+ <li>Added YAML support. Bug
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=123"
+ >123</a></li>
+ <li>Added VHDL support courtesy Le Poussin.</li>
+ <li>IE performance improvements. Bug
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=102"
+ >102</a> courtesy jacobly.</li>
+ <li>A variety of markup formatting fixes courtesy smain and thezbyg.</li>
+ <li>Fixed copy and paste in IE[678].
+ <li>Changed output to use <code>&amp;#160;</code> instead of
+ <code>&amp;nbsp;</code> so that the output works when embedded in XML.
+ Bug
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=108"
+ >108</a>.</li>
+ </ul>
+ </body>
+</html>
View
202 docs/assets/vendor/prettify/COPYING
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of