Permalink
Browse files

Demo rewrite

  • Loading branch information...
1 parent 6bdb5e7 commit df57eb59691f95717592fd536f31ee96c7fd4781 @puzrin puzrin committed Jan 11, 2016
View
@@ -4,5 +4,4 @@ dist
doc
node_modules
tmp
-support
benchmark/implementations
View
@@ -1,5 +1,5 @@
coverage
-tmp
+demo
node_modules
doc
benchmark/implementations/*
View
@@ -28,12 +28,21 @@ test: lint
./node_modules/.bin/mocha -R spec
+demo: lint
+ rm -rf ./demo
+ mkdir ./demo
+ cp ./node_modules/codemirror/lib/codemirror.css ./demo/
+ cp ./support/demo_template/index.html ./demo/
+ cp ./support/demo_template/demo.css ./demo/
+ browserify ./support/demo_template/demo.js -r esprima > ./demo/demo.js
+
+
coverage:
rm -rf coverage
./node_modules/.bin/istanbul cover node_modules/.bin/_mocha
-gh-pages:
+gh-pages: demo
@if test -z ${REMOTE_REPO} ; then \
echo 'Remote repo URL not found' >&2 ; \
exit 128 ; \
@@ -89,5 +98,5 @@ todo:
grep 'TODO' -n -r ./lib 2>/dev/null || test true
-.PHONY: publish lint test dev-deps gh-pages todo coverage
+.PHONY: publish lint test dev-deps gh-pages todo coverage demo
.SILENT: help lint test todo coverage
View
@@ -1,10 +1,10 @@
-JS-YAML - YAML 1.2 parser and serializer for JavaScript
-=======================================================
+JS-YAML - YAML 1.2 parser / writer for JavaScript
+=================================================
[![Build Status](https://travis-ci.org/nodeca/js-yaml.svg?branch=master)](https://travis-ci.org/nodeca/js-yaml)
[![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml)
-[Online Demo](http://nodeca.github.com/js-yaml/)
+__[Online Demo](http://nodeca.github.com/js-yaml/)__
This is an implementation of [YAML](http://yaml.org/), a human friendly data
@@ -1,68 +0,0 @@
-.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;}
@@ -1,19 +0,0 @@
-.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;}
View
@@ -5,39 +5,35 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="Live example of YAML JavaScript parser 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/es5-shim.js"></script>
- <script src="js/esprima.js"></script>
- <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/json3.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();">
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.css">
+ <link rel="stylesheet" href="codemirror.css">
+ <link rel="stylesheet" href="demo.css">
+
+ <script src="https://cdn.jsdelivr.net/es5.shim/4.4.1/es5-shim.min.js"></script>
+ <script src="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>
-<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">---
+ </head>
+ <body>
+
+ <div class="header">
+ <h1>JS-YAML demo. YAML JavaScript parser.</h1>
+ </div>
+ <div class="content">
+ <div class="src">
+ <h4 class="subheader"><a href="#" id="permalink">permalink</a> Edit source here:</h4>
+ <textarea id="source">---
# Collection Types #############################################################
################################################################################
@@ -243,27 +239,15 @@
- bunny
- chocolate
</textarea>
-</div>
-<div class='dst'>
- <h5>Result (JS object dump):</h5>
- <textarea id="result"></textarea>
-</div>
-
-<div class="gh-ribbon">
- <a href="https://github.com/nodeca/js-yaml" target="_blank" title="Source code for YAML JavaScript parser">Fork me on GitHub</a>
-</div>
-
-<!-- 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 -->
-
+ </div>
+ <div class="dst">
+ <h4 class="subheader">Result (JS object dump):</h4>
+ <textarea id="result"></textarea>
+ </div>
+ </div>
+
+ <div class="gh-ribbon">
+ <a href="https://github.com/nodeca/js-yaml" target="_blank" title="Source code for YAML JavaScript parser">Fork me on GitHub</a>
+ </div>
</body>
</html>
Oops, something went wrong.

0 comments on commit df57eb5

Please sign in to comment.