code:
asciiw.userbuond.com
==========
Your handcrafted ascii weather report.

A minimalist weather site showing the current weather text info along with some nice ascii animations.

All ASCII animations were done by hand.

Licence
-------
wtfpl

license: wtfpl


code:
/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}


code:
@font-face {
  font-family: 'Inconsolata';
  font-style: normal;
  font-weight: 400;
  src: local('Inconsolata'), local('Inconsolata'), url(../css/Inconsolata.otf) format('opentype');
}
body {
  overflow: hidden;
  font-family: Inconsolata;
  white-space: no-wrap;
  text-align: center;
  margin: 0 auto;
  margin-top: 50px;
  line-height: 1.2em;
  background: url('../css/snow.png');
}
#weather {
}
div {
}
#wrapper {
  margin: 0 auto;
  width: 350px;
}
textarea {
  margin: 0 auto;
  outline: none;
  text-align: center;
  border: none;
  border-top: 1px solid #cfcfcf;
  border-bottom: 1px solid #cfcfcf;
  display: block;
  width: 350px;
  height: 200px;
  resize: none;
  overflow: hidden;
  background: none;
  padding-bottom: 20px; padding-top: 20px;
  user-select: none;
}

h1 {
  display: block;
  font-size: 28px;
  padding-bottom: 15px;
  text-align: left;
  letter-spacing: -1px;
}
h1 .small {
  font-size: 12px;
}

#location {
  float: right;
  font-size: 12px;
  height: 18px;
  line-height: 18px;
}

#location input {
  border: none;
  font-size: 11px;
  padding: 3px;
  color: #888888;
}

#location a:hover {
  background: none;
  color: black;
  text-decoration: underline;
}

#label {
  display: inline-block;
  text-align: center
}
h2 {
  font-size: 22px;
  font-weight: bold;
  margin-top: 30px;
  margin-bottom: 5px;
  opacity: 0;
}
footer {
  margin-top: 20px;
  font-size: 11px;
  font-weight: normal;
  line-height: 1em;
}
#date {
  margin-top: 0;
  padding-top: 0;
  font-size: 12px;
  opacity: 0;
}

a {
  color: #00396b;
  text-decoration: none;
  display: inline-block;
  padding: 3px;
}

a:hover {
  background: #00396b;
  color: white;
}


code:
<!doctype html>

<title>asciiw - handcrafted ascii weather report</title>

<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/style.css">

asciiw

  <textarea></textarea>

    source on github | licensed wtfpl


code:
var api_key = "dbe04f1b8655b92d";
var default_zipcode = 53703;
var old_text = "";
var timer;
var weather_conditions = {
  "light rain" : { title : "Lightly Raining in ", frame : slides.raining },
  "rain" : { title : "Raining in ", frame : slides.raining },
  "cloud" : { title : "Cloudy in ", frame : slides.cloudy },
  "clear" : { title : "All Clear in ", frame : slides.clear },
  "overcast" : { title : "Overcast in ", frame : slides.cloudy },
  "sun" : { title : "Sunny in ", frame : slides.cloudy },
  "snow" : { title : "Snowing in ", frame : slides.snowing }
};

function error(message) {
  clear_timer();
  console.log(message);
  $("body textarea").val(message);
}

function fade_in(zepto_selector) {
  zepto_selector.animate({ "opacity" : 100 }, 300, "linear");
}

function warn(message) {
  console.log("Warning: " + message);
}

function switch_zip() {
  var new_zip = $("#location input").val().replace(" ", "");
  if (new_zip.match(/\d{5}/)) {
    var parts = window.location.href.split("/");
    var now = parts[parts.length -1].match(/\d+/);
    if (now && now.length > 0) { parts.pop(); }
    console.log(parts.join("/") + "/" + new_zip);
    window.location.href = parts.join("/") + "/" + new_zip;
  } else { warn("Invalid Zipcode!"); }
}

function install_event_handlers() {
  $("body").on('click', function(e) {
    console.log(e.target);
    if ($(e.target).attr("id") != "location" && !$(e.target).is("input")) {
      $("#location").html(old_text);
    }
  });
  $("#location").on('click', function() {
    if ($("#location").has("input").length == 0) {
      old_text = $("#location").html();
      $("#location").html("<input type='text' placeholder='Enter ZIP'></input>Go");
      $("#location input").focus();
      install_event_handlers();
    } else {
    }
  });
  $("#location a").on('click', function() { switch_zip(); return false; });
  $(document).on('keypress', function(e) { if (e.keyCode == 13) { switch_zip(); } });
}

function timenow(){
  var now= new Date(), ampm= 'AM',
  h= now.getHours(), m= now.getMinutes(), s= now.getSeconds();
  if(h>= 12){ if(h>12)h-= 12; ampm= 'PM'; }
    if(h<10) h= '0'+h;
      if(m<10) m= '0'+m;
        if(s<10) s= '0'+s;
          return now.toLocaleDateString()+' '+h+':'+m+':'+s+' '+ampm;
}

function animate_weather(slides_hash) {
  var x = 0;
  timer = setInterval(function() {
    $("body textarea").val(slides_hash.frames[x].join("\n"));
    x = x + 1;
    if (x == slides_hash.frames.length) { x = 0; }
  }, slides_hash.interval);
}
function clear_timer() { clearInterval(timer); }

function display_weather(zip, data) {
  var frame = null,
  location = data.display_location.full;
  city     = data.display_location.city;

  for (condition in weather_conditions) {
    if (data.weather.toLowerCase().match(condition)) {
      $("h2").html(weather_conditions[condition].title + city);
      frame = weather_conditions[condition].frame;
    }
  }
  if (!frame) {
    error("Unsupported Weather Status '" + data.weather + "'\nPlease submit a bug, patch, or report!");
    return;
  }

  $("#location").html(location + " - " + zip);
  $("#details").html(data.temp_f + "°F | " + data.wind_mph + "MPH Wind | " + data.wind_string );
  $("#date").html(timenow());
  fade_in($("#location"));
  fade_in($("h2"));
  fade_in($("#details"));
  fade_in($("#date"));
  animate_weather(frame);
}

function get_weather(zip_code) {
  $.ajax({
    url : "http://api.wunderground.com/api/" + api_key + "/conditions/q/" + zip_code + ".json",
    dataType : "jsonp",
    success : function(data) { display_weather(zip_code, data.current_observation); },
    error : function(data) { error("Either\n You're not connected to the Internets\nor Wunderground is down buddy"); },
    timeout: 3000
  });
}
window.onload = function() {
  install_event_handlers();
  var parts = window.location.href.split("/");
  var matches = parts[parts.length -1].match(/\d{5}/);
  get_weather(matches && matches[0] ? matches[0] : default_zipcode);
};


code:
icons!  famfamfam
http://famfamfam.com/lab/icons/silk

background, thanks subtle patterns!
http://subtlepatterns.com


code:
Miledit 2
=========
Miledit 2 is a list editor in JS featuring basic text styling (bold, italics, links) but stripped of extraneous features of WYSIWYG. It's a list editor not a text editor. Resultingly, its lightweight minimalistic interface.  It imports and exports data as a single markdown list file.

[Demo Link](http://userbound.com/ui/mil-edit-2)

Miledit 2 is heavily adapted and inspired by my former, [mil edit](). The UI code is split into 9 modules and 1's Markdown libraries were as dependencies in favor of regex-based [mil_markdown](). As far as the user-side goes, a history stack is maintained of callback functions for stepping through state.  As far as user functionality goes, the major new features are:
- Foldable Sections
- Drag and Drop
- Undo / Redo

Dependencies
------------
[ZeptoJS](http://zeptojs.com)
[\_.js](http://underscorejs.org)

Tests
-----
Unit tests are in Jasmine, and a work in progress. Definitely not production software yet, but it is close.  I'm open any contributions, to get this to production quality quicker (see below).

TODO
----
- Bugs
    * Undo/Redo stack not entirely consistent
    * mil_markdown bold within bold/italic within italic cancels out
- Clean up CSS
- Make Credits File
- New (Full) Key bindings Documentation
- Should there be JS to trigger CSS themes, or is should this be developer/user implemented?
- Allow Copy and Paste
- Integrate Copy Paste with Undo/Redo stack
- Finish writing unit tests
- Buttons and Keybindings for collapse and expand all


code:
html body {
  padding-top: 0;
  background: #fff;
  font-size: 13px;
  font-family: monospace;
  background: url('../images/linedpaper.png');
}
.right { float: right; }
.left { float: left; }

#application { padding: 50px 100px; }
#fork-me img {
  position: absolute; top: 0; right: 0; border: 0;
}

h1 {
  font-size: 30px;
  line-height: 30px;
  padding-bottom: 15px;
  text-align: left;
  font-family: "Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace;
  display: inline-block;
  letter-spacing: -5px;
}

h1 sup {
  position: absolute;
  margin-top: -10px;;
  padding-left: 10px;
  font-size: 10px;
}
.subline {
  font-family: "Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace;
  font-size: 20px;
  padding-left: 20px;
  display: inline-block;
}

#footer {
  text-align: left;
  line-height: 20px;
}

hr {
  border: none;
  height: 4px;
  display: block;
  background-color: #f0f0f0;
  margin: 18px 0;
}

a {
  text-decoration: none;
  padding: 0 2px;
  color: #002ab3;
  cursor: pointer;
}
a:hover { color: white; background-color: #002ab3; }

::selection, ::-moz-selection, ::-webkit-selection {
  background: #fffde0;
}

.clear-content {
  margin-top: 10px;
  float: right;
}


code:
/* mil-edit Display Page specific
 * You don't need this stuff if you drop mil edit somewhere
 * */

/* mil-edit Editor Area
 * For styling the lists, textarea, etc... */

#editor {
  width: 100%;
  overflow: hidden;
  background: white;
  border: 1px solid #cfcfcf;
  border-top: none;
  font-size: 13px;
  font-family: Open Sans;
}

#editor.viewing-help.cover-all {
  position: relative;
  min-height: 550px;
}

#editor.viewing-help.cover-all #keybindings {
  position: absolute;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  left: -15px;
}
#editor.viewing-help.cover-all #keys span {
  display: none;
}

#editor a {
  text-decoration: none;
  padding: 0 2px;
  color: #002ab3;
  cursor: pointer;
}
#editor a:hover { color: white; background-color: #002ab3; }

#editor div#area {
  clear: both;
  overflow: hidden;
  display: table;
  width: 100%;
  background: white;
}

#editor #list {
  display: table-cell;
  vertical-align: top;
  height: 100%;
}

#editor a {
  text-decoration: none;
  padding: 0 2px;
  color: #002ab3;
  cursor: pointer;
}
#editor a:hover { color: white; background-color: #002ab3; }

