Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 1ebf456f65
Fetching contributors…

Cannot retrieve contributors at this time

349 lines (310 sloc) 13.5 KB
<!-- add prototype and styles to ensure that libraries don't collide and css doesn't conflict -->
<title>Mercury Editor Regression Testing</title>
<script src="/prototype.js" type="text/javascript"></script>
<style type="text/css">
body { border: 1px dotted #000; padding: 10px; }
input { padding: 20px !important }
.mercury-toolbar-container { display: none !important }
<meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0">
<!-- include the loader -->
<script src="/assets/mercury/support/history.js" type="text/javascript"></script>
<script src="/mercury/javascripts/mercury_loader.js?pack=bundled&src=/mercury" type="text/javascript"></script>
<!-- preload snippets -->
<script type="text/javascript">
// it's worth mentioning that mercury is not loaded in the first request, but should be loaded in the second.
History.Adapter.bind(window, 'statechange', function() {
var state = History.getState();
console.debug(, state.title, state.url);
Event.observe(window, "mercury:ready", function() {
Mercury.saveURL = '/contents';
snippet_0: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "00"}},
snippet_1: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "01"}},
snippet_2: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "02"}},
snippet_3: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "03"}},
snippet_4: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "04"}},
snippet_5: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "05"}},
snippet_6: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "06"}},
snippet_7: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "07"}},
snippet_8: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "08"}},
snippet_9: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "09"}},
snippet_10: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "10"}},
snippet_11: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "11"}},
snippet_12: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "12"}},
snippet_13: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "13"}}
<!-- styles for the content layout -->
<style type="text/css">
body, td {
font: normal normal normal 100%/normal 'Helvetica Neue', Helvetica, Arial, sans-serif;
h1 {
color: #09F;
margin: 20px 0 0 0;
font-weight: 200;
h2 {
font-weight: 200;
margin: 15px 0 0 0;
border-bottom: 1px solid #CCC;
#forms form {
display: inline;
#content {
min-width: 500px;
width: 70%;
margin: 20px auto;
#controls {
position: absolute;
top: 20px;
left: 20px;
padding: 10px;
margin: 0;
border: 1px solid #999;
background: rgba(255, 255, 255, 0.8);
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
list-style-type: none;
#controls div {
color: #333;
text-transform: lowercase;
text-decoration: none;
cursor: pointer;
.mercury-snippet {
background: rgba(0, 0, 0, 0.5);
color: #FFF;
width: 300px;
height: 100px;
margin: 1px 0;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
#snippetable1 {
float: left;
width: 100%;
margin-bottom: 20px;
#snippetable1 .mercury-snippet {
float: left;
width: 33%;
border: 1px solid #000;
<div id="content">
<ul id="controls">
<li><div onclick="alert(Mercury.version)">Mercury Version</div></li>
<li><div onclick="Mercury.trigger('toggle:interface')">Toggle Interface</div></li>
<li><div onclick="var num = 1; History.pushState({state: num}, 'Mercury Editor -- With history.pushState!', '?pushstate=' + num);">history.pushState</div></li>
<li><div onclick="History.go(-1);">History.go(-1)</div></li>
<li><div onclick="History.back();">History.back()</div></li>
<li><div onclick="History.forward();">History.forward()</div></li>
<h1>Forms (with various methods and targets)</h1>
<div id="forms">
<form id="form1" action="/mercury/test_page" method="post" target="_top">
<input type="submit" name="commit" value="post _top">
<form id="form2" action="/mercury/test_page" method="get" target="_blank">
<input type="submit" name="commit" value="post _blank">
<form id="form3" action="/mercury/test_page" method="post" target="_self">
<input type="submit" name="commit" value="post _self">
<form id="form4" action="/mercury/test_page" method="get">
<input type="submit" name="commit" value="get [none]">
<form id="form5" action="/mercury/test_page" method="post" class="lightview" target="_self">
<input type="submit" name="commit" value="post _self .lightview">
<form id="form6" action="/mercury/test_page" method="get" target="foo">
<input type="submit" name="commit" value="get foo">
<h1>Links (With various targets)</h1>
<div id="links">
<a id="anchor1" href="/mercury/test_page" target="_top">_top</a>
<a id="anchor2" href="/mercury/test_page" target="_blank">_blank</a>
<a id="anchor3" href="/mercury/test_page" target="_self">_self</a>
<a id="anchor4" href="/mercury/test_page">[none]</a>
<a id="anchor5" href="/mercury/test_page" class="lightview" target="_self">_self .lightview</a>
<a id="anchor6" href="/mercury/test_page" target="foo">foo</a>
<h1>Editable region</h1>
<div id="editable1" class="mercury-region" data-type="editable">
If the first line of content isn't wrapped in an element you can't set justification (mozilla only bug).
<h2>text with a meta tag (that will be removed)</h2>
123<meta>editable content
<h2>anchor with a div inside</h2>
<a href="/foo1">l<div>ink with a div in</div> it</a>
<h2>image wrapped in an anchor</h2>
<a href="/foo2"><img alt="logo" src="/assets/mercury/temp-logo.png"></a>123
<h2>table with header and definition cells</h2>
<table border="1">
<th colspan="5">R1C2</th>
<th colspan="2">R2C1</th>
<th rowspan="2">R2C2</th>
<th rowspan="5">R2C4</th>
<td colspan="2">R3C1</td>
<td rowspan="4">R4C3</td>
<th rowspan="2">R6C1</th>
<th rowspan="2">R6C2</th>
<td colspan="2">R8C1</td>
<td colspan="4">R7C2</td>
<h2>table without tbody or border</h2>
<th colspan="2">R1C2</th>
<td rowspan="2">R2C1</td>
<h2>fixed width table (column where all colspans > 1, row where all rowspans > 1)</h2>
<table border="1" width="200">
<td rowspan="2">R1C1</td>
<td colspan="2" rowspan="2">R1C2</td>
<td colspan="2">R3C2</td>
<td colspan="2">R4C3</td>
<h2>paragraph with an overline wrapped in an underline</h2>
<p>123 <u>under <span style="text-decoration:overline">overline</span> line</u> 123</p>
<h2>paragraph with an underline wrapped in an overline</h2>
<p>123 <span style="text-decoration:overline">over <u>underline</u> line</span> 123</p>
<h2>style tag that styles images with a border</h2>
<style type="text/css">img { border: 2px solid red}</style>
<h2>image next to content wrapped in an anchor</h2>
<img alt="logo" src="/assets/mercury/temp-logo.png"><a href="#bookmark1">link for #bookmark1</a>
<h2>snippet that's pre-loaded</h2>
<div class="mercury-snippet" data-snippet="snippet_0">snippet0</div>
<h2>bookmark links</h2>
<a name="bookmark1">Bookmark1</a><br/><a name="bookmark2">Bookmark2</a>
Additional content not wrapped in anything
<h2>youtube and vimeo iframes with content surrounding it</h2>
<!--123<iframe style="width: 560px; height: 349px; " src="" frameborder="0" allowfullscreen="true"></iframe>123321-->
<!--<iframe style="width: 400px; height: 225px; " src=";byline=1&amp;portrait=0&amp;color=ffffff" frameborder="0"></iframe>123-->
<h1>Markupable region (with markdown)</h1>
<div id="markupable1" class="mercury-region" data-type="markupable">
## notes ##
**whitespace** in markupable regions is _important_.
## ordered list ##
1. list item 1
2. list item 2
## unordered list ##
- list item 1
- list item 2
## horizontal rule ##
- - -
## anchor ##
[this is a link](foo 'optional title')
## image ##
![add alt text](/assets/mercury/temp-logo.png)
## snippet that's pre-loaded ##
## code ##
<a href="/foo">this html will not be escaped</a>
and whitespace will be retained
## blockquote ##
> this is indented one level
## paragraph with bold, italics, etc. ##
Turkey corned beef ham, chuck ham hock **venison _drumstick_ ** tongue ribeye. Beef tongue pancetta, short ribs meatball headcheese jowl bacon swine t-bone shoulder venison. Hamburger short loin turkey flank short ribs tail. Chicken tri-tip sausage, bresaola sirloin turkey hamburger <sub>headcheese</sub> shank rump. Pork ground round t-bone, ham hock sirloin biltong chicken fatback pork belly pastrami pancetta jowl tail. Cow ribeye pork chop, flank sirloin tail short loin pork loin chicken boudin pastrami. Boudin chuck shankle, spare ribs pancetta <sup>fatback</sup> bresaola.
<h1>Snippetable region</h1>
<div id="snippetable1" class="mercury-region" data-type="snippetable">
<div class="mercury-snippet" data-snippet="snippet_2">snippet2</div>
<div class="mercury-snippet" data-snippet="snippet_3">snippet3</div>
<div class="mercury-snippet" data-snippet="snippet_4">snippet4</div>
<div class="mercury-snippet" data-snippet="snippet_5">snippet5</div>
<div class="mercury-snippet" data-snippet="snippet_6">snippet6</div>
<div class="mercury-snippet" data-snippet="snippet_7">snippet7</div>
<div class="mercury-snippet" data-snippet="snippet_8">snippet8</div>
<div class="mercury-snippet" data-snippet="snippet_9">snippet9</div>
<h1>Editable region (single snippet and no content)</h1>
<div id="editable2" class="mercury-region" data-type="editable">
<div class="mercury-snippet" data-snippet="snippet_10">snippet10</div>
<h1>Editable region (fixed width/height and overflow)</h1>
<div id="editable3" class="mercury-region" data-type="editable" style="width:200px;height:90px;">
<br/>1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/><a href="#offset_test">8</a><br/>9<br/>10<br/>11<br/>12<br/>13<br/>14<br/>15
<h1>Snippetable region (iframe snippet that contains flash)</h1>
<div id="snippetable2" class="mercury-region" data-type="snippetable">
<div class="mercury-snippet" data-snippet="snippet_11">snippet11</div>
<div class="mercury-snippet" data-snippet="snippet_12">snippet12</div>
<iframe class="mercury-snippet" data-snippet="snippet_13" width="560" height="349" src="" frameborder="0" allowfullscreen="true"></iframe>
Jump to Line
Something went wrong with that request. Please try again.