import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Count Microformats</title>
<meta name="description" content="microformat-shiv - A light-weight cross browser javascript microformats 2 parser" />
<link rel="stylesheet" href="css/testrunner.css">
<link rel="stylesheet" href="css/prettify.css">
<!-- loads Modules to help with debugging ie windows.Modules -->
<script src="../../lib/utilities.js"></script>
<script src="../../lib/domutils.js"></script>
<script src="../../lib/url.js"></script>
<script src="../../lib/html.js"></script>
<script src="../../lib/text.js"></script>
<script src="../../lib/dates.js"></script>
<script src="../../lib/isodate.js"></script>
<script src="../../lib/parser.js"></script>
<script src="../../lib/parser-implied.js"></script>
<script src="../../lib/parser-includes.js"></script>
<script src="../../lib/parser-rels.js"></script>
<script src="../../lib/maps/h-adr.js"></script>
<script src="../../lib/maps/h-card.js"></script>
<script src="../../lib/maps/h-entry.js"></script>
<script src="../../lib/maps/h-event.js"></script>
<script src="../../lib/maps/h-feed.js"></script>
<script src="../../lib/maps/h-geo.js"></script>
<script src="../../lib/maps/h-item.js"></script>
<script src="../../lib/maps/h-listing.js"></script>
<script src="../../lib/maps/h-news.js"></script>
<script src="../../lib/maps/h-org.js"></script>
<script src="../../lib/maps/h-product.js"></script>
<script src="../../lib/maps/h-recipe.js"></script>
<script src="../../lib/maps/h-resume.js"></script>
<script src="../../lib/maps/h-review-aggregate.js"></script>
<script src="../../lib/maps/h-review.js"></script>
<script src="../../lib/maps/rel.js"></script>
<script src="javascript/beautify.js"></script>
<script src="javascript/prettify.js"></script>
<script src="javascript/count.js"></script>
</head>
<body>
<p>microformat-shiv</p>
<h1>Count Microformats</h1>
<p>Type or copy and paste the HTML you want to parse into the box below.</p>
<form id="mf-form" class="tool-interface" method="get" action="">
<p>
<label for="html">HTML</label>
<textarea id="html" name="html">&lt;a class="h-card" href="http://glennjones.net"&gt;
&lt;span class="p-given-name"&gt;Glenn&lt;/span&gt;
&lt;span class="p-family-name"&gt;Jones&lt;/span&gt;
&lt;/a&gt;
&lt;a class="h-card" href="http://janedoe.net"&gt;
&lt;span class="p-given-name"&gt;Jane&lt;/span&gt;
&lt;span class="p-family-name"&gt;Doe&lt;/span&gt;
&lt;/a&gt;
&lt;a class="h-event" href="http://janedoe.net"&gt;
&lt;span class="p-name"&gt;Event&lt;/span&gt;
&lt;span class="dt-start"&gt;2015-07-01&lt;/span&gt;
&lt;/a&gt;
</textarea>
</p>
<input class="button" value="Count" type="submit">
</form>
<h1>Parser JSON</h1>
<div id="parser-json"><pre class="prettyprint"><code class="language-json"></code></pre></div>
</body>
</html>

View file

@ -0,0 +1,9 @@
body {
font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
padding: 60px 50px;
}
h3.capitalize {
text-transform: capitalize;
}

View file

@ -0,0 +1,270 @@
@charset "utf-8";
body {
margin:0;
}
#mocha {
font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 60px 50px;
}
#mocha ul,
#mocha li {
margin: 0;
padding: 0;
}
#mocha ul {
list-style: none;
}
#mocha h1,
#mocha h2 {
margin: 0;
}
#mocha h1 {
margin-top: 15px;
font-size: 1em;
font-weight: 200;
}
#mocha h1 a {
text-decoration: none;
color: inherit;
}
#mocha h1 a:hover {
text-decoration: underline;
}
#mocha .suite .suite h1 {
margin-top: 0;
font-size: .8em;
}
#mocha .hidden {
display: none;
}
#mocha h2 {
font-size: 12px;
font-weight: normal;
cursor: pointer;
}
#mocha .suite {
margin-left: 15px;
}
#mocha .test {
margin-left: 15px;
overflow: hidden;
}
#mocha .test.pending:hover h2::after {
content: '(pending)';
font-family: arial, sans-serif;
}
#mocha .test.pass.medium .duration {
background: #c09853;
}
#mocha .test.pass.slow .duration {
background: #b94a48;
}
#mocha .test.pass::before {
content: '✓';
font-size: 12px;
display: block;
float: left;
margin-right: 5px;
color: #00d6b2;
}
#mocha .test.pass .duration {
font-size: 9px;
margin-left: 5px;
padding: 2px 5px;
color: #fff;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
}
#mocha .test.pass.fast .duration {
display: none;
}
#mocha .test.pending {
color: #0b97c4;
}
#mocha .test.pending::before {
content: '◦';
color: #0b97c4;
}
#mocha .test.fail {
color: #c00;
}
#mocha .test.fail pre {
color: black;
}
#mocha .test.fail::before {
content: '✖';
font-size: 12px;
display: block;
float: left;
margin-right: 5px;
color: #c00;
}
#mocha .test pre.error {
color: #c00;
max-height: 300px;
overflow: auto;
}
/**
* (1): approximate for browsers not supporting calc
* (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)
* ^^ seriously
*/
#mocha .test pre {
display: block;
float: left;
clear: left;
font: 12px/1.5 monaco, monospace;
margin: 5px;
padding: 15px;
border: 1px solid #eee;
max-width: 85%; /*(1)*/
max-width: calc(100% - 42px); /*(2)*/
word-wrap: break-word;
border-bottom-color: #ddd;
-webkit-border-radius: 3px;
-webkit-box-shadow: 0 1px 3px #eee;
-moz-border-radius: 3px;
-moz-box-shadow: 0 1px 3px #eee;
border-radius: 3px;
}
#mocha .test h2 {
position: relative;
}
#mocha .test a.replay {
position: absolute;
top: 3px;
right: 0;
text-decoration: none;
vertical-align: middle;
display: block;
width: 15px;
height: 15px;
line-height: 15px;
text-align: center;
background: #eee;
font-size: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
-webkit-transition: opacity 200ms;
-moz-transition: opacity 200ms;
transition: opacity 200ms;
opacity: 0.3;
color: #888;
}
#mocha .test:hover a.replay {
opacity: 1;
}
#mocha-report.pass .test.fail {
display: none;
}
#mocha-report.fail .test.pass {
display: none;
}
#mocha-report.pending .test.pass,
#mocha-report.pending .test.fail {
display: none;
}
#mocha-report.pending .test.pass.pending {
display: block;
}
#mocha-error {
color: #c00;
font-size: 1.5em;
font-weight: 100;
letter-spacing: 1px;
}
#mocha-stats {
position: fixed;
top: 15px;
right: 10px;
font-size: 12px;
margin: 0;
color: #888;
z-index: 1;
}
#mocha-stats .progress {
float: right;
padding-top: 0;
}
#mocha-stats em {
color: black;
}
#mocha-stats a {
text-decoration: none;
color: inherit;
}
#mocha-stats a:hover {
border-bottom: 1px solid #eee;
}
#mocha-stats li {
display: inline-block;
margin: 0 5px;
list-style: none;
padding-top: 11px;
}
#mocha-stats canvas {
width: 40px;
height: 40px;
}
#mocha code .comment { color: #ddd; }
#mocha code .init { color: #2f6fad; }
#mocha code .string { color: #5890ad; }
#mocha code .keyword { color: #8a6343; }
#mocha code .number { color: #2f6fad; }
@media screen and (max-device-width: 480px) {
#mocha {
margin: 60px 0px;
}
#mocha #stats {
position: absolute;
}
}