#editor #active {
  color: black;
  background: #ececec;
  border-left: 1px solid #cfcfcf;
  border-bottom: 1px solid #cfcfcf;
}

#editor #active textarea {
  width: 100%;
  background: none;
  border: none; outline: none !important;
  font-family: inherit; font-size: inherit;
  resize: none;
  padding: 0; margin: 0;
  word-wrap: break-word;
  white-space:pre;
}

#editor ::selection, #editor ::-moz-selection, #editor ::-webkit-selection {
  background: #fffde0;
}

#editor ul {
	margin: 0;
  display: block;
  padding-left: 10px;
  color: #212121;
  line-height: 1em;
  border: none;

}
#editor ul ul {
  border: 1px solid #cfcfcf;
  border-top: 1px solid #cfcfcf;
  border-right: 1px solid #cfcfcf;
  margin: 5px 0;
  margin-bottom: none !important;
}

#editor li {
  display: list-item;
  background-color: #fdfdfd;
  color: black;

  margin-left: 5px;
	padding: 5px;
  padding-left: 15px;

  border-left: 1px solid #cfcfcf;
  border-bottom: 1px dotted #cfcfcf;

  cursor: pointer;
  -webkit-user-select: none;
  -ms-user-select: none;
}

#editor li:last-child {
  border-bottom: none;
}
#editor li:hover { background: white; }
#editor li.parent {
}
#editor li.scoped.parent {
  color: black;
  background: #f9f9f9;
}

.nest {
}

#editor li.scoped.nest {
}
#editor li.scoped.nest li {
  color: black;
}
ul li ul li {
  color: #545454;
  background: #fbfbfb;
}

#editor ul { background: #ffffff; padding-left: 0;}
#editor ul ul { background: #f0f0f0; }
#editor ul ul ul { background: #ffffff; }
#editor ul ul ul ul { background: #f0f0f0; }
#editor ul ul ul ul ul { background: #ffffff; }
#editor ul ul ul ul ul ul { background: #f0f0f0; }
#editor ul ul ul ul ul ul ul { background: #ffffff; }
#editor ul ul ul ul ul ul ul ul { background: #f0f0f0; }
#editor ul ul ul ul ul ul ul ul ul { background: #ffffff; }
#editor ul ul ul ul ul ul ul ul ul ul { background: #f0f0f0; }
#editor ul ul ul ul ul ul ul ul ul ul ul { background: #ffffff; }

#editor ul li {
  position: relative;
  font-size: 14px;
  line-height: 1.5em;
  padding-left: 15px;
}

#editor strong { font-weight: bold; }
#editor em { font-style: italic; }

#editor ul li.collapsed{
  text-align: right;
}
//#editor ul li.collapsed:after { content: "..."; }

#editor ul li.collapsed { display: none; }
#editor ul li.collapse.parent { display: block; }

#editor ul li .collapse-expand {
  width: 13px;
  font-size: 11px;
  line-height: 22px;
  height: 22px;
  padding: 0px 6px;
  //border: 1px solid #cfcfcf;
  //background: white;
  background-image: url('../images/bullet_arrow_down.png');
  background-repeat: no-repeat;
  background-position: center center;
  position: absolute;
  right: 5px;

  margin-top: -1px;
}

#editor ul li.parent.folded {
  border-bottom: 1px solid #cfcfcf;
}
#editor.viewing-help ul li .collapse-expand {
  right: 5px;
}
#editor ul li .collapse-expand:hover {
  //width: 70px;
  //border: 1px solid #cfcfcf;
  //background-color: #f7f7f7;
  text-align: left;
}

#wrapped {
}

#editor ul li .collapse-expand.collapsed {
  //margin-top: 0;
  //left: 45px;
  background-image: url('../images/bullet_arrow_up.png') !important;
}
/* Buttons Bar at the top of the editor */
#buttons {
  height: 35px;

  padding: 0 5px;
  padding-right: 0;

  background: white;
  //background: url('../images/buttons_bar.png');
  background-position: 0 -9px;

  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;

  border-bottom: 1px solid #cfcfcf;
  border-top: 1px solid #cfcfcf;

  width: auto;
  clear: both;
}

#buttons a {
  width: 20px;
  height: 22px;

  margin: 0 0px;
  margin-top: 5px;

  background: white;
  background-position: center center;
  background-repeat: no-repeat;

  border: 1px solid white;
  //border: 1px solid #cfcfcf;
  //background-color: #fdfdfd;

  float: left;
}

#buttons a:hover, #buttons a.active {
  border: 1px solid #cfcfcf;
  background-color: #e6e6e6;
}

#buttons.fixed {
  position: fixed;
  top: 20px;
  height: auto;
  padding-bottom: 5px;
  width: 30px;
  padding-left: 4px;
  padding-right: 0px;
  padding-top: 5px;
  margin-left: -36px;
  border: 1px solid #e8e8e8;
  border-right: 1px solid white;

}
#buttons.fixed .separator {
  width: 24px;
  height: 1px;
  border-left: none;
  border-top: 1px solid #e8e8e8;
  margin-left: 2px;
  margin-bottom: 5px;
}
#buttons.fixed a#keys { display: none; }

#buttons.fixed a {
  margin-bottom: 0px;
  margin-top: 1px;
  //border: 1px solid #e8e8e8;
}

#buttons.fixed a:hover {
  border: 1px solid #cfcfcf;
}

#buttons .separator {
  display: block;
  float: left;
  height: 15px;
  border-left: 1px solid #cfcfcf;
  width: 0px;
  margin-top: 10px;
  margin-left: 6px;
  margin-right: 6px;
}

#buttons a#keys {
  float: right;
  display: inline-block;
  width: auto;
  height: 35px;
  line-height: 35px;

  background-image: url('../images/help.png');
  background-position: 10px center;
  background-repeat: no-repeat;

  padding: 0;
  //padding-right: 10px;

  font-size: 16px !important;
  color: black;
  padding-left: 35px;
  background-color: #fcfcfc;
  margin-top: 0;

  border: none;
  border-left: 1px solid #cfcfcf;
}

#buttons a#keys span {
  color: #4d4d4d;
  //border-left: 1px solid #cfcfcf;
  //padding-left: 8px;
  line-height: 10px;
  height: 10px;
}

#buttons a#keys:hover {
  border: none; border-left: 1px solid #cfcfcf;
}
#buttons a#keys:hover span { color: #002ab3; }
#buttons a#keys.enabled { font-size: 15px; }

#buttons a#undent { margin-left: 0; background-image: url('../images/text_indent_remove.png'); /*border-right: none; */ }
#buttons a#indent { background-image: url('../images/text_indent.png'); }
#buttons a#link { background-image: url('../images/world_link.png'); }
#buttons a#italic { background-image: url('../images/text_italic.png'); }
#buttons a#bold { background-image: url('../images/text_bold.png'); /*border-right: none;*/ }
#buttons a#undo { background-image: url('../images/arrow_undo.png'); }
#buttons a#redo { background-image: url('../images/arrow_redo.png'); }

#buttons a#smaller { background-image: url('../images/text_lowercase.png'); }
#buttons a#bigger { background-image: url('../images/text_uppercase.png'); }

#buttons a#smaller, #buttons a#bigger {
  /* until i get some better icons */
  background-image: none;
  float: right;
  color: black;
  line-height: 20px;
  text-align: center;
  font-size: 22px;
}

#buttons a#smaller {
  margin-right: 5px;
}

#buttons .hidden { display: none; }

/* Keybindings Pane */
#editor #keybindings {
  font-size: 12px;
  line-height: 24px;
  text-align: left;
  width: 230px;
  font-size: 13px;
  background: #fcfcfc;
  display: none;
  opacity: 0;
  margin: 0;
  vertical-align: top;
  border-left: 1px solid #cfcfcf;
  padding: 15px;
  padding-top: 0;
  margin-left: 20px;
  background: white;

  position: relative;
  font-family: Open Sans;
  height: 400px;
}

#editor #keybindings .basic {
  //position: fixed;
}

#editor #keybindings .basic.fixed {
  position: fixed;
  top: 0;
}

#editor #keybindings a#collapse {
  vertical-align: bottom;
  float: left;
  position: absolute;
  bottom: 60px;
}

#editor #keybindings.visible { display: table-cell; }

#editor #keybindings h2 a {
  font-size: 11px;
  float: right;
  line-height: 16px;
  margin-top: 8px;
}

#editor #keybindings h2 {
  display: block;
  margin: 10px 0;
  border-bottom: 1px solid #cfcfcf;

  font-size: 15px;
  line-height: 30px;

  color: #002ab3;
  font-family: Verdana, sans;
}

#editor #keybindings span.key {
  border: 1px solid #cfcfcf;
  background: white;
  display: inline-block;
  padding: 0px 3px;
  line-height: 18px;
  margin-top: 3px;
  font-size: 11px;
}

.drag-list {
  border-left: none !important;
  border-bottom: none !important;
  background: none !important;
}
.drag-item {
  border-bottom: 1px solid #cfcfcf !important;
  border-right: 1px solid #cfcfcf !important;
  border-top: 1px solid #cfcfcf;
}

#wrapped {
  border: 1px solid #e8e8e8;
}

#size {
  display: inline-block;
  background-image: url('../images/font.png');
  background-repeat: no-repeat;
  background-position: left center;
  width: 50px;
  height: 100%;
  vertical-align: middle;
  padding-left: 20px;
  outline: 0 !important;
  border: 0 !important;
  margin-right: 20px;

  float: right;
}

#size input {
  height: 100%;
  width: 50px;
  border: 0;
  outline: 0;
}
#size input:focus {
}

.fixed #size {
  border: 0;
  outline: 0;
  -moz-transform: rotate(270deg);
  -webkit-transform: rotate(270deg);
  left: -19px;
  top: 246px;
  height: 100px;
  position: absolute;
}

#editor.size-1 .collapse-expand {
  left: 104px;

  margin-top: -5px;
}

#editor.size-1 ul li ul li .collapse-expand { margin-left: 10px; }
#editor.size-1 ul li ul li ul li .collapse-expand { margin-left: 20px; }
#editor.size-1 ul li ul li ul li ul li .collapse-expand { margin-left: 30px; }
#editor.size-1 ul li ul li ul li ul li ul li .collapse-expand { margin-left: 40px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 50px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 60px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 70px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 80px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 90px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 100px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 110px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 120px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 130px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 140px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 150px; }
#editor.size-1 ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li ul li .collapse-expand { margin-right: 160px; }

#editor.size-1 .collapse-expand {
  margin-top: -6px;
}
#editor.size-1 li {
  font-size: 13px;
  line-height: 13px;
  padding: none;
  margin-left: 2px;
  border-bottom: none;
}
#editor.size-1 li#active {
  border-left: 1px solid #88888A;
  border-bottom: inherit;;
}

