couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ryanram...@apache.org
Subject [09/51] [partial] Restructure to simpler jam/erica style.
Date Sat, 11 May 2013 05:48:22 GMT
http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/less/tests/forms.html
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/less/tests/forms.html b/src/fauxton/jam/bootstrap/less/tests/forms.html
new file mode 100644
index 0000000..a63d728
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/less/tests/forms.html
@@ -0,0 +1,179 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <title>Bootstrap, from Twitter</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <!-- Le styles -->
+    <link href="../../docs/assets/css/bootstrap.css" rel="stylesheet">
+    <link href="../../docs/assets/css/bootstrap-responsive.css" rel="stylesheet">
+    <style>
+      body {
+        padding-top: 30px;
+        padding-bottom: 30px;
+      }
+    </style>
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    <!-- Le fav and touch icons -->
+    <link rel="shortcut icon" href="../../docs/assets/ico/favicon.ico">
+    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../docs/assets/ico/apple-touch-icon-144-precomposed.png">
+    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../docs/assets/ico/apple-touch-icon-114-precomposed.png">
+    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../docs/assets/ico/apple-touch-icon-72-precomposed.png">
+    <link rel="apple-touch-icon-precomposed" href="../../docs/assets/ico/apple-touch-icon-57-precomposed.png">
+  </head>
+
+  <body>
+
+    <form class="container">
+
+      <div class="page-header">
+        <h1>Form controls</h1>
+      </div>
+
+      <div class="row">
+        <div class="span4">
+
+          <label>Select</label>
+          <select>
+            <option>Select</option>
+            <option>Option 2</option>
+            <option>Option 3</option>
+          </select>
+
+          <hr>
+
+          <label>textarea</label>
+          <textarea>Textarea</textarea>
+
+          <hr>
+
+          <label>text</label>
+          <input type="text" value="Text input">
+
+          <hr>
+
+          <label>password</label>
+          <input type="password" value="Password input">
+
+          <hr>
+
+          <label>checkbox</label>
+          <input type="checkbox" value="">
+
+          <hr>
+
+          <label>radio</label>
+          <input type="radio" value="">
+
+          <hr>
+
+          <label>button</label>
+          <input type="button" value="Button">
+
+          <hr>
+
+          <label>submit</label>
+          <input type="submit" value="Submit">
+
+          <hr>
+
+          <label>reset</label>
+          <input type="reset" value="Reset">
+
+        </div><!-- /span4 -->
+        <div class="span4">
+
+          <label>file</label>
+          <input type="file" value="">
+
+          <hr>
+
+          <label>hidden</label>
+          <input type="hidden" value="hidden">
+
+          <hr>
+
+          <label>image</label>
+          <input type="image" value="">
+
+          <hr>
+
+          <label>datetime</label>
+          <input type="datetime" value="">
+
+          <hr>
+
+          <label>datetime-local</label>
+          <input type="datetime-local" value="">
+
+          <hr>
+
+          <label>date</label>
+          <input type="date" value="">
+
+          <hr>
+
+          <label>month</label>
+          <input type="month" value="">
+
+          <hr>
+
+          <label>time</label>
+          <input type="time" value="">
+
+          <hr>
+
+          <label>week</label>
+          <input type="week" value="">
+
+        </div><!-- /span4 -->
+        <div class="span4">
+
+          <label>number</label>
+          <input type="number" value="">
+
+          <hr>
+
+          <label>range</label>
+          <input type="range" value="">
+
+          <hr>
+
+          <label>email</label>
+          <input type="email" value="">
+
+          <hr>
+
+          <label>url</label>
+          <input type="url" value="">
+
+          <hr>
+
+          <label>search</label>
+          <input type="search" value="">
+
+          <hr>
+
+          <label>tel</label>
+          <input type="tel" value="">
+
+          <hr>
+
+          <label>color</label>
+          <input type="color" value="">
+
+        </div><!-- /span4 -->
+      </div><!-- /row -->
+
+    </form> <!-- /container -->
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/less/tests/navbar-fixed-top.html
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/less/tests/navbar-fixed-top.html b/src/fauxton/jam/bootstrap/less/tests/navbar-fixed-top.html
new file mode 100644
index 0000000..2d9a7a7
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/less/tests/navbar-fixed-top.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <title>Bootstrap, from Twitter</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <!-- Le styles -->
+    <link href="../../docs/assets/css/bootstrap.css" rel="stylesheet">
+    <style>
+      body {
+        padding-top: 60px;
+        padding-bottom: 30px;
+      }
+    </style>
+    <link href="../../docs/assets/css/bootstrap-responsive.css" rel="stylesheet">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    <!-- Le fav and touch icons -->
+    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../docs/assets/ico/apple-touch-icon-144-precomposed.png">
+    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../docs/assets/ico/apple-touch-icon-114-precomposed.png">
+      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../docs/assets/ico/apple-touch-icon-72-precomposed.png">
+                    <link rel="apple-touch-icon-precomposed" href="../../docs/assets/ico/apple-touch-icon-57-precomposed.png">
+                                   <link rel="shortcut icon" href="../../docs/assets/ico/favicon.png">
+  </head>
+
+  <body>
+
+    <!-- Fixed navbar -->
+    <div class="navbar navbar-fixed-top">
+      <div class="navbar-inner">
+        <div class="container">
+          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+          </a>
+          <a class="brand" href="#">Project name</a>
+          <div class="nav-collapse collapse">
+            <ul class="nav">
+              <li class="active"><a href="#">Home</a></li>
+              <li><a href="#about">About</a></li>
+              <li><a href="#contact">Contact</a></li>
+              <li class="dropdown">
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
+                <ul class="dropdown-menu">
+                  <li><a href="#">Action</a></li>
+                  <li><a href="#">Another action</a></li>
+                  <li><a href="#">Something else here</a></li>
+                  <li class="divider"></li>
+                  <li class="nav-header">Nav header</li>
+                  <li><a href="#">Separated link</a></li>
+                  <li><a href="#">One more separated link</a></li>
+                </ul>
+              </li>
+            </ul>
+            <ul class="nav pull-right">
+              <li><a href="./navbar.html">Default</a></li>
+              <li><a href="./navbar-static-top.html">Static top</a></li>
+              <li class="active"><a href="./navbar-fixed-top.html">Fixed top</a></li>
+            </ul>
+          </div><!--/.nav-collapse -->
+        </div>
+      </div>
+    </div>
+
+    <div class="container">
+
+      <!-- Main hero unit for a primary marketing message or call to action -->
+      <div class="hero-unit">
+        <h1>Navbar example</h1>
+        <p>This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.</p>
+        <p>
+          <a class="btn btn-large btn-primary" href="../components.html#navbar">View navbar docs &raquo;</a>
+        </p>
+      </div>
+
+    </div> <!-- /container -->
+
+    <!-- Le javascript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <script src="../../docs/assets/js/jquery.js"></script>
+    <script src="../../docs/assets/js/bootstrap-transition.js"></script>
+    <script src="../../docs/assets/js/bootstrap-alert.js"></script>
+    <script src="../../docs/assets/js/bootstrap-modal.js"></script>
+    <script src="../../docs/assets/js/bootstrap-dropdown.js"></script>
+    <script src="../../docs/assets/js/bootstrap-scrollspy.js"></script>
+    <script src="../../docs/assets/js/bootstrap-tab.js"></script>
+    <script src="../../docs/assets/js/bootstrap-tooltip.js"></script>
+    <script src="../../docs/assets/js/bootstrap-popover.js"></script>
+    <script src="../../docs/assets/js/bootstrap-button.js"></script>
+    <script src="../../docs/assets/js/bootstrap-collapse.js"></script>
+    <script src="../../docs/assets/js/bootstrap-carousel.js"></script>
+    <script src="../../docs/assets/js/bootstrap-typeahead.js"></script>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/less/tests/navbar-static-top.html
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/less/tests/navbar-static-top.html b/src/fauxton/jam/bootstrap/less/tests/navbar-static-top.html
new file mode 100644
index 0000000..4bead8e
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/less/tests/navbar-static-top.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <title>Bootstrap, from Twitter</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <!-- Le styles -->
+    <link href="../../docs/assets/css/bootstrap.css" rel="stylesheet">
+    <style>
+      body {
+        padding-bottom: 30px;
+      }
+      .hero-unit {
+        margin-top: 20px;
+      }
+    </style>
+    <link href="../../docs/assets/css/bootstrap-responsive.css" rel="stylesheet">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    <!-- Le fav and touch icons -->
+    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../docs/assets/ico/apple-touch-icon-144-precomposed.png">
+    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../docs/assets/ico/apple-touch-icon-114-precomposed.png">
+      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../docs/assets/ico/apple-touch-icon-72-precomposed.png">
+                    <link rel="apple-touch-icon-precomposed" href="../../docs/assets/ico/apple-touch-icon-57-precomposed.png">
+                                   <link rel="shortcut icon" href="../../docs/assets/ico/favicon.png">
+  </head>
+
+  <body>
+
+    <!-- Static navbar -->
+    <div class="navbar navbar-static-top">
+      <div class="navbar-inner">
+        <div class="container">
+          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+          </a>
+          <a class="brand" href="#">Project name</a>
+          <div class="nav-collapse collapse">
+            <ul class="nav">
+              <li class="active"><a href="#">Home</a></li>
+              <li><a href="#about">About</a></li>
+              <li><a href="#contact">Contact</a></li>
+              <li class="dropdown">
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
+                <ul class="dropdown-menu">
+                  <li><a href="#">Action</a></li>
+                  <li><a href="#">Another action</a></li>
+                  <li><a href="#">Something else here</a></li>
+                  <li class="divider"></li>
+                  <li class="nav-header">Nav header</li>
+                  <li><a href="#">Separated link</a></li>
+                  <li><a href="#">One more separated link</a></li>
+                </ul>
+              </li>
+            </ul>
+          <ul class="nav pull-right">
+            <li><a href="./navbar.html">Default</a></li>
+            <li class="active"><a href="./navbar-static-top.html">Static top</a></li>
+            <li><a href="./navbar-fixed-top.html">Fixed top</a></li>
+          </ul>
+          </div><!--/.nav-collapse -->
+        </div>
+      </div>
+    </div>
+
+
+    <div class="container">
+
+      <!-- Main hero unit for a primary marketing message or call to action -->
+      <div class="hero-unit">
+        <h1>Navbar example</h1>
+        <p>This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.</p>
+        <p>
+          <a class="btn btn-large btn-primary" href="../components.html#navbar">View navbar docs &raquo;</a>
+        </p>
+      </div>
+
+    </div> <!-- /container -->
+
+    <!-- Le javascript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <script src="../../docs/assets/js/jquery.js"></script>
+    <script src="../../docs/assets/js/bootstrap-transition.js"></script>
+    <script src="../../docs/assets/js/bootstrap-alert.js"></script>
+    <script src="../../docs/assets/js/bootstrap-modal.js"></script>
+    <script src="../../docs/assets/js/bootstrap-dropdown.js"></script>
+    <script src="../../docs/assets/js/bootstrap-scrollspy.js"></script>
+    <script src="../../docs/assets/js/bootstrap-tab.js"></script>
+    <script src="../../docs/assets/js/bootstrap-tooltip.js"></script>
+    <script src="../../docs/assets/js/bootstrap-popover.js"></script>
+    <script src="../../docs/assets/js/bootstrap-button.js"></script>
+    <script src="../../docs/assets/js/bootstrap-collapse.js"></script>
+    <script src="../../docs/assets/js/bootstrap-carousel.js"></script>
+    <script src="../../docs/assets/js/bootstrap-typeahead.js"></script>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/less/tests/navbar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/less/tests/navbar.html b/src/fauxton/jam/bootstrap/less/tests/navbar.html
new file mode 100644
index 0000000..d5ad478
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/less/tests/navbar.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <title>Bootstrap, from Twitter</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <!-- Le styles -->
+    <link href="../../docs/assets/css/bootstrap.css" rel="stylesheet">
+    <style>
+      body {
+        padding-top: 0;
+        padding-bottom: 30px;
+      }
+      .navbar {
+        margin-top: 20px;
+      }
+    </style>
+    <link href="../../docs/assets/css/bootstrap-responsive.css" rel="stylesheet">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    <!-- Le fav and touch icons -->
+    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../docs/assets/ico/apple-touch-icon-144-precomposed.png">
+    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../docs/assets/ico/apple-touch-icon-114-precomposed.png">
+      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../docs/assets/ico/apple-touch-icon-72-precomposed.png">
+                    <link rel="apple-touch-icon-precomposed" href="../../docs/assets/ico/apple-touch-icon-57-precomposed.png">
+                                   <link rel="shortcut icon" href="../../docs/assets/ico/favicon.png">
+  </head>
+
+  <body>
+
+    <div class="container">
+
+      <!-- Static navbar -->
+      <div class="navbar">
+        <div class="navbar-inner">
+          <div class="container">
+            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+              <span class="icon-bar"></span>
+              <span class="icon-bar"></span>
+              <span class="icon-bar"></span>
+            </a>
+            <a class="brand" href="#">Project name</a>
+            <div class="nav-collapse collapse">
+              <ul class="nav">
+                <li class="active"><a href="#">Home</a></li>
+                <li><a href="#about">About</a></li>
+                <li><a href="#contact">Contact</a></li>
+                <li class="dropdown">
+                  <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
+                  <ul class="dropdown-menu">
+                    <li><a href="#">Action</a></li>
+                    <li><a href="#">Another action</a></li>
+                    <li><a href="#">Something else here</a></li>
+                    <li class="divider"></li>
+                    <li class="nav-header">Nav header</li>
+                    <li><a href="#">Separated link</a></li>
+                    <li><a href="#">One more separated link</a></li>
+                  </ul>
+                </li>
+              </ul>
+              <ul class="nav pull-right">
+                <li class="active"><a href="./navbar.html">Default</a></li>
+                <li><a href="./navbar-static-top.html">Static top</a></li>
+                <li><a href="./navbar-fixed-top.html">Fixed top</a></li>
+              </ul>
+            </div><!--/.nav-collapse -->
+          </div>
+        </div>
+      </div>
+
+      <!-- Main hero unit for a primary marketing message or call to action -->
+      <div class="hero-unit">
+        <h1>Navbar example</h1>
+        <p>This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.</p>
+        <p>
+          <a class="btn btn-large btn-primary" href="../components.html#navbar">View navbar docs &raquo;</a>
+        </p>
+      </div>
+
+    </div> <!-- /container -->
+
+    <!-- Le javascript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <script src="../../docs/assets/js/jquery.js"></script>
+    <script src="../../docs/assets/js/bootstrap-transition.js"></script>
+    <script src="../../docs/assets/js/bootstrap-alert.js"></script>
+    <script src="../../docs/assets/js/bootstrap-modal.js"></script>
+    <script src="../../docs/assets/js/bootstrap-dropdown.js"></script>
+    <script src="../../docs/assets/js/bootstrap-scrollspy.js"></script>
+    <script src="../../docs/assets/js/bootstrap-tab.js"></script>
+    <script src="../../docs/assets/js/bootstrap-tooltip.js"></script>
+    <script src="../../docs/assets/js/bootstrap-popover.js"></script>
+    <script src="../../docs/assets/js/bootstrap-button.js"></script>
+    <script src="../../docs/assets/js/bootstrap-collapse.js"></script>
+    <script src="../../docs/assets/js/bootstrap-carousel.js"></script>
+    <script src="../../docs/assets/js/bootstrap-typeahead.js"></script>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/less/thumbnails.less
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/less/thumbnails.less b/src/fauxton/jam/bootstrap/less/thumbnails.less
new file mode 100644
index 0000000..a84a7d3
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/less/thumbnails.less
@@ -0,0 +1,52 @@
+//
+// Thumbnails
+// --------------------------------------------------
+
+
+// Note: `.thumbnails` and `.thumbnails > li` are overriden in responsive files
+
+// Make wrapper ul behave like the grid
+.thumbnails {
+  margin-left: -@gridGutterWidth;
+  list-style: none;
+  .clearfix();
+}
+// Fluid rows have no left margin
+.row-fluid .thumbnails {
+  margin-left: 0;
+}
+
+// Float li to make thumbnails appear in a row
+.thumbnails > li {
+  float: left; // Explicity set the float since we don't require .span* classes
+  margin-bottom: @baseLineHeight;
+  margin-left: @gridGutterWidth;
+}
+
+// The actual thumbnail (can be `a` or `div`)
+.thumbnail {
+  display: block;
+  padding: 4px;
+  line-height: @baseLineHeight;
+  border: 1px solid #ddd;
+  .border-radius(@baseBorderRadius);
+  .box-shadow(0 1px 3px rgba(0,0,0,.055));
+  .transition(all .2s ease-in-out);
+}
+// Add a hover state for linked versions only
+a.thumbnail:hover {
+  border-color: @linkColor;
+  .box-shadow(0 1px 4px rgba(0,105,214,.25));
+}
+
+// Images and captions
+.thumbnail > img {
+  display: block;
+  max-width: 100%;
+  margin-left: auto;
+  margin-right: auto;
+}
+.thumbnail .caption {
+  padding: 9px;
+  color: @gray;
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/less/tooltip.less
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/less/tooltip.less b/src/fauxton/jam/bootstrap/less/tooltip.less
new file mode 100644
index 0000000..93fac8d
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/less/tooltip.less
@@ -0,0 +1,70 @@
+//
+// Tooltips
+// --------------------------------------------------
+
+
+// Base class
+.tooltip {
+  position: absolute;
+  z-index: @zindexTooltip;
+  display: block;
+  visibility: visible;
+  padding: 5px;
+  font-size: 11px;
+  .opacity(0);
+  &.in     { .opacity(80); }
+  &.top    { margin-top:  -3px; }
+  &.right  { margin-left:  3px; }
+  &.bottom { margin-top:   3px; }
+  &.left   { margin-left: -3px; }
+}
+
+// Wrapper for the tooltip content
+.tooltip-inner {
+  max-width: 200px;
+  padding: 3px 8px;
+  color: @tooltipColor;
+  text-align: center;
+  text-decoration: none;
+  background-color: @tooltipBackground;
+  .border-radius(@baseBorderRadius);
+}
+
+// Arrows
+.tooltip-arrow {
+  position: absolute;
+  width: 0;
+  height: 0;
+  border-color: transparent;
+  border-style: solid;
+}
+.tooltip {
+  &.top .tooltip-arrow {
+    bottom: 0;
+    left: 50%;
+    margin-left: -@tooltipArrowWidth;
+    border-width: @tooltipArrowWidth @tooltipArrowWidth 0;
+    border-top-color: @tooltipArrowColor;
+  }
+  &.right .tooltip-arrow {
+    top: 50%;
+    left: 0;
+    margin-top: -@tooltipArrowWidth;
+    border-width: @tooltipArrowWidth @tooltipArrowWidth @tooltipArrowWidth 0;
+    border-right-color: @tooltipArrowColor;
+  }
+  &.left .tooltip-arrow {
+    top: 50%;
+    right: 0;
+    margin-top: -@tooltipArrowWidth;
+    border-width: @tooltipArrowWidth 0 @tooltipArrowWidth @tooltipArrowWidth;
+    border-left-color: @tooltipArrowColor;
+  }
+  &.bottom .tooltip-arrow {
+    top: 0;
+    left: 50%;
+    margin-left: -@tooltipArrowWidth;
+    border-width: 0 @tooltipArrowWidth @tooltipArrowWidth;
+    border-bottom-color: @tooltipArrowColor;
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/less/type.less
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/less/type.less b/src/fauxton/jam/bootstrap/less/type.less
new file mode 100644
index 0000000..683a307
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/less/type.less
@@ -0,0 +1,235 @@
+//
+// Typography
+// --------------------------------------------------
+
+
+// Body text
+// -------------------------
+
+p {
+  margin: 0 0 @baseLineHeight / 2;
+}
+.lead {
+  margin-bottom: @baseLineHeight;
+  font-size: @baseFontSize * 1.5;
+  font-weight: 200;
+  line-height: @baseLineHeight * 1.5;
+}
+
+
+// Emphasis & misc
+// -------------------------
+
+// Ex: 14px base font * 85% = about 12px
+small   { font-size: 85%; }
+
+strong  { font-weight: bold; }
+em      { font-style: italic; }
+cite    { font-style: normal; }
+
+// Utility classes
+.muted               { color: @grayLight; }
+a.muted:hover        { color: darken(@grayLight, 10%); }
+
+.text-warning        { color: @warningText; }
+a.text-warning:hover { color: darken(@warningText, 10%); }
+
+.text-error          { color: @errorText; }
+a.text-error:hover   { color: darken(@errorText, 10%); }
+
+.text-info           { color: @infoText; }
+a.text-info:hover    { color: darken(@infoText, 10%); }
+
+.text-success        { color: @successText; }
+a.text-success:hover { color: darken(@successText, 10%); }
+
+
+// Headings
+// -------------------------
+
+h1, h2, h3, h4, h5, h6 {
+  margin: (@baseLineHeight / 2) 0;
+  font-family: @headingsFontFamily;
+  font-weight: @headingsFontWeight;
+  line-height: @baseLineHeight;
+  color: @headingsColor;
+  text-rendering: optimizelegibility; // Fix the character spacing for headings
+  small {
+    font-weight: normal;
+    line-height: 1;
+    color: @grayLight;
+  }
+}
+
+h1,
+h2,
+h3 { line-height: @baseLineHeight * 2; }
+
+h1 { font-size: @baseFontSize * 2.75; } // ~38px
+h2 { font-size: @baseFontSize * 2.25; } // ~32px
+h3 { font-size: @baseFontSize * 1.75; } // ~24px
+h4 { font-size: @baseFontSize * 1.25; } // ~18px
+h5 { font-size: @baseFontSize; }
+h6 { font-size: @baseFontSize * 0.85; } // ~12px
+
+h1 small { font-size: @baseFontSize * 1.75; } // ~24px
+h2 small { font-size: @baseFontSize * 1.25; } // ~18px
+h3 small { font-size: @baseFontSize; }
+h4 small { font-size: @baseFontSize; }
+
+
+// Page header
+// -------------------------
+
+.page-header {
+  padding-bottom: (@baseLineHeight / 2) - 1;
+  margin: @baseLineHeight 0 (@baseLineHeight * 1.5);
+  border-bottom: 1px solid @grayLighter;
+}
+
+
+
+// Lists
+// --------------------------------------------------
+
+// Unordered and Ordered lists
+ul, ol {
+  padding: 0;
+  margin: 0 0 @baseLineHeight / 2 25px;
+}
+ul ul,
+ul ol,
+ol ol,
+ol ul {
+  margin-bottom: 0;
+}
+li {
+  line-height: @baseLineHeight;
+}
+
+// Remove default list styles
+ul.unstyled,
+ol.unstyled {
+  margin-left: 0;
+  list-style: none;
+}
+
+// Single-line list items
+ul.inline,
+ol.inline {
+  margin-left: 0;
+  list-style: none;
+  & > li {
+    display: inline-block;
+    padding-left: 5px;
+    padding-right: 5px;
+  }
+}
+
+// Description Lists
+dl {
+  margin-bottom: @baseLineHeight;
+}
+dt,
+dd {
+  line-height: @baseLineHeight;
+}
+dt {
+  font-weight: bold;
+}
+dd {
+  margin-left: @baseLineHeight / 2;
+}
+// Horizontal layout (like forms)
+.dl-horizontal {
+  .clearfix(); // Ensure dl clears floats if empty dd elements present
+  dt {
+    float: left;
+    width: @horizontalComponentOffset - 20;
+    clear: left;
+    text-align: right;
+    .text-overflow();
+  }
+  dd {
+    margin-left: @horizontalComponentOffset;
+  }
+}
+
+// MISC
+// ----
+
+// Horizontal rules
+hr {
+  margin: @baseLineHeight 0;
+  border: 0;
+  border-top: 1px solid @hrBorder;
+  border-bottom: 1px solid @white;
+}
+
+// Abbreviations and acronyms
+abbr[title],
+// Added data-* attribute to help out our tooltip plugin, per https://github.com/twitter/bootstrap/issues/5257
+abbr[data-original-title] {
+  cursor: help;
+  border-bottom: 1px dotted @grayLight;
+}
+abbr.initialism {
+  font-size: 90%;
+  text-transform: uppercase;
+}
+
+// Blockquotes
+blockquote {
+  padding: 0 0 0 15px;
+  margin: 0 0 @baseLineHeight;
+  border-left: 5px solid @grayLighter;
+  p {
+    margin-bottom: 0;
+    #font > .shorthand(16px,300,@baseLineHeight * 1.25);
+  }
+  small {
+    display: block;
+    line-height: @baseLineHeight;
+    color: @grayLight;
+    &:before {
+      content: '\2014 \00A0';
+    }
+  }
+
+  // Float right with text-align: right
+  &.pull-right {
+    float: right;
+    padding-right: 15px;
+    padding-left: 0;
+    border-right: 5px solid @grayLighter;
+    border-left: 0;
+    p,
+    small {
+      text-align: right;
+    }
+    small {
+      &:before {
+        content: '';
+      }
+      &:after {
+        content: '\00A0 \2014';
+      }
+    }
+  }
+}
+
+// Quotes
+q:before,
+q:after,
+blockquote:before,
+blockquote:after {
+  content: "";
+}
+
+// Addresses
+address {
+  display: block;
+  margin-bottom: @baseLineHeight;
+  font-style: normal;
+  line-height: @baseLineHeight;
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/less/utilities.less
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/less/utilities.less b/src/fauxton/jam/bootstrap/less/utilities.less
new file mode 100644
index 0000000..314b4ff
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/less/utilities.less
@@ -0,0 +1,30 @@
+//
+// Utility classes
+// --------------------------------------------------
+
+
+// Quick floats
+.pull-right {
+  float: right;
+}
+.pull-left {
+  float: left;
+}
+
+// Toggling content
+.hide {
+  display: none;
+}
+.show {
+  display: block;
+}
+
+// Visibility
+.invisible {
+  visibility: hidden;
+}
+
+// For Affix plugin
+.affix {
+  position: fixed;
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/less/variables.less
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/less/variables.less b/src/fauxton/jam/bootstrap/less/variables.less
new file mode 100644
index 0000000..de36074
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/less/variables.less
@@ -0,0 +1,301 @@
+//
+// Variables
+// --------------------------------------------------
+
+
+// Global values
+// --------------------------------------------------
+
+
+// Grays
+// -------------------------
+@black:                 #000;
+@grayDarker:            #222;
+@grayDark:              #333;
+@gray:                  #555;
+@grayLight:             #999;
+@grayLighter:           #eee;
+@white:                 #fff;
+
+
+// Accent colors
+// -------------------------
+@blue:                  #049cdb;
+@blueDark:              #0064cd;
+@green:                 #46a546;
+@red:                   #9d261d;
+@yellow:                #ffc40d;
+@orange:                #f89406;
+@pink:                  #c3325f;
+@purple:                #7a43b6;
+
+
+// Scaffolding
+// -------------------------
+@bodyBackground:        @white;
+@textColor:             @grayDark;
+
+
+// Links
+// -------------------------
+@linkColor:             #08c;
+@linkColorHover:        darken(@linkColor, 15%);
+
+
+// Typography
+// -------------------------
+@sansFontFamily:        "Helvetica Neue", Helvetica, Arial, sans-serif;
+@serifFontFamily:       Georgia, "Times New Roman", Times, serif;
+@monoFontFamily:        Monaco, Menlo, Consolas, "Courier New", monospace;
+
+@baseFontSize:          14px;
+@baseFontFamily:        @sansFontFamily;
+@baseLineHeight:        20px;
+@altFontFamily:         @serifFontFamily;
+
+@headingsFontFamily:    inherit; // empty to use BS default, @baseFontFamily
+@headingsFontWeight:    bold;    // instead of browser default, bold
+@headingsColor:         inherit; // empty to use BS default, @textColor
+
+
+// Component sizing
+// -------------------------
+// Based on 14px font-size and 20px line-height
+
+@fontSizeLarge:         @baseFontSize * 1.25; // ~18px
+@fontSizeSmall:         @baseFontSize * 0.85; // ~12px
+@fontSizeMini:          @baseFontSize * 0.75; // ~11px
+
+@paddingLarge:          11px 19px; // 44px
+@paddingSmall:          2px 10px;  // 26px
+@paddingMini:           0 6px;   // 22px
+
+@baseBorderRadius:      4px;
+@borderRadiusLarge:     6px;
+@borderRadiusSmall:     3px;
+
+
+// Tables
+// -------------------------
+@tableBackground:                   transparent; // overall background-color
+@tableBackgroundAccent:             #f9f9f9; // for striping
+@tableBackgroundHover:              #f5f5f5; // for hover
+@tableBorder:                       #ddd; // table and cell border
+
+// Buttons
+// -------------------------
+@btnBackground:                     @white;
+@btnBackgroundHighlight:            darken(@white, 10%);
+@btnBorder:                         #bbb;
+
+@btnPrimaryBackground:              @linkColor;
+@btnPrimaryBackgroundHighlight:     spin(@btnPrimaryBackground, 20%);
+
+@btnInfoBackground:                 #5bc0de;
+@btnInfoBackgroundHighlight:        #2f96b4;
+
+@btnSuccessBackground:              #62c462;
+@btnSuccessBackgroundHighlight:     #51a351;
+
+@btnWarningBackground:              lighten(@orange, 15%);
+@btnWarningBackgroundHighlight:     @orange;
+
+@btnDangerBackground:               #ee5f5b;
+@btnDangerBackgroundHighlight:      #bd362f;
+
+@btnInverseBackground:              #444;
+@btnInverseBackgroundHighlight:     @grayDarker;
+
+
+// Forms
+// -------------------------
+@inputBackground:               @white;
+@inputBorder:                   #ccc;
+@inputBorderRadius:             @baseBorderRadius;
+@inputDisabledBackground:       @grayLighter;
+@formActionsBackground:         #f5f5f5;
+@inputHeight:                   @baseLineHeight + 10px; // base line-height + 8px vertical padding + 2px top/bottom border
+
+
+// Dropdowns
+// -------------------------
+@dropdownBackground:            @white;
+@dropdownBorder:                rgba(0,0,0,.2);
+@dropdownDividerTop:            #e5e5e5;
+@dropdownDividerBottom:         @white;
+
+@dropdownLinkColor:             @grayDark;
+@dropdownLinkColorHover:        @white;
+@dropdownLinkColorActive:       @white;
+
+@dropdownLinkBackgroundActive:  @linkColor;
+@dropdownLinkBackgroundHover:   @dropdownLinkBackgroundActive;
+
+
+
+// COMPONENT VARIABLES
+// --------------------------------------------------
+
+
+// Z-index master list
+// -------------------------
+// Used for a bird's eye view of components dependent on the z-axis
+// Try to avoid customizing these :)
+@zindexDropdown:          1000;
+@zindexPopover:           1010;
+@zindexTooltip:           1030;
+@zindexFixedNavbar:       1030;
+@zindexModalBackdrop:     1040;
+@zindexModal:             1050;
+
+
+// Sprite icons path
+// -------------------------
+@iconSpritePath:          "../img/glyphicons-halflings.png";
+@iconWhiteSpritePath:     "../img/glyphicons-halflings-white.png";
+
+
+// Input placeholder text color
+// -------------------------
+@placeholderText:         @grayLight;
+
+
+// Hr border color
+// -------------------------
+@hrBorder:                @grayLighter;
+
+
+// Horizontal forms & lists
+// -------------------------
+@horizontalComponentOffset:       180px;
+
+
+// Wells
+// -------------------------
+@wellBackground:                  #f5f5f5;
+
+
+// Navbar
+// -------------------------
+@navbarCollapseWidth:             979px;
+@navbarCollapseDesktopWidth:      @navbarCollapseWidth + 1;
+
+@navbarHeight:                    40px;
+@navbarBackgroundHighlight:       #ffffff;
+@navbarBackground:                darken(@navbarBackgroundHighlight, 5%);
+@navbarBorder:                    darken(@navbarBackground, 12%);
+
+@navbarText:                      #777;
+@navbarLinkColor:                 #777;
+@navbarLinkColorHover:            @grayDark;
+@navbarLinkColorActive:           @gray;
+@navbarLinkBackgroundHover:       transparent;
+@navbarLinkBackgroundActive:      darken(@navbarBackground, 5%);
+
+@navbarBrandColor:                @navbarLinkColor;
+
+// Inverted navbar
+@navbarInverseBackground:                #111111;
+@navbarInverseBackgroundHighlight:       #222222;
+@navbarInverseBorder:                    #252525;
+
+@navbarInverseText:                      @grayLight;
+@navbarInverseLinkColor:                 @grayLight;
+@navbarInverseLinkColorHover:            @white;
+@navbarInverseLinkColorActive:           @navbarInverseLinkColorHover;
+@navbarInverseLinkBackgroundHover:       transparent;
+@navbarInverseLinkBackgroundActive:      @navbarInverseBackground;
+
+@navbarInverseSearchBackground:          lighten(@navbarInverseBackground, 25%);
+@navbarInverseSearchBackgroundFocus:     @white;
+@navbarInverseSearchBorder:              @navbarInverseBackground;
+@navbarInverseSearchPlaceholderColor:    #ccc;
+
+@navbarInverseBrandColor:                @navbarInverseLinkColor;
+
+
+// Pagination
+// -------------------------
+@paginationBackground:                #fff;
+@paginationBorder:                    #ddd;
+@paginationActiveBackground:          #f5f5f5;
+
+
+// Hero unit
+// -------------------------
+@heroUnitBackground:              @grayLighter;
+@heroUnitHeadingColor:            inherit;
+@heroUnitLeadColor:               inherit;
+
+
+// Form states and alerts
+// -------------------------
+@warningText:             #c09853;
+@warningBackground:       #fcf8e3;
+@warningBorder:           darken(spin(@warningBackground, -10), 3%);
+
+@errorText:               #b94a48;
+@errorBackground:         #f2dede;
+@errorBorder:             darken(spin(@errorBackground, -10), 3%);
+
+@successText:             #468847;
+@successBackground:       #dff0d8;
+@successBorder:           darken(spin(@successBackground, -10), 5%);
+
+@infoText:                #3a87ad;
+@infoBackground:          #d9edf7;
+@infoBorder:              darken(spin(@infoBackground, -10), 7%);
+
+
+// Tooltips and popovers
+// -------------------------
+@tooltipColor:            #fff;
+@tooltipBackground:       #000;
+@tooltipArrowWidth:       5px;
+@tooltipArrowColor:       @tooltipBackground;
+
+@popoverBackground:       #fff;
+@popoverArrowWidth:       10px;
+@popoverArrowColor:       #fff;
+@popoverTitleBackground:  darken(@popoverBackground, 3%);
+
+// Special enhancement for popovers
+@popoverArrowOuterWidth:  @popoverArrowWidth + 1;
+@popoverArrowOuterColor:  rgba(0,0,0,.25);
+
+
+
+// GRID
+// --------------------------------------------------
+
+
+// Default 940px grid
+// -------------------------
+@gridColumns:             12;
+@gridColumnWidth:         60px;
+@gridGutterWidth:         20px;
+@gridRowWidth:            (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));
+
+// 1200px min
+@gridColumnWidth1200:     70px;
+@gridGutterWidth1200:     30px;
+@gridRowWidth1200:        (@gridColumns * @gridColumnWidth1200) + (@gridGutterWidth1200 * (@gridColumns - 1));
+
+// 768px-979px
+@gridColumnWidth768:      42px;
+@gridGutterWidth768:      20px;
+@gridRowWidth768:         (@gridColumns * @gridColumnWidth768) + (@gridGutterWidth768 * (@gridColumns - 1));
+
+
+// Fluid grid
+// -------------------------
+@fluidGridColumnWidth:    percentage(@gridColumnWidth/@gridRowWidth);
+@fluidGridGutterWidth:    percentage(@gridGutterWidth/@gridRowWidth);
+
+// 1200px min
+@fluidGridColumnWidth1200:     percentage(@gridColumnWidth1200/@gridRowWidth1200);
+@fluidGridGutterWidth1200:     percentage(@gridGutterWidth1200/@gridRowWidth1200);
+
+// 768px-979px
+@fluidGridColumnWidth768:      percentage(@gridColumnWidth768/@gridRowWidth768);
+@fluidGridGutterWidth768:      percentage(@gridGutterWidth768/@gridRowWidth768);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/less/wells.less
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/less/wells.less b/src/fauxton/jam/bootstrap/less/wells.less
new file mode 100644
index 0000000..84a744b
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/less/wells.less
@@ -0,0 +1,29 @@
+//
+// Wells
+// --------------------------------------------------
+
+
+// Base class
+.well {
+  min-height: 20px;
+  padding: 19px;
+  margin-bottom: 20px;
+  background-color: @wellBackground;
+  border: 1px solid darken(@wellBackground, 7%);
+  .border-radius(@baseBorderRadius);
+  .box-shadow(inset 0 1px 1px rgba(0,0,0,.05));
+  blockquote {
+    border-color: #ddd;
+    border-color: rgba(0,0,0,.15);
+  }
+}
+
+// Sizes
+.well-large {
+  padding: 24px;
+  .border-radius(@borderRadiusLarge);
+}
+.well-small {
+  padding: 9px;
+  .border-radius(@borderRadiusSmall);
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/bootstrap/package.json
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/bootstrap/package.json b/src/fauxton/jam/bootstrap/package.json
new file mode 100644
index 0000000..c81e3f1
--- /dev/null
+++ b/src/fauxton/jam/bootstrap/package.json
@@ -0,0 +1,26 @@
+{
+    "name": "bootstrap"
+  , "description": "Sleek, intuitive, and powerful front-end framework for faster and easier web development."
+  , "version": "2.2.2"
+  , "keywords": ["bootstrap", "css"]
+  , "homepage": "http://twitter.github.com/bootstrap/"
+  , "author": "Twitter Inc."
+  , "scripts": { "test": "make test" }
+  , "repository": {
+      "type": "git"
+    , "url": "https://github.com/twitter/bootstrap.git"
+  }
+  , "licenses": [
+    {
+        "type": "Apache-2.0"
+      , "url": "http://www.apache.org/licenses/LICENSE-2.0"
+    }
+  ]
+  , "devDependencies": {
+      "uglify-js": "1.2.6"
+    , "jshint": "0.6.1"
+    , "recess": "1.0.3"
+    , "connect": "2.1.3"
+    , "hogan.js": "2.0.0"
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/codemirror/LICENSE
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/codemirror/LICENSE b/src/fauxton/jam/codemirror/LICENSE
new file mode 100644
index 0000000..3916e96
--- /dev/null
+++ b/src/fauxton/jam/codemirror/LICENSE
@@ -0,0 +1,23 @@
+Copyright (C) 2012 by Marijn Haverbeke <marijnh@gmail.com>
+
+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.
+
+Please note that some subdirectories of the CodeMirror distribution
+include their own LICENSE files, and are released under different
+licences.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/codemirror/README.md
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/codemirror/README.md b/src/fauxton/jam/codemirror/README.md
new file mode 100644
index 0000000..8ed9871
--- /dev/null
+++ b/src/fauxton/jam/codemirror/README.md
@@ -0,0 +1,8 @@
+# CodeMirror [![Build Status](https://secure.travis-ci.org/marijnh/CodeMirror.png?branch=master)](http://travis-ci.org/marijnh/CodeMirror)
+
+CodeMirror is a JavaScript component that provides a code editor in
+the browser. When a mode is available for the language you are coding
+in, it will color your code, and optionally help with indentation.
+
+The project page is http://codemirror.net
+The manual is at http://codemirror.net/doc/manual.html

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/codemirror/keymap/emacs.js
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/codemirror/keymap/emacs.js b/src/fauxton/jam/codemirror/keymap/emacs.js
new file mode 100644
index 0000000..fab3ab9
--- /dev/null
+++ b/src/fauxton/jam/codemirror/keymap/emacs.js
@@ -0,0 +1,30 @@
+// TODO number prefixes
+(function() {
+  // Really primitive kill-ring implementation.
+  var killRing = [];
+  function addToRing(str) {
+    killRing.push(str);
+    if (killRing.length > 50) killRing.shift();
+  }
+  function getFromRing() { return killRing[killRing.length - 1] || ""; }
+  function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }
+
+  CodeMirror.keyMap.emacs = {
+    "Ctrl-X": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-X");},
+    "Ctrl-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");},
+    "Ctrl-Alt-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");},
+    "Alt-W": function(cm) {addToRing(cm.getSelection());},
+    "Ctrl-Y": function(cm) {cm.replaceSelection(getFromRing());},
+    "Alt-Y": function(cm) {cm.replaceSelection(popFromRing());},
+    "Ctrl-/": "undo", "Shift-Ctrl--": "undo", "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
+    "Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": "clearSearch", "Shift-Alt-5": "replace",
+    "Ctrl-Z": "undo", "Cmd-Z": "undo", "Alt-/": "autocomplete", "Alt-V": "goPageUp",
+    "Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto",
+    fallthrough: ["basic", "emacsy"]
+  };
+
+  CodeMirror.keyMap["emacs-Ctrl-X"] = {
+    "Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": "undo", "K": "close",
+    auto: "emacs", nofallthrough: true
+  };
+})();

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/codemirror/keymap/vim.js
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/codemirror/keymap/vim.js b/src/fauxton/jam/codemirror/keymap/vim.js
new file mode 100644
index 0000000..c2e74b8
--- /dev/null
+++ b/src/fauxton/jam/codemirror/keymap/vim.js
@@ -0,0 +1,847 @@
+// Supported keybindings:
+//
+// Cursor movement:
+// h, j, k, l
+// e, E, w, W, b, B
+// Ctrl-f, Ctrl-b
+// Ctrl-n, Ctrl-p
+// $, ^, 0
+// G
+// ge, gE
+// gg
+// f<char>, F<char>, t<char>, T<char>
+// Ctrl-o, Ctrl-i TODO (FIXME - Ctrl-O wont work in Chrome)
+// /, ?, n, N TODO (does not work)
+// #, * TODO
+//
+// Entering insert mode:
+// i, I, a, A, o, O
+// s
+// ce, cb
+// cc
+// S, C TODO
+// cf<char>, cF<char>, ct<char>, cT<char>
+//
+// Deleting text:
+// x, X
+// J
+// dd, D
+// de, db
+// df<char>, dF<char>, dt<char>, dT<char>
+//
+// Yanking and pasting:
+// yy, Y
+// p, P
+// p'<char> TODO - test
+// y'<char> TODO - test
+// m<char> TODO - test
+//
+// Changing text in place:
+// ~
+// r<char>
+//
+// Visual mode:
+// v, V TODO
+//
+// Misc:
+// . TODO
+//
+
+(function() {
+  var sdir = "f";
+  var buf = "";
+  var yank = 0;
+  var mark = [];
+  var repeatCount = 0;
+  function isLine(cm, line) { return line >= 0 && line < cm.lineCount(); }
+  function emptyBuffer() { buf = ""; }
+  function pushInBuffer(str) { buf += str; }
+  function pushRepeatCountDigit(digit) {return function(cm) {repeatCount = (repeatCount * 10) + digit}; }
+  function getCountOrOne() {
+    var i = repeatCount;
+    return i || 1;
+  }
+  function clearCount() {
+    repeatCount = 0;
+  }
+  function iterTimes(func) {
+    for (var i = 0, c = getCountOrOne(); i < c; ++i) func(i, i == c - 1);
+    clearCount();
+  }
+  function countTimes(func) {
+    if (typeof func == "string") func = CodeMirror.commands[func];
+    return function(cm) { iterTimes(function () { func(cm); }); };
+  }
+
+  function iterObj(o, f) {
+    for (var prop in o) if (o.hasOwnProperty(prop)) f(prop, o[prop]);
+  }
+  function iterList(l, f) {
+    for (var i = 0; i < l.length; ++i) f(l[i]);
+  }
+  function toLetter(ch) {
+    // T -> t, Shift-T -> T, '*' -> *, "Space" -> " "
+    if (ch.slice(0, 6) == "Shift-") {
+      return ch.slice(0, 1);
+    } else {
+      if (ch == "Space") return " ";
+      if (ch.length == 3 && ch[0] == "'" && ch[2] == "'") return ch[1];
+      return ch.toLowerCase();
+    }
+  }
+  var SPECIAL_SYMBOLS = "~`!@#$%^&*()_-+=[{}]\\|/?.,<>:;\"\'1234567890";
+  function toCombo(ch) {
+    // t -> T, T -> Shift-T, * -> '*', " " -> "Space"
+    if (ch == " ") return "Space";
+    var specialIdx = SPECIAL_SYMBOLS.indexOf(ch);
+    if (specialIdx != -1) return "'" + ch + "'";
+    if (ch.toLowerCase() == ch) return ch.toUpperCase();
+    return "Shift-" + ch.toUpperCase();
+  }
+
+  var word = [/\w/, /[^\w\s]/], bigWord = [/\S/];
+  // Finds a word on the given line, and continue searching the next line if it can't find one.
+  function findWord(cm, lineNum, pos, dir, regexps) {
+    var line = cm.getLine(lineNum);
+    while (true) {
+      var stop = (dir > 0) ? line.length : -1;
+      var wordStart = stop, wordEnd = stop;
+      // Find bounds of next word.
+      for (; pos != stop; pos += dir) {
+        for (var i = 0; i < regexps.length; ++i) {
+          if (regexps[i].test(line.charAt(pos))) {
+            wordStart = pos;
+            // Advance to end of word.
+            for (; pos != stop && regexps[i].test(line.charAt(pos)); pos += dir) {}
+            wordEnd = (dir > 0) ? pos : pos + 1;
+            return {
+                from: Math.min(wordStart, wordEnd),
+                to: Math.max(wordStart, wordEnd),
+                line: lineNum};
+          }
+        }
+      }
+      // Advance to next/prev line.
+      lineNum += dir;
+      if (!isLine(cm, lineNum)) return null;
+      line = cm.getLine(lineNum);
+      pos = (dir > 0) ? 0 : line.length;
+    }
+  }
+  /**
+   * @param {boolean} cm CodeMirror object.
+   * @param {regexp} regexps Regular expressions for word characters.
+   * @param {number} dir Direction, +/- 1.
+   * @param {number} times Number of times to advance word.
+   * @param {string} where Go to "start" or "end" of word, 'e' vs 'w'.
+   * @param {boolean} yank Whether we are finding words to yank. If true,
+   *     do not go to the next line to look for the last word. This is to
+   *     prevent deleting new line on 'dw' at the end of a line.
+   */
+  function moveToWord(cm, regexps, dir, times, where, yank) {
+    var cur = cm.getCursor();
+    if (yank) {
+      where = 'start';
+    }
+    for (var i = 0; i < times; i++) {
+      var startCh = cur.ch, startLine = cur.line, word;
+      while (true) {
+        // Search and advance.
+        word = findWord(cm, cur.line, cur.ch, dir, regexps);
+        if (word) {
+          if (yank && times == 1 && dir == 1 && cur.line != word.line) {
+            // Stop at end of line of last word. Don't want to delete line return
+            // for dw if the last deleted word is at the end of a line.
+            cur.ch = cm.getLine(cur.line).length;
+            break;
+          } else {
+            // Move to the word we just found. If by moving to the word we end up
+            // in the same spot, then move an extra character and search again.
+            cur.line = word.line;
+            if (dir > 0 && where == 'end') {
+              // 'e'
+              if (startCh != word.to - 1 || startLine != word.line) {
+                cur.ch = word.to - 1;
+                break;
+              } else {
+                cur.ch = word.to;
+              }
+            } else if (dir > 0 && where == 'start') {
+              // 'w'
+              if (startCh != word.from || startLine != word.line) {
+                cur.ch = word.from;
+                break;
+              } else {
+                cur.ch = word.to;
+              }
+            } else if (dir < 0 && where == 'end') {
+              // 'ge'
+              if (startCh != word.to || startLine != word.line) {
+                cur.ch = word.to;
+                break;
+              } else {
+                cur.ch = word.from - 1;
+              }
+            } else if (dir < 0 && where == 'start') {
+              // 'b'
+              if (startCh != word.from || startLine != word.line) {
+                cur.ch = word.from;
+                break;
+              } else {
+                cur.ch = word.from - 1;
+              }
+            }
+          }
+        } else {
+          // No more words to be found. Move to end of document.
+          for (; isLine(cm, cur.line + dir); cur.line += dir) {}
+          cur.ch = (dir > 0) ? cm.getLine(cur.line).length : 0;
+          break;
+        }
+      }
+    }
+    return cur;
+  }
+  function joinLineNext(cm) {
+    var cur = cm.getCursor(), ch = cur.ch, line = cm.getLine(cur.line);
+    CodeMirror.commands.goLineEnd(cm);
+    if (cur.line != cm.lineCount()) {
+      CodeMirror.commands.goLineEnd(cm);
+      cm.replaceSelection(" ", "end");
+      CodeMirror.commands.delCharRight(cm);
+    }
+  }
+  function delTillMark(cm, cHar) {
+    var i = mark[cHar];
+    if (i === undefined) {
+      // console.log("Mark not set"); // TODO - show in status bar
+      return;
+    }
+    var l = cm.getCursor().line, start = i > l ? l : i, end = i > l ? i : l;
+    cm.setCursor(start);
+    for (var c = start; c <= end; c++) {
+      pushInBuffer("\n"+cm.getLine(start));
+      cm.removeLine(start);
+    }
+  }
+  function yankTillMark(cm, cHar) {
+    var i = mark[cHar];
+    if (i === undefined) {
+      // console.log("Mark not set"); // TODO - show in status bar
+      return;
+    }
+    var l = cm.getCursor().line, start = i > l ? l : i, end = i > l ? i : l;
+    for (var c = start; c <= end; c++) {
+      pushInBuffer("\n"+cm.getLine(c));
+    }
+    cm.setCursor(start);
+  }
+  function goLineStartText(cm) {
+    // Go to the start of the line where the text begins, or the end for whitespace-only lines
+    var cur = cm.getCursor(), firstNonWS = cm.getLine(cur.line).search(/\S/);
+    cm.setCursor(cur.line, firstNonWS == -1 ? line.length : firstNonWS, true);
+  }
+
+  function charIdxInLine(cm, cHar, motion_options) {
+    // Search for cHar in line.
+    // motion_options: {forward, inclusive}
+    // If inclusive = true, include it too.
+    // If forward = true, search forward, else search backwards.
+    // If char is not found on this line, do nothing
+    var cur = cm.getCursor(), line = cm.getLine(cur.line), idx;
+    var ch = toLetter(cHar), mo = motion_options;
+    if (mo.forward) {
+      idx = line.indexOf(ch, cur.ch + 1);
+      if (idx != -1 && mo.inclusive) idx += 1;
+    } else {
+      idx = line.lastIndexOf(ch, cur.ch);
+      if (idx != -1 && !mo.inclusive) idx += 1;
+    }
+    return idx;
+  }
+
+  function moveTillChar(cm, cHar, motion_options) {
+    // Move to cHar in line, as found by charIdxInLine.
+    var idx = charIdxInLine(cm, cHar, motion_options), cur = cm.getCursor();
+    if (idx != -1) cm.setCursor({line: cur.line, ch: idx});
+  }
+
+  function delTillChar(cm, cHar, motion_options) {
+    // delete text in this line, untill cHar is met,
+    // as found by charIdxInLine.
+    // If char is not found on this line, do nothing
+    var idx = charIdxInLine(cm, cHar, motion_options);
+    var cur = cm.getCursor();
+    if (idx !== -1) {
+      if (motion_options.forward) {
+        cm.replaceRange("", {line: cur.line, ch: cur.ch}, {line: cur.line, ch: idx});
+      } else {
+        cm.replaceRange("", {line: cur.line, ch: idx}, {line: cur.line, ch: cur.ch});
+      }
+    }
+  }
+
+  function enterInsertMode(cm) {
+    // enter insert mode: switch mode and cursor
+    clearCount();
+    cm.setOption("keyMap", "vim-insert");
+  }
+
+  function dialog(cm, text, shortText, f) {
+    if (cm.openDialog) cm.openDialog(text, f);
+    else f(prompt(shortText, ""));
+  }
+  function showAlert(cm, text) {
+    var esc = text.replace(/[<&]/, function(ch) { return ch == "<" ? "&lt;" : "&amp;"; });
+    if (cm.openDialog) cm.openDialog(esc + " <button type=button>OK</button>");
+    else alert(text);
+  }
+
+  // main keymap
+  var map = CodeMirror.keyMap.vim = {
+    // Pipe (|); TODO: should be *screen* chars, so need a util function to turn tabs into spaces?
+    "'|'": function(cm) {
+      cm.setCursor(cm.getCursor().line, getCountOrOne() - 1, true);
+      clearCount();
+    },
+    "A": function(cm) {
+      cm.setCursor(cm.getCursor().line, cm.getCursor().ch+1, true);
+      enterInsertMode(cm);
+    },
+    "Shift-A": function(cm) { CodeMirror.commands.goLineEnd(cm); enterInsertMode(cm);},
+    "I": function(cm) { enterInsertMode(cm);},
+    "Shift-I": function(cm) { goLineStartText(cm); enterInsertMode(cm);},
+    "O": function(cm) {
+      CodeMirror.commands.goLineEnd(cm);
+      CodeMirror.commands.newlineAndIndent(cm);
+      enterInsertMode(cm);
+    },
+    "Shift-O": function(cm) {
+      CodeMirror.commands.goLineStart(cm);
+      cm.replaceSelection("\n", "start");
+      cm.indentLine(cm.getCursor().line);
+      enterInsertMode(cm);
+    },
+    "G": function(cm) { cm.setOption("keyMap", "vim-prefix-g");},
+    "Shift-D": function(cm) {
+      // commented out verions works, but I left original, cause maybe
+      // I don't know vim enouth to see what it does
+      /* var cur = cm.getCursor();
+      var f = {line: cur.line, ch: cur.ch}, t = {line: cur.line};
+      pushInBuffer(cm.getRange(f, t));
+      */
+      emptyBuffer();
+      mark["Shift-D"] = cm.getCursor(false).line;
+      cm.setCursor(cm.getCursor(true).line);
+      delTillMark(cm,"Shift-D"); mark = [];
+    },
+
+    "S": function (cm) {
+      countTimes(function (_cm) {
+        CodeMirror.commands.delCharRight(_cm);
+      })(cm);
+      enterInsertMode(cm);
+    },
+    "M": function(cm) {cm.setOption("keyMap", "vim-prefix-m"); mark = [];},
+    "Y": function(cm) {cm.setOption("keyMap", "vim-prefix-y"); emptyBuffer(); yank = 0;},
+    "Shift-Y": function(cm) {
+      emptyBuffer();
+      mark["Shift-D"] = cm.getCursor(false).line;
+      cm.setCursor(cm.getCursor(true).line);
+      yankTillMark(cm,"Shift-D"); mark = [];
+    },
+    "/": function(cm) {var f = CodeMirror.commands.find; f && f(cm); sdir = "f";},
+    "'?'": function(cm) {
+      var f = CodeMirror.commands.find;
+      if (f) { f(cm); CodeMirror.commands.findPrev(cm); sdir = "r"; }
+    },
+    "N": function(cm) {
+      var fn = CodeMirror.commands.findNext;
+      if (fn) sdir != "r" ? fn(cm) : CodeMirror.commands.findPrev(cm);
+    },
+    "Shift-N": function(cm) {
+      var fn = CodeMirror.commands.findNext;
+      if (fn) sdir != "r" ? CodeMirror.commands.findPrev(cm) : fn.findNext(cm);
+    },
+    "Shift-G": function(cm) {
+      (repeatCount == 0) ? cm.setCursor(cm.lineCount()) : cm.setCursor(repeatCount - 1);
+      clearCount();
+      CodeMirror.commands.goLineStart(cm);
+    },
+    "':'": function(cm) {
+      var exModeDialog = ': <input type="text" style="width: 90%"/>';
+      dialog(cm, exModeDialog, ':', function(command) {
+        if (command.match(/^\d+$/)) {
+          cm.setCursor(command - 1, cm.getCursor().ch);
+        } else {
+          showAlert(cm, "Bad command: " + command);
+        }
+      });
+    },
+    nofallthrough: true, style: "fat-cursor"
+  };
+
+  // standard mode switching
+  iterList(["d", "t", "T", "f", "F", "c", "r"], function (ch) {
+    CodeMirror.keyMap.vim[toCombo(ch)] = function (cm) {
+      cm.setOption("keyMap", "vim-prefix-" + ch);
+      emptyBuffer();
+    };
+  });
+
+  // main num keymap
+  // Add bindings that are influenced by number keys
+  iterObj({
+    "Left": "goColumnLeft", "Right": "goColumnRight",
+    "Down": "goLineDown", "Up": "goLineUp", "Backspace": "goCharLeft",
+    "Space": "goCharRight",
+    "X": function(cm) {CodeMirror.commands.delCharRight(cm);},
+    "P": function(cm) {
+      var cur = cm.getCursor().line;
+      if (buf!= "") {
+        if (buf[0] == "\n") CodeMirror.commands.goLineEnd(cm);
+        cm.replaceRange(buf, cm.getCursor());
+      }
+    },
+    "Shift-X": function(cm) {CodeMirror.commands.delCharLeft(cm);},
+    "Shift-J": function(cm) {joinLineNext(cm);},
+    "Shift-P": function(cm) {
+      var cur = cm.getCursor().line;
+      if (buf!= "") {
+        CodeMirror.commands.goLineUp(cm);
+        CodeMirror.commands.goLineEnd(cm);
+        cm.replaceSelection(buf, "end");
+      }
+      cm.setCursor(cur+1);
+    },
+    "'~'": function(cm) {
+      var cur = cm.getCursor(), cHar = cm.getRange({line: cur.line, ch: cur.ch}, {line: cur.line, ch: cur.ch+1});
+      cHar = cHar != cHar.toLowerCase() ? cHar.toLowerCase() : cHar.toUpperCase();
+      cm.replaceRange(cHar, {line: cur.line, ch: cur.ch}, {line: cur.line, ch: cur.ch+1});
+      cm.setCursor(cur.line, cur.ch+1);
+    },
+    "Ctrl-B": function(cm) {CodeMirror.commands.goPageUp(cm);},
+    "Ctrl-F": function(cm) {CodeMirror.commands.goPageDown(cm);},
+    "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
+    "U": "undo", "Ctrl-R": "redo"
+  }, function(key, cmd) { map[key] = countTimes(cmd); });
+
+  // empty key maps
+  iterList([
+      "vim-prefix-d'",
+      "vim-prefix-y'",
+      "vim-prefix-df",
+      "vim-prefix-dF",
+      "vim-prefix-dt",
+      "vim-prefix-dT",
+      "vim-prefix-c",
+      "vim-prefix-cf",
+      "vim-prefix-cF",
+      "vim-prefix-ct",
+      "vim-prefix-cT",
+      "vim-prefix-",
+      "vim-prefix-f",
+      "vim-prefix-F",
+      "vim-prefix-t",
+      "vim-prefix-T",
+      "vim-prefix-r",
+      "vim-prefix-m"
+      ],
+      function (prefix) {
+        CodeMirror.keyMap[prefix] = {
+          auto: "vim",
+          nofallthrough: true,
+          style: "fat-cursor"
+        };
+      });
+
+  CodeMirror.keyMap["vim-prefix-g"] = {
+    "E": countTimes(function(cm) { cm.setCursor(moveToWord(cm, word, -1, 1, "end"));}),
+    "Shift-E": countTimes(function(cm) { cm.setCursor(moveToWord(cm, bigWord, -1, 1, "end"));}),
+    "G": function (cm) {
+      cm.setCursor({line: repeatCount - 1, ch: cm.getCursor().ch});
+      clearCount();
+    },
+    auto: "vim", nofallthrough: true, style: "fat-cursor"
+  };
+
+  CodeMirror.keyMap["vim-prefix-d"] = {
+    "D": countTimes(function(cm) {
+      pushInBuffer("\n"+cm.getLine(cm.getCursor().line));
+      cm.removeLine(cm.getCursor().line);
+      cm.setOption("keyMap", "vim");
+    }),
+    "'": function(cm) {
+      cm.setOption("keyMap", "vim-prefix-d'");
+      emptyBuffer();
+    },
+    "B": function(cm) {
+      var cur = cm.getCursor();
+      var line = cm.getLine(cur.line);
+      var index = line.lastIndexOf(" ", cur.ch);
+
+      pushInBuffer(line.substring(index, cur.ch));
+      cm.replaceRange("", {line: cur.line, ch: index}, cur);
+      cm.setOption("keyMap", "vim");
+    },
+    nofallthrough: true, style: "fat-cursor"
+  };
+
+  CodeMirror.keyMap["vim-prefix-c"] = {
+    "B": function (cm) {
+      countTimes("delWordLeft")(cm);
+      enterInsertMode(cm);
+    },
+    "C": function (cm) {
+      iterTimes(function (i, last) {
+        CodeMirror.commands.deleteLine(cm);
+        if (i) {
+          CodeMirror.commands.delCharRight(cm);
+          if (last) CodeMirror.commands.deleteLine(cm);
+        }
+      });
+      enterInsertMode(cm);
+    },
+    nofallthrough: true, style: "fat-cursor"
+  };
+
+  iterList(["vim-prefix-d", "vim-prefix-c", "vim-prefix-"], function (prefix) {
+    iterList(["f", "F", "T", "t"],
+      function (ch) {
+        CodeMirror.keyMap[prefix][toCombo(ch)] = function (cm) {
+          cm.setOption("keyMap", prefix + ch);
+          emptyBuffer();
+        };
+      });
+  });
+
+  var MOTION_OPTIONS = {
+    "t": {inclusive: false, forward: true},
+    "f": {inclusive: true,  forward: true},
+    "T": {inclusive: false, forward: false},
+    "F": {inclusive: true,  forward: false}
+  };
+
+  function setupPrefixBindingForKey(m) {
+    CodeMirror.keyMap["vim-prefix-m"][m] = function(cm) {
+      mark[m] = cm.getCursor().line;
+    };
+    CodeMirror.keyMap["vim-prefix-d'"][m] = function(cm) {
+      delTillMark(cm,m);
+    };
+    CodeMirror.keyMap["vim-prefix-y'"][m] = function(cm) {
+      yankTillMark(cm,m);
+    };
+    CodeMirror.keyMap["vim-prefix-r"][m] = function (cm) {
+      var cur = cm.getCursor();
+      cm.replaceRange(toLetter(m),
+          {line: cur.line, ch: cur.ch},
+          {line: cur.line, ch: cur.ch + 1});
+      CodeMirror.commands.goColumnLeft(cm);
+    };
+    // all commands, related to motions till char in line
+    iterObj(MOTION_OPTIONS, function (ch, options) {
+      CodeMirror.keyMap["vim-prefix-" + ch][m] = function(cm) {
+        moveTillChar(cm, m, options);
+      };
+      CodeMirror.keyMap["vim-prefix-d" + ch][m] = function(cm) {
+        delTillChar(cm, m, options);
+      };
+      CodeMirror.keyMap["vim-prefix-c" + ch][m] = function(cm) {
+        delTillChar(cm, m, options);
+        enterInsertMode(cm);
+      };
+    });
+  }
+  for (var i = 65; i < 65 + 26; i++) { // uppercase alphabet char codes
+    var ch = String.fromCharCode(i);
+    setupPrefixBindingForKey(toCombo(ch));
+    setupPrefixBindingForKey(toCombo(ch.toLowerCase()));
+  }
+  for (var i = 0; i < SPECIAL_SYMBOLS.length; ++i) {
+    setupPrefixBindingForKey(toCombo(SPECIAL_SYMBOLS.charAt(i)));
+  }
+  setupPrefixBindingForKey("Space");
+
+  CodeMirror.keyMap["vim-prefix-y"] = {
+    "Y": countTimes(function(cm) {
+      pushInBuffer("\n"+cm.getLine(cm.getCursor().line+yank)); yank++;
+      cm.setOption("keyMap", "vim");
+    }),
+    "'": function(cm) {cm.setOption("keyMap", "vim-prefix-y'"); emptyBuffer();},
+    nofallthrough: true, style: "fat-cursor"
+  };
+
+  CodeMirror.keyMap["vim-insert"] = {
+    // TODO: override navigation keys so that Esc will cancel automatic indentation from o, O, i_<CR>
+    "Esc": function(cm) {
+      cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1, true);
+      cm.setOption("keyMap", "vim");
+    },
+    "Ctrl-N": "autocomplete",
+    "Ctrl-P": "autocomplete",
+    fallthrough: ["default"]
+  };
+
+  function findMatchedSymbol(cm, cur, symb) {
+    var line = cur.line;
+    var symb = symb ? symb : cm.getLine(line)[cur.ch];
+
+    // Are we at the opening or closing char
+    var forwards = ['(', '[', '{'].indexOf(symb) != -1;
+
+    var reverseSymb = (function(sym) {
+      switch (sym) {
+        case '(' : return ')';
+        case '[' : return ']';
+        case '{' : return '}';
+        case ')' : return '(';
+        case ']' : return '[';
+        case '}' : return '{';
+        default : return null;
+      }
+    })(symb);
+
+    // Couldn't find a matching symbol, abort
+    if (reverseSymb == null) return cur;
+
+    // Tracking our imbalance in open/closing symbols. An opening symbol wii be
+    // the first thing we pick up if moving forward, this isn't true moving backwards
+    var disBal = forwards ? 0 : 1;
+
+    while (true) {
+      if (line == cur.line) {
+        // First pass, do some special stuff
+        var currLine =  forwards ? cm.getLine(line).substr(cur.ch).split('') : cm.getLine(line).substr(0,cur.ch).split('').reverse();
+      } else {
+        var currLine =  forwards ? cm.getLine(line).split('') : cm.getLine(line).split('').reverse();
+      }
+
+      for (var index = 0;  index < currLine.length; index++) {
+        if (currLine[index] == symb) disBal++;
+        else if (currLine[index] == reverseSymb) disBal--;
+
+        if (disBal == 0) {
+          if (forwards && cur.line == line) return {line: line, ch: index + cur.ch};
+          else if (forwards) return {line: line, ch: index};
+          else return {line: line, ch: currLine.length - index - 1 };
+        }
+      }
+
+      if (forwards) line++;
+      else line--;
+    }
+  }
+
+  function selectCompanionObject(cm, revSymb, inclusive) {
+    var cur = cm.getCursor();
+
+    var end = findMatchedSymbol(cm, cur, revSymb);
+    var start = findMatchedSymbol(cm, end);
+    start.ch += inclusive ? 1 : 0;
+    end.ch += inclusive ? 0 : 1;
+
+    return {start: start, end: end};
+  }
+
+  // These are our motion commands to be used for navigation and selection with
+  // certian other commands. All should return a cursor object.
+  var motionList = ['B', 'E', 'J', 'K', 'H', 'L', 'W', 'Shift-W', "'^'", "'$'", "'%'", 'Esc'];
+
+  motions = {
+    'B': function(cm, times, yank) { return moveToWord(cm, word, -1, times, 'start', yank); },
+    'Shift-B': function(cm, times, yank) { return moveToWord(cm, bigWord, -1, times, 'start', yank); },
+    'E': function(cm, times, yank) { return moveToWord(cm, word, 1, times, 'end', yank); },
+    'Shift-E': function(cm, times, yank) { return moveToWord(cm, bigWord, 1, times, 'end', yank); },
+    'J': function(cm, times) {
+      var cur = cm.getCursor();
+      return {line: cur.line+times, ch : cur.ch};
+    },
+
+    'K': function(cm, times) {
+      var cur = cm.getCursor();
+      return {line: cur.line-times, ch: cur.ch};
+    },
+
+    'H': function(cm, times) {
+      var cur = cm.getCursor();
+      return {line: cur.line, ch: cur.ch-times};
+    },
+
+    'L': function(cm, times) {
+      var cur = cm.getCursor();
+      return {line: cur.line, ch: cur.ch+times};
+    },
+    'W': function(cm, times, yank) { return moveToWord(cm, word, 1, times, 'start', yank); },
+    'Shift-W': function(cm, times, yank) { return moveToWord(cm, bigWord, 1, times, 'start', yank); },
+    "'^'": function(cm, times) {
+      var cur = cm.getCursor();
+      var line = cm.getLine(cur.line).split('');
+
+      // Empty line :o
+      if (line.length == 0) return cur;
+
+      for (var index = 0;  index < line.length; index++) {
+        if (line[index].match(/[^\s]/)) return {line: cur.line, ch: index};
+      }
+    },
+    "'$'": function(cm) {
+      var cur = cm.getCursor();
+      var line = cm.getLine(cur.line);
+      return {line: cur.line, ch: line.length};
+    },
+    "'%'": function(cm) { return findMatchedSymbol(cm, cm.getCursor()); },
+    "Esc" : function(cm) {
+      cm.setOption('vim');
+      repeatCount = 0;
+
+      return cm.getCursor();
+    }
+  };
+
+  // Map our movement actions each operator and non-operational movement
+  iterList(motionList, function(key, index, array) {
+    CodeMirror.keyMap['vim-prefix-d'][key] = function(cm) {
+      // Get our selected range
+      var start = cm.getCursor();
+      var end = motions[key](cm, repeatCount ? repeatCount : 1, true);
+
+      // Set swap var if range is of negative length
+      if ((start.line > end.line) || (start.line == end.line && start.ch > end.ch)) var swap = true;
+
+      // Take action, switching start and end if swap var is set
+      pushInBuffer(cm.getRange(swap ? end : start, swap ? start : end));
+      cm.replaceRange("", swap ? end : start, swap ? start : end);
+
+      // And clean up
+      repeatCount = 0;
+      cm.setOption("keyMap", "vim");
+    };
+
+    CodeMirror.keyMap['vim-prefix-c'][key] = function(cm) {
+      var start = cm.getCursor();
+      var end = motions[key](cm, repeatCount ? repeatCount : 1, true);
+
+      if ((start.line > end.line) || (start.line == end.line && start.ch > end.ch)) var swap = true;
+      pushInBuffer(cm.getRange(swap ? end : start, swap ? start : end));
+      cm.replaceRange("", swap ? end : start, swap ? start : end);
+
+      repeatCount = 0;
+      cm.setOption('keyMap', 'vim-insert');
+    };
+
+    CodeMirror.keyMap['vim-prefix-y'][key] = function(cm) {
+      var start = cm.getCursor();
+      var end = motions[key](cm, repeatCount ? repeatCount : 1, true);
+
+      if ((start.line > end.line) || (start.line == end.line && start.ch > end.ch)) var swap = true;
+      pushInBuffer(cm.getRange(swap ? end : start, swap ? start : end));
+
+      repeatCount = 0;
+      cm.setOption("keyMap", "vim");
+    };
+
+    CodeMirror.keyMap['vim'][key] = function(cm) {
+      var cur = motions[key](cm, repeatCount ? repeatCount : 1);
+      cm.setCursor(cur.line, cur.ch);
+
+      repeatCount = 0;
+    };
+  });
+
+  function addCountBindings(keyMapName) {
+    // Add bindings for number keys
+    keyMap = CodeMirror.keyMap[keyMapName];
+    keyMap["0"] = function(cm) {
+      if (repeatCount > 0) {
+        pushRepeatCountDigit(0)(cm);
+      } else {
+        CodeMirror.commands.goLineStart(cm);
+      }
+    };
+    for (var i = 1; i < 10; ++i) {
+      keyMap[i] = pushRepeatCountDigit(i);
+    }
+  }
+  addCountBindings('vim');
+  addCountBindings('vim-prefix-d');
+  addCountBindings('vim-prefix-y');
+  addCountBindings('vim-prefix-c');
+
+  // Create our keymaps for each operator and make xa and xi where x is an operator
+  // change to the corrosponding keymap
+  var operators = ['d', 'y', 'c'];
+  iterList(operators, function(key, index, array) {
+    CodeMirror.keyMap['vim-prefix-'+key+'a'] = {
+      auto: 'vim', nofallthrough: true, style: "fat-cursor"
+    };
+    CodeMirror.keyMap['vim-prefix-'+key+'i'] = {
+      auto: 'vim', nofallthrough: true, style: "fat-cursor"
+    };
+
+    CodeMirror.keyMap['vim-prefix-'+key]['A'] = function(cm) {
+      repeatCount = 0;
+      cm.setOption('keyMap', 'vim-prefix-' + key + 'a');
+    };
+
+    CodeMirror.keyMap['vim-prefix-'+key]['I'] = function(cm) {
+      repeatCount = 0;
+      cm.setOption('keyMap', 'vim-prefix-' + key + 'i');
+    };
+  });
+
+  function regexLastIndexOf(string, pattern, startIndex) {
+    for (var i = startIndex == null ? string.length : startIndex; i >= 0; --i)
+      if (pattern.test(string.charAt(i))) return i;
+    return -1;
+  }
+
+  // Create our text object functions. They work similar to motions but they
+  // return a start cursor as well
+  var textObjectList = ['W', 'Shift-[', 'Shift-9', '['];
+  var textObjects = {
+    'W': function(cm, inclusive) {
+      var cur = cm.getCursor();
+      var line = cm.getLine(cur.line);
+
+      var line_to_char = new String(line.substring(0, cur.ch));
+      var start = regexLastIndexOf(line_to_char, /[^a-zA-Z0-9]/) + 1;
+      var end = motions["E"](cm, 1) ;
+
+      end.ch += inclusive ? 1 : 0 ;
+      return {start: {line: cur.line, ch: start}, end: end };
+    },
+    'Shift-[': function(cm, inclusive) { return selectCompanionObject(cm, '}', inclusive); },
+    'Shift-9': function(cm, inclusive) { return selectCompanionObject(cm, ')', inclusive); },
+    '[': function(cm, inclusive) { return selectCompanionObject(cm, ']', inclusive); }
+  };
+
+  // One function to handle all operation upon text objects. Kinda funky but it works
+  // better than rewriting this code six times
+  function textObjectManipulation(cm, object, remove, insert, inclusive) {
+    // Object is the text object, delete object if remove is true, enter insert
+    // mode if insert is true, inclusive is the difference between a and i
+    var tmp = textObjects[object](cm, inclusive);
+    var start = tmp.start;
+    var end = tmp.end;
+
+    if ((start.line > end.line) || (start.line == end.line && start.ch > end.ch)) var swap = true ;
+
+    pushInBuffer(cm.getRange(swap ? end : start, swap ? start : end));
+    if (remove) cm.replaceRange("", swap ? end : start, swap ? start : end);
+    if (insert) cm.setOption('keyMap', 'vim-insert');
+  }
+
+  // And finally build the keymaps up from the text objects
+  for (var i = 0; i < textObjectList.length; ++i) {
+    var object = textObjectList[i];
+    (function(object) {
+      CodeMirror.keyMap['vim-prefix-di'][object] = function(cm) { textObjectManipulation(cm, object, true, false, false); };
+      CodeMirror.keyMap['vim-prefix-da'][object] = function(cm) { textObjectManipulation(cm, object, true, false, true); };
+      CodeMirror.keyMap['vim-prefix-yi'][object] = function(cm) { textObjectManipulation(cm, object, false, false, false); };
+      CodeMirror.keyMap['vim-prefix-ya'][object] = function(cm) { textObjectManipulation(cm, object, false, false, true); };
+      CodeMirror.keyMap['vim-prefix-ci'][object] = function(cm) { textObjectManipulation(cm, object, true, true, false); };
+      CodeMirror.keyMap['vim-prefix-ca'][object] = function(cm) { textObjectManipulation(cm, object, true, true, true); };
+    })(object)
+  }
+})();

http://git-wip-us.apache.org/repos/asf/couchdb/blob/4615a788/src/fauxton/jam/codemirror/lib/codemirror.css
----------------------------------------------------------------------
diff --git a/src/fauxton/jam/codemirror/lib/codemirror.css b/src/fauxton/jam/codemirror/lib/codemirror.css
new file mode 100644
index 0000000..41b8d09
--- /dev/null
+++ b/src/fauxton/jam/codemirror/lib/codemirror.css
@@ -0,0 +1,174 @@
+.CodeMirror {
+  line-height: 1em;
+  font-family: monospace;
+
+  /* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */
+  position: relative;
+  /* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */
+  overflow: hidden;
+}
+
+.CodeMirror-scroll {
+  overflow: auto;
+  height: 300px;
+  /* This is needed to prevent an IE[67] bug where the scrolled content
+     is visible outside of the scrolling box. */
+  position: relative;
+  outline: none;
+}
+
+/* Vertical scrollbar */
+.CodeMirror-scrollbar {
+  position: absolute;
+  right: 0; top: 0;
+  overflow-x: hidden;
+  overflow-y: scroll;
+  z-index: 5;
+}
+.CodeMirror-scrollbar-inner {
+  /* This needs to have a nonzero width in order for the scrollbar to appear
+     in Firefox and IE9. */
+  width: 1px;
+}
+.CodeMirror-scrollbar.cm-sb-overlap {
+  /* Ensure that the scrollbar appears in Lion, and that it overlaps the content
+     rather than sitting to the right of it. */
+  position: absolute;
+  z-index: 1;
+  float: none;
+  right: 0;
+  min-width: 12px;
+}
+.CodeMirror-scrollbar.cm-sb-nonoverlap {
+  min-width: 12px;
+}
+.CodeMirror-scrollbar.cm-sb-ie7 {
+  min-width: 18px;
+}
+
+.CodeMirror-gutter {
+  position: absolute; left: 0; top: 0;
+  z-index: 10;
+  background-color: #f7f7f7;
+  border-right: 1px solid #eee;
+  min-width: 2em;
+  height: 100%;
+}
+.CodeMirror-gutter-text {
+  color: #aaa;
+  text-align: right;
+  padding: .4em .2em .4em .4em;
+  white-space: pre !important;
+  cursor: default;
+}
+.CodeMirror-lines {
+  padding: .4em;
+  white-space: pre;
+  cursor: text;
+}
+
+.CodeMirror pre {
+  -moz-border-radius: 0;
+  -webkit-border-radius: 0;
+  -o-border-radius: 0;
+  border-radius: 0;
+  border-width: 0; margin: 0; padding: 0; background: transparent;
+  font-family: inherit;
+  font-size: inherit;
+  padding: 0; margin: 0;
+  white-space: pre;
+  word-wrap: normal;
+  line-height: inherit;
+  color: inherit;
+  overflow: visible;
+}
+
+.CodeMirror-wrap pre {
+  word-wrap: break-word;
+  white-space: pre-wrap;
+  word-break: normal;
+}
+.CodeMirror-wrap .CodeMirror-scroll {
+  overflow-x: hidden;
+}
+
+.CodeMirror textarea {
+  outline: none !important;
+}
+
+.CodeMirror pre.CodeMirror-cursor {
+  z-index: 10;
+  position: absolute;
+  visibility: hidden;
+  border-left: 1px solid black;
+  border-right: none;
+  width: 0;
+}
+.cm-keymap-fat-cursor pre.CodeMirror-cursor {
+  width: auto;
+  border: 0;
+  background: transparent;
+  background: rgba(0, 200, 0, .4);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
+}
+/* Kludge to turn off filter in ie9+, which also accepts rgba */
+.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+}
+.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
+.CodeMirror-focused pre.CodeMirror-cursor {
+  visibility: visible;
+}
+
+div.CodeMirror-selected { background: #d9d9d9; }
+.CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; }
+
+.CodeMirror-searching {
+  background: #ffa;
+  background: rgba(255, 255, 0, .4);
+}
+
+/* Default theme */
+
+.cm-s-default span.cm-keyword {color: #708;}
+.cm-s-default span.cm-atom {color: #219;}
+.cm-s-default span.cm-number {color: #164;}
+.cm-s-default span.cm-def {color: #00f;}
+.cm-s-default span.cm-variable {color: black;}
+.cm-s-default span.cm-variable-2 {color: #05a;}
+.cm-s-default span.cm-variable-3 {color: #085;}
+.cm-s-default span.cm-property {color: black;}
+.cm-s-default span.cm-operator {color: black;}
+.cm-s-default span.cm-comment {color: #a50;}
+.cm-s-default span.cm-string {color: #a11;}
+.cm-s-default span.cm-string-2 {color: #f50;}
+.cm-s-default span.cm-meta {color: #555;}
+.cm-s-default span.cm-error {color: #f00;}
+.cm-s-default span.cm-qualifier {color: #555;}
+.cm-s-default span.cm-builtin {color: #30a;}
+.cm-s-default span.cm-bracket {color: #997;}
+.cm-s-default span.cm-tag {color: #170;}
+.cm-s-default span.cm-attribute {color: #00c;}
+.cm-s-default span.cm-header {color: blue;}
+.cm-s-default span.cm-quote {color: #090;}
+.cm-s-default span.cm-hr {color: #999;}
+.cm-s-default span.cm-link {color: #00c;}
+
+span.cm-header, span.cm-strong {font-weight: bold;}
+span.cm-em {font-style: italic;}
+span.cm-emstrong {font-style: italic; font-weight: bold;}
+span.cm-link {text-decoration: underline;}
+
+span.cm-invalidchar {color: #f00;}
+
+div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
+div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
+
+@media print {
+
+  /* Hide the cursor when printing */
+  .CodeMirror pre.CodeMirror-cursor {
+    visibility: hidden;
+  }
+
+}


Mime
View raw message