Permalink
Browse files

Update browserified demo

  • Loading branch information...
0 parents commit 2b937dd6a72cf1878b841cd0a13887fb33698719 @ixti ixti committed Dec 21, 2011
Showing with 8,870 additions and 0 deletions.
  1. 0 .nojekyll
  2. +68 −0 css/codemirror.css
  3. +19 −0 css/codemirror.default.css
  4. +58 −0 css/demo.css
  5. +238 −0 index.html
  6. +182 −0 js/base64.js
  7. +2,332 −0 js/codemirror.js
  8. +352 −0 js/codemirror/javascript.js
  9. +95 −0 js/codemirror/yaml.js
  10. +86 −0 js/demo.js
  11. +20 −0 js/hasher.min.js
  12. +5,218 −0 js/js-yaml.js
  13. +202 −0 js/utils.js
No changes.
@@ -0,0 +1,68 @@
+.CodeMirror {
+ line-height: 1em;
+ font-family: monospace;
+}
+
+.CodeMirror-scroll {
+ overflow: auto;
+ height: 300px;
+ /* This is needed to prevent an IE[67] bug where the scrolled content
+ is visible outside of the scrolling box. */
+ position: relative;
+}
+
+.CodeMirror-gutter {
+ position: absolute; left: 0; top: 0;
+ z-index: 10;
+ background-color: #f7f7f7;
+ border-right: 1px solid #eee;
+ min-width: 2em;
+ height: 100%;
+}
+.CodeMirror-gutter-text {
+ color: #aaa;
+ text-align: right;
+ padding: .4em .2em .4em .4em;
+}
+.CodeMirror-lines {
+ padding: .4em;
+}
+
+.CodeMirror pre {
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ -o-border-radius: 0;
+ border-radius: 0;
+ border-width: 0; margin: 0; padding: 0; background: transparent;
+ font-family: inherit;
+ font-size: inherit;
+ padding: 0; margin: 0;
+ white-space: pre;
+ word-wrap: normal;
+}
+
+.CodeMirror textarea {
+ font-family: inherit !important;
+ font-size: inherit !important;
+}
+
+.CodeMirror-cursor {
+ z-index: 10;
+ position: absolute;
+ visibility: hidden;
+ border-left: 1px solid black !important;
+}
+.CodeMirror-focused .CodeMirror-cursor {
+ visibility: visible;
+}
+
+span.CodeMirror-selected {
+ background: #ccc !important;
+ color: HighlightText !important;
+}
+.CodeMirror-focused span.CodeMirror-selected {
+ background: Highlight !important;
+}
+
+.CodeMirror-matchingbracket {color: #0f0 !important;}
+.CodeMirror-nonmatchingbracket {color: #f22 !important;}
@@ -0,0 +1,19 @@
+.cm-s-default span.cm-keyword {color: #708;}
+.cm-s-default span.cm-atom {color: #219;}
+.cm-s-default span.cm-number {color: #164;}
+.cm-s-default span.cm-def {color: #00f;}
+.cm-s-default span.cm-variable {color: black;}
+.cm-s-default span.cm-variable-2 {color: #05a;}
+.cm-s-default span.cm-variable-3 {color: #0a5;}
+.cm-s-default span.cm-property {color: black;}
+.cm-s-default span.cm-operator {color: black;}
+.cm-s-default span.cm-comment {color: #a50;}
+.cm-s-default span.cm-string {color: #a11;}
+.cm-s-default span.cm-string-2 {color: #f50;}
+.cm-s-default span.cm-meta {color: #555;}
+.cm-s-default span.cm-error {color: #f00;}
+.cm-s-default span.cm-qualifier {color: #555;}
+.cm-s-default span.cm-builtin {color: #30a;}
+.cm-s-default span.cm-bracket {color: #cc7;}
+.cm-s-default span.cm-tag {color: #170;}
+.cm-s-default span.cm-attribute {color: #00c;}
@@ -0,0 +1,58 @@
+body {
+ margin: 30px;
+ padding: 0;
+ font-family: verdana, sans-serif;
+}
+h1 {
+ font-size: 50px;
+ margin: 40px 0 30px;
+ color: #aaa;
+}
+#permalink {
+ float: right;
+}
+h5 {
+ font-size: 16px;
+ font-weight: normal;
+ line-height: 30px;
+ margin: 0;
+ font-style: italic;
+}
+.src {
+ width: 49%;
+ float: left;
+}
+.dst {
+ width: 49%;
+ float: right;
+}
+
+.src .CodeMirror {
+ background-color: #fffffb;
+ border: 1px solid #888;
+ border-radius: 3px;
+ box-shadow: 0 0 3px #ccc inset;
+}
+
+.dst .CodeMirror {
+ background-color: #F8F8F8;
+ border: 1px solid #eee;
+ border-radius: 3px;
+}
+
+.CodeMirror-scroll {
+ height: 500px;
+ line-height: 1.2;
+}
+
+.cm-s-default span.cm-comment {color: #baa;}
+
+.addthis_toolbox {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ opacity: .6;
+}
+.addthis_toolbox:hover {
+ opacity: 1;
+}
@@ -0,0 +1,238 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>YAML parser for JavaScript - JS-YAML</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta name="description" content="Live example of YAML JavaScript parcer right in your browser. Type your YAML code and see result.">
+ <meta name="keywords" content="yaml,parser,javascript">
+ <link rel="stylesheet" href="css/codemirror.css">
+ <link rel="stylesheet" href="css/codemirror.default.css">
+ <link rel="stylesheet" href="css/demo.css">
+ <script src="js/js-yaml.js"></script>
+ <script src="js/codemirror.js"></script>
+ <script src="js/codemirror/yaml.js"></script>
+ <script src="js/codemirror/javascript.js"></script>
+ <script src="js/hasher.min.js"></script>
+ <script src="js/utils.js"></script>
+ <script src="js/base64.js"></script>
+ <script src="js/demo.js"></script>
+
+<script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-26895916-1']);
+ _gaq.push(['_trackPageview']);
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+</script>
+
+ </head>
+ <body onLoad="runDemo();">
+
+<h1>JS-YAML demo. YAML JavaScript parser.</h1>
+<div class='src'>
+ <h5><a href="#" id="permalink">permalink</a> Edit source here (YAML):</h5>
+ <textarea id="source">---
+# Collection Types #############################################################
+################################################################################
+
+# http://yaml.org/type/map.html -----------------------------------------------#
+
+map:
+ # Unordered set of key: value pairs.
+ Block style: !!map
+ Clark : Evans
+ Ingy : döt Net
+ Oren : Ben-Kiki
+ Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }
+
+# http://yaml.org/type/omap.html ----------------------------------------------#
+
+omap:
+ # Explicitly typed ordered map (dictionary).
+ Bestiary: !!omap
+ - aardvark: African pig-like ant eater. Ugly.
+ - anteater: South-American ant eater. Two species.
+ - anaconda: South-American constrictor snake. Scaly.
+ # Etc.
+ # Flow style
+ Numbers: !!omap [ one: 1, two: 2, three : 3 ]
+
+# http://yaml.org/type/pairs.html ---------------------------------------------#
+
+pairs:
+ # Explicitly typed pairs.
+ Block tasks: !!pairs
+ - meeting: with team.
+ - meeting: with boss.
+ - break: lunch.
+ - meeting: with client.
+ Flow tasks: !!pairs [ meeting: with team, meeting: with boss ]
+
+# http://yaml.org/type/set.html -----------------------------------------------#
+
+set:
+ # Explicitly typed set.
+ baseball players: !!set
+ ? Mark McGwire
+ ? Sammy Sosa
+ ? Ken Griffey
+ # Flow style
+ baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees }
+
+# http://yaml.org/type/seq.html -----------------------------------------------#
+
+seq:
+ # Ordered sequence of nodes
+ Block style: !!seq
+ - Mercury # Rotates - no light/dark sides.
+ - Venus # Deadliest. Aptly named.
+ - Earth # Mostly dirt.
+ - Mars # Seems empty.
+ - Jupiter # The king.
+ - Saturn # Pretty.
+ - Uranus # Where the sun hardly shines.
+ - Neptune # Boring. No rings.
+ - Pluto # You call this a planet?
+ Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks
+ Jupiter, Saturn, Uranus, Neptune, # Gas
+ Pluto ] # Overrated
+
+
+# Scalar Types #################################################################
+################################################################################
+
+# http://yaml.org/type/bool.html ----------------------------------------------#
+
+bool:
+ canonical: y
+ answer: NO
+ logical: True
+ option: on
+
+# http://yaml.org/type/float.html ---------------------------------------------#
+
+float:
+ canonical: 6.8523015e+5
+ exponentioal: 685.230_15e+03
+ fixed: 685_230.15
+ sexagesimal: 190:20:30.15
+ negative infinity: -.inf
+ not a number: .NaN
+
+# http://yaml.org/type/int.html -----------------------------------------------#
+
+int:
+ canonical: 685230
+ decimal: +685_230
+ octal: 02472256
+ hexadecimal: 0x_0A_74_AE
+ binary: 0b1010_0111_0100_1010_1110
+ sexagesimal: 190:20:30
+
+# http://yaml.org/type/merge.html ---------------------------------------------#
+
+merge:
+ - &CENTER { x: 1, y: 2 }
+ - &LEFT { x: 0, y: 2 }
+ - &BIG { r: 10 }
+ - &SMALL { r: 1 }
+
+ # All the following maps are equal:
+
+ - # Explicit keys
+ x: 1
+ y: 2
+ r: 10
+ label: nothing
+
+ - # Merge one map
+ << : *CENTER
+ r: 10
+ label: center
+
+ - # Merge multiple maps
+ << : [ *CENTER, *BIG ]
+ label: center/big
+
+ - # Override
+ << : [ *BIG, *LEFT, *SMALL ]
+ x: 1
+ label: big/left/small
+
+# http://yaml.org/type/null.html ----------------------------------------------#
+
+null:
+ # This mapping has four keys,
+ # one has a value.
+ empty:
+ canonical: ~
+ english: null
+ ~: null key
+ # This sequence has five
+ # entries, two have values.
+ sparse:
+ - ~
+ - 2nd entry
+ -
+ - 4th entry
+ - Null
+
+# http://yaml.org/type/str.html -----------------------------------------------#
+
+string: abcd
+
+# http://yaml.org/type/timestamp.html -----------------------------------------#
+
+timestamp:
+ canonical: 2001-12-15T02:59:43.1Z
+ valid iso8601: 2001-12-14t21:59:43.10-05:00
+ space separated: 2001-12-14 21:59:43.10 -5
+ no time zone (Z): 2001-12-15 2:59:43.10
+ date (00:00:00Z): 2002-12-14
+
+
+# JavaScript Specific Types ####################################################
+################################################################################
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp
+
+regexp:
+ simple: !!js/regexp foobar
+ modifiers: !!js/regexp /foobar/mi
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined
+
+undefined: !!js/undefined ~
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function
+
+function: !!js/function >
+ function foobar() {
+ return 'Wow! JS-YAML Rocks!';
+ }
+ </textarea>
+</div>
+<div class='dst'>
+ <h5>Result (JS object dump):</h5>
+ <textarea id="result"></textarea>
+</div>
+
+<a href="https://github.com/nodeca/js-yaml" title="Source code for YAML JavaScript parser"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub"></a>
+
+<!-- AddThis Button BEGIN
+<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
+<a class="addthis_button_preferred_1"></a>
+<a class="addthis_button_preferred_2"></a>
+<a class="addthis_button_preferred_3"></a>
+<a class="addthis_button_preferred_4"></a>
+<a class="addthis_button_compact"></a>
+<a class="addthis_counter addthis_bubble_style"></a>
+</div>
+<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4eb9fd761a407f6b"></script>
+<!-- AddThis Button END -->
+
+ </body>
+</html>
Oops, something went wrong.

0 comments on commit 2b937dd

Please sign in to comment.