#editor.size-1 li.parent {
  border-top: 1px solid #cfcfcf;
  border-bottom: 1px solid #cfcfcf;
  padding-left: 25px !important;
  margin-top: 2px;
}

#editor.size-1 li.scoped {
  border-left: 1px solid #cfcfcf;
  background: #f2f2f2;
  border-bottom: 1px #cfcfcf solid;
}

#editor.size-1 li.scoped {
  background: white;
  border-bottom: 1px solid #cfcfcf;
}

#editor.size-1 li.nest {
  padding: 0;
}
#editor.size-1 li.nest ul {
  padding: 0;
  padding-left: 10px;
  padding-bottom: 2px;
  margin: 0;
  border: none;
  border-left: none;
  border-bottom: 1px solid #cfcfcf;
  background: none !important;
  padding-left: 5px;
}
#editor.size-1 li.nest ul li {
  padding-left: 5px;
  border-left: 1px solid #cfcfcf;
}


code:
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: local('Open Sans'), local('OpenSans'), url(../ttf/open_sans.ttf) format('truetype');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(../ttf/open_sans-bold.ttf) format('truetype');
}
@font-face {
  font-family: 'Open Sans';
  font-style: italic;
  font-weight: 400;
  src: local('Open Sans Italic'), local('OpenSans-Italic'), url(../ttf/open_sans-italic.ttf) format('truetype');
}


code:
<!doctype html>

    <title>Miledit 2: A simple markdown list editor in javascript.</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="./css/reset.css" />
    <link rel="stylesheet" href="./css/page.css" />
    <link rel="stylesheet" href="./css/typography.css" />
    <link rel="stylesheet" href="./css/style.css" />

      Clear Content

mil edit 2


code:
var mil_edit = (function(my) {
  var history = my.history;
  var state = my.state;
  var focus = my.focus;
  var tree = my.tree;
  var interface = my.interface;
  var event_handlers = my.event_handlers;
  var user_actions = my.user_actions;

  function load_template() { $(my.globals.root).html(editor_template); }
  function initialize(r) {
    if (my.globals.initialized) { return false; }
    if (r != undefined) { my.globals.root = r; }
    load_template();
    event_handlers.install();
    $(my.globals.root_selector).html($("<ul>").append(my.globals.li_tag));
    my.focus.set($("li", my.globals.root_selector).first());
    return my.globals.initialized =  true;
  }

  // Mil Edit Publicly Returned Object
  return {
    history : history,

    set_cutoff_height : function(pixels) { my.globals.cutoff_height = pixels; },
    undo : user_actions.undo,
    redo : user_actions.redo,

    drag : event_handlers.drag,
    drop : event_handlers.drop,

    set_size : interface.set_size,
    collapse_all : interface.collapse_all,
    expand_all: interface.expand_all,

    bold : user_actions.bold,
    italic : user_actions.italic,
    link : user_actions.link,

    initialize : initialize,
    disable : function() {
      event_handlers.uninstall();
      my.globals.initialized =  false;
    },

    simulate_key : event_handlers.simulate_key,
    fake_key_down: event_handlers.key_down,
    fake_key_up: event_handlers.key_up,
    insert_below: tree.insert_below,

    dump_state: state.dump_state,
    dump_focus_state : state.dump_focus_state,
    load_state: state.load_state,

    // line manipulation
    indent : user_actions.indent,
    undent : user_actions.undent,

    // keybindings/help menu
    keybindings : user_actions.sidebar,

    // load and dump markdown
    dump_markdown : state.dump_markdown,
    load_markdown : state.load_markdown,

    clear : user_actions.clear
  };
}(mil_edit || {}));