View file

@ -0,0 +1,65 @@
/* Pretty printing styles. Used with prettify.js. */
.str { color: #85C5DC; }
.kwd { color: #EDF0D1; }
.com { color: #878989; }
.typ { color: #F5896F; }
.lit { color: #FFB17A; }
.pun { color: #FFFFFF; }
.pln { color: #FFFFFF; }
.tag { color: #F5896F; }
.atn { color: #F5896F; }
.atv { color: #85C5DC; }
.dec { color: #878989; }
pre.prettyprint {
background-color:#302F2D;
border: none;
line-height: normal;
font-size: 100%;
border-radius: 6px 6px 6px 6px;
font-family: consolas,​'andale mono',​'courier new',​monospace;
padding-top: 12px;
overflow: hidden;
}
code{
font-size: 13px;
line-height: normal;
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 { list-style-type: none }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 { background: #eee }
@media print {
.str { color: #060; }
.kwd { color: #006; font-weight: bold; }
.com { color: #600; font-style: italic; }
.typ { color: #404; font-weight: bold; }
.lit { color: #044; }
.pun { color: #440; }
.pln { color: #000; }
.tag { color: #006; font-weight: bold; }
.atn { color: #404; }
.atv { color: #060; }
}
/* correct additional line return at top of html diaplay*/
code>:first-child{
display: none;
}

View file

@ -0,0 +1,367 @@
/*
All content and code is released into the public domain
http://en.wikipedia.org/wiki/public_domain
Contributors
Glenn Jones - http://glennjones.net/
*/
@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700);
body {
padding:50px;
font:1em "Helvetica Neue", Helvetica, Arial, sans-serif;
color:#333;
font-weight:300;
border-top: 5px solid #302F2D;
margin: 0;
}
h1, h2, h3, h4, h5, h6 {
color:#222;
font-weight: normal;
}
p, ul, ol, table, pre, dl {
margin:0 0 20px;
}
h1, h2, h3 {
margin-top: 50px;
margin-bottom: 10px;
font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
h1 {
font-size: 2em;
}
h2, h3 {
font-size: 1.5em;
}
/* the first h1 in a page */
h1:first-of-type{
margin-top: 0;
font-weight: bold;
}
a {
color: #39c;
font-weight: 300;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a[name]{
color: #333;
}
a[name]:hover {
text-decoration: none;
}
blockquote {
border-left: 1px solid #e5e5e5;
margin: 0;
padding: 0 0 0 20px;
font-style: italic;
}
code, pre {
font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;
font-size: 12px;
margin: 0;
}
pre {
padding: 8px 15px;
border-radius: 5px;
border: 1px solid #e5e5e5;
overflow-x: auto;
color: #fff;
margin: 0;
}
table {
border-collapse: collapse;
}
th, td {
text-align: left;
padding: 2px 10px;
border-bottom: 1px solid #e5e5e5;
font-weight: 300;
}
th{
background-color: #333;
color:#fff;
}
td a{
font-weight: 300;
}
dt {
color:#444;
font-weight:700;
}
img {
max-width:100%;
}
li{
padding: 0.25em 0 0.25em 0;
}
button, input[type="submit"], input[type="button"], .button {
display: inline-block;
padding-top: 0.4em;
padding-right: 1em;
padding-left: 1em;
padding-bottom: 0.5em;
margin-bottom: 0;
font-weight: 200;
font-size: 1rem;
text-align: center;
white-space: nowrap;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
border-radius: 3px;
background-color: #33a0e8;
color: #fff;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
select {
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
option {
padding: 2em;
}
footer{
margin-top: 8em;
text-align: center;
}
/* The Magnificent Clearfix: Updated to prevent margin-collapsing on child elements.
j.mp/bestclearfix */
.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; }
.clearfix:after { clear: both; }
/* Fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */
.clearfix { zoom: 1; }
.test-counts{
font-weight: 700;
margin-bottom: 4em;
}
.test-detail{
display:none;
}
.all-test-list, .test-result-list{
list-style: none;
margin: 0;
padding: 0;
display: block;
float: left;
}
.all-test-list li .test-result-list li{
padding: 0.2em 0 0.2em 0;
white-space: nowrap;
cursor: pointer;
}
.all-test-list li::hover, .test-result-list li::hover{
text-decoration: underline;
}
.all-test-list li.test-error a, .test-result-list li.test-error a{
color: red;
text-decoration: underline;
}
.flexbox-container {
display: -ms-flex;
display: -webkit-flex;
display: flex;
}
.flexbox-container > section {
margin-bottom: 3em;
}
.flexbox-container > section:first-child {
width: 20%;
margin-right: 20px;
}
.flexbox-container > section:nth-child(2) {
padding-left: 1em;
width: 80%;
}
@media (max-width: 1400px) {
.flexbox-container > section:first-child {
width: 25%;
}
.flexbox-container > section:nth-child(2) {
width: 75%;
}
}
@media (max-width: 1200px) {
.flexbox-container > section:first-child {
width: 30%;
}
.flexbox-container > section:nth-child(2) {
width: 70%;
}
}
@media (max-width: 1000px) {
.flexbox-container > section:first-child {
width: 35%;
}
.flexbox-container > section:nth-child(2) {
width: 65%;
}
}
#test-status {
margin-top: 0;
}
.test-passed{
border-left: 10px solid green;
}
.test-failed{
border-left: 10px solid red;
}
.differences-description{
margin-top: 2em;
}
.differences-description li{
padding: 0;
}
.failed{
color: red;
}
#test-list-by-version section{
width: 30%;
margin-right: 20px;
}
.test-container{
padding-left: 1em;
}
#textcontent-test textarea{
font-size: 1em;
min-height: 6em;
min-width: 40em;
padding: 0.5em;
}
#textcontent-test input{
font-size: 1em;
}
/* Tool interface */
.tool-interface input[type="text"], input[type="url"] {
width: 20em;
padding: 0.4em;
border: 1px solid #999;
border-radius: 0.4em;
color: #333;
font-size: 1em
}
.tool-interface label {
display: inline-block;
width: 5em;
}
.tool-interface select {
padding: 0.2em;
font-family: open_sansregular, calibri, arial, helvetica, 'lucida grande', 'lucida sans unicode', verdana, sans-serif;
}
.tool-interface option{
padding: 0.2em;
}
.tool-interface textarea{
width: 100%;
height: 16em;
border: 1px solid #999;
border-radius: 0.4em;
font-size: 1em;
font-family: open_sansregular, calibri, arial, helvetica, 'lucida grande', 'lucida sans unicode', verdana, sans-serif;
}
.tool-interface .button{
margin-left: 5.2em;
}
.tool-interface label.checkbox-label{
width: auto;
}
.tool-interface .checkbox{
margin-left: 5.2em;
}
select.indent {
margin-left: 5em;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -0,0 +1,99 @@
// Based on https://gist.github.com/1129031 By Eli Grey, http://eligrey.com - Public domain.
// DO NOT use https://developer.mozilla.org/en-US/docs/Web/API/DOMParser example polyfill
// as it does not work with earliar version of chrome
(function(DOMParser) {
"use strict";
var DOMParser_proto;
var real_parseFromString;
var textHTML; // Flag for text/html support
var textXML; // Flag for text/xml support
var htmlElInnerHTML; // Flag for support for setting html element's innerHTML
// Stop here if DOMParser not defined
if (!DOMParser) return;
// Firefox, Opera and IE throw errors on unsupported types
try {
// WebKit returns null on unsupported types
textHTML = !!(new DOMParser).parseFromString('', 'text/html');
} catch (er) {
textHTML = false;
}
// If text/html supported, don't need to do anything.
if (textHTML) return;
// Next try setting innerHTML of a created document
// IE 9 and lower will throw an error (can't set innerHTML of its HTML element)
try {
var doc = document.implementation.createHTMLDocument('');
doc.documentElement.innerHTML = '<title></title><div></div>';
htmlElInnerHTML = true;
} catch (er) {
htmlElInnerHTML = false;
}
// If if that failed, try text/xml
if (!htmlElInnerHTML) {
try {
textXML = !!(new DOMParser).parseFromString('', 'text/xml');
} catch (er) {
textHTML = false;
}
}
// Mess with DOMParser.prototype (less than optimal...) if one of the above worked
// Assume can write to the prototype, if not, make this a stand alone function
if (DOMParser.prototype && (htmlElInnerHTML || textXML)) {
DOMParser_proto = DOMParser.prototype;
real_parseFromString = DOMParser_proto.parseFromString;
DOMParser_proto.parseFromString = function (markup, type) {
// Only do this if type is text/html
if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
var doc, doc_el, first_el;
// Use innerHTML if supported
if (htmlElInnerHTML) {
doc = document.implementation.createHTMLDocument("");
doc_el = doc.documentElement;
doc_el.innerHTML = markup;
first_el = doc_el.firstElementChild;
// Otherwise use XML method
} else if (textXML) {
// Make sure markup is wrapped in HTML tags
// Should probably allow for a DOCTYPE
if (!(/^<html.*html>$/i.test(markup))) {
markup = '<html>' + markup + '<\/html>';
}
doc = (new DOMParser).parseFromString(markup, 'text/xml');
doc_el = doc.documentElement;
first_el = doc_el.firstElementChild;
}
// Is this an entire document or a fragment?
if (doc_el.childElementCount == 1 && first_el.localName.toLowerCase() == 'html') {
doc.replaceChild(first_el, doc_el);
}
return doc;
// If not text/html, send as-is to host method
} else {
return real_parseFromString.apply(this, arguments);
}
};
}
}(DOMParser));

View file

@ -0,0 +1,518 @@
/*
JS Beautifier
---------------
Written by Einars "elfz" Lielmanis, <elfz@laacz.lv>
http://elfz.laacz.lv/beautify/
Originally converted to javascript by Vital, <vital76@gmail.com>
http://my.opera.com/Vital/blog/2007/11/21/javascript-beautify-on-javascript-translated
You are free to use this in any way you want, in case you find this useful or working for you.
Usage:
js_beautify(js_source_text);
*/
function js_beautify(js_source_text, indent_size, indent_character)
{
var input, output, token_text, last_type, current_mode, modes, indent_level, indent_string;
var whitespace, wordchar, punct;
indent_character = indent_character || ' ';
indent_size = indent_size || 4;
indent_string = '';
while (indent_size--) indent_string += indent_character;
input = js_source_text;
last_word = ''; // last 'TK_WORD' passed
last_type = 'TK_START_EXPR'; // last token type
last_text = ''; // last token text
output = '';
whitespace = "\n\r\t ".split('');
wordchar = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$'.split('');
punct = '+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |='.split(' ');
// words which should always start on new line.
line_starters = 'continue,try,throw,return,var,if,switch,case,default,for,while,break,function'.split(',');
// states showing if we are currently in expression (i.e. "if" case) - 'EXPRESSION', or in usual block (like, procedure), 'BLOCK'.
// some formatting depends on that.
current_mode = 'BLOCK';
modes = [current_mode];
indent_level = 0;
parser_pos = 0; // parser position
in_case = false; // flag for parser that case/default has been processed, and next colon needs special attention
while (true) {
var t = get_next_token(parser_pos);
token_text = t[0];
token_type = t[1];
if (token_type == 'TK_EOF') {
break;
}
switch (token_type) {
case 'TK_START_EXPR':
set_mode('EXPRESSION');
if (last_type == 'TK_END_EXPR' || last_type == 'TK_START_EXPR') {
// do nothing on (( and )( and ][ and ]( ..
} else if (last_type != 'TK_WORD' && last_type != 'TK_OPERATOR') {
print_space();
} else if (in_array(last_word, line_starters) && last_word != 'function') {
print_space();
}
print_token();
break;
case 'TK_END_EXPR':
print_token();
restore_mode();
break;
case 'TK_START_BLOCK':
set_mode('BLOCK');
if (last_type != 'TK_OPERATOR' && last_type != 'TK_START_EXPR') {
if (last_type == 'TK_START_BLOCK') {
print_newline();
} else {
print_space();
}
}
print_token();
indent();
break;
case 'TK_END_BLOCK':
if (last_type == 'TK_END_EXPR') {
unindent();
print_newline();
} else if (last_type == 'TK_END_BLOCK') {
unindent();
print_newline();
} else if (last_type == 'TK_START_BLOCK') {
// nothing
unindent();
} else {
unindent();
print_newline();
}
print_token();
restore_mode();
break;
case 'TK_WORD':
if (token_text == 'case' || token_text == 'default') {
if (last_text == ':') {
// switch cases following one another
remove_indent();
} else {
// case statement starts in the same line where switch
unindent();
print_newline();
indent();
}
print_token();
in_case = true;
break;
}
prefix = 'NONE';
if (last_type == 'TK_END_BLOCK') {
if (!in_array(token_text.toLowerCase(), ['else', 'catch', 'finally'])) {
prefix = 'NEWLINE';
} else {
prefix = 'SPACE';
print_space();
}
} else if (last_type == 'TK_END_COMMAND' && current_mode == 'BLOCK') {
prefix = 'NEWLINE';
} else if (last_type == 'TK_END_COMMAND' && current_mode == 'EXPRESSION') {
prefix = 'SPACE';
} else if (last_type == 'TK_WORD') {
prefix = 'SPACE';
} else if (last_type == 'TK_START_BLOCK') {
prefix = 'NEWLINE';
} else if (last_type == 'TK_END_EXPR') {
print_space();
prefix = 'NEWLINE';
}
if (in_array(token_text, line_starters) || prefix == 'NEWLINE') {
if (last_text == 'else') {
// no need to force newline on else break
print_space();
} else if ((last_type == 'TK_START_EXPR' || last_text == '=') && token_text == 'function') {
// no need to force newline on 'function': (function
// DONOTHING
} else if (last_type == 'TK_WORD' && (last_text == 'return' || last_text == 'throw')) {
// no newline between 'return nnn'
print_space();
} else
if (last_type != 'TK_END_EXPR') {
if ((last_type != 'TK_START_EXPR' || token_text != 'var') && last_text != ':') {
// no need to force newline on 'var': for (var x = 0...)
if (token_text == 'if' && last_type == 'TK_WORD' && last_word == 'else') {
// no newline for } else if {
print_space();
} else {
print_newline();
}
}
}
} else if (prefix == 'SPACE') {
print_space();
}
print_token();
last_word = token_text;
break;
case 'TK_END_COMMAND':
print_token();
break;
case 'TK_STRING':
if (last_type == 'TK_START_BLOCK' || last_type == 'TK_END_BLOCK') {
print_newline();
} else if (last_type == 'TK_WORD') {
print_space();
}
print_token();
break;
case 'TK_OPERATOR':
start_delim = true;
end_delim = true;
if (token_text == ':' && in_case) {
print_token(); // colon really asks for separate treatment
print_newline();
break;
}
in_case = false;
if (token_text == ',') {
if (last_type == 'TK_END_BLOCK') {
print_token();
print_newline();
} else {
if (current_mode == 'BLOCK') {
print_token();
print_newline();
} else {
print_token();
print_space();
}
}
break;
} else if (token_text == '--' || token_text == '++') { // unary operators special case
if (last_text == ';') {
// space for (;; ++i)
start_delim = true;
end_delim = false;
} else {
start_delim = false;
end_delim = false;
}
} else if (token_text == '!' && last_type == 'TK_START_EXPR') {
// special case handling: if (!a)
start_delim = false;
end_delim = false;
} else if (last_type == 'TK_OPERATOR') {
start_delim = false;
end_delim = false;
} else if (last_type == 'TK_END_EXPR') {
start_delim = true;
end_delim = true;
} else if (token_text == '.') {
// decimal digits or object.property
start_delim = false;
end_delim = false;
} else if (token_text == ':') {
// zz: xx
// can't differentiate ternary op, so for now it's a ? b: c; without space before colon
start_delim = false;
}
if (start_delim) {
print_space();
}
print_token();
if (end_delim) {
print_space();
}
break;
case 'TK_BLOCK_COMMENT':
print_newline();
print_token();
print_newline();
break;
case 'TK_COMMENT':
// print_newline();
print_space();
print_token();
print_newline();
break;
case 'TK_UNKNOWN':
print_token();
break;
}
if (token_type != 'TK_COMMENT') {
last_type = token_type;
last_text = token_text;
}
}
return output;
function print_newline(ignore_repeated)
{
ignore_repeated = typeof ignore_repeated == 'undefined' ? true: ignore_repeated;
output = output.replace(/[ \t]+$/, ''); // remove possible indent
if (output == '') return; // no newline on start of file
if (output.substr(output.length - 1) != "\n" || !ignore_repeated) {
output += "\n";
}
for (var i = 0; i < indent_level; i++) {
output += indent_string;
}
}
function print_space()
{
if (output && output.substr(output.length - 1) != ' ' && output.substr(output.length - 1) != '\n') { // prevent occassional duplicate space
output += ' ';
}
}
function print_token()
{
output += token_text;
}
function indent()
{
indent_level++;
}
function unindent()
{
if (indent_level) {
indent_level--;
}
}
function remove_indent()
{
if (output.substr(output.length - indent_string.length) == indent_string) {
output = output.substr(0, output.length - indent_string.length);
}
}
function set_mode(mode)
{
modes.push(current_mode);
current_mode = mode;
}
function restore_mode()
{
current_mode = modes.pop();
}
function get_next_token()
{
var n_newlines = 0;
var c = '';
do {
if (parser_pos >= input.length) {
return ['', 'TK_EOF'];
}
c = input.charAt(parser_pos);
parser_pos += 1;
if (c == "\n") {
n_newlines += 1;
}
}
while (in_array(c, whitespace));
if (n_newlines > 1) {
for (var i = 0; i < n_newlines; i++) {
print_newline(i == 0);
}
}
var wanted_newline = n_newlines == 1;
if (in_array(c, wordchar)) {
if (parser_pos < input.length) {
while (in_array(input.charAt(parser_pos), wordchar)) {
c += input.charAt(parser_pos);
parser_pos += 1;
if (parser_pos == input.length) break;
}
}
// small and surprisingly unugly hack for 1E-10 representation
if (parser_pos != input.length && c.match(/^[0-9]+[Ee]$/) && input.charAt(parser_pos) == '-') {
parser_pos += 1;
var t = get_next_token(parser_pos);
next_word = t[0];
next_type = t[1];
c += '-' + next_word;
return [c, 'TK_WORD'];
}
if (c == 'in') { // hack for 'in' operator
return [c, 'TK_OPERATOR'];
}
return [c, 'TK_WORD'];
}
if (c == '(' || c == '[') {
return [c, 'TK_START_EXPR'];
}
if (c == ')' || c == ']') {
return [c, 'TK_END_EXPR'];
}
if (c == '{') {
return [c, 'TK_START_BLOCK'];
}
if (c == '}') {
return [c, 'TK_END_BLOCK'];
}
if (c == ';') {
return [c, 'TK_END_COMMAND'];
}
if (c == '/') {
// peek for comment /* ... */
if (input.charAt(parser_pos) == '*') {
comment = '';
parser_pos += 1;
if (parser_pos < input.length) {
while (! (input.charAt(parser_pos) == '*' && input.charAt(parser_pos + 1) && input.charAt(parser_pos + 1) == '/') && parser_pos < input.length) {
comment += input.charAt(parser_pos);
parser_pos += 1;
if (parser_pos >= input.length) break;
}
}
parser_pos += 2;
return ['/*' + comment + '*/', 'TK_BLOCK_COMMENT'];
}
// peek for comment // ...
if (input.charAt(parser_pos) == '/') {
comment = c;
while (input.charAt(parser_pos) != "\x0d" && input.charAt(parser_pos) != "\x0a") {
comment += input.charAt(parser_pos);
parser_pos += 1;
if (parser_pos >= input.length) break;
}
parser_pos += 1;
if (wanted_newline) {
print_newline();
}
return [comment, 'TK_COMMENT'];
}
}
if (c == "'" || // string
c == '"' || // string
(c == '/' &&
((last_type == 'TK_WORD' && last_text == 'return') || (last_type == 'TK_START_EXPR' || last_type == 'TK_END_BLOCK' || last_type == 'TK_OPERATOR' || last_type == 'TK_EOF' || last_type == 'TK_END_COMMAND')))) { // regexp
sep = c;
c = '';
esc = false;
if (parser_pos < input.length) {
while (esc || input.charAt(parser_pos) != sep) {
c += input.charAt(parser_pos);
if (!esc) {
esc = input.charAt(parser_pos) == '\\';
} else {
esc = false;
}
parser_pos += 1;
if (parser_pos >= input.length) break;
}
}
parser_pos += 1;
if (last_type == 'TK_END_COMMAND') {
print_newline();
}
return [sep + c + sep, 'TK_STRING'];
}
if (in_array(c, punct)) {
while (parser_pos < input.length && in_array(c + input.charAt(parser_pos), punct)) {
c += input.charAt(parser_pos);
parser_pos += 1;
if (parser_pos >= input.length) break;
}
return [c, 'TK_OPERATOR'];
}
return [c, 'TK_UNKNOWN'];
}
function in_array(what, arr)
{
for (var i = 0; i < arr.length; i++)
{
if (arr[i] == what) return true;
}
return false;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,62 @@
/*!
parse
Used by http://localhost:3000/
Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
*/
window.onload = function() {
var form;
form= document.getElementById('mf-form');
form.onsubmit = function(e){
e.preventDefault();
var html,
doc,
node,
options,
mfJSON,
parserJSONElt;
// get data from html
html = document.getElementById('html').value;
parserJSONElt = document.querySelector('#parser-json pre code')
// createHTMLDocument is not well support below ie9
doc = document.implementation.createHTMLDocument("New Document");
node = document.createElement('div');
node.innerHTML = html;
doc.body.appendChild(node);
options ={
'node': node
};
// parse direct into Modules to help debugging
if(window.Modules){
var parser = new Modules.Parser();
mfJSON = parser.count(options);
}else if(window.Microformats){
mfJSON = Microformats.count(options);
}
// format output
parserJSONElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(mfJSON) ) );
//prettyPrint();
}
function htmlEscape(str) {
return String(str)
.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,5 @@
/*!
* deep-diff.
* Licensed under the MIT License.
*/
(function(e,t){"use strict";if(typeof define==="function"&&define.amd){define([],t)}else if(typeof exports==="object"){module.exports=t()}else{e.DeepDiff=t()}})(this,function(e){"use strict";var t,n,r=[];if(typeof global==="object"&&global){t=global}else if(typeof window!=="undefined"){t=window}else{t={}}n=t.DeepDiff;if(n){r.push(function(){if("undefined"!==typeof n&&t.DeepDiff===p){t.DeepDiff=n;n=e}})}function a(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}function i(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:true});if(t&&t.length){Object.defineProperty(this,"path",{value:t,enumerable:true})}}function f(e,t,n){f.super_.call(this,"E",e);Object.defineProperty(this,"lhs",{value:t,enumerable:true});Object.defineProperty(this,"rhs",{value:n,enumerable:true})}a(f,i);function u(e,t){u.super_.call(this,"N",e);Object.defineProperty(this,"rhs",{value:t,enumerable:true})}a(u,i);function l(e,t){l.super_.call(this,"D",e);Object.defineProperty(this,"lhs",{value:t,enumerable:true})}a(l,i);function s(e,t,n){s.super_.call(this,"A",e);Object.defineProperty(this,"index",{value:t,enumerable:true});Object.defineProperty(this,"item",{value:n,enumerable:true})}a(s,i);function h(e,t,n){var r=e.slice((n||t)+1||e.length);e.length=t<0?e.length+t:t;e.push.apply(e,r);return e}function c(e){var t=typeof e;if(t!=="object"){return t}if(e===Math){return"math"}else if(e===null){return"null"}else if(Array.isArray(e)){return"array"}else if(e instanceof Date){return"date"}else if(/^\/.*\//.test(e.toString())){return"regexp"}return"object"}function o(t,n,r,a,i,p,b){i=i||[];var d=i.slice(0);if(typeof p!=="undefined"){if(a&&a(d,p,{lhs:t,rhs:n})){return}d.push(p)}var v=typeof t;var y=typeof n;if(v==="undefined"){if(y!=="undefined"){r(new u(d,n))}}else if(y==="undefined"){r(new l(d,t))}else if(c(t)!==c(n)){r(new f(d,t,n))}else if(t instanceof Date&&n instanceof Date&&t-n!==0){r(new f(d,t,n))}else if(v==="object"&&t!==null&&n!==null){b=b||[];if(b.indexOf(t)<0){b.push(t);if(Array.isArray(t)){var k,m=t.length;for(k=0;k<t.length;k++){if(k>=n.length){r(new s(d,k,new l(e,t[k])))}else{o(t[k],n[k],r,a,d,k,b)}}while(k<n.length){r(new s(d,k,new u(e,n[k++])))}}else{var g=Object.keys(t);var w=Object.keys(n);g.forEach(function(i,f){var u=w.indexOf(i);if(u>=0){o(t[i],n[i],r,a,d,i,b);w=h(w,u)}else{o(t[i],e,r,a,d,i,b)}});w.forEach(function(t){o(e,n[t],r,a,d,t,b)})}b.length=b.length-1}}else if(t!==n){if(!(v==="number"&&isNaN(t)&&isNaN(n))){r(new f(d,t,n))}}}function p(t,n,r,a){a=a||[];o(t,n,function(e){if(e){a.push(e)}},r);return a.length?a:e}function b(e,t,n){if(n.path&&n.path.length){var r=e[t],a,i=n.path.length-1;for(a=0;a<i;a++){r=r[n.path[a]]}switch(n.kind){case"A":b(r[n.path[a]],n.index,n.item);break;case"D":delete r[n.path[a]];break;case"E":case"N":r[n.path[a]]=n.rhs;break}}else{switch(n.kind){case"A":b(e[t],n.index,n.item);break;case"D":e=h(e,t);break;case"E":case"N":e[t]=n.rhs;break}}return e}function d(e,t,n){if(e&&t&&n&&n.kind){var r=e,a=-1,i=n.path.length-1;while(++a<i){if(typeof r[n.path[a]]==="undefined"){r[n.path[a]]=typeof n.path[a]==="number"?[]:{}}r=r[n.path[a]]}switch(n.kind){case"A":b(r[n.path[a]],n.index,n.item);break;case"D":delete r[n.path[a]];break;case"E":case"N":r[n.path[a]]=n.rhs;break}}}function v(e,t,n){if(n.path&&n.path.length){var r=e[t],a,i=n.path.length-1;for(a=0;a<i;a++){r=r[n.path[a]]}switch(n.kind){case"A":v(r[n.path[a]],n.index,n.item);break;case"D":r[n.path[a]]=n.lhs;break;case"E":r[n.path[a]]=n.lhs;break;case"N":delete r[n.path[a]];break}}else{switch(n.kind){case"A":v(e[t],n.index,n.item);break;case"D":e[t]=n.lhs;break;case"E":e[t]=n.lhs;break;case"N":e=h(e,t);break}}return e}function y(e,t,n){if(e&&t&&n&&n.kind){var r=e,a,i;i=n.path.length-1;for(a=0;a<i;a++){if(typeof r[n.path[a]]==="undefined"){r[n.path[a]]={}}r=r[n.path[a]]}switch(n.kind){case"A":v(r[n.path[a]],n.index,n.item);break;case"D":r[n.path[a]]=n.lhs;break;case"E":r[n.path[a]]=n.lhs;break;case"N":delete r[n.path[a]];break}}}function k(e,t,n){if(e&&t){var r=function(r){if(!n||n(e,t,r)){d(e,t,r)}};o(e,t,r)}}Object.defineProperties(p,{diff:{value:p,enumerable:true},observableDiff:{value:o,enumerable:true},applyDiff:{value:k,enumerable:true},applyChange:{value:d,enumerable:true},revertChange:{value:y,enumerable:true},isConflict:{value:function(){return"undefined"!==typeof n},enumerable:true},noConflict:{value:function(){if(r){r.forEach(function(e){e()});r=null}return p},enumerable:true}});return p});

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,133 @@
/*!
parse
Used by http://localhost:3000/
Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
*/
window.onload = function() {
var form;
form= document.getElementById('mf-form');
form.onsubmit = function(e){
e = (e)? e : window.event;
if (e.preventDefault) {
e.preventDefault();
} else {
event.returnValue = false;
}
var html,
baseUrl,
filter,
collapsewhitespace,
overlappingversions,
impliedPropertiesByVersion,
dateformatElt,
dateformat,
doc,
node,
options,
mfJSON,
parserJSONElt;
// get data from html
html = document.getElementById('html').value;
baseUrl = document.getElementById('baseurl').value;
filters = document.getElementById('filters').value;
collapsewhitespace = document.getElementById('collapsewhitespace').checked;
//overlappingversions = document.getElementById('overlappingversions').checked;
//impliedPropertiesByVersion = document.getElementById('impliedPropertiesByVersion').checked;
parseLatLonGeo = document.getElementById('parseLatLonGeo').checked;
dateformatElt = document.getElementById("dateformat");
dateformat = dateformatElt.options[dateformatElt.selectedIndex].value;
parserJSONElt = document.querySelector('#parser-json pre code')
var dom = new DOMParser();
doc = dom.parseFromString( html, 'text/html' );
options ={
'document': doc,
'node': doc,
'dateFormat': dateformat,
'parseLatLonGeo': false
};
if(baseUrl.trim() !== ''){
options.baseUrl = baseUrl;
}
if(filters.trim() !== ''){
if(filters.indexOf(',') > -1){
options.filters = trimArrayItems(filters.split(','));
}else{
options.filters = [filters.trim()];
}
}
if(collapsewhitespace === true){
options.textFormat = 'normalised';
}
/*
if(overlappingversions === true){
options.overlappingVersions = false;
}
if(impliedPropertiesByVersion === true){
options.impliedPropertiesByVersion = true;
}
*/
if(parseLatLonGeo === true){
options.parseLatLonGeo = true
}
if(options.baseUrl){
html = '<base href="' + baseUrl+ '">' + html;
}
// parse direct into Modules to help debugging
if(window.Modules){
var parser = new Modules.Parser();
mfJSON = parser.get(options);
}else if(window.Microformats){
mfJSON = Microformats.get(options);
}
// format output
parserJSONElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(mfJSON) ) );
//prettyPrint();
}
};
function htmlEscape(str) {
return String(str)
.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
function trimArrayItems( arr ){
return arr.map(function(item){
return item.trim();
})
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,179 @@
/*!
testrunner
Used by http://localhost:3000/testrunner.html
Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
*/
var options = {
'baseUrl': 'http://example.com',
'dateFormat': 'html5',
'parseLatLonGeo': false
};
window.onload = function() {
var test = testData.data[0],
versionElt = document.querySelector('#version');
versionElt.innerHTML = 'v' + testData.version;
buildTest( test );
buildList( testData );
}
function displayTest(e){
var label = e.target.innerHTML;
var i = testData.data.length;
while (i--) {
if(testData.data[i].name === label){
buildTest( testData.data[i] );
break;
}
}
}
function buildTest( test ){
var testDetailElt = document.querySelector('.test-detail'),
nameElt = document.querySelector('#test-name'),
htmlElt = document.querySelector('#test-html pre code'),
jsonElt = document.querySelector('#test-json pre code'),
parserElt = document.querySelector('#parser-json pre code'),
diffElt = document.querySelector('#test-diff pre code');
nameElt.innerHTML = test.name;
htmlElt.innerHTML = htmlEscape( test.html );
jsonElt.innerHTML = htmlEscape( test.json );
var dom = new DOMParser();
doc = dom.parseFromString( test.html, 'text/html' );
options.node = doc;
var mfJSON = Microformats.get( options );
parserElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(mfJSON) ) );
// diff json
var diff = DeepDiff(JSON.parse(test.json), mfJSON);
if(diff !== undefined){
diffElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(diff) ) );
}else{
diffElt.innerHTML = '';
}
console.log(diff)
if(diff !== undefined){
addClass(nameElt, 'failed');
addClass(testDetailElt, 'test-failed');
removeClass(testDetailElt, 'test-passed');
}else{
removeClass(nameElt, 'failed');
removeClass(testDetailElt, 'test-failed');
addClass(testDetailElt, 'test-passed');
}
testDetailElt.style.display = 'block';
//prettyPrint();
}
function passTest( test ){
var dom = new DOMParser(),
doc = dom.parseFromString( test.html, 'text/html' );
options.node = doc;
var mfJSON = Microformats.get( options );
// diff json
var diff = DeepDiff(JSON.parse(test.json), mfJSON);
return (diff === undefined);
}
function buildList( tests ){
var total = tests.data.length,
passed = 0,
testResultListElt = document.querySelector('.test-result-list');
tests.data.forEach(function(item){
var li = document.createElement('li');
li.innerHTML = item.name;
testResultListElt.appendChild(li);
if( passTest( item ) === false ){
//li.classList.add('failed')
addClass(li, 'failed');
}else{
passed ++;
}
li.addEventListener('click', function(e){
e.preventDefault();
displayTest(e);
});
});
updateCounts( {
'total': total,
'passed': passed,
'percentPassed': ((100/total) * passed).toFixed(1)
} )
}
function updateCounts( data ){
var testCountsElt = document.querySelector('.test-counts');
testCountsElt.innerHTML = 'Passed: ' + data.passed + '/' + data.total + ' - ' + data.percentPassed + '% of microformats tests';
}
function htmlEscape(str) {
return String(str)
.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
// I needed the opposite function today, so adding here too:
function htmlUnescape(value){
return String(value)
.replace(/&quot;/g, '"')
.replace(/&#39;/g, "'")
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&amp;/g, '&');
}
// Does the node have a class
function hasClass(node, className) {
if (node.className) {
return node.className.match(
new RegExp('(\\s|^)' + className + '(\\s|$)'));
} else {
return false;
}
}
// Add a class to an node
function addClass(node, className) {
if (!hasClass(node, className)) {
node.className += " " + className;
}
}
// Removes a class from an node
function removeClass(node, className) {
if (hasClass(node, className)) {
var reg = new RegExp('(\\s|^)' + className + '(\\s|$)');
node.className = node.className.replace(reg, ' ');
}
}

View file

@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Parse Microformats</title>
<meta name="description" content="microformat-shiv - A light-weight cross browser javascript microformats 2 parser" />
<link rel="stylesheet" href="css/testrunner.css">
<link rel="stylesheet" href="css/prettify.css">
<!-- Loads full umd version -->
<script src="../../thirdparty/es5-shim.min.js"></script>
<script src="../../microformat-shiv.js"></script>
<script src="javascript/beautify.js"></script>
<script src="javascript/prettify.js"></script>
<script src="javascript/DOMParser.js"></script>
<script src="javascript/parse.js"></script>
</head>
<body>
<p>microformat-shiv</p>
<h1>Parse Microformats - UMD</h1>
<p>Type or copy and paste the HTML you want to parse into the box below.</p>
<form id="mf-form" class="tool-interface" method="get" action="">
<p>
<label for="html">HTML</label>
<textarea id="html" name="html">&lt;a class="h-card" href="http://glennjones.net"&gt;
&lt;span class="p-given-name"&gt;Glenn&lt;/span&gt;
&lt;span class="p-family-name"&gt;Jones&lt;/span&gt;
&lt;/a&gt;
</textarea>
</p>
<p>
<label for="baseurl">BaseURL</label>
<input id="baseurl" name="baseurl" placeholder="Optional URL to help resolve relative links" value="http://example.com" type="text">
</p>
<p>
<label for="filters">Filters</label>
<input id="filters" name="filters" placeholder="Optional comma separted list of formats to filter by" type="text">
</p>
<p class="checkbox">
<input id="collapsewhitespace" name="collapsewhitespace" id="textformat2" type="checkbox">
<label class="checkbox-label" for="textformat2"><strong>Experimental</strong> ‐ Text white-space collapsing</label>
</p>
<p class="checkbox">
<input id="parseLatLonGeo" name="parseLatLonGeo" id="parseLatLonGeo" type="checkbox">
<label class="checkbox-label" for="parseLatLonGeo"><strong>Experimental</strong> ‐ Parse geo data writen as latlon i.e. 30.267991;-97.739568</label>
</p>
<p>
<select id="dateformat" class="indent" name="dateformat" id="dateformat2">
<option value="auto" selected="selected">auto</option>
<option value="W3C">w3c</option>
<option value="HTML5">html5</option>
<option value="RFC3339">rfc3339</option>
</select>
<label class="checkbox-label" for="dateformat2"><strong>Experimental</strong> ‐ ISO date profile</label>
</p>
<input class="button" value="Parse" type="submit">
</form>
<h1>Parser JSON</h1>
<div id="parser-json"><pre class="prettyprint"><code class="language-json"></code></pre></div>
</body>
</html>

View file

@ -0,0 +1,127 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Parse Microformats</title>
<meta name="description" content="microformat-shiv - A light-weight cross browser javascript microformats 2 parser" />
<link rel="stylesheet" href="css/testrunner.css">
<link rel="stylesheet" href="css/prettify.css">
<script src="..././thirdparty/es5-shim.min.js"></script>
<!-- loads Modules to help with debugging ie windows.Modules -->
<script src="../../lib/utilities.js"></script>
<script src="../../lib/domutils.js"></script>
<script src="../../lib/url.js"></script>
<script src="../../lib/html.js"></script>
<script src="../../lib/text.js"></script>
<script src="../../lib/dates.js"></script>
<script src="../../lib/isodate.js"></script>
<script src="../../lib/parser.js"></script>
<script src="../../lib/parser-implied.js"></script>
<script src="../../lib/parser-includes.js"></script>
<script src="../../lib/parser-rels.js"></script>
<script src="../../lib/maps/h-adr.js"></script>
<script src="../../lib/maps/h-card.js"></script>
<script src="../../lib/maps/h-entry.js"></script>
<script src="../../lib/maps/h-event.js"></script>
<script src="../../lib/maps/h-feed.js"></script>
<script src="../../lib/maps/h-geo.js"></script>
<script src="../../lib/maps/h-item.js"></script>
<script src="../../lib/maps/h-listing.js"></script>
<script src="../../lib/maps/h-news.js"></script>
<script src="../../lib/maps/h-org.js"></script>
<script src="../../lib/maps/h-product.js"></script>
<script src="../../lib/maps/h-recipe.js"></script>
<script src="../../lib/maps/h-resume.js"></script>
<script src="../../lib/maps/h-review-aggregate.js"></script>
<script src="../../lib/maps/h-review.js"></script>
<script src="../../lib/maps/rel.js"></script>
<script src="javascript/beautify.js"></script>
<script src="javascript/prettify.js"></script>
<script src="javascript/DOMParser.js"></script>
<script src="javascript/parse.js"></script>
</head>
<body>
<p>microformat-shiv</p>
<h1>Parse Microformats - Modules</h1>
<p>Type or copy and paste the HTML you want to parse into the box below.</p>
<form id="mf-form" class="tool-interface" method="get" action="">
<p>
<label for="html">HTML</label>
<textarea id="html" name="html">&lt;a class="h-card" href="glenn.html"&gt;
&lt;span class="p-given-name"&gt;Glenn&lt;/span&gt;
&lt;span class="p-family-name"&gt;Jones&lt;/span&gt;
&lt;/a&gt;
</textarea>
</p>
<p>
<label for="baseurl">BaseURL</label>
<input id="baseurl" name="baseurl" placeholder="Optional URL to help resolve relative links" value="http://example.com" type="text">
</p>
<p>
<label for="filters">Filters</label>
<input id="filters" name="filters" placeholder="Optional comma separted list of formats to filter by" type="text">
</p>
<p class="checkbox">
<input id="collapsewhitespace" name="collapsewhitespace" id="textformat2" type="checkbox">
<label class="checkbox-label" for="textformat2"><strong>Experimental</strong> ‐ Text white-space collapsing</label>
</p>
<!--
<p class="checkbox">
<input id="overlappingversions" name="overlappingversions" id="overlappingversions" type="checkbox">
<label class="checkbox-label" for="overlappingversions"><strong>Experimental</strong> ‐ Block overlapping properties from different microformat versions</label>
</p>
<p class="checkbox">
<input id="impliedPropertiesByVersion" name="impliedPropertiesByVersion" id="impliedPropertiesByVersion" type="checkbox">
<label class="checkbox-label" for="impliedPropertiesByVersion"><strong>Experimental</strong> ‐ Set implied properties by microformat version</label>
</p>
-->
<p class="checkbox">
<input id="parseLatLonGeo" name="parseLatLonGeo" id="parseLatLonGeo" type="checkbox">
<label class="checkbox-label" for="parseLatLonGeo"><strong>Experimental</strong> ‐ Parse geo data writen as latlon i.e. 30.267991;-97.739568</label>
</p>
<p>
<select id="dateformat" class="indent" name="dateformat" id="dateformat2">
<option value="auto" selected="selected">auto</option>
<option value="W3C">w3c</option>
<option value="HTML5">html5</option>
<option value="RFC3339">rfc3339</option>
</select>
<label class="checkbox-label" for="dateformat2"><strong>Experimental</strong> ‐ Fixed ISO date profile for output</label>
</p>
<input class="button" value="Parse" type="submit">
</form>
<h1>Parser JSON</h1>
<div id="parser-json"><pre class="prettyprint"><code class="language-json"></code></pre></div>
</body>
</html>

View file

@ -0,0 +1,69 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Microformats Test Suite</title>
<link rel="stylesheet" href="css/testrunner.css">
<link rel="stylesheet" href="css/prettify.css">
<script src="../../thirdparty/es5-shim.min.js"></script>
<script src="../../microformat-shiv.js"></script>
<script src="javascript/DOMParser.js"></script>
<script src="javascript/data.js"></script>
<script src="javascript/beautify.js"></script>
<script src="javascript/prettify.js"></script>
<script src="javascript/deep-diff-0.3.1.min.js"></script>
<script src="javascript/testrunner.js"></script>
</head>
<body >
<p>microformat-shiv</p>
<h1>Microformats Tests <span id="version"></span></h1>
<h2 class="test-counts"></h2>
<p>Inspect the details of any test from the list</p>
<section class="flexbox-container">
<section class="test-results">
<ul class="test-result-list">
</ul>
</section>
<section class="test-detail">
<h2 id="test-name"></h2>
<h1>Test</h1>
<div id="test-html"><pre class="prettyprint"><code class="language-html"></code></pre></div>
<h1>Expected JSON</h1>
<div id="test-json"><pre class="prettyprint"><code class="language-json"></code></pre></div>
<h1>Parser JSON</h1>
<div id="parser-json"><pre class="prettyprint"><code class="language-json"></code></pre></div>
<div class="differences">
<h1>Differences</h1>
<div id="test-diff"><pre class="prettyprint"><code class="language-json"></code></pre></div>
</div>
</section>
</section>
<footer>
</footer>
</body>
</html>