code:
var mil_edit = (function(my) {
  var globals   = my.globals;
  var util      = my.util;
  var focus     = my.focus;
  var interface = my.interface;
  var state     = my.state;
  var tree      = my.tree;
  var history   = my.history;
  var keybindings = my.keybindings;
  var user_actions = my.user_actions;

  var event_handlers = new Object();
  var drag_target = null;
  var old_state;

  event_handlers.drag = function(ev) {
    if (drag_target) { return false; }
    var associated_parent, associated_nest;
    old_state = state.dump_state();

    // Set within the event_handlers scope
    drag_target = ev.target;

    tree.clean_tree();
    if ($("div.collapse-expand", ev.target).length) { // Dragging the associated_parent
      associated_nest = $(drag_target).next();
      associated_parent = $(ev.target);
    } else if ($($(ev.target).children()[0]).is("ul")) { // Dragging the actual list
      associated_nest = $(ev.target);
      associated_parent = $(associated_nest).prev();
    } else if (!$("li", ev.target).length) { // Just dragging a single list item
      associated_nest = null;
      associated_parent = $(drag_target);
    }

    $(associated_parent).wrap("

");
    if (associated_nest != null) { $("#wrapped").append(associated_nest); }
    ev.dataTransfer.setDragImage($("#wrapped")[0],0,0);
    ev.dataTransfer.setData("text/html", null);

    return true;
  }
  event_handlers.drop = function(ev) {
    var mouse_top = ev.y + $(window).scrollTop();
    var closest = null;
     _.each($("#editor li"), function(e) {
       var x = $(e).offset().top;
       if (closest == null || Math.abs(x - mouse_top) < Math.abs(closest[0] - mouse_top)) {
         closest = [$(e).offset().top, $(e)];
       }
    });

    var source  = drag_target;
    var saved_state = old_state;
    var destination = closest[1];
    if (destination.has(".collapse-expand").length != 0) {
      destination = $(destination.next().children()[0]).children().last();
    }

    try {
      history.do_action({
        undo : function() { return state.load_state(saved_state); },
        redo : function() {
          if ($(destination).next().length == 0) {
            $(destination).after($("#wrapped"));
          } else {
            $(destination).before($("#wrapped"));
          }
          $("#wrapped").children().unwrap();

          tree.clean_tree();
          focus.browser_focus_reset();
          interface.recurrent(); // need undo/redo icon
          drag_target = false;
          return true;
        }
      });
    } catch(err) { $("#wrapped").children().unwrap(); /* DOM Hierarchy Error */ return false; }

    return false;
  }

  event_handlers.simulate_key = function(k) {
    var textarea = $("#active textarea");
    // Simulate a Backspace
    if (typeof k == "object" && (k.keyCode == 46 || k.keyCode == 8)) {
      var pos = textarea[0].selectionStart - 1;
      textarea.val(util.remove_at(
        textarea.val(),
        textarea[0].selectionStart - 1,
        textarea[0].selectionEnd - textarea[0].selectionStart
      ));
      focus.position_cursor(pos);
    } else {
      var to_insert = "";
      if (typeof k == "string") {
        to_insert = k;
      } else {
        k = k || window.event;
        var charCode = k.charCode || k.keyCode,
        to_insert = String.fromCharCode(charCode);
        to_insert = k.shiftKey ? to_insert.toUpperCase() : to_insert.toLowerCase();
      }
      textarea.val(util.insert_at(textarea.val(), textarea[0].selectionEnd, to_insert));
    }
    return true;
  }

  event_handlers.key_down = function(k) {
    if (!util.is_focused()) { if (!focus.browser_focus_reset()) { return true; } }
    var original_event = k;

    // Convert k to mutable object with only properties needed
    if (util.type(k) == "[object KeyboardEvent]") {
      k = { keyCode : k.keyCode, shiftKey : k.shiftKey, ctrlKey : k.ctrlKey };
    }
    var passthrough_keys = _.union(61, 173, _.range(48,58), _.range(65, 91), 32, _.range(186,193), _.range(219, 223));

    // Check to see if we fill any of the bindings
    var binding_return = -1;
    _.each(keybindings, function(b) {
      if (b.key.key_code == k.keyCode && b.key.ctrl_key == k.ctrlKey && b.key.shift_key == k.shiftKey) {
        binding_return = b.handler(); // will set binding return to true or false
      }
    });

    if (binding_return != -1) {
      original_event.preventDefault();
      return binding_return || false;
    } else if (_.contains(passthrough_keys, k.keyCode)) {
      if (k.ctrlKey) { return true; } // Dont add C-V and C-C to history handled by custom events
      history.add_action({
        undo: function() { return event_handlers.simulate_key({ keyCode : 46 }); },
        redo: function() { return event_handlers.simulate_key(k); }
      });
      return true;
    } else {
      return false;
    }
  };

  event_handlers.key_up = function(e) {
    if (!util.is_focused()) { return true; }
    focus.adjust_rows();
    interface.ensure_input_in_view();
    tree.fix_collapse_expand_buttons();
    interface.recurrent();
    focus.browser_focus_reset(true);
  };

  event_handlers.mouse_down = function(e) {  // records for undo events on click / dbl click
    //if (!util.is_focused()) { return true; }
    if (!globals.clicking) { mouse_down_focus_state = state.dump_focus_state(); }
    if (e.detail == 1) { return true; }
    if ($(e.target).is("textarea")) { return globals.clicking; }
  };
  event_handlers.mouse_up = function(e) {
    //if (!util.is_focused()) { return true; }
    var t = $(e.target);
    if (t.is("a")) { return false; } // click link
    if (t.is("textarea")) { return true; }

    var the_li = this, old_state = state.dump_state();
    if (t.is(".collapse-expand")) {
      history.do_action({
        undo : function() { state.load_state(old_state); return true; },
        redo : function() { interface.toggle_expand_collapse(the_li); return true; }
      });
      interface.recurrent();
      return false;
    }
    if (!t.length) { return false; }
    if (!util.is_editable(t)) {
      if (util.is_editable(t.parent())) {
        t = t.parent();
      } else {
        while (!util.is_editable(t)) {
          if (!t.children().length) { break; }
          t = t.children().first();
        }
      }
    }

    var focus_state = state.dump_focus_state();
    history.do_action({
      undo : function() { return state.load_focus_state(focus_state); },
      redo : function() { return focus.set(t, true); }
    })
    interface.recurrent();

    return true;
  };

  event_handlers.click_textarea = function(e) {
    if (!util.is_focused()) { return true; }
    globals.clicking = true;

    var current_focus_state = state.dump_focus_state();
    var old_focus_state     = mouse_down_focus_state;
    history.add_action({
      undo : function() { return state.load_focus_state(old_focus_state); },
      redo : function() { return state.load_focus_state(current_focus_state); }
    });
    if (e.detail == 3) {
      globals.clicking = false;
      clearTimeout(globals.clicking_falsify_callback);
    } else {
      globals.clicking_falsify_callback = setTimeout(
        function() { globals.clicking = false; },
        300
      );
    }
    interface.recurrent();
    return false;
  };

  event_handlers.cut = function(e)  { if (!util.is_focused()) { return true; } };
  event_handlers.copy = function(e) { if (!util.is_focused()) { return true; } };
  event_handlers.paste = function(e) {
    if (!util.is_focused()) { return true; }
    var old_state = state.dump_state();
    history.add_action({
      undo : function() { return load_state(old_state); },
      redo : function() { }
    });
  }
  event_handlers.font_size_change = function(e) {
    interface.set_size(parseInt($("#size input").val()));
  }
  //event_handlers.timed_interval = function(e) { }
  event_handlers.window_resize = function(e) {
    if (parseInt($("#editor").css("width").split("px")[0]) < 415) {
      $("#editor").addClass("cover-all");
    } else {
      $("#editor").removeClass("cover-all");
    }
  }

  event_handlers.install = function() {
    $(document).on('keydown', event_handlers.key_down);
    $(document).on('keyup', event_handlers.key_up );
    $(document).on('mousedown', "#editor li", event_handlers.mouse_down);
    $(document).on('mouseup', "#editor li", event_handlers.mouse_up);
    $(document).on('click', "#editor textarea", event_handlers.click_textarea);
    $(document).on('cut', "#editor textarea", event_handlers.cut);
    $(document).on('copy', "#editor textarea", event_handlers.copy);
    $(document).on('paste', "#editor textarea", event_handlers.paste);
    $(document).on('scroll', event_handlers.scroll);
    $(window).on('resize', event_handlers.window_resize);

    $("#size input").on('change', event_handlers.font_size_change);
    //setInterval(event_handlers.timed_interval, 500);
  }

  event_handlers.uninstall = function() {
    $(document).off('keydown', event_handlers.key_down);
    $(document).off('keyup', event_handlers.key_up );
    $(document).off('mousedown', "#editor li", event_handlers.mouse_down);
    $(document).off('mouseup', "#editor li", event_handlers.mouse_up);
    $(document).off('click', "#editor textarea", event_handlers.click_textarea);
    $(document).off('cut', "#editor textarea", event_handlers.cut);
    $(document).off('copy', "#edior textarea", event_handlers.copy);
    $(document).off('paste', "#editor textarea", event_handlers.paste);
  }

  return _.extend(my, { event_handlers : event_handlers });
}(mil_edit || {}));


code:
var mil_edit = (function(my) {
  var globals = {
    root             : "#editor",
    root_selector    : "#editor #area #list",
    initialized      : false,
    help_enabled     : false,
    is_animating     : false,
    li_tag           : "<li draggable='true' ondragstart='mil_edit.drag(event)' ondrop='mil_edit.drop(event)' ondragover='return false;'>",
    mouse_down_focus_state : false,
    clicking : false,
    clicking_falsify_callback : false,
    drag_target : false,
    cutoff_height : 0
  };

  return _.extend(my, { globals : globals });
}(mil_edit || {}));


code:
var mil_edit = (function(my) {
  var history = new Object();
  history.stack_limit = 200;
  history.undo_stack = [], history.redo_stack = [];

  history.push_to_stack = function(stack, action) {
    stack.push(action);
    if (stack.length > history.stack_limit) { stack.shift(); }
  }

  history.add_action = function(action) {
    if (typeof action == "function") { var a = action; action = { undo: a, redo : a}; }
    history.push_to_stack(history.undo_stack, action);
    history.redo_stack = [];
  }
  history.do_action = function(action) {
    if (typeof action == "function") { var a = action; action = { undo: a, redo : a}; }
    history.push_to_stack(history.redo_stack, action);
    history.redo();
  }
  history.undo = function() {
    var command = history.undo_stack.pop();
    if (command && command.undo()) {
      history.push_to_stack(history.redo_stack, command);
    }
  };
  history.redo = function() {
    var command = history.redo_stack.pop();
    if (command && command.redo()) {
      history.push_to_stack(history.undo_stack, command);
    }
  }

  return _.extend(my, { history : history });
}(mil_edit || {}));


code:
var mil_edit = (function(my) {
  // Dependency Imported from mil_edit scope
  var history = my.history;
  var tree    = my.tree;
  var util    = my.util;
  var focus   = my.focus;
  var globals = my.globals;
  var event_handlers = my.event_handlers;
  var interface = new Object();

  interface.sync_ui_buttons = function() {
    util.set_class($("#bold"), "active", focus.is_in_bold());
    util.set_class($("#italic"), "active", focus.is_in_italic());
    util.set_class($("#undo"), "hidden", !history.undo_stack.length);
    util.set_class($("#redo"), "hidden", !history.redo_stack.length);
    util.set_class($("#undo_separator"), "hidden", !(history.redo_stack.length || history.undo_stack.length));
  };

  interface.recurrent = function() {
    tree.clean_tree();
    interface.sync_ui_buttons();

    tree.fix_collapse_expand_buttons();
    interface.ensure_input_in_view();
    //focus.browser_focus_reset();
  };

  interface.collapse_all = function() {
    _.each($(".collapse-expand"), function(c) {
      var associated_li_parent = $(c).parent().next();
      if (!associated_li_parent.hasClass("collapsed")) {
        tree.collapse($(c));
      }
    });
  }
  interface.expand_all = function() {
    _.each($(".collapse-expand"), function(c) {
      var associated_li_parent = $(c).parent().next();
      if (associated_li_parent.hasClass("collapsed")) {
        tree.expand($(c));
      }
    });
  }

  interface.toggle_expand_collapse_current_position = function() {
    var collapse_expand_selector;
    return interface.toggle_expand_collapse(
      $("#active").children(".collapse-expand").length > 0 ?
        $("#active")[0] :
        $("#active").parent().parent().prev()
    );
  };

  interface.toggle_expand_collapse = function(associated_parent_dom) {
    if (globals.is_animating) { return false; }

    var associated_nest = $(associated_parent_dom).next();
    var new_focus = $("#active", associated_nest).length ? $(associated_parent_dom) : null;

    setTimeout(function() { globals.is_animating = false; }, 200);
    if ($(associated_nest).hasClass("collapsed")) {
      interface.expand_nest(associated_nest)
    } else {
      interface.collapse_nest(associated_nest);
    }

    if (new_focus) { focus.set(new_focus); }
    return true;
  };

  interface.expand_nest = function(nest_dom) {
    globals.is_animating = true;
    $(nest_dom).removeClass("collapsed").animate(
      { opacity : 1 }, { duration: 200, complete : function() { globals.is_animating = false; } }
    );
  };
  interface.collapse_nest = function(nest_dom) {
    globals.is_animating = true;
    $(nest_dom).animate({ opacity: 0 }, { duration : 200,
      complete : function() {
        $(nest_dom).addClass("collapsed");
        tree.fix_collapse_expand_buttons();
        globals.is_animating = false;
      }
    });
  };

  interface.set_size = function(size) {
    if (size > 10) { size == 10; }
    if (size < 1)  { size == 1; }

    _.each(_.range(1,11), function(n) {
      if ($(globals.root).hasClass("size-" + n)) {
        $(globals.root).removeClass("size-" + n);
      }
    });
    $(globals.root).addClass("size-" + size);
  };

  interface.toggle_sidebar = function() {
    if (globals.is_animating) { return false; }
    my.event_handlers.window_resize()

    globals.is_animating = true;
    if (globals.help_enabled) {
      $("#keys").animate({ 'width': 'auto' }, { duration: 150 }).removeClass("enabled");
      $("#keys span").text("");
      $("#keybindings", globals.root).animate({ opacity: 0 }, {
        complete : function() {
          $(globals.root + " #keybindings").removeClass("visible");
          $(globals.root).removeClass("viewing-help");
          globals.is_animating = false;
        }
      });
      globals.help_enabled= false;
    } else {
      if (parseInt($("#editor").css("width").split("px")[0]) < 415) {
        $("#keys").addClass('enabled');
      } else {
        $("#keys").animate({ 'width': '225px' }, { duration: 150 }).addClass('enabled');
        $("#keys span").text("Help");
      }
      $("#keybindings", globals.root).addClass("visible").animate({ opacity: 1.0 }, {
        duration: 600, easing: 'ease-in',
        complete : function() {
          globals.is_animating = false;
          $(globals.root).addClass("viewing-help");
        } });
        globals.help_enabled= true;
    }
    focus.browser_focus_reset(false);
    return true;
  };

  interface.ensure_input_in_view = function() {
    if ($("#active").offset().top - globals.cutoff_height < $(window).scrollTop()) {
      window.scrollTo(0,$("#active").offset().top - globals.cutoff_height);
    }
    if ($("#active").offset().top + $("#active").height() > $(window).scrollTop() + $(window).height()) {
      var bottom_diff = ($("#active").offset().top + $("#active").height()) - ($(window).scrollTop() + $(window).height());
      window.scrollTo(0,$(window).scrollTop() + bottom_diff + 10);
    }
  }

  interface.bold = function() {  focus.surround_selection("**", "**"); };
  interface.italic = function() { focus.surround_selection("_", "_"); };
  interface.link = function() {
    var field = $("#active textarea")[0];
    var selected = field.selectionStart != field.selectionEnd ? true : false;
    focus.surround_selection("[", "]()");
    if (selected) { focus.position_cursor_delta(-1); }
  };
  interface.clear = function() {
    $(root_selector).html($("<ul>").append(li_tag));
    focus.set($("li", root_selector).first());
    return true;
  };

  return _.extend(my, { interface : interface });
}(mil_edit || {}));


code:
var mil_edit = (function(my) {
  var user_actions = my.user_actions;

  var keybindings = [
    { key : { key_code  : 89, ctrl_key : true, shift_key : false  },  handler : user_actions.redo },
    { key : { key_code  : 90, ctrl_key : true, shift_key : false  },  handler : user_actions.undo },

    { key : { key_code  : 9,  ctrl_key  : false, shift_key : true },  handler : user_actions.undent }, // right tab
    { key : { key_code  : 37, ctrl_key  : false, shift_key : true },  handler : user_actions.undent }, // right ->

    { key : { key_code  : 9, ctrl_key : false, shift_key : false  },  handler : user_actions.indent }, // left tab
    { key : { key_code  : 39, ctrl_key : false, shift_key : true  },  handler : user_actions.indent }, // left <-

    { key : { key_code  : 69, ctrl_key : true, shift_key : false  },  handler : user_actions.fold }, // ctrl e

    { key : { key_code  : 46, ctrl_key : false, shift_key : false },  handler : user_actions.backspace },
    { key : { key_code  : 8, ctrl_key : false, shift_key : false  },  handler : user_actions.backspace },

    { key : { key_code : 38, ctrl_key : false, shift_key : false  },  handler : user_actions.focus_up }, // up key
    { key : { key_code : 38, ctrl_key : false, shift_key : true   },  handler : user_actions.shift_up },  // shift up

    { key : { key_code : 40, ctrl_key : false, shift_key : false  },  handler : user_actions.focus_down }, // down key
    { key : { key_code : 40, ctrl_key : false, shift_key : true   },  handler : user_actions.shift_down }, // shift down

    { key : { key_code : 13, ctrl_key : false, shift_key : false  },  handler : user_actions.enter }, // enter key

    { key : { key_code : 191, ctrl_key : true, shift_key : false  },  handler : user_actions.sidebar }, // ctrl ? (shift /)

    { key : { key_code : 73, ctrl_key : true, shift_key : false   },  handler : user_actions.italic }, // ctrl i
    { key : { key_code : 66, ctrl_key : true, shift_key : false   },  handler : user_actions.bold }, // ctrl b
    { key : { key_code : 37, ctrl_key : false, shift_key : false  },  handler : user_actions.left_arrow }, // <-
    { key : { key_code : 39, ctrl_key : false, shift_key : false  },  handler : user_actions.right_arrow }, // ->

    //{ key_code : 89, ctrl_key : true, shift_key : false } : handlers[link], // ctrl u
    { key : { key_code : 88, ctrl_key : true, shift_key : true    }, handler : user_actions.clear }//ctrl x
  ];

  return _.extend(my, { keybindings : keybindings });
}(mil_edit || {}));


code:
var template_buttons = ''.concat(
  '
',

  '',
  '',

  '',
  '',
  '',
  '',
  '',
  '',

  '',

  '
'
);

var template_keybindings = ''.concat(
  '
',

  '
',

  '
Drag and Drop
',
  'Re-arrange items using drag and drop',

  '
Styling Text
',
  '**Two Stars** makes text Bold
',
  '_Underscores_ makes text Italic
',

  '
Key Controls
',
  'Tab to Indent
',
  'Shift Tab to Undent
',
  '↑ and ↓ to move between lines
',
  'Shift ↑ ↓ to shift between lines
',

  'Hide →',
  '
',

  '
'
);

var template_list = ''.concat(
  '
',
  '

',
  template_keybindings,
  '
'
  );

var editor_template = ''.concat(
  template_buttons,
  template_list
);


code:
var mil_markdown = (function() {
  var li_tag = "
";
  var tabSize = 2;

  function regex_substitute(payload, regexp, delimStart, delimEnd) {
    if (!delimEnd) { delimEnd = delimStart; }
    return payload.replace(
      regexp,
      function(a, s, capture, e) { return delimStart + capture + delimEnd }
    );
  };
  function replace_bolds_to_md(payload) {
    var expression = new RegExp(/(\)([^>]+)(\<\/strong\>)/ig);
    return regex_substitute(payload, expression, "**");
  }
  function replace_italics_to_md(payload) {
    var expression = new RegExp(/(\)([^>]+)(\<\/em\>)/ig);
    return regex_substitute(payload, expression, "_");
  }
  function replace_links_to_md(payload) {
    return payload.replace(
      new RegExp(/(\)([^<]+)(\<\/a\>)/ig),
      function(a,b,href,d,content,f) {
        return "[" + content + "](" + href + ")";
      }
    );
  }
  function replace_bolds_to_html(payload) {
    // Use of regex_substitute for all fns would be ideal
    var expression = new RegExp(/(\*\*)(([^*][^*]|[^*])+)(\*\*)/ig);
    return payload.replace(
      expression,
      function(a,open_delim,content,d,close_delim,f) {
        return "" + content + "";
      }
    );
  }
  function replace_italics_to_html(payload) {
    var expression = new RegExp(/(_)([^_]+)(_)/ig);
    return regex_substitute(payload, expression, "", "");
  }
  function replace_links_to_html(payload) {
    return payload.replace(
      new RegExp(/(\[)([^\]]+)(\]\()([^)]+)(\))/ig),
      function(all, a,content,c,url,e) {
        return "" + content + "";
      }
    );
  }

  function strip_junk_tags(payload) {
    var strip_p = new RegExp(/(\
)(.+)?(\<\/p\>)/ig);
    var strip_div = new RegExp(/(\
]+?\>)()(\<\/div\>)/ig);
    return regex_substitute(regex_substitute(payload, strip_p, ""), strip_div, "");
  }

  function markdownify_text_attributes(payload) {
    if (!payload) { payload = "" }
    return strip_junk_tags(replace_italics_to_md(replace_bolds_to_md(replace_links_to_md(payload))));
  }
   /* Dump */
  function markdownify(payload) {
    var ret = "";
    _.each($("li", payload), function (l, i) {
      if ($(l).children("ul").size() != 0) { return; } // wrapper li
      var text = "", pre = "", level = $(l).parents("ul").size() -1;
      _.times(level * tabSize, function () { pre = pre + " "; });
      pre += (level % 2 === 0) ?  "- " : "* ";
      text = $(l).html();
      ret += pre + text;
      if (i + 1 != $("li", payload).length) { ret += "\n"; }
    });
    return markdownify_text_attributes(ret);
  };

  function htmlify_text_attributes(payload) {
    // convert links, a and bold
    return strip_junk_tags(replace_italics_to_html(replace_bolds_to_html(replace_links_to_html(payload))));
  }
  function htmlify(payload) {
    var lines = payload.split("\n"), root = $("
"), parent = root, last_indent = 0;

    _.each(lines, function(line, index) {
      if (line == "") { return; }
      var matches = line.match(new RegExp("(\s\s)*[-*] (.+)"));
      if (!matches) { return; }
      var leading = matches.index, content = matches[2];

      if (leading - 2 == last_indent) {
        parent.append($(li_tag).append("
"));
        parent = $(parent.children().last().children()[0]);
      } else if (last_indent -leading > 0) {
        _.times((last_indent - leading) / 2, function() {
          parent = parent.parent().parent();
        });
      }

      parent.append(li_tag + content + "
");
      last_indent = leading;
    });
    if ($(root).children().size() == 0) {
      return false;
    } else {
      _.each($("li", root), function(a) {
        if ($(a).children("ul").size() != 0) { return; }
        $(a).html(htmlify_text_attributes($(a).html()));
      });
      return $(root);
    }
  }

  return {
    markdownify : markdownify,
    markdownify_text_attributes : markdownify_text_attributes,
    htmlify : htmlify,
    htmlify_text_attributes : htmlify_text_attributes
  }
}());


code:
var mil_edit = (function(my) {
  var globals   = my.globals;
  var focus     = my.focus;
  var tree      = my.tree;
  var interface = my.interface;
  var state = new Object();

  /* Dumping and Loading */
  state.dump_markdown = function() {
    var x = $("ul", globals.root_selector).clone()[0];
    $("#active", x).html($("#active textarea").val());
    return mil_markdown.markdownify(x);
  };
  state.load_markdown = function(markdownString) {
    var html = mil_markdown.htmlify(markdownString);
    $(globals.root_selector).html(html ? html : "

");
    focus.set($("li", globals.root_selector).last());
    interface.recurrent();
    return true;
  };
  state.dump_focus_state = function() {
    if ($("#active textarea").length == 0) { return false; }
    var end_cursor_max = $("#active textarea").clone().val().length;
    var selection_start = $("#active textarea")[0].selectionStart;
    var selection_end = $("#active textarea")[0].selectionEnd;
    if (selection_start > end_cursor_max) { selection_start = end_cursor_max; }
    if (selection_end > end_cursor_max) { selection_end = end_cursor_max; }

    return [
      parseInt($("li", globals.root_selector).index("#active")),
      parseInt(selection_start),
      parseInt(selection_end),
      String($("#active textarea").clone().val())
    ];
  };
  state.load_focus_state = function(dumped_state) {
    focus.set($($("li", globals.root_selector)[dumped_state[0]]), true);
    $("#active textarea").val(dumped_state[3]);
    focus.position_cursor(dumped_state[1], dumped_state[2]);
    tree.fix_collapse_expand_buttons();
    return true;
  };
  state.dump_state = function() {
    tree.clean_tree();
    if ($("#active textarea").length == 0) { return false; }
    return [
      $(globals.root_selector).clone().html(),
      $("#active textarea")[0].value,
      state.dump_focus_state()
    ];
  };
  state.load_state = function(h) {
    tree.clean_tree();
    $(globals.root_selector).html(h[0]);
    $("#active textarea").val(h[1]);
    state.load_focus_state(h[2]);
    return true;
  };

  return _.extend(my, { state : state });
}(mil_edit || {}));


code:
var mil_edit = (function(my) {
  // Dependency Imported from mil_edit scope
  var globals = my.globals;
  var history = my.history;
  var util    = my.util;
  var tree = new Object();

  tree.are_brothers = function(zepto_selector_a, zepto_selector_b) {
    return _.contains(zepto_selector_a.parent().children(), zepto_selector_b[0]);
  };

  tree.levels_to_root = function(zepto_selector) {
    var level = 0;
    while ($(zepto_selector).attr("id") != "list" && $(zepto_selector).parent().length != 0) {
      zepto_selector = $(zepto_selector).parent();
      level++;
    }
    return level;
  };

  tree.directional_find = function(tag, zepto_selector_origin, direction) {
    // tag to find, zepto selector, and which direction to go in
    if (zepto_selector_origin.length == 0) { return false; }
    var c = zepto_selector_origin;

    brother_children = (direction == 1) ? c.next().size() : c.prev().size();

    while(!brother_children && c.parent()){
      c = c.parent();
      brother_children = (direction == 1) ? c.next().size() : c.prev().size();
      if (brother_children) { break; }
    }

    // At the top or not dealing in li uls anymore
    if (c.is(globals.root_selector) || (!c.is("li") && !c.is("ul"))) {
      return false;
    }

    // Search DOWN the tree
    c = (direction == 1) ? c.next() : c.prev();
    while (c.children().size() && !util.is_editable(c)) {
      c = (direction == 1) ? c.children().first(tag) : c.children().last(tag);
    }

    return $(c).is(tag) ? c : false;
  };
  tree.delete_empties = function() {
    /* Remove empty li's and li ul's */
    _.each(_.union($("li", globals.root_selector), $("li ul", globals.root_selector)), function(item) {
      if ($(item).html() == "") { $(item).remove(); }
    });
  };

  tree.merge_seperate_lists = function() {
    /* Combine ul's un-necessarily "seperate" */
    while ($("ul", globals.root_selector).parent().next().children("ul").size() > 0) {
      _.each($("ul", globals.root_selector), function(item) {
        if ($(item).parent().next().children("ul").size() > 0) {
          $(item).append($(item).parent().next().children("ul").children());
          $(item).parent().next().children("ul").parent().remove();
        }
      });
    }
  };

  tree.clean_tree = function() {
    // If top UL somehow calls out of place, fix it
    if ($("#list").children().size() != 1 && !$($("#list").children()[0]).is("ul")) {
      $("#list").html("<ul>" + $("#list").html() + "</ul>");
    }
    tree.delete_empties();
    tree.merge_seperate_lists();
    tree.delete_empties();
    if ($("#active").parent().parent().siblings().size() == 0) {
      focus.undent();
    }
    tree.fix_collapse_expand_buttons();
    $("#wrapped").children().unwrap();
  }

  tree.new_brother = function(brother) { return $(globals.li_tag).insertAfter(brother ? brother : "#active"); }
  tree.delete_above = function() { focus.set_delta(-1); tree.clean_tree(); return true; }
  tree.insert_below = function() { return focus.set(tree.new_brother()); };

  tree.fix_collapse_expand_buttons = function() {
    _.each($(".collapse-expand", globals.root_selector), function(btn) {
      $(btn).remove();
    });
    _.each(_.union($(".nest", globals.root_selector), $(".parent", globals.root_selector)), function(s) {
      $(s).removeClass("nest").removeClass("parent");
    });

    _.each($("ul", globals.root_selector), function(ul) {
      var associated_nest = $(ul).parent();
      if (associated_nest.is(globals.root_selector)) { return; } // root selector
      var associated_parent = associated_nest.prev();
        var d = $("<div>").addClass("collapse-expand");
        if (associated_nest.hasClass("collapsed")) { d.addClass("collapsed"); }
        if (associated_nest.hasClass("collapsed")) {
          associated_parent.addClass("folded");
        } else {
          associated_parent.removeClass("folded");
        }
        $(associated_parent).addClass("parent").prepend(d);
        $(associated_nest).addClass("nest");
    });

    _.each($(".scoped", globals.root_selector), function(s) {
      $(s).removeClass("scoped");
    });

    var node = $("#active").parent().parent();
    while(node.is("li")) {
      node.addClass("scoped");
      node.prev().addClass("scoped");
      node = node.parent().parent();
    }
  };

  tree.clear = function() {
    $(globals.root_selector).html($("<ul>").append(globals.li_tag));
    focus.set($("li", globals.root_selector).first());
    return true;
  };

  var focus = new Object();
  focus.position_cursor =  function(start_position, end_position) {
    if (!end_position) { end_position = start_position; }
    var field = $("#active textarea")[0];
    if (field.createTextRange) {
      var range = field.createTextRange();
      range.move('character', start_position);
      range.moveEnd('character', end_position);
      range.select();
    } else {
      if (field.selectionStart != undefined) {
        field.setSelectionRange(start_position, end_position);
      }
      field.focus();
    }
    return true;
  };

  focus.position_cursor_delta = function(delta) {
    focus.position_cursor($("#active textarea")[0].selectionStart + delta);
    return true;
  };

  focus.adjust_rows = function() {
    var f = $("#active textarea");
    f.css("overflow", "hidden").height("18px");
    f.height(f[0].scrollHeight + "px");
  };

  focus.is_in_bold = function() {
    return util.is_enclosed_by(
      $("#active textarea").val(), $("#active textarea")[0].selectionEnd, "**");
  }
  focus.is_in_italic = function() {
    return util.is_enclosed_by(
      $("#active textarea").val(), $("#active textarea")[0].selectionEnd, "_");
  }
  focus.surround_selection = function(prepend, append) {
    var field = $("#active textarea")[0];
    var emptySelection = field.selectionStart == field.selectionEnd ? true : false;

    var end = field.selectionEnd + append.length + prepend.length;
    var newText = $(field).val();
    newText = util.insert_at(newText, field.selectionStart, prepend);
    newText = util.insert_at(newText, field.selectionEnd + prepend.length, append);
    $(field).val(newText);
    focus.position_cursor(emptySelection ? end - append.length : end);
  }

  focus.set = function(zepto_selector) {
    if ($("#active").size() != 0) {
      $("#active").html(
        mil_markdown.htmlify_text_attributes($("#active").children("textarea").val())
      ).removeAttr("id");
    }

    zepto_selector.attr("id", "active").find(".collapse-expand").remove();
    var content = $("<div />").html(mil_markdown.markdownify_text_attributes($("#active").html())).text();
    $("#active").html($("<textarea type='text' placeholder='∇' rows='1'>" + content + "</textarea>"));
    focus.browser_focus_reset();
    //interface.recurrent(); // will add back in collapse/expand
    return true;
  };

  focus.browser_focus_reset = function(dont_reposition_cursor) {
    if (!$(document.activeElement).is("textarea") && !$(document.activeElement).is("input")) {
      if (!dont_reposition_cursor) { focus.position_cursor(10000); }
      focus.adjust_rows();
      $("#active textarea")[0].focus();
      return true;
    } else { return false; }
  };

  focus.set_delta = function(delta) {
    var nextItem = tree.directional_find("li", $("#active"), delta);
    if (!nextItem) { return false; }
    if (nextItem.parent().parent().is("li.collapsed")) {
      while (nextItem.parent().parent().is("li.collapsed")) {
        nextItem = tree.directional_find("li", nextItem.parent(), delta);
      }
    }
    if (!nextItem || !nextItem.is("li")) { return false; }
    return focus.set(nextItem);
  };

  focus.shift = function(delta) {
    var associated_nest = false,
    prepend = $("#active"),
    append  = $("#active");

    if ($($("#active").next().children()[0]).is("ul")) {
      associated_nest = $("#active").next();
      append = $("#active").next();
    }

    if (delta == -1) {
      if (!prepend.prev().length) { return false; }
      if ($(prepend.prev().children()[0]).is("ul")) { prepend= $(prepend).prev(); }
      $("#active").insertBefore(prepend.prev());
    } else {
      if (!append.next().length) { return false; }
      if ($(append.next().next().children()[0]).is("ul")) { append = $(append).next(); }
      $("#active").insertAfter(append.next());
    }
    $(associated_nest).insertAfter($("#active"));
    focus.browser_focus_reset();
    return true;
  };

  focus.indent = function(shift_up) {
    // Top of Tree
    if ($("#active").prev().size() == 0) { return false; }

    var nest = null;
    if ($($("#active").next().children()[0]).is("ul")) {
      nest = $("#active").next().wrap(globals.li_tag + "<ul>");
      shift_up = shift_up - 1;
    }

    // Shift up the active and its nest
    $("#active").wrap(globals.li_tag + "<ul>");
    tree.clean_tree();

    if (shift_up) {
      _.times(shift_up, function() {
        $("#active").prev().before($("#active"));
      });
    }
    if (nest) { $("#active").after(nest); }

    return true;
  };

  focus.undent = function() {
    // Top of the Tree
    if ($("#active").parent().parent().is("div")) { return false; }

    // Move around the Active and (its) nested list
    var associated_nest = null;
    if ($($("#active").next().children()[0]).is("ul")) { associated_nest = $("#active").next(); }
    $("#active").parent().parent().after($("#active"));
    if(associated_nest) { $("#active").after(associated_nest); }

    tree.clean_tree();
    $("#active textarea")[0].focus();
    return true;
  };

  return _.extend(my, { tree : tree, focus : focus });
}(mil_edit || {}));


code:
var mil_edit = (function(my) {
  var globals        = my.globals;
  var util           = my.util;
  var focus          = my.focus;
  var interface      = my.interface;
  var state          = my.state;
  var tree           = my.tree;
  var history        = my.history;

  var user_actions = new Object();

  user_actions.redo = function() {
    history.redo();
    return false;
  };
  user_actions.undo = function() {
    history.undo();
    return false;
  };
  user_actions.undent = function() {
    var restore_position = util.brother_elements_to_end($("#active"));
    history.do_action({undo: function() { return focus.indent(restore_position); }, redo: focus.undent});
    return false;
  };
  user_actions.indent = function() {
    history.do_action({undo: focus.undent, redo: focus.indent});
    focus.browser_focus_reset(true);
    return false;
  };
  user_actions.fold = function() {
    var old_state = state.dump_focus_state();
    history.do_action({
      undo : function() {
        if (interface.toggle_expand_collapse_current_position()) {
          state.load_focus_state(old_state);
          return true;
        } else { return false; }
      },
      redo : function() { return interface.toggle_expand_collapse_current_position(); }
    });

    return false;
  };
  user_actions.backspace = function() {
    if ($("#active").children("textarea").val() == "") {
      // we're all emptied out
      if ($(globals.root_selector).children().children().size() == 0) { return; }
      if ($("#active").parent().parent().is("div")) {
        var old_state = state.dump_state();
        history.do_action({
          undo : function() { state.load_state(old_state); },  //TODO inefficient
          redo : tree.delete_above
        });
      } else {
        var restore_position = util.brother_elements_to_end($("#active"));
        history.do_action({undo: function() { return focus.indent(restore_position); }, redo: focus.undent});
      }
      return false;
    } else {
      var focus_state = state.dump_state();
      history.do_action({
        undo : function() { return state.load_state(focus_state); },
        redo : function() { return my.event_handlers.simulate_key({ keyCode : 46 }); }
      });
      return true;
    }
  };

  user_actions.focus_up = function() {
    history.do_action({
      undo : function()  { return focus.set_delta(1); },
      redo : function() { return focus.set_delta(-1); }
    });
    return false;
  };
  user_actions.focus_down = function() {
    history.do_action({
      undo : function()  { return focus.set_delta(-1); },
      redo : function() { return focus.set_delta(1); }
    });
    return false;
  };
  user_actions.shift_up = function() {
    history.do_action({
      undo: function()  { return focus.shift(1);  },
      redo : function() { return focus.shift(-1); }
    });
    return false;
  };
  user_actions.shift_down = function() {
    history.do_action({
      undo : function()  { return focus.shift(-1);  },
      redo : function() { return focus.shift(1); }
    });
    return false;
  };
  user_actions.enter = function() {
    if ($($("#active").next().children()[0]).is("ul")) { // no action!
      // create a new brother under the nest
      var created_brother = null;
      var collapsed_nest = null;
      var focus_state = state.dump_focus_state();
      history.do_action({
        undo : function() {
          interface.expand_nest(collapsed_nest);
          $(created_brother).remove();
          return state.load_focus_state(focus_state);
        },
        redo : function() {
          collapsed_nest = $("#active").next();
          interface.collapse_nest(collapsed_nest);
          created_brother = tree.new_brother($("#active").next())
          return focus.set(created_brother);
        }
      });
    } else if ($("#active textarea").val() == "") {
      history.do_action({undo : focus.undent, redo : focus.indent});
    } else  {
      var focus_state = state.dump_focus_state();
      history.do_action({
        undo : function() {
          tree.delete_above();
          return state.load_focus_state(focus_state);
        },
        redo : function() {
          tree.insert_below();
          tree.clean_tree();
          return true;
        }
      });
    }
    return false;
  };
  user_actions.sidebar = function() {
    //history.do_action(interface.toggle_sidebar);
    interface.toggle_sidebar();
    return false;
  };
  user_actions.bold = function() {
    var focus_state = state.dump_focus_state();
    history.do_action({
      undo : function() { return state.load_focus_state(focus_state); },
      redo : function() { interface.bold(); return true; }
    });
    return false;
  };
  user_actions.italic = function() {
    var focus_state = state.dump_focus_state();
    history.do_action({
      undo : function() { return state.load_focus_state(focus_state); },
      redo : function() { interface.italic(); return true; }
    });
    return false;
  };
  user_actions.link = function() {
    var focus_state = state.dump_focus_state();
    history.do_action({
      undo : function() { return state.load_focus_state(focus_state); },
      redo : function() { interface.link(); return true; }
    });
    return false;
  };
  user_actions.clear = function() {
    var old_state = state.dump_state();
    history.do_action({
      undo : function() { return state.load_state(old_state); },
      redo : tree.clear
    });
    return false;
  };
  user_actions.right_arrow = function() {
    history.add_action({
      undo : function() { return focus.position_cursor_delta(-1);},
      redo : function() { return focus.position_cursor_delta(1); }
    });
    return true;
  };
  user_actions.left_arrow = function() {
    history.add_action({
      undo : function() { return focus.position_cursor_delta(1);  },
      redo : function() { return focus.position_cursor_delta(-1); }
    });
    return true;
  };

  // Buttons updated on each user action
  // Don't need to account for keybindings/ui buttons seperatly
  _.each(user_actions, function(old_callback,fn) {
    user_actions[fn] = function() {
      old_callback();
      interface.sync_ui_buttons();
    };
  });

  return _.extend(my, { user_actions : user_actions });
}(mil_edit || {}));


code:
var mil_edit = (function(my) {
  var globals = my.globals;
  var util = new Object();

  util.type = function(x) { return Object.prototype.toString.call(x); };
  // String Helpers and Manipulation
  util.number_of_matches = function(string, substring) {
    return string.split(substring).length - 1;
  };
  util.remove_at = function(str, pos, len) {
    if (!len) { len = 1; }
    return str.slice(0, pos) + str.slice(pos + len);
  }
  util.insert_at = function(str, pos, cha) {
    return str.slice(0, pos) + cha + str.slice(pos)
  }
  util.is_enclosed_by = function(string, position, delimiter) {
    total  = string.split(delimiter).length - 1;
    before = util.number_of_matches(string.slice(0, position), delimiter);
    after  = util.number_of_matches(string.slice(position), delimiter);
    if (total % 2 != 0) { total = total - 1; }
    return before % 2 != 0 && after % 2 != 0;
  }

  util.brother_elements_to_end = function(zepto_selector) {
    var count = 0;
    while (zepto_selector.next().length != 0) {
      zepto_selector = zepto_selector.next(); count++;
    }
    return count;
  }

  // Building atop Zepto
  util.set_class = function(zepto_selector, class_name, condition) {
    condition ? zepto_selector.addClass(class_name) : zepto_selector.removeClass(class_name);
  }
  util.is_editable = function(zepto_selector) {
    var firstChild = zepto_selector.children().first();
    if (firstChild.is("textarea") || firstChild.is("strong") || firstChild.is("em") || firstChild.is("a") || firstChild.is(".collapse-expand")) {
      return true; } else { return false; }
  }

  util.is_focused = function() {
    return $(globals.root).has(document.activeElement).length > 0 ? true : false;
  }

  util.focused_node = function() {
    if (document.selection) {
      return document.selection.createRange().parentElement();
    } else {
      var selection = window.getSelection();
      if (selection.rangeCount > 0) {
        return selection.getRangeAt(0).startContainer.parentNode;
      }
    }
  }

  return _.extend(my, { util : util });
}(mil_edit || {}));


code:
Copyright (c) 2008-2011 Pivotal Labs

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


code:
jasmine.HtmlReporterHelpers = {};

jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
  var el = document.createElement(type);

  for (var i = 2; i < arguments.length; i++) {
    var child = arguments[i];

    if (typeof child === 'string') {
      el.appendChild(document.createTextNode(child));
    } else {
      if (child) {
        el.appendChild(child);
      }
    }
  }

  for (var attr in attrs) {
    if (attr == "className") {
      el[attr] = attrs[attr];
    } else {
      el.setAttribute(attr, attrs[attr]);
    }
  }

  return el;
};

jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
  var results = child.results();
  var status = results.passed() ? 'passed' : 'failed';
  if (results.skipped) {
    status = 'skipped';
  }

  return status;
};

jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
  var parentDiv = this.dom.summary;
  var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
  var parent = child[parentSuite];

  if (parent) {
    if (typeof this.views.suites[parent.id] == 'undefined') {
      this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
    }
    parentDiv = this.views.suites[parent.id].element;
  }

  parentDiv.appendChild(childElement);
};

jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
  for(var fn in jasmine.HtmlReporterHelpers) {
    ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
  }
};

jasmine.HtmlReporter = function(_doc) {
  var self = this;
  var doc = _doc || window.document;

  var reporterView;

  var dom = {};

  // Jasmine Reporter Public Interface
  self.logRunningSpecs = false;

  self.reportRunnerStarting = function(runner) {
    var specs = runner.specs() || [];

    if (specs.length == 0) {
      return;
    }

    createReporterDom(runner.env.versionString());
    doc.body.appendChild(dom.reporter);
    setExceptionHandling();

    reporterView = new jasmine.HtmlReporter.ReporterView(dom);
    reporterView.addSpecs(specs, self.specFilter);
  };

  self.reportRunnerResults = function(runner) {
    reporterView && reporterView.complete();
  };

  self.reportSuiteResults = function(suite) {
    reporterView.suiteComplete(suite);
  };

  self.reportSpecStarting = function(spec) {
    if (self.logRunningSpecs) {
      self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
    }
  };

  self.reportSpecResults = function(spec) {
    reporterView.specComplete(spec);
  };

  self.log = function() {
    var console = jasmine.getGlobal().console;
    if (console && console.log) {
      if (console.log.apply) {
        console.log.apply(console, arguments);
      } else {
        console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
      }
    }
  };

  self.specFilter = function(spec) {
    if (!focusedSpecName()) {
      return true;
    }

    return spec.getFullName().indexOf(focusedSpecName()) === 0;
  };

  return self;

  function focusedSpecName() {
    var specName;

    (function memoizeFocusedSpec() {
      if (specName) {
        return;
      }

      var paramMap = [];
      var params = jasmine.HtmlReporter.parameters(doc);

      for (var i = 0; i < params.length; i++) {
        var p = params[i].split('=');
        paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
      }

      specName = paramMap.spec;
    })();

    return specName;
  }

  function createReporterDom(version) {
    dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
      dom.banner = self.createDom('div', { className: 'banner' },
        self.createDom('span', { className: 'title' }, "Jasmine "),
        self.createDom('span', { className: 'version' }, version)),

      dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
      dom.alert = self.createDom('div', {className: 'alert'},
        self.createDom('span', { className: 'exceptions' },
          self.createDom('label', { className: 'label', 'for': 'no_try_catch' }, 'No try/catch'),
          self.createDom('input', { id: 'no_try_catch', type: 'checkbox' }))),
      dom.results = self.createDom('div', {className: 'results'},
        dom.summary = self.createDom('div', { className: 'summary' }),
        dom.details = self.createDom('div', { id: 'details' }))
    );
  }

  function noTryCatch() {
    return window.location.search.match(/catch=false/);
  }

  function searchWithCatch() {
    var params = jasmine.HtmlReporter.parameters(window.document);
    var removed = false;
    var i = 0;

    while (!removed && i < params.length) {
      if (params[i].match(/catch=/)) {
        params.splice(i, 1);
        removed = true;
      }
      i++;
    }
    if (jasmine.CATCH_EXCEPTIONS) {
      params.push("catch=false");
    }

    return params.join("&");
  }

  function setExceptionHandling() {
    var chxCatch = document.getElementById('no_try_catch');

    if (noTryCatch()) {
      chxCatch.setAttribute('checked', true);
      jasmine.CATCH_EXCEPTIONS = false;
    }
    chxCatch.onclick = function() {
      window.location.search = searchWithCatch();
    };
  }
};
jasmine.HtmlReporter.parameters = function(doc) {
  var paramStr = doc.location.search.substring(1);
  var params = [];

  if (paramStr.length > 0) {
    params = paramStr.split('&');
  }
  return params;
}
jasmine.HtmlReporter.sectionLink = function(sectionName) {
  var link = '?';
  var params = [];

  if (sectionName) {
    params.push('spec=' + encodeURIComponent(sectionName));
  }
  if (!jasmine.CATCH_EXCEPTIONS) {
    params.push("catch=false");
  }
  if (params.length > 0) {
    link += params.join("&");
  }

  return link;
};
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);
jasmine.HtmlReporter.ReporterView = function(dom) {
  this.startedAt = new Date();
  this.runningSpecCount = 0;
  this.completeSpecCount = 0;
  this.passedCount = 0;
  this.failedCount = 0;
  this.skippedCount = 0;

  this.createResultsMenu = function() {
    this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
      this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
      ' | ',
      this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));

    this.summaryMenuItem.onclick = function() {
      dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
    };

    this.detailsMenuItem.onclick = function() {
      showDetails();
    };
  };

  this.addSpecs = function(specs, specFilter) {
    this.totalSpecCount = specs.length;

    this.views = {
      specs: {},
      suites: {}
    };

    for (var i = 0; i < specs.length; i++) {
      var spec = specs[i];
      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
      if (specFilter(spec)) {
        this.runningSpecCount++;
      }
    }
  };

  this.specComplete = function(spec) {
    this.completeSpecCount++;

    if (isUndefined(this.views.specs[spec.id])) {
      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
    }

    var specView = this.views.specs[spec.id];

    switch (specView.status()) {
      case 'passed':
        this.passedCount++;
        break;

      case 'failed':
        this.failedCount++;
        break;

      case 'skipped':
        this.skippedCount++;
        break;
    }

    specView.refresh();
    this.refresh();
  };

  this.suiteComplete = function(suite) {
    var suiteView = this.views.suites[suite.id];
    if (isUndefined(suiteView)) {
      return;
    }
    suiteView.refresh();
  };

  this.refresh = function() {

    if (isUndefined(this.resultsMenu)) {
      this.createResultsMenu();
    }

    // currently running UI
    if (isUndefined(this.runningAlert)) {
      this.runningAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "runningAlert bar" });
      dom.alert.appendChild(this.runningAlert);
    }
    this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);

    // skipped specs UI
    if (isUndefined(this.skippedAlert)) {
      this.skippedAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "skippedAlert bar" });
    }

    this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";

    if (this.skippedCount === 1 && isDefined(dom.alert)) {
      dom.alert.appendChild(this.skippedAlert);
    }

    // passing specs UI
    if (isUndefined(this.passedAlert)) {
      this.passedAlert = this.createDom('span', { href: jasmine.HtmlReporter.sectionLink(), className: "passingAlert bar" });
    }
    this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);

    // failing specs UI
    if (isUndefined(this.failedAlert)) {
      this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
    }
    this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);

    if (this.failedCount === 1 && isDefined(dom.alert)) {
      dom.alert.appendChild(this.failedAlert);
      dom.alert.appendChild(this.resultsMenu);
    }

    // summary info
    this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
    this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
  };

  this.complete = function() {
    dom.alert.removeChild(this.runningAlert);

    this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";

    if (this.failedCount === 0) {
      dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
    } else {
      showDetails();
    }

    dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
  };

  return this;

  function showDetails() {
    if (dom.reporter.className.search(/showDetails/) === -1) {
      dom.reporter.className += " showDetails";
    }
  }

  function isUndefined(obj) {
    return typeof obj === 'undefined';
  }

  function isDefined(obj) {
    return !isUndefined(obj);
  }

  function specPluralizedFor(count) {
    var str = count + " spec";
    if (count > 1) {
      str += "s"
    }
    return str;
  }

};

jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);

jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
  this.spec = spec;
  this.dom = dom;
  this.views = views;

  this.symbol = this.createDom('li', { className: 'pending' });
  this.dom.symbolSummary.appendChild(this.symbol);

  this.summary = this.createDom('div', { className: 'specSummary' },
    this.createDom('a', {
      className: 'description',
      href: jasmine.HtmlReporter.sectionLink(this.spec.getFullName()),
      title: this.spec.getFullName()
    }, this.spec.description)
  );

  this.detail = this.createDom('div', { className: 'specDetail' },
      this.createDom('a', {
        className: 'description',
        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
        title: this.spec.getFullName()
      }, this.spec.getFullName())
  );
};

jasmine.HtmlReporter.SpecView.prototype.status = function() {
  return this.getSpecStatus(this.spec);
};

jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
  this.symbol.className = this.status();

  switch (this.status()) {
    case 'skipped':
      break;

    case 'passed':
      this.appendSummaryToSuiteDiv();
      break;

    case 'failed':
      this.appendSummaryToSuiteDiv();
      this.appendFailureDetail();
      break;
  }
};

jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
  this.summary.className += ' ' + this.status();
  this.appendToSummary(this.spec, this.summary);
};

jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
  this.detail.className += ' ' + this.status();

  var resultItems = this.spec.results().getItems();
  var messagesDiv = this.createDom('div', { className: 'messages' });

  for (var i = 0; i < resultItems.length; i++) {
    var result = resultItems[i];

    if (result.type == 'log') {
      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
    } else if (result.type == 'expect' && result.passed && !result.passed()) {
      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));

      if (result.trace.stack) {
        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
      }
    }
  }

  if (messagesDiv.childNodes.length > 0) {
    this.detail.appendChild(messagesDiv);
    this.dom.details.appendChild(this.detail);
  }
};

jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
  this.suite = suite;
  this.dom = dom;
  this.views = views;

  this.element = this.createDom('div', { className: 'suite' },
    this.createDom('a', { className: 'description', href: jasmine.HtmlReporter.sectionLink(this.suite.getFullName()) }, this.suite.description)
  );

  this.appendToSummary(this.suite, this.element);
};

jasmine.HtmlReporter.SuiteView.prototype.status = function() {
  return this.getSpecStatus(this.suite);
};

jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
  this.element.className += " " + this.status();
};

jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);

/* @deprecated Use jasmine.HtmlReporter instead
 */
jasmine.TrivialReporter = function(doc) {
  this.document = doc || document;
  this.suiteDivs = {};
  this.logRunningSpecs = false;
};

jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
  var el = document.createElement(type);

  for (var i = 2; i < arguments.length; i++) {
    var child = arguments[i];

    if (typeof child === 'string') {
      el.appendChild(document.createTextNode(child));
    } else {
      if (child) { el.appendChild(child); }
    }
  }

  for (var attr in attrs) {
    if (attr == "className") {
      el[attr] = attrs[attr];
    } else {
      el.setAttribute(attr, attrs[attr]);
    }
  }

  return el;
};

jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
  var showPassed, showSkipped;

  this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
      this.createDom('div', { className: 'banner' },
        this.createDom('div', { className: 'logo' },
            this.createDom('span', { className: 'title' }, "Jasmine"),
            this.createDom('span', { className: 'version' }, runner.env.versionString())),
        this.createDom('div', { className: 'options' },
            "Show ",
            showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
            this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
            showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
            this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
            )
          ),

      this.runnerDiv = this.createDom('div', { className: 'runner running' },
          this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
          this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
          this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
      );

  this.document.body.appendChild(this.outerDiv);

  var suites = runner.suites();
  for (var i = 0; i < suites.length; i++) {
    var suite = suites[i];
    var suiteDiv = this.createDom('div', { className: 'suite' },
        this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
        this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
    this.suiteDivs[suite.id] = suiteDiv;
    var parentDiv = this.outerDiv;
    if (suite.parentSuite) {
      parentDiv = this.suiteDivs[suite.parentSuite.id];
    }
    parentDiv.appendChild(suiteDiv);
  }

  this.startedAt = new Date();

  var self = this;
  showPassed.onclick = function(evt) {
    if (showPassed.checked) {
      self.outerDiv.className += ' show-passed';
    } else {
      self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
    }
  };

  showSkipped.onclick = function(evt) {
    if (showSkipped.checked) {
      self.outerDiv.className += ' show-skipped';
    } else {
      self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
    }
  };
};

jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
  var results = runner.results();
  var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
  this.runnerDiv.setAttribute("class", className);
  //do it twice for IE
  this.runnerDiv.setAttribute("className", className);
  var specs = runner.specs();
  var specCount = 0;
  for (var i = 0; i < specs.length; i++) {
    if (this.specFilter(specs[i])) {
      specCount++;
    }
  }
  var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
  message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
  this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);

  this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
};

jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
  var results = suite.results();
  var status = results.passed() ? 'passed' : 'failed';
  if (results.totalCount === 0) { // todo: change this to check results.skipped
    status = 'skipped';
  }
  this.suiteDivs[suite.id].className += " " + status;
};

jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
  if (this.logRunningSpecs) {
    this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
  }
};

jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
  var results = spec.results();
  var status = results.passed() ? 'passed' : 'failed';
  if (results.skipped) {
    status = 'skipped';
  }
  var specDiv = this.createDom('div', { className: 'spec '  + status },
      this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
      this.createDom('a', {
        className: 'description',
        href: '?spec=' + encodeURIComponent(spec.getFullName()),
        title: spec.getFullName()
      }, spec.description));

  var resultItems = results.getItems();
  var messagesDiv = this.createDom('div', { className: 'messages' });
  for (var i = 0; i < resultItems.length; i++) {
    var result = resultItems[i];

    if (result.type == 'log') {
      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
    } else if (result.type == 'expect' && result.passed && !result.passed()) {
      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));

      if (result.trace.stack) {
        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
      }
    }
  }

  if (messagesDiv.childNodes.length > 0) {
    specDiv.appendChild(messagesDiv);
  }

  this.suiteDivs[spec.suite.id].appendChild(specDiv);
};

jasmine.TrivialReporter.prototype.log = function() {
  var console = jasmine.getGlobal().console;
  if (console && console.log) {
    if (console.log.apply) {
      console.log.apply(console, arguments);
    } else {
      console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
    }
  }
};

jasmine.TrivialReporter.prototype.getLocation = function() {
  return this.document.location;
};

jasmine.TrivialReporter.prototype.specFilter = function(spec) {
  var paramMap = {};
  var params = this.getLocation().search.substring(1).split('&');
  for (var i = 0; i < params.length; i++) {
    var p = params[i].split('=');
    paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
  }

  if (!paramMap.spec) {
    return true;
  }
  return spec.getFullName().indexOf(paramMap.spec) === 0;
};


code:
body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }

#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
#HTMLReporter a { text-decoration: none; }
#HTMLReporter a:hover { text-decoration: underline; }
#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
#HTMLReporter #jasmine_content { position: fixed; right: 100%; }
#HTMLReporter .version { color: #aaaaaa; }
#HTMLReporter .banner { margin-top: 14px; }
#HTMLReporter .duration { color: #aaaaaa; float: right; }
#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
#HTMLReporter .symbolSummary li.passed { font-size: 14px; }
#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
#HTMLReporter .symbolSummary li.failed { line-height: 9px; }
#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
#HTMLReporter .symbolSummary li.pending { line-height: 11px; }
#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
#HTMLReporter .exceptions { color: #fff; float: right; margin-top: 5px; margin-right: 5px; }
#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
#HTMLReporter .runningAlert { background-color: #666666; }
#HTMLReporter .skippedAlert { background-color: #aaaaaa; }
#HTMLReporter .skippedAlert:first-child { background-color: #333333; }
#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
#HTMLReporter .passingAlert { background-color: #a6b779; }
#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
#HTMLReporter .failingAlert { background-color: #cf867e; }
#HTMLReporter .failingAlert:first-child { background-color: #b03911; }
#HTMLReporter .results { margin-top: 14px; }
#HTMLReporter #details { display: none; }
#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
#HTMLReporter.showDetails .summary { display: none; }
#HTMLReporter.showDetails #details { display: block; }
#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
#HTMLReporter .summary { margin-top: 14px; }
#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
#HTMLReporter .summary .specSummary.failed a { color: #b03911; }
#HTMLReporter .description + .suite { margin-top: 0; }
#HTMLReporter .suite { margin-top: 14px; }
#HTMLReporter .suite a { color: #333333; }
#HTMLReporter #details .specDetail { margin-bottom: 28px; }
#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
#HTMLReporter .resultMessage span.result { display: block; }
#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }

#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
#TrivialReporter a:visited, #TrivialReporter a { color: #303; }
#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
#TrivialReporter .runner.running { background-color: yellow; }
#TrivialReporter .options { text-align: right; font-size: .8em; }
#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
#TrivialReporter .suite .suite { margin: 5px; }
#TrivialReporter .suite.passed { background-color: #dfd; }
#TrivialReporter .suite.failed { background-color: #fdd; }
#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
#TrivialReporter .spec.skipped { background-color: #bbb; }
#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
#TrivialReporter .passed { background-color: #cfc; display: none; }
#TrivialReporter .failed { background-color: #fbb; }
#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
#TrivialReporter .resultMessage .mismatch { color: black; }
#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
#TrivialReporter #jasmine_content { position: fixed; right: 100%; }
#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }