You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2014/08/25 15:39:41 UTC

[01/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/secondary-indexes bfe55cd20 -> 8688d16f3 (forced update)


Upgrade d3 to version 3.4.11


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/b7fc5f44
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/b7fc5f44
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/b7fc5f44

Branch: refs/heads/secondary-indexes
Commit: b7fc5f444e3878f506acfa48469ec2396d73d75c
Parents: 79c11d7
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Aug 12 15:42:37 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Aug 12 15:42:37 2014 +0200

----------------------------------------------------------------------
 assets/js/libs/d3.js | 907 ++++++++++++++++++++++------------------------
 1 file changed, 433 insertions(+), 474 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7fc5f44/assets/js/libs/d3.js
----------------------------------------------------------------------
diff --git a/assets/js/libs/d3.js b/assets/js/libs/d3.js
index b57c8d0..38a2047 100644
--- a/assets/js/libs/d3.js
+++ b/assets/js/libs/d3.js
@@ -1,6 +1,6 @@
 !function() {
   var d3 = {
-    version: "3.4.3"
+    version: "3.4.11"
   };
   if (!Date.now) Date.now = function() {
     return +new Date();
@@ -32,9 +32,10 @@
       d3_style_setProperty.call(this, name, value + "", priority);
     };
   }
-  d3.ascending = function(a, b) {
+  d3.ascending = d3_ascending;
+  function d3_ascending(a, b) {
     return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
-  };
+  }
   d3.descending = function(a, b) {
     return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
   };
@@ -90,13 +91,13 @@
     return x != null && !isNaN(x);
   }
   d3.mean = function(array, f) {
-    var n = array.length, a, m = 0, i = -1, j = 0;
+    var s = 0, n = array.length, a, i = -1, j = n;
     if (arguments.length === 1) {
-      while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j;
+      while (++i < n) if (d3_number(a = array[i])) s += a; else --j;
     } else {
-      while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j;
+      while (++i < n) if (d3_number(a = f.call(array, array[i], i))) s += a; else --j;
     }
-    return j ? m : undefined;
+    return j ? s / j : undefined;
   };
   d3.quantile = function(values, p) {
     var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h;
@@ -105,16 +106,16 @@
   d3.median = function(array, f) {
     if (arguments.length > 1) array = array.map(f);
     array = array.filter(d3_number);
-    return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined;
+    return array.length ? d3.quantile(array.sort(d3_ascending), .5) : undefined;
   };
-  d3.bisector = function(f) {
+  function d3_bisector(compare) {
     return {
       left: function(a, x, lo, hi) {
         if (arguments.length < 3) lo = 0;
         if (arguments.length < 4) hi = a.length;
         while (lo < hi) {
           var mid = lo + hi >>> 1;
-          if (f.call(a, a[mid], mid) < x) lo = mid + 1; else hi = mid;
+          if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid;
         }
         return lo;
       },
@@ -123,17 +124,20 @@
         if (arguments.length < 4) hi = a.length;
         while (lo < hi) {
           var mid = lo + hi >>> 1;
-          if (x < f.call(a, a[mid], mid)) hi = mid; else lo = mid + 1;
+          if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1;
         }
         return lo;
       }
     };
+  }
+  var d3_bisect = d3_bisector(d3_ascending);
+  d3.bisectLeft = d3_bisect.left;
+  d3.bisect = d3.bisectRight = d3_bisect.right;
+  d3.bisector = function(f) {
+    return d3_bisector(f.length === 1 ? function(d, x) {
+      return d3_ascending(f(d), x);
+    } : f);
   };
-  var d3_bisector = d3.bisector(function(d) {
-    return d;
-  });
-  d3.bisectLeft = d3_bisector.left;
-  d3.bisect = d3.bisectRight = d3_bisector.right;
   d3.shuffle = function(array) {
     var m = array.length, t, i;
     while (m) {
@@ -488,16 +492,14 @@
     return n.querySelector(s);
   }, d3_selectAll = function(s, n) {
     return n.querySelectorAll(s);
-  }, d3_selectMatcher = d3_documentElement[d3_vendorSymbol(d3_documentElement, "matchesSelector")], d3_selectMatches = function(n, s) {
+  }, d3_selectMatcher = d3_documentElement.matches || d3_documentElement[d3_vendorSymbol(d3_documentElement, "matchesSelector")], d3_selectMatches = function(n, s) {
     return d3_selectMatcher.call(n, s);
   };
   if (typeof Sizzle === "function") {
     d3_select = function(s, n) {
       return Sizzle(s, n)[0] || null;
     };
-    d3_selectAll = function(s, n) {
-      return Sizzle.uniqueSort(Sizzle(s, n));
-    };
+    d3_selectAll = Sizzle;
     d3_selectMatches = Sizzle.matchesSelector;
   }
   d3.selection = function() {
@@ -625,7 +627,7 @@
     return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g");
   }
   function d3_selection_classes(name) {
-    return name.trim().split(/^|\s+/);
+    return (name + "").trim().split(/^|\s+/);
   }
   function d3_selection_classed(name, value) {
     name = d3_selection_classes(name).map(d3_selection_classedName);
@@ -872,7 +874,7 @@
     return this.order();
   };
   function d3_selection_sortComparator(comparator) {
-    if (!arguments.length) comparator = d3.ascending;
+    if (!arguments.length) comparator = d3_ascending;
     return function(a, b) {
       return a && b ? comparator(a.__data__, b.__data__) : !a - !b;
     };
@@ -1123,46 +1125,42 @@
     }) : [];
   };
   d3.behavior.drag = function() {
-    var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, "mousemove", "mouseup"), touchstart = dragstart(touchid, touchposition, "touchmove", "touchend");
+    var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_behavior_dragMouseSubject, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_behavior_dragTouchSubject, "touchmove", "touchend");
     function drag() {
       this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart);
     }
-    function touchid() {
-      return d3.event.changedTouches[0].identifier;
-    }
-    function touchposition(parent, id) {
-      return d3.touches(parent).filter(function(p) {
-        return p.identifier === id;
-      })[0];
-    }
-    function dragstart(id, position, move, end) {
+    function dragstart(id, position, subject, move, end) {
       return function() {
-        var target = this, parent = target.parentNode, event_ = event.of(target, arguments), eventTarget = d3.event.target, eventId = id(), drag = eventId == null ? "drag" : "drag-" + eventId, origin_ = position(parent, eventId), dragged = 0, offset, w = d3.select(d3_window).on(move + "." + drag, moved).on(end + "." + drag, ended), dragRestore = d3_event_dragSuppress();
+        var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject()).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(), position0 = position(parent, dragId);
         if (origin) {
-          offset = origin.apply(target, arguments);
-          offset = [ offset.x - origin_[0], offset.y - origin_[1] ];
+          dragOffset = origin.apply(that, arguments);
+          dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];
         } else {
-          offset = [ 0, 0 ];
+          dragOffset = [ 0, 0 ];
         }
-        event_({
+        dispatch({
           type: "dragstart"
         });
         function moved() {
-          var p = position(parent, eventId), dx = p[0] - origin_[0], dy = p[1] - origin_[1];
+          var position1 = position(parent, dragId), dx, dy;
+          if (!position1) return;
+          dx = position1[0] - position0[0];
+          dy = position1[1] - position0[1];
           dragged |= dx | dy;
-          origin_ = p;
-          event_({
+          position0 = position1;
+          dispatch({
             type: "drag",
-            x: p[0] + offset[0],
-            y: p[1] + offset[1],
+            x: position1[0] + dragOffset[0],
+            y: position1[1] + dragOffset[1],
             dx: dx,
             dy: dy
           });
         }
         function ended() {
-          w.on(move + "." + drag, null).on(end + "." + drag, null);
-          dragRestore(dragged && d3.event.target === eventTarget);
-          event_({
+          if (!position(parent, dragId)) return;
+          dragSubject.on(move + dragName, null).on(end + dragName, null);
+          dragRestore(dragged && d3.event.target === target);
+          dispatch({
             type: "dragend"
           });
         }
@@ -1175,6 +1173,15 @@
     };
     return d3.rebind(drag, event, "on");
   };
+  function d3_behavior_dragTouchId() {
+    return d3.event.changedTouches[0].identifier;
+  }
+  function d3_behavior_dragTouchSubject() {
+    return d3.event.target;
+  }
+  function d3_behavior_dragMouseSubject() {
+    return d3_window;
+  }
   var π = Math.PI, τ = 2 * π, halfπ = π / 2, ε = 1e-6, ε2 = ε * ε, d3_radians = π / 180, d3_degrees = 180 / π;
   function d3_sgn(x) {
     return x > 0 ? 1 : x < 0 ? -1 : 0;
@@ -1220,13 +1227,13 @@
       x: 0,
       y: 0,
       k: 1
-    }, translate0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1;
+    }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1;
     function zoom(g) {
-      g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on(mousemove, mousewheelreset).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
+      g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
     }
     zoom.event = function(g) {
       g.each(function() {
-        var event_ = event.of(this, arguments), view1 = view;
+        var dispatch = event.of(this, arguments), view1 = view;
         if (d3_transitionInheritId) {
           d3.select(this).transition().each("start.zoom", function() {
             view = this.__chart__ || {
@@ -1234,7 +1241,7 @@
               y: 0,
               k: 1
             };
-            zoomstarted(event_);
+            zoomstarted(dispatch);
           }).tween("zoom:zoom", function() {
             var dx = size[0], dy = size[1], cx = dx / 2, cy = dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]);
             return function(t) {
@@ -1244,16 +1251,16 @@
                 y: cy - l[1] * k,
                 k: k
               };
-              zoomed(event_);
+              zoomed(dispatch);
             };
           }).each("end.zoom", function() {
-            zoomended(event_);
+            zoomended(dispatch);
           });
         } else {
           this.__chart__ = view;
-          zoomstarted(event_);
-          zoomed(event_);
-          zoomended(event_);
+          zoomstarted(dispatch);
+          zoomed(dispatch);
+          zoomended(dispatch);
         }
       });
     };
@@ -1336,46 +1343,46 @@
         return (y - view.y) / view.k;
       }).map(y0.invert));
     }
-    function zoomstarted(event) {
-      event({
+    function zoomstarted(dispatch) {
+      dispatch({
         type: "zoomstart"
       });
     }
-    function zoomed(event) {
+    function zoomed(dispatch) {
       rescale();
-      event({
+      dispatch({
         type: "zoom",
         scale: view.k,
         translate: [ view.x, view.y ]
       });
     }
-    function zoomended(event) {
-      event({
+    function zoomended(dispatch) {
+      dispatch({
         type: "zoomend"
       });
     }
     function mousedowned() {
-      var target = this, event_ = event.of(target, arguments), eventTarget = d3.event.target, dragged = 0, w = d3.select(d3_window).on(mousemove, moved).on(mouseup, ended), l = location(d3.mouse(target)), dragRestore = d3_event_dragSuppress();
-      d3_selection_interrupt.call(target);
-      zoomstarted(event_);
+      var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress();
+      d3_selection_interrupt.call(that);
+      zoomstarted(dispatch);
       function moved() {
         dragged = 1;
-        translateTo(d3.mouse(target), l);
-        zoomed(event_);
+        translateTo(d3.mouse(that), location0);
+        zoomed(dispatch);
       }
       function ended() {
-        w.on(mousemove, d3_window === target ? mousewheelreset : null).on(mouseup, null);
-        dragRestore(dragged && d3.event.target === eventTarget);
-        zoomended(event_);
+        subject.on(mousemove, null).on(mouseup, null);
+        dragRestore(dragged && d3.event.target === target);
+        zoomended(dispatch);
       }
     }
     function touchstarted() {
-      var target = this, event_ = event.of(target, arguments), locations0 = {}, distance0 = 0, scale0, eventId = d3.event.changedTouches[0].identifier, touchmove = "touchmove.zoom-" + eventId, touchend = "touchend.zoom-" + eventId, w = d3.select(d3_window).on(touchmove, moved).on(touchend, ended), t = d3.select(target).on(mousedown, null).on(touchstart, started), dragRestore = d3_event_dragSuppress();
-      d3_selection_interrupt.call(target);
+      var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that).on(mousedown, null).on(touchstart, started), dragRestore = d3_event_dragSuppress();
+      d3_selection_interrupt.call(that);
       started();
-      zoomstarted(event_);
+      zoomstarted(dispatch);
       function relocate() {
-        var touches = d3.touches(target);
+        var touches = d3.touches(that);
         scale0 = view.k;
         touches.forEach(function(t) {
           if (t.identifier in locations0) locations0[t.identifier] = location(t);
@@ -1383,6 +1390,9 @@
         return touches;
       }
       function started() {
+        var target = d3.event.target;
+        d3.select(target).on(touchmove, moved).on(touchend, ended);
+        targets.push(target);
         var changed = d3.event.changedTouches;
         for (var i = 0, n = changed.length; i < n; ++i) {
           locations0[changed[i].identifier] = null;
@@ -1394,7 +1404,7 @@
             scaleTo(view.k * 2);
             translateTo(p, l);
             d3_eventPreventDefault();
-            zoomed(event_);
+            zoomed(dispatch);
           }
           touchtime = now;
         } else if (touches.length > 1) {
@@ -1403,7 +1413,7 @@
         }
       }
       function moved() {
-        var touches = d3.touches(target), p0, l0, p1, l1;
+        var touches = d3.touches(that), p0, l0, p1, l1;
         for (var i = 0, n = touches.length; i < n; ++i, l1 = null) {
           p1 = touches[i];
           if (l1 = locations0[p1.identifier]) {
@@ -1419,7 +1429,7 @@
         }
         touchtime = null;
         translateTo(p0, l0);
-        zoomed(event_);
+        zoomed(dispatch);
       }
       function ended() {
         if (d3.event.touches.length) {
@@ -1431,37 +1441,32 @@
             return void relocate();
           }
         }
-        w.on(touchmove, null).on(touchend, null);
-        t.on(mousedown, mousedowned).on(touchstart, touchstarted);
+        d3.selectAll(targets).on(zoomName, null);
+        subject.on(mousedown, mousedowned).on(touchstart, touchstarted);
         dragRestore();
-        zoomended(event_);
+        zoomended(dispatch);
       }
     }
     function mousewheeled() {
-      var event_ = event.of(this, arguments);
-      if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this), 
-      zoomstarted(event_);
+      var dispatch = event.of(this, arguments);
+      if (mousewheelTimer) clearTimeout(mousewheelTimer); else translate0 = location(center0 = center || d3.mouse(this)), 
+      d3_selection_interrupt.call(this), zoomstarted(dispatch);
       mousewheelTimer = setTimeout(function() {
         mousewheelTimer = null;
-        zoomended(event_);
+        zoomended(dispatch);
       }, 50);
       d3_eventPreventDefault();
-      var point = center || d3.mouse(this);
-      if (!translate0) translate0 = location(point);
       scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);
-      translateTo(point, translate0);
-      zoomed(event_);
-    }
-    function mousewheelreset() {
-      translate0 = null;
+      translateTo(center0, translate0);
+      zoomed(dispatch);
     }
     function dblclicked() {
-      var event_ = event.of(this, arguments), p = d3.mouse(this), l = location(p), k = Math.log(view.k) / Math.LN2;
-      zoomstarted(event_);
+      var dispatch = event.of(this, arguments), p = d3.mouse(this), l = location(p), k = Math.log(view.k) / Math.LN2;
+      zoomstarted(dispatch);
       scaleTo(Math.pow(2, d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1));
       translateTo(p, l);
-      zoomed(event_);
-      zoomended(event_);
+      zoomed(dispatch);
+      zoomended(dispatch);
     }
     return d3.rebind(zoom, event, "on");
   };
@@ -1473,29 +1478,23 @@
   }, "mousewheel") : (d3_behavior_zoomDelta = function() {
     return -d3.event.detail;
   }, "MozMousePixelScroll");
-  function d3_Color() {}
-  d3_Color.prototype.toString = function() {
+  d3.color = d3_color;
+  function d3_color() {}
+  d3_color.prototype.toString = function() {
     return this.rgb() + "";
   };
-  d3.hsl = function(h, s, l) {
-    return arguments.length === 1 ? h instanceof d3_Hsl ? d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : d3_hsl(+h, +s, +l);
-  };
+  d3.hsl = d3_hsl;
   function d3_hsl(h, s, l) {
-    return new d3_Hsl(h, s, l);
-  }
-  function d3_Hsl(h, s, l) {
-    this.h = h;
-    this.s = s;
-    this.l = l;
+    return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l);
   }
-  var d3_hslPrototype = d3_Hsl.prototype = new d3_Color();
+  var d3_hslPrototype = d3_hsl.prototype = new d3_color();
   d3_hslPrototype.brighter = function(k) {
     k = Math.pow(.7, arguments.length ? k : 1);
-    return d3_hsl(this.h, this.s, this.l / k);
+    return new d3_hsl(this.h, this.s, this.l / k);
   };
   d3_hslPrototype.darker = function(k) {
     k = Math.pow(.7, arguments.length ? k : 1);
-    return d3_hsl(this.h, this.s, k * this.l);
+    return new d3_hsl(this.h, this.s, k * this.l);
   };
   d3_hslPrototype.rgb = function() {
     return d3_hsl_rgb(this.h, this.s, this.l);
@@ -1517,25 +1516,18 @@
     function vv(h) {
       return Math.round(v(h) * 255);
     }
-    return d3_rgb(vv(h + 120), vv(h), vv(h - 120));
+    return new d3_rgb(vv(h + 120), vv(h), vv(h - 120));
   }
-  d3.hcl = function(h, c, l) {
-    return arguments.length === 1 ? h instanceof d3_Hcl ? d3_hcl(h.h, h.c, h.l) : h instanceof d3_Lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : d3_hcl(+h, +c, +l);
-  };
+  d3.hcl = d3_hcl;
   function d3_hcl(h, c, l) {
-    return new d3_Hcl(h, c, l);
-  }
-  function d3_Hcl(h, c, l) {
-    this.h = h;
-    this.c = c;
-    this.l = l;
+    return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l);
   }
-  var d3_hclPrototype = d3_Hcl.prototype = new d3_Color();
+  var d3_hclPrototype = d3_hcl.prototype = new d3_color();
   d3_hclPrototype.brighter = function(k) {
-    return d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)));
+    return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)));
   };
   d3_hclPrototype.darker = function(k) {
-    return d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)));
+    return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)));
   };
   d3_hclPrototype.rgb = function() {
     return d3_hcl_lab(this.h, this.c, this.l).rgb();
@@ -1543,27 +1535,20 @@
   function d3_hcl_lab(h, c, l) {
     if (isNaN(h)) h = 0;
     if (isNaN(c)) c = 0;
-    return d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c);
+    return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c);
   }
-  d3.lab = function(l, a, b) {
-    return arguments.length === 1 ? l instanceof d3_Lab ? d3_lab(l.l, l.a, l.b) : l instanceof d3_Hcl ? d3_hcl_lab(l.l, l.c, l.h) : d3_rgb_lab((l = d3.rgb(l)).r, l.g, l.b) : d3_lab(+l, +a, +b);
-  };
+  d3.lab = d3_lab;
   function d3_lab(l, a, b) {
-    return new d3_Lab(l, a, b);
-  }
-  function d3_Lab(l, a, b) {
-    this.l = l;
-    this.a = a;
-    this.b = b;
+    return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.l, l.c, l.h) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b);
   }
   var d3_lab_K = 18;
   var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883;
-  var d3_labPrototype = d3_Lab.prototype = new d3_Color();
+  var d3_labPrototype = d3_lab.prototype = new d3_color();
   d3_labPrototype.brighter = function(k) {
-    return d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
+    return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
   };
   d3_labPrototype.darker = function(k) {
-    return d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
+    return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
   };
   d3_labPrototype.rgb = function() {
     return d3_lab_rgb(this.l, this.a, this.b);
@@ -1573,10 +1558,10 @@
     x = d3_lab_xyz(x) * d3_lab_X;
     y = d3_lab_xyz(y) * d3_lab_Y;
     z = d3_lab_xyz(z) * d3_lab_Z;
-    return d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z));
+    return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z));
   }
   function d3_lab_hcl(l, a, b) {
-    return l > 0 ? d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : d3_hcl(NaN, NaN, l);
+    return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l);
   }
   function d3_lab_xyz(x) {
     return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037;
@@ -1587,36 +1572,29 @@
   function d3_xyz_rgb(r) {
     return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055));
   }
-  d3.rgb = function(r, g, b) {
-    return arguments.length === 1 ? r instanceof d3_Rgb ? d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : d3_rgb(~~r, ~~g, ~~b);
-  };
+  d3.rgb = d3_rgb;
+  function d3_rgb(r, g, b) {
+    return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b);
+  }
   function d3_rgbNumber(value) {
-    return d3_rgb(value >> 16, value >> 8 & 255, value & 255);
+    return new d3_rgb(value >> 16, value >> 8 & 255, value & 255);
   }
   function d3_rgbString(value) {
     return d3_rgbNumber(value) + "";
   }
-  function d3_rgb(r, g, b) {
-    return new d3_Rgb(r, g, b);
-  }
-  function d3_Rgb(r, g, b) {
-    this.r = r;
-    this.g = g;
-    this.b = b;
-  }
-  var d3_rgbPrototype = d3_Rgb.prototype = new d3_Color();
+  var d3_rgbPrototype = d3_rgb.prototype = new d3_color();
   d3_rgbPrototype.brighter = function(k) {
     k = Math.pow(.7, arguments.length ? k : 1);
     var r = this.r, g = this.g, b = this.b, i = 30;
-    if (!r && !g && !b) return d3_rgb(i, i, i);
+    if (!r && !g && !b) return new d3_rgb(i, i, i);
     if (r && r < i) r = i;
     if (g && g < i) g = i;
     if (b && b < i) b = i;
-    return d3_rgb(Math.min(255, ~~(r / k)), Math.min(255, ~~(g / k)), Math.min(255, ~~(b / k)));
+    return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k));
   };
   d3_rgbPrototype.darker = function(k) {
     k = Math.pow(.7, arguments.length ? k : 1);
-    return d3_rgb(~~(k * this.r), ~~(k * this.g), ~~(k * this.b));
+    return new d3_rgb(k * this.r, k * this.g, k * this.b);
   };
   d3_rgbPrototype.hsl = function() {
     return d3_rgb_hsl(this.r, this.g, this.b);
@@ -1628,7 +1606,7 @@
     return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16);
   }
   function d3_rgb_parse(format, rgb, hsl) {
-    var r = 0, g = 0, b = 0, m1, m2, name;
+    var r = 0, g = 0, b = 0, m1, m2, color;
     m1 = /([a-z]+)\((.*)\)/i.exec(format);
     if (m1) {
       m2 = m1[2].split(",");
@@ -1644,23 +1622,20 @@
         }
       }
     }
-    if (name = d3_rgb_names.get(format)) return rgb(name.r, name.g, name.b);
-    if (format != null && format.charAt(0) === "#") {
+    if (color = d3_rgb_names.get(format)) return rgb(color.r, color.g, color.b);
+    if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.substring(1), 16))) {
       if (format.length === 4) {
-        r = format.charAt(1);
-        r += r;
-        g = format.charAt(2);
-        g += g;
-        b = format.charAt(3);
-        b += b;
+        r = (color & 3840) >> 4;
+        r = r >> 4 | r;
+        g = color & 240;
+        g = g >> 4 | g;
+        b = color & 15;
+        b = b << 4 | b;
       } else if (format.length === 7) {
-        r = format.substring(1, 3);
-        g = format.substring(3, 5);
-        b = format.substring(5, 7);
+        r = (color & 16711680) >> 16;
+        g = (color & 65280) >> 8;
+        b = color & 255;
       }
-      r = parseInt(r, 16);
-      g = parseInt(g, 16);
-      b = parseInt(b, 16);
     }
     return rgb(r, g, b);
   }
@@ -1674,7 +1649,7 @@
       h = NaN;
       s = l > 0 && l < 1 ? 0 : h;
     }
-    return d3_hsl(h, s, l);
+    return new d3_hsl(h, s, l);
   }
   function d3_rgb_lab(r, g, b) {
     r = d3_rgb_xyz(r);
@@ -2043,6 +2018,14 @@
   };
   d3.csv = d3.dsv(",", "text/csv");
   d3.tsv = d3.dsv("	", "text/tab-separated-values");
+  d3.touch = function(container, touches, identifier) {
+    if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;
+    if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {
+      if ((touch = touches[i]).identifier === identifier) {
+        return d3_mousePoint(container, touch);
+      }
+    }
+  };
   var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = d3_window[d3_vendorSymbol(d3_window, "requestAnimationFrame")] || function(callback) {
     setTimeout(callback, 17);
   };
@@ -2116,7 +2099,7 @@
       if (value < 0) value *= -1;
       if (precision) value = d3.round(value, d3_format_precision(value, precision));
       i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);
-      i = Math.max(-24, Math.min(24, Math.floor((i <= 0 ? i + 1 : i - 1) / 3) * 3));
+      i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3));
     }
     return d3_formatPrefixes[8 + i / 3];
   };
@@ -2678,7 +2661,7 @@
     return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;
   }
   function d3_time_parseZone(date, string, i) {
-    return /^[+-]\d{4}$/.test(string = string.substring(i, i + 5)) ? (date.Z = +string, 
+    return /^[+-]\d{4}$/.test(string = string.substring(i, i + 5)) ? (date.Z = -string, 
     i + 5) : -1;
   }
   function d3_time_expandYear(d) {
@@ -3227,7 +3210,6 @@
           clip.lineEnd = ringEnd;
           segments = [];
           polygon = [];
-          listener.polygonStart();
         },
         polygonEnd: function() {
           clip.point = point;
@@ -3236,13 +3218,15 @@
           segments = d3.merge(segments);
           var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon);
           if (segments.length) {
+            if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
             d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener);
           } else if (clipStartInside) {
+            if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
             listener.lineStart();
             interpolate(null, null, 1, listener);
             listener.lineEnd();
           }
-          listener.polygonEnd();
+          if (polygonStarted) listener.polygonEnd(), polygonStarted = false;
           segments = polygon = null;
         },
         sphere: function() {
@@ -3270,7 +3254,7 @@
         line.lineEnd();
       }
       var segments;
-      var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygon, ring;
+      var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring;
       function pointRing(λ, φ) {
         ring.push([ λ, φ ]);
         var point = rotate(λ, φ);
@@ -3291,9 +3275,12 @@
         if (clean & 1) {
           segment = ringSegments[0];
           var n = segment.length - 1, i = -1, point;
-          listener.lineStart();
-          while (++i < n) listener.point((point = segment[i])[0], point[1]);
-          listener.lineEnd();
+          if (n > 0) {
+            if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
+            listener.lineStart();
+            while (++i < n) listener.point((point = segment[i])[0], point[1]);
+            listener.lineEnd();
+          }
           return;
         }
         if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
@@ -4598,7 +4585,12 @@
     }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n;
     if (!n) return d3_geo_mercator;
     function forward(λ, φ) {
-      var ρ = abs(abs(φ) - halfπ) < ε ? 0 : F / Math.pow(t(φ), n);
+      if (F > 0) {
+        if (φ < -halfπ + ε) φ = -halfπ + ε;
+      } else {
+        if (φ > halfπ - ε) φ = halfπ - ε;
+      }
+      var ρ = F / Math.pow(t(φ), n);
       return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ];
     }
     forward.invert = function(x, y) {
@@ -4688,13 +4680,13 @@
   (d3.geo.transverseMercator = function() {
     var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate;
     projection.center = function(_) {
-      return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ -_[1], _[0] ]);
+      return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]);
     };
     projection.rotate = function(_) {
       return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), 
       [ _[0], _[1], _[2] - 90 ]);
     };
-    return projection.rotate([ 0, 0 ]);
+    return rotate([ 0, 0, 90 ]);
   }).raw = d3_geo_transverseMercator;
   d3.geom = {};
   function d3_geom_pointX(d) {
@@ -5615,71 +5607,38 @@
   }
   d3.interpolateString = d3_interpolateString;
   function d3_interpolateString(a, b) {
-    var m, i, j, s0 = 0, s1 = 0, s = [], q = [], n, o;
+    var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
     a = a + "", b = b + "";
-    d3_interpolate_number.lastIndex = 0;
-    for (i = 0; m = d3_interpolate_number.exec(b); ++i) {
-      if (m.index) s.push(b.substring(s0, s1 = m.index));
-      q.push({
-        i: s.length,
-        x: m[0]
-      });
-      s.push(null);
-      s0 = d3_interpolate_number.lastIndex;
-    }
-    if (s0 < b.length) s.push(b.substring(s0));
-    for (i = 0, n = q.length; (m = d3_interpolate_number.exec(a)) && i < n; ++i) {
-      o = q[i];
-      if (o.x == m[0]) {
-        if (o.i) {
-          if (s[o.i + 1] == null) {
-            s[o.i - 1] += o.x;
-            s.splice(o.i, 1);
-            for (j = i + 1; j < n; ++j) q[j].i--;
-          } else {
-            s[o.i - 1] += o.x + s[o.i + 1];
-            s.splice(o.i, 2);
-            for (j = i + 1; j < n; ++j) q[j].i -= 2;
-          }
-        } else {
-          if (s[o.i + 1] == null) {
-            s[o.i] = o.x;
-          } else {
-            s[o.i] = o.x + s[o.i + 1];
-            s.splice(o.i + 1, 1);
-            for (j = i + 1; j < n; ++j) q[j].i--;
-          }
-        }
-        q.splice(i, 1);
-        n--;
-        i--;
-      } else {
-        o.x = d3_interpolateNumber(parseFloat(m[0]), parseFloat(o.x));
+    while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) {
+      if ((bs = bm.index) > bi) {
+        bs = b.substring(bi, bs);
+        if (s[i]) s[i] += bs; else s[++i] = bs;
       }
-    }
-    while (i < n) {
-      o = q.pop();
-      if (s[o.i + 1] == null) {
-        s[o.i] = o.x;
+      if ((am = am[0]) === (bm = bm[0])) {
+        if (s[i]) s[i] += bm; else s[++i] = bm;
       } else {
-        s[o.i] = o.x + s[o.i + 1];
-        s.splice(o.i + 1, 1);
+        s[++i] = null;
+        q.push({
+          i: i,
+          x: d3_interpolateNumber(am, bm)
+        });
       }
-      n--;
+      bi = d3_interpolate_numberB.lastIndex;
     }
-    if (s.length === 1) {
-      return s[0] == null ? (o = q[0].x, function(t) {
-        return o(t) + "";
-      }) : function() {
-        return b;
-      };
+    if (bi < b.length) {
+      bs = b.substring(bi);
+      if (s[i]) s[i] += bs; else s[++i] = bs;
     }
-    return function(t) {
-      for (i = 0; i < n; ++i) s[(o = q[i]).i] = o.x(t);
+    return s.length < 2 ? q[0] ? (b = q[0].x, function(t) {
+      return b(t) + "";
+    }) : function() {
+      return b;
+    } : (b = q.length, function(t) {
+      for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
       return s.join("");
-    };
+    });
   }
-  var d3_interpolate_number = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
+  var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g");
   d3.interpolate = d3_interpolate;
   function d3_interpolate(a, b) {
     var i = d3.interpolators.length, f;
@@ -5688,7 +5647,7 @@
   }
   d3.interpolators = [ function(a, b) {
     var t = typeof b;
-    return (t === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_Color ? d3_interpolateRgb : t === "object" ? Array.isArray(b) ? d3_interpolateArray : d3_interpolateObject : d3_interpolateNumber)(a, b);
+    return (t === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b);
   } ];
   d3.interpolateArray = d3_interpolateArray;
   function d3_interpolateArray(a, b) {
@@ -6359,41 +6318,30 @@
   var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity;
   d3.layout.hierarchy = function() {
     var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;
-    function recurse(node, depth, nodes) {
-      var childs = children.call(hierarchy, node, depth);
-      node.depth = depth;
-      nodes.push(node);
-      if (childs && (n = childs.length)) {
-        var i = -1, n, c = node.children = new Array(n), v = 0, j = depth + 1, d;
-        while (++i < n) {
-          d = c[i] = recurse(childs[i], j, nodes);
-          d.parent = node;
-          v += d.value;
-        }
-        if (sort) c.sort(sort);
-        if (value) node.value = v;
-      } else {
-        delete node.children;
-        if (value) {
-          node.value = +value.call(hierarchy, node, depth) || 0;
+    function hierarchy(root) {
+      var stack = [ root ], nodes = [], node;
+      root.depth = 0;
+      while ((node = stack.pop()) != null) {
+        nodes.push(node);
+        if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) {
+          var n, childs, child;
+          while (--n >= 0) {
+            stack.push(child = childs[n]);
+            child.parent = node;
+            child.depth = node.depth + 1;
+          }
+          if (value) node.value = 0;
+          node.children = childs;
+        } else {
+          if (value) node.value = +value.call(hierarchy, node, node.depth) || 0;
+          delete node.children;
         }
       }
-      return node;
-    }
-    function revalue(node, depth) {
-      var children = node.children, v = 0;
-      if (children && (n = children.length)) {
-        var i = -1, n, j = depth + 1;
-        while (++i < n) v += revalue(children[i], j);
-      } else if (value) {
-        v = +value.call(hierarchy, node, depth) || 0;
-      }
-      if (value) node.value = v;
-      return v;
-    }
-    function hierarchy(d) {
-      var nodes = [];
-      recurse(d, 0, nodes);
+      d3_layout_hierarchyVisitAfter(root, function(node) {
+        var childs, parent;
+        if (sort && (childs = node.children)) childs.sort(sort);
+        if (value && (parent = node.parent)) parent.value += node.value;
+      });
       return nodes;
     }
     hierarchy.sort = function(x) {
@@ -6412,7 +6360,16 @@
       return hierarchy;
     };
     hierarchy.revalue = function(root) {
-      revalue(root, 0);
+      if (value) {
+        d3_layout_hierarchyVisitBefore(root, function(node) {
+          if (node.children) node.value = 0;
+        });
+        d3_layout_hierarchyVisitAfter(root, function(node) {
+          var parent;
+          if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0;
+          if (parent = node.parent) parent.value += node.value;
+        });
+      }
       return root;
     };
     return hierarchy;
@@ -6423,6 +6380,29 @@
     object.links = d3_layout_hierarchyLinks;
     return object;
   }
+  function d3_layout_hierarchyVisitBefore(node, callback) {
+    var nodes = [ node ];
+    while ((node = nodes.pop()) != null) {
+      callback(node);
+      if ((children = node.children) && (n = children.length)) {
+        var n, children;
+        while (--n >= 0) nodes.push(children[n]);
+      }
+    }
+  }
+  function d3_layout_hierarchyVisitAfter(node, callback) {
+    var nodes = [ node ], nodes2 = [];
+    while ((node = nodes.pop()) != null) {
+      nodes2.push(node);
+      if ((children = node.children) && (n = children.length)) {
+        var i = -1, n, children;
+        while (++i < n) nodes.push(children[i]);
+      }
+    }
+    while ((node = nodes2.pop()) != null) {
+      callback(node);
+    }
+  }
   function d3_layout_hierarchyChildren(d) {
     return d.children;
   }
@@ -6738,185 +6718,6 @@
   function d3_layout_histogramRange(values) {
     return [ d3.min(values), d3.max(values) ];
   }
-  d3.layout.tree = function() {
-    var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;
-    function tree(d, i) {
-      var nodes = hierarchy.call(this, d, i), root = nodes[0];
-      function firstWalk(node, previousSibling) {
-        var children = node.children, layout = node._tree;
-        if (children && (n = children.length)) {
-          var n, firstChild = children[0], previousChild, ancestor = firstChild, child, i = -1;
-          while (++i < n) {
-            child = children[i];
-            firstWalk(child, previousChild);
-            ancestor = apportion(child, previousChild, ancestor);
-            previousChild = child;
-          }
-          d3_layout_treeShift(node);
-          var midpoint = .5 * (firstChild._tree.prelim + child._tree.prelim);
-          if (previousSibling) {
-            layout.prelim = previousSibling._tree.prelim + separation(node, previousSibling);
-            layout.mod = layout.prelim - midpoint;
-          } else {
-            layout.prelim = midpoint;
-          }
-        } else {
-          if (previousSibling) {
-            layout.prelim = previousSibling._tree.prelim + separation(node, previousSibling);
-          }
-        }
-      }
-      function secondWalk(node, x) {
-        node.x = node._tree.prelim + x;
-        var children = node.children;
-        if (children && (n = children.length)) {
-          var i = -1, n;
-          x += node._tree.mod;
-          while (++i < n) {
-            secondWalk(children[i], x);
-          }
-        }
-      }
-      function apportion(node, previousSibling, ancestor) {
-        if (previousSibling) {
-          var vip = node, vop = node, vim = previousSibling, vom = node.parent.children[0], sip = vip._tree.mod, sop = vop._tree.mod, sim = vim._tree.mod, som = vom._tree.mod, shift;
-          while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {
-            vom = d3_layout_treeLeft(vom);
-            vop = d3_layout_treeRight(vop);
-            vop._tree.ancestor = node;
-            shift = vim._tree.prelim + sim - vip._tree.prelim - sip + separation(vim, vip);
-            if (shift > 0) {
-              d3_layout_treeMove(d3_layout_treeAncestor(vim, node, ancestor), node, shift);
-              sip += shift;
-              sop += shift;
-            }
-            sim += vim._tree.mod;
-            sip += vip._tree.mod;
-            som += vom._tree.mod;
-            sop += vop._tree.mod;
-          }
-          if (vim && !d3_layout_treeRight(vop)) {
-            vop._tree.thread = vim;
-            vop._tree.mod += sim - sop;
-          }
-          if (vip && !d3_layout_treeLeft(vom)) {
-            vom._tree.thread = vip;
-            vom._tree.mod += sip - som;
-            ancestor = node;
-          }
-        }
-        return ancestor;
-      }
-      d3_layout_treeVisitAfter(root, function(node, previousSibling) {
-        node._tree = {
-          ancestor: node,
-          prelim: 0,
-          mod: 0,
-          change: 0,
-          shift: 0,
-          number: previousSibling ? previousSibling._tree.number + 1 : 0
-        };
-      });
-      firstWalk(root);
-      secondWalk(root, -root._tree.prelim);
-      var left = d3_layout_treeSearch(root, d3_layout_treeLeftmost), right = d3_layout_treeSearch(root, d3_layout_treeRightmost), deep = d3_layout_treeSearch(root, d3_layout_treeDeepest), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2, y1 = deep.depth || 1;
-      d3_layout_treeVisitAfter(root, nodeSize ? function(node) {
-        node.x *= size[0];
-        node.y = node.depth * size[1];
-        delete node._tree;
-      } : function(node) {
-        node.x = (node.x - x0) / (x1 - x0) * size[0];
-        node.y = node.depth / y1 * size[1];
-        delete node._tree;
-      });
-      return nodes;
-    }
-    tree.separation = function(x) {
-      if (!arguments.length) return separation;
-      separation = x;
-      return tree;
-    };
-    tree.size = function(x) {
-      if (!arguments.length) return nodeSize ? null : size;
-      nodeSize = (size = x) == null;
-      return tree;
-    };
-    tree.nodeSize = function(x) {
-      if (!arguments.length) return nodeSize ? size : null;
-      nodeSize = (size = x) != null;
-      return tree;
-    };
-    return d3_layout_hierarchyRebind(tree, hierarchy);
-  };
-  function d3_layout_treeSeparation(a, b) {
-    return a.parent == b.parent ? 1 : 2;
-  }
-  function d3_layout_treeLeft(node) {
-    var children = node.children;
-    return children && children.length ? children[0] : node._tree.thread;
-  }
-  function d3_layout_treeRight(node) {
-    var children = node.children, n;
-    return children && (n = children.length) ? children[n - 1] : node._tree.thread;
-  }
-  function d3_layout_treeSearch(node, compare) {
-    var children = node.children;
-    if (children && (n = children.length)) {
-      var child, n, i = -1;
-      while (++i < n) {
-        if (compare(child = d3_layout_treeSearch(children[i], compare), node) > 0) {
-          node = child;
-        }
-      }
-    }
-    return node;
-  }
-  function d3_layout_treeRightmost(a, b) {
-    return a.x - b.x;
-  }
-  function d3_layout_treeLeftmost(a, b) {
-    return b.x - a.x;
-  }
-  function d3_layout_treeDeepest(a, b) {
-    return a.depth - b.depth;
-  }
-  function d3_layout_treeVisitAfter(node, callback) {
-    function visit(node, previousSibling) {
-      var children = node.children;
-      if (children && (n = children.length)) {
-        var child, previousChild = null, i = -1, n;
-        while (++i < n) {
-          child = children[i];
-          visit(child, previousChild);
-          previousChild = child;
-        }
-      }
-      callback(node, previousSibling);
-    }
-    visit(node, null);
-  }
-  function d3_layout_treeShift(node) {
-    var shift = 0, change = 0, children = node.children, i = children.length, child;
-    while (--i >= 0) {
-      child = children[i]._tree;
-      child.prelim += shift;
-      child.mod += shift;
-      shift += child.shift + (change += child.change);
-    }
-  }
-  function d3_layout_treeMove(ancestor, node, shift) {
-    ancestor = ancestor._tree;
-    node = node._tree;
-    var change = shift / (node.number - ancestor.number);
-    ancestor.change += change;
-    node.change -= change;
-    node.shift += shift;
-    node.prelim += shift;
-    node.mod += shift;
-  }
-  function d3_layout_treeAncestor(vim, node, ancestor) {
-    return vim._tree.ancestor.parent == node.parent ? vim._tree.ancestor : ancestor;
-  }
   d3.layout.pack = function() {
     var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius;
     function pack(d, i) {
@@ -6924,17 +6725,17 @@
         return radius;
       };
       root.x = root.y = 0;
-      d3_layout_treeVisitAfter(root, function(d) {
+      d3_layout_hierarchyVisitAfter(root, function(d) {
         d.r = +r(d.value);
       });
-      d3_layout_treeVisitAfter(root, d3_layout_packSiblings);
+      d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
       if (padding) {
         var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2;
-        d3_layout_treeVisitAfter(root, function(d) {
+        d3_layout_hierarchyVisitAfter(root, function(d) {
           d.r += dr;
         });
-        d3_layout_treeVisitAfter(root, d3_layout_packSiblings);
-        d3_layout_treeVisitAfter(root, function(d) {
+        d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
+        d3_layout_hierarchyVisitAfter(root, function(d) {
           d.r -= dr;
         });
       }
@@ -7071,11 +6872,158 @@
       c.y = a.y;
     }
   }
+  d3.layout.tree = function() {
+    var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null;
+    function tree(d, i) {
+      var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0);
+      d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z;
+      d3_layout_hierarchyVisitBefore(root1, secondWalk);
+      if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else {
+        var left = root0, right = root0, bottom = root0;
+        d3_layout_hierarchyVisitBefore(root0, function(node) {
+          if (node.x < left.x) left = node;
+          if (node.x > right.x) right = node;
+          if (node.depth > bottom.depth) bottom = node;
+        });
+        var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1);
+        d3_layout_hierarchyVisitBefore(root0, function(node) {
+          node.x = (node.x + tx) * kx;
+          node.y = node.depth * ky;
+        });
+      }
+      return nodes;
+    }
+    function wrapTree(root0) {
+      var root1 = {
+        A: null,
+        children: [ root0 ]
+      }, queue = [ root1 ], node1;
+      while ((node1 = queue.pop()) != null) {
+        for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) {
+          queue.push((children[i] = child = {
+            _: children[i],
+            parent: node1,
+            children: (child = children[i].children) && child.slice() || [],
+            A: null,
+            a: null,
+            z: 0,
+            m: 0,
+            c: 0,
+            s: 0,
+            t: null,
+            i: i
+          }).a = child);
+        }
+      }
+      return root1.children[0];
+    }
+    function firstWalk(v) {
+      var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;
+      if (children.length) {
+        d3_layout_treeShift(v);
+        var midpoint = (children[0].z + children[children.length - 1].z) / 2;
+        if (w) {
+          v.z = w.z + separation(v._, w._);
+          v.m = v.z - midpoint;
+        } else {
+          v.z = midpoint;
+        }
+      } else if (w) {
+        v.z = w.z + separation(v._, w._);
+      }
+      v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
+    }
+    function secondWalk(v) {
+      v._.x = v.z + v.parent.m;
+      v.m += v.parent.m;
+    }
+    function apportion(v, w, ancestor) {
+      if (w) {
+        var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
+        while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {
+          vom = d3_layout_treeLeft(vom);
+          vop = d3_layout_treeRight(vop);
+          vop.a = v;
+          shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
+          if (shift > 0) {
+            d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift);
+            sip += shift;
+            sop += shift;
+          }
+          sim += vim.m;
+          sip += vip.m;
+          som += vom.m;
+          sop += vop.m;
+        }
+        if (vim && !d3_layout_treeRight(vop)) {
+          vop.t = vim;
+          vop.m += sim - sop;
+        }
+        if (vip && !d3_layout_treeLeft(vom)) {
+          vom.t = vip;
+          vom.m += sip - som;
+          ancestor = v;
+        }
+      }
+      return ancestor;
+    }
+    function sizeNode(node) {
+      node.x *= size[0];
+      node.y = node.depth * size[1];
+    }
+    tree.separation = function(x) {
+      if (!arguments.length) return separation;
+      separation = x;
+      return tree;
+    };
+    tree.size = function(x) {
+      if (!arguments.length) return nodeSize ? null : size;
+      nodeSize = (size = x) == null ? sizeNode : null;
+      return tree;
+    };
+    tree.nodeSize = function(x) {
+      if (!arguments.length) return nodeSize ? size : null;
+      nodeSize = (size = x) == null ? null : sizeNode;
+      return tree;
+    };
+    return d3_layout_hierarchyRebind(tree, hierarchy);
+  };
+  function d3_layout_treeSeparation(a, b) {
+    return a.parent == b.parent ? 1 : 2;
+  }
+  function d3_layout_treeLeft(v) {
+    var children = v.children;
+    return children.length ? children[0] : v.t;
+  }
+  function d3_layout_treeRight(v) {
+    var children = v.children, n;
+    return (n = children.length) ? children[n - 1] : v.t;
+  }
+  function d3_layout_treeMove(wm, wp, shift) {
+    var change = shift / (wp.i - wm.i);
+    wp.c -= change;
+    wp.s += shift;
+    wm.c += change;
+    wp.z += shift;
+    wp.m += shift;
+  }
+  function d3_layout_treeShift(v) {
+    var shift = 0, change = 0, children = v.children, i = children.length, w;
+    while (--i >= 0) {
+      w = children[i];
+      w.z += shift;
+      w.m += shift;
+      shift += w.s + (change += w.c);
+    }
+  }
+  function d3_layout_treeAncestor(vim, v, ancestor) {
+    return vim.a.parent === v.parent ? vim.a : ancestor;
+  }
   d3.layout.cluster = function() {
     var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;
     function cluster(d, i) {
       var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;
-      d3_layout_treeVisitAfter(root, function(node) {
+      d3_layout_hierarchyVisitAfter(root, function(node) {
         var children = node.children;
         if (children && children.length) {
           node.x = d3_layout_clusterX(children);
@@ -7087,7 +7035,7 @@
         }
       });
       var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;
-      d3_layout_treeVisitAfter(root, nodeSize ? function(node) {
+      d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) {
         node.x = (node.x - root.x) * size[0];
         node.y = (root.y - node.y) * size[1];
       } : function(node) {
@@ -7466,9 +7414,24 @@
   }
   function d3_scale_linearTickFormat(domain, m, format) {
     var range = d3_scale_linearTickRange(domain, m);
-    return d3.format(format ? format.replace(d3_format_re, function(a, b, c, d, e, f, g, h, i, j) {
-      return [ b, c, d, e, f, g, h, i || "." + d3_scale_linearFormatPrecision(j, range), j ].join("");
-    }) : ",." + d3_scale_linearPrecision(range[2]) + "f");
+    if (format) {
+      var match = d3_format_re.exec(format);
+      match.shift();
+      if (match[8] === "s") {
+        var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1])));
+        if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2]));
+        match[8] = "f";
+        format = d3.format(match.join(""));
+        return function(d) {
+          return format(prefix.scale(d)) + prefix.symbol;
+        };
+      }
+      if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range);
+      format = match.join("");
+    } else {
+      format = ",." + d3_scale_linearPrecision(range[2]) + "f";
+    }
+    return d3.format(format);
   }
   var d3_scale_linearFormatSignificant = {
     s: 1,
@@ -7482,7 +7445,7 @@
   }
   function d3_scale_linearFormatPrecision(type, range) {
     var p = d3_scale_linearPrecision(range[2]);
-    return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(Math.abs(range[0]), Math.abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2;
+    return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2;
   }
   d3.scale.log = function() {
     return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]);
@@ -7610,7 +7573,7 @@
   function d3_scale_ordinal(domain, ranger) {
     var index, range, rangeBand;
     function scale(x) {
-      return range[((index.get(x) || ranger.t === "range" && index.set(x, domain.push(x))) - 1) % range.length];
+      return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length];
     }
     function steps(start, step) {
       return d3.range(domain.length).map(function(i) {
@@ -7715,9 +7678,7 @@
     }
     scale.domain = function(x) {
       if (!arguments.length) return domain;
-      domain = x.filter(function(d) {
-        return !isNaN(d);
-      }).sort(d3.ascending);
+      domain = x.filter(d3_number).sort(d3_ascending);
       return rescale();
     };
     scale.range = function(x) {
@@ -8558,6 +8519,7 @@
   };
   d3_transitionPrototype.delay = function(value) {
     var id = this.id;
+    if (arguments.length < 1) return this.node().__transition__[id].delay;
     return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
       node.__transition__[id].delay = +value.call(node, node.__data__, i, j);
     } : (value = +value, function(node) {
@@ -8566,6 +8528,7 @@
   };
   d3_transitionPrototype.duration = function(value) {
     var id = this.id;
+    if (arguments.length < 1) return this.node().__transition__[id].duration;
     return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
       node.__transition__[id].duration = Math.max(1, value.call(node, node.__data__, i, j));
     } : (value = Math.max(1, value), function(node) {
@@ -8664,7 +8627,7 @@
       g.each(function() {
         var g = d3.select(this);
         var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();
-        var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick).style("opacity", 1), tickTransform;
+        var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickTransform;
         var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), 
         d3.transition(path));
         tickEnter.append("line");
@@ -9214,7 +9177,7 @@
   } ], [ "%Y", d3_true ] ]);
   var d3_time_scaleMilliseconds = {
     range: function(start, stop, step) {
-      return d3.range(+start, +stop, step).map(d3_time_scaleDate);
+      return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate);
     },
     floor: d3_identity,
     ceil: d3_identity
@@ -9265,11 +9228,7 @@
   d3.xml = d3_xhrType(function(request) {
     return request.responseXML;
   });
-  if (typeof define === "function" && define.amd) {
-    define(d3);
-  } else if (typeof module === "object" && module.exports) {
-    module.exports = d3;
-  } else {
-    this.d3 = d3;
-  }
-}();
\ No newline at end of file
+  if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3;
+  this.d3 = d3;
+}();
+


[22/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
style form fields and tab buttons


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/0a50426f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/0a50426f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/0a50426f

Branch: refs/heads/secondary-indexes
Commit: 0a50426fb18185fb943f109729139c136ecfec14
Parents: 2833356
Author: Jenn Schiffer <je...@pancaketheorem.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:35:09 2014 -0400

----------------------------------------------------------------------
 .../documents/assets/less/advancedOptions.less  | 37 +++++++++++++++++++-
 .../documents/templates/advanced_options.html   |  4 +--
 2 files changed, 38 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0a50426f/app/addons/documents/assets/less/advancedOptions.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/advancedOptions.less b/app/addons/documents/assets/less/advancedOptions.less
index 0ff8124..b68dfd5 100644
--- a/app/addons/documents/assets/less/advancedOptions.less
+++ b/app/addons/documents/assets/less/advancedOptions.less
@@ -27,7 +27,7 @@
     margin: 0;
     .query-group {
       padding: 20px;
-      border-bottom: 1px solid #ccc;
+      border-bottom: 1px solid #555;
     }
     .query-group:last-child {
       border-bottom: none;
@@ -44,6 +44,38 @@
     .dropdown.inline {
       display: inline-block;
     }
+    input[type="text"],
+    textarea {
+      .border-radius(5px);
+      background-color: #666;
+      padding: 8px;
+      border: none;
+      color: #eee;
+    }
+    .btn-success {
+      .border-radius(5px);
+    }
+  }
+  .toggle-btns {
+    .btn {
+      padding: 5px 5px 3px;
+      background: #727A82;
+      color: #fff;
+      font-size: 12px;
+      border: none;
+    }
+    .btn.active {
+      background: #fff;
+      color: #E33F3B;
+      box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.25) inset, 2px 2px 2px rgba(0, 0, 0, 0.15);
+    }
+    label:first-child {
+      .border-radius(5px 0 0 5px);
+    }
+    label:last-child {
+      .border-radius(0 5px 5px 0);
+      margin-left: 1px;
+    }
   }
 }
 #query:before {
@@ -57,3 +89,6 @@
   width: 0;
   height: 0;
 }
+#button-options {
+  margin-top: 20px;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0a50426f/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/advanced_options.html b/app/addons/documents/templates/advanced_options.html
index 1fc9546..c6268fb 100644
--- a/app/addons/documents/templates/advanced_options.html
+++ b/app/addons/documents/templates/advanced_options.html
@@ -65,10 +65,10 @@ the License.
     </span>
     <!-- tabs for choosing Keys or Start & end -->
     <div class="btn-group toggle-btns row-fluid">
-      <label for="showKeys" class="drop-down btn span6">
+      <label for="showKeys" class="drop-down btn">
        By Key(s)
       </label>
-      <label for="showStartEnd" class="drop-down btn span6">
+      <label for="showStartEnd" class="drop-down btn">
         Between Keys
       </label>
     </div>


[18/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
move around query options, init style
Adding Views, testing header stuff,  fixing layout issues
Add all the indexes to the sidebar
Fix sidebar to work with different indexes
Added the apache license
changed a comment ffs.
Ripping out views into it's own addon
An insane amount of header stuff
design doc ui
Move Fauxton's apibar and breadcrumbs out into components
fix new indexes
buncha editor stuff
making the preview page look less butts.
Styling the view form
documents
This stuff can't be tables. Boo.
less for indexes
resize stuff
And more refactor stuff
View editor updates,
Splitting out less files
An absolute abortion happening in the resizeColumns file
style form fields and tab buttons
move around query options, init style
routes stuff
removed the breadcrumbs POC
Step one in cleaning up that gnarly save on indexes
Always show editor
fixing layout
Adding Views, testing header stuff,  fixing layout issues
Add all the indexes to the sidebar
Fix sidebar to work with different indexes
Added the apache license
changed a comment ffs.
Ripping out views into it's own addon
Setting Up Indexes addon


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/28333566
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/28333566
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/28333566

Branch: refs/heads/secondary-indexes
Commit: 28333566cf546ea76d0bf809cdcf97726bebcfc2
Parents: 0396942
Author: Jenn Schiffer <je...@pancaketheorem.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:35:08 2014 -0400

----------------------------------------------------------------------
 .gitignore                                      |   1 +
 .../documents/assets/less/advancedOptions.less  |  58 ++
 app/addons/documents/assets/less/changes.less   |  12 +
 app/addons/documents/assets/less/documents.less |  12 +-
 app/addons/documents/assets/less/sidenav.less   |  12 +
 app/addons/documents/resources.js               | 205 ------
 app/addons/documents/routes.js                  | 179 +----
 .../documents/templates/advanced_options.html   | 218 +++---
 .../documents/templates/all_docs_item.html      |  26 +-
 .../documents/templates/all_docs_list.html      |   6 +-
 .../templates/design_doc_selector.html          |  38 -
 .../documents/templates/header_alldocs.html     |  35 +
 .../documents/templates/header_doc_edit.html    |  33 +
 .../documents/templates/index_menu_item.html    |   6 +-
 .../documents/templates/index_row_docular.html  |  29 -
 .../documents/templates/index_row_tabular.html  |  25 -
 app/addons/documents/templates/view_editor.html |  91 ---
 app/addons/documents/views-index.js             | 574 ---------------
 app/addons/documents/views-sidebar.js           |  61 +-
 app/addons/documents/views.js                   |  99 ++-
 app/addons/fauxton/base.js                      |  80 +--
 app/addons/fauxton/components.js                |  88 ++-
 app/addons/fauxton/resizeColumns.js             |  63 +-
 app/addons/fauxton/templates/breadcrumbs.html   |   5 +-
 app/addons/fauxton/templates/menu_dropdown.html |   6 +-
 app/addons/indexes/assets/less/doc-item.less    |  83 +++
 app/addons/indexes/assets/less/index-form.less  |  64 ++
 app/addons/indexes/assets/less/indexes.less     |  17 +
 .../assets/less/new-index-placeholder.less      |  25 +
 app/addons/indexes/base.js                      |  74 ++
 app/addons/indexes/index-components.js          |  30 +
 app/addons/indexes/less/indexes.less            |  13 +
 .../indexes/less/new-index-placeholder.less     |   3 +
 app/addons/indexes/resources.js                 | 285 ++++++++
 app/addons/indexes/routes-core.js               | 129 ++++
 app/addons/indexes/routes-list.js               |  71 ++
 app/addons/indexes/routes-show.js               |  72 ++
 app/addons/indexes/routes-viewindexes.js        | 107 +++
 app/addons/indexes/routes.js                    |  24 +
 .../indexes/templates/design_doc_selector.html  |  38 +
 app/addons/indexes/templates/header_left.html   |  17 +
 app/addons/indexes/templates/header_right.html  |  18 +
 app/addons/indexes/templates/index_header.html  |  28 +
 .../indexes/templates/index_row_docular.html    |  35 +
 app/addons/indexes/templates/list_editor.html   |  18 +
 .../indexes/templates/preview_screen.html       |  16 +
 app/addons/indexes/templates/show_editor.html   |  41 ++
 app/addons/indexes/templates/view_editor.html   |  80 +++
 app/addons/indexes/views.js                     | 712 +++++++++++++++++++
 app/templates/layouts/two_pane.html             |  18 +-
 app/templates/layouts/with_sidebar.html         |   8 +-
 app/templates/layouts/with_tabs.html            |   9 +-
 app/templates/layouts/with_tabs_sidebar.html    |  11 +-
 assets/img/couchWatermark.png                   | Bin 0 -> 7053 bytes
 assets/less/fauxton.less                        | 690 +-----------------
 assets/less/formstyles.less                     | 247 +++++++
 assets/less/templates.less                      | 586 +++++++++++++++
 settings.json.default                           |   1 +
 58 files changed, 3414 insertions(+), 2118 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 1baaaf1..4d2ca75 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ app/addons/*
 !app/addons/replication
 !app/addons/contribute
 !app/addons/auth
+!app/addons/indexes
 !app/addons/exampleAuth
 !app/addons/permissions
 !app/addons/verifyinstall

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/assets/less/advancedOptions.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/advancedOptions.less b/app/addons/documents/assets/less/advancedOptions.less
index 2e29d38..0ff8124 100644
--- a/app/addons/documents/assets/less/advancedOptions.less
+++ b/app/addons/documents/assets/less/advancedOptions.less
@@ -1 +1,59 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+/*ALL DOCS TABLE*/
+
 /*for advanced options css*/
+#query {
+  .border-radius(5px);
+  width: 490px;
+  position: absolute;
+  z-index: 11;
+  background-color: #333;
+  padding: 0;
+  .well {
+    background: none;
+    border: none;
+    color: #fff;
+    padding: 0;
+    margin: 0;
+    .query-group {
+      padding: 20px;
+      border-bottom: 1px solid #ccc;
+    }
+    .query-group:last-child {
+      border-bottom: none;
+    }
+    .controls-group {
+      margin: 0;
+    }
+    .controls-group:last-child {
+      margin: 0;
+    }
+  }
+  form {
+    margin-bottom: 0;
+    .dropdown.inline {
+      display: inline-block;
+    }
+  }
+}
+#query:before {
+  content: '';
+  position: absolute;
+  top: -25px;
+  left: 30px;
+  border-color: transparent transparent #333 transparent;
+  border-style: solid;
+  border-width: 15px;
+  width: 0;
+  height: 0;
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/assets/less/changes.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/changes.less b/app/addons/documents/assets/less/changes.less
index 96e6d19..ebd395a 100644
--- a/app/addons/documents/assets/less/changes.less
+++ b/app/addons/documents/assets/less/changes.less
@@ -1,3 +1,15 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
 /** used in changes.html **/
 .change-box {
   margin: 0 20px 20px 20px;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index 2b29744..b52e54f 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -9,7 +9,7 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-/*ALL DOCS TABLE*/
+
 
 @import "../../../../../assets/less/variables.less";
 @import "../../../../../assets/less/bootstrap/variables.less";
@@ -21,11 +21,6 @@
 tr.all-docs-item {
   border: none;
   background: transparent;
-    .btn-group {
-        position: absolute;
-        right: 0;
-        top: 6px;
-    }
 }
 button.beautify {
   margin-top: 20px;
@@ -58,7 +53,7 @@ button.beautify {
         position: relative;
     }
 
-    table td div div {
+    table td div div.btn-group {
         display: none;
         line-height: 1;
         position: absolute;
@@ -169,6 +164,3 @@ button.string-edit[disabled] {
 
 
 
-
-
-

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/assets/less/sidenav.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/sidenav.less b/app/addons/documents/assets/less/sidenav.less
index 477af7a..fa65a23 100644
--- a/app/addons/documents/assets/less/sidenav.less
+++ b/app/addons/documents/assets/less/sidenav.less
@@ -1,3 +1,15 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
 
 .sidenav{
   .nav-list > .active > a{

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/resources.js b/app/addons/documents/resources.js
index e1df569..f95bf78 100644
--- a/app/addons/documents/resources.js
+++ b/app/addons/documents/resources.js
@@ -494,211 +494,6 @@ function(app, FauxtonAPI, PagingCollection) {
     }
   });
 
-  Documents.IndexCollection = PagingCollection.extend({
-    model: Documents.ViewRow,
-    documentation: function(){
-      return "docs";
-    },
-    initialize: function(_models, options) {
-      this.database = options.database;
-      this.params = _.extend({limit: 20, reduce: false}, options.params);
-
-      this.idxType = "_view";
-      this.view = options.view;
-      this.design = options.design.replace('_design/','');
-      this.perPageLimit = options.perPageLimit || 20;
-
-      if (!this.params.limit) {
-        this.params.limit = this.perPageLimit;
-      }
-    },
-
-    urlRef: function(context, params) {
-      var query = "";
-      
-      if (params) {
-        if (!_.isEmpty(params)) {
-          query = "?" + $.param(params);
-        } else {
-          query = '';
-        }
-      } else if (this.params) {
-        var parsedParam = Documents.QueryParams.stringify(this.params);
-        query = "?" + $.param(parsedParam);
-      }
-
-      var startOfUrl = app.host;
-      if (context === 'app') {
-        startOfUrl = 'database';
-      } else if (context === "apiurl"){
-        startOfUrl = window.location.origin;
-      }
-      var design = app.utils.safeURLName(this.design),
-          view = app.utils.safeURLName(this.view);
-
-      var url = [startOfUrl, this.database.safeID(), "_design", design, this.idxType, view];
-      return url.join("/") + query;
-    },
-
-    url: function () {
-      return this.urlRef.apply(this, arguments);
-    },
-
-    totalRows: function() {
-      if (this.params.reduce) { return "unknown_reduce";}
-
-      return this.viewMeta.total_rows || "unknown";
-    },
-
-    updateSeq: function() {
-      return this.viewMeta.update_seq || false;
-    },
-
-    simple: function () {
-      var docs = this.map(function (item) {
-        return {
-          _id: item.id,
-          key: item.get('key'),
-          value: item.get('value')
-        };
-      });
-
-      return new Documents.IndexCollection(docs, {
-        database: this.database,
-        params: this.params,
-        view: this.view,
-        design: this.design
-      });
-    },
-
-    parse: function(resp) {
-      var rows = resp.rows;
-      this.endTime = new Date().getTime();
-      this.requestDuration = (this.endTime - this.startTime);
-
-      return PagingCollection.prototype.parse.apply(this, arguments);
-    },
-
-    buildAllDocs: function(){
-      this.fetch();
-    },
-
-    // We implement our own fetch to store the starttime so we that
-    // we can get the request duration
-    fetch: function () {
-      this.startTime = new Date().getTime();
-      return PagingCollection.prototype.fetch.call(this);
-    },
-
-    allDocs: function(){
-      return this.models;
-    },
-
-    // This is taken from futon.browse.js $.timeString
-    requestDurationInString: function () {
-      var ms, sec, min, h, timeString, milliseconds = this.requestDuration;
-
-      sec = Math.floor(milliseconds / 1000.0);
-      min = Math.floor(sec / 60.0);
-      sec = (sec % 60.0).toString();
-      if (sec.length < 2) {
-         sec = "0" + sec;
-      }
-
-      h = (Math.floor(min / 60.0)).toString();
-      if (h.length < 2) {
-        h = "0" + h;
-      }
-
-      min = (min % 60.0).toString();
-      if (min.length < 2) {
-        min = "0" + min;
-      }
-
-      timeString = h + ":" + min + ":" + sec;
-
-      ms = (milliseconds % 1000.0).toString();
-      while (ms.length < 3) {
-        ms = "0" + ms;
-      }
-      timeString += "." + ms;
-
-      return timeString;
-    }
-
-  });
-
-
-  Documents.PouchIndexCollection = PagingCollection.extend({
-    model: Documents.ViewRow,
-    documentation: function(){
-      return "docs";
-    },
-    initialize: function(_models, options) {
-      this.database = options.database;
-      this.rows = options.rows;
-      this.view = options.view;
-      this.design = options.design.replace('_design/','');
-      this.params = _.extend({limit: 20, reduce: false}, options.params);
-
-      this.idxType = "_view";
-    },
-
-    url: function () {
-      return '';
-    },
-
-    simple: function () {
-      var docs = this.map(function (item) {
-        return {
-          _id: item.id,
-          key: item.get('key'),
-          value: item.get('value')
-        };
-      });
-
-      return new Documents.PouchIndexCollection(docs, {
-        database: this.database,
-        params: this.params,
-        view: this.view,
-        design: this.design,
-        rows: this.rows
-      });
-
-    },
-
-    fetch: function() {
-      var deferred = FauxtonAPI.Deferred();
-      this.reset(this.rows, {silent: true});
-
-      this.viewMeta = {
-        total_rows: this.rows.length,
-        offset: 0,
-        update_seq: false
-      };
-
-      deferred.resolve();
-      return deferred;
-    },
-
-    totalRows: function() {
-      return this.viewMeta.total_rows || "unknown";
-    },
-
-    updateSeq: function() {
-      return this.viewMeta.update_seq || false;
-    },
-
-    buildAllDocs: function(){
-      this.fetch();
-    },
-
-    allDocs: function(){
-      return this.models;
-    }
-  });
-
-
 
   return Documents;
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index 8eca7f6..bf0bc95 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -14,12 +14,11 @@ define([
   "app",
 
   "api",
-
+ "addons/fauxton/components",
   // Modules
   //views
   "addons/documents/views",
   "addons/documents/views-changes",
-  "addons/documents/views-index",
   "addons/documents/views-doceditor",
 
   "addons/databases/base",
@@ -27,7 +26,7 @@ define([
   "addons/fauxton/components"
 ],
 
-function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resources, Components) {
+function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases, Resources) {
 
   var DocEditorRouteObject = FauxtonAPI.RouteObject.extend({
     layout: "one_pane",
@@ -57,6 +56,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
 
     crumbs: function() {
       return [
+        {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
         {"name": this.database.id, "link": Databases.databaseUrl(this.database)},
         {"name": this.docID, "link": "#"}
       ];
@@ -114,6 +114,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
     },
     crumbs: function() {
       return [
+        {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
         {"name": this.database.id, "link": Databases.databaseUrl(this.database)},
         {"name": "New", "link": "#"}
       ];
@@ -134,34 +135,16 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
         route: "allDocs",
         roles: ["_reader","_writer","_admin"]
       },
-      "database/:database/_design/:ddoc/_views/:view": {
-        route: "viewFn",
-        roles: ['_admin']
-      },
-      "database/:database/_design/:ddoc/_lists/:fn": {
-        route: "tempFn",
-        roles: ['_admin']
-      },
-      "database/:database/_design/:ddoc/_filters/:fn": {
-        route: "tempFn",
-        roles: ['_admin']
-      },
-      "database/:database/_design/:ddoc/_show/:fn": {
-        route: "tempFn",
-        roles: ['_admin']
-      },
       "database/:database/_design/:ddoc/metadata": {
         route: "designDocMetadata",
         roles: ['_admin']
       },
-      "database/:database/new_view": "newViewEditor",
-      "database/:database/new_view/:designDoc": "newViewEditor",
       "database/:database/_changes(:params)": "changes"
     },
 
     events: {
       "route:updateAllDocs": "updateAllDocsFromView",
-      "route:updatePreviewDocs": "updateAllDocsFromPreview",
+      // "route:updatePreviewDocs": "updateAllDocsFromPreview",
       "route:reloadDesignDocs": "reloadDesignDocs",
       "route:paginate": "paginate",
       "route:perPageChange": "perPageChange",
@@ -194,8 +177,8 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
         database: this.data.database
       }));
     },
+
     designDocMetadata:  function(database, ddoc){
-      this.toolsView && this.toolsView.remove();
       this.viewEditor && this.viewEditor.remove();
 
       var designDocInfo = new Resources.DdocInfo({_id: "_design/"+ddoc},{database: this.data.database });
@@ -209,6 +192,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
 
       this.crumbs = function () {
         return [
+          {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
           {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
         ];
       };
@@ -216,15 +200,6 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
       this.apiUrl = [designDocInfo.url('apiurl'), designDocInfo.documentation() ];
 
     },
-    tempFn:  function(databaseName, ddoc, fn){
-      this.setView("#dashboard-upper-content", new Documents.Views.temp({}));
-      this.crumbs = function () {
-        return [
-          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
-        ];
-      };
-
-    },
 
     establish: function () {
       return this.data.designDocs.fetch({reset: true});
@@ -283,62 +258,13 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
       }));
 
       this.crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
         {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)}
       ];
 
       this.apiUrl = [this.data.database.allDocs.urlRef("apiurl", urlParams), this.data.database.allDocs.documentation() ];
     },
 
-    viewFn: function (databaseName, ddoc, view) {
-      var params = this.createParams(),
-          urlParams = params.urlParams,
-          docParams = params.docParams,
-          decodeDdoc = decodeURIComponent(ddoc);
-
-      view = view.replace(/\?.*$/,'');
-
-      this.data.indexedDocs = new Documents.IndexCollection(null, {
-        database: this.data.database,
-        design: decodeDdoc,
-        view: view,
-        params: docParams,
-        paging: {
-          pageSize: this.getDocPerPageLimit(urlParams, parseInt(docParams.limit, 10))
-        }
-      });
-
-      this.viewEditor = this.setView("#dashboard-upper-content", new Index.ViewEditor({
-        model: this.data.database,
-        ddocs: this.data.designDocs,
-        viewName: view,
-        params: urlParams,
-        newView: false,
-        database: this.data.database,
-        ddocInfo: this.ddocInfo(decodeDdoc, this.data.designDocs, view)
-      }));
-
-      this.toolsView && this.toolsView.remove();
-
-      this.documentsView = this.createViewDocumentsView({
-        designDoc: decodeDdoc,
-        docParams: docParams,
-        urlParams: urlParams,
-        database: this.data.database,
-        indexedDocs: this.data.indexedDocs,
-        designDocs: this.data.designDocs,
-        view: view
-      });
-
-      this.sidebar.setSelectedTab(app.utils.removeSpecialCharacters(ddoc) + '_' + app.utils.removeSpecialCharacters(view));
-
-      this.crumbs = function () {
-        return [
-          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
-        ];
-      };
-
-      this.apiUrl = [this.data.indexedDocs.urlRef("apiurl", urlParams), "docs"];
-    },
 
     ddocInfo: function (designDoc, designDocs, view) {
       return {
@@ -348,40 +274,18 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
       };
     },
 
-    createViewDocumentsView: function (options) {
-
-      return this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
-        database: options.database,
-        collection: options.indexedDocs,
-        nestedView: Documents.Views.Row,
-        viewList: true,
-        ddocInfo: this.ddocInfo(options.designDoc, options.designDocs, options.view),
-        docParams: options.docParams,
-        params: options.urlParams
-      }));
-    },
-
-    newViewEditor: function (database, designDoc) {
-      var params = app.getParams();
-
-      this.toolsView && this.toolsView.remove();
-      this.documentsView && this.documentsView.remove();
+    // createViewDocumentsView: function (options) {
 
-      this.viewEditor = this.setView("#dashboard-upper-content", new Index.ViewEditor({
-        currentddoc: "_design/"+designDoc || "",
-        ddocs: this.data.designDocs,
-        params: params,
-        database: this.data.database,
-        newView: true
-      }));
-
-      this.sidebar.setSelectedTab('new-view');
-      this.crumbs = function () {
-        return [
-          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
-        ];
-      };
-    },
+    //   return this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
+    //     database: options.database,
+    //     collection: options.indexedDocs,
+    //     nestedView: Documents.Views.Row,
+    //     viewList: true,
+    //     ddocInfo: this.ddocInfo(options.designDoc, options.designDocs, options.view),
+    //     docParams: options.docParams,
+    //     params: options.urlParams
+    //   }));
+    // },
 
     updateAllDocsFromView: function (event) {
       var view = event.view,
@@ -401,28 +305,6 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
         collection = this.data.database.allDocs;
         collection.paging.pageSize = pageSize;
 
-      } else {
-        collection = this.data.indexedDocs = new Documents.IndexCollection(null, {
-          database: this.data.database,
-          design: ddoc,
-          view: view,
-          params: docParams,
-          paging: {
-            pageSize: pageSize
-          }
-        });
-
-        if (!this.documentsView) {
-          this.documentsView = this.createViewDocumentsView({
-            designDoc: ddoc,
-            docParams: docParams,
-            urlParams: urlParams,
-            database: this.data.database,
-            indexedDocs: this.indexedDocs,
-            designDocs: this.data.designDocs,
-            view: view
-          });
-        }
       }
 
       this.documentsView.setCollection(collection);
@@ -432,26 +314,6 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
       this.apiUrl = [collection.urlRef("apiurl", urlParams), "docs"];
     },
 
-    updateAllDocsFromPreview: function (event) {
-      var view = event.view,
-      rows = event.rows,
-      ddoc = event.ddoc;
-
-      this.data.indexedDocs = new Documents.PouchIndexCollection(null, {
-        database: this.data.database,
-        design: ddoc,
-        view: view,
-        rows: rows
-      });
-
-      this.documentsView = this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
-        database: this.data.database,
-        collection: this.data.indexedDocs,
-        nestedView: Documents.Views.Row,
-        viewList: true
-      }));
-    },
-
     perPageChange: function (perPage) {
       // We need to restore the collection parameters to the defaults (1st page)
       // and update the page size
@@ -518,13 +380,14 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
         filterView: this.filterView
       }));
 
-      this.toolsView && this.toolsView.remove();
+
       this.viewEditor && this.viewEditor.remove();
 
       this.sidebar.setSelectedTab('changes');
 
       this.crumbs = function () {
         return [
+          {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
           {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
           {"name": "_changes", "link": "/_changes"}
         ];

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/advanced_options.html b/app/addons/documents/templates/advanced_options.html
index c986d4e..1fc9546 100644
--- a/app/addons/documents/templates/advanced_options.html
+++ b/app/addons/documents/templates/advanced_options.html
@@ -11,57 +11,119 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-<div class="errors-container"></div>
 <form class="js-view-query-update custom-inputs">
 
-<!-- tabs for choosing Keys or Start & end -->
+  <div class="query-group">
+    <span class="add-on">
+      API Options
+      <a class="help-link" href="<%-getDocUrl(documentation)%>" target="_blank">
+        <i class="icon-question-sign"></i>
+      </a>
+    </span>
 
-  <div class="btn-group toggle-btns row-fluid">
-    <label for="showKeys" class="drop-down btn span6">
-     By Key(s)
-    </label>
-    <label for="showStartEnd" class="drop-down btn span6">
-      Between Keys
-    </label>
-  </div>
+    <div class="errors-container"></div>
+    
+      <div class="controls-group">
+        <div class="row-fluid">
+
+            <div class="checkbox inline">
+              <input id="select2" name="include_docs" type="checkbox" value="true">
+              <label for="include_docs">Include Docs</label>
+            </div>
+
+            <% if (hasReduce) { %>
+              <div class="checkbox inline">
+                <input id="check2" name="reduce" type="checkbox" value="true">
+                <label for="check2">Reduce</label>
+              </div>
+       
+              <label id="select1" class="drop-down inline">
+                Group Level
+                <select id="select1" disabled name="group_level" class="input-small">
+                  <option value="0">None</option>
+                  <option value="1">1</option>
+                  <option value="2">2</option>
+                  <option value="3">3</option>
+                  <option value="4">4</option>
+                  <option value="5">5</option>
+                  <option value="6">6</option>
+                  <option value="7">7</option>
+                  <option value="8">8</option>
+                  <option value="9">9</option>
+                  <option value="999" selected="selected">Exact</option>
+                </select>
+              </label>
+            <% } %>
 
-  <div class="controls-group well hide js-query-keys-wrapper">
-    <div class="row-fluid" id="js-showKeys">
-      <div class="controls controls-row">
-        <label for="keys-input" class="drop-down">A key, or an array of keys.</label>
-        <textarea id="keys-input" name="keys" class="input-xxlarge" rows="5" type="text" placeholder='Enter valid JSON; e.g., ["1234"] or ["1234","2345"]'></textarea>
-        <div id="keys-error" class="inline-block js-keys-error"></div>
+        </div>
       </div>
+  </div>
+
+  <div class="query-group">
+    <span class="add-on">
+      Keys
+    </span>
+    <!-- tabs for choosing Keys or Start & end -->
+    <div class="btn-group toggle-btns row-fluid">
+      <label for="showKeys" class="drop-down btn span6">
+       By Key(s)
+      </label>
+      <label for="showStartEnd" class="drop-down btn span6">
+        Between Keys
+      </label>
     </div>
-    <div class="row-fluid hide" id="js-showStartEnd">
-      <div class="controls controls-row">
-        <div class="span6">
-          <label for="startkey" class="drop-down">Start key</label>
-          <input name="startkey" id="startkey" type="text" placeholder='e.g., "1234"' disabled>
+
+    <div class="controls-group well hide js-query-keys-wrapper">
+      <div class="row-fluid" id="js-showKeys">
+        <div class="controls controls-row">
+          <label for="keys-input" class="drop-down">A key, or an array of keys.</label>
+          <textarea id="keys-input" name="keys" class="input-xxlarge" rows="5" type="text" placeholder='Enter valid JSON; e.g., ["1234"] or ["1234","2345"]'></textarea>
+          <div id="keys-error" class="inline-block js-keys-error"></div>
         </div>
-        <div class="span6">
-          <label for="endkey" class="drop-down">End key</label>
-          <input id="endkey" name="endkey" type="text" placeholder='e.g., "1234"'>
-          <div class="controls controls-row checkbox inline">
-            <input id="check5" name="inclusive_end" type="checkbox" value="true" checked disabled>
-            <label for="check5">Include End Key in results</label>
+      </div>
+      <div class="row-fluid hide" id="js-showStartEnd">
+        <div class="controls controls-row">
+          <div>
+            <label for="startkey" class="drop-down">Start key</label>
+            <input name="startkey" id="startkey" type="text" placeholder='e.g., "1234"' disabled>
+          </div>
+          <div>
+            <label for="endkey" class="drop-down">End key</label>
+            <input id="endkey" name="endkey" type="text" placeholder='e.g., "1234"'>
+            <div class="controls controls-row checkbox inline">
+              <input id="check5" name="inclusive_end" type="checkbox" value="true" checked disabled>
+              <label for="check5">Include End Key in results</label>
+            </div>
           </div>
+
         </div>
 
       </div>
-
     </div>
   </div>
 
-<!-- Limit and Skip are conditional -->
-
-  <div class="controls-group">
+  <div class="controls-group query-group">
+    <!-- Limit and Skip are conditional -->
+    <span class="add-on">
+      Additional Parameters
+    </span>
 
     <div class="row-fluid">
-      <div class="span6">
-        <label class="drop-down inline">
+      <% if (showStale) { %>
+        <div class="checkbox inline">
+          <input id="check7" name="stale" type="checkbox" value="ok">
+          <label for="check7">Stale</label>
+        </div>
+      <% } %>
+        <div class="checkbox inline">
+          <input id="check6" name="update_seq" type="checkbox" value="true">
+          <label for="check6">Update Sequence</label>
+        </div>
+
+      <div class="dropdown inline">
+        <label class="drop-down">
           Limit:
-          <select name="limit" class="input-medium">
+          <select name="limit" class="input-small">
             <option selected="selected">None</option>
             <option>5</option>
             <option>10</option>
@@ -69,89 +131,39 @@ the License.
             <option>30</option>
             <option>50</option>
             <option>100</option>
-  		      <option>500</option>
-          </select>
-        </label>
-      </div>
-      <div class="span6">
-        <label for="skipRows" class="inline drop-down">
-          # of rows to skip
-          <input name="skip" class="input-small" type="text" id="skipRows" placeholder="0">
-        </label>
-      </div>
-    </div>
-    <div class="row-fluid">
-      <div class="span6">
-        <label id="select2" class="drop-down inline">
-          Order:
-          <select id="select2" name="descending" class="input-medium">
-            <option value="false">Ascending</option>
-            <option value="true">Descending</option>
-          </select>
-        </label>
-      </div>
-      <div class="span6">
-        <label id="select2" class="drop-down inline">
-          Docs:
-          <select id="select2" name="include_docs" class="input-medium">
-            <option value="false">Exclude</option>
-            <option value="true">Include</option>
+            <option>500</option>
           </select>
         </label>
       </div>
-    </div>
-    <div class="row-fluid">
-      <% if (showStale) { %>
-        <div class="span6">
-          <div class="checkbox inline">
-            <input id="check7" name="stale" type="checkbox" value="ok">
-            <label for="check7">Stale</label>
-          </div>
-        </div>
-      <% } %>
-      <div class="span6 update-seq">
-        <div class="checkbox inline">
-          <input id="check6" name="update_seq" type="checkbox" value="true">
-          <label for="check6">Update Sequence</label>
-        </div>
-      </div>
 
     </div>
-  <% if (hasReduce) { %>
+
     <div class="row-fluid">
-      <div class="span6">
-        <div class="checkbox inline">
-          <input id="check2" name="reduce" type="checkbox" value="true">
-          <label for="check2">Reduce</label>
-        </div>
+      <div class="checkbox inline">
+        <input id="select2" name="descending" type="checkbox" value="true">
+        <label for="descending">Descending</label>
       </div>
-      <div class="span6">
-        <label id="select1" class="drop-down inline">
-          Group Level:
-          <select id="select1" disabled name="group_level" class="input-small">
-            <option value="0">None</option>
-            <option value="1">1</option>
-            <option value="2">2</option>
-            <option value="3">3</option>
-            <option value="4">4</option>
-            <option value="5">5</option>
-            <option value="6">6</option>
-            <option value="7">7</option>
-            <option value="8">8</option>
-            <option value="9">9</option>
-            <option value="999" selected="selected">Exact</option>
-          </select>
+
+      <div class="dropdown inline">
+        <label for="skipRows" class="drop-down">
+          Skip
+          <input name="skip" class="input-small" type="text" id="skipRows" placeholder="# of rows">
         </label>
       </div>
     </div>
-  <% } %>
   </div>
 
-  <div class="controls-group">
+  <div class="controls-group query-group">
+    <span class="add-on">
+      Query the DB
+    </span>
     <div id="button-options" class="controls controls-row">
-      <button type="submit" class="btn btn-success">Query</button>
+      <button type="submit" class="btn btn-success">
+        <i class="fonticon-play icon"></i>
+        Query
+      </button>
     </div>
   </div>
+
 </form>
-</div>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/templates/all_docs_item.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_item.html b/app/addons/documents/templates/all_docs_item.html
index a8ef20f..4526df2 100644
--- a/app/addons/documents/templates/all_docs_item.html
+++ b/app/addons/documents/templates/all_docs_item.html
@@ -12,15 +12,21 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<td class="select"><input <%- checked ? 'checked="checked"' : '' %> type="checkbox" class="js-row-select"></td>
-<td>
-  <div>
+<div class="select"><input <%- checked ? 'checked="checked"' : '' %> type="checkbox" class="js-row-select"></div>
+<div class="doc-item">
+
+  <header>
+    _id <span class="header-id-number">"<%=docID%>"</span>
+
+  <% if (doc.isEditable()) { %>
+    <div class="btn-group">
+      <a href="#<%= doc.url('web-index') %>" class="btn btn-small edits">Edit <%- doc.docType() %></a>
+      <button href="#" class="btn btn-small btn-danger delete" title="Delete this document."><i class="icon icon-trash"></i></button>
+    </div>
+  <% } %>
+  </header>
+  <div class="doc-data">
     <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
-    <% if (doc.isEditable()) { %>
-      <div class="btn-group">
-        <a href="#<%= doc.url('web-index') %>" class="btn btn-small edits">Edit <%- doc.docType() %></a>
-        <button href="#" class="btn btn-small btn-danger delete" title="Delete this document."><i class="icon icon-trash"></i></button>
-      </div>
-    <% } %>
   </div>
-</td>
+</div>
+<div class="clearfix"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/templates/all_docs_list.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_list.html b/app/addons/documents/templates/all_docs_list.html
index a643427..d132eb2 100644
--- a/app/addons/documents/templates/all_docs_list.html
+++ b/app/addons/documents/templates/all_docs_list.html
@@ -29,9 +29,9 @@ the License.
   <p>
 
   <div id="item-numbers"> </div>
-  <table class="all-docs table table-striped table-condensed">
-    <tbody></tbody>
-  </table>
+  <div id="doc-list">
+
+  </div>
 
   <% if (endOfResults) { %>
   <div class="text-center well">

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/templates/design_doc_selector.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/design_doc_selector.html b/app/addons/documents/templates/design_doc_selector.html
deleted file mode 100644
index d12cd64..0000000
--- a/app/addons/documents/templates/design_doc_selector.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->
-<div class="span3">
-  <label for="ddoc">Save to Design Document <a class="help-link" data-bypass="true" href="<%-getDocUrl('design_doc')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
-  <select id="ddoc">
-    <optgroup label="Select a document">
-      <option value="new-doc">New document</option>
-
-      <% ddocs.each(function(ddoc) { %>
-      <%= ddoc.id %>
-      <%= ddocName %>
-      <% if (ddoc.id === ddocName) { %>
-      <option selected="selected" value="<%- ddoc.id %>"><%- ddoc.id %></option>
-      <% } else { %>
-      <option value="<%- ddoc.id %>"><%- ddoc.id %></option>
-      <% } %>
-      <% }); %>
-    </optgroup>
-  </select>
-</div>
-
-<div id="new-ddoc-section" class="span5" style="display:none">
-  <label class="control-label" for="new-ddoc"> _design/ </label>
-  <div class="controls">
-    <input type="text" id="new-ddoc" placeholder="newDesignDoc" />
-  </div>
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/templates/header_alldocs.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html
new file mode 100644
index 0000000..61eb2d8
--- /dev/null
+++ b/app/addons/documents/templates/header_alldocs.html
@@ -0,0 +1,35 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+<div class="header-left">
+<!--back arrow-->
+
+<!--title with dropdown DB search-->
+
+
+<!-- Menu gear-->
+
+</div>
+
+
+<div class="header-right">
+  <!-- Select all -->
+
+  <!-- search (jump to doc)-->
+
+  <!-- Query Options-->
+
+
+  <!--right margin for api bar-->
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/templates/header_doc_edit.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_doc_edit.html b/app/addons/documents/templates/header_doc_edit.html
new file mode 100644
index 0000000..fbc213f
--- /dev/null
+++ b/app/addons/documents/templates/header_doc_edit.html
@@ -0,0 +1,33 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+<div class="header-left">
+<!--back arrow-->
+
+<!--title with dropdown DB search-->
+
+<!-- Menu gear-->
+</div>
+
+
+<div class="header-right">
+<!-- Select button-->
+<!-- ? button-->
+<!-- ? button-->
+<!-- ? button-->
+<!-- ? button-->
+<!-- json button-->
+<!-- trash button-->
+<!-- cancel button-->
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/templates/index_menu_item.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/index_menu_item.html b/app/addons/documents/templates/index_menu_item.html
index 434a02a..cc32d54 100644
--- a/app/addons/documents/templates/index_menu_item.html
+++ b/app/addons/documents/templates/index_menu_item.html
@@ -14,9 +14,9 @@ the License.
 <a class="js-toggle-<%-ddocType%> accordion-header js-collapse-toggle" data-toggle="collapse"  data-target="#<%- removeSpecialCharacters(ddoc) + ddocType %>" id="nav-design-function-<%= removeSpecialCharacters(ddoc) + ddocType %>">
   <div class="fonticon-play"></div>
   <span class="<%- icon %> fonticon"></span>
-  <%- name %>
-  </a>
-  <ul class="accordion-body collapse" id="<%- removeSpecialCharacters(ddoc) + ddocType %>">
+  <%- ddocType %>
+</a>
+<ul class="accordion-body collapse" id="<%- removeSpecialCharacters(ddoc) + ddocType %>">
   <% _.each(collection, function (item, index) { %>
   <li>
   <a data-ddoctype="<%- ddocType %>" id="<%- removeSpecialCharacters(ddoc) %>_<%- removeSpecialCharacters(index) %>" href="#/database/<%- safeURL(database) %>/_design/<%= safeURL(ddoc)%>/_<%-ddocType%>/<%= safeURL(index) %>" class="toggle-view">

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/templates/index_row_docular.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/index_row_docular.html b/app/addons/documents/templates/index_row_docular.html
deleted file mode 100644
index e8973ad..0000000
--- a/app/addons/documents/templates/index_row_docular.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->
-<% if (doc.isEditable()) { %>
-  <td class="select"><input type="checkbox"></td>
-<% } %>
-<td>
-  <div>
-    <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
-
-      <div class="btn-group">
-        <a href="#<%= url %>" class="btn btn-small edits">Edit <%= doc.docType() %></a>
-        <% if (doc.isEditable()) { %>
-          <button href="#" class="btn btn-small btn-danger delete" title="Delete this document."><i class="icon icon-trash"></i></button>
-        <% } %>
-      </div>
-
-  </div>
-</td>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/templates/index_row_tabular.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/index_row_tabular.html b/app/addons/documents/templates/index_row_tabular.html
deleted file mode 100644
index f5f68fa..0000000
--- a/app/addons/documents/templates/index_row_tabular.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->
-
-<td class="select"><input type="checkbox"></td>
-<td>
-  <div>
-    <pre class="prettyprint"><%- JSON.stringify(doc.get("key")) %></pre>
-  </div>
-</td>
-<td>
-  <div>
-    <pre class="prettyprint"><%- JSON.stringify(doc.get("value")) %></pre>
-  </div>
-</td>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/templates/view_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/view_editor.html b/app/addons/documents/templates/view_editor.html
index 769deed..e69de29 100644
--- a/app/addons/documents/templates/view_editor.html
+++ b/app/addons/documents/templates/view_editor.html
@@ -1,91 +0,0 @@
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->
-<div class="dashboard-upper-menu">
-  <ul class="nav nav-tabs" id="db-views-tabs-nav">
-    <li class="active"> <a data-bypass="true" id="index-nav" data-toggle="tab" href="#index">
-      <i class="fonticon-wrench fonticon"></i>
-      <% if (newView) { %>Create Index <% } else { %>Edit Index <% } %></a></li>
-    <% if (!newView) { %>
-    <li><a data-bypass="true" id="query-nav" href="#query" data-toggle="tab">
-      <i class="fonticon-plus fonticon"></i> Query Options</a>
-    </li>
-    <% } %>
-  </ul>
-</div>
-  <div class="all-docs-list errors-container"></div>
-  <div class="tab-content">
-	 <div id="query-options-wrapper"></div>
-    <div class="tab-pane active" id="index">
-      <div id="define-view" class="ddoc-alert well">
-        <div class="errors-container"></div>
-        <form class="form-horizontal view-query-save">
-
-          <div class="control-group design-doc-group">
-          </div>
-
-          <div class="control-group">
-            <label for="index-name">Index name <a class="help-link" data-bypass="true" href="<%-getDocUrl('view_functions')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
-            <input type="text" id="index-name" value="<%- viewName %>" placeholder="Index name" />
-          </div>
-
-
-          <div class="control-group">
-            <label for="map-function">Map function <a class="help-link" data-bypass="true" href="<%-getDocUrl('map_functions')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
-            <% if (newView) { %>
-            <div class="js-editor" id="map-function"><%= langTemplates.map %></div>
-            <% } else { %>
-            <div class="js-editor" id="map-function"><%- ddoc.get('views')[viewName].map %></div>
-            <button class="beautify beautify_map btn btn-primary btn-large hide beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
-            <% } %>
-          </div>
-
-
-          <div class="control-group">
-            <label for="reduce-function-selector">Reduce (optional) <a class="help-link" data-bypass="true" href="<%-getDocUrl('reduce_functions')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
-
-            <select id="reduce-function-selector">
-              <option value="" <%- !reduceFunStr ? 'selected="selected"' : '' %>>None</option>
-              <% _.each(["_sum", "_count", "_stats"], function(reduce) { %>
-              <option value="<%- reduce %>" <% if (reduce == reduceFunStr) { %>selected<% } %>><%= reduce %></option>
-              <% }) %>
-              <option value="CUSTOM" <% if (isCustomReduce) { %>selected<% } %>>Custom Reduce function</option>
-            </select>
-          </div>
-
-          <div class="control-group reduce-function">
-            <label for="reduce-function">Custom Reduce function</label>
-            <% if (newView) { %>
-            <div class="js-editor" id="reduce-function"><%- langTemplates.reduce %></div>
-            <% } else { %>
-            <div class="js-editor" id="reduce-function"><%- ddoc.get('views')[viewName].reduce %></div>
-            <button class="beautify beautify_reduce btn btn-primary btn-large hide beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
-            <% } %>
-          </div>
-
-          <div class="control-group">
-            <button class="btn btn-success save"><i class="icon fonticon-ok-circled"></i> Save &amp; Build Index</button>
-            <% if (!newView) { %>
-            <button class="btn btn-danger delete"><i class="icon fonticon-cancel-circled"></i> Delete</button>
-            <% } %>
-          </div>
-          <div class="clearfix"></div>
-        </form>
-      </div>
-    </div>
-    <div class="tab-pane" id="metadata">
-      <div id="ddoc-info" class="well"> </div>
-    </div>
-    <div class="tab-pane" id="query">
-    </div>
-  </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/views-index.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-index.js b/app/addons/documents/views-index.js
deleted file mode 100644
index d0ed8ed..0000000
--- a/app/addons/documents/views-index.js
+++ /dev/null
@@ -1,574 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-define([
-  "app",
-
-  "api",
-  "addons/fauxton/components",
-
-  "addons/documents/resources",
-  "addons/databases/resources",
-  "addons/pouchdb/base",
-  //views
-  "addons/documents/views-advancedopts",
-  // Libs
-  "addons/fauxton/resizeColumns",
-
-  // Plugins
-  "plugins/beautify",
-  "plugins/prettify"
-],
-
-function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
-         QueryOptions, resizeColumns, beautify, prettify) {
-
-  var Views = {};
-
-  Views.ViewEditor = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/view_editor",
-    builtinReduces: ['_sum', '_count', '_stats'],
-
-    events: {
-      "click button.save": "saveView",
-      "click button.delete": "deleteView",
-      "change select#reduce-function-selector": "updateReduce",
-      "click button.preview": "previewView",
-      "click #db-views-tabs-nav": 'toggleIndexNav',
-      "click .beautify_map":  "beautifyCode",
-      "click .beautify_reduce":  "beautifyCode",
-      "click #query-options-wrapper": 'toggleIndexNav'
-    },
-
-    langTemplates: {
-      "javascript": {
-        map: "function(doc) {\n  emit(doc._id, 1);\n}",
-        reduce: "function(keys, values, rereduce){\n  if (rereduce){\n    return sum(values);\n  } else {\n    return values.length;\n  }\n}"
-      }
-    },
-
-    defaultLang: "javascript",
-
-    initialize: function(options) {
-      this.newView = options.newView || false;
-      this.ddocs = options.ddocs;
-      this.params = options.params;
-      this.database = options.database;
-      this.currentDdoc = options.currentddoc;
-      if (this.newView) {
-        this.viewName = 'newView';
-      } else {
-        this.ddocID = options.ddocInfo.id;
-        this.viewName = options.viewName;
-        this.ddocInfo = new Documents.DdocInfo({_id: this.ddocID},{database: this.database});
-      }
-
-      this.showIndex = false;
-      _.bindAll(this);
-    },
-
-    establish: function () {
-      if (this.ddocInfo) {
-        return this.ddocInfo.fetch();
-      }
-    },
-
-    updateValues: function() {
-      var notification;
-      if (this.model.changedAttributes()) {
-        notification = FauxtonAPI.addNotification({
-          msg: "Document saved successfully.",
-          type: "success",
-          clear: true
-        });
-        this.editor.setValue(this.model.prettyJSON());
-      }
-    },
-
-    updateReduce: function(event) {
-      var $ele = $("#reduce-function-selector");
-      var $reduceContainer = $(".control-group.reduce-function");
-      if ($ele.val() == "CUSTOM") {
-        this.createReduceEditor();
-        this.reduceEditor.setValue(this.langTemplates.javascript.reduce);
-        $reduceContainer.show();
-      } else {
-        $reduceContainer.hide();
-      }
-    },
-
-    deleteView: function (event) {
-      event.preventDefault();
-
-      if (this.newView) { return alert('Cannot delete a new view.'); }
-      if (!confirm('Are you sure you want to delete this view?')) {return;}
-
-      var that = this,
-          promise,
-          viewName = this.$('#index-name').val(),
-          ddocName = this.$('#ddoc :selected').val(),
-          ddoc = this.getCurrentDesignDoc();
-
-      ddoc.removeDdocView(viewName);
-
-      if (ddoc.hasViews()) {
-        promise = ddoc.save();
-      } else {
-        promise = ddoc.destroy();
-      }
-
-      promise.then(function () {
-        FauxtonAPI.navigate('/database/' + that.database.safeID() + '/_all_docs?limit=' + Databases.DocLimit);
-        FauxtonAPI.triggerRouteEvent('reloadDesignDocs');
-      });
-    },
-
-    saveView: function(event) {
-      var json, notification,
-      that = this;
-
-      if (event) { event.preventDefault();}
-
-      $('#dashboard-content').scrollTop(0); //scroll up
-
-      if (this.hasValidCode() && this.$('#new-ddoc:visible').val() !=="") {
-        var mapVal = this.mapEditor.getValue(),
-        reduceVal = this.reduceVal(),
-        viewName = this.$('#index-name').val(),
-        ddoc = this.getCurrentDesignDoc(),
-        ddocName = ddoc.id,
-        viewNameChange = false;
-
-        if (this.viewName !== viewName) {
-          ddoc.removeDdocView(this.viewName);
-          this.viewName = viewName;
-          viewNameChange = true;
-        }
-
-        notification = FauxtonAPI.addNotification({
-          msg: "Saving document.",
-          selector: "#define-view .errors-container",
-          clear: true
-        });
-
-        ddoc.setDdocView(viewName, mapVal, reduceVal);
-
-        ddoc.save().then(function () {
-          that.ddocs.add(ddoc);
-
-          that.mapEditor.editSaved();
-          that.reduceEditor && that.reduceEditor.editSaved();
-
-
-          FauxtonAPI.addNotification({
-            msg: "View has been saved.",
-            type: "success",
-            selector: "#define-view .errors-container",
-            clear: true
-          });
-
-          if (that.newView || viewNameChange) {
-            var fragment = '/database/' + that.database.safeID() +'/' + ddoc.safeID() + '/_view/' + app.utils.safeURLName(viewName);
-
-            FauxtonAPI.navigate(fragment, {trigger: false});
-            that.newView = false;
-            that.ddocID = ddoc.safeID();
-            that.viewName = viewName;
-            that.ddocInfo = ddoc;
-            that.showIndex = true;
-            that.render();
-            FauxtonAPI.triggerRouteEvent('reloadDesignDocs', {
-              selectedTab: app.utils.removeSpecialCharacters(ddocName.replace(/_design\//,'')) + '_' + app.utils.removeSpecialCharacters(viewName)
-            });
-          }
-
-          if (that.reduceFunStr !== reduceVal) {
-            that.reduceFunStr = reduceVal;
-            that.advancedOptions.renderOnUpdatehasReduce(that.hasReduce());
-          }
-
-          FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: ddocName, view: viewName});
-
-        }, function(xhr) {
-          var responseText = JSON.parse(xhr.responseText).reason;
-          notification = FauxtonAPI.addNotification({
-            msg: "Save failed: " + responseText,
-            type: "error",
-            clear: true
-          });
-        });
-      } else {
-        var errormessage = (this.$('#new-ddoc:visible').val() ==="")?"Enter a design doc name":"Please fix the Javascript errors and try again.";
-        notification = FauxtonAPI.addNotification({
-          msg: errormessage,
-          type: "error",
-          selector: "#define-view .errors-container",
-          clear: true
-        });
-      }
-    },
-
-    updateView: function(event, paramInfo) {
-       event.preventDefault();
-
-       if (this.newView) { return alert('Please save this new view before querying it.'); }
-
-       var errorParams = paramInfo.errorParams,
-           params = paramInfo.params;
-
-       if (_.any(errorParams)) {
-         _.map(errorParams, function(param) {
-
-           // TODO: Where to add this error?
-           // bootstrap wants the error on a control-group div, but we're not using that
-           //$('form.view-query-update input[name='+param+'], form.view-query-update select[name='+param+']').addClass('error');
-           return FauxtonAPI.addNotification({
-             msg: "JSON Parse Error on field: "+param.name,
-             type: "error",
-             selector: ".advanced-options .errors-container",
-             clear: true
-           });
-         });
-         FauxtonAPI.addNotification({
-           msg: "Make sure that strings are properly quoted and any other values are valid JSON structures",
-           type: "warning",
-           selector: ".advanced-options .errors-container",
-           clear: true
-         });
-
-         return false;
-      }
-
-       var fragment = window.location.hash.replace(/\?.*$/, '');
-       if (!_.isEmpty(params)) {
-        fragment = fragment + '?' + $.param(params);
-       }
-
-       FauxtonAPI.navigate(fragment, {trigger: false});
-       FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: this.ddocID, view: this.viewName});
-    },
-
-
-    previewView: function(event, paramsInfo) {
-      event.preventDefault();
-      var that = this,
-      mapVal = this.mapVal(),
-      reduceVal = this.reduceVal(),
-      paramsArr = [];
-
-      if (paramsInfo && paramsInfo.params) {
-        paramsArr = paramsInfo.params;
-      }
-
-      var params = _.reduce(paramsArr, function (params, param) {
-        params[param.name] = param.value;
-        return params;
-      }, {reduce: false});
-
-      FauxtonAPI.addNotification({
-        msg: "<strong>Warning!</strong> Preview executes the Map/Reduce functions in your browser, and may behave differently from CouchDB.",
-        type: "warning",
-        selector: ".advanced-options .errors-container",
-        fade: true,
-        escape: false // beware of possible XSS when the message changes
-      });
-
-      var promise = FauxtonAPI.Deferred();
-
-      if (!this.database.allDocs || this.database.allDocs.params.include_docs !== true) {
-        this.database.buildAllDocs({limit: Databases.DocLimit.toString(), include_docs: true});
-        promise = this.database.allDocs.fetch();
-       } else {
-        promise.resolve();
-       }
-
-      promise.then(function () {
-        params.docs = that.database.allDocs.map(function (model) { return model.get('doc');});
-        var queryPromise = pouchdb.runViewQuery({map: mapVal, reduce: reduceVal}, params);
-        queryPromise.then(function (results) {
-          FauxtonAPI.triggerRouteEvent('updatePreviewDocs', {rows: results.rows, ddoc: that.getCurrentDesignDoc().id, view: that.viewName});
-        });
-      });
-    },
-
-    getCurrentDesignDoc: function () {
-      return this.designDocSelector.getCurrentDesignDoc();
-    },
-
-    isCustomReduceEnabled: function() {
-      return $("#reduce-function-selector").val() == "CUSTOM";
-    },
-
-    mapVal: function () {
-      if (this.mapEditor) {
-        return this.mapEditor.getValue();
-      }
-
-      return this.$('#map-function').text();
-    },
-
-    reduceVal: function() {
-      var reduceOption = this.$('#reduce-function-selector :selected').val(),
-      reduceVal = "";
-
-      if (reduceOption === 'CUSTOM') {
-        if (!this.reduceEditor) { this.createReduceEditor(); }
-        reduceVal = this.reduceEditor.getValue();
-      } else if ( reduceOption !== 'NONE') {
-        reduceVal = reduceOption;
-      }
-
-      return reduceVal;
-    },
-
-
-    hasValidCode: function() {
-      return _.every(["mapEditor", "reduceEditor"], function(editorName) {
-        var editor = this[editorName];
-        if (editorName === "reduceEditor" && ! this.isCustomReduceEnabled()) {
-          return true;
-        }
-        return editor.hadValidCode();
-      }, this);
-    },
-
-    toggleIndexNav: function (event) {
-      $('#dashboard-content').scrollTop(0); //scroll up
-
-      var $targetId = this.$(event.target).attr('id'),
-          $previousTab = this.$(this.$('li.active a').attr('href')),
-          $targetTab = this.$(this.$(event.target).attr('href'));
-
-      if ($targetTab.attr('id') !== $previousTab.attr('id')) {
-        $previousTab.removeAttr('style');
-      }
-
-      if ($targetId === 'index-nav') {
-        if (this.newView) { return; }
-        var that = this;
-        $('#dashboard-content').scrollTop(0); //scroll up
-        $targetTab.toggle('slow', function(){
-           that.showEditors();
-        });
-      } else {
-        $targetTab.toggle('slow');
-      }
-    },
-
-    serialize: function() {
-      return {
-        ddocs: this.ddocs,
-        ddoc: this.model,
-        ddocName: this.model.id,
-        viewName: this.viewName,
-        reduceFunStr: this.reduceFunStr,
-        isCustomReduce: this.hasCustomReduce(),
-        newView: this.newView,
-        langTemplates: this.langTemplates.javascript
-      };
-    },
-
-    hasCustomReduce: function() {
-      return this.reduceFunStr && ! _.contains(this.builtinReduces, this.reduceFunStr);
-    },
-
-    hasReduce: function () {
-      return this.reduceFunStr || false;
-    },
-
-    createReduceEditor: function () {
-      if (this.reduceEditor) {
-        this.reduceEditor.remove();
-      }
-
-      this.reduceEditor = new Components.Editor({
-        editorId: "reduce-function",
-        mode: "javascript",
-        couchJSHINT: true
-      });
-      this.reduceEditor.render();
-
-      if (this.reduceEditor.getLines() === 1){
-        this.$('.beautify_reduce').removeClass("hide");
-        $('.beautify-tooltip').tooltip();
-      }
-    },
-    beforeRender: function () {
-
-      if (this.newView) {
-        this.reduceFunStr = '';
-        if (this.ddocs.length === 0) {
-          this.model = new Documents.Doc(null, {database: this.database});
-        } else {
-          this.model = this.ddocs.first().dDocModel();
-        }
-        this.ddocID = this.model.id;
-      } else {
-        var ddocDecode = decodeURIComponent(this.ddocID);
-        this.model = this.ddocs.get(this.ddocID).dDocModel();
-        this.reduceFunStr = this.model.viewHasReduce(this.viewName);
-      }
-
-      var viewFilters = FauxtonAPI.getExtensions('sidebar:viewFilters'),
-          filteredModels = this.ddocs.models,
-          designDocs = this.ddocs.clone();
-
-      if (!_.isEmpty(viewFilters)) {
-        _.each(viewFilters, function (filter) {
-          filteredModels = _.filter(filteredModels, filter);
-        });
-        designDocs.reset(filteredModels, {silent: true});
-      }
-
-      this.designDocSelector = this.setView('.design-doc-group', new Views.DesignDocSelector({
-        collection: designDocs,
-        ddocName: this.currentDdoc || this.model.id,
-        database: this.database
-      }));
-
-      if (!this.newView) {
-        this.eventer = _.extend({}, Backbone.Events);
-
-        this.advancedOptions = this.insertView('#query', new QueryOptions.AdvancedOptions({
-          updateViewFn: this.updateView,
-          previewFn: this.previewView,
-          database: this.database,
-          viewName: this.viewName,
-          ddocName: this.model.id,
-          hasReduce: this.hasReduce(),
-          eventer: this.eventer,
-          showStale: true
-        }));
-      }
-
-    },
-
-    afterRender: function() {
-
-      if (this.params && !this.newView) {
-        this.advancedOptions.updateFromParams(this.params);
-      }
-
-      this.designDocSelector.updateDesignDoc();
-      if (this.newView || this.showIndex) {
-        this.showEditors();
-        this.showIndex = false;
-      } else {
-        this.$('#index').hide();
-        this.$('#index-nav').parent().removeClass('active');
-      }
-
-    },
-
-    showEditors: function () {
-      this.mapEditor = new Components.Editor({
-        editorId: "map-function",
-        mode: "javascript",
-        couchJSHINT: true
-      });
-      this.mapEditor.render();
-
-      if (this.hasCustomReduce()) {
-        this.createReduceEditor();
-      } else {
-        $(".control-group.reduce-function").hide();
-      }
-
-      if (this.newView) {
-        this.mapEditor.setValue(this.langTemplates[this.defaultLang].map);
-        //Use a built in view by default
-        //this.reduceEditor.setValue(this.langTemplates[this.defaultLang].reduce);
-      }
-
-      this.mapEditor.editSaved();
-      this.reduceEditor && this.reduceEditor.editSaved();
-
-      if (this.mapEditor.getLines() === 1){
-        this.$('.beautify_map').removeClass("hide");
-        $('.beautify-tooltip').tooltip();
-      }
-    },
-    beautifyCode: function(e){
-      e.preventDefault();
-      var targetEditor = $(e.currentTarget).hasClass('beautify_reduce')?this.reduceEditor:this.mapEditor;
-      var beautifiedCode = beautify(targetEditor.getValue());
-      targetEditor.setValue(beautifiedCode);
-    },
-    cleanup: function () {
-      this.mapEditor && this.mapEditor.remove();
-      this.reduceEditor && this.reduceEditor.remove();
-    }
-  });
-
-  Views.DesignDocSelector = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/design_doc_selector",
-
-    events: {
-      "change select#ddoc": "updateDesignDoc"
-    },
-
-    initialize: function (options) {
-      this.ddocName = options.ddocName;
-      this.database = options.database;
-      this.listenTo(this.collection, 'add', this.ddocAdded);
-      this.DocModel = options.DocModel || Documents.Doc;
-    },
-
-    ddocAdded: function (ddoc) {
-      this.ddocName = ddoc.id;
-      this.render();
-    },
-
-    serialize: function () {
-      return {
-        ddocName: this.ddocName,
-        ddocs: this.collection
-      };
-    },
-
-    updateDesignDoc: function () {
-      if (this.newDesignDoc()) {
-        this.$('#new-ddoc-section').show();
-      } else {
-        this.$('#new-ddoc-section').hide();
-      }
-    },
-
-    newDesignDoc: function () {
-
-      return this.$('#ddoc').val() === 'new-doc';
-    },
-
-    newDocValidation: function(){
-      return this.newDesignDoc() && this.$('#new-ddoc').val()==="";
-    },
-    getCurrentDesignDoc: function () {
-      if (this.newDesignDoc()) {
-        var doc = {
-          _id: '_design/' + this.$('#new-ddoc').val(),
-          views: {},
-          language: "javascript"
-        };
-        var ddoc = new this.DocModel(doc, {database: this.database});
-        //this.collection.add(ddoc);
-        return ddoc;
-      } else if ( !this.newDesignDoc() ) {
-        var ddocName = this.$('#ddoc').val();
-        return this.collection.find(function (ddoc) {
-          return ddoc.id === ddocName;
-        }).dDocModel();
-      }
-    }
-  });
-
-  return Views;
-});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/views-sidebar.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-sidebar.js b/app/addons/documents/views-sidebar.js
index 9f8c0ee..2c53b1b 100644
--- a/app/addons/documents/views-sidebar.js
+++ b/app/addons/documents/views-sidebar.js
@@ -151,16 +151,23 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     toggleArrow:  function(e){
       this.$(e.currentTarget).toggleClass("down");
     },
-    buildIndexList: function(collection, info){
+
+    buildIndexList: function(collection, indexType){
       var design = this.model.id.replace(/^_design\//,"");
+      var selector = indexType.selector;
+      var ddocType = indexType.ddocType;
+      var icon = indexType.icon;
+
+
+        this.insertView(".accordion-body", new Views.IndexItem({
+          selector: selector,
+          ddoc: design,
+          collection: collection[selector],
+          ddocType: ddocType,
+          database: this.model.collection.database.id,
+          icon: icon
+        }));
 
-      this.insertView(".accordion-body", new Views.IndexItem({
-        selector: info.selector,
-        ddoc: design,
-        collection: collection[info.selector],
-        name: info.name,
-        database: this.model.collection.database.id
-      }));
     },
 
     serialize: function(){
@@ -176,23 +183,19 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
 
     getSidebarLinks: function () {
       var ddocName = this.model.id.replace(/^_design\//,""),
-          docSafe = app.utils.safeURLName(ddocName), 
+          docSafe = app.utils.safeURLName(ddocName),
           database = this.collection.database;
 
       return _.reduce(FauxtonAPI.getExtensions('sidebar:links'), function (menuLinks, link) {
 
         menuLinks.push({
           title: link.title,
-          url: "#" + database.url('app') + "/" + link.url + "/" + docSafe,
+          url: "#" + database.url('app') + "/_design/" + docSafe + "/" + link.url,
           icon: 'fonticon-plus-circled'
         });
 
-        return menuLinks; 
-     }, [{
-      title: 'New View',
-      url: "#" + database.url('app') + "/new_view/" + docSafe,
-      icon: 'fonticon-plus-circled'
-     }]);
+        return menuLinks;
+     }, []);
 
     },
 
@@ -202,13 +205,9 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
 
       if (!ddocDocs){ return; }
 
-      this.buildIndexList(ddocDocs, {
-        selector: "views",
-        name: 'Views'
-      });
-
-      _.each(sidebarListTypes, function (info) {
-        this.buildIndexList(ddocDocs, info);
+      //this.buildIndexList(ddocDocs, "views", "view");
+      _.each(sidebarListTypes, function (listType) {
+        this.buildIndexList(ddocDocs, listType);
       },this);
 
     },
@@ -228,6 +227,7 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     }
   });
 
+  //Sidebar Index Item
   Views.IndexItem = FauxtonAPI.View.extend({
     template: "addons/documents/templates/index_menu_item",
     tagName: 'li',
@@ -238,19 +238,15 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
       this.database = options.database;
       this.selected = !! options.selected;
       this.selector = options.selector;
-      this.name = options.name;
-      this.icons = {
-        "Views": "fonticon-sidenav-map-reduce",
-        "indexes": "fonticon-sidenav-search"
-      };
+      this.ddocType = options.ddocType || this.selector;
+      this.icon = options.icon;
 
     },
 
     serialize: function() {
       return {
-        icon: this.icons[this.ddocType],
-        ddocType:  this.selector,
-        name: this.name,
+        icon: this.icon,
+        ddocType:  this.ddocType,
         index: this.index,
         ddoc: this.ddoc,
         database: this.database,
@@ -258,7 +254,6 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
         collection: this.collection
       };
     },
-
     afterRender: function() {
       if (this.selected) {
         $(".sidenav ul.nav-list li").removeClass("active");
@@ -267,6 +262,8 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     }
   });
 
+
+
   return Views;
 });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 7085bd8..45a2718 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -38,6 +38,75 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     });
   }
 
+  //Header for alldocs with search, back, Menu, Query options, select etc
+  Views.AllDocsHeader = FauxtonAPI.View.extend({
+    template: "addons/documents/templates/header_alldocs",
+    events: {
+      'select .selectAllDocs': 'selectAllDocs'
+    },
+    initialize: function(options){
+
+    },
+    selectAllDocs: function(){
+      //trigger event to select all in other view
+    },
+    afterRender:function(){
+      //insert DB search dropdown
+
+      //insert top create level dropdown with gear icon
+
+      //search docs
+
+      //insert queryoptions
+
+    }
+  });
+
+
+  //header that shows up when a doc is selected
+  // when a Doc is selected, trigger a routeEvent to render this
+  // the routeEvent will determine which header to show (??)
+  Views.DocEditHeader = FauxtonAPI.View.extend({
+    template: "addons/documents/templates/header_doc_edit",
+    events: {
+      'select .selectAllDocs': 'selectAllDocs'
+    },
+    initialize: function(options){
+
+    },
+    selectAllDocs: function(){
+      //trigger event to select all in other view
+    },
+    afterRender:function(){
+      //insert DB search dropdown
+
+      //insert top create level dropdown with gear icon
+    }
+  });
+
+  Views.DocsHeader = FauxtonAPI.View.extend({
+    template: "addons/documents/templates/header_selecteddoc",
+    events: {
+      'select .selectAllDocs': 'selectAllDocs'
+    },
+    initialize: function(options){
+
+    },
+    selectAllDocs: function(){
+      //trigger event to select all in other view
+    },
+    afterRender:function(){
+      //insert DB search dropdown
+
+      //insert top create level dropdown with gear icon
+
+      //search docs
+
+      //insert queryoptions
+
+    }
+  });
+
 
   Views.DeleteDBModal = Components.ModalView.extend({
     template: "addons/documents/templates/delete_database_modal",
@@ -83,9 +152,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
   Views.Document = FauxtonAPI.View.extend({
     template: "addons/documents/templates/all_docs_item",
-    tagName: "tr",
-    className: "all-docs-item",
-
+    className: "all-docs-item doc-row",
     initialize: function (options) {
       this.checked = options.checked;
     },
@@ -103,6 +170,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
     serialize: function() {
       return {
+        docID: this.model.get('_id'),
         doc: this.model,
         checked: this.checked
       };
@@ -148,27 +216,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     }
   });
 
-  Views.Row = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/index_row_docular",
-    tagName: "tr",
-
-    events: {
-      "click button.delete": "destroy"
-    },
-
-    destroy: function (event) {
-      event.preventDefault();
-
-      window.alert('Cannot delete a document generated from a view.');
-    },
-
-    serialize: function() {
-      return {
-        doc: this.model,
-        url: this.model.url('app')
-      };
-    }
-  });
 
 
   Views.AllDocsNumber = FauxtonAPI.View.extend({
@@ -378,7 +425,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     },
 
     toggleDocument: function (event) {
-      var $row = this.$(event.target).closest('tr'),
+      var $row = this.$(event.target).closest('.doc-row'),
           docId = $row.attr('data-id'),
           rev = this.collection.get(docId).get('_rev'),
           data = {_id: docId, _rev: rev, _deleted: true};
@@ -535,7 +582,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
         if (this.bulkDeleteDocsCollection) {
           isChecked = this.bulkDeleteDocsCollection.get(doc.id);
         }
-        this.rows[doc.id] = this.insertView("table.all-docs tbody", new this.nestedView({
+        this.rows[doc.id] = this.insertView("#doc-list", new this.nestedView({
           model: doc,
           checked: isChecked
         }));

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/fauxton/base.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/base.js b/app/addons/fauxton/base.js
index 8b88d36..68ee7cd 100644
--- a/app/addons/fauxton/base.js
+++ b/app/addons/fauxton/base.js
@@ -14,11 +14,10 @@ define([
   "app",
   "api",
   "addons/fauxton/resizeColumns",
-  "addons/fauxton/components",
-  "plugins/zeroclipboard/ZeroClipboard"
+  "addons/fauxton/components"
 ],
 
-function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
+function(app, FauxtonAPI, resizeColumns, Components) {
 
   var Fauxton = FauxtonAPI.addon();
   FauxtonAPI.addNotification = function (options) {
@@ -51,7 +50,7 @@ function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
   Fauxton.initialize = function () {
     // app.footer = new Fauxton.Footer({el: "#footer-content"}),
     app.navBar = new Fauxton.NavBar();
-    app.apiBar = new Fauxton.ApiBar();
+    app.apiBar = new Components.ApiBar();
 
     FauxtonAPI.when.apply(null, app.navBar.establish()).done(function() {
       FauxtonAPI.masterLayout.setView("#primary-navbar", app.navBar, true);
@@ -77,7 +76,7 @@ function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
       var crumbs = routeObject.get('crumbs');
 
       if (crumbs.length) {
-        FauxtonAPI.masterLayout.setView('#breadcrumbs', new Fauxton.Breadcrumbs({
+        FauxtonAPI.masterLayout.setView('#breadcrumbs', new Components.Breadcrumbs({
           crumbs: crumbs
         }), true).render();
       }
@@ -93,20 +92,7 @@ function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
     });
   };
 
-  Fauxton.Breadcrumbs = FauxtonAPI.View.extend({
-    template: "addons/fauxton/templates/breadcrumbs",
 
-    serialize: function() {
-      var crumbs = _.clone(this.crumbs);
-      return {
-        crumbs: crumbs
-      };
-    },
-
-    initialize: function(options) {
-      this.crumbs = options.crumbs;
-    }
-  });
 
   Fauxton.VersionInfo = Backbone.Model.extend({
     url: function () {
@@ -259,64 +245,6 @@ function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
     // TODO: ADD ACTIVE CLASS
   });
 
-  Fauxton.ApiBar = FauxtonAPI.View.extend({
-    template: "addons/fauxton/templates/api_bar",
-    endpoint: '_all_docs',
-
-    documentation: 'docs',
-
-    events:  {
-      "click .api-url-btn" : "toggleAPIbar"
-    },
-
-    toggleAPIbar: function(e){
-      var $currentTarget = $(e.currentTarget).find('span');
-      if ($currentTarget.hasClass("fonticon-plus")){
-        $currentTarget.removeClass("fonticon-plus").addClass("fonticon-minus");
-      }else{
-        $currentTarget.removeClass("fonticon-minus").addClass("fonticon-plus");
-      }
-      $('.api-navbar').toggle();
-    },
-
-    serialize: function() {
-      return {
-        endpoint: this.endpoint,
-        documentation: this.documentation
-      };
-    },
-
-    hide: function(){
-      this.$el.addClass('hide');
-    },
-    show: function(){
-      this.$el.removeClass('hide');
-    },
-    update: function(endpoint) {
-      this.show();
-      this.endpoint = endpoint[0];
-      this.documentation = endpoint[1];
-      this.render();
-    },
-    afterRender: function(){
-      var client = new Components.Clipboard({
-        $el: this.$('.copy-url')
-      });
-
-      client.on("load", function(e){
-        var $apiInput = $('#api-navbar input');
-        var copyURLTimer;
-        client.on("mouseup", function(e){
-          $apiInput.css("background-color","#aaa");
-          window.clearTimeout(copyURLTimer);
-          copyURLTimer = setInterval(function () {
-            $apiInput.css("background-color","#fff");
-          }, 200);
-        });
-      });
-    }
-
-  });
 
   Fauxton.Notification = FauxtonAPI.View.extend({
     fadeTimer: 5000,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index c863ba7..c92a7ce 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -34,6 +34,83 @@ define([
 function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
   var Components = FauxtonAPI.addon();
 
+
+  Components.Breadcrumbs = FauxtonAPI.View.extend({
+    className: "breadcrumb pull-left",
+    tagName: "ul",
+    template: "addons/fauxton/templates/breadcrumbs",
+    serialize: function() {
+      var crumbs = _.clone(this.crumbs);
+      return {
+        crumbs: crumbs
+      };
+    },
+
+    initialize: function(options) {
+      this.crumbs = options.crumbs;
+    }
+  });
+
+  Components.ApiBar = FauxtonAPI.View.extend({
+    template: "addons/fauxton/templates/api_bar",
+    endpoint: '_all_docs',
+
+    documentation: 'docs',
+
+    events:  {
+      "click .api-url-btn" : "toggleAPIbar"
+    },
+
+    toggleAPIbar: function(e){
+      var $currentTarget = $(e.currentTarget).find('span');
+      if ($currentTarget.hasClass("fonticon-plus")){
+        $currentTarget.removeClass("fonticon-plus").addClass("fonticon-minus");
+      }else{
+        $currentTarget.removeClass("fonticon-minus").addClass("fonticon-plus");
+      }
+      $('.api-navbar').toggle();
+    },
+
+    serialize: function() {
+      return {
+        endpoint: this.endpoint,
+        documentation: this.documentation
+      };
+    },
+
+    hide: function(){
+      this.$el.addClass('hide');
+    },
+    show: function(){
+      this.$el.removeClass('hide');
+    },
+    update: function(endpoint) {
+      this.show();
+      this.endpoint = endpoint[0];
+      this.documentation = endpoint[1];
+      this.render();
+    },
+    afterRender: function(){
+      ZeroClipboard.config({ moviePath: "/assets/js/plugins/zeroclipboard/ZeroClipboard.swf" });
+      var client = new ZeroClipboard(this.$(".copy-url"));
+      client.on("load", function(e){
+        var $apiInput = $('#api-navbar input');
+        var copyURLTimer;
+        client.on("mouseup", function(e){
+          $apiInput.css("background-color","#aaa");
+          window.clearTimeout(copyURLTimer);
+          copyURLTimer = setInterval(function () {
+            $apiInput.css("background-color","#fff");
+          }, 200);
+        });
+      });
+    }
+
+  });
+
+
+
+
   Components.Pagination = FauxtonAPI.View.extend({
     template: "addons/fauxton/templates/pagination",
 
@@ -453,7 +530,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
       if (this.mode != "plain") {
         this.editor.getSession().setMode("ace/mode/" + this.mode);
       }
-      
+
       this.editor.setShowPrintMargin(false);
       this.addCommands();
 
@@ -624,11 +701,12 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
     className: "dropdown",
     initialize: function(options){
       this.links = options.links;
+      this.icon = options.icon || "fonticon-plus-circled2";
     },
     serialize: function(){
-      var sidebarItem = FauxtonAPI.getExtensions('sidebar:links');
       return {
-        links: this.links
+        links: this.links,
+        icon: this.icon
       };
     }
   });
@@ -656,7 +734,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
   //need to make this into a backbone view...
   var routeObjectSpinner;
   FauxtonAPI.RouteObject.on('beforeEstablish', function (routeObject) {
-    if (!routeObject.disableLoader){ 
+    if (!routeObject.disableLoader){
       var opts = {
         lines: 16, // The number of lines to draw
         length: 8, // The length of each line
@@ -702,7 +780,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
   FauxtonAPI.RouteObject.on('beforeRender', function (routeObject, view, selector) {
     removeRouteObjectSpinner();
 
-    if (!view.disableLoader){ 
+    if (!view.disableLoader){
       var opts = {
         lines: 16, // The number of lines to draw
         length: 8, // The length of each line


[48/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Fix replication links from all dbs page and header


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/66d97572
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/66d97572
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/66d97572

Branch: refs/heads/secondary-indexes
Commit: 66d97572055344a6ec4511c830f356c86f346ee4
Parents: 885f234
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:37 2014 -0400

----------------------------------------------------------------------
 app/addons/permissions/views.js | 9 +++++----
 app/addons/replication/route.js | 5 +++--
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/66d97572/app/addons/permissions/views.js
----------------------------------------------------------------------
diff --git a/app/addons/permissions/views.js b/app/addons/permissions/views.js
index 43f5aab..0080da7 100644
--- a/app/addons/permissions/views.js
+++ b/app/addons/permissions/views.js
@@ -20,6 +20,7 @@ function (app, FauxtonAPI, Permissions ) {
   Permissions.events = _.extend(events, Backbone.Events);
 
   Permissions.Permissions = FauxtonAPI.View.extend({
+    className: "view",
     template: "addons/permissions/templates/permissions",
 
     initialize: function (options) {
@@ -80,7 +81,7 @@ function (app, FauxtonAPI, Permissions ) {
 
     beforeRender: function () {
       var section = this.model.get(this.section);
-      
+
       this.nameViews = [];
       this.roleViews = [];
 
@@ -107,11 +108,11 @@ function (app, FauxtonAPI, Permissions ) {
 
     discardRemovedViews: function () {
       this.nameViews = _.filter(this.nameViews, function (view) {
-        return !view.removed; 
+        return !view.removed;
       });
 
       this.roleViews = _.filter(this.roleViews, function (view) {
-        return !view.removed; 
+        return !view.removed;
       });
     },
 
@@ -178,7 +179,7 @@ function (app, FauxtonAPI, Permissions ) {
     removeItem: function (event) {
       var that = this;
       event.preventDefault();
-      
+
       this.removed = true;
       Permissions.events.trigger('itemRemoved');
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/66d97572/app/addons/replication/route.js
----------------------------------------------------------------------
diff --git a/app/addons/replication/route.js b/app/addons/replication/route.js
index 17368f8..d0c298a 100644
--- a/app/addons/replication/route.js
+++ b/app/addons/replication/route.js
@@ -22,6 +22,7 @@ function(app, FauxtonAPI, Replication, Views) {
     roles: ["_admin"],
     routes: {
       "replication": "defaultView",
+      "replication/new/:dbname": "defaultView",
       "replication/:dbname": "defaultView"
     },
     selectedHeader: "Replication",
@@ -29,7 +30,7 @@ function(app, FauxtonAPI, Replication, Views) {
       return [this.replication.url(), this.replication.documentation];
     },
     crumbs: [
-      {"name": "Replicate changes from: ", "link": "replication"}
+      {"name": "Replicate ", "link": "replication"}
     ],
     defaultView: function(dbname){
 			this.databases = new Replication.DBList({});
@@ -39,7 +40,7 @@ function(app, FauxtonAPI, Replication, Views) {
         selectedDB: dbname ||"",
 				collection: this.databases,
         status:  this.tasks
-			}));  
+			}));
     }
   });
 


[23/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
button and search box moved to header on all docs


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/6e298698
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/6e298698
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/6e298698

Branch: refs/heads/secondary-indexes
Commit: 6e298698023f0666025a37f3fc4c78778acf25d9
Parents: 0a50426
Author: Jenn Schiffer <je...@pancaketheorem.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:35:09 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/routes.js                      |  5 +++++
 app/addons/documents/templates/all_docs_layout.html | 12 ------------
 app/addons/documents/templates/header_alldocs.html  | 14 +++++++++++---
 app/addons/documents/views.js                       | 12 ++++++++----
 4 files changed, 24 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6e298698/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index bf0bc95..f06a307 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -172,6 +172,11 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
         }
       });
 
+      this.header = this.setView("#breadcrumbs", new Documents.Views.AllDocsHeader({
+        database: this.data.database
+      }));
+
+
       this.sidebar = this.setView("#sidebar-content", new Documents.Views.Sidebar({
         collection: this.data.designDocs,
         database: this.data.database

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6e298698/app/addons/documents/templates/all_docs_layout.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_layout.html b/app/addons/documents/templates/all_docs_layout.html
index e2c2479..90de57c 100644
--- a/app/addons/documents/templates/all_docs_layout.html
+++ b/app/addons/documents/templates/all_docs_layout.html
@@ -11,15 +11,3 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-<div class="dashboard-upper-menu">
-	<ul class="nav nav-tabs window-resizeable" id="db-views-tabs-nav">
-	  <li><a id="toggle-query" href="#query" data-bypass="true" data-toggle="tab">
-	    <i class="fonticon fonticon-plus"></i> Query Options</a></li>
-	</ul>
-	<div class="js-search searchbox-container"></div>
-</div>
-
-<div class="tab-content">
-  <div class="tab-pane" id="query">
-  </div>
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6e298698/app/addons/documents/templates/header_alldocs.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html
index 61eb2d8..72d49ad 100644
--- a/app/addons/documents/templates/header_alldocs.html
+++ b/app/addons/documents/templates/header_alldocs.html
@@ -27,9 +27,17 @@ the License.
   <!-- Select all -->
 
   <!-- search (jump to doc)-->
+  <div id="header-search" class="js-search searchbox-container"></div>
 
   <!-- Query Options-->
-
-
-  <!--right margin for api bar-->
+  <a id="toggle-query" href="#query" data-bypass="true" data-toggle="tab">
+    <i class="fonticon fonticon-plus"></i> 
+    Query Options
+  </a>
+
+  <div class="tab-content">
+    <div class="tab-pane" id="query">
+  </div>
 </div>
+
+  <!--right margin for api bar-->
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6e298698/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 45a2718..50c9c77 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -50,12 +50,16 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     selectAllDocs: function(){
       //trigger event to select all in other view
     },
-    afterRender:function(){
+    beforeRender:function(){
       //insert DB search dropdown
 
       //insert top create level dropdown with gear icon
 
       //search docs
+      this.setView("#header-search", new Views.JumpToDoc({
+        database: this.database,
+        collection: this.database.allDocs
+      }));
 
       //insert queryoptions
 
@@ -293,11 +297,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
     toggleQuery: function (event) {
       $('#dashboard-content').scrollTop(0);
-      this.$('#query').toggle('slow');
+      this.$('#query').toggle();
     },
 
     beforeRender: function () {
-      this.advancedOptions = this.insertView('#query', new QueryOptions.AdvancedOptions({
+      this.advancedOptions = this.insertView('#toggle-query', new QueryOptions.AdvancedOptions({
         updateViewFn: this.updateAllDocs,
         previewFn: this.previewView,
         hasReduce: false,
@@ -308,7 +312,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       this.toolsView = this.setView(".js-search", new Views.JumpToDoc({
         database: this.database,
         collection: this.database.allDocs
-      }));
+      })); 
     },
 
     afterRender: function () {


[28/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
hide other trays when opening another tray
fix tray styling from button work
style buttons to right header


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/effbe5e4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/effbe5e4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/effbe5e4

Branch: refs/heads/secondary-indexes
Commit: effbe5e40319a242d3aa823cf1e28ff4dad6cf70
Parents: cd7b26f
Author: Jenn Schiffer <je...@pancaketheorem.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:35 2014 -0400

----------------------------------------------------------------------
 .../documents/assets/less/advancedOptions.less  |  7 +++-
 app/addons/documents/assets/less/headers.less   | 41 ++++++++++++++++++--
 .../documents/templates/advanced_options.html   |  2 +-
 .../documents/templates/header_alldocs.html     | 20 +++++-----
 app/addons/documents/views-advancedopts.js      |  4 +-
 app/addons/fauxton/components.js                |  1 +
 app/addons/fauxton/templates/api_bar.html       | 10 ++---
 assets/less/fauxton.less                        |  2 +
 8 files changed, 66 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/effbe5e4/app/addons/documents/assets/less/advancedOptions.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/advancedOptions.less b/app/addons/documents/assets/less/advancedOptions.less
index 83b1655..6febf3b 100644
--- a/app/addons/documents/assets/less/advancedOptions.less
+++ b/app/addons/documents/assets/less/advancedOptions.less
@@ -23,13 +23,16 @@
   .border-radius(5px);
   width: 490px;
   position: absolute;
+  right: 5px;
   z-index: 11;
   background-color: #333;
   color: #fff;
   padding: 0;
   margin: 0;
   .add-on {
-    padding-bottom: 10px;
+    padding: 0;
+    margin: 0;
+    line-height: 1em;
   }
   .query-group {
     padding: 20px;
@@ -128,7 +131,7 @@
   content: '';
   position: absolute;
   top: -25px;
-  left: 30px;
+  right: 140px;
   border-color: transparent transparent #333 transparent;
   border-style: solid;
   border-width: 15px;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/effbe5e4/app/addons/documents/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/headers.less b/app/addons/documents/assets/less/headers.less
index 31faef1..ce5a27d 100644
--- a/app/addons/documents/assets/less/headers.less
+++ b/app/addons/documents/assets/less/headers.less
@@ -1,21 +1,56 @@
 .header-right {
+  .add-on {
+    font-size: 16px;
+  }
+  .well {
+    padding: 0;
+    margin: 0;
+  }
   .searchbox-container {
     position: relative;
     right: inherit;
-    height: 38px;
     input[type="text"] {
       .border-radius(5px);
       font-size: 13px;
       padding: 8px 35px 8px 10px;
+      width: 275px;
     }
     .btn-primary {
       background: none repeat scroll 0% 0% transparent;
       border: none;
       position: absolute;
-      right: 0;
-      padding-top: 7px;
+      right: 12px;
+      top: 8px;
       z-index: 2;
       color: #999;
     }
   }
+  > .btn {
+    padding: 0;
+    margin: 0;
+  }
+  > .button,
+  > .button a,
+  .api-url-btn > button {
+    color: #666;
+    font-size: 13px;
+    line-height: 3em;
+  }
+  > div {
+    float: right;
+    height: 60px;
+    border-left: 1px solid #ccc;
+    margin: 0;   
+    padding: 10px 15px;
+    line-height: 40px; 
+  }
+  > div:last-child {
+    border-left: none;
+  }
+  .api-url-btn {
+    background: none;
+    border: none;
+    padding: 0;
+    margin: 0;
+  }
 }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/effbe5e4/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/advanced_options.html b/app/addons/documents/templates/advanced_options.html
index 0502301..5e0e77f 100644
--- a/app/addons/documents/templates/advanced_options.html
+++ b/app/addons/documents/templates/advanced_options.html
@@ -12,7 +12,7 @@ License for the specific language governing permissions and limitations under
 the License.
 -->    
 <a id="toggle-query" href="#query-options-tray" data-bypass="true" data-toggle="tab">
-  <i class="fonticon fonticon-plus"></i>
+  <i class="fonticon fonticon-cog"></i>
   Query Options
 </a>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/effbe5e4/app/addons/documents/templates/header_alldocs.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html
index 6e8f97f..3434dde 100644
--- a/app/addons/documents/templates/header_alldocs.html
+++ b/app/addons/documents/templates/header_alldocs.html
@@ -12,18 +12,20 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-  <!-- Select toggle -->
-  <div id="header-select-all">
-    <span class="toggle-select-menu icon fonticon-ok-circled">Select</span>
-  </div>
+  <!-- floats right -->
 
-  <div id="header-select-menu"></div>
-  <!-- search (jump to doc)-->
-  <div id="header-search" class="js-search searchbox-container"></div>
+  <div id="header-api-bar" class="button"></div>
 
   <!-- Query Options-->
-  <div class="header-query-options">
+  <div class="button header-query-options">
     <!-- Insert the query options here :) -->
     <div id="query-options"></div>
   </div>
-  <div id="header-api-bar"></div>
+
+  <!-- search (jump to doc)-->
+  <div id="header-search" class="js-search searchbox-container"></div>
+
+  <!-- Select toggle -->
+  <div id="header-select-all" class="button">
+    <span class="toggle-select-menu icon fonticon-ok-circled">Select</span>
+  </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/effbe5e4/app/addons/documents/views-advancedopts.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-advancedopts.js b/app/addons/documents/views-advancedopts.js
index 6500b50..0a91914 100644
--- a/app/addons/documents/views-advancedopts.js
+++ b/app/addons/documents/views-advancedopts.js
@@ -64,7 +64,8 @@ function(app, FauxtonAPI, resizeColumns ) {
     toggleQuery: function(event) {
       $('#dashboard-content').scrollTop(0);
       this.$('#query-options-tray').toggle();
-    },
+      $('.api-navbar').hide();
+    }, 
 
     resetForm: function() {
       $('input, textarea').each(function(){
@@ -74,6 +75,7 @@ function(app, FauxtonAPI, resizeColumns ) {
       $("select").each(function(){
         this.selectedIndex = 0;
       });
+      $('#query-options-tray').hide();
     },
 
     showKeys: function(){

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/effbe5e4/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index 60d0c26..55f4af4 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -109,6 +109,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
       }else{
         $currentTarget.removeClass("fonticon-minus").addClass("fonticon-plus");
       }
+      $('#query-options-tray').hide();
       $('.api-navbar').toggle();
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/effbe5e4/app/addons/fauxton/templates/api_bar.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/api_bar.html b/app/addons/fauxton/templates/api_bar.html
index f56741c..bab431b 100644
--- a/app/addons/fauxton/templates/api_bar.html
+++ b/app/addons/fauxton/templates/api_bar.html
@@ -12,22 +12,22 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<button class="btn btn-primary pull-right api-url-btn">
-  API URL
+<a class="btn btn-primary pull-right api-url-btn">
   <i class="fonticon-plus icon"></i>
-</button>
+  API URL
+</a>
 <div class="clearfix"></div>
 <div class="api-navbar" style="display: none">
     <div class="input-prepend input-append">
       <span class="add-on">
         API URL
         <a class="help-link" data-bypass="true" href="<%-getDocUrl(documentation)%>" target="_blank">
-          <i class="icon-question-sign"></i>
+          <i class="fonticon-link"></i>
         </a>
       </span>
       <input id="api-url-text" type="text" class="input-xxlarge" value="<%- endpoint %>">
       <a class="btn copy-url" data-clipboard-target="api-url-text">
-        <i class="fonticon-eye icon"></i>
+        <i class="fonticon-clipboard icon"></i>
         Copy
       </a>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/effbe5e4/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 29ef04f..e8a9fdb 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -262,6 +262,7 @@ div.spinner {
   right: 5px;
   background-color: #333;
   padding: 5px 20px;
+  z-index: 2;
   .input-append.input-prepend {
     margin-bottom: 0px;
     .copying {
@@ -293,6 +294,7 @@ div.spinner {
       margin-left: -1px;
       padding: 10px 10px 8px;
       border: none;
+      line-height: 1.5em;
       .border-radius(5px);
       &:hover{
         background-color: #cbcbcb;


[15/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Disable async rendering to fix race conditions


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/03969421
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/03969421
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/03969421

Branch: refs/heads/secondary-indexes
Commit: 03969421f92efb3b5c643aa56f84afb2239c0696
Parents: 9d8900b
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sun Aug 24 16:33:43 2014 +0200

----------------------------------------------------------------------
 app/core/base.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/03969421/app/core/base.js
----------------------------------------------------------------------
diff --git a/app/core/base.js b/app/core/base.js
index b9d0f7f..61da5e4 100644
--- a/app/core/base.js
+++ b/app/core/base.js
@@ -62,7 +62,7 @@ function(Backbone, LayoutManager) {
     manage: true,
     disableLoader: false,
 
-    useRAF: true,
+    useRAF: false,
 
     forceRender: function () {
       this.hasRendered = false;
@@ -88,7 +88,7 @@ function(Backbone, LayoutManager) {
   _.each([FauxtonAPI.Model, FauxtonAPI.Collection], function (ctor) {
     _.extend(ctor.prototype, caching);
   });
-  
+
   var extensions = _.extend({}, Backbone.Events);
   // Can look at a remove function later.
   FauxtonAPI.registerExtension = function (name, view) {
@@ -102,7 +102,7 @@ function(Backbone, LayoutManager) {
 
   FauxtonAPI.unRegisterExtension = function (name) {
     var views = extensions[name];
-    
+
     if (!views) { return; }
     extensions.trigger('remove:' + name, views);
     delete extensions[name];
@@ -125,7 +125,7 @@ function(Backbone, LayoutManager) {
     var _cb = arguments[arguments.length -1];
     if (_.isObject(view) && !cb) {
       _cb = function (item) { return _.isEqual(item, view);};
-    } 
+    }
 
     views = _.filter(views, function (item) {
       return !_cb(item);


[05/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Upgrade backbone.layoutmanager

Work off Tim's initial commits and adjust to cater for the use of
establish functions in views and routeObjects.
We don't want to immediately render the view. We first want any pending
promises returned from a routeObjects establish and a view's establish
to complete before rendering the view.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/2283352a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/2283352a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/2283352a

Branch: refs/heads/secondary-indexes
Commit: 2283352a0938129d0acc04927bdb0e175bd61b4f
Parents: 07cce5a
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Aug 11 12:06:21 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Aug 18 11:30:50 2014 +0200

----------------------------------------------------------------------
 app/addons/activetasks/tests/viewsSpec.js       | 15 ++--
 app/addons/config/tests/resourcesSpec.js        |  4 +-
 app/addons/documents/tests/views-changesSpec.js |  7 +-
 app/addons/fauxton/tests/baseSpec.js            | 12 ++-
 app/addons/fauxton/tests/filterViewSpec.js      | 10 ++-
 app/addons/fauxton/tests/paginateSpec.js        |  4 +-
 app/addons/permissions/tests/viewsSpec.js       | 12 +--
 app/core/base.js                                |  4 +-
 app/core/layout.js                              | 81 ++++++++++++++++----
 app/core/routeObject.js                         | 11 ++-
 app/core/tests/layoutSpec.js                    | 79 +++++++++++++++++--
 app/core/tests/routeObjectSpec.js               |  6 ++
 test/mocha/testUtils.js                         |  8 +-
 13 files changed, 198 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/addons/activetasks/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/activetasks/tests/viewsSpec.js b/app/addons/activetasks/tests/viewsSpec.js
index 19c5b65..8731200 100644
--- a/app/addons/activetasks/tests/viewsSpec.js
+++ b/app/addons/activetasks/tests/viewsSpec.js
@@ -27,9 +27,9 @@ define([
 
     describe("on change polling rate", function () {
       var viewSandbox;
-      beforeEach(function () {
+      beforeEach(function (done) {
         viewSandbox = new ViewSandbox();
-        viewSandbox.renderView(tabMenu);
+        viewSandbox.renderView(tabMenu, done);
       });
 
       afterEach(function () {
@@ -66,7 +66,7 @@ define([
 
     describe('on request by type', function () {
       var viewSandbox, mainView;
-      beforeEach(function () {
+      beforeEach(function (done) {
 
         mainView = new Views.View({
           collection: new Activetasks.AllTasks(),
@@ -74,8 +74,9 @@ define([
         });
 
         viewSandbox = new ViewSandbox();
-        viewSandbox.renderView(tabMenu);
-        viewSandbox.renderView(mainView);
+        viewSandbox.renderView(tabMenu).promise().then(function () {
+          viewSandbox.renderView(mainView, done);
+        });
       });
 
       afterEach(function () {
@@ -99,14 +100,14 @@ define([
 
   describe('DataSection', function () {
     var viewSandbox, mainView;
-    beforeEach(function () {
+    beforeEach(function (done) {
       mainView = new Views.View({
         collection: new Activetasks.AllTasks(),
         currentView: "all"
       });
 
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(mainView);
+      viewSandbox.renderView(mainView, done);
     });
 
     afterEach(function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/addons/config/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/config/tests/resourcesSpec.js b/app/addons/config/tests/resourcesSpec.js
index 1cc9e62..8699e36 100644
--- a/app/addons/config/tests/resourcesSpec.js
+++ b/app/addons/config/tests/resourcesSpec.js
@@ -37,9 +37,9 @@ define([
 
     describe("editing Items", function () {
       var viewSandbox;
-      beforeEach(function () {
+      beforeEach(function (done) {
         viewSandbox = new ViewSandbox();
-        viewSandbox.renderView(tabMenu);
+        viewSandbox.renderView(tabMenu, done);
       });
 
       afterEach(function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/addons/documents/tests/views-changesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/views-changesSpec.js b/app/addons/documents/tests/views-changesSpec.js
index 94ca585..36669ad 100644
--- a/app/addons/documents/tests/views-changesSpec.js
+++ b/app/addons/documents/tests/views-changesSpec.js
@@ -28,7 +28,7 @@ define([
 
     handlerSpy = sinon.spy(Views.Changes.prototype, 'toggleJson');
 
-    beforeEach(function () {
+    beforeEach(function (done) {
       var database = new Databases.Model({id: 'bla'});
       database.buildChanges({descending: 'true', limit: '100', include_docs: 'true'} );
       filteredView = new Views.Changes({
@@ -36,10 +36,11 @@ define([
       });
 
       view = new Views.Changes({
-        model: model
+        model: model,
+        useRAF: false
       });
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(view);
+      viewSandbox.renderView(view, done);
     });
 
     afterEach(function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/addons/fauxton/tests/baseSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/tests/baseSpec.js b/app/addons/fauxton/tests/baseSpec.js
index a7ff7a1..b9814bc 100644
--- a/app/addons/fauxton/tests/baseSpec.js
+++ b/app/addons/fauxton/tests/baseSpec.js
@@ -88,15 +88,19 @@ describe('Fauxton Notifications', function () {
       delete window.fauxton_xss_test_escaped;
     });
 
-    it('should be able to render unescaped', function () {
+    it('should be able to render unescaped', function (done) {
       var view = FauxtonAPI.addNotification({
         msg: '<script>window.fauxton_xss_test_unescaped = true;</script>',
         selector: 'body',
         escape: false
       });
-      view.$el.remove();
-      assert.ok(window.fauxton_xss_test_unescaped);
-      delete window.fauxton_xss_test_unescaped;
+
+      view.promise().then(function () {
+        view.$el.remove();
+        assert.ok(window.fauxton_xss_test_unescaped);
+        delete window.fauxton_xss_test_unescaped;
+        done();
+      });
     });
 
     it('should render escaped if the escape value is not explicitly false,' +

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/addons/fauxton/tests/filterViewSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/tests/filterViewSpec.js b/app/addons/fauxton/tests/filterViewSpec.js
index 1eefa05..3a566dc 100644
--- a/app/addons/fauxton/tests/filterViewSpec.js
+++ b/app/addons/fauxton/tests/filterViewSpec.js
@@ -27,13 +27,15 @@ define([
       FauxtonAPI.router.triggerRouteEvent = function () {};
     }
 
-    beforeEach(function () {
+    beforeEach(function (done) {
       filterView = new Components.FilterView({
         eventNamespace: 'mynamespace'
       });
 
+      Components.FilterItemView.prototype.useRAF = false;
+
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(filterView);
+      viewSandbox.renderView(filterView, done);
     });
 
     afterEach(function () {
@@ -43,7 +45,6 @@ define([
     it('should add filter markup', function () {
       filterView.$('[name="filter"]').val('i was a lonely filter');
       filterView.$('.js-filter-form').submit();
-
       filterView.$('[name="filter"]').val('i am a filter');
       filterView.$('.js-filter-form').submit();
       assert.equal(2, filterView.$('.js-remove-filter').length);
@@ -73,7 +74,8 @@ define([
     it('should add tooltips when a text for it is defined', function () {
       filterView = new Components.FilterView({
         eventNamespace: 'mynamespace',
-        tooltipText: 'ente ente'
+        tooltipText: 'ente ente',
+        useRAF: false
       });
       viewSandbox.renderView(filterView);
       assert.equal(1, filterView.$('.js-filter-tooltip').length);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/addons/fauxton/tests/paginateSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/tests/paginateSpec.js b/app/addons/fauxton/tests/paginateSpec.js
index d336ea8..f97b255 100644
--- a/app/addons/fauxton/tests/paginateSpec.js
+++ b/app/addons/fauxton/tests/paginateSpec.js
@@ -22,7 +22,7 @@ define([
 
   describe('IndexPaginate', function () {
     var viewSandbox, paginate, collection, navigateMock;
-    beforeEach(function () {
+    beforeEach(function (done) {
       collection = new Models.IndexCollection([{
         id:'myId1',
         doc: 'num1'
@@ -43,7 +43,7 @@ define([
         canShowNextfn: function () { return true;}
       });
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(paginate); 
+      viewSandbox.renderView(paginate, done); 
     });
 
     afterEach(function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/addons/permissions/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/permissions/tests/viewsSpec.js b/app/addons/permissions/tests/viewsSpec.js
index c22d405..147cee4 100644
--- a/app/addons/permissions/tests/viewsSpec.js
+++ b/app/addons/permissions/tests/viewsSpec.js
@@ -21,7 +21,7 @@ define([
   describe('Permission View', function () {
     var security, section, viewSandbox;
 
-    beforeEach(function () {
+    beforeEach(function (done) {
       security = new Models.Security({'admins': {
         'names': ['_user'],
         'roles': []
@@ -34,7 +34,7 @@ define([
       });
 
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(section); 
+      viewSandbox.renderView(section, done); 
     });
 
     afterEach(function () {
@@ -67,7 +67,7 @@ define([
         security,
         viewSandbox;
 
-    beforeEach(function () {
+    beforeEach(function (done) {
       security = new Models.Security({'admins': {
         'names': ['_user'],
         'roles': []
@@ -80,7 +80,7 @@ define([
       });
 
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(section); 
+      viewSandbox.renderView(section, done); 
     });
 
     afterEach(function () {
@@ -130,13 +130,13 @@ define([
     var item,
         viewSandbox;
 
-    beforeEach(function () {
+    beforeEach(function (done) {
       item = new Views.PermissionItem({
         item: '_user'
       });
 
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(item); 
+      viewSandbox.renderView(item, done); 
     });
 
     afterEach(function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/core/base.js
----------------------------------------------------------------------
diff --git a/app/core/base.js b/app/core/base.js
index 9fbb7a0..b9d0f7f 100644
--- a/app/core/base.js
+++ b/app/core/base.js
@@ -62,9 +62,7 @@ function(Backbone, LayoutManager) {
     manage: true,
     disableLoader: false,
 
-    // Either tests or source are expecting synchronous renders, so disable
-    // asynchronous rendering improvements.
-    useRAF: false,
+    useRAF: true,
 
     forceRender: function () {
       this.hasRendered = false;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/core/layout.js
----------------------------------------------------------------------
diff --git a/app/core/layout.js b/app/core/layout.js
index 0a45e62..8d589e7 100644
--- a/app/core/layout.js
+++ b/app/core/layout.js
@@ -10,31 +10,86 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define(function(require, exports, module) {
-  var Backbone = require("backbone");
-  var LayoutManager = require("plugins/backbone.layoutmanager");
+define([
+  "backbone", 
+  "plugins/backbone.layoutmanager"
+], function(Backbone) {
 
-  var Layout = Backbone.Layout.extend({
-    template: "templates/layouts/with_sidebar",
+  // A wrapper of the main Backbone.layoutmanager
+  // Allows the main layout of the page to be changed by any plugin.
+  var Layout = function () {
+    this.layout = new Backbone.Layout({
+      template: "templates/layouts/with_sidebar"
+    });
 
-    // Either tests or source are expecting synchronous renders, so disable
-    // asynchronous rendering improvements.
-    useRAF: false,
+    this.layoutViews = {};
+    //this views don't ever get removed. An example of this is the main navigation sidebar
+    this.permanentViews = {};
+    this.el = this.layout.el;
+  };
+
+  Layout.configure = function (options) {
+    Backbone.Layout.configure(options);
+  };
+
+  // creatings the dashboard object same way backbone does
+  _.extend(Layout.prototype, {
+    render: function () {
+      return this.layout.render();
+    },
 
     setTemplate: function(template) {
       if (template.prefix){
-        this.template = template.prefix + template.name;
+        this.layout.template = template.prefix + template.name;
       } else{
-        this.template = "templates/layouts/" + template;
+        this.layout.template = "templates/layouts/" + template;
       }
-
       // If we're changing layouts all bets are off, so kill off all the
       // existing views in the layout.
-      this.removeView();
+      _.each(this.layoutViews, function(view){view.removeView();});
+      this.layoutViews = {};
       this.render();
+    },
+
+    setView: function(selector, view, keep) {
+      this.layout.setView(selector, view, false);
+
+      if (!keep) {
+        this.layoutViews[selector] = view;
+      } else {
+        this.permanentViews[selector] = view;
+      }
+
+      return view;
+    },
+
+    renderView: function(selector) {
+      var view = this.layoutViews[selector];
+      if (!view) {
+        return false;
+      } else {
+        return view.render();
+      }
+    },
+
+    removeView: function (selector) {
+      var view = this.layout.getView(selector);
+
+      if (!view) {
+        return false;
+        }
+
+      this.layout.removeView(selector);
+      
+      if (this.layoutViews[selector]) {
+        delete this.layoutViews[selector];
+      }
+
+      return true;
     }
+
   });
 
-  module.exports = Layout;
+  return Layout;
 
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/core/routeObject.js
----------------------------------------------------------------------
diff --git a/app/core/routeObject.js b/app/core/routeObject.js
index f8a238f..898afcb 100644
--- a/app/core/routeObject.js
+++ b/app/core/routeObject.js
@@ -149,12 +149,17 @@ function(FauxtonAPI, Backbone) {
     },
 
     renderViewOnLayout: function(viewInfo, resp, xhr){
-      var masterLayout = viewInfo.masterLayout;
+      var masterLayout = viewInfo.masterLayout,
+          triggerBroadcast = _.bind(this.triggerBroadcast, this);
 
       masterLayout.setView(viewInfo.selector, viewInfo.view);
-      masterLayout.renderView(viewInfo.selector);
+      var promise = masterLayout.renderView(viewInfo.selector).promise();
 
-      this.triggerBroadcast('afterRender', viewInfo.view, viewInfo.selector);
+      promise.then(function () {
+        triggerBroadcast('afterRender', viewInfo.view, viewInfo.selector);
+      });
+
+      return promise;
     },
 
     establishError: function(resp){

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/core/tests/layoutSpec.js
----------------------------------------------------------------------
diff --git a/app/core/tests/layoutSpec.js b/app/core/tests/layoutSpec.js
index 2b87173..1ae5675 100644
--- a/app/core/tests/layoutSpec.js
+++ b/app/core/tests/layoutSpec.js
@@ -27,24 +27,24 @@ define([
       it("Should set template without prefix", function () {
         layout.setTemplate('myTemplate');
 
-        assert.equal(layout.template, 'templates/layouts/myTemplate');
+        assert.equal(layout.layout.template, 'templates/layouts/myTemplate');
 
       });
 
       it("Should set template with prefix", function () {
         layout.setTemplate({name: 'myTemplate', prefix: 'myPrefix/'});
 
-        assert.equal(layout.template, 'myPrefix/myTemplate');
+        assert.equal(layout.layout.template, 'myPrefix/myTemplate');
       });
 
       it("Should remove old views", function () {
-        var view = new FauxtonAPI.Layout();
+        var view = new FauxtonAPI.View();
 
-        layout.setView('selector', view);
+        layout.setView('#selector', view);
 
-        var mockRemove = sinon.spy(view, 'remove');
+        var removeSpy = sinon.spy(view, 'removeView');
         layout.setTemplate('myTemplate');
-        assert.ok(mockRemove.calledOnce);
+        assert.ok(removeSpy.calledOnce);
 
       });
 
@@ -58,5 +58,72 @@ define([
       });
 
     });
+
+    describe('#setView', function () {
+      var view;
+      beforeEach(function () {
+        view = new FauxtonAPI.View();
+      });
+
+      it("Should keep record of view", function () {
+        layout.setView('.selector', view);
+        assert.equal(view, layout.layoutViews['.selector']);
+      });
+
+      it("Should not keep record of view if keep is false", function () {
+        layout.setView('.selector', view, true);
+        assert.ok(_.isUndefined(layout.layoutViews['.selector']));
+        assert.equal(view, layout.permanentViews['.selector']);
+      });
+
+    });
+
+    describe('#removeView', function () {
+      var view;
+
+      beforeEach(function () {
+        view = new FauxtonAPI.View();
+        layout.setView('#selector', view);
+      });
+
+      it('Should remove view from layout', function () {
+        var removeSpy = sinon.spy(layout.layout, 'removeView');
+
+        layout.removeView('#selector');
+        assert.ok(removeSpy.calledOnce);
+      });
+
+      it('Should remove view from list of active views', function () {
+        layout.setView('#selector', view);
+        layout.removeView('#selector');
+
+        assert.ok(_.isUndefined(layout.layoutViews['#selector']));
+      });
+
+      it("should return false if view doesn't exist", function () {
+        assert.notOk(layout.removeView('#fake'));
+      });
+
+    });
+
+    describe('#renderView', function () {
+      var view;
+
+      beforeEach(function () {
+        view = new FauxtonAPI.View();
+        layout.setView('#selector', view);
+      });
+
+      it('should render view', function () {
+        var renderSpy = sinon.spy(view, 'render');
+        layout.renderView('#selector');
+        assert.ok(renderSpy.calledOnce);
+      });
+
+      it('should not render a non-existing view', function () {
+        assert.notOk(layout.renderView('#fake'));
+      });
+
+    });
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/app/core/tests/routeObjectSpec.js
----------------------------------------------------------------------
diff --git a/app/core/tests/routeObjectSpec.js b/app/core/tests/routeObjectSpec.js
index 2fca94d..f3f4b48 100644
--- a/app/core/tests/routeObjectSpec.js
+++ b/app/core/tests/routeObjectSpec.js
@@ -71,7 +71,13 @@ define([
             viewSpy = sinon.stub(view, "establish");
         
         view.hasRendered = false;
+        view.promise = function () { 
+          var promise = $.Deferred();
+          promise.resolve();
+          return promise;
+        };
         getViewsSpy.returns({'#view': view});
+        mockLayout.renderView = function () { return view;};
 
         testRouteObject.renderWith('the-route', mockLayout, 'args');
         assert.ok(viewSpy.calledOnce, 'Should render view');

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2283352a/test/mocha/testUtils.js
----------------------------------------------------------------------
diff --git a/test/mocha/testUtils.js b/test/mocha/testUtils.js
index 2c418f9..6b9e57f 100644
--- a/test/mocha/testUtils.js
+++ b/test/mocha/testUtils.js
@@ -29,15 +29,19 @@ function(FauxtonAPI,chai, sinonChai) {
       this.$ = this.$el.find;
     },
     views: [],
-    renderView: function (view) {
+    renderView: function (view, done) {
       this.views.push(view);
       this.$el.append(view.el);
       view.render();
+      if (done) { 
+        view.promise().done(function () { done(); });
+      }
+      return view;
     },
 
     remove: function () {
       _.each(this.views, function (view) {
-        view.remove();
+        view.removeView();
       }, this);
     }
   });


[02/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Sidebar: Do not show version on a collapsed view

There is not enough space for showing the version on a collapsed
sidebar.

COUCHDB-2234


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/6e11deec
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/6e11deec
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/6e11deec

Branch: refs/heads/secondary-indexes
Commit: 6e11deecb83879af9940ed95a52b031631ebdeed
Parents: b7fc5f4
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sat Aug 9 21:27:40 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu Aug 14 21:12:18 2014 +0200

----------------------------------------------------------------------
 app/addons/fauxton/base.js                | 2 +-
 app/addons/fauxton/templates/nav_bar.html | 2 +-
 assets/less/fauxton.less                  | 7 ++++++-
 3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6e11deec/app/addons/fauxton/base.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/base.js b/app/addons/fauxton/base.js
index 00f73a7..8b88d36 100644
--- a/app/addons/fauxton/base.js
+++ b/app/addons/fauxton/base.js
@@ -237,7 +237,7 @@ function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
     },
 
     beforeRender: function () {
-      this.insertView(".version", this.versionFooter);
+      this.insertView(".js-version", this.versionFooter);
       this.addLinkViews();
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6e11deec/app/addons/fauxton/templates/nav_bar.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/nav_bar.html b/app/addons/fauxton/templates/nav_bar.html
index f33399d..93c45df 100644
--- a/app/addons/fauxton/templates/nav_bar.html
+++ b/app/addons/fauxton/templates/nav_bar.html
@@ -70,5 +70,5 @@ the License.
       <% }); %>
     </ul>
   </div>
-  <div class="version"></div>
+  <div class="js-version"></div>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6e11deec/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 10b1e78..88d2293 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -344,11 +344,16 @@ table.databases {
   bottom: 0;
   background-color: @primaryNav;
   overflow-y: scroll;
-  .version {
+  .js-version {
     color: #fff;
     font-size: 10px;
     padding-left: 10px;
   }
+  .closeMenu & {
+    .js-version {
+      display: none;
+    }
+  }
   #footer-links{
     position: absolute;
     bottom: 0;


[36/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Design doc selector fix
pagination fix


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/566ac349
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/566ac349
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/566ac349

Branch: refs/heads/secondary-indexes
Commit: 566ac349d8e57767c88df69755c0aef6cf0b0348
Parents: 45f082a
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 app/addons/fauxton/components.js                |  1 +
 app/addons/fauxton/templates/pagination.html    | 29 ++++++++++----------
 .../indexes/templates/design_doc_selector.html  | 16 +++++------
 app/addons/indexes/templates/show_editor.html   |  2 +-
 app/addons/indexes/templates/view_editor.html   |  2 +-
 app/addons/indexes/views.js                     |  3 ++
 6 files changed, 27 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/566ac349/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index d225cd9..28a9070 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -154,6 +154,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
 
 
   Components.Pagination = FauxtonAPI.View.extend({
+    tagName: "ul",
     className: "pagination pagination-centered",
     template: "addons/fauxton/templates/pagination",
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/566ac349/app/addons/fauxton/templates/pagination.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/pagination.html b/app/addons/fauxton/templates/pagination.html
index 614fd06..3958f63 100644
--- a/app/addons/fauxton/templates/pagination.html
+++ b/app/addons/fauxton/templates/pagination.html
@@ -11,18 +11,17 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-  <ul>
-    <% if (page > 1) { %>
-    <li> <a href="<%- urlFun(page-1) %>">&laquo;</a></li>
-    <% } else { %>
-      <li class="disabled"> <a href="<%- urlFun(page) %>">&laquo;</a></li>
-    <% } %>
-    <% _.each(_.range(1, totalPages+1), function(i) { %>
-      <li <% if (page == i) { %>class="active"<% } %>> <a href="<%- urlFun(i) %>"><%- i %></a></li>
-    <% }) %>
-    <% if (page < totalPages) { %>
-      <li><a href="<%- urlFun(page+1) %>">&raquo;</a></li>
-    <% } else { %>
-      <li class="disabled"> <a href="<%- urlFun(page) %>">&raquo;</a></li>
-    <% } %>
-  </ul>
+<% if (page > 1) { %>
+<li> <a href="<%- urlFun(page-1) %>">&laquo;</a></li>
+<% } else { %>
+  <li class="disabled"> <a href="<%- urlFun(page) %>">&laquo;</a></li>
+<% } %>
+<% _.each(_.range(1, totalPages+1), function(i) { %>
+  <li <% if (page == i) { %>class="active"<% } %>> <a href="<%- urlFun(i) %>"><%- i %></a></li>
+<% }) %>
+<% if (page < totalPages) { %>
+  <li><a href="<%- urlFun(page+1) %>">&raquo;</a></li>
+<% } else { %>
+  <li class="disabled"> <a href="<%- urlFun(page) %>">&raquo;</a></li>
+<% } %>
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/566ac349/app/addons/indexes/templates/design_doc_selector.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/design_doc_selector.html b/app/addons/indexes/templates/design_doc_selector.html
index 7d58116..2cad6af 100644
--- a/app/addons/indexes/templates/design_doc_selector.html
+++ b/app/addons/indexes/templates/design_doc_selector.html
@@ -16,21 +16,19 @@ the License.
   <div class="select-wrapper span5">
     <select id="ddoc">
       <optgroup label="Select a document">
-        <option value="new-doc">New document</option>
+        <option value="new-doc" <% if(newView){ %>selected="selected" <%}%> >New document</option>
 
         <% ddocs.each(function(ddoc) { %>
-        <%= ddoc.id %>
-        <%= ddocName %>
-        <% if (ddoc.id === ddocName) { %>
-        <option selected="selected" value="<%- ddoc.id %>"><%- ddoc.id %></option>
-        <% } else { %>
-        <option value="<%- ddoc.id %>"><%- ddoc.id %></option>
-        <% } %>
+          <% if (ddoc.id === ddocName && !newView) { %>
+          <option selected="selected" value="<%- ddoc.id %>"><%- ddoc.id %></option>
+          <% } else { %>
+          <option value="<%- ddoc.id %>"><%- ddoc.id %></option>
+          <% } %>
         <% }); %>
       </optgroup>
     </select>
     <i></i>
   </div>
 
-  <input type="text" id="new-ddoc" class="span7" style="display:none" placeholder="Enter a design doc name" />
+  <input type="text" id="new-ddoc" class="span7" <% if(!newView){ %> style="display:none"<% } %> placeholder="Enter a design doc name" />
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/566ac349/app/addons/indexes/templates/show_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/show_editor.html b/app/addons/indexes/templates/show_editor.html
index 9afa2bf..ef36110 100644
--- a/app/addons/indexes/templates/show_editor.html
+++ b/app/addons/indexes/templates/show_editor.html
@@ -17,7 +17,7 @@ the License.
   <div class="errors-container"></div>
   <form class="form-horizontal view-query-save">
     <div class="control-group">
-      <p>Views are the primary tool used for querying and reporting on CouchDB databases.</p>
+      <p>Views are the primary tool used for querying and reporting.</p>
     </div>
 
     <div class="control-group design-doc-group">

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/566ac349/app/addons/indexes/templates/view_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/view_editor.html b/app/addons/indexes/templates/view_editor.html
index f33d3f9..2b8c540 100644
--- a/app/addons/indexes/templates/view_editor.html
+++ b/app/addons/indexes/templates/view_editor.html
@@ -16,7 +16,7 @@ the License.
   <div class="errors-container"></div>
   <form class="form-horizontal view-query-save">
     <div class="control-group">
-      <p>Views are the primary tool used for querying and reporting on CouchDB databases.</p>
+      <p>Views are the primary tool used for querying and reporting.</p>
     </div>
 
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/566ac349/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
index fa84708..51f37fa 100644
--- a/app/addons/indexes/views.js
+++ b/app/addons/indexes/views.js
@@ -580,6 +580,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
       this.designDocSelector = this.setView('.design-doc-group', new Views.DesignDocSelector({
         collection: designDocs,
+        newView: this.newView,
         ddocName: this.currentDdoc || this.model.id,
         database: this.database
       }));
@@ -646,6 +647,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     },
 
     initialize: function (options) {
+      this.newView = options.newView;
       this.ddocName = options.ddocName;
       this.database = options.database;
       this.listenTo(this.collection, 'add', this.ddocAdded);
@@ -659,6 +661,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
     serialize: function () {
       return {
+        newView: this.newView,
         ddocName: this.ddocName,
         ddocs: this.collection
       };


[06/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Refactored Layout and View, upgraded to latest LM

The Layout object was a simple wrapper over the Layout constructor
instead of extending the constructor itself.  I've patched this to make
it more consistent and removed duplicative methods.  I've also removed
the tests for `removeView` since that is now a built-in method.

The latest LM contains bugfixes and render performance updates that
unforuntately have to be opt-out.  Areas in the source or tests that are
expecting synchronous renders must be patched to work asynchronously to
take advantage.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/07cce5a6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/07cce5a6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/07cce5a6

Branch: refs/heads/secondary-indexes
Commit: 07cce5a61d281b61ebcf3fa9ee77a72d7ca52247
Parents: a57188c
Author: Tim Branyen <ti...@tabdeveloper.com>
Authored: Fri Aug 1 10:18:13 2014 -0400
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Aug 18 11:30:50 2014 +0200

----------------------------------------------------------------------
 app/core/base.js                            |   4 +
 app/core/layout.js                          |  77 ++------
 app/core/tests/layoutSpec.js                |  38 +---
 assets/js/plugins/backbone.layoutmanager.js | 240 ++++++++++++++++++-----
 4 files changed, 217 insertions(+), 142 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/07cce5a6/app/core/base.js
----------------------------------------------------------------------
diff --git a/app/core/base.js b/app/core/base.js
index 15499b3..9fbb7a0 100644
--- a/app/core/base.js
+++ b/app/core/base.js
@@ -62,6 +62,10 @@ function(Backbone, LayoutManager) {
     manage: true,
     disableLoader: false,
 
+    // Either tests or source are expecting synchronous renders, so disable
+    // asynchronous rendering improvements.
+    useRAF: false,
+
     forceRender: function () {
       this.hasRendered = false;
     }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/07cce5a6/app/core/layout.js
----------------------------------------------------------------------
diff --git a/app/core/layout.js b/app/core/layout.js
index ff339c7..0a45e62 100644
--- a/app/core/layout.js
+++ b/app/core/layout.js
@@ -10,82 +10,31 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  "backbone", 
-  "plugins/backbone.layoutmanager"
-], function(Backbone) {
+define(function(require, exports, module) {
+  var Backbone = require("backbone");
+  var LayoutManager = require("plugins/backbone.layoutmanager");
 
-  // A wrapper of the main Backbone.layoutmanager
-  // Allows the main layout of the page to be changed by any plugin.
-  var Layout = function () {
-    this.layout = new Backbone.Layout({
-      template: "templates/layouts/with_sidebar",
-    });
+  var Layout = Backbone.Layout.extend({
+    template: "templates/layouts/with_sidebar",
 
-    this.layoutViews = {};
-    this.el = this.layout.el;
-  };
-
-  Layout.configure = function (options) {
-    Backbone.Layout.configure(options);
-  };
-
-  // creatings the dashboard object same way backbone does
-  _.extend(Layout.prototype, {
-    render: function () {
-      return this.layout.render();
-    },
+    // Either tests or source are expecting synchronous renders, so disable
+    // asynchronous rendering improvements.
+    useRAF: false,
 
     setTemplate: function(template) {
       if (template.prefix){
-        this.layout.template = template.prefix + template.name;
+        this.template = template.prefix + template.name;
       } else{
-        this.layout.template = "templates/layouts/" + template;
+        this.template = "templates/layouts/" + template;
       }
+
       // If we're changing layouts all bets are off, so kill off all the
       // existing views in the layout.
-      _.each(this.layoutViews, function(view){view.remove();});
-      this.layoutViews = {};
+      this.removeView();
       this.render();
-    },
-
-    setView: function(selector, view, keep) {
-      this.layout.setView(selector, view, false);
-
-      if (!keep) {
-        this.layoutViews[selector] = view;
-      }
-
-      return view;
-    },
-
-    renderView: function(selector) {
-      var view = this.layoutViews[selector];
-      if (!view) {
-        return false;
-      } else {
-        return view.render();
-      }
-    },
-
-    removeView: function (selector) {
-      var view = this.layout.getView(selector);
-
-      if (!view) {
-        return false;
-      }
-
-      view.remove();
-      
-      if (this.layoutViews[selector]) {
-        delete this.layoutViews[selector];
-      }
-
-      return true;
     }
-
   });
 
-  return Layout;
+  module.exports = Layout;
 
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/07cce5a6/app/core/tests/layoutSpec.js
----------------------------------------------------------------------
diff --git a/app/core/tests/layoutSpec.js b/app/core/tests/layoutSpec.js
index 40b1947..2b87173 100644
--- a/app/core/tests/layoutSpec.js
+++ b/app/core/tests/layoutSpec.js
@@ -27,24 +27,20 @@ define([
       it("Should set template without prefix", function () {
         layout.setTemplate('myTemplate');
 
-        assert.equal(layout.layout.template, 'templates/layouts/myTemplate');
+        assert.equal(layout.template, 'templates/layouts/myTemplate');
 
       });
 
       it("Should set template with prefix", function () {
         layout.setTemplate({name: 'myTemplate', prefix: 'myPrefix/'});
 
-        assert.equal(layout.layout.template, 'myPrefix/myTemplate');
+        assert.equal(layout.template, 'myPrefix/myTemplate');
       });
 
       it("Should remove old views", function () {
-        var view = {
-          remove: function () {}
-        };
+        var view = new FauxtonAPI.Layout();
 
-        layout.layoutViews = {
-          'selector': view
-        };
+        layout.setView('selector', view);
 
         var mockRemove = sinon.spy(view, 'remove');
         layout.setTemplate('myTemplate');
@@ -62,31 +58,5 @@ define([
       });
 
     });
-
-    describe('#renderView', function () {
-
-      it('Should render existing view', function () {
-        var view = new Backbone.View();
-        var mockRender = sinon.spy(view, 'render');
-        layout.layoutViews = {
-          '#selector': view
-        };
-
-        var out = layout.renderView('#selector');
-
-        assert.ok(mockRender.calledOnce);
-      });
-
-      it('Should return false for non-existing view', function () {
-        var view = new Backbone.View();
-        layout.layoutViews = {
-          'selector': view
-        };
-
-        var out = layout.renderView('wrongSelector');
-        assert.notOk(out, 'No view found');
-      });
-    });
-
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/07cce5a6/assets/js/plugins/backbone.layoutmanager.js
----------------------------------------------------------------------
diff --git a/assets/js/plugins/backbone.layoutmanager.js b/assets/js/plugins/backbone.layoutmanager.js
index c5d4a80..e20bf5a 100644
--- a/assets/js/plugins/backbone.layoutmanager.js
+++ b/assets/js/plugins/backbone.layoutmanager.js
@@ -1,22 +1,35 @@
 /*!
- * backbone.layoutmanager.js v0.9.4
+ * backbone.layoutmanager.js v0.9.5
  * Copyright 2013, Tim Branyen (@tbranyen)
  * backbone.layoutmanager.js may be freely distributed under the MIT license.
  */
 (function(window, factory) {
   "use strict";
-  var Backbone = window.Backbone;
 
   // AMD. Register as an anonymous module.  Wrap in function so we have access
   // to root via `this`.
   if (typeof define === "function" && define.amd) {
-    return define(["backbone", "underscore", "jquery"], function() {
+    define(["backbone", "underscore", "jquery"], function() {
       return factory.apply(window, arguments);
     });
   }
 
+  // Node. Does not work with strict CommonJS, but only CommonJS-like
+  // environments that support module.exports, like Node.
+  else if (typeof exports === "object") {
+    var Backbone = require("backbone");
+    var _ = require("underscore");
+    // In a browserify build, since this is the entry point, Backbone.$
+    // is not bound. Ensure that it is.
+    Backbone.$ = Backbone.$ || require("jquery");
+
+    module.exports = factory.call(window, Backbone, _, Backbone.$);
+  }
+
   // Browser globals.
-  Backbone.Layout = factory.call(window, Backbone, window._, Backbone.$);
+  else {
+    factory.call(window, window.Backbone, window._, window.Backbone.$);
+  }
 }(typeof global === "object" ? global : this, function (Backbone, _, $) {
 "use strict";
 
@@ -236,20 +249,33 @@ var LayoutManager = Backbone.View.extend({
     return this.__manager__.renderDeferred.promise();
   },
 
+  // Proxy `then` for easier invocation.
+  then: function() {
+    return this.promise().then.apply(this, arguments);
+  },
+
   // Sometimes it's desirable to only render the child views under the parent.
   // This is typical for a layout that does not change.  This method will
-  // iterate over the child Views and aggregate all child render promises and
-  // return the parent View.  The internal `promise()` method will return the
-  // aggregate promise that resolves once all children have completed their
-  // render.
-  renderViews: function() {
+  // iterate over the provided views or delegate to `getViews` to fetch child
+  // Views and aggregate all render promises and return the parent View.
+  // The internal `promise()` method will return the aggregate promise that
+  // resolves once all children have completed their render.
+  renderViews: function(views) {
     var root = this;
     var manager = root.__manager__;
     var newDeferred = root.deferred();
 
+    // If the caller provided an array of views then render those, otherwise
+    // delegate to getViews.
+    if (views && _.isArray(views)) {
+      views = _.chain(views);
+    } else {
+      views = root.getViews(views);
+    }
+
     // Collect all promises from rendering the child views and wait till they
     // all complete.
-    var promises = root.getViews().map(function(view) {
+    var promises = views.map(function(view) {
       return view.render().__manager__.renderDeferred;
     }).value();
 
@@ -392,16 +418,12 @@ var LayoutManager = Backbone.View.extend({
     // Code path is less complex for Views that are not being inserted.  Simply
     // remove existing Views and bail out with the assignment.
     if (!insert) {
-      // If the View we are adding has already been rendered, simply inject it
-      // into the parent.
-      if (view.hasRendered) {
-        // Apply the partial.
-        view.partial(root.$el, view.$el, root.__manager__, manager);
+      // Ensure remove is called only when swapping in a new view (when the
+      // view is the same, it does not need to be removed or cleaned up).
+      if (root.getView(name) !== view) {
+        root.removeView(name);
       }
 
-      // Ensure remove is called when swapping View's.
-      root.removeView(name);
-
       // Assign to main views object and return for chainability.
       return root.views[selector] = view;
     }
@@ -450,7 +472,6 @@ var LayoutManager = Backbone.View.extend({
 
     // Triggered once the render has succeeded.
     function resolve() {
-      var next;
 
       // Insert all subViews into the parent at once.
       _.each(root.views, function(views, selector) {
@@ -465,8 +486,7 @@ var LayoutManager = Backbone.View.extend({
       if (parent && !manager.insertedViaFragment) {
         if (!root.contains(parent.el, root.el)) {
           // Apply the partial using parent's html() method.
-          parent.partial(parent.$el, root.$el, rentManager,
-            manager);
+          parent.partial(parent.$el, root.$el, rentManager, manager);
         }
       }
 
@@ -475,21 +495,24 @@ var LayoutManager = Backbone.View.extend({
 
       // Set this View as successfully rendered.
       root.hasRendered = true;
+      manager.renderInProgress = false;
+
+      // Clear triggeredByRAF flag.
+      delete manager.triggeredByRAF;
 
       // Only process the queue if it exists.
-      if (next = manager.queue.shift()) {
+      if (manager.queue && manager.queue.length) {
         // Ensure that the next render is only called after all other
         // `done` handlers have completed.  This will prevent `render`
         // callbacks from firing out of order.
-        next();
+        (manager.queue.shift())();
       } else {
         // Once the queue is depleted, remove it, the render process has
         // completed.
         delete manager.queue;
       }
 
-      // Reusable function for triggering the afterRender callback and event
-      // and setting the hasRendered flag.
+      // Reusable function for triggering the afterRender callback and event.
       function completeRender() {
         var console = window.console;
         var afterRender = root.afterRender;
@@ -520,10 +543,10 @@ var LayoutManager = Backbone.View.extend({
 
       // If the parent is currently rendering, wait until it has completed
       // until calling the nested View's `afterRender`.
-      if (rentManager && rentManager.queue) {
+      if (rentManager && (rentManager.renderInProgress || rentManager.queue)) {
         // Wait until the parent View has finished rendering, which could be
         // asynchronous, and trigger afterRender on this View once it has
-        // compeleted.
+        // completed.
         parent.once("afterRender", completeRender);
       } else {
         // This View and its parent have both rendered.
@@ -574,23 +597,21 @@ var LayoutManager = Backbone.View.extend({
       });
     }
 
-    // Another render is currently happening if there is an existing queue, so
-    // push a closure to render later into the queue.
-    if (manager.queue) {
-      aPush.call(manager.queue, actuallyRender);
-    } else {
-      manager.queue = [];
+    // Mark this render as in progress. This will prevent
+    // afterRender from being fired until the entire chain has rendered.
+    manager.renderInProgress = true;
 
-      // This the first `render`, preceeding the `queue` so render
-      // immediately.
-      actuallyRender(root, def);
-    }
+    // Start the render.
+    // Register this request & cancel any that conflict.
+    root._registerWithRAF(actuallyRender, def);
 
     // Put the deferred inside of the `__manager__` object, since we don't want
     // end users accessing this directly anymore in favor of the `afterRender`
     // event.  So instead of doing `render().then(...` do
     // `render().once("afterRender", ...`.
-    root.__manager__.renderDeferred = def;
+    // FIXME: I think we need to move back to promises so that we don't
+    // miss events, regardless of sync/async (useRAF setting)
+    manager.renderDeferred = def;
 
     // Return the actual View for chainability purposes.
     return root;
@@ -603,6 +624,75 @@ var LayoutManager = Backbone.View.extend({
 
     // Call the original remove function.
     return this._remove.apply(this, arguments);
+  },
+
+  // Register a view render with RAF.
+  _registerWithRAF: function(callback, deferred) {
+    var root = this;
+    var manager = root.__manager__;
+    var rentManager = manager.parent && manager.parent.__manager__;
+
+    // Allow RAF processing to be shut off using `useRAF`:false.
+    if (this.useRAF === false) {
+      if (manager.queue) {
+        aPush.call(manager.queue, callback);
+      } else {
+        manager.queue = [];
+        callback();
+      }
+      return;
+    }
+
+    // Keep track of all deferreds so we can resolve them.
+    manager.deferreds = manager.deferreds || [];
+    manager.deferreds.push(deferred);
+
+    // Schedule resolving all deferreds that are waiting.
+    deferred.done(resolveDeferreds);
+
+    // Cancel any other renders on this view that are queued to execute.
+    this._cancelQueuedRAFRender();
+
+    // Trigger immediately if the parent was triggered by RAF.
+    // The flag propagates downward so this view's children are also
+    // rendered immediately.
+    if (rentManager && rentManager.triggeredByRAF) {
+      return finish();
+    }
+
+    // Register this request with requestAnimationFrame.
+    manager.rafID = root.requestAnimationFrame(finish);
+
+    function finish() {
+      // Remove this ID as it is no longer valid.
+      manager.rafID = null;
+
+      // Set flag (will propagate to children) so they render
+      // without waiting for RAF.
+      manager.triggeredByRAF = true;
+
+      // Call original cb.
+      callback();
+    }
+
+    // Resolve all deferreds that were cancelled previously, if any.
+    // This allows the user to bind callbacks to any render callback,
+    // even if it was cancelled above.
+    function resolveDeferreds() {
+      for (var i = 0; i < manager.deferreds.length; i++){
+        manager.deferreds[i].resolveWith(root, [root]);
+      }
+      manager.deferreds = [];
+    }
+  },
+
+  // Cancel any queued render requests.
+  _cancelQueuedRAFRender: function() {
+    var root = this;
+    var manager = root.__manager__;
+    if (manager.rafID != null) {
+      root.cancelAnimationFrame(manager.rafID);
+    }
   }
 },
 
@@ -652,6 +742,9 @@ var LayoutManager = Backbone.View.extend({
       // Remove the View completely.
       view.$el.remove();
 
+      // Cancel any pending renders, if present.
+      view._cancelQueuedRAFRender();
+
       // Bail out early if no parent exists.
       if (!manager.parent) { return; }
 
@@ -735,12 +828,18 @@ var LayoutManager = Backbone.View.extend({
     if (options.suppressWarnings === true) {
       Backbone.View.prototype.suppressWarnings = true;
     }
+
+    // Allow global configuration of `useRAF`.
+    if (options.useRAF === false) {
+      Backbone.View.prototype.useRAF = false;
+    }
   },
 
   // Configure a View to work with the LayoutManager plugin.
   setupView: function(views, options) {
-    // Don't break the options object (passed into Backbone.View#initialize).
-    options = options || {};
+    // Ensure that options is always an object, and clone it so that
+    // changes to the original object don't screw up this view.
+    options = _.extend({}, options);
 
     // Set up all Views passed.
     _.each(aConcat.call([], views), function(view) {
@@ -819,14 +918,14 @@ var LayoutManager = Backbone.View.extend({
   }
 });
 
-LayoutManager.VERSION = "0.9.4";
+LayoutManager.VERSION = "0.9.5";
 
 // Expose through Backbone object.
 Backbone.Layout = LayoutManager;
 
 // Override _configure to provide extra functionality that is necessary in
 // order for the render function reference to be bound during initialize.
-Backbone.View = function(options) {
+Backbone.View.prototype.constructor = function(options) {
   var noel;
 
   // Ensure options is always an object.
@@ -854,6 +953,8 @@ Backbone.View = function(options) {
   ViewConstructor.apply(this, arguments);
 };
 
+Backbone.View = Backbone.View.prototype.constructor;
+
 // Copy over the extend method.
 Backbone.View.extend = ViewConstructor.extend;
 
@@ -865,6 +966,10 @@ var defaultOptions = {
   // Prefix template/layout paths.
   prefix: "",
 
+  // Use requestAnimationFrame to queue up view rendering and cancel
+  // repeat requests. Leave on for better performance.
+  useRAF: true,
+
   // Can be used to supply a different deferred implementation.
   deferred: function() {
     return $.Deferred();
@@ -878,7 +983,7 @@ var defaultOptions = {
 
   // By default, render using underscore's templating and trim output.
   renderTemplate: function(template, context) {
-    return trim(template(context));
+    return trim(template.call(this, context));
   },
 
   // By default, pass model attributes to the templates
@@ -964,7 +1069,54 @@ var defaultOptions = {
   // A method to determine if a View contains another.
   contains: function(parent, child) {
     return $.contains(parent, child);
-  }
+  },
+
+  // Based on:
+  // http://paulirish.com/2011/requestanimationframe-for-smart-animating/
+  // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and
+  // Tino Zijdel.
+  requestAnimationFrame: (function() {
+    var lastTime = 0;
+    var vendors = ["ms", "moz", "webkit", "o"];
+    var requestAnimationFrame = window.requestAnimationFrame;
+
+    for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
+      requestAnimationFrame = window[vendors[i] + "RequestAnimationFrame"];
+    }
+
+    if (!requestAnimationFrame){
+      requestAnimationFrame = function(callback) {
+        var currTime = new Date().getTime();
+        var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+        var id = window.setTimeout(function() {
+          callback(currTime + timeToCall);
+        }, timeToCall);
+        lastTime = currTime + timeToCall;
+        return id;
+      };
+    }
+
+    return _.bind(requestAnimationFrame, window);
+  })(),
+
+  cancelAnimationFrame: (function() {
+    var vendors = ["ms", "moz", "webkit", "o"];
+    var cancelAnimationFrame = window.cancelAnimationFrame;
+
+    for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
+      cancelAnimationFrame =
+        window[vendors[i] + "CancelAnimationFrame"] ||
+        window[vendors[i] + "CancelRequestAnimationFrame"];
+    }
+
+    if (!cancelAnimationFrame) {
+      cancelAnimationFrame = function(id) {
+        clearTimeout(id);
+      };
+    }
+
+    return _.bind(cancelAnimationFrame, window);
+  })()
 };
 
 // Extend LayoutManager with default options.


[04/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
make CI build faster

Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/a57188ce
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/a57188ce
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/a57188ce

Branch: refs/heads/secondary-indexes
Commit: a57188cea8cada14106b787eb45908063f93f4b6
Parents: 580ea7b
Author: Peter Dave Hello <hs...@peterdavehello.org>
Authored: Sun Aug 17 00:38:25 2014 +0800
Committer: Peter Dave Hello <hs...@peterdavehello.org>
Committed: Sun Aug 17 00:38:25 2014 +0800

----------------------------------------------------------------------
 .travis.yml | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a57188ce/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 6e5919d..2fba053 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,5 @@
 language: node_js
 node_js:
   - "0.10"
+git:
+  depth: 10


[33/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
adding back some route events


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/d8274411
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/d8274411
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/d8274411

Branch: refs/heads/secondary-indexes
Commit: d8274411fba88236a65037018ae2a10bff124623
Parents: 5187861
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/routes.js    | 15 +++++++++++----
 app/addons/indexes/routes-core.js | 35 +++++++++++++++++++++++++++++++++-
 app/addons/indexes/views.js       | 17 ++++++-----------
 assets/less/templates.less        |  2 +-
 4 files changed, 52 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d8274411/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index 994ca5c..324a9ea 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -265,7 +265,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
 
     resetAllDocsHeader: function(){
       if (this.changesHeader){
-        this.headerRight = this.setView("#api-navbar", new Documents.Views.RightAllDocsHeader({
+        this.rightHeader = this.setView("#api-navbar", new Documents.Views.RightAllDocsHeader({
           database: this.data.database
         }));
         this.changesHeader = false;
@@ -290,7 +290,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       /* --------------------------------------------------
         Update the apiUrl
       ----------------------------------------------------*/
-      this.headerRight.updateApiUrl([designDocInfo.url('apiurl'), designDocInfo.documentation()]);
+      this.rightHeader.updateApiUrl([designDocInfo.url('apiurl'), designDocInfo.documentation()]);
 
     },
 
@@ -365,7 +365,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       /* --------------------------------------------------
         update the api url
       ----------------------------------------------------*/
-      this.headerRight.updateApiUrl([this.data.database.allDocs.urlRef("apiurl", urlParams), this.data.database.allDocs.documentation()]);
+      this.rightHeader.updateApiUrl([this.data.database.allDocs.urlRef("apiurl", urlParams), this.data.database.allDocs.documentation()]);
     },
 
 
@@ -415,9 +415,12 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       this.leftheader.forceRender();
       this.documentsView.forceRender();
 
-      this.headerRight.updateApiUrl([collection.urlRef("apiurl", urlParams), "docs"]);
+      this.rightHeader.updateApiUrl([collection.urlRef("apiurl", urlParams), "docs"]);
     },
 
+    /* --------------------------------------------------
+      Called when you change the # of items to show in the pagination footer
+    ----------------------------------------------------*/
     perPageChange: function (perPage) {
       // We need to restore the collection parameters to the defaults (1st page)
       // and update the page size
@@ -428,6 +431,10 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       this.setDocPerPageLimit(perPage);
     },
 
+    /* --------------------------------------------------
+      Triggers when you hit the paginate forward and backwards buttons
+    ----------------------------------------------------*/
+
     paginate: function (options) {
       var collection = this.documentsView.collection;
       this.leftheader.forceRender();

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d8274411/app/addons/indexes/routes-core.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-core.js b/app/addons/indexes/routes-core.js
index ae21e03..a341d41 100644
--- a/app/addons/indexes/routes-core.js
+++ b/app/addons/indexes/routes-core.js
@@ -47,7 +47,8 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
     events: {
       "route:updatePreviewDocs": "updateAllDocsFromPreview",
       "route:perPageChange": "perPageChange",
-      "route:paginate": "paginate"
+      "route:paginate": "paginate",
+      "route:updateAllDocs": "updateAllDocsFromView"
     },
 
     /* --------------------------------------------------
@@ -136,6 +137,38 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
 
 
     /* --------------------------------------------------
+        Reload preview docs
+    -----------------------------------------------------*/
+    updateAllDocsFromView: function (event) {
+      var view = event.view,
+          params = this.createParams(),
+          urlParams = params.urlParams,
+          docParams = params.docParams,
+          ddoc = event.ddoc,
+          pageSize,
+          collection;
+
+      var defaultPageSize = _.isUndefined(this.documentsView) ? 20 : this.documentsView.perPage();
+      docParams.limit = pageSize = this.getDocPerPageLimit(urlParams, defaultPageSize);
+
+      if (event.allDocs) {
+        this.eventAllDocs = true; // this is horrible. But I cannot get the trigger not to fire the route!
+        this.data.database.buildAllDocs(docParams);
+        collection = this.data.database.allDocs;
+        collection.paging.pageSize = pageSize;
+
+      }
+
+      this.documentsView.setCollection(collection);
+      this.documentsView.setParams(docParams, urlParams);
+
+      this.leftheader.forceRender();
+      this.documentsView.forceRender();
+
+      this.rightHeader.updateApiUrl([collection.urlRef("apiurl", urlParams), "docs"]);
+    },
+
+    /* --------------------------------------------------
       Docs that are returned from a view
     ----------------------------------------------------*/
     createViewDocumentsView: function (options) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d8274411/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
index 51f37fa..421495f 100644
--- a/app/addons/indexes/views.js
+++ b/app/addons/indexes/views.js
@@ -88,14 +88,12 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
            return FauxtonAPI.addNotification({
              msg: "JSON Parse Error on field: "+param.name,
              type: "error",
-             selector: ".advanced-options .errors-container",
              clear: true
            });
          });
          FauxtonAPI.addNotification({
            msg: "Make sure that strings are properly quoted and any other values are valid JSON structures",
            type: "warning",
-           selector: ".advanced-options .errors-container",
            clear: true
          });
 
@@ -131,7 +129,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       FauxtonAPI.addNotification({
         msg: "<strong>Warning!</strong> Preview executes the Map/Reduce functions in your browser, and may behave differently from CouchDB.",
         type: "warning",
-        selector: ".advanced-options .errors-container",
         fade: true,
         escape: false // beware of possible XSS when the message changes
       });
@@ -310,7 +307,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       this.showIndex = false;
       _.bindAll(this);
 
-      FauxtonAPI.Events.on('index:delete', this.deleteView);
+      FauxtonAPI.Events.on('index:delete', this.deleteEvent);
     },
 
     establish: function () {
@@ -343,11 +340,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       }
     },
 
+    deleteEvent: function(){
+      this.deleteView();
+    },
+
     deleteView: function (event) {
       event && event.preventDefault();
 
       if (this.newView) { return alert('Cannot delete a new view.'); }
-      if (!confirm('Are you sure you want to delete this view?')) {return;}
+      if (!confirm('Are you sure you want to delete this view?')) { return; }
 
       var that = this,
           promise,
@@ -394,7 +395,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
         notification = FauxtonAPI.addNotification({
           msg: "Saving document.",
-          selector: "#define-view .errors-container",
           clear: true
         });
 
@@ -419,7 +419,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
         notification = FauxtonAPI.addNotification({
           msg: errormessage,
           type: "error",
-          selector: "#define-view .errors-container",
           clear: true
         });
       }
@@ -439,7 +438,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       FauxtonAPI.addNotification({
         msg: "View has been saved.",
         type: "success",
-        selector: "#define-view .errors-container",
         clear: true
       });
 
@@ -455,9 +453,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
         this.ddocInfo = ddoc;
         this.showIndex = true;
         this.render();
-        FauxtonAPI.triggerRouteEvent('reloadDesignDocs', {
-          selectedTab: app.utils.removeSpecialCharacters(ddocName.replace(/_design\//,'')) + '_' + app.utils.removeSpecialCharacters(viewName)
-        });
       }
 
       // TODO:// this should change to a trigger because we shouldn't define advanced options in this view

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d8274411/assets/less/templates.less
----------------------------------------------------------------------
diff --git a/assets/less/templates.less b/assets/less/templates.less
index 3ab7d19..abf1c4b 100644
--- a/assets/less/templates.less
+++ b/assets/less/templates.less
@@ -482,7 +482,7 @@
 #right-content{
   .two-pane &{
     .view {
-      padding: 0 20px;
+      padding: 0 20px 40px;
     }
     border-left: 1px solid #999;
     .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));


[31/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Changes header, updating the view headers and adding the link icons


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/a80d189d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/a80d189d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/a80d189d

Branch: refs/heads/secondary-indexes
Commit: a80d189d4fb363877e72ac68a8fbdd7d9d12a671
Parents: cf8cf40
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:35 2014 -0400

----------------------------------------------------------------------
 .../documents/templates/header_changes.html     | 20 ++++++++++++++++++++
 app/addons/documents/views-changes.js           |  3 ++-
 app/addons/fauxton/templates/api_bar.html       |  2 +-
 app/addons/indexes/templates/header_right.html  | 15 ++++++++++-----
 app/addons/indexes/views.js                     |  2 +-
 5 files changed, 34 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a80d189d/app/addons/documents/templates/header_changes.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_changes.html b/app/addons/documents/templates/header_changes.html
new file mode 100644
index 0000000..8521486
--- /dev/null
+++ b/app/addons/documents/templates/header_changes.html
@@ -0,0 +1,20 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+  <!-- floats right -->
+
+  <div id="header-api-bar" class="button"></div>
+
+  <!-- search (jump to doc)-->
+  <div id="header-search" class="js-search searchbox-container"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a80d189d/app/addons/documents/views-changes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-changes.js b/app/addons/documents/views-changes.js
index d63a825..f5cb75e 100644
--- a/app/addons/documents/views-changes.js
+++ b/app/addons/documents/views-changes.js
@@ -27,7 +27,8 @@ function(app, FauxtonAPI, resizeColumns, Components, prettify, ZeroClipboard) {
   var Views = {};
 
   Views.ChangesHeader = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/header_alldocs",
+    className: "header-right",
+    template: "addons/documents/templates/header_changes",
     initialize: function (options) {
       this.filterView = options.filterView;
       this.endpoint = options.endpoint;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a80d189d/app/addons/fauxton/templates/api_bar.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/api_bar.html b/app/addons/fauxton/templates/api_bar.html
index bab431b..255087d 100644
--- a/app/addons/fauxton/templates/api_bar.html
+++ b/app/addons/fauxton/templates/api_bar.html
@@ -13,7 +13,7 @@ the License.
 -->
 
 <a class="btn btn-primary pull-right api-url-btn">
-  <i class="fonticon-plus icon"></i>
+  <i class="fonticon-link icon"></i>
   API URL
 </a>
 <div class="clearfix"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a80d189d/app/addons/indexes/templates/header_right.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/header_right.html b/app/addons/indexes/templates/header_right.html
index 38634b5..0370e51 100644
--- a/app/addons/indexes/templates/header_right.html
+++ b/app/addons/indexes/templates/header_right.html
@@ -12,11 +12,16 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
   <!-- Select toggle-->
-  <div id="header-select-all">
+  <div id="header-api-bar" class="button"></div>
+
+  <!-- Query Options-->
+  <div class="button header-query-options">
+    <!-- Insert the query options here :) -->
+    <div id="query-options"></div>
+  </div>
+
+
+  <div id="header-select-all" class="button">
     <span class="toggle-select-menu icon fonticon-ok-circled">Select</span>
   </div>
-  <!-- Query Options-->
-  <div id="header-query-options"></div>
-  <!--right margin for api bar-->
-  <div id="header-api-bar"></div>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a80d189d/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
index 9d0546e..6340251 100644
--- a/app/addons/indexes/views.js
+++ b/app/addons/indexes/views.js
@@ -61,7 +61,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
         documentation: this.documentation
       }));
 
-      this.advancedOptions = this.insertView('#header-query-options', new QueryOptions.AdvancedOptions({
+      this.advancedOptions = this.insertView('#query-options', new QueryOptions.AdvancedOptions({
         database: this.database,
         viewName: this.viewName,
         ddocName: this.model.id,


[20/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
move old alldocs stuff to advancedopts


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/5b674dd2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/5b674dd2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/5b674dd2

Branch: refs/heads/secondary-indexes
Commit: 5b674dd242c76ceedd7d2554386261c085cb3aff
Parents: a6d6ff8
Author: Jenn Schiffer <je...@pancaketheorem.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:35:09 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/routes.js             |  2 +-
 app/addons/documents/views-advancedopts.js | 12 ++++++--
 app/addons/documents/views.js              | 39 -------------------------
 3 files changed, 11 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5b674dd2/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index f06a307..8a43528 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -247,7 +247,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
 
       this.data.database.allDocs.paging.pageSize = this.getDocPerPageLimit(urlParams, parseInt(docParams.limit, 10));
 
-      this.viewEditor = this.setView("#dashboard-upper-content", new Documents.Views.AllDocsLayout({
+      this.viewEditor = this.setView("#dashboard-upper-content", new Documents.Views.AllDocsHeader({
         database: this.data.database,
         collection: this.data.database.allDocs,
         params: urlParams,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5b674dd2/app/addons/documents/views-advancedopts.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-advancedopts.js b/app/addons/documents/views-advancedopts.js
index b2e1af5..6cb515e 100644
--- a/app/addons/documents/views-advancedopts.js
+++ b/app/addons/documents/views-advancedopts.js
@@ -39,10 +39,11 @@ function(app, FauxtonAPI, resizeColumns ) {
       "change form.js-view-query-update input": "updateFilters",
       "change form.js-view-query-update select": "updateFilters",
       "submit form.js-view-query-update": "updateView",
-      "click .toggle-btns > label":  "toggleQuery"
+      "click .toggle-btns > label":  "toggleQueryKeys",
+      "click #toggle-query": "toggleQuery"
     },
 
-    toggleQuery: function(e){
+    toggleQueryKeys: function(e){
       e.preventDefault();
 
       if (this.$(e.currentTarget).hasClass("active")){
@@ -61,6 +62,12 @@ function(app, FauxtonAPI, resizeColumns ) {
       }
     },
 
+    toggleQuery: function (event) {
+      console.log('togglequery');
+      $('#dashboard-content').scrollTop(0);
+      this.$('#query-options').toggle();
+    },
+
     showKeys: function(){
       this.$("#js-showKeys, .js-disabled-message").show();
       this.$('[name="startkey"],[name="endkey"],[name="inclusive_end"]').attr("disabled","true");
@@ -82,6 +89,7 @@ function(app, FauxtonAPI, resizeColumns ) {
           view.update(this.database, this.ddocName, this.viewName);
         }, this);
       }
+
     },
 
     renderOnUpdatehasReduce: function (hasReduce) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5b674dd2/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 0d8993c..dedb897 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -359,45 +359,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
   });
 
-  Views.AllDocsLayout = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/all_docs_layout",
-
-    initialize: function (options) {
-      this.database = options.database;
-      this.params = options.params;
-    },
-
-    events: {
-      'click #toggle-query': "toggleQuery"
-    },
-
-    toggleQuery: function (event) {
-      $('#dashboard-content').scrollTop(0);
-      this.$('#query-options').toggle();
-    },
-
-    beforeRender: function () {
-      this.advancedOptions = this.insertView('#toggle-query', new QueryOptions.AdvancedOptions({
-        updateViewFn: this.updateAllDocs,
-        previewFn: this.previewView,
-        hasReduce: false,
-        showPreview: false,
-        database: this.database,
-      }));
-
-      this.toolsView = this.setView(".js-search", new Views.JumpToDoc({
-        database: this.database,
-        collection: this.database.allDocs
-      }));
-    },
-
-    afterRender: function () {
-      if (this.params) {
-        this.advancedOptions.updateFromParams(this.params);
-      }
-    }
-
-  });
 
   // TODO: Rename to reflect that this is a list of rows or documents
   Views.AllDocsList = FauxtonAPI.View.extend({


[17/48] move around query options, init style Adding Views, testing header stuff, fixing layout issues Add all the indexes to the sidebar Fix sidebar to work with different indexes Added the apache license changed a comment ffs. Ripping out views into i

Posted by de...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/fauxton/resizeColumns.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/resizeColumns.js b/app/addons/fauxton/resizeColumns.js
index b3d8841..98555a9 100644
--- a/app/addons/fauxton/resizeColumns.js
+++ b/app/addons/fauxton/resizeColumns.js
@@ -32,7 +32,8 @@ function(FauxtonAPI) {
       var primaryNavWidth  = $('body').hasClass('closeMenu') ? 64 : 220;
       return primaryNavWidth;
     },
-    getPanelWidth: function(){
+
+    getSinglePanelWidth: function(){
       var sidebarWidth = $('#sidebar-content').length > 0 ? $('#sidebar-content').outerWidth() : 0,
           borders = parseInt($('#dashboard').css('border-left-width'), 10) +
                     parseInt($('#dashboard-content').css('border-left-width'), 10) +
@@ -40,6 +41,16 @@ function(FauxtonAPI) {
 
       return (this.getPrimaryNavWidth() + sidebarWidth + borders);
     },
+
+    getTwoPanelWidth: function(){
+      var borders = parseInt($('#dashboard').css('border-left-width'), 10) +
+          parseInt($('#right-content').css('border-left-width'), 10) +
+          parseInt($('#left-content').css('border-right-width'), 10)+
+          parseInt($('#left-content').css('border-left-width'), 10) +
+          parseInt($('#right-content').css('border-right-width'), 10);
+      return (this.getPrimaryNavWidth()+ borders);
+    },
+
     initialize: function(){
      // $(window).off('resize');
       var that = this;
@@ -49,33 +60,63 @@ function(FauxtonAPI) {
       FauxtonAPI.utils.initWindowResize();
       this.onResizeHandler();
     },
+
     updateOptions:function(options){
       this.options = {};
       this.options = options;
     },
+
     turnOff:function(){
       FauxtonAPI.utils.removeWindowResize("animation");
     },
+
     cleanupCallback: function(){
       this.callback = null;
     },
+
+    singlePanelResize: function(){
+      var combinedWidth = window.innerWidth - this.getSinglePanelWidth(),
+      smallWidthConstraint = ($('#sidebar-content').length > 0)? 470:800,
+      panelWidth;
+
+      if (combinedWidth > smallWidthConstraint) {
+        panelWidth = combinedWidth;
+      } else if (combinedWidth < smallWidthConstraint){
+        panelWidth = smallWidthConstraint;
+      }
+      return panelWidth;
+    },
+
+    getPanelWidth: function(){
+      var panelWidth;
+      if ($('#dashboard').hasClass('two-pane')){
+        panelWidth = (window.innerWidth - this.getTwoPanelWidth())/2;
+      } else {
+        panelWidth = this.singlePanelResize();
+      }
+      return panelWidth;
+    },
+
+    setPosition: function(panelWidth){
+      var primary = this.getPrimaryNavWidth();
+      $('#right-content').css('left',panelWidth+primary+4);
+    },
+
     onResizeHandler: function (){
       //if there is an override, do that instead
       if (this.options.onResizeHandler){
         this.options.onResizeHandler();
       } else {
-        var combinedWidth = window.innerWidth - this.getPanelWidth(),
-        smallWidthConstraint = ($('#sidebar-content').length > 0)? 470:800,
-        panelWidth;
-
-        if (combinedWidth > smallWidthConstraint) {
-          panelWidth = window.innerWidth - this.getPanelWidth();
-        } else if (combinedWidth < smallWidthConstraint){
-          panelWidth = smallWidthConstraint;
-        }
+        /*
+          Just so we all are aware:
+          This entire file and the html of the layouts is bonkers
+          crazy. I hate what horrible things happened in this file.
+          It will change soon with a layout overhaul.
+        */
 
+        var panelWidth = this.getPanelWidth();
+        this.setPosition(panelWidth);
         $('.window-resizeable').innerWidth(panelWidth);
-
       }
       //if there is a callback, run that
       if(this.options.callback) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/fauxton/templates/breadcrumbs.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/breadcrumbs.html b/app/addons/fauxton/templates/breadcrumbs.html
index 52ea884..ca073c3 100644
--- a/app/addons/fauxton/templates/breadcrumbs.html
+++ b/app/addons/fauxton/templates/breadcrumbs.html
@@ -12,13 +12,10 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<ul class="breadcrumb pull-left">
   <% _.each(_.initial(crumbs), function(crumb) { %>
     <li>
-      <a href="#<%- crumb.link %>"><%- crumb.name %></a>
-      <span class="divider fonticon fonticon-right-open"> </span>
+      <a href="#<%- crumb.link %>" class="fonticon <%- crumb.className %>"><%- crumb.name %></a>
     </li>
   <% }); %>
   <% var last = _.last(crumbs) || {name: ''} %>
   <li class="active"><%- last.name %></li>
-</ul>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/fauxton/templates/menu_dropdown.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/menu_dropdown.html b/app/addons/fauxton/templates/menu_dropdown.html
index ddef343..d1e96af 100644
--- a/app/addons/fauxton/templates/menu_dropdown.html
+++ b/app/addons/fauxton/templates/menu_dropdown.html
@@ -12,7 +12,7 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<a class="dropdown-toggle icon fonticon-plus-circled2" data-toggle="dropdown" href="#" data-bypass="true"></a>
+<a class="dropdown-toggle icon <%=icon%>" data-toggle="dropdown" href="#" data-bypass="true"></a>
 <ul class="dropdown-menu arrow" role="menu" aria-labelledby="dLabel">
   <% _.each(links, function (linkSection) { %>
     <% if (linkSection.title) { %>
@@ -20,9 +20,9 @@ the License.
     <% } %>
     <% _.each(linkSection.links, function (link) { %>
       <li>
-        <a 
+        <a
           <% if (link.icon) { %>
-          class="icon <%- link.icon %>" 
+          class="icon <%- link.icon %>"
           <% } %>
           href="<%- link.url %>">
           <%- link.title %>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/assets/less/doc-item.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/assets/less/doc-item.less b/app/addons/indexes/assets/less/doc-item.less
new file mode 100644
index 0000000..a04883a
--- /dev/null
+++ b/app/addons/indexes/assets/less/doc-item.less
@@ -0,0 +1,83 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+.view table td div.doc-menu-item div.dropdown{
+  display: block;
+}
+
+#doc-list{
+  margin-top: 30px;
+  div.doc-row {
+    margin-bottom:20px;
+    div.select {
+      width: 10%;
+      float: left;
+      vertical-align: top;
+    }
+    .doc-item {
+      float:left;
+      width:90%;
+      vertical-align: top;
+      position: relative;
+      .border-radius(5px 5px 5px 5px);
+      .box-shadow(3px 4px 0 rgba(0, 0, 0, 0.3));
+      border: 1px solid #000;
+      header {
+        font-weight: bold;
+        position: relative;
+        padding: 20px;
+        background-color: #777;
+        color: #3a2c2b;
+        border-bottom: 1px solid #000;
+        .header-id-number{
+          color: #fff;
+          margin-left: 10px;
+        }
+      }
+
+      .doc-data{
+        pre.prettyprint{
+        }
+      }
+
+      &:hover{
+        .btn-group{
+          display:block;
+        }
+      }
+      //temporary
+      .btn-group{
+        position:absolute;
+        top:10px;
+        right:10px;
+        display:none;
+      }
+
+      .doc-menu {
+        position:absolute;
+        right: 0px;
+        top: 0px;
+        .doc-menu-item{
+          a {
+            text-decoration: none;
+          }
+          .dropdown-menu {
+            left:auto;
+            right: 0px;
+          }
+          display: inline-block;
+          width: 30px;
+          height: 30px;
+        }
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/assets/less/index-form.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/assets/less/index-form.less b/app/addons/indexes/assets/less/index-form.less
new file mode 100644
index 0000000..c07163b
--- /dev/null
+++ b/app/addons/indexes/assets/less/index-form.less
@@ -0,0 +1,64 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+.index-form{
+  .control-group {
+    padding:15px 25px;
+    border-bottom: 1px solid #D9D9D9;
+    border-top: 1px solid #fff;
+    margin: 0 0 0 1px;
+    > input[type=text]{
+      width: 100%;
+      .border-radius(5px 5px 5px 5px);
+    }
+  }
+  .js-editor {
+    border: 1px solid #ccc;
+    .border-radius(5px 5px 5px 5px);
+  }
+}
+.input-prepend {
+  margin-left:0;
+}
+.new-ddoc {
+  .select-wrapper {
+    .border-radius(5px 0 0 5px);
+    margin-left:0;
+    overflow: hidden;
+    border: 1px solid #d0cdc6;
+    position: relative;
+    select {
+      border: 0;
+      color: #000;
+      background: transparent;
+      font-size: 14px;
+      padding: 5px 10px;
+      -webkit-appearance: none;
+      -moz-appearance: window;
+      height: 44px;
+    }
+    i {
+      position: absolute;
+      right: 20px;
+      top: 16px;
+      display: block;
+      color: #000;
+      width: 0;
+      height: 0;
+      border-style: solid;
+      border-width: 10px 7.5px 0 7.5px;
+      border-color: #000000 transparent transparent transparent;
+    }
+  }
+  input[type=text]{
+    .border-radius(0px 5px 5px 0);
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/assets/less/indexes.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/assets/less/indexes.less b/app/addons/indexes/assets/less/indexes.less
new file mode 100644
index 0000000..5795cce
--- /dev/null
+++ b/app/addons/indexes/assets/less/indexes.less
@@ -0,0 +1,17 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+@import "../../../../../assets/less/variables.less";
+@import "../../../../../assets/less/bootstrap/variables.less";
+@import "../../../../../assets/less/bootstrap/mixins.less";
+@import "new-index-placeholder.less";
+@import "index-form.less";
+@import "doc-item.less";

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/assets/less/new-index-placeholder.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/assets/less/new-index-placeholder.less b/app/addons/indexes/assets/less/new-index-placeholder.less
new file mode 100644
index 0000000..6336771
--- /dev/null
+++ b/app/addons/indexes/assets/less/new-index-placeholder.less
@@ -0,0 +1,25 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+.watermark-logo {
+  background: transparent url('../img/couchWatermark.png') no-repeat 50% 50%;
+  min-height: 400px;
+  padding-top: 80%;
+  text-align: center;
+  h3 {
+    border-bottom: 1px solid #ccc;
+    padding-bottom:10px;
+    margin-bottom:20px;
+  }
+  .preview {
+    margin: 0 10px;
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/base.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/base.js b/app/addons/indexes/base.js
new file mode 100644
index 0000000..6365c61
--- /dev/null
+++ b/app/addons/indexes/base.js
@@ -0,0 +1,74 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+
+/*  View Indexes  */
+define([
+  "app",
+  "api",
+  "addons/indexes/routes"
+],
+function(app, FauxtonAPI, Routes) {
+  Routes.initialize = function() {
+
+    /*
+      Example of an extension:
+      An extension is just like an event that may or may not have listener in another view.
+      In this case the listener is in the documents addon in the sidebar.
+
+      If there are is a view that you want rendered in another route, this is the way to do it.
+
+      Each Secondary index is going to trigger this event with the views it's passing.
+      The views will be rendered and have links to the routes defined in this addon. Then it's just business as usual.
+
+      FauxtonAPI.registerExtension('sidebar:list', new Views.IndexMenu({}));
+      FauxtonAPI.registerExtension('sidebar:links',{
+        title: "New View",
+        url: "new_view"
+      });
+
+
+    */
+    //Show in the sidebar
+    FauxtonAPI.registerExtension('sidebar:list', {
+      selector:'views',
+      ddocType:'view',
+      icon: "fonticon-sidenav-map-reduce"
+    });
+    FauxtonAPI.registerExtension('sidebar:list', {
+      selector:'list',
+      icon: "fonticon-sidenav-list-function"
+    });
+    FauxtonAPI.registerExtension('sidebar:list', {
+      selector:'show',
+      icon: "fonticon-sidenav-show-function"
+    });
+
+
+    /* show in the add new menu dropdown */
+    FauxtonAPI.registerExtension('sidebar:links', {
+      title: "Secondary View",
+      url: "new_view"
+    });
+    FauxtonAPI.registerExtension('sidebar:links', {
+      title: "List Function",
+      url: "new_list"
+    });
+
+    FauxtonAPI.registerExtension('sidebar:links', {
+      url: 'new_show',
+      title: 'Show Index'
+    });
+
+  };
+  return Routes;
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/index-components.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/index-components.js b/app/addons/indexes/index-components.js
new file mode 100644
index 0000000..1ec34e2
--- /dev/null
+++ b/app/addons/indexes/index-components.js
@@ -0,0 +1,30 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+
+/*
+  Index components includes any common, generic, and reusable code for creating secondary indexes
+  View functions, List functions, Show Functions, and Filter functions, as well as anything created by
+  couchdb affiliates.
+*/
+
+define([
+  "app",
+  "api"
+],
+
+function(app, FauxtonAPI) {
+  var Components = {};
+
+
+  return Components;
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/less/indexes.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/less/indexes.less b/app/addons/indexes/less/indexes.less
new file mode 100644
index 0000000..d526ee9
--- /dev/null
+++ b/app/addons/indexes/less/indexes.less
@@ -0,0 +1,13 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+@import "new-index-placeholder.less";

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/less/new-index-placeholder.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/less/new-index-placeholder.less b/app/addons/indexes/less/new-index-placeholder.less
new file mode 100644
index 0000000..3f5db0e
--- /dev/null
+++ b/app/addons/indexes/less/new-index-placeholder.less
@@ -0,0 +1,3 @@
+.watermark-logo {
+  background: transparent url(../img/couchWatermark.png') no-repeat 0 0;
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/resources.js b/app/addons/indexes/resources.js
new file mode 100644
index 0000000..626d984
--- /dev/null
+++ b/app/addons/indexes/resources.js
@@ -0,0 +1,285 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+  "app",
+  "api",
+  "cloudant.pagingcollection"
+],
+
+function(app, FauxtonAPI, PagingCollection) {
+ var Resources = {};
+
+
+   Resources.QueryParams = (function () {
+    var _eachParams = function (params, action) {
+      // clone to avoid in-place modification
+      var result = _.clone(params);
+
+      _.each(['startkey', 'endkey', 'key'], function (key) {
+        if (_.has(result, key)) {
+          result[key] = action(result[key]);
+        }
+      });
+
+      return result;
+    };
+
+    return {
+      parse: function (params) {
+        return _eachParams(params, JSON.parse);
+      },
+
+      stringify: function (params) {
+        return _eachParams(params, JSON.stringify);
+      }
+    };
+  })();
+
+  Resources.ViewRow = FauxtonAPI.Model.extend({
+    // this is a hack so that backbone.collections doesn't group
+    // these by id and reduce the number of items returned.
+    idAttribute: "_id",
+
+    docType: function() {
+      if (!this.id) return "reduction";
+
+      return this.id.match(/^_design/) ? "design doc" : "doc";
+    },
+    documentation: function(){
+      return "docs";
+    },
+    url: function(context) {
+      return this.collection.database.url(context) + "/" + this.safeID();
+    },
+
+    isEditable: function() {
+      return this.docType() != "reduction";
+    },
+    safeID: function() {
+      var id = this.id || this.get("id");
+
+      return app.utils.safeURLName(id);
+    },
+
+    prettyJSON: function() {
+      //var data = this.get("doc") ? this.get("doc") : this;
+      return JSON.stringify(this, null, "  ");
+    }
+  });
+
+
+  Resources.PouchIndexCollection = PagingCollection.extend({
+    model: Resources.ViewRow,
+    documentation: function(){
+      return "docs";
+    },
+    initialize: function(_models, options) {
+      this.database = options.database;
+      this.rows = options.rows;
+      this.view = options.view;
+      this.design = options.design.replace('_design/','');
+      this.params = _.extend({limit: 20, reduce: false}, options.params);
+
+      this.idxType = "_view";
+    },
+
+    url: function () {
+      return '';
+    },
+
+    simple: function () {
+      var docs = this.map(function (item) {
+        return {
+          _id: item.id,
+          key: item.get('key'),
+          value: item.get('value')
+        };
+      });
+
+      return new Resources.PouchIndexCollection(docs, {
+        database: this.database,
+        params: this.params,
+        view: this.view,
+        design: this.design,
+        rows: this.rows
+      });
+
+    },
+
+    fetch: function() {
+      var deferred = FauxtonAPI.Deferred();
+      this.reset(this.rows, {silent: true});
+
+      this.viewMeta = {
+        total_rows: this.rows.length,
+        offset: 0,
+        update_seq: false
+      };
+
+      deferred.resolve();
+      return deferred;
+    },
+
+    totalRows: function() {
+      return this.viewMeta.total_rows || "unknown";
+    },
+
+    updateSeq: function() {
+      return this.viewMeta.update_seq || false;
+    },
+
+    buildAllDocs: function(){
+      this.fetch();
+    },
+
+    allDocs: function(){
+      return this.models;
+    }
+  });
+
+
+  Resources.IndexCollection = PagingCollection.extend({
+    model: Resources.ViewRow,
+    documentation: function(){
+      return "docs";
+    },
+    initialize: function(_models, options) {
+      this.database = options.database;
+      this.params = _.extend({limit: 20, reduce: false}, options.params);
+
+      this.idxType = "_view";
+      this.view = options.view;
+      this.design = options.design.replace('_design/','');
+      this.perPageLimit = options.perPageLimit || 20;
+
+      if (!this.params.limit) {
+        this.params.limit = this.perPageLimit;
+      }
+    },
+
+    urlRef: function(context, params) {
+      var query = "";
+
+      if (params) {
+        if (!_.isEmpty(params)) {
+          query = "?" + $.param(params);
+        } else {
+          query = '';
+        }
+      } else if (this.params) {
+        var parsedParam = Resources.QueryParams.stringify(this.params);
+        query = "?" + $.param(parsedParam);
+      }
+
+      var startOfUrl = app.host;
+      if (context === 'app') {
+        startOfUrl = 'database';
+      } else if (context === "apiurl"){
+        startOfUrl = window.location.origin;
+      }
+      var design = app.utils.safeURLName(this.design),
+          view = app.utils.safeURLName(this.view);
+
+      var url = [startOfUrl, this.database.safeID(), "_design", design, this.idxType, view];
+      return url.join("/") + query;
+    },
+
+    url: function () {
+      return this.urlRef.apply(this, arguments);
+    },
+
+    totalRows: function() {
+      if (this.params.reduce) { return "unknown_reduce";}
+
+      return this.viewMeta.total_rows || "unknown";
+    },
+
+    updateSeq: function() {
+      return this.viewMeta.update_seq || false;
+    },
+
+    simple: function () {
+      var docs = this.map(function (item) {
+        return {
+          _id: item.id,
+          key: item.get('key'),
+          value: item.get('value')
+        };
+      });
+
+      return new Resources.IndexCollection(docs, {
+        database: this.database,
+        params: this.params,
+        view: this.view,
+        design: this.design
+      });
+    },
+
+    parse: function(resp) {
+      var rows = resp.rows;
+      this.endTime = new Date().getTime();
+      this.requestDuration = (this.endTime - this.startTime);
+
+      return PagingCollection.prototype.parse.apply(this, arguments);
+    },
+
+    buildAllDocs: function(){
+      this.fetch();
+    },
+
+    // We implement our own fetch to store the starttime so we that
+    // we can get the request duration
+    fetch: function () {
+      this.startTime = new Date().getTime();
+      return PagingCollection.prototype.fetch.call(this);
+    },
+
+    allDocs: function(){
+      return this.models;
+    },
+
+    // This is taken from futon.browse.js $.timeString
+    requestDurationInString: function () {
+      var ms, sec, min, h, timeString, milliseconds = this.requestDuration;
+
+      sec = Math.floor(milliseconds / 1000.0);
+      min = Math.floor(sec / 60.0);
+      sec = (sec % 60.0).toString();
+      if (sec.length < 2) {
+         sec = "0" + sec;
+      }
+
+      h = (Math.floor(min / 60.0)).toString();
+      if (h.length < 2) {
+        h = "0" + h;
+      }
+
+      min = (min % 60.0).toString();
+      if (min.length < 2) {
+        min = "0" + min;
+      }
+
+      timeString = h + ":" + min + ":" + sec;
+
+      ms = (milliseconds % 1000.0).toString();
+      while (ms.length < 3) {
+        ms = "0" + ms;
+      }
+      timeString += "." + ms;
+
+      return timeString;
+    }
+
+  });
+
+  return Resources;
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/routes-core.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-core.js b/app/addons/indexes/routes-core.js
new file mode 100644
index 0000000..354afb0
--- /dev/null
+++ b/app/addons/indexes/routes-core.js
@@ -0,0 +1,129 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+  "app",
+  "api",
+  "addons/databases/base",
+  "addons/indexes/views",
+  "addons/documents/views",
+  "addons/indexes/resources"
+],
+
+function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
+
+  var CoreIndexRouteObj =  FauxtonAPI.RouteObject.extend({
+    layout: "two_pane",
+
+    initialize: function (route, masterLayout, options) {
+      this.databaseName = options[0];
+
+      this.data = {
+        database: new Databases.Model({id:this.databaseName})
+      };
+
+      this.data.designDocs = new Documents.AllDocs(null, {
+        database: this.data.database,
+        paging: {
+          pageSize: 500
+        },
+        params: {
+          startkey: '_design',
+          endkey: '_design1',
+          include_docs: true,
+          limit: 500
+        }
+      });
+    },
+
+    events: {
+      "route:updatePreviewDocs": "updateAllDocsFromPreview"
+    },
+
+    ddocInfo: function (designDoc, designDocs, view) {
+      return {
+        id: "_design/" + designDoc,
+        currView: view,
+        designDocs: designDocs
+      };
+    },
+
+    createParams: function (options) {
+      var urlParams = app.getParams(options);
+      var params = Documents.QueryParams.parse(urlParams);
+
+      return {
+        urlParams: urlParams,
+        docParams: _.extend(params, {limit: this.getDocPerPageLimit(params, 20)})
+      };
+    },
+
+    getDocPerPageLimit: function (urlParams, perPage) {
+      var storedPerPage = perPage;
+
+      if (window.localStorage) {
+        storedPerPage = window.localStorage.getItem('fauxton:perpage');
+
+        if (!storedPerPage) {
+          this.setDocPerPageLimit(perPage);
+          storedPerPage = perPage;
+        } else {
+          storedPerPage = parseInt(storedPerPage, 10);
+        }
+      }
+
+      if (!urlParams.limit || urlParams.limit > storedPerPage) {
+        return parseInt(storedPerPage, 10);
+      } else {
+        return parseInt(urlParams.limit, 10);
+      }
+    },
+
+    establish: function () {
+      return this.data.designDocs.fetch({reset: true});
+    },
+
+    createViewDocumentsView: function (options) {
+      return this.setView("#right-content", new Documents.Views.AllDocsList({
+        database: options.database,
+        collection: options.indexedDocs,
+        nestedView: Views.Row,
+        viewList: true,
+        ddocInfo: this.ddocInfo(options.designDoc, options.designDocs, options.view),
+        docParams: options.docParams,
+        params: options.urlParams
+      }));
+    },
+
+    updateAllDocsFromPreview: function (event) {
+      var view = event.view,
+      rows = event.rows,
+      ddoc = event.ddoc;
+
+      this.data.indexedDocs = new Documents.PouchIndexCollection(null, {
+        database: this.data.database,
+        design: ddoc,
+        view: view,
+        rows: rows
+      });
+
+      this.documentsView = this.setView("#right-content", new Documents.Views.AllDocsList({
+        database: this.data.database,
+        collection: this.data.indexedDocs,
+        nestedView: Views.Row,
+        viewList: true
+      }));
+    }
+  });
+
+  return CoreIndexRouteObj;
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/routes-list.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-list.js b/app/addons/indexes/routes-list.js
new file mode 100644
index 0000000..1245c24
--- /dev/null
+++ b/app/addons/indexes/routes-list.js
@@ -0,0 +1,71 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+  "app",
+  "api",
+  "addons/databases/base",
+  "addons/indexes/views",
+  "addons/documents/views",
+  "addons/indexes/resources",
+  "addons/indexes/routes-core"
+],
+
+function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
+
+  var ListIndexes = RouteCore.extend({
+    routes: {
+      "database/:database/_design/:ddoc/_lists/:fn": {
+        route: "tempFn",
+        roles: ['_admin']
+      },
+      "database/:database/new_list": "newListsEditor",
+      "database/:database/new_list/:designDoc": "newListsEditor"
+    },
+
+    apiUrl: function() {
+      //TODO: Hook up proper API urls
+      return '';
+    },
+
+    newListsEditor: function (database, designDoc) {
+      var params = app.getParams();
+
+      this.setView("#left-content", new Views.ListEditor({
+        model: this.data.database,
+        currentddoc: designDoc ? "_design/"+designDoc : "",
+        ddocs: this.data.designDocs,
+        params: params,
+        database: this.data.database,
+        newView: true
+      }));
+
+      this.setView("#right-content", new Views.PreviewScreen({}));
+      this.crumbs = function () {
+        return [
+          {"name": "Create List Index", "link": Databases.databaseUrl(this.data.database)},
+        ];
+      };
+    },
+    tempFn:  function(databaseName, ddoc, fn){
+      this.setView("#left-content", new Views.ListEditor({}));
+
+      this.setView("#right-content", new Views.PreviewScreen({}));
+      this.crumbs = function () {
+        return [
+          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
+        ];
+      };
+    }
+  });
+
+  return ListIndexes;
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/routes-show.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-show.js b/app/addons/indexes/routes-show.js
new file mode 100644
index 0000000..10a3a56
--- /dev/null
+++ b/app/addons/indexes/routes-show.js
@@ -0,0 +1,72 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+  "app",
+  "api",
+  "addons/databases/base",
+  "addons/indexes/views",
+  "addons/documents/views",
+  "addons/indexes/resources",
+  "addons/indexes/routes-core"
+],
+
+function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
+
+  var ShowIndexes = RouteCore.extend({
+    routes: {
+      "database/:database/_design/:ddoc/_show/:fn": {
+        route: "tempFn",
+        roles: ['_admin']
+      },
+      "database/:database/new_show": "newShowEditor",
+      "database/:database/new_show/:designDoc": "newShowEditor"
+    },
+
+    newShowEditor: function (database, designDoc) {
+      var params = app.getParams();
+
+      this.setView("#left-content", new Views.ShowEditor({
+        model: this.data.database,
+        currentddoc: designDoc ? "_design/"+designDoc : "",
+        ddocs: this.data.designDocs,
+        params: params,
+        database: this.data.database,
+        newView: true
+      }));
+
+      this.setView("#right-content", new Views.PreviewScreen({}));
+      this.crumbs = function () {
+        return [
+          {"name": "Create Show Index", "link": Databases.databaseUrl(this.data.database)},
+        ];
+      };
+    },
+
+    apiUrl: function() {
+      //TODO: Hook up proper API urls
+      return '';
+    },
+
+    tempFn:  function(databaseName, ddoc, fn){
+      this.setView("#left-content", new Views.ShowEditor({}));
+
+      this.setView("#right-content", new Views.PreviewScreen({}));
+      this.crumbs = function () {
+        return [
+          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
+        ];
+      };
+    }
+  });
+
+  return ShowIndexes;
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/routes-viewindexes.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-viewindexes.js b/app/addons/indexes/routes-viewindexes.js
new file mode 100644
index 0000000..de53981
--- /dev/null
+++ b/app/addons/indexes/routes-viewindexes.js
@@ -0,0 +1,107 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+  "app",
+  "api",
+  "addons/databases/base",
+  "addons/indexes/views",
+  "addons/documents/views",
+  "addons/indexes/resources",
+  "addons/indexes/routes-core"
+],
+
+function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
+
+  var ViewIndexes = RouteCore.extend({
+    routes: {
+      "database/:database/_design/:ddoc/_view/:view": {
+        route: "viewFn",
+        roles: ['_admin']
+      },
+      "database/:database/new_view": "newViewEditor",
+      "database/:database/new_view/:designDoc": "newViewEditor"
+    },
+
+    newViewEditor: function (database, designDoc) {
+      var params = app.getParams();
+      this.rightheader && this.rightheader.remove();
+
+      this.setView("#right-content", new Views.PreviewScreen({}));
+
+      this.viewEditor = this.setView("#left-content", new Views.ViewEditor({
+        model: this.data.database,
+        currentddoc: designDoc ? "_design/"+designDoc : "",
+        ddocs: this.data.designDocs,
+        params: params,
+        database: this.data.database,
+        newView: true
+      }));
+
+      this.leftheader = this.setView("#breadcrumbs", new Views.LeftHeader({
+        title:"Create a View Index",
+        database: this.data.database
+      }));
+
+    },
+
+    viewFn: function (databaseName, ddoc, view) {
+      var params = this.createParams(),
+          urlParams = params.urlParams,
+          docParams = params.docParams,
+          decodeDdoc = decodeURIComponent(ddoc);
+          view = view.replace(/\?.*$/,'');
+
+      this.leftheader = this.setView("#breadcrumbs", new Views.LeftHeader({
+        title: view,
+        database: this.data.database
+      }));
+
+      this.rightheader = this.setView("#api-bar", new Views.RightHeader({
+        database: this.data.database
+      }));
+
+      this.data.indexedDocs = new Resources.IndexCollection(null, {
+        database: this.data.database,
+        design: decodeDdoc,
+        view: view,
+        params: docParams,
+        paging: {
+          pageSize: this.getDocPerPageLimit(urlParams, parseInt(docParams.limit, 10))
+        }
+      });
+
+      this.viewEditor = this.setView("#left-content", new Views.ViewEditor({
+        model: this.data.database,
+        ddocs: this.data.designDocs,
+        viewName: view,
+        params: urlParams,
+        newView: false,
+        database: this.data.database,
+        ddocInfo: this.ddocInfo(decodeDdoc, this.data.designDocs, view)
+      }));
+
+      this.documentsView = this.createViewDocumentsView({
+        designDoc: decodeDdoc,
+        docParams: docParams,
+        urlParams: urlParams,
+        database: this.data.database,
+        indexedDocs: this.data.indexedDocs,
+        designDocs: this.data.designDocs,
+        view: view
+      });
+
+      this.apiUrl = [this.data.indexedDocs.urlRef("apiurl", urlParams), "docs"];
+    }
+  });
+
+  return ViewIndexes;
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes.js b/app/addons/indexes/routes.js
new file mode 100644
index 0000000..90c9aac
--- /dev/null
+++ b/app/addons/indexes/routes.js
@@ -0,0 +1,24 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+  "app",
+  "api",
+  "addons/indexes/views",
+  "addons/indexes/routes-viewindexes",
+  "addons/indexes/routes-show",
+  "addons/indexes/routes-list",
+],
+
+function (app, FauxtonAPI, Views, ViewIndex, Show, List) {
+  Views.RouteObjects = [ViewIndex, Show, List];
+  return Views;
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/templates/design_doc_selector.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/design_doc_selector.html b/app/addons/indexes/templates/design_doc_selector.html
new file mode 100644
index 0000000..98abc46
--- /dev/null
+++ b/app/addons/indexes/templates/design_doc_selector.html
@@ -0,0 +1,38 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+<div class="span3">
+  <label for="ddoc">Save to Design Document <a class="help-link" href="<%-getDocUrl('design_doc')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
+  <select id="ddoc">
+    <optgroup label="Select a document">
+      <option value="new-doc">New document</option>
+
+      <% ddocs.each(function(ddoc) { %>
+      <%= ddoc.id %>
+      <%= ddocName %>
+      <% if (ddoc.id === ddocName) { %>
+      <option selected="selected" value="<%- ddoc.id %>"><%- ddoc.id %></option>
+      <% } else { %>
+      <option value="<%- ddoc.id %>"><%- ddoc.id %></option>
+      <% } %>
+      <% }); %>
+    </optgroup>
+  </select>
+</div>
+
+<div id="new-ddoc-section" class="span5" style="display:none">
+  <label class="control-label" for="new-ddoc"> _design/ </label>
+  <div class="controls">
+    <input type="text" id="new-ddoc" placeholder="newDesignDoc" />
+  </div>
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/templates/header_left.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/header_left.html b/app/addons/indexes/templates/header_left.html
new file mode 100644
index 0000000..13bea60
--- /dev/null
+++ b/app/addons/indexes/templates/header_left.html
@@ -0,0 +1,17 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+<!--back arrow-->
+<div id="header-breadcrumbs"></div>
+  <!-- Menu gear-->
+<div id="header-dropdown-menu"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/templates/header_right.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/header_right.html b/app/addons/indexes/templates/header_right.html
new file mode 100644
index 0000000..90828d2
--- /dev/null
+++ b/app/addons/indexes/templates/header_right.html
@@ -0,0 +1,18 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+  <!-- Query Options-->
+  <!--right margin for api bar-->
+  <div id="header-api-bar"></div>
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/templates/index_header.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/index_header.html b/app/addons/indexes/templates/index_header.html
new file mode 100644
index 0000000..ac8ac56
--- /dev/null
+++ b/app/addons/indexes/templates/index_header.html
@@ -0,0 +1,28 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+<div class="header-left">
+<!--back arrow-->
+
+<!--title-->
+
+<!-- Menu gear-->
+
+</div>
+
+
+<div class="header-right">
+  <!-- Query Options-->
+  <!--right margin for api bar-->
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/templates/index_row_docular.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/index_row_docular.html b/app/addons/indexes/templates/index_row_docular.html
new file mode 100644
index 0000000..ba88d06
--- /dev/null
+++ b/app/addons/indexes/templates/index_row_docular.html
@@ -0,0 +1,35 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+<% if (doc.isEditable()) { %>
+  <div class="select"><input type="checkbox"></div>
+<% } %>
+
+<div class="doc-item">
+  <header>
+    _id <span class="header-id-number">"<%=docID%>"</span>
+
+    <div class="doc-menu">
+      <a href="#<%= url %>" class="doc-menu-item icon fonticon-pencil"></a>
+      <% if (doc.isEditable()) { %>
+        <button href="#" class="btn btn-small btn-danger delete" title="Delete this document."><i class="icon icon-trash"></i></button>
+      <% } %>
+
+      <div id="view-doc-menu" class="doc-menu-item"></div>
+    </div>
+  </header>
+  <div class="doc-data">
+    <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
+  </div>
+</div>
+<div class="clearfix"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/templates/list_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/list_editor.html b/app/addons/indexes/templates/list_editor.html
new file mode 100644
index 0000000..8644909
--- /dev/null
+++ b/app/addons/indexes/templates/list_editor.html
@@ -0,0 +1,18 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+<form>
+  <label> A FORM</label>
+
+</form>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/templates/preview_screen.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/preview_screen.html b/app/addons/indexes/templates/preview_screen.html
new file mode 100644
index 0000000..1fcf6d9
--- /dev/null
+++ b/app/addons/indexes/templates/preview_screen.html
@@ -0,0 +1,16 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+<h3>No Index Created Yet!</h3>
+<p> Run <a href="#/preview" class="btn btn-success save"> Preview</a> To query result</p>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/templates/show_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/show_editor.html b/app/addons/indexes/templates/show_editor.html
new file mode 100644
index 0000000..9afa2bf
--- /dev/null
+++ b/app/addons/indexes/templates/show_editor.html
@@ -0,0 +1,41 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+<div class="all-docs-list errors-container"></div>
+<div id="define-view" class="ddoc-alert index-form">
+  <div class="errors-container"></div>
+  <form class="form-horizontal view-query-save">
+    <div class="control-group">
+      <p>Views are the primary tool used for querying and reporting on CouchDB databases.</p>
+    </div>
+
+    <div class="control-group design-doc-group">
+    </div>
+
+
+    <div class="control-group">
+      <label for="index-name">Index name <a class="help-link" href="<%-getDocUrl('view_functions')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
+      <input type="text" id="index-name" value="<%- viewName %>" placeholder="Index name" />
+    </div>
+
+
+    <div class="control-group">
+      <button class="btn btn-success save"><i class="icon fonticon-ok-circled"></i> Save &amp; Build Index</button>
+      <% if (!newView) { %>
+      <button class="btn btn-danger delete"><i class="icon fonticon-cancel-circled"></i> Delete</button>
+      <% } %>
+    </div>
+    <div class="clearfix"></div>
+  </form>
+</div>=

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/templates/view_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/view_editor.html b/app/addons/indexes/templates/view_editor.html
new file mode 100644
index 0000000..f33d3f9
--- /dev/null
+++ b/app/addons/indexes/templates/view_editor.html
@@ -0,0 +1,80 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+<div class="all-docs-list errors-container"></div>
+<div id="define-view" class="ddoc-alert index-form">
+  <div class="errors-container"></div>
+  <form class="form-horizontal view-query-save">
+    <div class="control-group">
+      <p>Views are the primary tool used for querying and reporting on CouchDB databases.</p>
+    </div>
+
+
+    <div class="control-group">
+      <label for="index-name">Database name</label>
+      <p><%- database %></p>
+    </div>
+
+
+    <div class="control-group design-doc-group">
+    </div>
+
+
+    <div class="control-group">
+      <label for="index-name">Index name <a class="help-link" href="<%-getDocUrl('view_functions')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
+      <input type="text" id="index-name" value="<%- viewName %>" placeholder="Index name" />
+    </div>
+
+    <div class="control-group">
+      <label for="map-function">Map function <a class="help-link" href="<%-getDocUrl('map_functions')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
+      <% if (newView) { %>
+      <div class="js-editor" id="map-function"><%= langTemplates.map %></div>
+      <% } else { %>
+      <div class="js-editor" id="map-function"><%- ddoc.get('views')[viewName].map %></div>
+      <button class="beautify beautify_map btn btn-primary btn-large hide beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
+      <% } %>
+    </div>
+
+
+    <div class="control-group">
+      <label for="reduce-function-selector">Reduce (optional) <a class="help-link" href="<%-getDocUrl('reduce_functions')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
+
+      <select id="reduce-function-selector">
+        <option value="" <%- !reduceFunStr ? 'selected="selected"' : '' %>>None</option>
+        <% _.each(["_sum", "_count", "_stats"], function(reduce) { %>
+        <option value="<%- reduce %>" <% if (reduce == reduceFunStr) { %>selected<% } %>><%= reduce %></option>
+        <% }) %>
+        <option value="CUSTOM" <% if (isCustomReduce) { %>selected<% } %>>Custom Reduce function</option>
+      </select>
+    </div>
+
+    <div class="control-group reduce-function">
+      <label for="reduce-function">Custom Reduce function</label>
+      <% if (newView) { %>
+      <div class="js-editor" id="reduce-function"><%- langTemplates.reduce %></div>
+      <% } else { %>
+      <div class="js-editor" id="reduce-function"><%- ddoc.get('views')[viewName].reduce %></div>
+      <button class="beautify beautify_reduce btn btn-primary btn-large hide beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
+      <% } %>
+    </div>
+
+    <div class="control-group">
+      <button class="btn btn-success save"><i class="icon fonticon-ok-circled"></i> Save &amp; Build Index</button>
+      <% if (!newView) { %>
+      <button class="btn btn-danger delete"><i class="icon fonticon-cancel-circled"></i> Delete</button>
+      <% } %>
+    </div>
+    <div class="clearfix"></div>
+  </form>
+</div>
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
new file mode 100644
index 0000000..80e6a40
--- /dev/null
+++ b/app/addons/indexes/views.js
@@ -0,0 +1,712 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+define([
+  "app",
+
+  "api",
+  "addons/fauxton/components",
+
+  "addons/documents/resources",
+  "addons/databases/resources",
+  "addons/pouchdb/base",
+  //views
+  "addons/documents/views-advancedopts",
+  // Libs
+  "addons/fauxton/resizeColumns",
+
+  // Plugins
+  "plugins/beautify",
+  "plugins/prettify"
+],
+
+function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
+         QueryOptions, resizeColumns, beautify, prettify) {
+
+  var Views = {};
+
+//left header
+  Views.LeftHeader = FauxtonAPI.View.extend({
+    className: "header-left",
+    template: "addons/indexes/templates/header_left",
+    initialize:function(options){
+      this.database = options.database;
+      this.title = options.title;
+    },
+    beforeRender: function(){
+      var crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": Databases.databaseUrl(this.database)},
+        {"name": this.title, "link": Databases.databaseUrl(this.database)}
+      ];
+      this.insertView("#header-breadcrumbs", new Components.Breadcrumbs({
+        crumbs: crumbs
+      }));
+      this.dropDownMenu();
+    },
+    dropDownMenu: function(){
+      var newLinks = [{
+        links: [{
+          title: 'Table',
+          icon: 'fonticon-table'
+        },{
+          title: 'JSON',
+          icon: 'fonticon-json'
+        }]
+      }];
+
+      this.insertView("#header-dropdown-menu", new Components.MenuDropDown({
+        icon: 'fonticon-cog',
+        links: newLinks,
+      }));
+    }
+  });
+
+//right header
+  Views.RightHeader = FauxtonAPI.View.extend({
+    className: "header-right",
+    template: "addons/indexes/templates/header_right",
+    initialize:function(options){
+      this.database = options.database;
+      this.title = options.title;
+    },
+    beforeRender: function(){
+      this.insertView(".header-api-bar", new Components.ApiBar({}));
+    }
+  });
+
+
+
+
+  Views.PreviewScreen = FauxtonAPI.View.extend({
+    template: "addons/indexes/templates/preview_screen",
+    className: "watermark-logo"
+  });
+
+
+  Views.Row = FauxtonAPI.View.extend({
+    template: "addons/indexes/templates/index_row_docular",
+    className: "doc-row",
+    events: {
+      "click button.delete": "destroy"
+    },
+
+    destroy: function (event) {
+      event.preventDefault();
+
+      window.alert('Cannot delete a document generated from a view.');
+    },
+
+    beforeRender: function(){
+      var newLinks = [{
+        links: [{
+          title: 'Table',
+          icon: 'fonticon-table'
+        },{
+          title: 'JSON',
+          icon: 'fonticon-json'
+        }]
+      }];
+
+      this.insertView("#view-doc-menu", new Components.MenuDropDown({
+        icon: 'fonticon-drop-down-dots',
+        links: newLinks,
+      }));
+    },
+
+    serialize: function() {
+      return {
+        docID: this.model.get('id'),
+        doc: this.model,
+        url: this.model.url('app')
+      };
+    }
+  });
+
+
+/*
+
+  INDEX EDITORS____________________________________
+
+*/
+
+  //Index view CORE  extend this
+  Views.IndexCore = FauxtonAPI.View.extend({
+    initialize: function(options) {
+        this.newView = options.newView || false;
+        this.ddocs = options.ddocs;
+        this.params = options.params;
+        this.database = options.database;
+        this.currentDdoc = options.currentddoc;
+      if (this.newView) {
+        this.viewName = 'newView';
+      } else {
+        this.ddocID = options.ddocInfo ? options.ddocInfo.id : '';
+        this.viewName = options.viewName;
+        this.ddocInfo = new Documents.DdocInfo({_id: this.ddocID},{database: this.database});
+      }
+
+      this.showIndex = false;
+      _.bindAll(this);
+    },
+    establish: function () {
+      if (this.ddocInfo) {
+        return this.ddocInfo.fetch();
+      }
+    },
+    serialize: function() {
+      return {
+        database: this.database.get('id'),
+        ddocs: this.ddocs,
+        ddoc: this.model,
+        ddocName: this.model.id,
+        viewName: this.viewName,
+        newView: this.newView,
+        langTemplates: this.langTemplates.javascript
+      };
+    }
+  });
+
+  Views.ShowEditor = Views.IndexCore.extend({
+    template: "addons/indexes/templates/show_editor",
+    langTemplates: {
+      "javascript": {
+        map: "function(doc) {\n  emit(doc._id, 1);\n}",
+      }
+    },
+    defaultLang: "javascript"
+  });
+
+  Views.ListEditor = Views.IndexCore.extend({
+    template: "addons/indexes/templates/list_editor",
+    langTemplates: {
+      "javascript": {
+        map: "function(doc) {\n  emit(doc._id, 1);\n}",
+      }
+    },
+    defaultLang: "javascript"
+  });
+
+
+
+
+  Views.ViewEditor = FauxtonAPI.View.extend({
+    template: "addons/indexes/templates/view_editor",
+    builtinReduces: ['_sum', '_count', '_stats'],
+
+    events: {
+      "click button.save": "saveView",
+      "click button.delete": "deleteView",
+      "change select#reduce-function-selector": "updateReduce",
+      "click button.preview": "previewView",
+      "click #db-views-tabs-nav": 'toggleIndexNav',
+      "click .beautify_map":  "beautifyCode",
+      "click .beautify_reduce":  "beautifyCode"
+    },
+
+    langTemplates: {
+      "javascript": {
+        map: "function(doc) {\n  emit(doc._id, 1);\n}",
+        reduce: "function(keys, values, rereduce){\n  if (rereduce){\n    return sum(values);\n  } else {\n    return values.length;\n  }\n}"
+      }
+    },
+
+    defaultLang: "javascript",
+
+    initialize: function(options) {
+      this.newView = options.newView || false;
+      this.ddocs = options.ddocs;
+      this.params = options.params;
+      this.database = options.database;
+      this.currentDdoc = options.currentddoc;
+      if (this.newView) {
+        this.viewName = 'newView';
+      } else {
+        this.ddocID = options.ddocInfo.id;
+        this.viewName = options.viewName;
+        this.ddocInfo = new Documents.DdocInfo({_id: this.ddocID},{database: this.database});
+      }
+
+      this.showIndex = false;
+      _.bindAll(this);
+    },
+
+    establish: function () {
+      if (this.ddocInfo) {
+        return this.ddocInfo.fetch();
+      }
+    },
+
+    updateValues: function() {
+      var notification;
+      if (this.model.changedAttributes()) {
+        notification = FauxtonAPI.addNotification({
+          msg: "Document saved successfully.",
+          type: "success",
+          clear: true
+        });
+        this.editor.setValue(this.model.prettyJSON());
+      }
+    },
+
+    updateReduce: function(event) {
+      var $ele = $("#reduce-function-selector");
+      var $reduceContainer = $(".control-group.reduce-function");
+      if ($ele.val() == "CUSTOM") {
+        this.createReduceEditor();
+        this.reduceEditor.setValue(this.langTemplates.javascript.reduce);
+        $reduceContainer.show();
+      } else {
+        $reduceContainer.hide();
+      }
+    },
+
+    deleteView: function (event) {
+      event.preventDefault();
+
+      if (this.newView) { return alert('Cannot delete a new view.'); }
+      if (!confirm('Are you sure you want to delete this view?')) {return;}
+
+      var that = this,
+          promise,
+          viewName = this.$('#index-name').val(),
+          ddocName = this.$('#ddoc :selected').val(),
+          ddoc = this.getCurrentDesignDoc();
+
+      ddoc.removeDdocView(viewName);
+
+      if (ddoc.hasViews()) {
+        promise = ddoc.save();
+      } else {
+        promise = ddoc.destroy();
+      }
+
+      promise.then(function () {
+        FauxtonAPI.navigate('/database/' + that.database.safeID() + '/_all_docs?limit=' + Databases.DocLimit);
+        FauxtonAPI.triggerRouteEvent('reloadDesignDocs');
+      });
+    },
+
+    saveView: function(event) {
+      var json, notification,
+      that = this;
+
+      if (event) { event.preventDefault();}
+
+      $('#dashboard-content').scrollTop(0); //scroll up
+      //check if the code is valid & the inputs are filled out
+      if (this.hasValidCode() && this.$('#new-ddoc:visible').val() !=="") {
+        var mapVal = this.mapEditor.getValue(),
+        reduceVal = this.reduceVal(),
+        viewName = this.$('#index-name').val(),
+        ddoc = this.getCurrentDesignDoc(),
+        ddocName = ddoc.id;
+        this.viewNameChange = false;
+
+
+        if (this.viewName !== viewName) {
+          ddoc.removeDdocView(this.viewName);
+          this.viewName = viewName;
+          this.viewNameChange = true;
+        }
+
+        notification = FauxtonAPI.addNotification({
+          msg: "Saving document.",
+          selector: "#define-view .errors-container",
+          clear: true
+        });
+
+        ddoc.setDdocView(viewName, mapVal, reduceVal);
+
+        ddoc.save().then(function () {
+          //on success
+          that.afterSave(ddoc, viewName, ddocName);
+        },
+        function(xhr) {
+          //on failure
+          var responseText = JSON.parse(xhr.responseText).reason;
+          notification = FauxtonAPI.addNotification({
+            msg: "Save failed: " + responseText,
+            type: "error",
+            clear: true
+          });
+        });
+      } else {
+        //if nothing is filled out give an error message
+        var errormessage = (this.$('#new-ddoc:visible').val() ==="")?"Enter a design doc name":"Please fix the Javascript errors and try again.";
+        notification = FauxtonAPI.addNotification({
+          msg: errormessage,
+          type: "error",
+          selector: "#define-view .errors-container",
+          clear: true
+        });
+      }
+    },
+
+    afterSave: function(ddoc, viewName, ddocName){
+      var reduceVal = this.reduceVal();
+      //add ddoc to the collection
+      this.ddocs.add(ddoc);
+
+      //trigger the EditSaved function on the map editor & reduce editor
+      this.mapEditor.editSaved();
+      this.reduceEditor && this.reduceEditor.editSaved();
+
+
+      //show a notification
+      FauxtonAPI.addNotification({
+        msg: "View has been saved.",
+        type: "success",
+        selector: "#define-view .errors-container",
+        clear: true
+      });
+
+
+      //if it's new or the name changed (aka created a new doc)
+      if (this.newView || this.viewNameChange) {
+        var fragment = '/database/' + this.database.safeID() +'/' + ddoc.safeID() + '/_view/' + app.utils.safeURLName(viewName);
+
+        FauxtonAPI.navigate(fragment, {trigger: false});
+        this.newView = false;
+        this.ddocID = ddoc.safeID();
+        this.viewName = viewName;
+        this.ddocInfo = ddoc;
+        this.showIndex = true;
+        this.render();
+        FauxtonAPI.triggerRouteEvent('reloadDesignDocs', {
+          selectedTab: app.utils.removeSpecialCharacters(ddocName.replace(/_design\//,'')) + '_' + app.utils.removeSpecialCharacters(viewName)
+        });
+      }
+
+      // TODO:// this should change to a trigger because we shouldn't define advanced options in this view
+      if (this.reduceFunStr !== reduceVal) {
+        this.reduceFunStr = reduceVal;
+       // this.advancedOptions.renderOnUpdatehasReduce(this.hasReduce());
+      }
+
+      // Route Event will reload the right content
+      FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: ddocName, view: viewName});
+    },
+
+    updateView: function(event, paramInfo) {
+       event.preventDefault();
+
+       if (this.newView) { return alert('Please save this new view before querying it.'); }
+
+       var errorParams = paramInfo.errorParams,
+           params = paramInfo.params;
+
+       if (_.any(errorParams)) {
+         _.map(errorParams, function(param) {
+
+           // TODO: Where to add this error?
+           // bootstrap wants the error on a control-group div, but we're not using that
+           //$('form.view-query-update input[name='+param+'], form.view-query-update select[name='+param+']').addClass('error');
+           return FauxtonAPI.addNotification({
+             msg: "JSON Parse Error on field: "+param.name,
+             type: "error",
+             selector: ".advanced-options .errors-container",
+             clear: true
+           });
+         });
+         FauxtonAPI.addNotification({
+           msg: "Make sure that strings are properly quoted and any other values are valid JSON structures",
+           type: "warning",
+           selector: ".advanced-options .errors-container",
+           clear: true
+         });
+
+         return false;
+      }
+
+       var fragment = window.location.hash.replace(/\?.*$/, '');
+       if (!_.isEmpty(params)) {
+        fragment = fragment + '?' + $.param(params);
+       }
+
+       FauxtonAPI.navigate(fragment, {trigger: false});
+       FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: this.ddocID, view: this.viewName});
+    },
+
+
+    previewView: function(event, paramsInfo) {
+      event.preventDefault();
+      var that = this,
+      mapVal = this.mapVal(),
+      reduceVal = this.reduceVal(),
+      paramsArr = [];
+
+      if (paramsInfo && paramsInfo.params) {
+        paramsArr = paramsInfo.params;
+      }
+
+      var params = _.reduce(paramsArr, function (params, param) {
+        params[param.name] = param.value;
+        return params;
+      }, {reduce: false});
+
+      FauxtonAPI.addNotification({
+        msg: "<strong>Warning!</strong> Preview executes the Map/Reduce functions in your browser, and may behave differently from CouchDB.",
+        type: "warning",
+        selector: ".advanced-options .errors-container",
+        fade: true,
+        escape: false // beware of possible XSS when the message changes
+      });
+
+      var promise = FauxtonAPI.Deferred();
+
+      if (!this.database.allDocs || this.database.allDocs.params.include_docs !== true) {
+        this.database.buildAllDocs({limit: Databases.DocLimit.toString(), include_docs: true});
+        promise = this.database.allDocs.fetch();
+       } else {
+        promise.resolve();
+       }
+
+      promise.then(function () {
+        params.docs = that.database.allDocs.map(function (model) { return model.get('doc');});
+        var queryPromise = pouchdb.runViewQuery({map: mapVal, reduce: reduceVal}, params);
+        queryPromise.then(function (results) {
+          FauxtonAPI.triggerRouteEvent('updatePreviewDocs', {rows: results.rows, ddoc: that.getCurrentDesignDoc().id, view: that.viewName});
+        });
+      });
+    },
+
+    getCurrentDesignDoc: function () {
+      return this.designDocSelector.getCurrentDesignDoc();
+    },
+
+    isCustomReduceEnabled: function() {
+      return $("#reduce-function-selector").val() == "CUSTOM";
+    },
+
+    mapVal: function () {
+      if (this.mapEditor) {
+        return this.mapEditor.getValue();
+      }
+
+      return this.$('#map-function').text();
+    },
+
+    reduceVal: function() {
+      var reduceOption = this.$('#reduce-function-selector :selected').val(),
+      reduceVal = "";
+
+      if (reduceOption === 'CUSTOM') {
+        if (!this.reduceEditor) { this.createReduceEditor(); }
+        reduceVal = this.reduceEditor.getValue();
+      } else if ( reduceOption !== 'NONE') {
+        reduceVal = reduceOption;
+      }
+
+      return reduceVal;
+    },
+
+
+    hasValidCode: function() {
+      return _.every(["mapEditor", "reduceEditor"], function(editorName) {
+        var editor = this[editorName];
+        if (editorName === "reduceEditor" && ! this.isCustomReduceEnabled()) {
+          return true;
+        }
+        return editor.hadValidCode();
+      }, this);
+    },
+
+
+    serialize: function() {
+      return {
+        database: this.database.get('id'),
+        ddocs: this.ddocs,
+        ddoc: this.model,
+        ddocName: this.model.id,
+        viewName: this.viewName,
+        reduceFunStr: this.reduceFunStr,
+        isCustomReduce: this.hasCustomReduce(),
+        newView: this.newView,
+        langTemplates: this.langTemplates.javascript
+      };
+    },
+
+    hasCustomReduce: function() {
+      return this.reduceFunStr && ! _.contains(this.builtinReduces, this.reduceFunStr);
+    },
+
+    hasReduce: function () {
+      return this.reduceFunStr || false;
+    },
+
+    createReduceEditor: function () {
+      if (this.reduceEditor) {
+        this.reduceEditor.remove();
+      }
+
+      this.reduceEditor = new Components.Editor({
+        editorId: "reduce-function",
+        mode: "javascript",
+        couchJSHINT: true
+      });
+      this.reduceEditor.render();
+
+      if (this.reduceEditor.getLines() === 1){
+        this.$('.beautify_reduce').removeClass("hide");
+        $('.beautify-tooltip').tooltip();
+      }
+    },
+    beforeRender: function () {
+
+      if (this.newView) {
+        this.reduceFunStr = '';
+        if (this.ddocs.length === 0) {
+          this.model = new Documents.Doc(null, {database: this.database});
+        } else {
+          this.model = this.ddocs.first().dDocModel();
+        }
+        this.ddocID = this.model.id;
+      } else {
+        var ddocDecode = decodeURIComponent(this.ddocID);
+        this.model = this.ddocs.get(this.ddocID).dDocModel();
+        this.reduceFunStr = this.model.viewHasReduce(this.viewName);
+      }
+
+      var viewFilters = FauxtonAPI.getExtensions('sidebar:viewFilters'),
+          filteredModels = this.ddocs.models,
+          designDocs = this.ddocs.clone();
+
+      if (!_.isEmpty(viewFilters)) {
+        _.each(viewFilters, function (filter) {
+          filteredModels = _.filter(filteredModels, filter);
+        });
+        designDocs.reset(filteredModels, {silent: true});
+      }
+
+      this.designDocSelector = this.setView('.design-doc-group', new Views.DesignDocSelector({
+        collection: designDocs,
+        ddocName: this.currentDdoc || this.model.id,
+        database: this.database
+      }));
+
+    },
+
+    afterRender: function() {
+      //TODO: have this happen on a trigger once we move advanced options to the header
+      // if (this.params && !this.newView) {
+      //   this.advancedOptions.updateFromParams(this.params);
+      // }
+
+      this.designDocSelector.updateDesignDoc();
+      this.showEditors();
+      this.showIndex = false;
+
+    },
+
+    showEditors: function () {
+      this.mapEditor = new Components.Editor({
+        editorId: "map-function",
+        mode: "javascript",
+        couchJSHINT: true
+      });
+      this.mapEditor.render();
+
+      if (this.hasCustomReduce()) {
+        this.createReduceEditor();
+      } else {
+        $(".control-group.reduce-function").hide();
+      }
+
+      if (this.newView) {
+        this.mapEditor.setValue(this.langTemplates[this.defaultLang].map);
+        //Use a built in view by default
+        //this.reduceEditor.setValue(this.langTemplates[this.defaultLang].reduce);
+      }
+
+      this.mapEditor.editSaved();
+      this.reduceEditor && this.reduceEditor.editSaved();
+
+      if (this.mapEditor.getLines() === 1){
+        this.$('.beautify_map').removeClass("hide");
+        $('.beautify-tooltip').tooltip();
+      }
+    },
+    beautifyCode: function(e){
+      e.preventDefault();
+      var targetEditor = $(e.currentTarget).hasClass('beautify_reduce')?this.reduceEditor:this.mapEditor;
+      var beautifiedCode = beautify(targetEditor.getValue());
+      targetEditor.setValue(beautifiedCode);
+    },
+    cleanup: function () {
+      this.mapEditor && this.mapEditor.remove();
+      this.reduceEditor && this.reduceEditor.remove();
+    }
+  });
+
+  Views.DesignDocSelector = FauxtonAPI.View.extend({
+    template: "addons/indexes/templates/design_doc_selector",
+
+    events: {
+      "change select#ddoc": "updateDesignDoc"
+    },
+
+    initialize: function (options) {
+      this.ddocName = options.ddocName;
+      this.database = options.database;
+      this.listenTo(this.collection, 'add', this.ddocAdded);
+      this.DocModel = options.DocModel || Documents.Doc;
+    },
+
+    ddocAdded: function (ddoc) {
+      this.ddocName = ddoc.id;
+      this.render();
+    },
+
+    serialize: function () {
+      return {
+        ddocName: this.ddocName,
+        ddocs: this.collection
+      };
+    },
+
+    updateDesignDoc: function () {
+      if (this.newDesignDoc()) {
+        this.$('#new-ddoc').show();
+      } else {
+        this.$('#new-ddoc').hide();
+      }
+    },
+
+    newDesignDoc: function () {
+
+      return this.$('#ddoc').val() === 'new-doc';
+    },
+
+    newDocValidation: function(){
+      return this.newDesignDoc() && this.$('#new-ddoc').val()==="";
+    },
+    getCurrentDesignDoc: function () {
+      if (this.newDesignDoc()) {
+        var doc = {
+          _id: '_design/' + this.$('#new-ddoc').val(),
+          views: {},
+          language: "javascript"
+        };
+        var ddoc = new this.DocModel(doc, {database: this.database});
+        //this.collection.add(ddoc);
+        return ddoc;
+      } else if ( !this.newDesignDoc() ) {
+        var ddocName = this.$('#ddoc').val();
+        return this.collection.find(function (ddoc) {
+          return ddoc.id === ddocName;
+        }).dDocModel();
+      }
+    }
+  });
+
+  return Views;
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/templates/layouts/two_pane.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/two_pane.html b/app/templates/layouts/two_pane.html
index 031ad12..0174a5a 100644
--- a/app/templates/layouts/two_pane.html
+++ b/app/templates/layouts/two_pane.html
@@ -12,18 +12,16 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-
 <div id="primary-navbar"></div>
-<div id="dashboard" class="container-fluid">
-  <div class="fixed-header">
-    <div id="breadcrumbs"></div>
-    <div id="api-navbar"></div>
-  </div>
+<div id="dashboard" class="container-fluid two-pane">
 
+  <header class="fixed-header row-fluid">
+    <div id="breadcrumbs" class="window-resizeable"></div>
+    <div id="api-navbar" class="window-resizeable"></div>
+  </header>
 
-  <div class="row-fluid content-area">
-    <div id="left-content" class="span6"></div>
-    <div id="right-content" class="span6"></div>
+  <div class="content-area two-pane">
+    <div id="left-content" class="span6 window-resizeable"></div>
+    <div id="right-content" class="span6 window-resizeable"></div>
   </div>
 </div>
-

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/templates/layouts/with_sidebar.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/with_sidebar.html b/app/templates/layouts/with_sidebar.html
index 4eba634..7fc64db 100644
--- a/app/templates/layouts/with_sidebar.html
+++ b/app/templates/layouts/with_sidebar.html
@@ -14,10 +14,10 @@ the License.
 
 
 <div id="primary-navbar"></div>
-<div id="dashboard" class="container-fluid">
-  <header class="fixed-header">
-    <div id="breadcrumbs"></div>
-    <div id="api-navbar"></div>
+<div id="dashboard" class="container-fluid with-sidebar">
+  <header class="fixed-header row-fluid">
+    <div id="breadcrumbs" class="sidebar"></div>
+    <div id="api-navbar" class="window-resizeable"></div>
   </header>
 
   <div class="with-sidebar content-area">

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/templates/layouts/with_tabs.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/with_tabs.html b/app/templates/layouts/with_tabs.html
index fc372ff..074385f 100644
--- a/app/templates/layouts/with_tabs.html
+++ b/app/templates/layouts/with_tabs.html
@@ -15,10 +15,11 @@ the License.
 <div id="primary-navbar"></div>
 <div id="dashboard" class="container-fluid">
 
-  <div class="fixed-header">
-    <div id="breadcrumbs"></div>
-    <div id="api-navbar"></div>
-  </div>
+  <header class="fixed-header row-fluid">
+    <div id="breadcrumbs" class="sidebar"></div>
+    <div id="api-navbar" class="window-resizeable"></div>
+  </header>
+
 
   <div class="row-fluid content-area">
   	<div id="tabs" class="row-fluid"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/app/templates/layouts/with_tabs_sidebar.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/with_tabs_sidebar.html b/app/templates/layouts/with_tabs_sidebar.html
index a0ed03d..de4bdee 100644
--- a/app/templates/layouts/with_tabs_sidebar.html
+++ b/app/templates/layouts/with_tabs_sidebar.html
@@ -13,17 +13,14 @@ the License.
 -->
 
 <div id="primary-navbar"></div>
-<div id="dashboard" class="container-fluid">
+<div id="dashboard" class="container-fluid with-sidebar">
 
-  <header class="fixed-header">
-    <div id="breadcrumbs"></div>
-    <div id="api-navbar"></div>
+  <header class="fixed-header row-fluid">
+    <div id="breadcrumbs" class="sidebar"></div>
+    <div id="api-navbar" class="window-resizeable"></div>
   </header>
 
   <div class="with-sidebar content-area">
-
-    <div id="tabs" class="row-fluid"></div>
-
     <aside id="sidebar-content" class="sidebar"></aside>
 
     <section id="dashboard-content" class="list pull-right window-resizeable">

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/assets/img/couchWatermark.png
----------------------------------------------------------------------
diff --git a/assets/img/couchWatermark.png b/assets/img/couchWatermark.png
new file mode 100644
index 0000000..cab9ce4
Binary files /dev/null and b/assets/img/couchWatermark.png differ


[10/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
fix test

travis was green but outdated


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/3628fe5e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/3628fe5e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/3628fe5e

Branch: refs/heads/secondary-indexes
Commit: 3628fe5e9b7381fa9a3311f68353e3b990f2cb68
Parents: 2da1d54
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Mon Aug 18 20:59:27 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon Aug 18 21:13:41 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/tests/viewsSpec.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/3628fe5e/app/addons/documents/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/viewsSpec.js b/app/addons/documents/tests/viewsSpec.js
index 44e4843..df3abf7 100644
--- a/app/addons/documents/tests/viewsSpec.js
+++ b/app/addons/documents/tests/viewsSpec.js
@@ -35,9 +35,9 @@ define([
       collection: database.allDocs
     });
 
-    beforeEach(function () {
+    beforeEach(function (done) {
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(view);
+      viewSandbox.renderView(view, done);
     });
 
     afterEach(function () {


[30/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
fix semi colon and alldocs select in header


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/da970d43
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/da970d43
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/da970d43

Branch: refs/heads/secondary-indexes
Commit: da970d43371d04b48563120be304ed0c5b6da283
Parents: effbe5e
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:35 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/templates/header_alldocs.html | 3 +++
 app/addons/documents/views-sidebar.js              | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/da970d43/app/addons/documents/templates/header_alldocs.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html
index 3434dde..36d62f8 100644
--- a/app/addons/documents/templates/header_alldocs.html
+++ b/app/addons/documents/templates/header_alldocs.html
@@ -26,6 +26,9 @@ the License.
   <div id="header-search" class="js-search searchbox-container"></div>
 
   <!-- Select toggle -->
+  <div id="header-select-menu"></div>
+
   <div id="header-select-all" class="button">
     <span class="toggle-select-menu icon fonticon-ok-circled">Select</span>
   </div>
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/da970d43/app/addons/documents/views-sidebar.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-sidebar.js b/app/addons/documents/views-sidebar.js
index ab6012c..3b970cb 100644
--- a/app/addons/documents/views-sidebar.js
+++ b/app/addons/documents/views-sidebar.js
@@ -38,7 +38,7 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
         this.ddocID = options.ddocInfo.id;
         this.currView = options.ddocInfo.currView;
       }
-      FauxtonAPI.Events.on('database:delete', this.showDeleteDatabaseModal)
+      FauxtonAPI.Events.on('database:delete', this.showDeleteDatabaseModal);
     },
     showDeleteDatabaseModal: function(event){
       this.deleteDBModal.showModal();


[26/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Changes header (not styled)
Left header is now a reusable component
Header stuff
placeholder graphic
Messed up folders
Fix design doc selector
Fixes for the header


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/f719ed13
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/f719ed13
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/f719ed13

Branch: refs/heads/secondary-indexes
Commit: f719ed13e7327b9a94b6313cb85007ee2b62c5a2
Parents: 14bb0f2
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:35 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/assets/less/changes.less   |   3 -
 app/addons/documents/assets/less/documents.less |   1 -
 app/addons/documents/assets/less/headers.less   |   6 +-
 app/addons/documents/routes.js                  | 161 +++++++++----
 app/addons/documents/templates/changes.html     |   4 +-
 .../documents/templates/header_alldocs.html     |  23 +-
 app/addons/documents/views-changes.js           |  26 ++-
 app/addons/documents/views-sidebar.js           |   2 +-
 app/addons/documents/views.js                   |  13 +-
 app/addons/fauxton/components.js                |  53 ++++-
 app/addons/fauxton/templates/header_left.html   |  17 ++
 .../assets/less/new-index-placeholder.less      |   2 +-
 app/addons/indexes/less/indexes.less            |  13 --
 .../indexes/less/new-index-placeholder.less     |   3 -
 app/addons/indexes/routes-list.js               |  65 ++++--
 app/addons/indexes/routes-show.js               |  69 ++++--
 app/addons/indexes/routes-viewindexes.js        |  75 ++++--
 .../indexes/templates/design_doc_selector.html  |  44 ++--
 app/addons/indexes/templates/header_left.html   |  17 --
 app/addons/indexes/templates/header_right.html  |   6 +-
 app/addons/indexes/templates/index_header.html  |  28 ---
 .../indexes/templates/preview_screen.html       |   2 +
 app/addons/indexes/views.js                     | 227 +++++++++----------
 assets/less/fauxton.less                        |   1 +
 assets/less/headers.less                        | 116 ++++++++++
 assets/less/templates.less                      | 100 --------
 26 files changed, 636 insertions(+), 441 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/documents/assets/less/changes.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/changes.less b/app/addons/documents/assets/less/changes.less
index ebd395a..4bd86b7 100644
--- a/app/addons/documents/assets/less/changes.less
+++ b/app/addons/documents/assets/less/changes.less
@@ -19,9 +19,6 @@
   right: 15px;
 }
 
-.changes-view {
-  padding-top: 70px;
-}
 
 .change-wrapper {
   margin-top: 20px;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index 26e3ffa..5a39fab 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -17,7 +17,6 @@
 @import "advancedOptions.less";
 @import "changes.less";
 @import "sidenav.less";
-@import "headers.less";
 
 tr.all-docs-item {
   border: none;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/documents/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/headers.less b/app/addons/documents/assets/less/headers.less
index 3df552c..31faef1 100644
--- a/app/addons/documents/assets/less/headers.less
+++ b/app/addons/documents/assets/less/headers.less
@@ -1,7 +1,3 @@
-.header-left {
-  width: 300px;
-  float: left;
-}
 .header-right {
   .searchbox-container {
     position: relative;
@@ -22,4 +18,4 @@
       color: #999;
     }
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index bd52fb8..c1d61bd 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -26,8 +26,10 @@ define([
   "addons/fauxton/components"
 ],
 
-function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases, Resources) {
-
+function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases, Resources, Components) {
+  /* --------------------------------------------------
+    DOCUMENT EDITOR ROUTE OBJECT
+  ----------------------------------------------------*/
   var DocEditorRouteObject = FauxtonAPI.RouteObject.extend({
     layout: "one_pane",
     disableLoader: true,
@@ -102,6 +104,10 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
     }
   });
 
+  /* --------------------------------------------------
+    NEW DOCUMENT EDITOR ROUTE OBJECT (for new documents)
+  ----------------------------------------------------*/
+
   var NewDocEditorRouteObject = DocEditorRouteObject.extend({
     initialize: function (route, masterLayout, options) {
       var databaseName = options[0];
@@ -126,6 +132,10 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
 
   });
 
+
+  /* --------------------------------------------------
+    ALL DOCS, METADATA AND CHANGES ROUTE OBJECT
+  ----------------------------------------------------*/
   var DocumentsRouteObject = FauxtonAPI.RouteObject.extend({
     layout: "with_tabs_sidebar",
     selectedHeader: "Databases",
@@ -154,11 +164,14 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
 
     initialize: function (route, masterLayout, options) {
       this.databaseName = options[0];
-
+      /* --------------------------------------------------
+        Set up Resources for the current database
+          &
+        get all design docs
+      ----------------------------------------------------*/
       this.data = {
         database: new Databases.Model({id:this.databaseName})
       };
-
       this.data.designDocs = new Documents.AllDocs(null, {
         database: this.data.database,
         paging: {
@@ -172,10 +185,17 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
         }
       });
 
-      this.header = this.setView("#breadcrumbs", new Documents.Views.AllDocsHeader({
-        database: this.data.database
-      }));
 
+      /* --------------------------------------------------
+        Show right header for all docs that includes:
+        query options, api bar, search and select
+      ----------------------------------------------------*/
+      this.changesHeader = true;
+      this.setAllDocsHeader();
+
+      /* --------------------------------------------------
+        Show the sidebar
+      ----------------------------------------------------*/
 
       this.sidebar = this.setView("#sidebar-content", new Documents.Views.Sidebar({
         collection: this.data.designDocs,
@@ -183,26 +203,34 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       }));
     },
 
-    designDocMetadata:  function(database, ddoc){
-      this.viewEditor && this.viewEditor.remove();
+    setAllDocsHeader: function(){
+      if (this.changesHeader){
+        this.headerRight = this.setView("#api-navbar", new Documents.Views.RightAllDocsHeader({
+          database: this.data.database
+        }));
+        this.changesHeader = false;
+      }
+    },
 
+    designDocMetadata:  function(database, ddoc){
       var designDocInfo = new Resources.DdocInfo({_id: "_design/"+ddoc},{database: this.data.database });
 
+      /* --------------------------------------------------
+        Show design doc metadata
+      ----------------------------------------------------*/
       this.setView("#dashboard-lower-content", new Documents.Views.DdocInfo({
         ddocName: ddoc,
         model: designDocInfo
       }));
-
+      /* --------------------------------------------------
+        Set selected tab
+      ----------------------------------------------------*/
       this.sidebar.setSelectedTab(app.utils.removeSpecialCharacters(ddoc)+"_metadata");
 
-      this.crumbs = function () {
-        return [
-          {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
-          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
-        ];
-      };
-
-      this.apiUrl = [designDocInfo.url('apiurl'), designDocInfo.documentation() ];
+      /* --------------------------------------------------
+        Update the apiUrl
+      ----------------------------------------------------*/
+      this.headerRight.updateApiUrl([designDocInfo.url('apiurl'), designDocInfo.documentation()]);
 
     },
 
@@ -235,18 +263,59 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
         return;
       }
 
+
+      /* --------------------------------------------------
+        Set up breadcrumb header
+      ----------------------------------------------------*/
+      var crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
+        {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)}
+      ];
+
+      var dropdown = [{
+        links: [{
+          title: 'Duplicate Index',
+          icon: 'fonticon-documents'
+        },{
+          title: 'Delete',
+          icon: 'fonticon-trash'
+        }]
+      }];
+
+      this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
+        crumbs: crumbs,
+        dropdownMenu: dropdown
+      }));
+
+      /*--------------------------------------------------
+      reset header if you have to
+      ----------------------------------------------------*/
+      this.setAllDocsHeader();
+
+      /* --------------------------------------------------
+        Build all docs
+      ----------------------------------------------------*/
+
       this.data.database.buildAllDocs(docParams);
 
+      /* --------------------------------------------------
+        Set sidebar highlight to all docs or design docs
+      ----------------------------------------------------*/
       if (docParams.startkey && docParams.startkey.indexOf('_design') > -1) {
         this.sidebar.setSelectedTab('design-docs');
       } else {
         this.sidebar.setSelectedTab('all-docs');
       }
 
-      this.viewEditor && this.viewEditor.remove();
+      /* --------------------------------------------------
+        Set page size
+      ----------------------------------------------------*/
 
       this.data.database.allDocs.paging.pageSize = this.getDocPerPageLimit(urlParams, parseInt(docParams.limit, 10));
 
+      /* --------------------------------------------------
+        Show all docs
+      ----------------------------------------------------*/
       this.documentsView = this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
         database: this.data.database,
         collection: this.data.database.allDocs,
@@ -255,12 +324,10 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
         bulkDeleteDocsCollection: new Documents.BulkDeleteDocCollection([], {databaseId: this.data.database.get('id')})
       }));
 
-      this.crumbs = [
-        {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
-        {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)}
-      ];
-
-      this.apiUrl = [this.data.database.allDocs.urlRef("apiurl", urlParams), this.data.database.allDocs.documentation() ];
+      /* --------------------------------------------------
+        update the api url
+      ----------------------------------------------------*/
+      this.headerRight.updateApiUrl([this.data.database.allDocs.urlRef("apiurl", urlParams), this.data.database.allDocs.documentation()]);
     },
 
 
@@ -309,7 +376,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       this.documentsView.setParams(docParams, urlParams);
       this.documentsView.forceRender();
 
-      this.apiUrl = [collection.urlRef("apiurl", urlParams), "docs"];
+      this.headerRight.updateApiUrl([collection.urlRef("apiurl", urlParams), "docs"]);
     },
 
     perPageChange: function (perPage) {
@@ -366,34 +433,48 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
     changes: function () {
       var docParams = app.getParams();
       this.data.database.buildChanges(docParams);
+      /* --------------------------------------------------
+        Set changes view
+      ----------------------------------------------------*/
 
       this.changesView = this.setView("#dashboard-lower-content", new Changes.Changes({
         model: this.data.database
       }));
 
+      /* --------------------------------------------------
+        Set up right header
+      ----------------------------------------------------*/
+
       this.filterView = new Components.FilterView({
         eventNamespace: "changes"
       });
-      this.headerView = this.setView("#dashboard-upper-content", new Changes.ChangesHeader({
-        filterView: this.filterView
+
+      this.headerView = this.setView("#api-navbar", new Changes.ChangesHeader({
+        filterView: this.filterView,
+        endpoint: this.data.database.url("apiurl"),
+        documentation: this.data.database.documentation()
       }));
 
+      this.changesHeader = true;
 
-      this.viewEditor && this.viewEditor.remove();
+      /* --------------------------------------------------
+        Set sidebar highlight
+      ----------------------------------------------------*/
 
       this.sidebar.setSelectedTab('changes');
 
-      this.crumbs = function () {
-        return [
-          {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
-          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
-          {"name": "_changes", "link": "/_changes"}
-        ];
-      };
-
-      this.apiUrl = function() {
-        return [this.data.database.url("changes-apiurl"), this.data.database.documentation()];
-      };
+      /* --------------------------------------------------
+        Set up breadcrumb header
+      ----------------------------------------------------*/
+      var crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
+        {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
+        {"name": "_changes", "link": "/_changes"}
+      ];
+      /* Set up breadcrumb header */
+      this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
+        crumbs: crumbs
+      }));
     },
 
     addFilter: function (filter) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/documents/templates/changes.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/changes.html b/app/addons/documents/templates/changes.html
index a9bfbaf..15330c9 100644
--- a/app/addons/documents/templates/changes.html
+++ b/app/addons/documents/templates/changes.html
@@ -11,7 +11,7 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-<div class="changes-view">
+
   <% _.each(changes, function (change) { %>
     <div class="change-wrapper">
       <div class="change-box">
@@ -66,4 +66,4 @@ the License.
       </div>
     </div>
   <% }); %>
-</div>
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/documents/templates/header_alldocs.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html
index dfdfc03..d83cb08 100644
--- a/app/addons/documents/templates/header_alldocs.html
+++ b/app/addons/documents/templates/header_alldocs.html
@@ -12,29 +12,14 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<div class="header-left">
-  <!--back arrow-->
-   
-  <!--title with dropdown DB search-->
-  <h2><%-database%></h2>
-   
-  <!-- Menu gear-->
-</div>
- 
- 
-<div class="header-right">
   <!-- Select all -->
-   
+
   <!-- search (jump to doc)-->
   <div id="header-search" class="js-search searchbox-container"></div>
-   
+
   <!-- Query Options-->
   <div class="header-query-options">
     <!-- Insert the query options here :) -->
-    <div id="query-options">
-    </div>
+    <div id="query-options"></div>
+    <div id="header-api-bar"></div>
   </div>
- 
-</div>
- 
-<!--right margin for api bar-->
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/documents/views-changes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-changes.js b/app/addons/documents/views-changes.js
index fad88b9..d63a825 100644
--- a/app/addons/documents/views-changes.js
+++ b/app/addons/documents/views-changes.js
@@ -27,25 +27,27 @@ function(app, FauxtonAPI, resizeColumns, Components, prettify, ZeroClipboard) {
   var Views = {};
 
   Views.ChangesHeader = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/changes_header",
+    template: "addons/documents/templates/header_alldocs",
+    initialize: function (options) {
+      this.filterView = options.filterView;
+      this.endpoint = options.endpoint;
+      this.documentation = options.documentation;
 
-    events: {
-      'click .js-toggle-filter': "toggleQuery"
-    },
-
-    toggleQuery: function (event) {
-      $('#dashboard-content').scrollTop(0);
-      this.$('#query').toggle('slow');
     },
-
-    initialize: function () {
-      this.setView(".js-filter", this.filterView);
+    beforeRender: function(){
+      this.setView("#header-search", this.filterView);
+
+      //Moved the apibar view into the components file so you can include it in your views
+      this.apiBar = this.insertView("#header-api-bar", new Components.ApiBar({
+        endpoint: this.endpoint,
+        documentation: this.documentation
+      }));
     }
   });
 
   Views.Changes = Components.FilteredView.extend({
+    className: "changes-view",
     template: "addons/documents/templates/changes",
-
     initialize: function () {
       this.listenTo(this.model.changes, 'sync', this.render);
       this.listenTo(this.model.changes, 'cachesync', this.render);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/documents/views-sidebar.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-sidebar.js b/app/addons/documents/views-sidebar.js
index 2c53b1b..8592dc1 100644
--- a/app/addons/documents/views-sidebar.js
+++ b/app/addons/documents/views-sidebar.js
@@ -190,7 +190,7 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
 
         menuLinks.push({
           title: link.title,
-          url: "#" + database.url('app') + "/_design/" + docSafe + "/" + link.url,
+          url: "#" + database.url('app')+ "/" + link.url + "/" + docSafe,
           icon: 'fonticon-plus-circled'
         });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index dedb897..62073d5 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -39,8 +39,9 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     });
   }
 
-  //Header for alldocs with search, back, Menu, Query options, select etc
-  Views.AllDocsHeader = FauxtonAPI.View.extend({
+  //Header for alldocs with search, Query options,& api bar
+  Views.RightAllDocsHeader = FauxtonAPI.View.extend({
+    className: "header-right",
     template: "addons/documents/templates/header_alldocs",
     events: {
       'select .selectAllDocs': 'selectAllDocs'
@@ -52,6 +53,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     selectAllDocs: function(){
       //trigger event to select all in other view
     },
+    updateApiUrl: function(api){
+      //this will update the api bar when the route changes
+      //you can find the method that updates it in components.js Components.ApiBar()
+      this.apiBar && this.apiBar.update(api);
+    },
     serialize: function() {
       //basically if you want something in a template, You can define it here
       return {
@@ -97,6 +103,9 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
         showPreview: false,
       }));
 
+      //Moved the apibar view into the components file so you can include it in your views
+      this.apiBar = this.insertView("#header-api-bar", new Components.ApiBar({}));
+
     },
     //moved from alldocs layout
     updateAllDocs: function (event, paramInfo) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index c92a7ce..18ea5b8 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -35,6 +35,40 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
   var Components = FauxtonAPI.addon();
 
 
+  //setting up the left header with the backbutton used in Views and All docs
+  Components.LeftHeader = FauxtonAPI.View.extend({
+    className: "header-left",
+    template: "addons/fauxton/templates/header_left",
+    initialize:function(options){
+      this.dropdownMenuLinks = options.dropdownMenu;
+      this.crumbs = options.crumbs || [];
+    },
+    updateCrumbs: function(crumbs){
+      this.breadcrumbs && this.breadcrumbs.update(crumbs);
+    },
+    updateDropdown: function(menuLinks){
+      this.dropdown && this.dropdown.update(menuLinks);
+    },
+    beforeRender: function(){
+      this.setUpCrumbs();
+      this.setUpDropDownMenu();
+    },
+    setUpCrumbs: function(){
+      this.breadcrumbs = this.insertView("#header-breadcrumbs", new Components.Breadcrumbs({
+        crumbs: this.crumbs
+      }));
+    },
+    setUpDropDownMenu: function(){
+      if (this.dropdownMenuLinks){
+        this.dropdown = this.insertView("#header-dropdown-menu", new Components.MenuDropDown({
+          icon: 'fonticon-cog',
+          links: this.dropdownMenuLinks,
+        }));
+      }
+    }
+  });
+
+
   Components.Breadcrumbs = FauxtonAPI.View.extend({
     className: "breadcrumb pull-left",
     tagName: "ul",
@@ -45,7 +79,10 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
         crumbs: crumbs
       };
     },
-
+    update: function(crumbs) {
+      this.crumbs = crumbs;
+      this.render();
+    },
     initialize: function(options) {
       this.crumbs = options.crumbs;
     }
@@ -53,14 +90,16 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
 
   Components.ApiBar = FauxtonAPI.View.extend({
     template: "addons/fauxton/templates/api_bar",
-    endpoint: '_all_docs',
-
-    documentation: 'docs',
-
     events:  {
       "click .api-url-btn" : "toggleAPIbar"
     },
 
+    initialize: function(options){
+      var _options = options || {};
+      this.endpoint = _options.endpoint || '_all_docs';
+      this.documentation = _options.documentation || 'docs';
+    },
+
     toggleAPIbar: function(e){
       var $currentTarget = $(e.currentTarget).find('span');
       if ($currentTarget.hasClass("fonticon-plus")){
@@ -703,6 +742,10 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
       this.links = options.links;
       this.icon = options.icon || "fonticon-plus-circled2";
     },
+    update: function(links){
+      this.links = links;
+      this.render();
+    },
     serialize: function(){
       return {
         links: this.links,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/fauxton/templates/header_left.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/header_left.html b/app/addons/fauxton/templates/header_left.html
new file mode 100644
index 0000000..13bea60
--- /dev/null
+++ b/app/addons/fauxton/templates/header_left.html
@@ -0,0 +1,17 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+<!--back arrow-->
+<div id="header-breadcrumbs"></div>
+  <!-- Menu gear-->
+<div id="header-dropdown-menu"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/assets/less/new-index-placeholder.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/assets/less/new-index-placeholder.less b/app/addons/indexes/assets/less/new-index-placeholder.less
index 6336771..ade1d3a 100644
--- a/app/addons/indexes/assets/less/new-index-placeholder.less
+++ b/app/addons/indexes/assets/less/new-index-placeholder.less
@@ -12,7 +12,7 @@
 .watermark-logo {
   background: transparent url('../img/couchWatermark.png') no-repeat 50% 50%;
   min-height: 400px;
-  padding-top: 80%;
+  padding-top: 60%;
   text-align: center;
   h3 {
     border-bottom: 1px solid #ccc;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/less/indexes.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/less/indexes.less b/app/addons/indexes/less/indexes.less
deleted file mode 100644
index d526ee9..0000000
--- a/app/addons/indexes/less/indexes.less
+++ /dev/null
@@ -1,13 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-@import "new-index-placeholder.less";

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/less/new-index-placeholder.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/less/new-index-placeholder.less b/app/addons/indexes/less/new-index-placeholder.less
deleted file mode 100644
index 3f5db0e..0000000
--- a/app/addons/indexes/less/new-index-placeholder.less
+++ /dev/null
@@ -1,3 +0,0 @@
-.watermark-logo {
-  background: transparent url(../img/couchWatermark.png') no-repeat 0 0;
-}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/routes-list.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-list.js b/app/addons/indexes/routes-list.js
index 1245c24..437cef6 100644
--- a/app/addons/indexes/routes-list.js
+++ b/app/addons/indexes/routes-list.js
@@ -16,10 +16,11 @@ define([
   "addons/indexes/views",
   "addons/documents/views",
   "addons/indexes/resources",
-  "addons/indexes/routes-core"
+  "addons/indexes/routes-core",
+  "addons/fauxton/components"
 ],
 
-function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
+function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore, Components) {
 
   var ListIndexes = RouteCore.extend({
     routes: {
@@ -39,6 +40,9 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
     newListsEditor: function (database, designDoc) {
       var params = app.getParams();
 
+      /* --------------------------------------------------
+        Insert View Editor for new list
+      ----------------------------------------------------*/
       this.setView("#left-content", new Views.ListEditor({
         model: this.data.database,
         currentddoc: designDoc ? "_design/"+designDoc : "",
@@ -47,23 +51,56 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
         database: this.data.database,
         newView: true
       }));
-
+      /* --------------------------------------------------
+        Insert Preview Screen View
+      ----------------------------------------------------*/
       this.setView("#right-content", new Views.PreviewScreen({}));
-      this.crumbs = function () {
-        return [
-          {"name": "Create List Index", "link": Databases.databaseUrl(this.data.database)},
-        ];
-      };
+
+      /* --------------------------------------------------
+        Set up & Insert breadcrumb header
+      ----------------------------------------------------*/
+      var crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": Databases.databaseUrl(this.data.database)},
+        {"name": "Create a List Index", "link": Databases.databaseUrl(this.data.database)}
+      ];
+      this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
+        crumbs: crumbs
+      }));
     },
-    tempFn:  function(databaseName, ddoc, fn){
+    tempFn:  function(databaseName, ddoc, view){
+      /* --------------------------------------------------
+        Set up breadcrumb header
+      ----------------------------------------------------*/
+      var crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": Databases.databaseUrl(this.data.database)},
+        {"name": view, "link": Databases.databaseUrl(this.data.database)}
+      ];
+
+      var dropdown = [{
+        links: [{
+          title: 'Duplicate Index',
+          icon: 'fonticon-documents'
+        },{
+          title: 'Delete',
+          icon: 'fonticon-trash'
+        }]
+      }];
+
+      this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
+        crumbs: crumbs,
+        dropdownMenu: dropdown
+      }));
+
+
+      /* --------------------------------------------------
+        Insert List Editor
+      ----------------------------------------------------*/
       this.setView("#left-content", new Views.ListEditor({}));
 
+      /* --------------------------------------------------
+        Insert Preview Screen View
+      ----------------------------------------------------*/
       this.setView("#right-content", new Views.PreviewScreen({}));
-      this.crumbs = function () {
-        return [
-          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
-        ];
-      };
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/routes-show.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-show.js b/app/addons/indexes/routes-show.js
index 10a3a56..73f52d1 100644
--- a/app/addons/indexes/routes-show.js
+++ b/app/addons/indexes/routes-show.js
@@ -16,10 +16,11 @@ define([
   "addons/indexes/views",
   "addons/documents/views",
   "addons/indexes/resources",
-  "addons/indexes/routes-core"
+  "addons/indexes/routes-core",
+   "addons/fauxton/components"
 ],
 
-function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
+function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore, Components) {
 
   var ShowIndexes = RouteCore.extend({
     routes: {
@@ -33,7 +34,9 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
 
     newShowEditor: function (database, designDoc) {
       var params = app.getParams();
-
+      /* --------------------------------------------------
+        Insert View Editor for new view
+      ----------------------------------------------------*/
       this.setView("#left-content", new Views.ShowEditor({
         model: this.data.database,
         currentddoc: designDoc ? "_design/"+designDoc : "",
@@ -43,28 +46,56 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
         newView: true
       }));
 
+      /* --------------------------------------------------
+        Insert Preview Screen View
+      ----------------------------------------------------*/
       this.setView("#right-content", new Views.PreviewScreen({}));
-      this.crumbs = function () {
-        return [
-          {"name": "Create Show Index", "link": Databases.databaseUrl(this.data.database)},
-        ];
-      };
-    },
 
-    apiUrl: function() {
-      //TODO: Hook up proper API urls
-      return '';
+      /* --------------------------------------------------
+        Set up & Insert breadcrumb header
+      ----------------------------------------------------*/
+      var crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": Databases.databaseUrl(this.data.database)},
+        {"name": "Create a Show Index", "link": Databases.databaseUrl(this.data.database)}
+      ];
+      this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
+        crumbs: crumbs
+      }));
     },
+    tempFn:  function(databaseName, ddoc, view){
+      /* --------------------------------------------------
+        Set up breadcrumb header
+      ----------------------------------------------------*/
+      var crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": Databases.databaseUrl(this.data.database)},
+        {"name": view, "link": Databases.databaseUrl(this.data.database)}
+      ];
+
+      var dropdown = [{
+        links: [{
+          title: 'Duplicate Index',
+          icon: 'fonticon-documents'
+        },{
+          title: 'Delete',
+          icon: 'fonticon-trash'
+        }]
+      }];
+
+      this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
+        crumbs: crumbs,
+        dropdownMenu: dropdown
+      }));
+
 
-    tempFn:  function(databaseName, ddoc, fn){
-      this.setView("#left-content", new Views.ShowEditor({}));
+      /* --------------------------------------------------
+        Insert Show Editor
+      ----------------------------------------------------*/
+      this.setView("#left-content", new Views.ListEditor({}));
 
+      /* --------------------------------------------------
+        Insert Preview Screen View
+      ----------------------------------------------------*/
       this.setView("#right-content", new Views.PreviewScreen({}));
-      this.crumbs = function () {
-        return [
-          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
-        ];
-      };
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/routes-viewindexes.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-viewindexes.js b/app/addons/indexes/routes-viewindexes.js
index de53981..7330d04 100644
--- a/app/addons/indexes/routes-viewindexes.js
+++ b/app/addons/indexes/routes-viewindexes.js
@@ -16,10 +16,11 @@ define([
   "addons/indexes/views",
   "addons/documents/views",
   "addons/indexes/resources",
-  "addons/indexes/routes-core"
+  "addons/indexes/routes-core",
+  "addons/fauxton/components"
 ],
 
-function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
+function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore, Components) {
 
   var ViewIndexes = RouteCore.extend({
     routes: {
@@ -33,10 +34,19 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
 
     newViewEditor: function (database, designDoc) {
       var params = app.getParams();
+      /* --------------------------------------------------
+        remove right header
+      ----------------------------------------------------*/
       this.rightheader && this.rightheader.remove();
 
+      /* --------------------------------------------------
+        Insert Preview Screen View
+      ----------------------------------------------------*/
       this.setView("#right-content", new Views.PreviewScreen({}));
 
+      /* --------------------------------------------------
+        Insert View Editor for new view
+      ----------------------------------------------------*/
       this.viewEditor = this.setView("#left-content", new Views.ViewEditor({
         model: this.data.database,
         currentddoc: designDoc ? "_design/"+designDoc : "",
@@ -46,9 +56,15 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
         newView: true
       }));
 
-      this.leftheader = this.setView("#breadcrumbs", new Views.LeftHeader({
-        title:"Create a View Index",
-        database: this.data.database
+      /* --------------------------------------------------
+        Set up & Insert breadcrumb header
+      ----------------------------------------------------*/
+      var crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": Databases.databaseUrl(this.data.database)},
+        {"name": "Create a View Index", "link": Databases.databaseUrl(this.data.database)}
+      ];
+      this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
+        crumbs: crumbs
       }));
 
     },
@@ -60,15 +76,32 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
           decodeDdoc = decodeURIComponent(ddoc);
           view = view.replace(/\?.*$/,'');
 
-      this.leftheader = this.setView("#breadcrumbs", new Views.LeftHeader({
-        title: view,
-        database: this.data.database
-      }));
+      /* --------------------------------------------------
+        Set up breadcrumb header
+      ----------------------------------------------------*/
+      var crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": Databases.databaseUrl(this.data.database)},
+        {"name": view, "link": Databases.databaseUrl(this.data.database)}
+      ];
+
+      var dropdown = [{
+        links: [{
+          title: 'Duplicate Index',
+          icon: 'fonticon-documents'
+        },{
+          title: 'Delete',
+          icon: 'fonticon-trash'
+        }]
+      }];
 
-      this.rightheader = this.setView("#api-bar", new Views.RightHeader({
-        database: this.data.database
+      this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
+        crumbs: crumbs,
+        dropdownMenu: dropdown
       }));
 
+      /* --------------------------------------------------
+        Set up Index Collection
+      ----------------------------------------------------*/
       this.data.indexedDocs = new Resources.IndexCollection(null, {
         database: this.data.database,
         design: decodeDdoc,
@@ -79,6 +112,21 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
         }
       });
 
+
+      /* --------------------------------------------------
+        Set up right header
+      ----------------------------------------------------*/
+
+      this.rightheader = this.setView("#api-navbar", new Views.RightHeader({
+        database: this.data.database,
+        model: this.data.database,
+        endpoint: this.data.indexedDocs.urlRef("apiurl", urlParams),
+        documentation: "docs"
+      }));
+
+      /* --------------------------------------------------
+        Insert View Editor
+      ----------------------------------------------------*/
       this.viewEditor = this.setView("#left-content", new Views.ViewEditor({
         model: this.data.database,
         ddocs: this.data.designDocs,
@@ -89,6 +137,9 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
         ddocInfo: this.ddocInfo(decodeDdoc, this.data.designDocs, view)
       }));
 
+      /* --------------------------------------------------
+        Insert Docs returned from view
+      ----------------------------------------------------*/
       this.documentsView = this.createViewDocumentsView({
         designDoc: decodeDdoc,
         docParams: docParams,
@@ -98,8 +149,6 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
         designDocs: this.data.designDocs,
         view: view
       });
-
-      this.apiUrl = [this.data.indexedDocs.urlRef("apiurl", urlParams), "docs"];
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/templates/design_doc_selector.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/design_doc_selector.html b/app/addons/indexes/templates/design_doc_selector.html
index 98abc46..7d58116 100644
--- a/app/addons/indexes/templates/design_doc_selector.html
+++ b/app/addons/indexes/templates/design_doc_selector.html
@@ -11,28 +11,26 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-<div class="span3">
-  <label for="ddoc">Save to Design Document <a class="help-link" href="<%-getDocUrl('design_doc')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
-  <select id="ddoc">
-    <optgroup label="Select a document">
-      <option value="new-doc">New document</option>
+<label for="ddoc">Save to Design Document <a class="help-link" data-bypass="true" href="<%-getDocUrl('design_doc')%>" target="_blank"><i class="icon-question-sign"></i></a></label>
+<div class="row-fluid new-ddoc">
+  <div class="select-wrapper span5">
+    <select id="ddoc">
+      <optgroup label="Select a document">
+        <option value="new-doc">New document</option>
 
-      <% ddocs.each(function(ddoc) { %>
-      <%= ddoc.id %>
-      <%= ddocName %>
-      <% if (ddoc.id === ddocName) { %>
-      <option selected="selected" value="<%- ddoc.id %>"><%- ddoc.id %></option>
-      <% } else { %>
-      <option value="<%- ddoc.id %>"><%- ddoc.id %></option>
-      <% } %>
-      <% }); %>
-    </optgroup>
-  </select>
-</div>
-
-<div id="new-ddoc-section" class="span5" style="display:none">
-  <label class="control-label" for="new-ddoc"> _design/ </label>
-  <div class="controls">
-    <input type="text" id="new-ddoc" placeholder="newDesignDoc" />
+        <% ddocs.each(function(ddoc) { %>
+        <%= ddoc.id %>
+        <%= ddocName %>
+        <% if (ddoc.id === ddocName) { %>
+        <option selected="selected" value="<%- ddoc.id %>"><%- ddoc.id %></option>
+        <% } else { %>
+        <option value="<%- ddoc.id %>"><%- ddoc.id %></option>
+        <% } %>
+        <% }); %>
+      </optgroup>
+    </select>
+    <i></i>
   </div>
-</div>
\ No newline at end of file
+
+  <input type="text" id="new-ddoc" class="span7" style="display:none" placeholder="Enter a design doc name" />
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/templates/header_left.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/header_left.html b/app/addons/indexes/templates/header_left.html
deleted file mode 100644
index 13bea60..0000000
--- a/app/addons/indexes/templates/header_left.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->
-<!--back arrow-->
-<div id="header-breadcrumbs"></div>
-  <!-- Menu gear-->
-<div id="header-dropdown-menu"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/templates/header_right.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/header_right.html b/app/addons/indexes/templates/header_right.html
index 90828d2..8279bf6 100644
--- a/app/addons/indexes/templates/header_right.html
+++ b/app/addons/indexes/templates/header_right.html
@@ -11,8 +11,12 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-
   <!-- Query Options-->
+  <div id="header-select-all">
+    <span class="toggle-select-menu icon fonticon-ok-circled">Select</span>
+  </div>
+  <!-- Query Options-->
+  <div id="header-query-options"></div>
   <!--right margin for api bar-->
   <div id="header-api-bar"></div>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/templates/index_header.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/index_header.html b/app/addons/indexes/templates/index_header.html
deleted file mode 100644
index ac8ac56..0000000
--- a/app/addons/indexes/templates/index_header.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->
-
-<div class="header-left">
-<!--back arrow-->
-
-<!--title-->
-
-<!-- Menu gear-->
-
-</div>
-
-
-<div class="header-right">
-  <!-- Query Options-->
-  <!--right margin for api bar-->
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/templates/preview_screen.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/preview_screen.html b/app/addons/indexes/templates/preview_screen.html
index 1fcf6d9..a7de45b 100644
--- a/app/addons/indexes/templates/preview_screen.html
+++ b/app/addons/indexes/templates/preview_screen.html
@@ -13,4 +13,6 @@ the License.
 -->
 
 <h3>No Index Created Yet!</h3>
+<!--
 <p> Run <a href="#/preview" class="btn btn-success save"> Preview</a> To query result</p>
+-->

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
index 80e6a40..bfe209e 100644
--- a/app/addons/indexes/views.js
+++ b/app/addons/indexes/views.js
@@ -34,41 +34,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
   var Views = {};
 
-//left header
-  Views.LeftHeader = FauxtonAPI.View.extend({
-    className: "header-left",
-    template: "addons/indexes/templates/header_left",
-    initialize:function(options){
-      this.database = options.database;
-      this.title = options.title;
-    },
-    beforeRender: function(){
-      var crumbs = [
-        {"name": "", "className": "fonticon-left-open", "link": Databases.databaseUrl(this.database)},
-        {"name": this.title, "link": Databases.databaseUrl(this.database)}
-      ];
-      this.insertView("#header-breadcrumbs", new Components.Breadcrumbs({
-        crumbs: crumbs
-      }));
-      this.dropDownMenu();
-    },
-    dropDownMenu: function(){
-      var newLinks = [{
-        links: [{
-          title: 'Table',
-          icon: 'fonticon-table'
-        },{
-          title: 'JSON',
-          icon: 'fonticon-json'
-        }]
-      }];
-
-      this.insertView("#header-dropdown-menu", new Components.MenuDropDown({
-        icon: 'fonticon-cog',
-        links: newLinks,
-      }));
-    }
-  });
 
 //right header
   Views.RightHeader = FauxtonAPI.View.extend({
@@ -77,9 +42,116 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     initialize:function(options){
       this.database = options.database;
       this.title = options.title;
+      this.api = options.api;
+      this.endpoint = options.endpoint;
+      this.documentation = options.documentation;
+      this.eventer = _.extend({}, Backbone.Events);
+    },
+    updateApiUrl: function(api){
+      //this will update the api bar when the route changes
+      //you can find the method that updates it in components.js Components.ApiBar()
+      this.apiBar && this.apiBar.update(api);
     },
     beforeRender: function(){
-      this.insertView(".header-api-bar", new Components.ApiBar({}));
+
+      this.apiBar = this.insertView("#header-api-bar", new Components.ApiBar({
+        endpoint: this.endpoint,
+        documentation: this.documentation
+      }));
+
+      this.advancedOptions = this.insertView('#header-query-options', new QueryOptions.AdvancedOptions({
+        updateViewFn: this.updateView,
+        previewFn: this.previewView,
+        database: this.database,
+        viewName: this.viewName,
+        ddocName: this.model.id,
+        hasReduce: this.hasReduce(),
+        eventer: this.eventer,
+        showStale: true
+      }));
+    },
+    hasReduce: function(){
+
+    },
+    updateView: function(event, paramInfo) {
+       event.preventDefault();
+
+       var errorParams = paramInfo.errorParams,
+           params = paramInfo.params;
+
+       if (_.any(errorParams)) {
+         _.map(errorParams, function(param) {
+
+           // TODO: Where to add this error?
+           // bootstrap wants the error on a control-group div, but we're not using that
+           //$('form.view-query-update input[name='+param+'], form.view-query-update select[name='+param+']').addClass('error');
+           return FauxtonAPI.addNotification({
+             msg: "JSON Parse Error on field: "+param.name,
+             type: "error",
+             selector: ".advanced-options .errors-container",
+             clear: true
+           });
+         });
+         FauxtonAPI.addNotification({
+           msg: "Make sure that strings are properly quoted and any other values are valid JSON structures",
+           type: "warning",
+           selector: ".advanced-options .errors-container",
+           clear: true
+         });
+
+         return false;
+      }
+
+       var fragment = window.location.hash.replace(/\?.*$/, '');
+       if (!_.isEmpty(params)) {
+        fragment = fragment + '?' + $.param(params);
+       }
+
+       FauxtonAPI.navigate(fragment, {trigger: false});
+       FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: this.ddocID, view: this.viewName});
+    },
+
+
+    previewView: function(event, paramsInfo) {
+      event.preventDefault();
+      var that = this,
+      mapVal = this.mapVal(),
+      reduceVal = this.reduceVal(),
+      paramsArr = [];
+
+      if (paramsInfo && paramsInfo.params) {
+        paramsArr = paramsInfo.params;
+      }
+
+      var params = _.reduce(paramsArr, function (params, param) {
+        params[param.name] = param.value;
+        return params;
+      }, {reduce: false});
+
+      FauxtonAPI.addNotification({
+        msg: "<strong>Warning!</strong> Preview executes the Map/Reduce functions in your browser, and may behave differently from CouchDB.",
+        type: "warning",
+        selector: ".advanced-options .errors-container",
+        fade: true,
+        escape: false // beware of possible XSS when the message changes
+      });
+
+      var promise = FauxtonAPI.Deferred();
+
+      if (!this.database.allDocs || this.database.allDocs.params.include_docs !== true) {
+        this.database.buildAllDocs({limit: Databases.DocLimit.toString(), include_docs: true});
+        promise = this.database.allDocs.fetch();
+       } else {
+        promise.resolve();
+       }
+
+      promise.then(function () {
+        params.docs = that.database.allDocs.map(function (model) { return model.get('doc');});
+        var queryPromise = pouchdb.runViewQuery({map: mapVal, reduce: reduceVal}, params);
+        queryPromise.then(function (results) {
+          FauxtonAPI.triggerRouteEvent('updatePreviewDocs', {rows: results.rows, ddoc: that.getCurrentDesignDoc().id, view: that.viewName});
+        });
+      });
     }
   });
 
@@ -396,89 +468,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: ddocName, view: viewName});
     },
 
-    updateView: function(event, paramInfo) {
-       event.preventDefault();
-
-       if (this.newView) { return alert('Please save this new view before querying it.'); }
-
-       var errorParams = paramInfo.errorParams,
-           params = paramInfo.params;
-
-       if (_.any(errorParams)) {
-         _.map(errorParams, function(param) {
-
-           // TODO: Where to add this error?
-           // bootstrap wants the error on a control-group div, but we're not using that
-           //$('form.view-query-update input[name='+param+'], form.view-query-update select[name='+param+']').addClass('error');
-           return FauxtonAPI.addNotification({
-             msg: "JSON Parse Error on field: "+param.name,
-             type: "error",
-             selector: ".advanced-options .errors-container",
-             clear: true
-           });
-         });
-         FauxtonAPI.addNotification({
-           msg: "Make sure that strings are properly quoted and any other values are valid JSON structures",
-           type: "warning",
-           selector: ".advanced-options .errors-container",
-           clear: true
-         });
-
-         return false;
-      }
-
-       var fragment = window.location.hash.replace(/\?.*$/, '');
-       if (!_.isEmpty(params)) {
-        fragment = fragment + '?' + $.param(params);
-       }
-
-       FauxtonAPI.navigate(fragment, {trigger: false});
-       FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: this.ddocID, view: this.viewName});
-    },
-
-
-    previewView: function(event, paramsInfo) {
-      event.preventDefault();
-      var that = this,
-      mapVal = this.mapVal(),
-      reduceVal = this.reduceVal(),
-      paramsArr = [];
-
-      if (paramsInfo && paramsInfo.params) {
-        paramsArr = paramsInfo.params;
-      }
-
-      var params = _.reduce(paramsArr, function (params, param) {
-        params[param.name] = param.value;
-        return params;
-      }, {reduce: false});
-
-      FauxtonAPI.addNotification({
-        msg: "<strong>Warning!</strong> Preview executes the Map/Reduce functions in your browser, and may behave differently from CouchDB.",
-        type: "warning",
-        selector: ".advanced-options .errors-container",
-        fade: true,
-        escape: false // beware of possible XSS when the message changes
-      });
-
-      var promise = FauxtonAPI.Deferred();
-
-      if (!this.database.allDocs || this.database.allDocs.params.include_docs !== true) {
-        this.database.buildAllDocs({limit: Databases.DocLimit.toString(), include_docs: true});
-        promise = this.database.allDocs.fetch();
-       } else {
-        promise.resolve();
-       }
-
-      promise.then(function () {
-        params.docs = that.database.allDocs.map(function (model) { return model.get('doc');});
-        var queryPromise = pouchdb.runViewQuery({map: mapVal, reduce: reduceVal}, params);
-        queryPromise.then(function (results) {
-          FauxtonAPI.triggerRouteEvent('updatePreviewDocs', {rows: results.rows, ddoc: that.getCurrentDesignDoc().id, view: that.viewName});
-        });
-      });
-    },
-
     getCurrentDesignDoc: function () {
       return this.designDocSelector.getCurrentDesignDoc();
     },

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 31678a3..6467923 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -23,6 +23,7 @@
 @import "prettyprint.less";
 @import "icons.less";
 @import "templates.less";
+@import "headers.less";
 @import "formstyles.less";
 /**
  * HTML-wide overrides

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/assets/less/headers.less b/assets/less/headers.less
new file mode 100644
index 0000000..c80a88f
--- /dev/null
+++ b/assets/less/headers.less
@@ -0,0 +1,116 @@
+.fixed-header{
+  height: 60px;
+  background-color: @breadcrumbBG;
+  position: fixed;
+  top: 0;
+  right: 0;
+  left: @navWidth;
+  .closeMenu & {
+    left: @collapsedNavWidth;
+  }
+  z-index: 100;
+  .two-pane & {
+    border: none;
+  }
+  .two-pane &,
+  .with-sidebar & {
+    #api-navbar{
+      > div {
+        .bottom-shadow-border;
+        height: 60px;
+      }
+      .left-shadow-border;
+    }
+    #breadcrumbs{
+      .bottom-shadow-border;
+    }
+  }
+  .one-pane & {
+    #breadcrumbs{
+      width: 90%;
+    }
+    position: relative;
+    border: none;
+    .box-shadow(none);
+    left: auto;
+  }
+  /* these styles are for the new header*/
+  > div {
+    display:inline-block;
+    vertical-align: top;
+  }
+}
+
+#api-navbar{
+  height: 60px;
+  position: relative;
+  /* these styles are for the new header*/
+  .right-header{
+  }
+}
+
+#breadcrumbs {
+  height: 60px;
+  &.sidebar{
+    width: @sidebarWidth - 4;
+  }
+  /* these styles are for the new header*/
+  .header-left{
+    > div{
+      display:inline-block;
+    }
+  }
+  .breadcrumb {
+    margin-bottom: 0;
+    background-color: transparent;
+    padding: 0;
+    li {
+      padding:15px 10px;
+      height: 60px;
+      vertical-align: top;
+      &:first-child {
+        font-size: 30px;
+        .with-sidebar &,
+        .two-pane & {
+          padding:20px 10px;
+          font-size: 19px;
+          border-right: 1px solid #ccc;
+        }
+      }
+      color: @breadcrumbText;
+      font-size: 18px;
+      text-shadow: none;
+      &.active{
+        color: #333;
+      }
+      a{
+        text-decoration: none;
+        color: @breadcrumbText;
+      }
+    }
+  }
+}
+
+.header-left{
+  position: relative;
+  #header-dropdown-menu {
+    position: absolute;
+    right: 0;
+    top: 0;
+    a {
+      text-decoration: none;
+    }
+    .dropdown {
+      border-left: 1px solid #ccc;
+      padding: 20px;
+    }
+    .dropdown-menu {
+      left: -105px;
+      top: 56px;
+    }
+  }
+}
+
+
+
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f719ed13/assets/less/templates.less
----------------------------------------------------------------------
diff --git a/assets/less/templates.less b/assets/less/templates.less
index a6f1a78..5c877b4 100644
--- a/assets/less/templates.less
+++ b/assets/less/templates.less
@@ -297,104 +297,6 @@
   }
 }
 
-.fixed-header{
-  height: 60px;
-  background-color: @breadcrumbBG;
-  position: fixed;
-  top: 0;
-  right: 0;
-  left: @navWidth;
-  .closeMenu & {
-    left: @collapsedNavWidth;
-  }
-  z-index: 100;
-  .two-pane & {
-    border: none;
-  }
-  .two-pane &,
-  .with-sidebar & {
-    #api-navbar{
-      > div {
-        .bottom-shadow-border;
-        height: 60px;
-      }
-      .left-shadow-border;
-    }
-    #breadcrumbs{
-      .bottom-shadow-border;
-    }
-  }
-  .one-pane & {
-    #breadcrumbs{
-      width: 90%;
-    }
-    position: relative;
-    border: none;
-    .box-shadow(none);
-    left: auto;
-  }
-  /* these styles are for the new header*/
-  > div {
-    display:inline-block;
-    vertical-align: top;
-  }
-}
-
-#api-navbar{
-  height: 60px;
-  position: relative;
-  /* these styles are for the new header*/
-  .right-header{
-  }
-}
-
-#breadcrumbs {
-  height: 60px;
-  &.sidebar{
-    width: @sidebarWidth - 4;
-  }
-  /* these styles are for the new header*/
-  .header-left{
-    > div{
-      display:inline-block;
-    }
-  }
-  .breadcrumb {
-    margin-bottom: 0;
-    background-color: transparent;
-    padding: 0;
-    li {
-      padding:15px 10px;
-      height: 60px;
-      vertical-align: top;
-      &:first-child {
-        font-size: 30px;
-        .with-sidebar &,
-        .two-pane & {
-          padding:20px 10px;
-          font-size: 19px;
-          border-right: 1px solid #ccc;
-        }
-      }
-      color: @breadcrumbText;
-      font-size: 18px;
-      text-shadow: none;
-      &.active{
-        color: #333;
-      }
-      a{
-        text-decoration: none;
-        color: @breadcrumbText;
-      }
-    }
-  }
-}
-
-
-
-
-
-
 
 
 /* SIDEBAR-CONTENT & DASHBOARD-CONTENT LAYOUTS:
@@ -449,8 +351,6 @@
   }
 }
 
-
-
 #dashboard-content{
   &.row-fluid,
   &.window-resizeable{


[09/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Fix double-click on design documents in all-docs-list

Closes COUCHDB-2247


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/2da1d54e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/2da1d54e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/2da1d54e

Branch: refs/heads/secondary-indexes
Commit: 2da1d54e79e62c58622c2a77f8b125e87f1fcc89
Parents: 4b3e5c9
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Wed Aug 13 21:17:09 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon Aug 18 20:46:04 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/views.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2da1d54e/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 545f4d6..7085bd8 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -114,7 +114,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
     edit: function(event) {
       event.preventDefault();
-      FauxtonAPI.navigate("#" + this.model.url('app'));
+      FauxtonAPI.navigate("#" + this.model.url('web-index'));
     },
 
     destroy: function(event) {


[16/48] move around query options, init style Adding Views, testing header stuff, fixing layout issues Add all the indexes to the sidebar Fix sidebar to work with different indexes Added the apache license changed a comment ffs. Ripping out views into i

Posted by de...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 93afce6..31678a3 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -22,7 +22,8 @@
 @import "bootstrap/mixins.less";
 @import "prettyprint.less";
 @import "icons.less";
-
+@import "templates.less";
+@import "formstyles.less";
 /**
  * HTML-wide overrides
  **/
@@ -56,28 +57,7 @@ a:hover {
   color: @red;
 }
 
-input[type=text],
-input[type=password] {
-  .border-radius(0);
-  padding: 12px;
-  border: 1px solid #ccc;
-  height: auto;
-  font-size: 16px;
-  margin-top: 0;
-}
-
-input[type="checkbox"],
-input[type="radio"] {
-  box-sizing: border-box;
-  padding: 0;
-}
 
-input[type="file"],
-input[type="checkbox"],
-input[type="radio"],
-select {
-  margin: 0 0 1em 0;
-}
 
 
 /* bootstrap overrides */
@@ -166,109 +146,7 @@ tbody {
   background-color: #F7F7F7;
 }
 
-/*form elements and buttons*/
-.btn-group {
-  > .btn + .dropdown-toggle,
-  > .btn:first-child,
-  > .btn:last-child,
-  > .dropdown-toggle {
-    .border-radius(0);
-    background-image: none;
-    text-shadow: none;
-  }
-}
-
-.btn {
-  .box-shadow(none);
-  .border-radius(@baseBorderRadius);
-  background-image: none;
-  text-shadow: none;
-  background-repeat: no-repeat;
-  padding: 10px;
-  margin-top: 0px;
-  .icon {
-    margin-right: 0.2em;
-  }
-  &.btn-small {
-    padding: 5px 10px;
-    .icon {
-      margin-right: 0;
-      font-size: inherit;
-    }
-  }
-  &.btn-mini {
-    padding: 3px 8px;
-    .icon {
-      margin-right: 0;
-      font-size: inherit;
-    }
-  }
-}
-.btn-primary {
-  background: @redButton;
-}
-
-.btn-primary a:visited {
-  color: #fff;
-}
-
-.form-actions {
-  background: none;
-  border: none;
-}
-
-.input-append,
-.input-prepend {
-  .add-on {
-    font-size: 18px;
-    padding: 14px 5px 30px;
-  }
-  .btn .icon {
-    font-size: 21.5px;
-    margin-right: 0;
-  }
-}
-
-.row-fluid .input-append [class*="span"],
-.input-prepend input[class*="span"] {
-  width: auto;
-}
-
-.form-inline {
-  input[type=password],
-  input[type=text] {
-    width: auto;
-  }
-}
-.checkbox {
-  label {
-    display: inline-block;
-    padding-left:25px;
-  }
-}
-
-label {
-  margin-right: 15px;
-  padding-left:0;
-  display: block;
-  cursor: pointer;
-  position: relative;
-  font-size: 14px;
-  &.inline {
-    display: inline-block;
-  }
-}
-.help-block {
-  font-size: 12px;
-}
-
-a.help-link:hover {
-  text-decoration: none;
-}
 
-input[type=text].error {
-  border: red 1px solid;
-}
 
 /**
  * Fauxton-specific Bootstrap additions
@@ -297,462 +175,9 @@ table.databases {
   }
 }
 
-/* ajax loader */
-.loader {
-  background: url('../img/loader.gif') center center no-repeat;
-  min-height:  100px;
-}
-#app-container.loader{
-  min-height: 400px;
-  > *{
-    display: none;
-  }
-}
-
-#global-notifications {
-  position: fixed;
-  top: 0px;
-  display: block;
-  z-index: 100000;
-  left: @navWidth;
-  .closeMenu & {
-    left: @collapsedNavWidth;
-  }
-  width: 100%;
-}
-
-#app-container{
-  padding: 0;
-  height: 100%;
-  width: 100%;
-  position: absolute;
-  top: 0;
-  left: 0;
-  > .row-fluid {
-    height: 100%;
-  }
-}
-
-/* Fixed side navigation */
-#primary-navbar {
-  height: 100%;
-  position: fixed;
-  width: @navWidth;
-  top: 0;
-  bottom: 0;
-  background-color: @primaryNav;
-  overflow-y: scroll;
-  .js-version {
-    color: #fff;
-    font-size: 10px;
-    padding-left: 10px;
-  }
-  .closeMenu & {
-    .js-version {
-      display: none;
-    }
-  }
-  #footer-links{
-    position: absolute;
-    bottom: 0;
-    width: 100%;
-  }
-  #user-create-admin{
-    font-size: 12px
-  }
-  .navbar {
-     .burger{
-        .transition(all @transitionSpeed @transitionEaseType);
-        padding: 22px 0 0 18px;
-        position: fixed;
-        z-index: 100;
-        width: 64px;
-        top: 0;
-        background-color: @primaryNav;
-        width: @navWidth;
-        div{
-          .transition(all @transitionSpeed @transitionEaseType);
-          height: 4px;
-          width: 24px;
-          .border-radius(2);
-          background-color: @navBG;
-          margin: 2px 0px;
-        }
-        &:hover div{
-          background-color: @orange;
-        }
-      }
-      .bottom-container {
-	     height: 110px;
-	     position: fixed;
-	     bottom: 0;
-	     width: 220px;
-	     background: #3a2c2b;
-       .brand {
-         .box-sizing(content-box);
-         .hide-text;
-         .customTransition(left, 1s, 0.805, 0.005, 0.165, 0.985);
-         margin: 10px 0 0 0;
-         width: 200px;
-         height: 40px;
-         padding: 10px;
-         float: none;
-         background: #3a2c2b;
-         .icon {
-           .box-sizing(content-box);
-           background: url(../img/couchdb-site.png) no-repeat 0 0;
-           display: block;
-           height: 100%;
-           width: 100%;
-         }
-         .closeMenu & {
-           .icon {
-              background: url(../img/minilogo.png) no-repeat 0 0;
-            }
-            width: 45px;
-          }
-       }
-       #footer-nav-links {
-	     li {
-		   a {
-		     font-size: 12px;
-		     color: @red;
-		     padding: 12px;
-		     text-shadow: none;
-		   }
-		   &.active, &:hover{
-             a {
-               text-decoration: underline;
-             }
-           }
-		 }
-       }
-    }
-    nav {
-      margin-top: 64px;
-      .nav{
-        margin: 0;
-        li{
-          .transition(all @transitionSpeed @transitionEaseType);
-          padding: 0;
-          font-size: 16px;
-          letter-spacing: 1px;
-          line-height: 23px;
-          width: @navWidth;
-          font-weight: normal;
-          font-family: helvetica;
-          .box-sizing(border-box);
-          background-color: @navBG;
-          border-bottom:  1px solid @primaryNav;
-          min-height: 48px;
-          &.active, &:hover{
-            a{
-              .box-shadow(none);
-            }
-            background-color: @red;
-          }
-          &:hover .fonticon:before{
-            color: @white;
-          }
-          &.active .fonticon:before,
-          &:hover .fonticon:before,
-          {
-            text-shadow: @boxShadow;
-            color: @NavIconActive;
-          }
-          a{
-            padding: 12px 25px 12px 60px;
-            background-color: transparent;
-            color: #fff;
-            text-shadow: @textShadowOff;
-            &.closeMenu{
-              color: transparent;
-            }
-            .fonticon {
-              position: relative;
-              &:before {
-                position: absolute;
-                top: -5px;
-                left: -41px;
-                font-size: 24px;
-                color: @NavIcon;
-                text-shadow: @boxShadowOff;
-              }
-            }
-            .closeMenu &{
-              color: transparent;
-            }
-          }
-        }
-      }
-      ul#footer-nav-links{
-        li{
-          background-color: @primaryNav;
-          border-top: 1px solid @red;
-          border-bottom: none;
-          font-size: 12px;
-          padding: 12px;
-          min-height: 44px;
-          &.active, &:hover{
-            background-color: @linkRed;
-            border-top: 1px solid @red;
-            a{
-              color: white;
-            }
-          }
-          a{
-            color: @red;
-          }
-        }
-
-      }
-      ul#bottom-nav-links{
-        margin-top: 0;
-        padding-bottom: 70px;
-        li{
-          min-height: 55px;
-          background-color: @bottomNav;
-          &.active{
-            background-color:@linkRed;
-          }
-          &:hover{
-            background-color: @navBGHover;
-          }
-          a{
-            &.fonticon {
-              position: relative;
-              &:before {
-                top: -5px;
-                left: -40px;
-                font-size: 22px;
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-}
-
-
-#dashboard {
-  .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));
-  border-left: 1px solid #999;
-  position: absolute;
-  left: @navWidth;
-  margin-left: 0;
-  padding-left: 0;
-  padding-right: 0;
-  background-color: @sidebarBG;
-  min-width: 600px;
-  height: 100%;
-  .closeMenu &{
-    left: @collapsedNavWidth;
-  }
-  &.one-pane{
-    min-width: 800px;
-    margin-top: 0;
-    overflow-x: hidden;
-  }
-}
-
-/*dashboard content can be in multiple templates*/
-
-#dashboard-content{
-  &.row-fluid,
-  &.window-resizeable{
-    /*remove gutter without rewriting variable*/
-    margin-left: 0px;
-  }
-  padding: 20px;
-  .with-sidebar &{
-    border-left: 1px solid #999;
-    border-right: 1px solid #999;
-    width: auto;
-    .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));
-    padding: 0px;
-    bottom: 0px;
-    top: 60px;
-    position: fixed;
-    overflow-x: hidden;
-    overflow-y: auto;
-    left: @sidebarWidth+@navWidth;
-    right: 0;
-    .box-sizing(border-box);
-    .closeMenu & {
-      left: @sidebarWidth+@collapsedNavWidth;
-    }
-  }
-  > div.inner {
-    display: block;
-  }
-}
-
-.with-sidebar.content-area {
-  position: absolute;
-  top: 0;
-  bottom: 0;
-  left: 0;
-  right: 0;
-}
-
-// .closeMenu .with-sidebar.content-area {
-//   left: 0;
-// }
-/*tools*/
-
-.row-fluid.content-area{
-  background-color: @background;
-}
-
-
-.fixed-header{
-  background-color: @breadcrumbBG;
-  position: fixed;
-  top: 0;
-  right: 0;
-  left: @navWidth;
-  .closeMenu & {
-    left: @collapsedNavWidth;
-  }
-  border-bottom: 5px solid @breadcrumbBorder;
-  .box-shadow(0 4px 6px -2px #808080);
-  z-index: 100;
-  .one-pane & {
-    position: relative;
-    border: none;
-    .box-shadow(none);
-    left: auto;
-  }
-}
-
-#breadcrumbs {
-   .breadcrumb {
-    margin: 15px 20px;
-    margin-bottom: 0;
-    background-color: transparent;
-    padding: 0;
-    li {
-      .divider {
-        font-size: 12px;
-        color: @breadcrumbArrow;
-      }
-      &:first-child {
-        font-size: 30px;
-      }
-      color: @breadcrumbText;
-      font-size: 18px;
-      text-shadow: none;
-      &.active{
-        color: #333;
-      }
-      a{
-        color: @breadcrumbText;
-      }
-    }
-   }
-}
-
-
-/*SIDEBAR TEMPLATE STYLES*/
-.topmenu-defaults {
-  height: 70px;
-  padding: 12px 10px 0;
-  .box-sizing(border-box);
-}
-
-.dashboard-upper-menu{
-  right: 0;
-  left: @sidebarWidth+@navWidth;
-  position: fixed;
-  z-index: 11;
-  display: block;
-  .topmenu-defaults;
-  background-color: #CBCBCB;
-  .closeMenu & {
-    left: @sidebarWidth+@collapsedNavWidth;
-  }
-}
-
-#dashboard-lower-content{
-  padding: 20px;
-  background-color: #F1F1F1;
-}
-
-#dashboard-upper-content{
-  .tab-content {
-    padding-top: 70px;
-  }
-  .well{
-    padding: 20px;
-    .border-radius(0);
-    .box-shadow(none);
-  }
-}
-
-.sidenav {
-  padding: 0;
-  header {
-    width: @sidebarWidth;
-    border-bottom: 1px solid #d3d7db;
-  }
-  .nav-list{
-    .divider {
-      border: none;
-    }
-    > li > a:hover,
-    > li > a:focus{
-      background-color: @darkRed;
-      color: #fff;
-    }
-    li.active > a {
-      color: @darkRed;
-    }
-    > li > a{
-      color: @linkRed;
-      padding: 10px 13px 10px 24px;
-      border-bottom: 1px solid #d3d7db;
-      span{
-        margin-right: 8px;
-        width: 14px;
-        display: inline-block;
-        text-align: center;
-      }
-    }
-    a{
-      display: block;
-      padding: 10px 5px 5px 15px;
-      color: @subListGray;
-      .divider {
-        background: none;
-        color: #ccc;
-        padding: 0 2px;
-      }
-    }
-    .nav-header{
-      padding: 0px;
-      text-shadow: none;
-      color: #333333;
-      & > span:hover {
-        color: @red;
-      }
-    }
-  }
-}
 
-#sidebar-content {
-  position: absolute;
-  top: 60px;
-  width: @sidebarWidth;
-  left: 0;
-  background-color: @secondarySidebar;
-  > div.inner {
-    display: block;
-  }
-}
 
 
-/*ONE PANEL TEMPLATE ONLY STYLES  AKA _all_dbs */
 
 .result-tools{
   border-bottom: 1px solid #999999;
@@ -808,76 +233,7 @@ table.databases {
   }
 }
 
-.custom-inputs{
-
-  input[type=radio],
-  input[type=checkbox] {
-    display: none;
-  }
-
-  .checkbox label:before {
-    border-radius: 3px;
-  }
-
-  .controls > .radio:first-child, .controls > .checkbox:first-child {
-    padding-top: 15px;
-  }
-
-  .radio.inline, .checkbox.inline {
-    display: inline-block;
-    padding-top: 15px;
-    margin-bottom: 12px;
-    vertical-align: middle;
-  }
-
-  input[type=checkbox]:checked + label:before {
-    /*content: "\2713"; */
-    content: "\00d7";
-    text-shadow: 1px 1px 1px rgba(0, 0, 0, .2);
-    font-size: 16px;
-    background-color: @red;
-    color: white;
-    text-align: center;
-    line-height: 15px;
-  }
-
-  label:before {
-    content: "";
-    display: inline-block;
-
-    width: 16px;
-    height: 16px;
-
-    margin-right: 10px;
-    position: absolute;
-    left: 0;
-    bottom: 1px;
-    background-color: #aaa;
-    box-shadow: inset 0px 2px 3px 0px rgba(0, 0, 0, .3), 0px 1px 0px 0px rgba(255, 255, 255, .8);
-  }
-
-  .radio label:before {
-    border-radius: 8px;
-  }
-
-  input[type=radio]:checked + label:before {
-    content: "\2022";
-    color: #f3f3f3;
-    font-size: 30px;
-    text-align: center;
-    line-height: 18px;
-  }
-
-  label.drop-down{
-    &:before{
-    display: none;
-    }
-  }
-}
 
-form.view-query-update, form.view-query-save {
-  max-width: 100%;
-}
 
 /*documents and databases */
 .view.show{
@@ -890,11 +246,6 @@ div.spinner {
   top: 50%;
 }
 
-#api-navbar{
-  position: relative;
-  padding-right: 5px;
-}
-
 .api-url-btn {
   margin-top: 5px;
   margin-bottom: 5px;
@@ -990,39 +341,4 @@ div.spinner {
   }
 }
 
-div.add-dropdown {
-  position: absolute;
-  top: 2px;
-  right: 0px;
-  .dropdown-menu{
-    left: -110px;
-    padding-bottom: 0;
-    width: 148px;
-    min-width: 0;
-    top: 38px;
-    .box-shadow(@boxShadow);
-      &.arrow:before{
-        right: 4px;
-      }
-      a {
-        background-color: #202326;
-        color: rgba(255, 255, 255, 0.8);
-        &:hover{
-          background-color: @red;
-          color: white;
-        }
-      }
-    li a {
-      padding: 10px 15px 10px 12px;
-    }
-  }
-  .dropdown-toggle{
-    border-top: none !important;
-    text-decoration: none;
-  }
-  > a {
-    border-bottom: none;
-    text-decoration: none;
-    font-size: 16px;
-  }
-}
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/assets/less/formstyles.less
----------------------------------------------------------------------
diff --git a/assets/less/formstyles.less b/assets/less/formstyles.less
new file mode 100644
index 0000000..4645664
--- /dev/null
+++ b/assets/less/formstyles.less
@@ -0,0 +1,247 @@
+/*  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ *  use this file except in compliance with the License. You may obtain a copy of
+ *  the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ *  License for the specific language governing permissions and limitations under
+ *  the License.
+ */
+@import "variables.less";
+
+input[type=text],
+input[type=password] {
+  .border-radius(0);
+  padding: 12px;
+  border: 1px solid #ccc;
+  height: auto;
+  font-size: 16px;
+  margin-top: 0;
+}
+
+input[type="checkbox"],
+input[type="radio"] {
+  box-sizing: border-box;
+  padding: 0;
+}
+
+input[type="file"],
+input[type="checkbox"],
+input[type="radio"],
+select {
+  margin: 0 0 1em 0;
+}
+
+/*form elements and buttons*/
+.btn-group {
+  > .btn + .dropdown-toggle,
+  > .btn:first-child,
+  > .btn:last-child,
+  > .dropdown-toggle {
+    .border-radius(0);
+    background-image: none;
+    text-shadow: none;
+  }
+}
+
+.btn {
+  .box-shadow(none);
+  .border-radius(@baseBorderRadius);
+  background-image: none;
+  text-shadow: none;
+  background-repeat: no-repeat;
+  padding: 10px;
+  margin-top: 0px;
+  .icon {
+    margin-right: 0.2em;
+  }
+  &.btn-small {
+    padding: 5px 10px;
+    .icon {
+      margin-right: 0;
+      font-size: inherit;
+    }
+  }
+  &.btn-mini {
+    padding: 3px 8px;
+    .icon {
+      margin-right: 0;
+      font-size: inherit;
+    }
+  }
+}
+.btn-primary {
+  background: @redButton;
+}
+
+.btn-primary a:visited {
+  color: #fff;
+}
+
+.form-actions {
+  background: none;
+  border: none;
+}
+
+.input-append,
+.input-prepend {
+  .add-on {
+    font-size: 18px;
+    padding: 14px 5px 30px;
+  }
+  .btn .icon {
+    font-size: 21.5px;
+    margin-right: 0;
+  }
+}
+
+.row-fluid .input-append [class*="span"],
+.input-prepend input[class*="span"] {
+  width: auto;
+}
+
+.form-inline {
+  input[type=password],
+  input[type=text] {
+    width: auto;
+  }
+}
+.checkbox {
+  label {
+    display: inline-block;
+    padding-left:25px;
+  }
+}
+
+label {
+  margin-right: 15px;
+  padding-left:0;
+  display: block;
+  cursor: pointer;
+  position: relative;
+  font-size: 14px;
+  &.inline {
+    display: inline-block;
+  }
+}
+.help-block {
+  font-size: 12px;
+}
+
+a.help-link:hover {
+  text-decoration: none;
+}
+
+input[type=text].error {
+  border: red 1px solid;
+}
+
+form.view-query-update, form.view-query-save {
+  max-width: 100%;
+}
+.custom-inputs{
+
+  input[type=radio],
+  input[type=checkbox] {
+    display: none;
+  }
+
+  .checkbox label:before {
+    border-radius: 3px;
+  }
+
+  .controls > .radio:first-child, .controls > .checkbox:first-child {
+    padding-top: 15px;
+  }
+
+  .radio.inline, .checkbox.inline {
+    display: inline-block;
+    padding-top: 15px;
+    margin-bottom: 12px;
+    vertical-align: middle;
+  }
+
+  input[type=checkbox]:checked + label:before {
+    /*content: "\2713"; */
+    content: "\00d7";
+    text-shadow: 1px 1px 1px rgba(0, 0, 0, .2);
+    font-size: 16px;
+    background-color: @red;
+    color: white;
+    text-align: center;
+    line-height: 15px;
+  }
+
+  label:before {
+    content: "";
+    display: inline-block;
+
+    width: 16px;
+    height: 16px;
+
+    margin-right: 10px;
+    position: absolute;
+    left: 0;
+    bottom: 1px;
+    background-color: #aaa;
+    box-shadow: inset 0px 2px 3px 0px rgba(0, 0, 0, .3), 0px 1px 0px 0px rgba(255, 255, 255, .8);
+  }
+
+  .radio label:before {
+    border-radius: 8px;
+  }
+
+  input[type=radio]:checked + label:before {
+    content: "\2022";
+    color: #f3f3f3;
+    font-size: 30px;
+    text-align: center;
+    line-height: 18px;
+  }
+
+  label.drop-down{
+    &:before{
+    display: none;
+    }
+  }
+}
+
+div.add-dropdown {
+  position: absolute;
+  top: 2px;
+  right: 0px;
+  .dropdown-menu{
+    left: -110px;
+    padding-bottom: 0;
+    width: 148px;
+    min-width: 0;
+    top: 38px;
+    .box-shadow(@boxShadow);
+      &.arrow:before{
+        right: 4px;
+      }
+      a {
+        background-color: #202326;
+        color: rgba(255, 255, 255, 0.8);
+        &:hover{
+          background-color: @red;
+          color: white;
+        }
+      }
+    li a {
+      padding: 10px 15px 10px 12px;
+    }
+  }
+  .dropdown-toggle{
+    border-top: none !important;
+    text-decoration: none;
+  }
+  > a {
+    border-bottom: none;
+    text-decoration: none;
+    font-size: 16px;
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/assets/less/templates.less
----------------------------------------------------------------------
diff --git a/assets/less/templates.less b/assets/less/templates.less
new file mode 100644
index 0000000..a6f1a78
--- /dev/null
+++ b/assets/less/templates.less
@@ -0,0 +1,586 @@
+/*  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ *  use this file except in compliance with the License. You may obtain a copy of
+ *  the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ *  License for the specific language governing permissions and limitations under
+ *  the License.
+ */
+ @import "variables.less";
+
+/* ajax loader */
+.loader {
+  background: url('../img/loader.gif') center center no-repeat;
+  min-height:  100px;
+}
+
+#global-notifications {
+  position: fixed;
+  top: 0px;
+  display: block;
+  z-index: 100000;
+  left: @navWidth;
+  .closeMenu & {
+    left: @collapsedNavWidth;
+  }
+  width: 100%;
+}
+
+/*container where the layout is injected*/
+#app-container{
+  padding: 0;
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  > .row-fluid {
+    height: 100%;
+  }
+  &.loader{
+    min-height: 400px;
+    > *{
+      display: none;
+    }
+  }
+}
+
+/* Fixed side navigation */
+#primary-navbar {
+  /* hack for the scrollbar that shines through from the sidebar */
+  -webkit-transform: translate3d(0, 0, 0);
+  height: 100%;
+  position: fixed;
+  width: @navWidth;
+  top: 0;
+  bottom: 0;
+  background-color: @primaryNav;
+  overflow-y: scroll;
+  .version {
+    color: #fff;
+    font-size: 10px;
+    padding-left: 10px;
+  }
+  #footer-links{
+    position: absolute;
+    bottom: 0;
+    width: 100%;
+  }
+  #user-create-admin{
+    font-size: 12px
+  }
+  .navbar {
+     .burger{
+        .transition(all @transitionSpeed @transitionEaseType);
+        padding: 22px 0 0 18px;
+        position: fixed;
+        top: 0;
+        z-index: 100;
+        background-color: @primaryNav;
+        width: @navWidth;
+        div{
+          .transition(all @transitionSpeed @transitionEaseType);
+          height: 4px;
+          width: 24px;
+          .border-radius(2);
+          background-color: @navBG;
+          margin: 2px 0px;
+        }
+        &:hover div{
+          background-color: @orange;
+        }
+      }
+      .bottom-container {
+       height: 110px;
+       position: fixed;
+       bottom: 0;
+       width: 220px;
+       background: #3a2c2b;
+       .brand {
+         .box-sizing(content-box);
+         .hide-text;
+         .customTransition(left, 1s, 0.805, 0.005, 0.165, 0.985);
+         margin: 10px 0 0 0;
+         width: 200px;
+         height: 40px;
+         padding: 10px;
+         float: none;
+         background: #3a2c2b;
+         .icon {
+           .box-sizing(content-box);
+           background: url(../img/couchdb-site.png) no-repeat 0 0;
+           display: block;
+           height: 100%;
+           width: 100%;
+         }
+         .closeMenu & {
+           .icon {
+              background: url(../img/minilogo.png) no-repeat 0 0;
+            }
+            width: 45px;
+          }
+       }
+       #footer-nav-links {
+       li {
+       a {
+         font-size: 12px;
+         color: @red;
+         padding: 12px;
+         text-shadow: none;
+       }
+       &.active, &:hover{
+             a {
+               text-decoration: underline;
+             }
+           }
+     }
+       }
+    }
+    nav {
+      margin-top: 64px;
+      .nav{
+        margin: 0;
+        li{
+          .transition(all @transitionSpeed @transitionEaseType);
+          padding: 0;
+          font-size: 16px;
+          letter-spacing: 1px;
+          line-height: 23px;
+          width: @navWidth;
+          font-weight: normal;
+          font-family: helvetica;
+          .box-sizing(border-box);
+          background-color: @navBG;
+          border-bottom:  1px solid @primaryNav;
+          min-height: 48px;
+          &.active, &:hover{
+            a{
+              .box-shadow(none);
+            }
+            background-color: @red;
+          }
+          &:hover .fonticon:before{
+            color: @white;
+          }
+          &.active .fonticon:before,
+          &:hover .fonticon:before,
+          {
+            text-shadow: @boxShadow;
+            color: @NavIconActive;
+          }
+          a{
+            padding: 12px 25px 12px 60px;
+            background-color: transparent;
+            color: #fff;
+            text-shadow: @textShadowOff;
+            &.closeMenu{
+              color: transparent;
+            }
+            .fonticon {
+              position: relative;
+              &:before {
+                position: absolute;
+                top: -5px;
+                left: -41px;
+                font-size: 24px;
+                color: @NavIcon;
+                text-shadow: @boxShadowOff;
+              }
+            }
+            .closeMenu &{
+              color: transparent;
+            }
+          }
+        }
+      }
+      ul#footer-nav-links{
+        li{
+          background-color: @primaryNav;
+          border-top: 1px solid @red;
+          border-bottom: none;
+          font-size: 12px;
+          padding: 12px;
+          min-height: 44px;
+          &.active, &:hover{
+            background-color: @linkRed;
+            border-top: 1px solid @red;
+            a{
+              color: white;
+            }
+          }
+          a{
+            color: @red;
+          }
+        }
+
+      }
+      ul#bottom-nav-links{
+        margin-top: 0;
+        padding-bottom: 70px;
+        li{
+          min-height: 55px;
+          background-color: @bottomNav;
+          &.active{
+            background-color:@linkRed;
+          }
+          &:hover{
+            background-color: @navBGHover;
+          }
+          a{
+            &.fonticon {
+              position: relative;
+              &:before {
+                top: -5px;
+                left: -40px;
+                font-size: 22px;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
+
+/*
+---------------------------------------------------
+  REUSEABLE SHADOW BORDER
+---------------------------------------------------
+*/
+
+.left-shadow-border{
+  border-left: 1px solid #999;
+  .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));
+}
+
+.bottom-shadow-border{
+  border-bottom: 1px solid #999;
+  .box-shadow(0px 6px 0 0 rgba(0, 0, 0, 0.1));
+}
+
+/*
+
+  FIXED HEADER, DASHBOARD & BREADCRUMBS:
+
+  one_pane.html
+  two_pane.html
+  with_sidebar.html
+  with_tabs.html
+  with_tabs_sidebar.html
+*/
+#dashboard {
+  .left-shadow-border;
+  position: absolute;
+  left: @navWidth;
+  margin-left: 0;
+  padding-left: 0;
+  padding-right: 0;
+  background-color: @sidebarBG;
+  min-width: 600px;
+  height: 100%;
+  .closeMenu &{
+    left: @collapsedNavWidth;
+  }
+  &.one-pane{
+    min-width: 800px;
+    margin-top: 0;
+    overflow-x: hidden;
+  }
+  &.two-pane{
+    margin-top: 0;
+    overflow-x: hidden;
+  }
+}
+
+.fixed-header{
+  height: 60px;
+  background-color: @breadcrumbBG;
+  position: fixed;
+  top: 0;
+  right: 0;
+  left: @navWidth;
+  .closeMenu & {
+    left: @collapsedNavWidth;
+  }
+  z-index: 100;
+  .two-pane & {
+    border: none;
+  }
+  .two-pane &,
+  .with-sidebar & {
+    #api-navbar{
+      > div {
+        .bottom-shadow-border;
+        height: 60px;
+      }
+      .left-shadow-border;
+    }
+    #breadcrumbs{
+      .bottom-shadow-border;
+    }
+  }
+  .one-pane & {
+    #breadcrumbs{
+      width: 90%;
+    }
+    position: relative;
+    border: none;
+    .box-shadow(none);
+    left: auto;
+  }
+  /* these styles are for the new header*/
+  > div {
+    display:inline-block;
+    vertical-align: top;
+  }
+}
+
+#api-navbar{
+  height: 60px;
+  position: relative;
+  /* these styles are for the new header*/
+  .right-header{
+  }
+}
+
+#breadcrumbs {
+  height: 60px;
+  &.sidebar{
+    width: @sidebarWidth - 4;
+  }
+  /* these styles are for the new header*/
+  .header-left{
+    > div{
+      display:inline-block;
+    }
+  }
+  .breadcrumb {
+    margin-bottom: 0;
+    background-color: transparent;
+    padding: 0;
+    li {
+      padding:15px 10px;
+      height: 60px;
+      vertical-align: top;
+      &:first-child {
+        font-size: 30px;
+        .with-sidebar &,
+        .two-pane & {
+          padding:20px 10px;
+          font-size: 19px;
+          border-right: 1px solid #ccc;
+        }
+      }
+      color: @breadcrumbText;
+      font-size: 18px;
+      text-shadow: none;
+      &.active{
+        color: #333;
+      }
+      a{
+        text-decoration: none;
+        color: @breadcrumbText;
+      }
+    }
+  }
+}
+
+
+
+
+
+
+
+
+/* SIDEBAR-CONTENT & DASHBOARD-CONTENT LAYOUTS:
+  with_sidebar.html
+  with_tabs_sidebar.html
+*/
+
+#sidebar-content {
+  position: absolute;
+  top: 60px;
+  width: @sidebarWidth;
+  left: 0;
+  background-color: @secondarySidebar;
+  > div.inner {
+    display: block;
+  }
+}
+
+.topmenu-defaults {
+  height: 70px;
+  padding: 12px 10px 0;
+  .box-sizing(border-box);
+}
+
+/* USED IN TEMPLATE: with_tabs_sidebar.html */
+.dashboard-upper-menu{
+  right: 0;
+  left: @sidebarWidth+@navWidth;
+  position: fixed;
+  z-index: 11;
+  display: block;
+  .topmenu-defaults;
+  background-color: #CBCBCB;
+  .closeMenu & {
+    left: @sidebarWidth+@collapsedNavWidth;
+  }
+}
+
+#dashboard-lower-content{
+  padding: 20px;
+  background-color: #F1F1F1;
+}
+
+#dashboard-upper-content{
+  .tab-content {
+    padding-top: 70px;
+  }
+  .well{
+    padding: 20px;
+    .border-radius(0);
+    .box-shadow(none);
+  }
+}
+
+
+
+#dashboard-content{
+  &.row-fluid,
+  &.window-resizeable{
+    /*remove gutter without rewriting variable*/
+    margin-left: 0px;
+  }
+  padding: 20px;
+  .with-sidebar &{
+    .left-shadow-border;
+    border-right: 1px solid #999;
+    width: auto;
+    padding: 0px;
+    bottom: 0px;
+    top: 60px;
+    position: fixed;
+    overflow-x: hidden;
+    overflow-y: auto;
+    left: @sidebarWidth+@navWidth;
+    right: 0;
+    .box-sizing(border-box);
+    .closeMenu & {
+      left: @sidebarWidth+@collapsedNavWidth;
+    }
+  }
+  > div.inner {
+    display: block;
+  }
+}
+
+/*
+  Sidenav:
+  USED IN DOCUMENT ADDON & EXTERNAL ADDONS
+*/
+.sidenav {
+  padding: 0;
+  header {
+    width: @sidebarWidth;
+    border-bottom: 1px solid #d3d7db;
+  }
+  .nav-list{
+    .divider {
+      border: none;
+    }
+    > li > a:hover,
+    > li > a:focus{
+      background-color: @darkRed;
+      color: #fff;
+    }
+    li.active > a {
+      color: @darkRed;
+    }
+    > li > a{
+      color: @linkRed;
+      padding: 10px 13px 10px 24px;
+      border-bottom: 1px solid #d3d7db;
+      span{
+        margin-right: 8px;
+        width: 14px;
+        display: inline-block;
+        text-align: center;
+      }
+    }
+    a{
+      display: block;
+      padding: 10px 5px 5px 15px;
+      color: @subListGray;
+      .divider {
+        background: none;
+        color: #ccc;
+        padding: 0 2px;
+      }
+    }
+    .nav-header{
+      padding: 0px;
+      text-shadow: none;
+      color: #333333;
+      & > span:hover {
+        color: @red;
+      }
+    }
+  }
+}
+
+.row-fluid.content-area{
+  background-color: @background;
+}
+
+
+/*
+  #left-content & #right-content from template:
+  two_pane.html
+*/
+#left-content,
+#right-content{
+  .two-pane &{
+    padding: 0px;
+    bottom: 0px;
+    top: 60px;
+    margin-left:0;
+    position: fixed;
+    overflow-x: hidden;
+    overflow-y: auto;
+    .box-sizing(border-box);
+  }
+}
+
+#left-content{
+  .two-pane &{
+    left: @navWidth;
+    .closeMenu & {
+      left: @collapsedNavWidth;
+    }
+  }
+}
+#right-content{
+  .two-pane &{
+    padding: 0 20px;
+    border-left: 1px solid #999;
+    .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));
+  }
+}
+
+
+.with-sidebar.content-area,
+.two-pane.content-area {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+}
+
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/28333566/settings.json.default
----------------------------------------------------------------------
diff --git a/settings.json.default b/settings.json.default
index bc5a617..d278368 100644
--- a/settings.json.default
+++ b/settings.json.default
@@ -3,6 +3,7 @@
   { "name": "fauxton" },
   { "name": "databases" },
   { "name": "documents" },
+  { "name": "indexes" },
   { "name": "pouchdb" },
   { "name": "activetasks" },
   { "name": "config" },


[37/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Fixed the resizeColumns code that was the worst


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/96bd61ae
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/96bd61ae
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/96bd61ae

Branch: refs/heads/secondary-indexes
Commit: 96bd61ae3ac749cf2214f7aee83ba155343d8cae
Parents: 6daad5d
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 app/addons/databases/templates/list.html        |   2 +-
 app/addons/databases/views.js                   |  19 +--
 .../documents/templates/all_docs_list.html      |   2 +-
 app/addons/documents/views.js                   |   3 +-
 app/addons/fauxton/resizeColumns.js             | 135 ++++++-------------
 app/templates/layouts/two_pane.html             |   8 +-
 6 files changed, 47 insertions(+), 122 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/96bd61ae/app/addons/databases/templates/list.html
----------------------------------------------------------------------
diff --git a/app/addons/databases/templates/list.html b/app/addons/databases/templates/list.html
index b0569e7..874801c 100644
--- a/app/addons/databases/templates/list.html
+++ b/app/addons/databases/templates/list.html
@@ -24,6 +24,6 @@ the License.
     </tbody>
   </table>
 </div>
-<footer class="pagination-footer window-resizeable">
+<footer class="pagination-footer window-resizeable-full">
   <div id="database-pagination"></div>
 </footer>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/96bd61ae/app/addons/databases/views.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/views.js b/app/addons/databases/views.js
index 29158c8..99a5ea2 100644
--- a/app/addons/databases/views.js
+++ b/app/addons/databases/views.js
@@ -128,6 +128,7 @@ function(app, Components, FauxtonAPI, Databases) {
       this.$el.find(".js-db-graveyard").tooltip();
     }
   });
+
   Views.List = FauxtonAPI.View.extend({
     dbLimit: 20,
     perPage: 20,
@@ -187,24 +188,6 @@ function(app, Components, FauxtonAPI, Databases) {
     setPage: function(page) {
       this.page = page || 1;
     },
-
-    afterRender: function() {
-      var that = this,
-          AllDBsArray = _.map(this.collection.toJSON(), function(item, key){
-            return item.name;
-          });
-
-      this.dbSearchTypeahead = new Components.Typeahead({
-        el: "input.search-autocomplete",
-        source: AllDBsArray,
-        onUpdate: function (item) {
-          that.switchDatabase(null, item);
-        }
-      });
-      this.dbSearchTypeahead.render();
-      this.$el.find(".js-db-graveyard").tooltip();
-    },
-
     selectAll: function(evt){
       $("input:checkbox").attr('checked', !$(evt.target).hasClass('active'));
     }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/96bd61ae/app/addons/documents/templates/all_docs_list.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_list.html b/app/addons/documents/templates/all_docs_list.html
index bf7e250..4a9482d 100644
--- a/app/addons/documents/templates/all_docs_list.html
+++ b/app/addons/documents/templates/all_docs_list.html
@@ -24,7 +24,7 @@ the License.
     </div>
   <% } %>
 </div>
-<footer class="pagination-footer window-resizeable">
+<footer class="pagination-footer window-resizeable<%=resizeLayout%>">
   <div id="item-numbers"> </div>
   <div id="documents-pagination"></div>
 </footer>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/96bd61ae/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index b292663..22cdf65 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -506,8 +506,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
     serialize: function() {
       return {
-        viewList: this.viewList,
-        expandDocs: this.expandDocs,
+        resizeLayout: this.viewList?"-half":"",
         endOfResults: !this.pagination.canShowNextfn()
       };
     },

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/96bd61ae/app/addons/fauxton/resizeColumns.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/resizeColumns.js b/app/addons/fauxton/resizeColumns.js
index 210ae4b..f88a3aa 100644
--- a/app/addons/fauxton/resizeColumns.js
+++ b/app/addons/fauxton/resizeColumns.js
@@ -23,129 +23,72 @@ define([
 
 function(FauxtonAPI) {
 
-
-// Lets think about what this needs to do, so it can be rewritten.
-/*
-  I have 3 types of resizable layouts:
-    - full size which will span across the content area that is
-     window.innerWidth - primaryNavWidth
-    - 2 panel which is the above divided by 2 with the left set on the second div
-    - "sidebar" which is window.innerWidth - primaryNavWidth - sidebarwidth
-    Also everything needs to account for border width
-
-    Step 1:
-    - getPrimaryNavWidth
-    - get window.innerWidth
-    - get appContainerWidth AKA full width
-    - getPanelWidth (app container / 2)
-    - sidebarwidth (app container - sidebar)
-*/
-
-
   var Resize = function(options){
     this.options = options;
   };
 
   Resize.prototype = {
-    getPrimaryNavWidth: function(){
-      var primaryNavWidth  = $('body').hasClass('closeMenu') ? 64 : 220;
-      return primaryNavWidth;
-    },
-
-    getSidebarWidth: function(){},
-
-    getSinglePanelWidth: function(){
-      var sidebarWidth = $('#sidebar-content').length > 0 ? $('#sidebar-content').outerWidth() : 0,
-          borders = parseInt($('#dashboard').css('border-left-width'), 10) +
-                    parseInt($('#dashboard-content').css('border-left-width'), 10) +
-                    parseInt($('#dashboard-content').css('border-right-width'), 10);
-
-      return (this.getPrimaryNavWidth() + sidebarWidth + borders);
-    },
-
-    getTwoPanelWidth: function(){
-      var borders = parseInt($('#dashboard').css('border-left-width'), 10) +
-          parseInt($('#right-content').css('border-left-width'), 10) +
-          parseInt($('#left-content').css('border-right-width'), 10)+
-          parseInt($('#left-content').css('border-left-width'), 10) +
-          parseInt($('#right-content').css('border-right-width'), 10);
-      return (this.getPrimaryNavWidth()+ borders);
-    },
 
     initialize: function(){
-     // $(window).off('resize');
-      var that = this;
       //add throttler :)
+      var that = this;
       this.lazyLayout = _.debounce(that.onResizeHandler, 300).bind(this);
       FauxtonAPI.utils.addWindowResize(this.lazyLayout,"animation");
       FauxtonAPI.utils.initWindowResize();
       this.onResizeHandler();
     },
 
-    updateOptions:function(options){
-      this.options = {};
-      this.options = options;
-    },
+    onResizeHandler: function (){
+      var fullWidth = this.getFullWidth(),
+          halfWidth = this.getHalfWidth(),
+          sidebarWidth = this.getSidebarContentWidth(),
+          left = $('.window-resizeable-half').length > 0? halfWidth : sidebarWidth;
+
+      $('.window-resizeable').innerWidth(sidebarWidth);
+      $('.window-resizeable-half').innerWidth(halfWidth);
+      $('.window-resizeable-full').innerWidth(fullWidth);
 
-    turnOff:function(){
-      FauxtonAPI.utils.removeWindowResize("animation");
+      //set left
+      this.setLeftPosition(left);
+      //if there is a callback, run that
+      this.options.callback && this.options.callback();
+      this.trigger('resize');
     },
 
     cleanupCallback: function(){
       this.callback = null;
     },
 
-    singlePanelResize: function(){
-      var combinedWidth = window.innerWidth - this.getSinglePanelWidth(),
-      smallWidthConstraint = ($('#sidebar-content').length > 0)? 470:800,
-      panelWidth;
-
-      if (combinedWidth > smallWidthConstraint) {
-        panelWidth = combinedWidth;
-      } else if (combinedWidth < smallWidthConstraint){
-        panelWidth = smallWidthConstraint;
-      }
-      return panelWidth;
+    getPrimaryNavWidth: function(){
+      var primaryNavWidth  = $('body').hasClass('closeMenu') ? 64 : $('#primary-navbar').outerWidth();
+      //$('body').hasClass('closeMenu') ? 64 : 220;
+      return primaryNavWidth;
     },
 
-    getPanelWidth: function(){
-      var panelWidth;
-      if ($('#dashboard').hasClass('two-pane')){
-        panelWidth = (window.innerWidth - this.getTwoPanelWidth())/2;
-      } else {
-        panelWidth = this.singlePanelResize();
-      }
-      return panelWidth;
+    getWindowWidth: function(){
+      return window.innerWidth;
     },
 
-    setPosition: function(panelWidth){
-      var primary = this.getPrimaryNavWidth();
-      $('.set-left-position').css('left',panelWidth+primary+4);
+    getFullWidth: function(){
+      return this.getWindowWidth() - this.getPrimaryNavWidth();
     },
 
-    onResizeHandler: function (){
-      //if there is an override, do that instead
-      if (this.options.onResizeHandler){
-        this.options.onResizeHandler();
-      } else {
-        /*
-          Just so we all are aware:
-          This entire file and the html of the layouts is bonkers
-          crazy. I hate what horrible things happened in this file.
-          It will change soon with a layout overhaul.
-        */
-
-        var panelWidth = this.getPanelWidth();
-        var fullWidth = this.getPanelWidth();
-        this.setPosition(panelWidth);
-        $('.window-resizeable').innerWidth(panelWidth);
-        $('.window-resizeable-full').innerWidth(fullWidth);
-      }
-      //if there is a callback, run that
-      if(this.options.callback) {
-        this.options.callback();
-      }
-      this.trigger('resize');
+    getSidebarWidth: function(){
+      return $('#breadcrumbs').length > 0 ? $('#breadcrumbs').outerWidth() : 0;
+    },
+
+    getSidebarContentWidth: function(){
+      return this.getFullWidth() - this.getSidebarWidth() -5;
+    },
+
+    getHalfWidth: function(){
+      var fullWidth = this.getFullWidth();
+      return fullWidth/2;
+    },
+
+    setLeftPosition: function(panelWidth){
+      var primary = this.getPrimaryNavWidth();
+      $('.set-left-position').css('left',panelWidth+primary+4);
     }
   };
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/96bd61ae/app/templates/layouts/two_pane.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/two_pane.html b/app/templates/layouts/two_pane.html
index 053285a..aa7e30e 100644
--- a/app/templates/layouts/two_pane.html
+++ b/app/templates/layouts/two_pane.html
@@ -16,12 +16,12 @@ the License.
 <div id="dashboard" class="container-fluid two-pane">
   <div id="global-notifications" class="container errors-container window-resizeable set-left-position"></div>
   <header class="fixed-header row-fluid">
-    <div id="breadcrumbs" class="window-resizeable"></div>
-    <div id="api-navbar" class="window-resizeable"></div>
+    <div id="breadcrumbs" class="window-resizeable-half"></div>
+    <div id="api-navbar" class="window-resizeable-half"></div>
   </header>
 
   <div class="content-area two-pane">
-    <div id="left-content" class="span6 window-resizeable"></div>
-    <div id="right-content" class="span6 window-resizeable set-left-position"></div>
+    <div id="left-content" class="span6 window-resizeable-half"></div>
+    <div id="right-content" class="span6 window-resizeable-half set-left-position"></div>
   </div>
 </div>


[38/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Fix styling the select toggle show


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/3f9f381e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/3f9f381e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/3f9f381e

Branch: refs/heads/secondary-indexes
Commit: 3f9f381e3371a7125f185c9b0c2160d9a11e65af
Parents: 09649df
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/assets/less/documents.less |  5 +----
 .../documents/templates/all_docs_item.html      |  4 ++--
 app/addons/documents/views.js                   |  8 +++----
 app/addons/indexes/assets/less/doc-item.less    | 22 +++++++++++++++-----
 4 files changed, 24 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/3f9f381e/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index 33e7e98..0f9836a 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -19,10 +19,7 @@
 @import "sidenav.less";
 @import "headers.less";
 
-tr.all-docs-item {
-  border: none;
-  background: transparent;
-}
+
 button.beautify {
   margin-top: 20px;
 }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/3f9f381e/app/addons/documents/templates/all_docs_item.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_item.html b/app/addons/documents/templates/all_docs_item.html
index 783e4f5..4526df2 100644
--- a/app/addons/documents/templates/all_docs_item.html
+++ b/app/addons/documents/templates/all_docs_item.html
@@ -12,8 +12,8 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<div class="select" <% if (!showSelect){ %>style="display:none"<%}%> ><input <%- checked ? 'checked="checked"' : '' %> type="checkbox" class="js-row-select"></div>
-<div class="doc-item  ">
+<div class="select"><input <%- checked ? 'checked="checked"' : '' %> type="checkbox" class="js-row-select"></div>
+<div class="doc-item">
 
   <header>
     _id <span class="header-id-number">"<%=docID%>"</span>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/3f9f381e/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 694ee64..cf17559 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -257,7 +257,9 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
   Views.Document = FauxtonAPI.View.extend({
     template: "addons/documents/templates/all_docs_item",
-    className: "all-docs-item doc-row",
+    className: function(){
+      return (this.showSelect? "showSelect":"") + " all-docs-item doc-row"
+    },
     initialize: function (options) {
       this.checked = options.checked;
       this.expanded = options.expanded;
@@ -269,8 +271,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     },
 
     showSelectBox: function(bool){
-      this.showSelect = bool;
-      this.$('.select').toggle(this.showSelect);
+      this.$el.toggleClass('showSelect');
     },
 
     selectAll: function(checked){
@@ -295,7 +296,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
     serialize: function() {
       return {
-        showSelect: this.showSelect,
         expanded: this.expanded,
         docID: this.model.get('_id'),
         doc: this.model,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/3f9f381e/app/addons/indexes/assets/less/doc-item.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/assets/less/doc-item.less b/app/addons/indexes/assets/less/doc-item.less
index ea92515..3d3e3ad 100644
--- a/app/addons/indexes/assets/less/doc-item.less
+++ b/app/addons/indexes/assets/less/doc-item.less
@@ -13,18 +13,30 @@
   display: block;
 }
 
+
 #doc-list{
   padding-top: 30px;
-  div.doc-row {
-    margin-bottom:20px;
-    div.select {
-      width: 10%;
+  .all-docs-item {
+    .select {
+      display:none;
       float: left;
       vertical-align: top;
     }
+    &.showSelect{
+      .select {
+        display:block;
+        width: 10%;
+      }
+      .doc-item {
+        width:90%;
+      }
+    }
+  }
+  div.doc-row {
+    margin-bottom:20px;
     .doc-item {
       float:left;
-      width:90%;
+      width:100%;
       vertical-align: top;
       position: relative;
       .border-radius(5px 5px 5px 5px);


[03/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Revert "Fauxton: Fix scrollbar from sidebar on collapsed state in Chrome"

This reverts commit 99665a15ac3a1e56259eb7445b9b2e505ac361fc.

This caused the sidebar not to scroll if the window is not height
enough


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/580ea7b2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/580ea7b2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/580ea7b2

Branch: refs/heads/secondary-indexes
Commit: 580ea7b24d9bb8304f251727d4dceb07a6e95bb5
Parents: 6e11dee
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sat Aug 16 14:15:38 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat Aug 16 14:15:38 2014 +0200

----------------------------------------------------------------------
 assets/less/fauxton.less | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/580ea7b2/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 88d2293..2032b04 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -335,8 +335,6 @@ table.databases {
 
 /* Fixed side navigation */
 #primary-navbar {
-  /* hack for the scrollbar that shines through from the sidebar */
-  -webkit-transform: translate3d(0, 0, 0);
   height: 100%;
   position: fixed;
   width: @navWidth;


[32/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Fixed pagination on indexes


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/5187861b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/5187861b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/5187861b

Branch: refs/heads/secondary-indexes
Commit: 5187861b71247b53d5db1511fcfd57482af08145
Parents: 566ac34
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 app/addons/fauxton/components.js  |  2 +-
 app/addons/indexes/routes-core.js | 53 +++++++++++++++++++++++++++++++++-
 2 files changed, 53 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5187861b/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index 28a9070..3784b8d 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -747,7 +747,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
     className: "dropdown",
     initialize: function(options){
       this.links = options.links;
-      this.icon = options.icon || "fonticon-plus-circled2";
+      this.icon = options.icon || "fonticon-plus-circled";
       _.bindAll(this);
       this.setUpEvents();
     },

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5187861b/app/addons/indexes/routes-core.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-core.js b/app/addons/indexes/routes-core.js
index 354afb0..ae21e03 100644
--- a/app/addons/indexes/routes-core.js
+++ b/app/addons/indexes/routes-core.js
@@ -45,9 +45,46 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
     },
 
     events: {
-      "route:updatePreviewDocs": "updateAllDocsFromPreview"
+      "route:updatePreviewDocs": "updateAllDocsFromPreview",
+      "route:perPageChange": "perPageChange",
+      "route:paginate": "paginate"
     },
 
+    /* --------------------------------------------------
+      Called when you change the # of items to show in the pagination footer
+    ----------------------------------------------------*/
+    perPageChange: function (perPage) {
+      // We need to restore the collection parameters to the defaults (1st page)
+      // and update the page size
+      this.perPage = perPage;
+      this.leftheader.forceRender();
+      this.documentsView.forceRender();
+      this.documentsView.collection.pageSizeReset(perPage, {fetch: false});
+      this.setDocPerPageLimit(perPage);
+    },
+
+    /* --------------------------------------------------
+      Store the docs to show per page in local storage
+    ----------------------------------------------------*/
+    setDocPerPageLimit: function (perPage) {
+      window.localStorage.setItem('fauxton:perpage', perPage);
+    },
+
+    /* --------------------------------------------------
+      Triggers when you hit the paginate forward and backwards buttons
+    ----------------------------------------------------*/
+
+    paginate: function (options) {
+      var collection = this.documentsView.collection;
+      this.leftheader.forceRender();
+      this.documentsView.forceRender();
+      collection.paging.pageSize = options.perPage;
+      var promise = collection[options.direction]({fetch: false});
+    },
+
+    /* --------------------------------------------------
+     Get Design doc info
+    ----------------------------------------------------*/
     ddocInfo: function (designDoc, designDocs, view) {
       return {
         id: "_design/" + designDoc,
@@ -56,6 +93,9 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
       };
     },
 
+    /* --------------------------------------------------
+      URL params from Advanced/ Query options
+    ----------------------------------------------------*/
     createParams: function (options) {
       var urlParams = app.getParams(options);
       var params = Documents.QueryParams.parse(urlParams);
@@ -66,6 +106,9 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
       };
     },
 
+    /* --------------------------------------------------
+      Stored docs in preview
+    ----------------------------------------------------*/
     getDocPerPageLimit: function (urlParams, perPage) {
       var storedPerPage = perPage;
 
@@ -91,6 +134,10 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
       return this.data.designDocs.fetch({reset: true});
     },
 
+
+    /* --------------------------------------------------
+      Docs that are returned from a view
+    ----------------------------------------------------*/
     createViewDocumentsView: function (options) {
       return this.setView("#right-content", new Documents.Views.AllDocsList({
         database: options.database,
@@ -103,6 +150,10 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
       }));
     },
 
+
+    /* --------------------------------------------------
+      If Preview worked....
+    ----------------------------------------------------*/
     updateAllDocsFromPreview: function (event) {
       var view = event.view,
       rows = event.rows,


[08/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
delete unused variable


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/1db30569
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/1db30569
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/1db30569

Branch: refs/heads/secondary-indexes
Commit: 1db30569c1436773e279fbd59d9ccf6d382519d3
Parents: 2283352
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Thu Aug 14 20:55:38 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon Aug 18 20:42:54 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/views.js | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1db30569/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index b68df87..fef3106 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -380,7 +380,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     toggleDocument: function (event) {
       var $row = this.$(event.target).closest('tr'),
           docId = $row.attr('data-id'),
-          db = this.database.get('id'),
           rev = this.collection.get(docId).get('_rev'),
           data = {_id: docId, _rev: rev, _deleted: true};
 


[07/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Fix deletion of docs that where selected using select-all

- add docs on page to bulk-delete-collection on select-all-click,
  which also reenables the trash-button
- make AllDocs testable, enable injection for viewMeta

Closes COUCHDB-2291


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/4b3e5c97
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/4b3e5c97
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/4b3e5c97

Branch: refs/heads/secondary-indexes
Commit: 4b3e5c97f0f7b0f4efe0f3ad441186f4606cb1fe
Parents: 1db3056
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Thu Aug 14 20:55:49 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon Aug 18 20:42:54 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/resources.js               |  1 +
 app/addons/documents/tests/views-sidebarSpec.js | 14 +++----
 app/addons/documents/tests/viewsSpec.js         | 39 ++++++++++++++++++--
 app/addons/documents/views.js                   | 30 ++++++++++++++-
 4 files changed, 72 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4b3e5c97/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/resources.js b/app/addons/documents/resources.js
index dc71153..e1df569 100644
--- a/app/addons/documents/resources.js
+++ b/app/addons/documents/resources.js
@@ -396,6 +396,7 @@ function(app, FauxtonAPI, PagingCollection) {
       return "docs";
     },
     initialize: function(_models, options) {
+      this.viewMeta = options.viewMeta;
       this.database = options.database;
       this.params = _.clone(options.params);
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4b3e5c97/app/addons/documents/tests/views-sidebarSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/views-sidebarSpec.js b/app/addons/documents/tests/views-sidebarSpec.js
index 216a21b..c8286bf 100644
--- a/app/addons/documents/tests/views-sidebarSpec.js
+++ b/app/addons/documents/tests/views-sidebarSpec.js
@@ -19,14 +19,14 @@ define([
 
   describe('Documents Sidebar', function () {
     var view;
-      beforeEach(function () {
-        viewSandbox = new ViewSandbox();
-        viewSandbox.renderView(view);
-      });
+    beforeEach(function () {
+      viewSandbox = new ViewSandbox();
+      viewSandbox.renderView(view);
+    });
 
-      afterEach(function () {
-        viewSandbox.remove();
-      });
+    afterEach(function () {
+      viewSandbox.remove();
+    });
   });
 });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4b3e5c97/app/addons/documents/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/viewsSpec.js b/app/addons/documents/tests/viewsSpec.js
index 639b116..44e4843 100644
--- a/app/addons/documents/tests/viewsSpec.js
+++ b/app/addons/documents/tests/viewsSpec.js
@@ -11,14 +11,47 @@
 // the License.
 define([
         'addons/documents/views',
+        'addons/documents/resources',
         'addons/databases/base',
         'testUtils'
-], function (Views, Databases, testUtils) {
-  var assert = testUtils.assert;
+], function (Views, Resources, Databases, testUtils) {
+  var assert = testUtils.assert,
+      ViewSandbox = testUtils.ViewSandbox,
+      viewSandbox;
+
+  describe('AllDocsList', function () {
+    var database = new Databases.Model({id: 'registry'}),
+        bulkDeleteDocCollection = new Resources.BulkDeleteDocCollection([], {databaseId: 'registry'});
+
+    database.allDocs = new Resources.AllDocs({_id: "ente"}, {
+      database: database,
+      viewMeta: {update_seq: 1},
+      params: {}
+    });
+
+    var view = new Views.Views.AllDocsList({
+      viewList: false,
+      bulkDeleteDocsCollection: bulkDeleteDocCollection,
+      collection: database.allDocs
+    });
+
+    beforeEach(function () {
+      viewSandbox = new ViewSandbox();
+      viewSandbox.renderView(view);
+    });
+
+    afterEach(function () {
+      viewSandbox.remove();
+    });
 
-  describe('DocumentsViews', function () {
     it('should load', function () {
       assert.equal(typeof Views.Views.AllDocsList, 'function');
     });
+
+    it('pressing SelectAll should fill the delete-bulk-docs-collection', function () {
+      assert.equal(bulkDeleteDocCollection.length, 0);
+      view.$('button.all').trigger('click');
+      assert.equal(bulkDeleteDocCollection.length, 1);
+    });
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4b3e5c97/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index fef3106..545f4d6 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -430,8 +430,34 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       });
     },
 
-    selectAll: function(evt){
-      $('.all-docs').find("input:checkbox").prop('checked', !$(evt.target).hasClass('active')).trigger('change');
+    selectAll: function (evt) {
+      var $allDocs = this.$('.all-docs'),
+          $rows = $allDocs.find('tr'),
+          $checkboxes = $allDocs.find('input:checkbox'),
+          modelsAffected,
+          docs;
+
+      $checkboxes.prop('checked', !$(evt.target).hasClass('active')).trigger('change');
+
+      if ($(evt.target).hasClass('active')) {
+        modelsAffected = _.reduce($rows, function (acc, el) {
+          var docId = $(el).attr('data-id');
+          acc.push(docId);
+          return acc;
+        }, []);
+        this.bulkDeleteDocsCollection.remove(modelsAffected);
+      } else {
+        modelsAffected = _.reduce($rows, function (acc, el) {
+          var docId = $(el).attr('data-id'),
+              rev = this.collection.get(docId).get('_rev');
+
+          acc.push({_id: docId, _rev: rev, _deleted: true});
+          return acc;
+        }, [], this);
+        this.bulkDeleteDocsCollection.add(modelsAffected);
+      }
+
+      this.toggleTrash();
     },
 
     serialize: function() {


[14/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
couchapp@0.11.x

removes the horn on push which breaks on linux


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/9d8900bd
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/9d8900bd
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/9d8900bd

Branch: refs/heads/secondary-indexes
Commit: 9d8900bd09f8b6e1c35292a2eb7088ac67851ca7
Parents: 43f0033
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sat Aug 23 22:44:35 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat Aug 23 22:44:35 2014 +0200

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/9d8900bd/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 60a02f5..e8d497a 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
     "async": "~0.2.6",
     "grunt": "~0.4.1",
     "grunt-cli": "~0.1.6",
-    "couchapp": "~0.9.1",
+    "couchapp": "~0.11.0",
     "grunt-contrib-cssmin": "~0.5.0",
     "grunt-contrib-clean": "~0.4.1",
     "grunt-contrib-jshint": "~0.6.0",


[11/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Sidebar improvements

Some UX improvements to the sidebar in a database view


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/b7c32c2d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/b7c32c2d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/b7c32c2d

Branch: refs/heads/secondary-indexes
Commit: b7c32c2d104f7498942c57f0ab7676383eee4a33
Parents: 3628fe5
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Aug 13 11:54:07 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Aug 20 10:56:13 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/routes.js                  | 10 +--
 .../documents/templates/design_doc_menu.html    |  2 +-
 .../documents/templates/index_menu_item.html    |  4 +-
 app/addons/documents/templates/sidebar.html     |  2 +-
 app/addons/documents/tests/routeSpec.js         | 35 +++++++++++
 app/addons/documents/views-sidebar.js           | 65 +++++++++++++-------
 assets/less/fauxton.less                        |  2 +
 7 files changed, 88 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7c32c2d/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index 3fd94f9..8eca7f6 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -134,7 +134,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
         route: "allDocs",
         roles: ["_reader","_writer","_admin"]
       },
-      "database/:database/_design/:ddoc/_view/:view": {
+      "database/:database/_design/:ddoc/_views/:view": {
         route: "viewFn",
         roles: ['_admin']
       },
@@ -182,8 +182,8 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
           pageSize: 500
         },
         params: {
-          startkey: '_design',
-          endkey: '_design1',
+          startkey: '_design/',
+          endkey: '_design0',
           include_docs: true,
           limit: 500
         }
@@ -503,7 +503,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
       }
     },
 
-    changes: function (event) {
+    changes: function () {
       var docParams = app.getParams();
       this.data.database.buildChanges(docParams);
 
@@ -531,7 +531,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
       };
 
       this.apiUrl = function() {
-        return [this.data.database.url("apiurl"), this.data.database.documentation()];
+        return [this.data.database.url("changes-apiurl"), this.data.database.documentation()];
       };
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7c32c2d/app/addons/documents/templates/design_doc_menu.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/design_doc_menu.html b/app/addons/documents/templates/design_doc_menu.html
index 1227d33..8180f48 100644
--- a/app/addons/documents/templates/design_doc_menu.html
+++ b/app/addons/documents/templates/design_doc_menu.html
@@ -16,7 +16,7 @@ the License.
 	<div  class="js-collapse-toggle accordion-header" data-toggle="collapse" data-target="#<%- ddoc_clean %>" id="nav-header-<%- ddoc_clean %>" >
 		<div class="accordion-list-item">
 			<div class="fonticon-play"></div>
-			<p><%- designDoc%></p>
+			<p>_design/<%- designDoc%></p>
 		</div>
 		<div class="new-button add-dropdown"></div>
 	</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7c32c2d/app/addons/documents/templates/index_menu_item.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/index_menu_item.html b/app/addons/documents/templates/index_menu_item.html
index 8519f42..434a02a 100644
--- a/app/addons/documents/templates/index_menu_item.html
+++ b/app/addons/documents/templates/index_menu_item.html
@@ -14,12 +14,12 @@ the License.
 <a class="js-toggle-<%-ddocType%> accordion-header js-collapse-toggle" data-toggle="collapse"  data-target="#<%- removeSpecialCharacters(ddoc) + ddocType %>" id="nav-design-function-<%= removeSpecialCharacters(ddoc) + ddocType %>">
   <div class="fonticon-play"></div>
   <span class="<%- icon %> fonticon"></span>
-  <%- ddocType %>
+  <%- name %>
   </a>
   <ul class="accordion-body collapse" id="<%- removeSpecialCharacters(ddoc) + ddocType %>">
   <% _.each(collection, function (item, index) { %>
   <li>
-  <a data-ddoctype="<%- ddocType %>" id="<%- removeSpecialCharacters(ddoc) %>_<%- removeSpecialCharacters(index) %>" href="#/database/<%- safeURL(database) %>/_design/<%= safeURL(ddoc)%>/_<%=ddocType%>/<%= safeURL(index) %>" class="toggle-view">
+  <a data-ddoctype="<%- ddocType %>" id="<%- removeSpecialCharacters(ddoc) %>_<%- removeSpecialCharacters(index) %>" href="#/database/<%- safeURL(database) %>/_design/<%= safeURL(ddoc)%>/_<%-ddocType%>/<%= safeURL(index) %>" class="toggle-view">
     <%- index %>
   </a>
   </li>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7c32c2d/app/addons/documents/templates/sidebar.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/sidebar.html b/app/addons/documents/templates/sidebar.html
index 8d2ea4c..23d113f 100644
--- a/app/addons/documents/templates/sidebar.html
+++ b/app/addons/documents/templates/sidebar.html
@@ -23,7 +23,7 @@ the License.
       <div id="new-all-docs-button" class="add-dropdown"> </div>
    </li>
   <li>
-      <a id="design-docs" href='#<%= database.url("index") %>?startkey="_design"&endkey="_e"'  class="toggle-view"> All Design Docs</a>
+      <a id="design-docs" href='#<%= database.url("index") %>?startkey="_design"&endkey="_design0"'  class="toggle-view"> All Design Docs</a>
       <div id="new-design-docs-button" class="add-dropdown"> </div>
     </li>
 </ul>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7c32c2d/app/addons/documents/tests/routeSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/routeSpec.js b/app/addons/documents/tests/routeSpec.js
new file mode 100644
index 0000000..d7ecebd
--- /dev/null
+++ b/app/addons/documents/tests/routeSpec.js
@@ -0,0 +1,35 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+        'addons/documents/routes',
+        'testUtils'
+], function (Documents, testUtils) {
+  var assert = testUtils.assert;
+  var DocumentRoute = Documents.RouteObjects[2];
+
+  describe('Documents Route', function () {
+
+    describe('changes route', function () {
+
+      it('Should set correct changes api url', function () {
+        var docRoute = new DocumentRoute('changes', {}, ['fakeDB']);
+        docRoute.changes();
+
+        console.log('docRoute.apiUrl()', docRoute.apiUrl());
+        assert.ok(/\/database\/fakeDB\/_changes\?descending=true&limit=100&include_docs=true/.test(docRoute.apiUrl()[0]));
+      });
+
+    });
+  });
+
+});
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7c32c2d/app/addons/documents/views-sidebar.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-sidebar.js b/app/addons/documents/views-sidebar.js
index 8699417..9f8c0ee 100644
--- a/app/addons/documents/views-sidebar.js
+++ b/app/addons/documents/views-sidebar.js
@@ -60,27 +60,41 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
       };
     },
 
+    getNewButtonLinks: function () {
+      var database = this.collection.database,
+          newurlPrefix = "#" + database.url('app'),
+          addLinks = FauxtonAPI.getExtensions('sidebar:links');
 
-    beforeRender: function(manage) {
-      this.deleteDBModal = this.setView(
-        '#delete-db-modal',
-        new Views.DeleteDBModal({database: this.database})
-      );
+      return _.reduce(FauxtonAPI.getExtensions('sidebar:links'), function (menuLinks, link) {
 
-      var database = this.collection.database,
-          newurlPrefix = "#" + database.url('app');
+        menuLinks.push({
+          title: link.title,
+          url: newurlPrefix + "/" + link.url,
+          icon: 'fonticon-plus-circled'
+        });
 
-      var newLinks = [{
-        title: 'Add new',
-        links: [{
+        return menuLinks; 
+     }, [{
           title: 'New Doc',
           url: newurlPrefix + '/new',
           icon: 'fonticon-plus-circled'
         },{
-          title: 'New Design Doc',
+          title: 'New View',
           url: newurlPrefix + '/new_view',
           icon: 'fonticon-plus-circled'
-        }]
+        }]);
+    },
+
+
+    beforeRender: function(manage) {
+      this.deleteDBModal = this.setView(
+        '#delete-db-modal',
+        new Views.DeleteDBModal({database: this.database})
+      );
+
+      var newLinks = [{
+        title: 'Add new',
+        links: this.getNewButtonLinks()
       }];
 
       this.insertView("#new-all-docs-button", new Components.MenuDropDown({
@@ -137,14 +151,14 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     toggleArrow:  function(e){
       this.$(e.currentTarget).toggleClass("down");
     },
-    buildIndexList: function(collection, selector, ddocType){
+    buildIndexList: function(collection, info){
       var design = this.model.id.replace(/^_design\//,"");
 
       this.insertView(".accordion-body", new Views.IndexItem({
-        selector: selector,
+        selector: info.selector,
         ddoc: design,
-        collection: collection[selector],
-        ddocType: ddocType,
+        collection: collection[info.selector],
+        name: info.name,
         database: this.model.collection.database.id
       }));
     },
@@ -175,7 +189,7 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
 
         return menuLinks; 
      }, [{
-      title: 'Secondary View',
+      title: 'New View',
       url: "#" + database.url('app') + "/new_view/" + docSafe,
       icon: 'fonticon-plus-circled'
      }]);
@@ -188,9 +202,13 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
 
       if (!ddocDocs){ return; }
 
-      this.buildIndexList(ddocDocs, "views", "view");
-      _.each(sidebarListTypes, function (type) {
-        this.buildIndexList(ddocDocs, type);
+      this.buildIndexList(ddocDocs, {
+        selector: "views",
+        name: 'Views'
+      });
+
+      _.each(sidebarListTypes, function (info) {
+        this.buildIndexList(ddocDocs, info);
       },this);
 
     },
@@ -220,9 +238,9 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
       this.database = options.database;
       this.selected = !! options.selected;
       this.selector = options.selector;
-      this.ddocType = options.ddocType || this.selector;
+      this.name = options.name;
       this.icons = {
-        "view": "fonticon-sidenav-map-reduce",
+        "Views": "fonticon-sidenav-map-reduce",
         "indexes": "fonticon-sidenav-search"
       };
 
@@ -231,7 +249,8 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     serialize: function() {
       return {
         icon: this.icons[this.ddocType],
-        ddocType:  this.ddocType,
+        ddocType:  this.selector,
+        name: this.name,
         index: this.index,
         ddoc: this.ddoc,
         database: this.database,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7c32c2d/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 2032b04..93afce6 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -365,6 +365,8 @@ table.databases {
         .transition(all @transitionSpeed @transitionEaseType);
         padding: 22px 0 0 18px;
         position: fixed;
+        z-index: 100;
+        width: 64px;
         top: 0;
         background-color: @primaryNav;
         width: @navWidth;


[44/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
removed that one index spec because it seemed like a place holder?  Fixed the paginate Spec to include the correct resources
removed table view from dropdown
remove unused eventer
comment language update
Removed Pouch for now
remove index-components placeholder file
error and comment clean up. All errors will be shown in the global section
Removed comment. Fixed case on event
padding to design doc meta data
Add Unbinds to the global events on cleanup. This will fix that delete triggering the popup a bunch of times issue
Fixed on On Save and Build Index
removed Preview from the indexes since it's borked
Fauxton events in one line
search icon alignment
Verify install too cramped
Config add new button was hidden
Api button alignment on non all DBs pages


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/8688d16f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/8688d16f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/8688d16f

Branch: refs/heads/secondary-indexes
Commit: 8688d16f3bf99cc1a57e938258afbb01c8c72b70
Parents: 66d9757
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:37 2014 -0400

----------------------------------------------------------------------
 app/addons/config/assets/less/config.less       |  2 +
 app/addons/databases/views.js                   |  1 -
 app/addons/documents/routes.js                  | 13 ----
 .../documents/templates/select-doc-menu.html    |  5 +-
 app/addons/documents/tests/views-indexSpec.js   | 33 ----------
 app/addons/documents/views-advancedopts.js      |  6 +-
 app/addons/documents/views-sidebar.js           |  4 ++
 app/addons/documents/views.js                   | 28 +++++---
 app/addons/fauxton/components.js                |  4 ++
 app/addons/fauxton/tests/paginateSpec.js        | 11 ++--
 app/addons/indexes/index-components.js          | 30 ---------
 app/addons/indexes/resources.js                 | 69 --------------------
 app/addons/indexes/routes-core.js               | 49 +++++++-------
 app/addons/indexes/views.js                     | 60 ++---------------
 .../assets/less/verifyinstall.less              |  1 +
 app/addons/verifyinstall/views.js               |  3 +-
 app/core/api.js                                 |  4 +-
 assets/less/fauxton.less                        |  8 +++
 assets/less/headers.less                        | 19 +++++-
 assets/less/pagination.less                     |  1 +
 20 files changed, 98 insertions(+), 253 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/config/assets/less/config.less
----------------------------------------------------------------------
diff --git a/app/addons/config/assets/less/config.less b/app/addons/config/assets/less/config.less
index 24bbab8..f7b61f8 100644
--- a/app/addons/config/assets/less/config.less
+++ b/app/addons/config/assets/less/config.less
@@ -11,7 +11,9 @@
  *  the License.
  */
 .config-item {
+  margin-top:60px;
   height: 65px;
+  margin-bottom: 10px;
 
   .js-value-input {
     width: 80%;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/databases/views.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/views.js b/app/addons/databases/views.js
index e2f0d52..a0fe6f0 100644
--- a/app/addons/databases/views.js
+++ b/app/addons/databases/views.js
@@ -21,7 +21,6 @@ define([
 function(app, Components, FauxtonAPI, Databases) {
   var Views = {};
 
-  //Header for alldocs with search, Query options,& api bar
   Views.RightAllDBsHeader = FauxtonAPI.View.extend({
     className: "header-right",
     template: "addons/databases/templates/header_alldbs",

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index 46fbc51..600b215 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -392,19 +392,6 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       };
     },
 
-    // createViewDocumentsView: function (options) {
-
-    //   return this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
-    //     database: options.database,
-    //     collection: options.indexedDocs,
-    //     nestedView: Documents.Views.Row,
-    //     viewList: true,
-    //     ddocInfo: this.ddocInfo(options.designDoc, options.designDocs, options.view),
-    //     docParams: options.docParams,
-    //     params: options.urlParams
-    //   }));
-    // },
-
     updateAllDocsFromView: function (event) {
       var view = event.view,
           params = this.createParams(),

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/documents/templates/select-doc-menu.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/select-doc-menu.html b/app/addons/documents/templates/select-doc-menu.html
index a00c851..44295c9 100644
--- a/app/addons/documents/templates/select-doc-menu.html
+++ b/app/addons/documents/templates/select-doc-menu.html
@@ -21,9 +21,6 @@ the License.
 
 <button class="button btn btn-small disabled js-bulk-delete"><i class="icon-trash"></i></button>
 
-<% if (expandDocs) { %>
+
 <button id="collapse" class="button btn btn-small"><i class="icon-minus"></i> Collapse</button>
-<% } else { %>
-<button id="collapse" class="button btn btn-small"><i class="icon-plus"></i> Expand</button>
-<% } %>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/documents/tests/views-indexSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/views-indexSpec.js b/app/addons/documents/tests/views-indexSpec.js
deleted file mode 100644
index 7012a04..0000000
--- a/app/addons/documents/tests/views-indexSpec.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-define([
-        'addons/documents/views-index',
-        'testUtils'
-], function (Views, testUtils) {
-  var assert = testUtils.assert,
-      ViewSandbox = testUtils.ViewSandbox,
-      viewSandbox;
-
-  describe('Documents Indexes', function () {
-    var view;
-      beforeEach(function () {
-        viewSandbox = new ViewSandbox();
-        viewSandbox.renderView(view);
-      });
-
-      afterEach(function () {
-        viewSandbox.remove();
-      });
-  });
-});
-
-

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/documents/views-advancedopts.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-advancedopts.js b/app/addons/documents/views-advancedopts.js
index 993750f..75c00a9 100644
--- a/app/addons/documents/views-advancedopts.js
+++ b/app/addons/documents/views-advancedopts.js
@@ -66,7 +66,7 @@ function(app, FauxtonAPI, resizeColumns ) {
       $('#dashboard-content').scrollTop(0);
       this.$('#query-options-tray').toggle();
       FauxtonAPI.Events.trigger('APIbar:closeTray');
-    }, 
+    },
 
     closeTray: function(){
       $('#query-options-tray').hide();
@@ -278,7 +278,9 @@ function(app, FauxtonAPI, resizeColumns ) {
         }
       }, this);
     },
-
+    cleanup: function (){
+      FauxtonAPI.Events.unbind('AdvancedOptions:closeTray');
+    },
     serialize: function () {
       return {
         hasReduce: this.hasReduce,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/documents/views-sidebar.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-sidebar.js b/app/addons/documents/views-sidebar.js
index 3b970cb..21a6f25 100644
--- a/app/addons/documents/views-sidebar.js
+++ b/app/addons/documents/views-sidebar.js
@@ -117,6 +117,10 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
       },this);
     },
 
+    cleanup: function(){
+      FauxtonAPI.Events.unbind('database:delete');
+    },
+
     afterRender: function () {
       if (this.selectedTab) {
         this.setSelectedTab(this.selectedTab);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 22cdf65..d787474 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -38,7 +38,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     });
   }
 
-  //Header for alldocs with search, Query options,& api bar
   Views.RightAllDocsHeader = FauxtonAPI.View.extend({
     className: "header-right",
     template: "addons/documents/templates/header_alldocs",
@@ -55,9 +54,14 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       FauxtonAPI.Events.on('success:bulkDelete', this.selectAllMenu);
     },
 
+    cleanup:function(){
+      FauxtonAPI.Events.unbind('advancedOptions:updateView');
+      FauxtonAPI.Events.unbind('success:bulkDelete');
+    },
+
     selectAllMenu: function(e){
       FauxtonAPI.triggerRouteEvent("toggleSelectHeader");
-      FauxtonAPI.Events.trigger("documents:show-select-all",this.selectVisible);
+      FauxtonAPI.Events.trigger("documents:showSelectAll",this.selectVisible);
     },
 
     addAllDocsMenu: function(){
@@ -127,21 +131,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
       if (_.any(errorParams)) {
         _.map(errorParams, function(param) {
-
-          // TODO: Where to add this error?
-          // bootstrap wants the error on a control-group div, but we're not using that
-          //$('form.view-query-update input[name='+param+'], form.view-query-update select[name='+param+']').addClass('error');
           return FauxtonAPI.addNotification({
             msg: "JSON Parse Error on field: "+param.name,
             type: "error",
-            selector: ".advanced-options .errors-container",
             clear:  true
           });
         });
         FauxtonAPI.addNotification({
           msg: "Make sure that strings are properly quoted and any other values are valid JSON structures",
           type: "warning",
-          selector: ".advanced-options .errors-container",
           clear:  true
         });
 
@@ -172,7 +170,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
     selectAllMenu: function(e){
       FauxtonAPI.triggerRouteEvent("toggleSelectHeader");
-      FauxtonAPI.Events.trigger("documents:show-select-all",this.selectVisible);
+      FauxtonAPI.Events.trigger("documents:showSelectAll",this.selectVisible);
     },
 
     bulkDelete: function(){
@@ -240,16 +238,23 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     className: function(){
       return (this.showSelect? "showSelect":"") + " all-docs-item doc-row";
     },
+
     initialize: function (options) {
       this.checked = options.checked;
       this.expanded = options.expanded;
       this.showSelect = false;
       _.bindAll(this);
-      FauxtonAPI.Events.on("documents:show-select-all", this.showSelectBox);
+      FauxtonAPI.Events.on("documents:showSelectAll", this.showSelectBox);
       FauxtonAPI.Events.on("documents:collapse", this.collapse);
       FauxtonAPI.Events.on("documents:selectAll", this.selectAll);
     },
 
+    cleanup: function(){
+      FauxtonAPI.Events.unbind("documents:showSelectAll");
+      FauxtonAPI.Events.unbind("documents:collapse");
+      FauxtonAPI.Events.unbind("documents:selectAll");
+    },
+
     showSelectBox: function(bool){
       this.$el.toggleClass('showSelect');
     },
@@ -534,6 +539,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     },
 
     cleanup: function () {
+      FauxtonAPI.Events.unbind("documents:bulkDelete");
+      FauxtonAPI.Events.unbind("documents:selectAll");
       this.pagination && this.pagination.remove();
       this.allDocsNumber && this.allDocsNumber.remove();
       _.each(this.rows, function (row) {row.remove();});
@@ -640,6 +647,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
 
   Views.DdocInfo = FauxtonAPI.View.extend({
+    className: "view",
     template: "addons/documents/templates/ddoc_info",
 
     initialize: function (options) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index e8bd559..afec0b4 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -140,6 +140,10 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
       this.render();
     },
 
+    cleanup: function(){
+      FauxtonAPI.Events.unbind('APIbar:closeTray');
+    },
+
     afterRender: function(){
       ZeroClipboard.config({ moviePath: "/assets/js/plugins/zeroclipboard/ZeroClipboard.swf" });
       var client = new ZeroClipboard(this.$(".copy-url"));

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/fauxton/tests/paginateSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/tests/paginateSpec.js b/app/addons/fauxton/tests/paginateSpec.js
index f97b255..2974f61 100644
--- a/app/addons/fauxton/tests/paginateSpec.js
+++ b/app/addons/fauxton/tests/paginateSpec.js
@@ -13,17 +13,18 @@ define([
        'app',
        'addons/fauxton/components',
        'addons/documents/resources',
+       'addons/indexes/resources',
        'testUtils',
        'api'
-], function (app, Views, Models, testUtils, FauxtonAPI) {
+], function (app, Views, Models, IndexModels, testUtils, FauxtonAPI) {
   var assert = testUtils.assert,
   ViewSandbox = testUtils.ViewSandbox;
 
 
   describe('IndexPaginate', function () {
     var viewSandbox, paginate, collection, navigateMock;
-    beforeEach(function (done) {
-      collection = new Models.IndexCollection([{
+    beforeEach(function () {
+      collection = new IndexModels.IndexCollection([{
         id:'myId1',
         doc: 'num1'
       },
@@ -43,7 +44,7 @@ define([
         canShowNextfn: function () { return true;}
       });
       viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(paginate, done); 
+      viewSandbox.renderView(paginate);
     });
 
     afterEach(function () {
@@ -55,7 +56,7 @@ define([
         //do this so it doesn't throw an error on other unwired up components
         FauxtonAPI.triggerRouteEvent = function () {};
         //FauxtonAPI.triggerRouteEvent.restore && FauxtonAPI.triggerRouteEvent.restore();
-        //FauxtonAPI.navigate.restore && FauxtonAPI.navigate.restore(); 
+        //FauxtonAPI.navigate.restore && FauxtonAPI.navigate.restore();
       });
 
       it('Should trigger routeEvent', function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/indexes/index-components.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/index-components.js b/app/addons/indexes/index-components.js
deleted file mode 100644
index 1ec34e2..0000000
--- a/app/addons/indexes/index-components.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-
-/*
-  Index components includes any common, generic, and reusable code for creating secondary indexes
-  View functions, List functions, Show Functions, and Filter functions, as well as anything created by
-  couchdb affiliates.
-*/
-
-define([
-  "app",
-  "api"
-],
-
-function(app, FauxtonAPI) {
-  var Components = {};
-
-
-  return Components;
-});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/indexes/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/resources.js b/app/addons/indexes/resources.js
index 626d984..2b5fbe7 100644
--- a/app/addons/indexes/resources.js
+++ b/app/addons/indexes/resources.js
@@ -77,75 +77,6 @@ function(app, FauxtonAPI, PagingCollection) {
   });
 
 
-  Resources.PouchIndexCollection = PagingCollection.extend({
-    model: Resources.ViewRow,
-    documentation: function(){
-      return "docs";
-    },
-    initialize: function(_models, options) {
-      this.database = options.database;
-      this.rows = options.rows;
-      this.view = options.view;
-      this.design = options.design.replace('_design/','');
-      this.params = _.extend({limit: 20, reduce: false}, options.params);
-
-      this.idxType = "_view";
-    },
-
-    url: function () {
-      return '';
-    },
-
-    simple: function () {
-      var docs = this.map(function (item) {
-        return {
-          _id: item.id,
-          key: item.get('key'),
-          value: item.get('value')
-        };
-      });
-
-      return new Resources.PouchIndexCollection(docs, {
-        database: this.database,
-        params: this.params,
-        view: this.view,
-        design: this.design,
-        rows: this.rows
-      });
-
-    },
-
-    fetch: function() {
-      var deferred = FauxtonAPI.Deferred();
-      this.reset(this.rows, {silent: true});
-
-      this.viewMeta = {
-        total_rows: this.rows.length,
-        offset: 0,
-        update_seq: false
-      };
-
-      deferred.resolve();
-      return deferred;
-    },
-
-    totalRows: function() {
-      return this.viewMeta.total_rows || "unknown";
-    },
-
-    updateSeq: function() {
-      return this.viewMeta.update_seq || false;
-    },
-
-    buildAllDocs: function(){
-      this.fetch();
-    },
-
-    allDocs: function(){
-      return this.models;
-    }
-  });
-
 
   Resources.IndexCollection = PagingCollection.extend({
     model: Resources.ViewRow,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/indexes/routes-core.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-core.js b/app/addons/indexes/routes-core.js
index 402ae99..1277c6b 100644
--- a/app/addons/indexes/routes-core.js
+++ b/app/addons/indexes/routes-core.js
@@ -63,7 +63,6 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
     },
 
     events: {
-      "route:updatePreviewDocs": "updateAllDocsFromPreview",
       "route:perPageChange": "perPageChange",
       "route:paginate": "paginate",
       "route:updateAllDocs": "updateAllDocsFromView"
@@ -125,7 +124,7 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
     },
 
     /* --------------------------------------------------
-      Stored docs in preview
+      determines how many docs to display for the request
     ----------------------------------------------------*/
     getDocPerPageLimit: function (urlParams, perPage) {
       var storedPerPage = perPage;
@@ -174,6 +173,28 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
         collection = this.data.database.allDocs;
         collection.paging.pageSize = pageSize;
 
+      } else {
+        collection = this.data.indexedDocs = new Resources.IndexCollection(null, {
+          database: this.data.database,
+          design: ddoc,
+          view: view,
+          params: docParams,
+          paging: {
+            pageSize: pageSize
+          }
+        });
+
+        if (!this.documentsView) {
+          this.documentsView = this.createViewDocumentsView({
+            designDoc: ddoc,
+            docParams: docParams,
+            urlParams: urlParams,
+            database: this.data.database,
+            indexedDocs: this.indexedDocs,
+            designDocs: this.data.designDocs,
+            view: view
+          });
+        }
       }
 
       this.documentsView.setCollection(collection);
@@ -195,30 +216,6 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
         docParams: options.docParams,
         params: options.urlParams
       }));
-    },
-
-
-    /* --------------------------------------------------
-      If Preview worked....
-    ----------------------------------------------------*/
-    updateAllDocsFromPreview: function (event) {
-      var view = event.view,
-      rows = event.rows,
-      ddoc = event.ddoc;
-
-      this.data.indexedDocs = new Documents.PouchIndexCollection(null, {
-        database: this.data.database,
-        design: ddoc,
-        view: view,
-        rows: rows
-      });
-
-      this.documentsView = this.setView("#right-content", new Documents.Views.AllDocsList({
-        database: this.data.database,
-        collection: this.data.indexedDocs,
-        nestedView: Views.Row,
-        viewList: true
-      }));
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
index 421495f..a0d5d0d 100644
--- a/app/addons/indexes/views.js
+++ b/app/addons/indexes/views.js
@@ -46,7 +46,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       this.api = options.api;
       this.endpoint = options.endpoint;
       this.documentation = options.documentation;
-      this.eventer = _.extend({}, Backbone.Events);
       FauxtonAPI.Events.on('advancedOptions:updateView', this.updateView);
     },
     updateApiUrl: function(api){
@@ -66,10 +65,14 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
         viewName: this.viewName,
         ddocName: this.model.id,
         hasReduce: this.hasReduce(),
-        eventer: this.eventer,
         showStale: true
       }));
     },
+
+    cleanup: function(){
+      FauxtonAPI.Events.unbind('advancedOptions:updateView');
+    },
+
     hasReduce: function(){
 
     },
@@ -81,10 +84,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
        if (_.any(errorParams)) {
          _.map(errorParams, function(param) {
-
-           // TODO: Where to add this error?
-           // bootstrap wants the error on a control-group div, but we're not using that
-           //$('form.view-query-update input[name='+param+'], form.view-query-update select[name='+param+']').addClass('error');
            return FauxtonAPI.addNotification({
              msg: "JSON Parse Error on field: "+param.name,
              type: "error",
@@ -107,48 +106,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
        FauxtonAPI.navigate(fragment, {trigger: false});
        FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: this.ddocID, view: this.viewName});
-    },
-
-
-    previewView: function(event, paramsInfo) {
-      event.preventDefault();
-      var that = this,
-      mapVal = this.mapVal(),
-      reduceVal = this.reduceVal(),
-      paramsArr = [];
-
-      if (paramsInfo && paramsInfo.params) {
-        paramsArr = paramsInfo.params;
-      }
-
-      var params = _.reduce(paramsArr, function (params, param) {
-        params[param.name] = param.value;
-        return params;
-      }, {reduce: false});
-
-      FauxtonAPI.addNotification({
-        msg: "<strong>Warning!</strong> Preview executes the Map/Reduce functions in your browser, and may behave differently from CouchDB.",
-        type: "warning",
-        fade: true,
-        escape: false // beware of possible XSS when the message changes
-      });
-
-      var promise = FauxtonAPI.Deferred();
-
-      if (!this.database.allDocs || this.database.allDocs.params.include_docs !== true) {
-        this.database.buildAllDocs({limit: Databases.DocLimit.toString(), include_docs: true});
-        promise = this.database.allDocs.fetch();
-       } else {
-        promise.resolve();
-       }
-
-      promise.then(function () {
-        params.docs = that.database.allDocs.map(function (model) { return model.get('doc');});
-        var queryPromise = pouchdb.runViewQuery({map: mapVal, reduce: reduceVal}, params);
-        queryPromise.then(function (results) {
-          FauxtonAPI.triggerRouteEvent('updatePreviewDocs', {rows: results.rows, ddoc: that.getCurrentDesignDoc().id, view: that.viewName});
-        });
-      });
     }
   });
 
@@ -177,9 +134,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     beforeRender: function(){
       var newLinks = [{
         links: [{
-          title: 'Table',
-          icon: 'fonticon-table'
-        },{
           title: 'JSON',
           icon: 'fonticon-json'
         }]
@@ -265,8 +219,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
   });
 
 
-
-
   Views.ViewEditor = FauxtonAPI.View.extend({
     template: "addons/indexes/templates/view_editor",
     builtinReduces: ['_sum', '_count', '_stats'],
@@ -275,7 +227,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       "click button.save": "saveView",
       "click button.delete": "deleteView",
       "change select#reduce-function-selector": "updateReduce",
-      "click button.preview": "previewView",
       "click #db-views-tabs-nav": 'toggleIndexNav',
       "click .beautify_map":  "beautifyCode",
       "click .beautify_reduce":  "beautifyCode"
@@ -629,6 +580,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       targetEditor.setValue(beautifiedCode);
     },
     cleanup: function () {
+      FauxtonAPI.Events.unbind('index:delete');
       this.mapEditor && this.mapEditor.remove();
       this.reduceEditor && this.reduceEditor.remove();
     }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/verifyinstall/assets/less/verifyinstall.less
----------------------------------------------------------------------
diff --git a/app/addons/verifyinstall/assets/less/verifyinstall.less b/app/addons/verifyinstall/assets/less/verifyinstall.less
index e084cb3..b1b15d5 100644
--- a/app/addons/verifyinstall/assets/less/verifyinstall.less
+++ b/app/addons/verifyinstall/assets/less/verifyinstall.less
@@ -11,6 +11,7 @@
 // the License.
 
 #start {
+  margin-top: 20px;
   margin-bottom: 20px;
 }
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/addons/verifyinstall/views.js
----------------------------------------------------------------------
diff --git a/app/addons/verifyinstall/views.js b/app/addons/verifyinstall/views.js
index 1e7e6f5..524e8e0 100644
--- a/app/addons/verifyinstall/views.js
+++ b/app/addons/verifyinstall/views.js
@@ -18,6 +18,7 @@ define([
 function(app, FauxtonAPI, VerifyInstall) {
 
   VerifyInstall.Main = FauxtonAPI.View.extend({
+    className: "view",
     template: 'addons/verifyinstall/templates/main',
 
     events: {
@@ -70,7 +71,7 @@ function(app, FauxtonAPI, VerifyInstall) {
       };
     },
 
-    
+
     startTest: function () {
       this.disableButton();
       this.$('.status').text('');

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/app/core/api.js
----------------------------------------------------------------------
diff --git a/app/core/api.js b/app/core/api.js
index 50a8b12..6053d65 100644
--- a/app/core/api.js
+++ b/app/core/api.js
@@ -27,9 +27,7 @@ function(FauxtonAPI, Layout, Router, RouteObject, utils) {
   });
 
   //global app events
-  FauxtonAPI.Events = {};
-  _.extend(FauxtonAPI.Events, Backbone.Events);
-
+  FauxtonAPI.Events = _.extend({}, Backbone.Events);
 
   FauxtonAPI.navigate = function(url, _opts) {
     var options = _.extend({trigger: true}, _opts );

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 74c698a..0b3fede 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -248,6 +248,14 @@ div.spinner {
   top: 50%;
 }
 
+#api-navbar{
+  > div{
+    > .api-url-btn {
+      padding:10px;
+    }
+  }
+}
+
 .api-url-btn {
   .icon {
     font-size: 11px;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/assets/less/headers.less b/assets/less/headers.less
index 1ef0743..27feffa 100644
--- a/assets/less/headers.less
+++ b/assets/less/headers.less
@@ -90,7 +90,7 @@
       height: 60px;
       vertical-align: top;
       &:first-child {
-        font-size: 30px;
+        font-size: 24px;
         .with-sidebar &,
         .two-pane & {
           padding:20px 10px;
@@ -209,9 +209,15 @@
       border: none;
       position: absolute;
       right: 12px;
-      top: 8px;
+      top: 0px;
+      height:60px;
       z-index: 2;
       color: #999;
+      .icon-search{
+        position: absolute;
+        top: 22px;
+        right: 15px;
+      }
     }
   }
   > div {
@@ -230,3 +236,12 @@
   right: 25px;
 }
 
+#jump-to-doc{
+  .btn-primary {
+    .icon-search{
+      position: absolute;
+      top: 18px;
+      right: 15px;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8688d16f/assets/less/pagination.less
----------------------------------------------------------------------
diff --git a/assets/less/pagination.less b/assets/less/pagination.less
index df0740a..3911b90 100644
--- a/assets/less/pagination.less
+++ b/assets/less/pagination.less
@@ -11,6 +11,7 @@
  *  the License.
  */
 footer.pagination-footer {
+  min-width: 600px;
   position:fixed;
   background-color:#fff;
   bottom:0;


[21/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
style query options now it is inside header


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/a6d6ff84
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/a6d6ff84
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/a6d6ff84

Branch: refs/heads/secondary-indexes
Commit: a6d6ff847c98c5d1815da0e02c7d6d68c2b20da2
Parents: 6e29869
Author: Jenn Schiffer <je...@pancaketheorem.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:35:09 2014 -0400

----------------------------------------------------------------------
 .../documents/assets/less/advancedOptions.less  |   4 +-
 app/addons/documents/assets/less/documents.less |   2 +-
 .../documents/templates/header_alldocs.html     |  41 +++---
 app/addons/documents/views.js                   | 127 ++++++++++++-------
 4 files changed, 104 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a6d6ff84/app/addons/documents/assets/less/advancedOptions.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/advancedOptions.less b/app/addons/documents/assets/less/advancedOptions.less
index b68dfd5..a932559 100644
--- a/app/addons/documents/assets/less/advancedOptions.less
+++ b/app/addons/documents/assets/less/advancedOptions.less
@@ -12,7 +12,7 @@
 /*ALL DOCS TABLE*/
 
 /*for advanced options css*/
-#query {
+#query-options {
   .border-radius(5px);
   width: 490px;
   position: absolute;
@@ -78,7 +78,7 @@
     }
   }
 }
-#query:before {
+#query-options:before {
   content: '';
   position: absolute;
   top: -25px;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a6d6ff84/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index b52e54f..647e847 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -42,7 +42,7 @@ button.beautify {
 }
 
 
-#query div.controls-group.well{
+#query-options div.controls-group.well{
     height: 180px;
     margin-right: 17px;
 }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a6d6ff84/app/addons/documents/templates/header_alldocs.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html
index 72d49ad..6312a47 100644
--- a/app/addons/documents/templates/header_alldocs.html
+++ b/app/addons/documents/templates/header_alldocs.html
@@ -13,31 +13,32 @@ the License.
 -->
 
 <div class="header-left">
-<!--back arrow-->
-
-<!--title with dropdown DB search-->
-
-
-<!-- Menu gear-->
-
+  <!--back arrow-->
+   
+  <!--title with dropdown DB search-->
+  <h2><%-database%></h2>
+   
+  <!-- Menu gear-->
 </div>
-
-
+ 
+ 
 <div class="header-right">
   <!-- Select all -->
-
+   
   <!-- search (jump to doc)-->
   <div id="header-search" class="js-search searchbox-container"></div>
-
+   
   <!-- Query Options-->
-  <a id="toggle-query" href="#query" data-bypass="true" data-toggle="tab">
-    <i class="fonticon fonticon-plus"></i> 
-    Query Options
-  </a>
-
-  <div class="tab-content">
-    <div class="tab-pane" id="query">
+  <div class="header-query-options">
+    <a id="toggle-query" href="#query-options" data-bypass="true" data-toggle="tab">
+      <i class="fonticon fonticon-plus"></i>
+      Query Options
+    </a>
+    <!-- Insert the query options here :) -->
+    <div id="query-options">
+    </div>
   </div>
+ 
 </div>
-
-  <!--right margin for api bar-->
\ No newline at end of file
+ 
+<!--right margin for api bar-->
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a6d6ff84/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 50c9c77..0d8993c 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -1,3 +1,4 @@
+
 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
 // use this file except in compliance with the License. You may obtain a copy of
 // the License at
@@ -45,11 +46,18 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       'select .selectAllDocs': 'selectAllDocs'
     },
     initialize: function(options){
-
+      //adding the database to the object
+      this.database = options.database;
     },
     selectAllDocs: function(){
       //trigger event to select all in other view
     },
+    serialize: function() {
+      //basically if you want something in a template, You can define it here
+      return {
+        database: this.database.get('id')
+      };
+    },
     beforeRender:function(){
       //insert DB search dropdown
 
@@ -62,7 +70,75 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       }));
 
       //insert queryoptions
+      //that file is included in require() above and the argument is QueryOptions
+      // and it wants all these params:
+      /* Sooooo I searched this file for where Advanced options was originally inserted to see what the hell
+         is happening.  and it's in AllDocsLayout.  So I'm going to move some of those functions over here
+
+        These are required:
+        this.database = options.database;
+        this.updateViewFn = options.updateViewFn;
+        this.previewFn = options.previewFn;
+
+        these are booleans:
+        this.showStale = _.isUndefined(options.showStale) ? false : options.showStale;
+        this.hasReduce = _.isUndefined(options.hasReduce) ? true : options.hasReduce;
+
+        these you only need for view indexes, not all docs because they are about
+        specific views and design docs (ddocs, also views live inside a ddoc):
+        this.viewName = options.viewName;
+        this.ddocName = options.ddocName;
+      */
+      this.setView("#query-options", new QueryOptions.AdvancedOptions({
+        updateViewFn: this.updateAllDocs,
+        previewFn: this.previewView,
+        database: this.database,
+        hasReduce: false,
+        showPreview: false,
+      }));
+
+    },
+    //moved from alldocs layout
+    updateAllDocs: function (event, paramInfo) {
+      event.preventDefault();
+
+      var errorParams = paramInfo.errorParams,
+          params = paramInfo.params;
+
+      if (_.any(errorParams)) {
+        _.map(errorParams, function(param) {
+
+          // TODO: Where to add this error?
+          // bootstrap wants the error on a control-group div, but we're not using that
+          //$('form.view-query-update input[name='+param+'], form.view-query-update select[name='+param+']').addClass('error');
+          return FauxtonAPI.addNotification({
+            msg: "JSON Parse Error on field: "+param.name,
+            type: "error",
+            selector: ".advanced-options .errors-container",
+            clear:  true
+          });
+        });
+        FauxtonAPI.addNotification({
+          msg: "Make sure that strings are properly quoted and any other values are valid JSON structures",
+          type: "warning",
+          selector: ".advanced-options .errors-container",
+          clear:  true
+        });
+
+        return false;
+      }
+
+      var fragment = window.location.hash.replace(/\?.*$/, '');
+
+      if (!_.isEmpty(params)) {
+        fragment = fragment + '?' + $.param(params);
+      }
 
+      FauxtonAPI.navigate(fragment, {trigger: false});
+      FauxtonAPI.triggerRouteEvent('updateAllDocs', {allDocs: true});
+    },
+    previewView: function (event) {
+      event.preventDefault();
     }
   });
 
@@ -297,7 +373,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
     toggleQuery: function (event) {
       $('#dashboard-content').scrollTop(0);
-      this.$('#query').toggle();
+      this.$('#query-options').toggle();
     },
 
     beforeRender: function () {
@@ -312,56 +388,13 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       this.toolsView = this.setView(".js-search", new Views.JumpToDoc({
         database: this.database,
         collection: this.database.allDocs
-      })); 
+      }));
     },
 
     afterRender: function () {
       if (this.params) {
         this.advancedOptions.updateFromParams(this.params);
       }
-    },
-
-    updateAllDocs: function (event, paramInfo) {
-      event.preventDefault();
-
-      var errorParams = paramInfo.errorParams,
-          params = paramInfo.params;
-
-      if (_.any(errorParams)) {
-        _.map(errorParams, function(param) {
-
-          // TODO: Where to add this error?
-          // bootstrap wants the error on a control-group div, but we're not using that
-          //$('form.view-query-update input[name='+param+'], form.view-query-update select[name='+param+']').addClass('error');
-          return FauxtonAPI.addNotification({
-            msg: "JSON Parse Error on field: "+param.name,
-            type: "error",
-            selector: ".advanced-options .errors-container",
-            clear:  true
-          });
-        });
-        FauxtonAPI.addNotification({
-          msg: "Make sure that strings are properly quoted and any other values are valid JSON structures",
-          type: "warning",
-          selector: ".advanced-options .errors-container",
-          clear:  true
-        });
-
-        return false;
-      }
-
-      var fragment = window.location.hash.replace(/\?.*$/, '');
-
-      if (!_.isEmpty(params)) {
-        fragment = fragment + '?' + $.param(params);
-      }
-
-      FauxtonAPI.navigate(fragment, {trigger: false});
-      FauxtonAPI.triggerRouteEvent('updateAllDocs', {allDocs: true});
-    },
-
-    previewView: function (event) {
-      event.preventDefault();
     }
 
   });
@@ -434,7 +467,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
           rev = this.collection.get(docId).get('_rev'),
           data = {_id: docId, _rev: rev, _deleted: true};
 
-      if (!$row.hasClass('js-to-delete')) {
+      if (!$row.hasClass('js-to-delete')) {
         this.bulkDeleteDocsCollection.add(data);
       } else {
         this.bulkDeleteDocsCollection.remove(this.bulkDeleteDocsCollection.get(docId));


[27/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Adding Dropdown,
moving footer to the bottom,
fix events on select header doc,
use events for advanced options
expand and collapse
select toggle
Make pagination fixed to the bottom and update files with apache license


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/cd7b26f2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/cd7b26f2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/cd7b26f2

Branch: refs/heads/secondary-indexes
Commit: cd7b26f2fca1bade33545136cec8a169d278e431
Parents: f719ed1
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:35 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/assets/less/documents.less |   1 +
 app/addons/documents/resources.js               |   2 +-
 app/addons/documents/routes.js                  | 100 ++++++---
 .../documents/templates/all_docs_item.html      |   4 +-
 .../documents/templates/all_docs_list.html      |  24 +--
 .../documents/templates/header_alldocs.html     |   8 +-
 .../documents/templates/header_doc_edit.html    |  33 ---
 .../documents/templates/select-doc-menu.html    |  24 +++
 app/addons/documents/views-advancedopts.js      |   9 +-
 app/addons/documents/views-sidebar.js           |   2 +
 app/addons/documents/views.js                   | 212 +++++++++----------
 app/addons/fauxton/components.js                |  22 ++
 .../fauxton/templates/index_pagination.html     |  16 +-
 app/addons/fauxton/templates/menu_dropdown.html |   2 +
 app/addons/fauxton/templates/pagination.html    |   3 -
 app/addons/indexes/templates/header_right.html  |   2 +-
 app/addons/indexes/views.js                     |   4 +-
 app/core/api.js                                 |   7 +-
 assets/index.underscore                         |   4 -
 assets/less/fauxton.less                        |   1 +
 assets/less/headers.less                        |  12 ++
 assets/less/mixins.less                         |  28 ++-
 assets/less/pagination.less                     |  21 ++
 assets/less/templates.less                      |   8 +-
 24 files changed, 321 insertions(+), 228 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index 5a39fab..26e3ffa 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -17,6 +17,7 @@
 @import "advancedOptions.less";
 @import "changes.less";
 @import "sidenav.less";
+@import "headers.less";
 
 tr.all-docs-item {
   border: none;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/resources.js b/app/addons/documents/resources.js
index f95bf78..20d4378 100644
--- a/app/addons/documents/resources.js
+++ b/app/addons/documents/resources.js
@@ -359,7 +359,7 @@ function(app, FauxtonAPI, PagingCollection) {
       if (ids.errorIds.length) {
         this.trigger('error', ids.errorIds);
       }
-
+      FauxtonAPI.Events.trigger('success:bulkDelete');
       this.trigger('updated');
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index c1d61bd..994ca5c 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -22,11 +22,10 @@ define([
   "addons/documents/views-doceditor",
 
   "addons/databases/base",
-  "addons/documents/resources",
-  "addons/fauxton/components"
+  "addons/documents/resources"
 ],
 
-function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases, Resources, Components) {
+function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases, Resources) {
   /* --------------------------------------------------
     DOCUMENT EDITOR ROUTE OBJECT
   ----------------------------------------------------*/
@@ -185,13 +184,26 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
         }
       });
 
+      /* --------------------------------------------------
+        Set up breadcrumb header
+      ----------------------------------------------------*/
+      var crumbs = [
+        {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
+        {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)}
+      ];
+
+
+      this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
+        crumbs: crumbs,
+        dropdownMenu: this.setUpDropdown()
+      }));
 
       /* --------------------------------------------------
         Show right header for all docs that includes:
         query options, api bar, search and select
       ----------------------------------------------------*/
       this.changesHeader = true;
-      this.setAllDocsHeader();
+      this.resetAllDocsHeader();
 
       /* --------------------------------------------------
         Show the sidebar
@@ -203,7 +215,55 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       }));
     },
 
-    setAllDocsHeader: function(){
+    setUpDropdown: function(){
+      var defaultMenuLinks = [{
+        links: [{
+          title: 'Replicate Database',
+          icon: 'fonticon-replicate',
+          url: '#/replication/'+this.databaseName
+        },{
+          title: 'Delete',
+          icon: 'fonticon-trash',
+          trigger: 'database:delete'
+        }]
+      }];
+
+      defaultMenuLinks.push({
+        title: 'Add new',
+        links: this.getExtensionLinks()
+      });
+
+      return defaultMenuLinks;
+    },
+
+    getExtensionLinks: function () {
+      var database = this.data.database,
+          newurlPrefix = "#" + database.url('app');
+
+      var menuLinks = [{
+          title: 'New Doc',
+          url: newurlPrefix + '/new',
+          icon: 'fonticon-plus-circled'
+        },{
+          title: 'New Design Doc',
+          url: newurlPrefix + '/new_view',
+          icon: 'fonticon-plus-circled'
+      }];
+
+      return _.reduce(FauxtonAPI.getExtensions('sidebar:links'), function (menuLinks, link) {
+
+        menuLinks.push({
+          title: link.title,
+          url: newurlPrefix + "/" + link.url,
+          icon: 'fonticon-plus-circled'
+        });
+
+        return menuLinks;
+     }, menuLinks);
+
+    },
+
+    resetAllDocsHeader: function(){
       if (this.changesHeader){
         this.headerRight = this.setView("#api-navbar", new Documents.Views.RightAllDocsHeader({
           database: this.data.database
@@ -264,33 +324,11 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       }
 
 
-      /* --------------------------------------------------
-        Set up breadcrumb header
-      ----------------------------------------------------*/
-      var crumbs = [
-        {"name": "", "className": "fonticon-left-open", "link": "/_all_dbs"},
-        {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)}
-      ];
-
-      var dropdown = [{
-        links: [{
-          title: 'Duplicate Index',
-          icon: 'fonticon-documents'
-        },{
-          title: 'Delete',
-          icon: 'fonticon-trash'
-        }]
-      }];
-
-      this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
-        crumbs: crumbs,
-        dropdownMenu: dropdown
-      }));
 
       /*--------------------------------------------------
       reset header if you have to
       ----------------------------------------------------*/
-      this.setAllDocsHeader();
+      this.resetAllDocsHeader();
 
       /* --------------------------------------------------
         Build all docs
@@ -374,6 +412,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
 
       this.documentsView.setCollection(collection);
       this.documentsView.setParams(docParams, urlParams);
+      this.leftheader.forceRender();
       this.documentsView.forceRender();
 
       this.headerRight.updateApiUrl([collection.urlRef("apiurl", urlParams), "docs"]);
@@ -383,6 +422,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       // We need to restore the collection parameters to the defaults (1st page)
       // and update the page size
       this.perPage = perPage;
+      this.leftheader.forceRender();
       this.documentsView.forceRender();
       this.documentsView.collection.pageSizeReset(perPage, {fetch: false});
       this.setDocPerPageLimit(perPage);
@@ -390,7 +430,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
 
     paginate: function (options) {
       var collection = this.documentsView.collection;
-
+      this.leftheader.forceRender();
       this.documentsView.forceRender();
       collection.paging.pageSize = options.perPage;
       var promise = collection[options.direction]({fetch: false});
@@ -485,7 +525,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
     removeFilter: function (filter) {
       this.changesView.filters.splice(this.changesView.filters.indexOf(filter), 1);
       this.changesView.render();
-    },
+    }
 
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/templates/all_docs_item.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_item.html b/app/addons/documents/templates/all_docs_item.html
index 4526df2..783e4f5 100644
--- a/app/addons/documents/templates/all_docs_item.html
+++ b/app/addons/documents/templates/all_docs_item.html
@@ -12,8 +12,8 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<div class="select"><input <%- checked ? 'checked="checked"' : '' %> type="checkbox" class="js-row-select"></div>
-<div class="doc-item">
+<div class="select" <% if (!showSelect){ %>style="display:none"<%}%> ><input <%- checked ? 'checked="checked"' : '' %> type="checkbox" class="js-row-select"></div>
+<div class="doc-item  ">
 
   <header>
     _id <span class="header-id-number">"<%=docID%>"</span>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/templates/all_docs_list.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_list.html b/app/addons/documents/templates/all_docs_list.html
index d132eb2..3eaca80 100644
--- a/app/addons/documents/templates/all_docs_list.html
+++ b/app/addons/documents/templates/all_docs_list.html
@@ -13,25 +13,8 @@ the License.
 -->
 
 <div class="view">
-  <% if (!viewList) { %>
-    <div class="row">
-      <div class="btn-toolbar span6">
-        <button type="button" class="btn btn-small all" data-toggle="button">✓ All</button>
-        <button class="btn btn-small disabled js-bulk-delete"><i class="icon-trash"></i></button>
-        <% if (expandDocs) { %>
-        <button id="collapse" class="btn btn-small"><i class="icon-minus"></i> Collapse</button>
-        <% } else { %>
-        <button id="collapse" class="btn btn-small"><i class="icon-plus"></i> Expand</button>
-        <% } %>
-      </div>
-    </div>
-  <% } %>
-  <p>
-
-  <div id="item-numbers"> </div>
-  <div id="doc-list">
 
-  </div>
+  <div id="doc-list"></div>
 
   <% if (endOfResults) { %>
   <div class="text-center well">
@@ -40,5 +23,8 @@ the License.
     </p>
     </div>
   <% } %>
-  <div id="documents-pagination"></div>
 </div>
+<footer class="pagination-footer" class="window-resizeable">
+<div id="item-numbers"> </div>
+<div id="documents-pagination"></div>
+</footer>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/templates/header_alldocs.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html
index d83cb08..6e8f97f 100644
--- a/app/addons/documents/templates/header_alldocs.html
+++ b/app/addons/documents/templates/header_alldocs.html
@@ -12,8 +12,12 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-  <!-- Select all -->
+  <!-- Select toggle -->
+  <div id="header-select-all">
+    <span class="toggle-select-menu icon fonticon-ok-circled">Select</span>
+  </div>
 
+  <div id="header-select-menu"></div>
   <!-- search (jump to doc)-->
   <div id="header-search" class="js-search searchbox-container"></div>
 
@@ -21,5 +25,5 @@ the License.
   <div class="header-query-options">
     <!-- Insert the query options here :) -->
     <div id="query-options"></div>
-    <div id="header-api-bar"></div>
   </div>
+  <div id="header-api-bar"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/templates/header_doc_edit.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_doc_edit.html b/app/addons/documents/templates/header_doc_edit.html
deleted file mode 100644
index fbc213f..0000000
--- a/app/addons/documents/templates/header_doc_edit.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->
-
-<div class="header-left">
-<!--back arrow-->
-
-<!--title with dropdown DB search-->
-
-<!-- Menu gear-->
-</div>
-
-
-<div class="header-right">
-<!-- Select button-->
-<!-- ? button-->
-<!-- ? button-->
-<!-- ? button-->
-<!-- ? button-->
-<!-- json button-->
-<!-- trash button-->
-<!-- cancel button-->
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/templates/select-doc-menu.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/select-doc-menu.html b/app/addons/documents/templates/select-doc-menu.html
new file mode 100644
index 0000000..bad70a7
--- /dev/null
+++ b/app/addons/documents/templates/select-doc-menu.html
@@ -0,0 +1,24 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+<div class="row">
+  <div class="btn-toolbar span6">
+    <button type="button" class="btn btn-small all" data-toggle="button">✓ All</button>
+    <button class="btn btn-small disabled js-bulk-delete"><i class="icon-trash"></i></button>
+    <% if (expandDocs) { %>
+    <button id="collapse" class="btn btn-small"><i class="icon-minus"></i> Collapse</button>
+    <% } else { %>
+    <button id="collapse" class="btn btn-small"><i class="icon-plus"></i> Expand</button>
+    <% } %>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/views-advancedopts.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-advancedopts.js b/app/addons/documents/views-advancedopts.js
index 9a00c63..6500b50 100644
--- a/app/addons/documents/views-advancedopts.js
+++ b/app/addons/documents/views-advancedopts.js
@@ -29,8 +29,6 @@ function(app, FauxtonAPI, resizeColumns ) {
       this.database = options.database;
       this.ddocName = options.ddocName;
       this.viewName = options.viewName;
-      this.updateViewFn = options.updateViewFn;
-      this.previewFn = options.previewFn;
       this.showStale = _.isUndefined(options.showStale) ? false : options.showStale;
       this.hasReduce = _.isUndefined(options.hasReduce) ? true : options.hasReduce;
     },
@@ -66,14 +64,14 @@ function(app, FauxtonAPI, resizeColumns ) {
     toggleQuery: function(event) {
       $('#dashboard-content').scrollTop(0);
       this.$('#query-options-tray').toggle();
-    }, 
+    },
 
     resetForm: function() {
       $('input, textarea').each(function(){
         $(this).val('');
       });
       $('input:checkbox').attr('checked', false);
-      $("select").each(function(){ 
+      $("select").each(function(){
         this.selectedIndex = 0;
       });
     },
@@ -190,7 +188,8 @@ function(app, FauxtonAPI, resizeColumns ) {
       event.preventDefault();
       var params = this.queryParams();
       if (!params) { return;}
-      this.updateViewFn(event, params);
+      FauxtonAPI.Events.trigger('advancedOptions:updateView', event, params);
+      //this.updateViewFn(event, params);
     },
 
     updateFilters: function(event) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/views-sidebar.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-sidebar.js b/app/addons/documents/views-sidebar.js
index 8592dc1..ab6012c 100644
--- a/app/addons/documents/views-sidebar.js
+++ b/app/addons/documents/views-sidebar.js
@@ -32,11 +32,13 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     },
 
     initialize: function(options) {
+      _.bindAll(this);
       this.database = options.database;
       if (options.ddocInfo) {
         this.ddocID = options.ddocInfo.id;
         this.currView = options.ddocInfo.currView;
       }
+      FauxtonAPI.Events.on('database:delete', this.showDeleteDatabaseModal)
     },
     showDeleteDatabaseModal: function(event){
       this.deleteDBModal.showModal();

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 62073d5..3cfc229 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -1,4 +1,3 @@
-
 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
 // use this file except in compliance with the License. You may obtain a copy of
 // the License at
@@ -44,37 +43,57 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     className: "header-right",
     template: "addons/documents/templates/header_alldocs",
     events: {
-      'select .selectAllDocs': 'selectAllDocs'
+      'click .toggle-select-menu': 'selectAllMenu'
     },
+
     initialize: function(options){
       //adding the database to the object
       this.database = options.database;
+      _.bindAll(this);
+      this.selectVisible = false;
+      FauxtonAPI.Events.on('advancedOptions:updateView', this.updateAllDocs);
+      FauxtonAPI.Events.on('success:bulkDelete', this.selectAllMenu);
     },
-    selectAllDocs: function(){
+
+    selectAllMenu: function(e){
       //trigger event to select all in other view
+      this.$('.toggle-select-menu').toggleClass('active');
+
+      //trigger event to change the header
+      this.toggleSelectMenu();
+      FauxtonAPI.Events.trigger("documents:show-select-all",this.selectVisible);
+
     },
-    updateApiUrl: function(api){
-      //this will update the api bar when the route changes
-      //you can find the method that updates it in components.js Components.ApiBar()
-      this.apiBar && this.apiBar.update(api);
+
+    toggleSelectMenu: function(){
+      if (this.selectVisible){
+        this.selectVisible = false;
+        this.selectMenu.remove();
+        this.addAllDocsMenu();
+      } else {
+        this.removeAllDocsMenu();
+        this.addSelectMenu();
+      }
     },
-    serialize: function() {
-      //basically if you want something in a template, You can define it here
-      return {
-        database: this.database.get('id')
-      };
+
+    addSelectMenu: function(){
+      this.selectVisible = true;
+      this.selectMenu =  this.insertView('#header-select-menu', new Views.SelectMenu({}));
+      this.selectMenu.render();
     },
-    beforeRender:function(){
-      //insert DB search dropdown
 
-      //insert top create level dropdown with gear icon
+    removeAllDocsMenu: function(){
+      this.headerSearch.remove();
+      this.queryOptions.remove();
+      this.apiBar.remove();
+    },
 
+    addAllDocsMenu: function(){
       //search docs
-      this.setView("#header-search", new Views.JumpToDoc({
+      this.headerSearch = this.insertView("#header-search", new Views.JumpToDoc({
         database: this.database,
         collection: this.database.allDocs
       }));
-
       //insert queryoptions
       //that file is included in require() above and the argument is QueryOptions
       // and it wants all these params:
@@ -95,9 +114,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
         this.viewName = options.viewName;
         this.ddocName = options.ddocName;
       */
-      this.setView("#query-options", new QueryOptions.AdvancedOptions({
-        updateViewFn: this.updateAllDocs,
-        previewFn: this.previewView,
+
+      this.queryOptions = this.insertView("#query-options", new QueryOptions.AdvancedOptions({
         database: this.database,
         hasReduce: false,
         showPreview: false,
@@ -106,7 +124,28 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       //Moved the apibar view into the components file so you can include it in your views
       this.apiBar = this.insertView("#header-api-bar", new Components.ApiBar({}));
 
+      this.apiBar.render();
+      this.queryOptions.render();
+      this.headerSearch.render();
     },
+
+    updateApiUrl: function(api){
+      //this will update the api bar when the route changes
+      //you can find the method that updates it in components.js Components.ApiBar()
+      this.apiBar && this.apiBar.update(api);
+    },
+
+    serialize: function() {
+      //basically if you want something in a template, You can define it here
+      return {
+        database: this.database.get('id')
+      };
+    },
+
+    beforeRender:function(){
+      this.addAllDocsMenu();
+    },
+
     //moved from alldocs layout
     updateAllDocs: function (event, paramInfo) {
       event.preventDefault();
@@ -145,54 +184,30 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
       FauxtonAPI.navigate(fragment, {trigger: false});
       FauxtonAPI.triggerRouteEvent('updateAllDocs', {allDocs: true});
-    },
-    previewView: function (event) {
-      event.preventDefault();
     }
   });
 
-
-  //header that shows up when a doc is selected
-  // when a Doc is selected, trigger a routeEvent to render this
-  // the routeEvent will determine which header to show (??)
-  Views.DocEditHeader = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/header_doc_edit",
+  // select docs header
+  Views.SelectMenu = FauxtonAPI.View.extend({
+    template:"addons/documents/templates/select-doc-menu",
     events: {
-      'select .selectAllDocs': 'selectAllDocs'
-    },
-    initialize: function(options){
-
-    },
-    selectAllDocs: function(){
-      //trigger event to select all in other view
+      "click button.all": "selectAll",
+      "click button.js-bulk-delete": "bulkDelete",
+      "click #collapse": "collapse"
     },
-    afterRender:function(){
-      //insert DB search dropdown
-
-      //insert top create level dropdown with gear icon
-    }
-  });
-
-  Views.DocsHeader = FauxtonAPI.View.extend({
-    template: "addons/documents/templates/header_selecteddoc",
-    events: {
-      'select .selectAllDocs': 'selectAllDocs'
+    bulkDelete: function(){
+      FauxtonAPI.Events.trigger("documents:bulkDelete");
     },
-    initialize: function(options){
+    selectAll: function(evt){
+      this.$(evt.target).toggleClass('active');
 
+      FauxtonAPI.Events.trigger("documents:selectAll", this.$(evt.target).hasClass('active'));
     },
-    selectAllDocs: function(){
-      //trigger event to select all in other view
-    },
-    afterRender:function(){
-      //insert DB search dropdown
-
-      //insert top create level dropdown with gear icon
-
-      //search docs
-
-      //insert queryoptions
-
+    collapse: function(evt){
+      var icon = this.$(evt.target).find('i');
+      icon.toggleClass('icon-minus');
+      icon.toggleClass('icon-plus');
+      FauxtonAPI.Events.trigger("documents:collapse");
     }
   });
 
@@ -244,6 +259,26 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     className: "all-docs-item doc-row",
     initialize: function (options) {
       this.checked = options.checked;
+      this.expanded = options.expanded;
+      this.showSelect = false;
+      _.bindAll(this);
+      FauxtonAPI.Events.on("documents:show-select-all", this.showSelectBox);
+      FauxtonAPI.Events.on("documents:collapse", this.collapse);
+      FauxtonAPI.Events.on("documents:selectAll", this.selectAll);
+    },
+
+    showSelectBox: function(bool){
+      this.showSelect = bool;
+      this.$('.select').toggle(this.showSelect);
+    },
+
+    selectAll: function(checked){
+      this.$("input:checkbox").prop('checked', checked).trigger('click');
+    },
+
+    collapse: function(bool){
+      this.collapse = bool;
+      this.$('.doc-data').toggle(this.collapse);
     },
 
     events: {
@@ -259,6 +294,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
 
     serialize: function() {
       return {
+        showSelect: this.showSelect,
+        expanded: this.expanded,
         docID: this.model.get('_id'),
         doc: this.model,
         checked: this.checked
@@ -373,14 +410,12 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
   Views.AllDocsList = FauxtonAPI.View.extend({
     template: "addons/documents/templates/all_docs_list",
     events: {
-      "click button.all": "selectAll",
-      "click button.js-bulk-delete": "bulkDelete",
-      "click #collapse": "collapse",
       "click .all-docs-item": "toggleDocument",
       "click #js-end-results": "scrollToQuery"
     },
 
     initialize: function (options) {
+      _.bindAll(this);
       this.nestedView = options.nestedView || Views.Document;
       this.rows = {};
       this.viewList = !!options.viewList;
@@ -399,6 +434,9 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       if (!this.viewList) {
         this.bulkDeleteDocsCollection = options.bulkDeleteDocsCollection;
       }
+
+      FauxtonAPI.Events.on("documents:bulkDelete", this.bulkDelete);
+      FauxtonAPI.Events.on("documents:selectAll", this.toggleTrash);
     },
 
     removeDocuments: function (ids) {
@@ -484,36 +522,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       });
     },
 
-    selectAll: function (evt) {
-      var $allDocs = this.$('.all-docs'),
-          $rows = $allDocs.find('tr'),
-          $checkboxes = $allDocs.find('input:checkbox'),
-          modelsAffected,
-          docs;
-
-      $checkboxes.prop('checked', !$(evt.target).hasClass('active')).trigger('change');
-
-      if ($(evt.target).hasClass('active')) {
-        modelsAffected = _.reduce($rows, function (acc, el) {
-          var docId = $(el).attr('data-id');
-          acc.push(docId);
-          return acc;
-        }, []);
-        this.bulkDeleteDocsCollection.remove(modelsAffected);
-      } else {
-        modelsAffected = _.reduce($rows, function (acc, el) {
-          var docId = $(el).attr('data-id'),
-              rev = this.collection.get(docId).get('_rev');
-
-          acc.push({_id: docId, _rev: rev, _deleted: true});
-          return acc;
-        }, [], this);
-        this.bulkDeleteDocsCollection.add(modelsAffected);
-      }
-
-      this.toggleTrash();
-    },
-
     serialize: function() {
       return {
         viewList: this.viewList,
@@ -522,18 +530,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       };
     },
 
-    collapse: function (event) {
-      event.preventDefault();
-
-      if (this.expandDocs) {
-        this.expandDocs = false;
-      } else {
-        this.expandDocs = true;
-      }
-
-      this.render();
-    },
-
     bulkDelete: function() {
       var that = this,
           documentsLength = this.bulkDeleteDocsCollection.length,
@@ -591,6 +587,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
         }
         this.rows[doc.id] = this.insertView("#doc-list", new this.nestedView({
           model: doc,
+          expanded: this.expandDocs,
           checked: isChecked
         }));
       }, this);
@@ -623,8 +620,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       }
 
       this.toggleTrash();
+      this.setPaginationWidth();
+    },
+    setPaginationWidth: function(){
+      this.$('#documents-pagination').css('width', this.$el.outerWidth());
     },
-
     perPage: function () {
       return this.allDocsNumber.perPage();
     }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index 18ea5b8..60d0c26 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -40,6 +40,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
     className: "header-left",
     template: "addons/fauxton/templates/header_left",
     initialize:function(options){
+      this.dropdownEvents = options.dropdownEvents;
       this.dropdownMenuLinks = options.dropdownMenu;
       this.crumbs = options.crumbs || [];
     },
@@ -63,6 +64,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
         this.dropdown = this.insertView("#header-dropdown-menu", new Components.MenuDropDown({
           icon: 'fonticon-cog',
           links: this.dropdownMenuLinks,
+          events: this.dropdownEvents
         }));
       }
     }
@@ -151,6 +153,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
 
 
   Components.Pagination = FauxtonAPI.View.extend({
+    className: "pagination pagination-centered",
     template: "addons/fauxton/templates/pagination",
 
     initialize: function(options) {
@@ -173,6 +176,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
   });
 
   Components.IndexPagination = FauxtonAPI.View.extend({
+    className: "pagination pagination-centered",
     template: "addons/fauxton/templates/index_pagination",
     events: {
       "click a": 'scrollTo',
@@ -741,6 +745,24 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
     initialize: function(options){
       this.links = options.links;
       this.icon = options.icon || "fonticon-plus-circled2";
+      _.bindAll(this);
+      this.setUpEvents();
+    },
+    setUpEvents: function(){
+      this.events = {};
+      var parentLinkObj = this.links;
+      for (var i=0; i< parentLinkObj.length; i++){
+        for (var x=0; x< parentLinkObj[i].links.length; x++){
+          if(parentLinkObj[i].links[x].trigger){
+            this.events['click .'+parentLinkObj[i].links[x].icon] = "triggerEvent";
+          }
+        }
+      }
+    },
+    triggerEvent: function(e){
+      e.preventDefault();
+      var eventTrigger = $(e.currentTarget).attr('triggerEvent');
+      FauxtonAPI.Events.trigger(eventTrigger);
     },
     update: function(links){
       this.links = links;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/fauxton/templates/index_pagination.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/index_pagination.html b/app/addons/fauxton/templates/index_pagination.html
index f445377..594f6fc 100644
--- a/app/addons/fauxton/templates/index_pagination.html
+++ b/app/addons/fauxton/templates/index_pagination.html
@@ -12,13 +12,11 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<div class="pagination pagination-centered">
-  <ul>
-    <li <% if (!canShowPreviousfn()) {%> class="disabled" <% } %>>
-       <a id="previous" href="#"> Previous </a>
-     </li>
-     <li <% if (!canShowNextfn()) {%> class="disabled" <% } %>>
-       <a id="next" href="#"> Next </a></li>
-  </ul>
-</div>
+<ul>
+  <li <% if (!canShowPreviousfn()) {%> class="disabled" <% } %>>
+     <a id="previous" href="#"> Previous </a>
+   </li>
+   <li <% if (!canShowNextfn()) {%> class="disabled" <% } %>>
+     <a id="next" href="#"> Next </a></li>
+</ul>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/fauxton/templates/menu_dropdown.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/menu_dropdown.html b/app/addons/fauxton/templates/menu_dropdown.html
index d1e96af..01c4ed9 100644
--- a/app/addons/fauxton/templates/menu_dropdown.html
+++ b/app/addons/fauxton/templates/menu_dropdown.html
@@ -21,11 +21,13 @@ the License.
     <% _.each(linkSection.links, function (link) { %>
       <li>
         <a
+          <% if (link.trigger){ %> data-bypass="true" triggerEvent="<%-link.trigger%>" <%}%>
           <% if (link.icon) { %>
           class="icon <%- link.icon %>"
           <% } %>
           href="<%- link.url %>">
           <%- link.title %>
+
         </a>
       <li>
     <%});%>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/fauxton/templates/pagination.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/pagination.html b/app/addons/fauxton/templates/pagination.html
index 0674c22..614fd06 100644
--- a/app/addons/fauxton/templates/pagination.html
+++ b/app/addons/fauxton/templates/pagination.html
@@ -11,8 +11,6 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-
-<div class="pagination pagination-centered">
   <ul>
     <% if (page > 1) { %>
     <li> <a href="<%- urlFun(page-1) %>">&laquo;</a></li>
@@ -28,4 +26,3 @@ the License.
       <li class="disabled"> <a href="<%- urlFun(page) %>">&raquo;</a></li>
     <% } %>
   </ul>
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/indexes/templates/header_right.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/header_right.html b/app/addons/indexes/templates/header_right.html
index 8279bf6..38634b5 100644
--- a/app/addons/indexes/templates/header_right.html
+++ b/app/addons/indexes/templates/header_right.html
@@ -11,7 +11,7 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-  <!-- Query Options-->
+  <!-- Select toggle-->
   <div id="header-select-all">
     <span class="toggle-select-menu icon fonticon-ok-circled">Select</span>
   </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
index bfe209e..9d0546e 100644
--- a/app/addons/indexes/views.js
+++ b/app/addons/indexes/views.js
@@ -40,12 +40,14 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     className: "header-right",
     template: "addons/indexes/templates/header_right",
     initialize:function(options){
+      _.bindAll(this);
       this.database = options.database;
       this.title = options.title;
       this.api = options.api;
       this.endpoint = options.endpoint;
       this.documentation = options.documentation;
       this.eventer = _.extend({}, Backbone.Events);
+      FauxtonAPI.Events.on('advancedOptions:updateView', this.updateView);
     },
     updateApiUrl: function(api){
       //this will update the api bar when the route changes
@@ -60,8 +62,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
       }));
 
       this.advancedOptions = this.insertView('#header-query-options', new QueryOptions.AdvancedOptions({
-        updateViewFn: this.updateView,
-        previewFn: this.previewView,
         database: this.database,
         viewName: this.viewName,
         ddocName: this.model.id,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/app/core/api.js
----------------------------------------------------------------------
diff --git a/app/core/api.js b/app/core/api.js
index 1b21dca..50a8b12 100644
--- a/app/core/api.js
+++ b/app/core/api.js
@@ -26,6 +26,11 @@ function(FauxtonAPI, Layout, Router, RouteObject, utils) {
     utils: utils
   });
 
+  //global app events
+  FauxtonAPI.Events = {};
+  _.extend(FauxtonAPI.Events, Backbone.Events);
+
+
   FauxtonAPI.navigate = function(url, _opts) {
     var options = _.extend({trigger: true}, _opts );
     FauxtonAPI.router.navigate(url,options);
@@ -47,7 +52,7 @@ function(FauxtonAPI, Layout, Router, RouteObject, utils) {
     FauxtonAPI.router.triggerRouteEvent("route:"+routeEvent, args);
   };
 
-  
+
   return FauxtonAPI;
 });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/assets/index.underscore
----------------------------------------------------------------------
diff --git a/assets/index.underscore b/assets/index.underscore
index 396cce3..6a887b5 100644
--- a/assets/index.underscore
+++ b/assets/index.underscore
@@ -35,10 +35,6 @@
   <div role="main" id="main">
     <div id="global-notifications" class="container errors-container"></div>
     <div id="app-container"></div>
-
-    <footer>
-      <div id="footer-content"></div>
-    </footer>
   </div>
 
   <!-- Application source. -->

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 6467923..29ef04f 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -25,6 +25,7 @@
 @import "templates.less";
 @import "headers.less";
 @import "formstyles.less";
+@import "pagination.less";
 /**
  * HTML-wide overrides
  **/

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/assets/less/headers.less b/assets/less/headers.less
index c80a88f..e073ad7 100644
--- a/assets/less/headers.less
+++ b/assets/less/headers.less
@@ -1,3 +1,15 @@
+/*  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ *  use this file except in compliance with the License. You may obtain a copy of
+ *  the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ *  License for the specific language governing permissions and limitations under
+ *  the License.
+ */
 .fixed-header{
   height: 60px;
   background-color: @breadcrumbBG;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/assets/less/mixins.less
----------------------------------------------------------------------
diff --git a/assets/less/mixins.less b/assets/less/mixins.less
index 63eda35..9c47456 100644
--- a/assets/less/mixins.less
+++ b/assets/less/mixins.less
@@ -1,3 +1,15 @@
+/*  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ *  use this file except in compliance with the License. You may obtain a copy of
+ *  the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ *  License for the specific language governing permissions and limitations under
+ *  the License.
+ */
 .translate-origin(@x, @y) {
   -webkit-transform-origin: @x @y;
      -moz-transform-origin: @x @y;
@@ -7,15 +19,15 @@
 }
 
 .customTransition(@prop, @delay, @a, @b, @c, @d){
--webkit-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d); 
-   -moz-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d); 
-    -ms-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d); 
-     -o-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d); 
+-webkit-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d);
+   -moz-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d);
+    -ms-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d);
+     -o-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d);
         transition: @prop, @delay cubic-bezier(@a, @b, @c, @d); /* custom */
 
--webkit-transition-timing-function: cubic-bezier(@a, @b, @c, @d); 
-   -moz-transition-timing-function: cubic-bezier(@a, @b, @c, @d); 
-    -ms-transition-timing-function: cubic-bezier(@a, @b, @c, @d); 
-     -o-transition-timing-function: cubic-bezier(@a, @b, @c, @d); 
+-webkit-transition-timing-function: cubic-bezier(@a, @b, @c, @d);
+   -moz-transition-timing-function: cubic-bezier(@a, @b, @c, @d);
+    -ms-transition-timing-function: cubic-bezier(@a, @b, @c, @d);
+     -o-transition-timing-function: cubic-bezier(@a, @b, @c, @d);
         transition-timing-function: cubic-bezier(@a, @b, @c, @d); /* custom */
 }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/assets/less/pagination.less
----------------------------------------------------------------------
diff --git a/assets/less/pagination.less b/assets/less/pagination.less
new file mode 100644
index 0000000..0137699
--- /dev/null
+++ b/assets/less/pagination.less
@@ -0,0 +1,21 @@
+/*  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ *  use this file except in compliance with the License. You may obtain a copy of
+ *  the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ *  License for the specific language governing permissions and limitations under
+ *  the License.
+ */
+footer.pagination-footer {
+  position:fixed;
+  background-color:#fff;
+  bottom:0;
+  border-top:1px solid #ccc;
+  .pagination{
+    margin: 15px 0 10px;
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cd7b26f2/assets/less/templates.less
----------------------------------------------------------------------
diff --git a/assets/less/templates.less b/assets/less/templates.less
index 5c877b4..062cd32 100644
--- a/assets/less/templates.less
+++ b/assets/less/templates.less
@@ -336,8 +336,10 @@
 }
 
 #dashboard-lower-content{
-  padding: 20px;
   background-color: #F1F1F1;
+  .view {
+    padding: 20px;
+  }
 }
 
 #dashboard-upper-content{
@@ -467,7 +469,9 @@
 }
 #right-content{
   .two-pane &{
-    padding: 0 20px;
+    .view {
+      padding: 0 20px;
+    }
     border-left: 1px solid #999;
     .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));
   }


[25/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Hook up delete dropdown on views


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/f128847e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/f128847e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/f128847e

Branch: refs/heads/secondary-indexes
Commit: f128847e90e785b7bf8e9381c051adf9ac7bb029
Parents: a80d189
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:35 2014 -0400

----------------------------------------------------------------------
 app/addons/indexes/routes-viewindexes.js | 6 ++++--
 app/addons/indexes/views.js              | 4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f128847e/app/addons/indexes/routes-viewindexes.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-viewindexes.js b/app/addons/indexes/routes-viewindexes.js
index 7330d04..f3bb65b 100644
--- a/app/addons/indexes/routes-viewindexes.js
+++ b/app/addons/indexes/routes-viewindexes.js
@@ -88,9 +88,11 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore, Co
         links: [{
           title: 'Duplicate Index',
           icon: 'fonticon-documents'
-        },{
+        },
+        {
           title: 'Delete',
-          icon: 'fonticon-trash'
+          icon: 'fonticon-trash',
+          trigger: 'index:delete'
         }]
       }];
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f128847e/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
index 6340251..fa84708 100644
--- a/app/addons/indexes/views.js
+++ b/app/addons/indexes/views.js
@@ -309,6 +309,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
       this.showIndex = false;
       _.bindAll(this);
+
+      FauxtonAPI.Events.on('index:delete', this.deleteView);
     },
 
     establish: function () {
@@ -342,7 +344,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     },
 
     deleteView: function (event) {
-      event.preventDefault();
+      event && event.preventDefault();
 
       if (this.newView) { return alert('Cannot delete a new view.'); }
       if (!confirm('Are you sure you want to delete this view?')) {return;}


[34/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
remove useless forcerenders for the breadcrumbs


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/09649df8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/09649df8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/09649df8

Branch: refs/heads/secondary-indexes
Commit: 09649df86273ec205100794f8a732104ab38fb5b
Parents: a257908
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/routes.js    | 6 +++---
 app/addons/indexes/routes-core.js | 4 +---
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/09649df8/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index 324a9ea..7f71bb9 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -412,7 +412,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
 
       this.documentsView.setCollection(collection);
       this.documentsView.setParams(docParams, urlParams);
-      this.leftheader.forceRender();
+
       this.documentsView.forceRender();
 
       this.rightHeader.updateApiUrl([collection.urlRef("apiurl", urlParams), "docs"]);
@@ -425,7 +425,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       // We need to restore the collection parameters to the defaults (1st page)
       // and update the page size
       this.perPage = perPage;
-      this.leftheader.forceRender();
+
       this.documentsView.forceRender();
       this.documentsView.collection.pageSizeReset(perPage, {fetch: false});
       this.setDocPerPageLimit(perPage);
@@ -437,7 +437,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
 
     paginate: function (options) {
       var collection = this.documentsView.collection;
-      this.leftheader.forceRender();
+
       this.documentsView.forceRender();
       collection.paging.pageSize = options.perPage;
       var promise = collection[options.direction]({fetch: false});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/09649df8/app/addons/indexes/routes-core.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-core.js b/app/addons/indexes/routes-core.js
index a341d41..65f33bc 100644
--- a/app/addons/indexes/routes-core.js
+++ b/app/addons/indexes/routes-core.js
@@ -58,7 +58,6 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
       // We need to restore the collection parameters to the defaults (1st page)
       // and update the page size
       this.perPage = perPage;
-      this.leftheader.forceRender();
       this.documentsView.forceRender();
       this.documentsView.collection.pageSizeReset(perPage, {fetch: false});
       this.setDocPerPageLimit(perPage);
@@ -77,7 +76,7 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
 
     paginate: function (options) {
       var collection = this.documentsView.collection;
-      this.leftheader.forceRender();
+
       this.documentsView.forceRender();
       collection.paging.pageSize = options.perPage;
       var promise = collection[options.direction]({fetch: false});
@@ -162,7 +161,6 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
       this.documentsView.setCollection(collection);
       this.documentsView.setParams(docParams, urlParams);
 
-      this.leftheader.forceRender();
       this.documentsView.forceRender();
 
       this.rightHeader.updateApiUrl([collection.urlRef("apiurl", urlParams), "docs"]);


[46/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
css cleanup


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/40e17886
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/40e17886
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/40e17886

Branch: refs/heads/secondary-indexes
Commit: 40e17886ea574dade260138062f8cada5f002a10
Parents: 0cf994c
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:37 2014 -0400

----------------------------------------------------------------------
 app/addons/fauxton/templates/header_left.html             | 2 +-
 app/addons/indexes/assets/less/new-index-placeholder.less | 1 +
 assets/less/bootstrap/dropdowns.less                      | 4 ++--
 assets/less/bootstrap/variables.less                      | 4 ++--
 assets/less/headers.less                                  | 4 ++--
 5 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/40e17886/app/addons/fauxton/templates/header_left.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/header_left.html b/app/addons/fauxton/templates/header_left.html
index 13bea60..420b90b 100644
--- a/app/addons/fauxton/templates/header_left.html
+++ b/app/addons/fauxton/templates/header_left.html
@@ -14,4 +14,4 @@ the License.
 <!--back arrow-->
 <div id="header-breadcrumbs"></div>
   <!-- Menu gear-->
-<div id="header-dropdown-menu"></div>
+<div id="header-dropdown-menu" class="add-dropdown"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/40e17886/app/addons/indexes/assets/less/new-index-placeholder.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/assets/less/new-index-placeholder.less b/app/addons/indexes/assets/less/new-index-placeholder.less
index ade1d3a..b5ca506 100644
--- a/app/addons/indexes/assets/less/new-index-placeholder.less
+++ b/app/addons/indexes/assets/less/new-index-placeholder.less
@@ -14,6 +14,7 @@
   min-height: 400px;
   padding-top: 60%;
   text-align: center;
+  margin: 0 20%;
   h3 {
     border-bottom: 1px solid #ccc;
     padding-bottom:10px;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/40e17886/assets/less/bootstrap/dropdowns.less
----------------------------------------------------------------------
diff --git a/assets/less/bootstrap/dropdowns.less b/assets/less/bootstrap/dropdowns.less
index f510b17..62dda0d 100644
--- a/assets/less/bootstrap/dropdowns.less
+++ b/assets/less/bootstrap/dropdowns.less
@@ -65,8 +65,8 @@
   }
   li.header-label{
     background-color: #1A1A1A;
-    color: #676767;
-    padding: 3px 20px;
+    color: #fff;
+    padding: 3px 10px;
     font-size: 13px;
   }
   &.arrow {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/40e17886/assets/less/bootstrap/variables.less
----------------------------------------------------------------------
diff --git a/assets/less/bootstrap/variables.less b/assets/less/bootstrap/variables.less
index eee77a0..0539bbe 100644
--- a/assets/less/bootstrap/variables.less
+++ b/assets/less/bootstrap/variables.less
@@ -119,12 +119,12 @@
 
 // Dropdowns
 // -------------------------
-@dropdownBackground:            #2B2F33;
+@dropdownBackground:            #1A1A1A;
 @dropdownBorder:                rgba(0,0,0,.2);
 @dropdownDividerTop:            #1A1A1A;
 @dropdownDividerBottom:         #1A1A1A;
 
-@dropdownLinkColor:             #D9D9D9;
+@dropdownLinkColor:             #E33F3B;
 @dropdownLinkColorHover:        @white;
 @dropdownLinkColorActive:       @white;
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/40e17886/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/assets/less/headers.less b/assets/less/headers.less
index 9ce3243..ba21a7f 100644
--- a/assets/less/headers.less
+++ b/assets/less/headers.less
@@ -127,7 +127,7 @@
       color: #666666;
     }
     a {
-      padding: 10px 20px;
+      padding: 10px;
       text-decoration: none;
     }
     .dropdown {
@@ -135,7 +135,7 @@
       padding: 20px 0px;
     }
     .dropdown-menu {
-      left: -109px;
+      left: -115px;
       top: 48px;
     }
   }


[35/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
comment out remove crumbs


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/a2579083
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/a2579083
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/a2579083

Branch: refs/heads/secondary-indexes
Commit: a2579083842e1a185d60ab76f672b7686df34cc1
Parents: d827441
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 app/addons/fauxton/base.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a2579083/app/addons/fauxton/base.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/base.js b/app/addons/fauxton/base.js
index 68ee7cd..1e43c0f 100644
--- a/app/addons/fauxton/base.js
+++ b/app/addons/fauxton/base.js
@@ -72,7 +72,7 @@ function(app, FauxtonAPI, resizeColumns, Components) {
     });
 
     FauxtonAPI.RouteObject.on('beforeEstablish', function (routeObject) {
-      FauxtonAPI.masterLayout.removeView('#breadcrumbs');
+      //FauxtonAPI.masterLayout.removeView('#breadcrumbs');
       var crumbs = routeObject.get('crumbs');
 
       if (crumbs.length) {


[43/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
All DBs header update


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/885f234a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/885f234a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/885f234a

Branch: refs/heads/secondary-indexes
Commit: 885f234aee237a0e8deafe85782d3c26582159e1
Parents: 40e1788
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:37 2014 -0400

----------------------------------------------------------------------
 app/addons/databases/assets/less/databases.less   |  3 +++
 app/addons/databases/routes.js                    | 14 +++++++-------
 app/addons/databases/templates/header_alldbs.html |  2 +-
 app/addons/databases/templates/newdatabase.html   |  2 +-
 app/addons/databases/views.js                     |  5 ++++-
 assets/less/headers.less                          |  4 +---
 assets/less/templates.less                        |  4 ++++
 7 files changed, 21 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/885f234a/app/addons/databases/assets/less/databases.less
----------------------------------------------------------------------
diff --git a/app/addons/databases/assets/less/databases.less b/app/addons/databases/assets/less/databases.less
index b401e7d..963179e 100644
--- a/app/addons/databases/assets/less/databases.less
+++ b/app/addons/databases/assets/less/databases.less
@@ -32,3 +32,6 @@
         font-size: 19px;
     }
 }
+#new a {
+    text-decoration: none;
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/885f234a/app/addons/databases/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/routes.js b/app/addons/databases/routes.js
index 1e4396c..a896d1e 100644
--- a/app/addons/databases/routes.js
+++ b/app/addons/databases/routes.js
@@ -36,18 +36,12 @@ function(app, FauxtonAPI, Databases, Views) {
       "_all_dbs(:params)": "allDatabases"
     },
 
-    apiUrl: function() {
-      return [this.databases.url("apiurl"), this.databases.documentation()];
-    },
-
     selectedHeader: "Databases",
 
     initialize: function() {
       this.databases = new Databases.List();
       this.deferred = FauxtonAPI.Deferred();
-      this.rightHeader = this.setView("#api-navbar", new Views.RightAllDBsHeader({
-        collection: this.databases
-      }));
+
     },
 
     allDatabases: function() {
@@ -58,6 +52,12 @@ function(app, FauxtonAPI, Databases, Views) {
         collection: this.databases
       }));
 
+      this.rightHeader = this.setView("#api-navbar", new Views.RightAllDBsHeader({
+        collection: this.databases,
+        endpoint: this.databases.url("apiurl"),
+        documentation: this.databases.documentation()
+      }));
+
       this.databasesView.setPage(dbPage);
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/885f234a/app/addons/databases/templates/header_alldbs.html
----------------------------------------------------------------------
diff --git a/app/addons/databases/templates/header_alldbs.html b/app/addons/databases/templates/header_alldbs.html
index a993225..492b5bf 100644
--- a/app/addons/databases/templates/header_alldbs.html
+++ b/app/addons/databases/templates/header_alldbs.html
@@ -17,7 +17,7 @@ the License.
   <div id="header-api-bar" class="button"></div>
 
   <!-- add database-->
-  <div class="button add-db">
+  <div class="button" id="add-db-button">
   </div>
 
   <!-- search (jump to doc)-->

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/885f234a/app/addons/databases/templates/newdatabase.html
----------------------------------------------------------------------
diff --git a/app/addons/databases/templates/newdatabase.html b/app/addons/databases/templates/newdatabase.html
index 1376ad5..2b25aac 100644
--- a/app/addons/databases/templates/newdatabase.html
+++ b/app/addons/databases/templates/newdatabase.html
@@ -12,5 +12,5 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<a class="btn btn-primary new" id="new"><i class="icon fonticon-new-database"></i> Add New Database</a>
+<a id="new"><i class="icon fonticon-new-database"></i> Add New Database</a>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/885f234a/app/addons/databases/views.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/views.js b/app/addons/databases/views.js
index 99a5ea2..e2f0d52 100644
--- a/app/addons/databases/views.js
+++ b/app/addons/databases/views.js
@@ -28,6 +28,7 @@ function(app, Components, FauxtonAPI, Databases) {
     initialize: function(options){
       //adding the database to the object
       _.bindAll(this);
+      this.endpoint = options.endpoint;
     },
 
     updateApiUrl: function(api){
@@ -47,7 +48,9 @@ function(app, Components, FauxtonAPI, Databases) {
 
 
       //Moved the apibar view into the components file so you can include it in your views
-      this.apiBar = this.insertView("#header-api-bar", new Components.ApiBar({}));
+      this.apiBar = this.insertView("#header-api-bar", new Components.ApiBar({
+        endpoint: this.endpoint
+      }));
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/885f234a/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/assets/less/headers.less b/assets/less/headers.less
index ba21a7f..1ef0743 100644
--- a/assets/less/headers.less
+++ b/assets/less/headers.less
@@ -49,9 +49,7 @@
     }
   }
   .one-pane & {
-    position: relative;
-    border: none;
-    .box-shadow(none);
+    .bottom-shadow-border;
     left: auto;
   }
   /* these styles are for the new header*/

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/885f234a/assets/less/templates.less
----------------------------------------------------------------------
diff --git a/assets/less/templates.less b/assets/less/templates.less
index b2dc28b..cf66117 100644
--- a/assets/less/templates.less
+++ b/assets/less/templates.less
@@ -352,6 +352,10 @@
     /*remove gutter without rewriting variable*/
     margin-left: 0px;
   }
+  .one-pane &{
+    margin-top:60px;
+    padding-bottom:60px;
+  }
   .with-sidebar &{
     .left-shadow-border;
     border-right: 1px solid #999;


[13/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Provides grouping and better formatting for design doc metadata

Fixes COUCHDB-2174.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/43f0033b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/43f0033b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/43f0033b

Branch: refs/heads/secondary-indexes
Commit: 43f0033b53c0a9d4e2650c85de10dd9bfdba883b
Parents: 2adfaf9
Author: thriqon <gi...@jonasw.de>
Authored: Thu Aug 21 10:34:52 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat Aug 23 22:00:27 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/templates/ddoc_info.html | 55 +++++++++++++++++-----
 app/helpers.js                                |  1 +
 2 files changed, 45 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/43f0033b/app/addons/documents/templates/ddoc_info.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/ddoc_info.html b/app/addons/documents/templates/ddoc_info.html
index 3f8f80f..e9b1b6e 100644
--- a/app/addons/documents/templates/ddoc_info.html
+++ b/app/addons/documents/templates/ddoc_info.html
@@ -12,17 +12,50 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 <div>
-  <h2>Design Doc MetaData:  _design/<%=Ddoc%> </h2>
+  <header class="page-header">
+    <h2>Design Document Metadata: _design/<%-Ddoc%> </h2>
+    <p class="help">Information about the specified design document, including the index, index size and current status of the design document and associated index information.<a href="<%- getDocUrl('design_doc_metadata') %>" class="help-link" target="_blank" data-bypass="true"><i class="icon-question-sign"></i></a></p>
+  </header>
   <div class="row-fluid">
-	<% i=0; _.map(view_index, function (val, key) { %>
-		<% if(i%2==0){%>
-			<div class="row-fluid">
-		<% }; %>
-	    <div class="span6 well-item"><strong> <%- key %></strong> : <%- val %>  </div>
-	    <% if(i%2==1){%>
-			</div>
-		<% }; %>
-	  	<% ++i;
-	}); %>
+    <div class="span6">
+      <header>
+        <h3>Status</h3>
+      </header>
+
+      <dl>
+        <dt>Updater</dt>
+        <dd><%- view_index.updater_running %></dd>
+        <dt>Compact</dt>
+        <dd><%- view_index.compact_running %></dd>
+        <dt>Waiting Commit</dt>
+        <dd><%- view_index.waiting_commit %></dd>
+        <dt>Waiting Clients</dt>
+        <dd><%- view_index.waiting_clients %></dd>
+        <dt>Update Sequence</dt>
+        <dd><%- view_index.update_seq %></dd>
+        <dt>Purge Sequence</dt>
+        <dd><%- view_index.purge_seq %></dd>
+      </dl>
+    </div>
+    <div class="span6">
+      <header>
+        <h3>Information</h3>
+      </header>
+      <dl>
+        <dt>Language</dt>
+        <dd><%- view_index.language %></dd>
+        <dt>Signature</dt>
+        <dd><%- view_index.signature %></dd>
+      </dl>
+      <header>
+        <h3>Storage</h3>
+      </header>
+      <dl>
+        <dt>Data Size</dt>
+        <dd><%- formatSize(view_index.data_size) %></dd>
+        <dt>Disk Size</dt>
+        <dd><%- formatSize(view_index.disk_size) %></dd>
+      </dl>
+    </div>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/43f0033b/app/helpers.js
----------------------------------------------------------------------
diff --git a/app/helpers.js b/app/helpers.js
index 6fa8481..acaaba2 100644
--- a/app/helpers.js
+++ b/app/helpers.js
@@ -43,6 +43,7 @@ function(utils, d3) {
     "all_dbs": "/_utils/docs/api/server/common.html?highlight=all_dbs#get--_all_dbs",
     "replication_doc": "/_utils/docs/replication/replicator.html#basics",
     "design_doc": "/_utils/docs/couchapp/ddocs.html#design-docs",
+    "design_doc_metadata" : "/_utils/docs/api/ddoc/common.html#api-ddoc-view-index-info",
     "view_functions": "/_utils/docs/couchapp/ddocs.html#view-functions",
     "map_functions": "/_utils/docs/couchapp/ddocs.html#map-functions",
     "reduce_functions": "/_utils/docs/couchapp/ddocs.html#reduce-and-rereduce-functions",


[24/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
style search box
cancel button functionality, styling
styling header and query options, add cancel button
style keys well, get new checkbox inputs working
have options properly toggle, style button


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/14bb0f28
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/14bb0f28
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/14bb0f28

Branch: refs/heads/secondary-indexes
Commit: 14bb0f28953dc831a6e303d01379ba97cb3ca188
Parents: 80e4524
Author: Jenn Schiffer <je...@pancaketheorem.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:35:31 2014 -0400

----------------------------------------------------------------------
 .../documents/assets/less/advancedOptions.less  | 85 +++++++++++++++-----
 app/addons/documents/assets/less/documents.less |  6 +-
 app/addons/documents/assets/less/headers.less   | 25 ++++++
 .../documents/templates/advanced_options.html   | 45 ++++++-----
 .../documents/templates/all_docs_layout.html    | 13 ---
 app/addons/documents/views-advancedopts.js      | 16 +++-
 app/helpers.js                                  |  1 +
 7 files changed, 130 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/14bb0f28/app/addons/documents/assets/less/advancedOptions.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/advancedOptions.less b/app/addons/documents/assets/less/advancedOptions.less
index ce8b546..83b1655 100644
--- a/app/addons/documents/assets/less/advancedOptions.less
+++ b/app/addons/documents/assets/less/advancedOptions.less
@@ -12,31 +12,38 @@
 /*ALL DOCS TABLE*/
 
 /*for advanced options css*/
+.advanced-options.well {
+  display: inline-block;
+  background: none;
+  border: none;
+  box-shadow: none;
+}
 #query-options-tray {
+  display: none;
   .border-radius(5px);
   width: 490px;
   position: absolute;
   z-index: 11;
   background-color: #333;
+  color: #fff;
   padding: 0;
-
-    color: #fff;
- 
+  margin: 0;
+  .add-on {
+    padding-bottom: 10px;
+  }
+  .query-group {
+    padding: 20px;
+    border-bottom: 1px solid #555;
+  }
+  .query-group:last-child {
+    border-bottom: none;
+  }
+  .controls-group {
     margin: 0;
-    .query-group {
-      padding: 20px;
-      border-bottom: 1px solid #555;
-    }
-    .query-group:last-child {
-      border-bottom: none;
-    }
-    .controls-group {
-      margin: 0;
-    }
-    .controls-group:last-child {
-      margin: 0;
-    }
-  
+  }
+  .controls-group:last-child {
+    margin: 0;
+  }
   form {
     margin-bottom: 0;
     .dropdown.inline {
@@ -49,10 +56,25 @@
       padding: 8px;
       border: none;
       color: #eee;
+      font-size: 13px;
+    }
+    .input-small {
+      width: 70px;
+      margin-left: 5px;
+    }
+    .checkbox {
+      padding: 0;
+      margin: 0;
     }
     .btn-success {
       .border-radius(5px);
     }
+    .btn-cancel, .btn-cancel:active {
+      background: none;
+      border: none;
+      box-shadow: none;
+      color: @red;
+    }
   }
   .toggle-btns {
     .btn {
@@ -75,6 +97,32 @@
       margin-left: 1px;
     }
   }
+  label {
+    margin-right: 0;
+    font-size: 13px;
+  }
+  div.controls-group.well{
+    height: 180px;
+    background: none;
+    border: none;
+    padding: 10px 0;
+  }
+  .row-fluid.fieldsets {
+    margin-bottom: 10px;
+    .inline {
+      width: 32%;
+    }
+    .inline:nth-child(3) {
+      text-align: right;
+      width: 34%;
+    }
+  }
+  .row-fluid.fieldsets:last-child {
+    margin-bottom: 0;
+  }
+  #skipRows {
+    margin-left: 5px;
+  }
 }
 #query-options-tray:before {
   content: '';
@@ -86,7 +134,4 @@
   border-width: 15px;
   width: 0;
   height: 0;
-}
-#button-options {
-  margin-top: 20px;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/14bb0f28/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index 271c9da..26e3ffa 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -17,6 +17,7 @@
 @import "advancedOptions.less";
 @import "changes.less";
 @import "sidenav.less";
+@import "headers.less";
 
 tr.all-docs-item {
   border: none;
@@ -42,11 +43,6 @@ button.beautify {
 }
 
 
-#query-options-tray div.controls-group.well{
-    height: 180px;
-    margin-right: 17px;
-}
-
 /** used in all_docs_list.html **/
 .view {
     table td div {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/14bb0f28/app/addons/documents/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/headers.less b/app/addons/documents/assets/less/headers.less
new file mode 100644
index 0000000..3df552c
--- /dev/null
+++ b/app/addons/documents/assets/less/headers.less
@@ -0,0 +1,25 @@
+.header-left {
+  width: 300px;
+  float: left;
+}
+.header-right {
+  .searchbox-container {
+    position: relative;
+    right: inherit;
+    height: 38px;
+    input[type="text"] {
+      .border-radius(5px);
+      font-size: 13px;
+      padding: 8px 35px 8px 10px;
+    }
+    .btn-primary {
+      background: none repeat scroll 0% 0% transparent;
+      border: none;
+      position: absolute;
+      right: 0;
+      padding-top: 7px;
+      z-index: 2;
+      color: #999;
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/14bb0f28/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/advanced_options.html b/app/addons/documents/templates/advanced_options.html
index 8e8bb36..0502301 100644
--- a/app/addons/documents/templates/advanced_options.html
+++ b/app/addons/documents/templates/advanced_options.html
@@ -20,21 +20,21 @@ the License.
   <form class="js-view-query-update custom-inputs">
 
     <div class="query-group">
-      <span class="add-on">
+      <div class="add-on">
         API Options
         <a class="help-link" href="<%-getDocUrl(documentation)%>" target="_blank">
           <i class="icon-question-sign"></i>
         </a>
-      </span>
+      </div>
 
       <div class="errors-container"></div>
       
         <div class="controls-group">
-          <div class="row-fluid">
+          <div class="row-fluid fieldsets">
 
               <div class="checkbox inline">
-                <input id="select2" name="include_docs" type="checkbox" value="true">
-                <label for="include_docs">Include Docs</label>
+                <input id="check1" name="include_docs" type="checkbox" value="true">
+                <label for="check1">Include Docs</label>
               </div>
 
               <% if (hasReduce) { %>
@@ -66,9 +66,9 @@ the License.
     </div>
 
     <div class="query-group">
-      <span class="add-on">
+      <div class="add-on">
         Keys
-      </span>
+      </div>
       <!-- tabs for choosing Keys or Start & end -->
       <div class="btn-group toggle-btns row-fluid">
         <label for="showKeys" class="drop-down btn">
@@ -110,25 +110,26 @@ the License.
 
     <div class="controls-group query-group">
       <!-- Limit and Skip are conditional -->
-      <span class="add-on">
+      <div class="add-on">
         Additional Parameters
-      </span>
+      </div>
 
-      <div class="row-fluid">
+      <div class="row-fluid fieldsets">
         <% if (showStale) { %>
           <div class="checkbox inline">
             <input id="check7" name="stale" type="checkbox" value="ok">
             <label for="check7">Stale</label>
           </div>
         <% } %>
-          <div class="checkbox inline">
-            <input id="check6" name="update_seq" type="checkbox" value="true">
-            <label for="check6">Update Sequence</label>
-          </div>
+
+        <div class="checkbox inline">
+          <input id="check6" name="update_seq" type="checkbox" value="true">
+          <label for="check6">Update Sequence</label>
+        </div>
 
         <div class="dropdown inline">
           <label class="drop-down">
-            Limit:
+            Limit 
             <select name="limit" class="input-small">
               <option selected="selected">None</option>
               <option>5</option>
@@ -144,10 +145,10 @@ the License.
 
       </div>
 
-      <div class="row-fluid">
+      <div class="row-fluid fieldsets">
         <div class="checkbox inline">
-          <input id="select2" name="descending" type="checkbox" value="true">
-          <label for="descending">Descending</label>
+          <input id="check3" name="descending" type="checkbox" value="true">
+          <label for="check3">Descending</label>
         </div>
 
         <div class="dropdown inline">
@@ -160,14 +161,18 @@ the License.
     </div>
 
     <div class="controls-group query-group">
-      <span class="add-on">
+      <div class="add-on">
         Query the DB
-      </span>
+      </div>
       <div id="button-options" class="controls controls-row">
         <button type="submit" class="btn btn-success">
           <i class="fonticon-play icon"></i>
           Query
         </button>
+
+        <a class="btn btn-cancel">
+          Cancel
+        </a>
       </div>
     </div>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/14bb0f28/app/addons/documents/templates/all_docs_layout.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_layout.html b/app/addons/documents/templates/all_docs_layout.html
deleted file mode 100644
index 90de57c..0000000
--- a/app/addons/documents/templates/all_docs_layout.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/14bb0f28/app/addons/documents/views-advancedopts.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-advancedopts.js b/app/addons/documents/views-advancedopts.js
index f8a1be6..9a00c63 100644
--- a/app/addons/documents/views-advancedopts.js
+++ b/app/addons/documents/views-advancedopts.js
@@ -40,7 +40,8 @@ function(app, FauxtonAPI, resizeColumns ) {
       "change form.js-view-query-update select": "updateFilters",
       "submit form.js-view-query-update": "updateView",
       "click .toggle-btns > label":  "toggleQueryKeys",
-      "click #toggle-query": "toggleQuery"
+      "click #toggle-query": "toggleQuery",
+      "click .btn-cancel": "resetForm"
     },
 
     toggleQueryKeys: function(e){
@@ -62,10 +63,19 @@ function(app, FauxtonAPI, resizeColumns ) {
       }
     },
 
-    toggleQuery: function (event) {
-      console.log('togglequery');
+    toggleQuery: function(event) {
       $('#dashboard-content').scrollTop(0);
       this.$('#query-options-tray').toggle();
+    }, 
+
+    resetForm: function() {
+      $('input, textarea').each(function(){
+        $(this).val('');
+      });
+      $('input:checkbox').attr('checked', false);
+      $("select").each(function(){ 
+        this.selectedIndex = 0;
+      });
     },
 
     showKeys: function(){

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/14bb0f28/app/helpers.js
----------------------------------------------------------------------
diff --git a/app/helpers.js b/app/helpers.js
index acaaba2..2810350 100644
--- a/app/helpers.js
+++ b/app/helpers.js
@@ -36,6 +36,7 @@ function(utils, d3) {
     return path;
   };
 
+
   // Get the URL for documentation, wiki, wherever we store it.
   // update the URLs in documentation_urls.js
   Helpers.docs =  {


[12/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Implement a filter for databases

Uses a new model to manage the state of the different search
filters to filter the view.

Nice feature: the filter for the database (upper input) and
the filters for the type (buttons) work nicely together,
so you can filter out all replications for that
database (let's name it registry)  without the compaction,
if you choose replication as type and enter "registry" in the
top input.

Closes COUCHDB-2125


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/2adfaf93
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/2adfaf93
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/2adfaf93

Branch: refs/heads/secondary-indexes
Commit: 2adfaf932a26a601fea0fc8cf316b6feb9023f99
Parents: b7c32c2
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri Aug 1 20:10:13 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Wed Aug 20 19:15:22 2014 +0200

----------------------------------------------------------------------
 .../activetasks/assets/less/activetasks.less    | 30 ++++++++++
 app/addons/activetasks/resources.js             |  4 ++
 app/addons/activetasks/routes.js                | 20 ++++++-
 .../activetasks/templates/tab_header.html       | 33 +++++++++++
 app/addons/activetasks/templates/table.html     | 24 ++------
 app/addons/activetasks/tests/viewsSpec.js       | 36 +++++++-----
 app/addons/activetasks/views.js                 | 59 +++++++++++++++-----
 7 files changed, 155 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2adfaf93/app/addons/activetasks/assets/less/activetasks.less
----------------------------------------------------------------------
diff --git a/app/addons/activetasks/assets/less/activetasks.less b/app/addons/activetasks/assets/less/activetasks.less
index b06f550..0f92a77 100644
--- a/app/addons/activetasks/assets/less/activetasks.less
+++ b/app/addons/activetasks/assets/less/activetasks.less
@@ -14,3 +14,33 @@
 .active-tasks th {
   cursor: pointer;
 }
+
+.activetasks-header .task-search-database {
+  margin: 20px;
+}
+
+.active-tasks th {
+  &.type {
+    width: 10%;
+  }
+
+  &.database {
+    width: 23%;
+  }
+
+  &.started {
+    width: 17%;
+  }
+
+  &.updated {
+    width: 17%;
+  }
+
+  &.pid {
+    width: 10%;
+  }
+
+  &.status {
+    width: 23%;
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2adfaf93/app/addons/activetasks/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/activetasks/resources.js b/app/addons/activetasks/resources.js
index 92165dc..0872d41 100644
--- a/app/addons/activetasks/resources.js
+++ b/app/addons/activetasks/resources.js
@@ -63,6 +63,10 @@ function (app, Fauxton) {
     }
   });
 
+  Active.Search = Backbone.Model.extend({
+    filterDatabase: null,
+    filterType: "all"
+  });
 
   return Active;
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2adfaf93/app/addons/activetasks/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/activetasks/routes.js b/app/addons/activetasks/routes.js
index cdc5a01..1805d3f 100644
--- a/app/addons/activetasks/routes.js
+++ b/app/addons/activetasks/routes.js
@@ -20,13 +20,17 @@ define([
 function (app, FauxtonAPI, Activetasks, Views) {
 
   var ActiveTasksRouteObject = FauxtonAPI.RouteObject.extend({
-    layout: "with_sidebar",
+    layout: "with_tabs_sidebar",
 
     routes: {
       "activetasks/:id": "defaultView",
       "activetasks": "defaultView"
     },
 
+    events: {
+      "route:changeFilter": "changeFilter",
+    },
+
     selectedHeader: 'Active Tasks',
 
     crumbs: [
@@ -41,15 +45,25 @@ function (app, FauxtonAPI, Activetasks, Views) {
 
     initialize: function () {
       this.allTasks = new Activetasks.AllTasks();
+      this.search = new Activetasks.Search();
     },
 
     defaultView: function () {
-      this.setView("#dashboard-content", new Views.View({
+      this.setView("#dashboard-lower-content", new Views.View({
         collection: this.allTasks,
-        currentView: "all"
+        currentView: "all",
+        searchModel: this.search
       }));
 
       this.setView("#sidebar-content", new Views.TabMenu({}));
+
+      this.headerView = this.setView("#dashboard-upper-content", new Views.TabHeader({
+        searchModel: this.search
+      }));
+    },
+
+    changeFilter: function (filterType) {
+      this.search.set('filterType', filterType);
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2adfaf93/app/addons/activetasks/templates/tab_header.html
----------------------------------------------------------------------
diff --git a/app/addons/activetasks/templates/tab_header.html b/app/addons/activetasks/templates/tab_header.html
new file mode 100644
index 0000000..d613c7d
--- /dev/null
+++ b/app/addons/activetasks/templates/tab_header.html
@@ -0,0 +1,33 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+<div class="dashboard-upper-menu">
+  <ul class="nav nav-tabs window-resizeable" id="db-views-tabs-nav">
+    <li>
+      <a class="js-toggle-filter" href="#filter" data-bypass="true" data-toggle="tab">
+        <i class="fonticon fonticon-plus"></i>Filter
+      </a>
+    </li>
+  </ul>
+</div>
+
+<div class="tab-content">
+  <div class="tab-pane" id="query">
+    <div class="activetasks-header">
+      <div class="pull-right">
+          <input class="task-search-database" type="text" name="search" placeholder="Search for databases...">
+      </div>
+    </div>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2adfaf93/app/addons/activetasks/templates/table.html
----------------------------------------------------------------------
diff --git a/app/addons/activetasks/templates/table.html b/app/addons/activetasks/templates/table.html
index a8cbd52..2268927 100644
--- a/app/addons/activetasks/templates/table.html
+++ b/app/addons/activetasks/templates/table.html
@@ -12,19 +12,7 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
 
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->
 
 <% if (collection.length === 0){%>
    <tr>
@@ -36,12 +24,12 @@ the License.
 
   <thead>
     <tr>
-      <th data-type="type">Type</th>
-      <th data-type="source,target,database">Object</th>
-      <th data-type="started_on">Started on</th>
-      <th data-type="updated_on">Last updated on</th>
-      <th data-type="pid">PID</th>
-      <th data-type="progress" width="200">Status</th>
+      <th class="type" data-type="type">Type</th>
+      <th class="database" data-type="source,target,database">Database</th>
+      <th class="started" data-type="started_on">Started on</th>
+      <th class="updated" data-type="updated_on">Last updated on</th>
+      <th class="pid" data-type="pid">PID</th>
+      <th class="status" data-type="progress">Status</th>
     </tr>
   </thead>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2adfaf93/app/addons/activetasks/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/activetasks/tests/viewsSpec.js b/app/addons/activetasks/tests/viewsSpec.js
index 8731200..e02dfb1 100644
--- a/app/addons/activetasks/tests/viewsSpec.js
+++ b/app/addons/activetasks/tests/viewsSpec.js
@@ -13,8 +13,9 @@ define([
         'api',
         'addons/activetasks/views',
         'addons/activetasks/resources',
+        'addons/activetasks/routes',
         'testUtils'
-], function (FauxtonAPI, Views, Activetasks, testUtils) {
+], function (FauxtonAPI, Views, Activetasks, RouteObject, testUtils) {
   var assert = testUtils.assert,
       ViewSandbox = testUtils.ViewSandbox;
 
@@ -62,19 +63,30 @@ define([
         assert.ok(spy.calledOnce);
       });
 
+      it("should set the correct active tab", function () {
+        var $rep = tabMenu.$('li[data-type="replication"]');
+        $rep.click();
+        assert.ok($rep.hasClass('active'));
+      });
     });
 
     describe('on request by type', function () {
-      var viewSandbox, mainView;
+      var viewSandbox, mainView, tabHeader, searchModel;
+
       beforeEach(function (done) {
+        searchModel = new Activetasks.Search();
 
+        tabHeader = new Views.TabHeader({
+          searchModel: searchModel
+        });
         mainView = new Views.View({
           collection: new Activetasks.AllTasks(),
-          currentView: "all"
+          currentView: "all",
+          searchModel: searchModel
         });
 
         viewSandbox = new ViewSandbox();
-        viewSandbox.renderView(tabMenu).promise().then(function () {
+        viewSandbox.renderView(tabHeader, function () {
           viewSandbox.renderView(mainView, done);
         });
       });
@@ -83,16 +95,9 @@ define([
         viewSandbox.remove();
       });
 
-      it("should set the filter the main-view", function () {
-        var $rep = tabMenu.$('li[data-type="replication"]');
-        $rep.click();
-        assert.equal("replication", mainView.filter);
-      });
-
-      it("should set correct active tab", function () {
-        var $rep = tabMenu.$('li[data-type="replication"]');
-        $rep.click();
-        assert.ok($rep.hasClass('active'));
+      it("should set the filter 'database' for the main-view", function () {
+        var $rep = tabHeader.$("input").val("registry").trigger("keyup");
+        assert.equal("registry", mainView.searchModel.get('filterDatabase'));
       });
     });
 
@@ -103,7 +108,8 @@ define([
     beforeEach(function (done) {
       mainView = new Views.View({
         collection: new Activetasks.AllTasks(),
-        currentView: "all"
+        currentView: "all",
+        searchModel: new Activetasks.Search()
       });
 
       viewSandbox = new ViewSandbox();

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2adfaf93/app/addons/activetasks/views.js
----------------------------------------------------------------------
diff --git a/app/addons/activetasks/views.js b/app/addons/activetasks/views.js
index 54d8215..28efa36 100644
--- a/app/addons/activetasks/views.js
+++ b/app/addons/activetasks/views.js
@@ -39,30 +39,36 @@ function (app, FauxtonAPI, ActiveTasks) {
       "click th": "sortByType"
     },
 
-    filter: "all",
-
     initialize: function (options) {
-      this.listenTo(ActiveTasks.events, "tasks:filter", this.filterAndRender);
+      this.listenTo(this.searchModel, "change", this.render);
       this.listenTo(this.collection, "reset", this.render);
     },
 
     beforeRender: function () {
-      this.filterAndInsertView(this.filter);
-    },
-
-    filterAndRender: function (view) {
-      this.filter = view;
-      this.render();
+      this.filterAndInsertView();
     },
 
     filterAndInsertView: function () {
-      var that = this;
+      var that = this,
+          database = this.searchModel.get("filterDatabase"),
+          filter = this.searchModel.get("filterType"),
+          databaseRegex = new RegExp(database, "g");
+
       this.removeView(".js-tasks-go-here");
 
       this.collection.forEach(function (item) {
-        if (that.filter !== "all" && item.get("type") !== that.filter) {
+
+        if (filter && filter !== "all" && item.get("type") !== filter) {
           return;
         }
+
+        if (database &&
+            !databaseRegex.test(item.get("source")) &&
+            !databaseRegex.test(item.get("target")) &&
+            !databaseRegex.test(item.get("database"))) {
+          return;
+        }
+
         var view = new Views.TableDetail({
           model: item
         });
@@ -148,12 +154,12 @@ function (app, FauxtonAPI, ActiveTasks) {
 
     requestByType: function(e){
       var currentTarget = e.currentTarget,
-          datatype = this.$(currentTarget).attr("data-type");
+          filter = this.$(currentTarget).attr("data-type");
 
       this.$('.task-tabs').find('li').removeClass('active');
       this.$(currentTarget).addClass('active');
 
-      ActiveTasks.events.trigger("tasks:filter", datatype);
+      FauxtonAPI.triggerRouteEvent('changeFilter', filter);
     }
   });
 
@@ -171,7 +177,7 @@ function (app, FauxtonAPI, ActiveTasks) {
       if (this.type === "replication"){
         objectField = this.model.get('source') + " to " + this.model.get('target');
       } else if (this.type === "indexer") {
-        objectField = this.model.get("database") + " / " + this.model.get("design_document");
+        objectField = this.model.get("database") + " (View: " + this.model.get("design_document") + ")";
       }
       return objectField;
     },
@@ -179,7 +185,7 @@ function (app, FauxtonAPI, ActiveTasks) {
     getProgress:  function(){
       var progress = "";
       if (this.type === "indexer"){
-        progress = "Processed " +this.model.get('changes_done')+ " of "+this.model.get('total_changes')+ ' changes.';
+        progress = "Processed " +this.model.get('changes_done')+ " of "+this.model.get('total_changes')+ ' changes. ';
       } else if (this.type === "replication"){
         progress = this.model.get('docs_written')+ " docs written. ";
         if (this.model.get('changes_pending') !== undefined) {
@@ -208,5 +214,28 @@ function (app, FauxtonAPI, ActiveTasks) {
     }
   });
 
+  Views.TabHeader = FauxtonAPI.View.extend({
+    template: "addons/activetasks/templates/tab_header",
+
+    events: {
+      "keyup input": "searchDb",
+      "click .js-toggle-filter": "toggleQuery"
+    },
+
+    toggleQuery: function (event) {
+      $('#dashboard-content').scrollTop(0);
+      this.$('#query').toggle('slow');
+    },
+
+    searchDb: function (event) {
+      event.preventDefault();
+
+      var $search = this.$('input[name="search"]'),
+          database = $search.val();
+
+      this.searchModel.set('filterDatabase', database);
+    }
+  });
+
   return Views;
 });


[19/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
refactor query options button to header


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/80e4524c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/80e4524c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/80e4524c

Branch: refs/heads/secondary-indexes
Commit: 80e4524c772fee0dde2f9c16fc09b89816b1ba00
Parents: 5b674dd
Author: Jenn Schiffer <je...@pancaketheorem.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:35:09 2014 -0400

----------------------------------------------------------------------
 .../documents/assets/less/advancedOptions.less  |  12 +-
 app/addons/documents/assets/less/documents.less |   2 +-
 app/addons/documents/routes.js                  |   7 -
 .../documents/templates/advanced_options.html   | 265 ++++++++++---------
 .../documents/templates/header_alldocs.html     |   4 -
 app/addons/documents/views-advancedopts.js      |   2 +-
 6 files changed, 143 insertions(+), 149 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/80e4524c/app/addons/documents/assets/less/advancedOptions.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/advancedOptions.less b/app/addons/documents/assets/less/advancedOptions.less
index a932559..ce8b546 100644
--- a/app/addons/documents/assets/less/advancedOptions.less
+++ b/app/addons/documents/assets/less/advancedOptions.less
@@ -12,18 +12,16 @@
 /*ALL DOCS TABLE*/
 
 /*for advanced options css*/
-#query-options {
+#query-options-tray {
   .border-radius(5px);
   width: 490px;
   position: absolute;
   z-index: 11;
   background-color: #333;
   padding: 0;
-  .well {
-    background: none;
-    border: none;
+
     color: #fff;
-    padding: 0;
+ 
     margin: 0;
     .query-group {
       padding: 20px;
@@ -38,7 +36,7 @@
     .controls-group:last-child {
       margin: 0;
     }
-  }
+  
   form {
     margin-bottom: 0;
     .dropdown.inline {
@@ -78,7 +76,7 @@
     }
   }
 }
-#query-options:before {
+#query-options-tray:before {
   content: '';
   position: absolute;
   top: -25px;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/80e4524c/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index 647e847..271c9da 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -42,7 +42,7 @@ button.beautify {
 }
 
 
-#query-options div.controls-group.well{
+#query-options-tray div.controls-group.well{
     height: 180px;
     margin-right: 17px;
 }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/80e4524c/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index 8a43528..bd52fb8 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -247,13 +247,6 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
 
       this.data.database.allDocs.paging.pageSize = this.getDocPerPageLimit(urlParams, parseInt(docParams.limit, 10));
 
-      this.viewEditor = this.setView("#dashboard-upper-content", new Documents.Views.AllDocsHeader({
-        database: this.data.database,
-        collection: this.data.database.allDocs,
-        params: urlParams,
-        docParams: docParams
-      }));
-
       this.documentsView = this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
         database: this.data.database,
         collection: this.data.database.allDocs,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/80e4524c/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/advanced_options.html b/app/addons/documents/templates/advanced_options.html
index c6268fb..8e8bb36 100644
--- a/app/addons/documents/templates/advanced_options.html
+++ b/app/addons/documents/templates/advanced_options.html
@@ -10,160 +10,167 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
--->
-<form class="js-view-query-update custom-inputs">
-
-  <div class="query-group">
-    <span class="add-on">
-      API Options
-      <a class="help-link" href="<%-getDocUrl(documentation)%>" target="_blank">
-        <i class="icon-question-sign"></i>
-      </a>
-    </span>
-
-    <div class="errors-container"></div>
-    
-      <div class="controls-group">
-        <div class="row-fluid">
-
-            <div class="checkbox inline">
-              <input id="select2" name="include_docs" type="checkbox" value="true">
-              <label for="include_docs">Include Docs</label>
-            </div>
+-->    
+<a id="toggle-query" href="#query-options-tray" data-bypass="true" data-toggle="tab">
+  <i class="fonticon fonticon-plus"></i>
+  Query Options
+</a>
+
+<div id="query-options-tray">
+  <form class="js-view-query-update custom-inputs">
+
+    <div class="query-group">
+      <span class="add-on">
+        API Options
+        <a class="help-link" href="<%-getDocUrl(documentation)%>" target="_blank">
+          <i class="icon-question-sign"></i>
+        </a>
+      </span>
+
+      <div class="errors-container"></div>
+      
+        <div class="controls-group">
+          <div class="row-fluid">
 
-            <% if (hasReduce) { %>
               <div class="checkbox inline">
-                <input id="check2" name="reduce" type="checkbox" value="true">
-                <label for="check2">Reduce</label>
+                <input id="select2" name="include_docs" type="checkbox" value="true">
+                <label for="include_docs">Include Docs</label>
               </div>
-       
-              <label id="select1" class="drop-down inline">
-                Group Level
-                <select id="select1" disabled name="group_level" class="input-small">
-                  <option value="0">None</option>
-                  <option value="1">1</option>
-                  <option value="2">2</option>
-                  <option value="3">3</option>
-                  <option value="4">4</option>
-                  <option value="5">5</option>
-                  <option value="6">6</option>
-                  <option value="7">7</option>
-                  <option value="8">8</option>
-                  <option value="9">9</option>
-                  <option value="999" selected="selected">Exact</option>
-                </select>
-              </label>
-            <% } %>
 
+              <% if (hasReduce) { %>
+                <div class="checkbox inline">
+                  <input id="check2" name="reduce" type="checkbox" value="true">
+                  <label for="check2">Reduce</label>
+                </div>
+         
+                <label id="select1" class="drop-down inline">
+                  Group Level
+                  <select id="select1" disabled name="group_level" class="input-small">
+                    <option value="0">None</option>
+                    <option value="1">1</option>
+                    <option value="2">2</option>
+                    <option value="3">3</option>
+                    <option value="4">4</option>
+                    <option value="5">5</option>
+                    <option value="6">6</option>
+                    <option value="7">7</option>
+                    <option value="8">8</option>
+                    <option value="9">9</option>
+                    <option value="999" selected="selected">Exact</option>
+                  </select>
+                </label>
+              <% } %>
+
+          </div>
         </div>
-      </div>
-  </div>
-
-  <div class="query-group">
-    <span class="add-on">
-      Keys
-    </span>
-    <!-- tabs for choosing Keys or Start & end -->
-    <div class="btn-group toggle-btns row-fluid">
-      <label for="showKeys" class="drop-down btn">
-       By Key(s)
-      </label>
-      <label for="showStartEnd" class="drop-down btn">
-        Between Keys
-      </label>
     </div>
 
-    <div class="controls-group well hide js-query-keys-wrapper">
-      <div class="row-fluid" id="js-showKeys">
-        <div class="controls controls-row">
-          <label for="keys-input" class="drop-down">A key, or an array of keys.</label>
-          <textarea id="keys-input" name="keys" class="input-xxlarge" rows="5" type="text" placeholder='Enter valid JSON; e.g., ["1234"] or ["1234","2345"]'></textarea>
-          <div id="keys-error" class="inline-block js-keys-error"></div>
-        </div>
+    <div class="query-group">
+      <span class="add-on">
+        Keys
+      </span>
+      <!-- tabs for choosing Keys or Start & end -->
+      <div class="btn-group toggle-btns row-fluid">
+        <label for="showKeys" class="drop-down btn">
+         By Key(s)
+        </label>
+        <label for="showStartEnd" class="drop-down btn">
+          Between Keys
+        </label>
       </div>
-      <div class="row-fluid hide" id="js-showStartEnd">
-        <div class="controls controls-row">
-          <div>
-            <label for="startkey" class="drop-down">Start key</label>
-            <input name="startkey" id="startkey" type="text" placeholder='e.g., "1234"' disabled>
+
+      <div class="controls-group well hide js-query-keys-wrapper">
+        <div class="row-fluid" id="js-showKeys">
+          <div class="controls controls-row">
+            <label for="keys-input" class="drop-down">A key, or an array of keys.</label>
+            <textarea id="keys-input" name="keys" class="input-xxlarge" rows="5" type="text" placeholder='Enter valid JSON; e.g., ["1234"] or ["1234","2345"]'></textarea>
+            <div id="keys-error" class="inline-block js-keys-error"></div>
           </div>
-          <div>
-            <label for="endkey" class="drop-down">End key</label>
-            <input id="endkey" name="endkey" type="text" placeholder='e.g., "1234"'>
-            <div class="controls controls-row checkbox inline">
-              <input id="check5" name="inclusive_end" type="checkbox" value="true" checked disabled>
-              <label for="check5">Include End Key in results</label>
+        </div>
+        <div class="row-fluid hide" id="js-showStartEnd">
+          <div class="controls controls-row">
+            <div>
+              <label for="startkey" class="drop-down">Start key</label>
+              <input name="startkey" id="startkey" type="text" placeholder='e.g., "1234"' disabled>
+            </div>
+            <div>
+              <label for="endkey" class="drop-down">End key</label>
+              <input id="endkey" name="endkey" type="text" placeholder='e.g., "1234"'>
+              <div class="controls controls-row checkbox inline">
+                <input id="check5" name="inclusive_end" type="checkbox" value="true" checked disabled>
+                <label for="check5">Include End Key in results</label>
+              </div>
             </div>
+
           </div>
 
         </div>
-
       </div>
     </div>
-  </div>
 
-  <div class="controls-group query-group">
-    <!-- Limit and Skip are conditional -->
-    <span class="add-on">
-      Additional Parameters
-    </span>
+    <div class="controls-group query-group">
+      <!-- Limit and Skip are conditional -->
+      <span class="add-on">
+        Additional Parameters
+      </span>
+
+      <div class="row-fluid">
+        <% if (showStale) { %>
+          <div class="checkbox inline">
+            <input id="check7" name="stale" type="checkbox" value="ok">
+            <label for="check7">Stale</label>
+          </div>
+        <% } %>
+          <div class="checkbox inline">
+            <input id="check6" name="update_seq" type="checkbox" value="true">
+            <label for="check6">Update Sequence</label>
+          </div>
 
-    <div class="row-fluid">
-      <% if (showStale) { %>
-        <div class="checkbox inline">
-          <input id="check7" name="stale" type="checkbox" value="ok">
-          <label for="check7">Stale</label>
-        </div>
-      <% } %>
-        <div class="checkbox inline">
-          <input id="check6" name="update_seq" type="checkbox" value="true">
-          <label for="check6">Update Sequence</label>
+        <div class="dropdown inline">
+          <label class="drop-down">
+            Limit:
+            <select name="limit" class="input-small">
+              <option selected="selected">None</option>
+              <option>5</option>
+              <option>10</option>
+              <option>20</option>
+              <option>30</option>
+              <option>50</option>
+              <option>100</option>
+              <option>500</option>
+            </select>
+          </label>
         </div>
 
-      <div class="dropdown inline">
-        <label class="drop-down">
-          Limit:
-          <select name="limit" class="input-small">
-            <option selected="selected">None</option>
-            <option>5</option>
-            <option>10</option>
-            <option>20</option>
-            <option>30</option>
-            <option>50</option>
-            <option>100</option>
-            <option>500</option>
-          </select>
-        </label>
       </div>
 
-    </div>
+      <div class="row-fluid">
+        <div class="checkbox inline">
+          <input id="select2" name="descending" type="checkbox" value="true">
+          <label for="descending">Descending</label>
+        </div>
 
-    <div class="row-fluid">
-      <div class="checkbox inline">
-        <input id="select2" name="descending" type="checkbox" value="true">
-        <label for="descending">Descending</label>
+        <div class="dropdown inline">
+          <label for="skipRows" class="drop-down">
+            Skip
+            <input name="skip" class="input-small" type="text" id="skipRows" placeholder="# of rows">
+          </label>
+        </div>
       </div>
+    </div>
 
-      <div class="dropdown inline">
-        <label for="skipRows" class="drop-down">
-          Skip
-          <input name="skip" class="input-small" type="text" id="skipRows" placeholder="# of rows">
-        </label>
+    <div class="controls-group query-group">
+      <span class="add-on">
+        Query the DB
+      </span>
+      <div id="button-options" class="controls controls-row">
+        <button type="submit" class="btn btn-success">
+          <i class="fonticon-play icon"></i>
+          Query
+        </button>
       </div>
     </div>
-  </div>
-
-  <div class="controls-group query-group">
-    <span class="add-on">
-      Query the DB
-    </span>
-    <div id="button-options" class="controls controls-row">
-      <button type="submit" class="btn btn-success">
-        <i class="fonticon-play icon"></i>
-        Query
-      </button>
-    </div>
-  </div>
 
-</form>
+  </form>
+</div>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/80e4524c/app/addons/documents/templates/header_alldocs.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html
index 6312a47..dfdfc03 100644
--- a/app/addons/documents/templates/header_alldocs.html
+++ b/app/addons/documents/templates/header_alldocs.html
@@ -30,10 +30,6 @@ the License.
    
   <!-- Query Options-->
   <div class="header-query-options">
-    <a id="toggle-query" href="#query-options" data-bypass="true" data-toggle="tab">
-      <i class="fonticon fonticon-plus"></i>
-      Query Options
-    </a>
     <!-- Insert the query options here :) -->
     <div id="query-options">
     </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/80e4524c/app/addons/documents/views-advancedopts.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-advancedopts.js b/app/addons/documents/views-advancedopts.js
index 6cb515e..f8a1be6 100644
--- a/app/addons/documents/views-advancedopts.js
+++ b/app/addons/documents/views-advancedopts.js
@@ -65,7 +65,7 @@ function(app, FauxtonAPI, resizeColumns ) {
     toggleQuery: function (event) {
       console.log('togglequery');
       $('#dashboard-content').scrollTop(0);
-      this.$('#query-options').toggle();
+      this.$('#query-options-tray').toggle();
     },
 
     showKeys: function(){


[47/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Commenting out the POC and placeholder stuff


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/0cf994c5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/0cf994c5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/0cf994c5

Branch: refs/heads/secondary-indexes
Commit: 0cf994c5aff6d92466e098d347f353b31e7ba70e
Parents: 8637328
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:37 2014 -0400

----------------------------------------------------------------------
 app/addons/indexes/base.js                     | 36 ++++++++++++---------
 app/addons/indexes/routes-viewindexes.js       |  5 +--
 app/addons/indexes/templates/header_right.html |  4 ---
 3 files changed, 21 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0cf994c5/app/addons/indexes/base.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/base.js b/app/addons/indexes/base.js
index 6365c61..f2220fa 100644
--- a/app/addons/indexes/base.js
+++ b/app/addons/indexes/base.js
@@ -44,14 +44,16 @@ function(app, FauxtonAPI, Routes) {
       ddocType:'view',
       icon: "fonticon-sidenav-map-reduce"
     });
-    FauxtonAPI.registerExtension('sidebar:list', {
-      selector:'list',
-      icon: "fonticon-sidenav-list-function"
-    });
-    FauxtonAPI.registerExtension('sidebar:list', {
-      selector:'show',
-      icon: "fonticon-sidenav-show-function"
-    });
+
+    //Commented out since they are just POCs
+    // FauxtonAPI.registerExtension('sidebar:list', {
+    //   selector:'list',
+    //   icon: "fonticon-sidenav-list-function"
+    // });
+    // FauxtonAPI.registerExtension('sidebar:list', {
+    //   selector:'show',
+    //   icon: "fonticon-sidenav-show-function"
+    // });
 
 
     /* show in the add new menu dropdown */
@@ -59,15 +61,17 @@ function(app, FauxtonAPI, Routes) {
       title: "Secondary View",
       url: "new_view"
     });
-    FauxtonAPI.registerExtension('sidebar:links', {
-      title: "List Function",
-      url: "new_list"
-    });
 
-    FauxtonAPI.registerExtension('sidebar:links', {
-      url: 'new_show',
-      title: 'Show Index'
-    });
+    //Commented out since they are just POCs
+    // FauxtonAPI.registerExtension('sidebar:links', {
+    //   title: "List Function",
+    //   url: "new_list"
+    // });
+
+    // FauxtonAPI.registerExtension('sidebar:links', {
+    //   url: 'new_show',
+    //   title: 'Show Index'
+    // });
 
   };
   return Routes;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0cf994c5/app/addons/indexes/routes-viewindexes.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-viewindexes.js b/app/addons/indexes/routes-viewindexes.js
index 546d72c..663e0e8 100644
--- a/app/addons/indexes/routes-viewindexes.js
+++ b/app/addons/indexes/routes-viewindexes.js
@@ -85,10 +85,7 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore, Co
       ];
 
       var dropdown = [{
-        links: [{
-          title: 'Duplicate Index',
-          icon: 'fonticon-documents'
-        },
+        links: [
         {
           title: 'Delete',
           icon: 'fonticon-trash',

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0cf994c5/app/addons/indexes/templates/header_right.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/header_right.html b/app/addons/indexes/templates/header_right.html
index 0370e51..2fba038 100644
--- a/app/addons/indexes/templates/header_right.html
+++ b/app/addons/indexes/templates/header_right.html
@@ -21,7 +21,3 @@ the License.
   </div>
 
 
-  <div id="header-select-all" class="button">
-    <span class="toggle-select-menu icon fonticon-ok-circled">Select</span>
-  </div>
-


[41/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Header stuff for all docs


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/6daad5d1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/6daad5d1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/6daad5d1

Branch: refs/heads/secondary-indexes
Commit: 6daad5d118ed122c636572ad5429d6f1b7e52af5
Parents: f5fd76d
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 app/addons/databases/routes.js                  |  3 +
 .../databases/templates/header_alldbs.html      | 26 ++++++
 app/addons/databases/templates/jump_to_db.html  | 19 ++++
 app/addons/databases/templates/list.html        | 38 +++-----
 app/addons/databases/views.js                   | 97 ++++++++++++++++----
 app/addons/documents/templates/view_editor.html |  0
 app/addons/documents/tests/viewsSpec.js         | 57 ------------
 app/addons/fauxton/resizeColumns.js             | 23 +++++
 app/addons/fauxton/tests/baseSpec.js            |  6 --
 app/templates/layouts/one_pane.html             |  4 +-
 assets/less/headers.less                        |  7 +-
 assets/less/templates.less                      | 16 +---
 12 files changed, 172 insertions(+), 124 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/app/addons/databases/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/routes.js b/app/addons/databases/routes.js
index 131abf9..1e4396c 100644
--- a/app/addons/databases/routes.js
+++ b/app/addons/databases/routes.js
@@ -45,6 +45,9 @@ function(app, FauxtonAPI, Databases, Views) {
     initialize: function() {
       this.databases = new Databases.List();
       this.deferred = FauxtonAPI.Deferred();
+      this.rightHeader = this.setView("#api-navbar", new Views.RightAllDBsHeader({
+        collection: this.databases
+      }));
     },
 
     allDatabases: function() {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/app/addons/databases/templates/header_alldbs.html
----------------------------------------------------------------------
diff --git a/app/addons/databases/templates/header_alldbs.html b/app/addons/databases/templates/header_alldbs.html
new file mode 100644
index 0000000..a993225
--- /dev/null
+++ b/app/addons/databases/templates/header_alldbs.html
@@ -0,0 +1,26 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+  <!-- floats right -->
+
+  <div id="header-api-bar" class="button"></div>
+
+  <!-- add database-->
+  <div class="button add-db">
+  </div>
+
+  <!-- search (jump to doc)-->
+  <div id="header-search" class="js-search searchbox-container"></div>
+
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/app/addons/databases/templates/jump_to_db.html
----------------------------------------------------------------------
diff --git a/app/addons/databases/templates/jump_to_db.html b/app/addons/databases/templates/jump_to_db.html
new file mode 100644
index 0000000..6c0f03a
--- /dev/null
+++ b/app/addons/databases/templates/jump_to_db.html
@@ -0,0 +1,19 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+<form id="jump-to-db" class="navbar-form pull-right database-search">
+  <div class="input-append">
+    <input type="text" class="search-autocomplete" name="search-query" placeholder="Database name" />
+    <button class="btn btn-primary" type="submit"><i class="icon icon-search"></i></button>
+  </div>
+</form>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/app/addons/databases/templates/list.html
----------------------------------------------------------------------
diff --git a/app/addons/databases/templates/list.html b/app/addons/databases/templates/list.html
index 1503c32..b0569e7 100644
--- a/app/addons/databases/templates/list.html
+++ b/app/addons/databases/templates/list.html
@@ -11,27 +11,19 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-
-<div class="result-tools" style="">
-  <div id="newButton" class="pull-left"></div>
-  <form id="jump-to-db" class="navbar-form pull-right database-search">
-    <div class="input-append">
-      <input type="text" class="search-autocomplete" name="search-query" placeholder="Database name" />
-      <button class="btn btn-primary" type="submit"><i class="icon icon-search"></i></button>
-    </div>
-  </form>
-
-
+<div class="view">
+  <table class="databases table table-striped">
+    <thead>
+      <th>Name</th>
+      <th>Size</th>
+      <th># of Docs</th>
+      <th>Update Seq</th>
+      <th>Actions</th>
+    </thead>
+    <tbody>
+    </tbody>
+  </table>
 </div>
-<table class="databases table table-striped">
-  <thead>
-    <th>Name</th>
-    <th>Size</th>
-    <th># of Docs</th>
-    <th>Update Seq</th>
-    <th>Actions</th>
-  </thead>
-  <tbody>
-  </tbody>
-</table>
-<div id="database-pagination"></div>
+<footer class="pagination-footer window-resizeable">
+  <div id="database-pagination"></div>
+</footer>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/app/addons/databases/views.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/views.js b/app/addons/databases/views.js
index 5629cb1..29158c8 100644
--- a/app/addons/databases/views.js
+++ b/app/addons/databases/views.js
@@ -21,6 +21,36 @@ define([
 function(app, Components, FauxtonAPI, Databases) {
   var Views = {};
 
+  //Header for alldocs with search, Query options,& api bar
+  Views.RightAllDBsHeader = FauxtonAPI.View.extend({
+    className: "header-right",
+    template: "addons/databases/templates/header_alldbs",
+    initialize: function(options){
+      //adding the database to the object
+      _.bindAll(this);
+    },
+
+    updateApiUrl: function(api){
+      //this will update the api bar when the route changes
+      //you can find the method that updates it in components.js Components.ApiBar()
+      this.apiBar && this.apiBar.update(api);
+    },
+
+    beforeRender:function(){
+      this.headerSearch = this.insertView("#header-search", new Views.JumpToDB({
+        collection: this.collection
+      }));
+
+      this.newbutton = this.insertView("#add-db-button", new Views.NewDatabaseButton({
+        collection: this.collection
+      }));
+
+
+      //Moved the apibar view into the components file so you can include it in your views
+      this.apiBar = this.insertView("#header-api-bar", new Components.ApiBar({}));
+    }
+  });
+
   Views.Item = FauxtonAPI.View.extend({
     template: "addons/databases/templates/item",
     tagName: "tr",
@@ -36,25 +66,16 @@ function(app, Components, FauxtonAPI, Databases) {
     }
   });
 
-  Views.List = FauxtonAPI.View.extend({
-    dbLimit: 20,
-    perPage: 20,
-    template: "addons/databases/templates/list",
+
+  Views.JumpToDB = FauxtonAPI.View.extend({
+    template: "addons/databases/templates/jump_to_db",
     events: {
-      "click button.all": "selectAll",
       "submit form#jump-to-db": "switchDatabase"
     },
-
     initialize: function(options) {
       var params = app.getParams();
       this.page = params.page ? parseInt(params.page, 10) : 1;
     },
-
-    serialize: function() {
-      return {
-        databases: this.collection
-      };
-    },
     establish: function(){
       var currentDBs = this.paginated();
       var deferred = FauxtonAPI.Deferred();
@@ -90,6 +111,54 @@ function(app, Components, FauxtonAPI, Databases) {
         });
       }
     },
+    afterRender: function() {
+      var that = this,
+          AllDBsArray = _.map(this.collection.toJSON(), function(item, key){
+            return item.name;
+          });
+
+      this.dbSearchTypeahead = new Components.Typeahead({
+        el: "input.search-autocomplete",
+        source: AllDBsArray,
+        onUpdate: function (item) {
+          that.switchDatabase(null, item);
+        }
+      });
+      this.dbSearchTypeahead.render();
+      this.$el.find(".js-db-graveyard").tooltip();
+    }
+  });
+  Views.List = FauxtonAPI.View.extend({
+    dbLimit: 20,
+    perPage: 20,
+    template: "addons/databases/templates/list",
+    events: {
+      "click button.all": "selectAll"
+    },
+
+    initialize: function(options) {
+      var params = app.getParams();
+      this.page = params.page ? parseInt(params.page, 10) : 1;
+    },
+
+    serialize: function() {
+      return {
+        databases: this.collection
+      };
+    },
+    establish: function(){
+      var currentDBs = this.paginated();
+      var deferred = FauxtonAPI.Deferred();
+
+      FauxtonAPI.when(currentDBs.map(function(database) {
+        return database.status.fetchOnce();
+      })).always(function(resp) {
+        //make this always so that even if a user is not allowed access to a database
+        //they will still see a list of all databases
+        deferred.resolve();
+      });
+      return [deferred];
+    },
 
     paginated: function() {
       var start = (this.page - 1) * this.perPage;
@@ -99,10 +168,6 @@ function(app, Components, FauxtonAPI, Databases) {
 
     beforeRender: function() {
 
-      this.insertView("#newButton", new Views.NewDatabaseButton({
-        collection: this.collection
-      }));
-
       _.each(this.paginated(), function(database) {
         this.insertView("table.databases tbody", new Views.Item({
           model: database

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/app/addons/documents/templates/view_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/view_editor.html b/app/addons/documents/templates/view_editor.html
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/app/addons/documents/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/viewsSpec.js b/app/addons/documents/tests/viewsSpec.js
index df3abf7..e69de29 100644
--- a/app/addons/documents/tests/viewsSpec.js
+++ b/app/addons/documents/tests/viewsSpec.js
@@ -1,57 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-define([
-        'addons/documents/views',
-        'addons/documents/resources',
-        'addons/databases/base',
-        'testUtils'
-], function (Views, Resources, Databases, testUtils) {
-  var assert = testUtils.assert,
-      ViewSandbox = testUtils.ViewSandbox,
-      viewSandbox;
-
-  describe('AllDocsList', function () {
-    var database = new Databases.Model({id: 'registry'}),
-        bulkDeleteDocCollection = new Resources.BulkDeleteDocCollection([], {databaseId: 'registry'});
-
-    database.allDocs = new Resources.AllDocs({_id: "ente"}, {
-      database: database,
-      viewMeta: {update_seq: 1},
-      params: {}
-    });
-
-    var view = new Views.Views.AllDocsList({
-      viewList: false,
-      bulkDeleteDocsCollection: bulkDeleteDocCollection,
-      collection: database.allDocs
-    });
-
-    beforeEach(function (done) {
-      viewSandbox = new ViewSandbox();
-      viewSandbox.renderView(view, done);
-    });
-
-    afterEach(function () {
-      viewSandbox.remove();
-    });
-
-    it('should load', function () {
-      assert.equal(typeof Views.Views.AllDocsList, 'function');
-    });
-
-    it('pressing SelectAll should fill the delete-bulk-docs-collection', function () {
-      assert.equal(bulkDeleteDocCollection.length, 0);
-      view.$('button.all').trigger('click');
-      assert.equal(bulkDeleteDocCollection.length, 1);
-    });
-  });
-});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/app/addons/fauxton/resizeColumns.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/resizeColumns.js b/app/addons/fauxton/resizeColumns.js
index 3fd1883..210ae4b 100644
--- a/app/addons/fauxton/resizeColumns.js
+++ b/app/addons/fauxton/resizeColumns.js
@@ -23,6 +23,25 @@ define([
 
 function(FauxtonAPI) {
 
+
+// Lets think about what this needs to do, so it can be rewritten.
+/*
+  I have 3 types of resizable layouts:
+    - full size which will span across the content area that is
+     window.innerWidth - primaryNavWidth
+    - 2 panel which is the above divided by 2 with the left set on the second div
+    - "sidebar" which is window.innerWidth - primaryNavWidth - sidebarwidth
+    Also everything needs to account for border width
+
+    Step 1:
+    - getPrimaryNavWidth
+    - get window.innerWidth
+    - get appContainerWidth AKA full width
+    - getPanelWidth (app container / 2)
+    - sidebarwidth (app container - sidebar)
+*/
+
+
   var Resize = function(options){
     this.options = options;
   };
@@ -33,6 +52,8 @@ function(FauxtonAPI) {
       return primaryNavWidth;
     },
 
+    getSidebarWidth: function(){},
+
     getSinglePanelWidth: function(){
       var sidebarWidth = $('#sidebar-content').length > 0 ? $('#sidebar-content').outerWidth() : 0,
           borders = parseInt($('#dashboard').css('border-left-width'), 10) +
@@ -115,8 +136,10 @@ function(FauxtonAPI) {
         */
 
         var panelWidth = this.getPanelWidth();
+        var fullWidth = this.getPanelWidth();
         this.setPosition(panelWidth);
         $('.window-resizeable').innerWidth(panelWidth);
+        $('.window-resizeable-full').innerWidth(fullWidth);
       }
       //if there is a callback, run that
       if(this.options.callback) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/app/addons/fauxton/tests/baseSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/tests/baseSpec.js b/app/addons/fauxton/tests/baseSpec.js
index b9814bc..8a41cff 100644
--- a/app/addons/fauxton/tests/baseSpec.js
+++ b/app/addons/fauxton/tests/baseSpec.js
@@ -61,12 +61,6 @@ define([
       FauxtonAPI.masterLayout = _layout;
     });
 
-    it('Should clear breadcrumbs', function () {
-      FauxtonAPI.masterLayout = mockLayout;
-      testRouteObject.renderWith('the-route', mockLayout, 'args');
-      assert.ok(mockLayout.removeView.calledWith('#breadcrumbs'), 'Clear Breadcrumbs called');
-    });
-
     it('Should set breadcrumbs when breadcrumbs exist', function () {
       FauxtonAPI.masterLayout = mockLayout;
       testRouteObject.renderWith('the-route', mockLayout, 'args');

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/app/templates/layouts/one_pane.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/one_pane.html b/app/templates/layouts/one_pane.html
index 0bbc989..a3c770b 100644
--- a/app/templates/layouts/one_pane.html
+++ b/app/templates/layouts/one_pane.html
@@ -17,13 +17,13 @@ the License.
   <div id="global-notifications" class="container errors-container window-resizeable"></div>
   <div class="fixed-header">
     <div id="breadcrumbs"></div>
-    <div id="api-navbar"></div>
+    <div id="api-navbar" class="window-resizeable"></div>
   </div>
 
 
   <div class="row-fluid content-area">
   	<div id="tabs" class="row"></div>
-    <div id="dashboard-content" class="window-resizeable"></div>
+    <div id="dashboard-content" class="window-resizeable-full"></div>
   </div>
 </div>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/assets/less/headers.less b/assets/less/headers.less
index a110714..9ce3243 100644
--- a/assets/less/headers.less
+++ b/assets/less/headers.less
@@ -49,9 +49,6 @@
     }
   }
   .one-pane & {
-    #breadcrumbs{
-      width: 90%;
-    }
     position: relative;
     border: none;
     .box-shadow(none);
@@ -74,9 +71,7 @@
 
 #breadcrumbs {
   height: 60px;
-  &.sidebar{
-    width: @sidebarWidth - 4;
-  }
+  width: @sidebarWidth - 4;
   /* these styles are for the new header*/
   .header-left{
     > div{

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6daad5d1/assets/less/templates.less
----------------------------------------------------------------------
diff --git a/assets/less/templates.less b/assets/less/templates.less
index abf1c4b..b2dc28b 100644
--- a/assets/less/templates.less
+++ b/assets/less/templates.less
@@ -342,28 +342,16 @@
   }
 }
 
-#dashboard-lower-content .view{
-  padding: 20px;
-}
 
-#dashboard-upper-content{
-  .tab-content {
-    padding-top: 70px;
-  }
-  .well{
+#dashboard-content{
+  .view {
     padding: 20px;
-    .border-radius(0);
-    .box-shadow(none);
   }
-}
-
-#dashboard-content{
   &.row-fluid,
   &.window-resizeable{
     /*remove gutter without rewriting variable*/
     margin-left: 0px;
   }
-  padding: 20px;
   .with-sidebar &{
     .left-shadow-border;
     border-right: 1px solid #999;


[45/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
fixing some padding issues in other addons


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/86373289
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/86373289
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/86373289

Branch: refs/heads/secondary-indexes
Commit: 86373289a5cd4fe4680ebc0e0a052249044a63b4
Parents: 96bd61a
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:37 2014 -0400

----------------------------------------------------------------------
 app/addons/config/views.js      | 10 ++++++----
 app/addons/replication/views.js | 11 ++++++-----
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/86373289/app/addons/config/views.js
----------------------------------------------------------------------
diff --git a/app/addons/config/views.js b/app/addons/config/views.js
index 7952182..792af32 100644
--- a/app/addons/config/views.js
+++ b/app/addons/config/views.js
@@ -46,7 +46,7 @@ function(app, FauxtonAPI, Config, Components) {
 
     uniqueName: function(name){
       var section = _.findWhere(this.collection.toJSON(), {"section":this.model.get("section")});
-      
+
       return _.findWhere(section.options, {name: name});
     },
 
@@ -108,6 +108,8 @@ function(app, FauxtonAPI, Config, Components) {
   });
 
   Views.Table = FauxtonAPI.View.extend({
+    className: "view",
+
     template: "addons/config/templates/dashboard",
 
     events: {
@@ -158,8 +160,8 @@ function(app, FauxtonAPI, Config, Components) {
       "submit #js-add-section-form": "validate"
     },
     initialize: function(){
-      this.sourceArray = _.map(this.collection.toJSON(), function(item, key){ 
-        return item.section; 
+      this.sourceArray = _.map(this.collection.toJSON(), function(item, key){
+        return item.section;
       });
     },
     afterRender: function(){
@@ -200,7 +202,7 @@ function(app, FauxtonAPI, Config, Components) {
           name = this.$('input[name="name"]').val();
           var section = _.findWhere(collection.toJSON(), {"section":sectionName});
           var options = _.findWhere(section.options, {name: name});
-          
+
           return options;
     },
     isSection: function(){

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/86373289/app/addons/replication/views.js
----------------------------------------------------------------------
diff --git a/app/addons/replication/views.js b/app/addons/replication/views.js
index a19e609..672022a 100644
--- a/app/addons/replication/views.js
+++ b/app/addons/replication/views.js
@@ -32,7 +32,7 @@ function(app, FauxtonAPI, Components, replication) {
   // -----------------------------------
   // afterRender: autocomplete on the target input field
   // beforeRender:  add the status table
-  // disableFields:  disable non active fields on submit 
+  // disableFields:  disable non active fields on submit
   // enableFields:  enable field when radio btns are clicked
   // establish:  get the DB list for autocomplete
   // formValidation:  make sure fields aren't empty
@@ -43,6 +43,7 @@ function(app, FauxtonAPI, Components, replication) {
   // toggleAdvancedOptions:  toggle advanced
 
   View.ReplicationForm = FauxtonAPI.View.extend({
+    className: "view",
     template: "addons/replication/templates/form",
     events:  {
       "submit #replication": "validate",
@@ -153,7 +154,7 @@ function(app, FauxtonAPI, Components, replication) {
         }
       });
       this.enableFields();
-    },		
+    },
     updateButtonText: function(wait){
       var $button = this.$('#replication button[type=submit]');
       if(wait){
@@ -163,7 +164,7 @@ function(app, FauxtonAPI, Components, replication) {
       }
     },
     submit: function(e){
-      this.disableFields(); 
+      this.disableFields();
       var formJSON = {};
       _.map(this.$(e.currentTarget).serializeArray(), function(formData){
         if(formData.value !== ''){
@@ -173,7 +174,7 @@ function(app, FauxtonAPI, Components, replication) {
 
       this.updateButtonText(true);
       this.startReplication(formJSON);
-    },	
+    },
     swapFields: function(e){
       //WALL O' VARIABLES
       var $fromSelect = this.$('#from_name'),
@@ -219,7 +220,7 @@ function(app, FauxtonAPI, Components, replication) {
     },
     beforeRender:  function(){
       this.collection.forEach(function(item) {
-        this.insertView(new View.replicationItem({ 
+        this.insertView(new View.replicationItem({
           model: item
         }));
       }, this);


[29/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Moved the Header styles into the global header styles


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/cf8cf40b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/cf8cf40b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/cf8cf40b

Branch: refs/heads/secondary-indexes
Commit: cf8cf40b4dfd48cc488d6c5d698434d4f183c4d0
Parents: da970d4
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:35 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/assets/less/headers.less | 56 ---------------------
 assets/less/headers.less                      | 57 +++++++++++++++++++++-
 2 files changed, 56 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cf8cf40b/app/addons/documents/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/headers.less b/app/addons/documents/assets/less/headers.less
deleted file mode 100644
index ce5a27d..0000000
--- a/app/addons/documents/assets/less/headers.less
+++ /dev/null
@@ -1,56 +0,0 @@
-.header-right {
-  .add-on {
-    font-size: 16px;
-  }
-  .well {
-    padding: 0;
-    margin: 0;
-  }
-  .searchbox-container {
-    position: relative;
-    right: inherit;
-    input[type="text"] {
-      .border-radius(5px);
-      font-size: 13px;
-      padding: 8px 35px 8px 10px;
-      width: 275px;
-    }
-    .btn-primary {
-      background: none repeat scroll 0% 0% transparent;
-      border: none;
-      position: absolute;
-      right: 12px;
-      top: 8px;
-      z-index: 2;
-      color: #999;
-    }
-  }
-  > .btn {
-    padding: 0;
-    margin: 0;
-  }
-  > .button,
-  > .button a,
-  .api-url-btn > button {
-    color: #666;
-    font-size: 13px;
-    line-height: 3em;
-  }
-  > div {
-    float: right;
-    height: 60px;
-    border-left: 1px solid #ccc;
-    margin: 0;   
-    padding: 10px 15px;
-    line-height: 40px; 
-  }
-  > div:last-child {
-    border-left: none;
-  }
-  .api-url-btn {
-    background: none;
-    border: none;
-    padding: 0;
-    margin: 0;
-  }
-}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/cf8cf40b/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/assets/less/headers.less b/assets/less/headers.less
index e073ad7..0323e3b 100644
--- a/assets/less/headers.less
+++ b/assets/less/headers.less
@@ -124,5 +124,60 @@
 }
 
 
-
+.header-right {
+  .add-on {
+    font-size: 16px;
+  }
+  .well {
+    padding: 0;
+    margin: 0;
+  }
+  .searchbox-container {
+    position: relative;
+    right: inherit;
+    input[type="text"] {
+      .border-radius(5px);
+      font-size: 13px;
+      padding: 8px 35px 8px 10px;
+      width: 275px;
+    }
+    .btn-primary {
+      background: none repeat scroll 0% 0% transparent;
+      border: none;
+      position: absolute;
+      right: 12px;
+      top: 8px;
+      z-index: 2;
+      color: #999;
+    }
+  }
+  > .btn {
+    padding: 0;
+    margin: 0;
+  }
+  > .button,
+  > .button a,
+  .api-url-btn > button {
+    color: #666;
+    font-size: 13px;
+    line-height: 3em;
+  }
+  > div {
+    float: right;
+    height: 60px;
+    border-left: 1px solid #ccc;
+    margin: 0;
+    padding: 10px 15px;
+    line-height: 40px;
+  }
+  > div:last-child {
+    border-left: none;
+  }
+  .api-url-btn {
+    background: none;
+    border: none;
+    padding: 0;
+    margin: 0;
+  }
+}
 


[42/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Pagination footer


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/45f082a1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/45f082a1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/45f082a1

Branch: refs/heads/secondary-indexes
Commit: 45f082a1879909500ec6eac281daa19b88f5cbe9
Parents: f128847
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/assets/less/documents.less |  9 ---
 .../documents/templates/all_docs_list.html      |  6 +-
 .../documents/templates/all_docs_number.html    |  5 +-
 app/addons/documents/views.js                   |  6 +-
 app/addons/fauxton/components.js                |  1 +
 app/addons/fauxton/resizeColumns.js             |  2 +-
 .../fauxton/templates/index_pagination.html     | 14 ++---
 app/addons/indexes/assets/less/doc-item.less    |  2 +-
 app/templates/layouts/one_pane.html             |  1 +
 app/templates/layouts/two_pane.html             |  4 +-
 app/templates/layouts/with_sidebar.html         |  1 +
 app/templates/layouts/with_tabs.html            |  2 +-
 app/templates/layouts/with_tabs_sidebar.html    |  2 +-
 assets/index.underscore                         |  1 -
 assets/less/bootstrap/alerts.less               |  4 +-
 assets/less/bootstrap/pagination.less           | 66 ++++++++++----------
 assets/less/bootstrap/variables.less            | 12 ++--
 assets/less/headers.less                        | 28 +++++++--
 assets/less/pagination.less                     | 32 +++++++++-
 assets/less/templates.less                      | 16 ++++-
 index.html                                      |  2 +-
 21 files changed, 136 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index 26e3ffa..33e7e98 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -33,15 +33,6 @@ button.beautify {
     }
 }
 
-#per-page {
-  float: right;
-
-  #select-per-page {
-    margin-top: 10px;
-  }
-
-}
-
 
 /** used in all_docs_list.html **/
 .view {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/addons/documents/templates/all_docs_list.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_list.html b/app/addons/documents/templates/all_docs_list.html
index 3eaca80..bf7e250 100644
--- a/app/addons/documents/templates/all_docs_list.html
+++ b/app/addons/documents/templates/all_docs_list.html
@@ -24,7 +24,7 @@ the License.
     </div>
   <% } %>
 </div>
-<footer class="pagination-footer" class="window-resizeable">
-<div id="item-numbers"> </div>
-<div id="documents-pagination"></div>
+<footer class="pagination-footer window-resizeable">
+  <div id="item-numbers"> </div>
+  <div id="documents-pagination"></div>
 </footer>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/addons/documents/templates/all_docs_number.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_number.html b/app/addons/documents/templates/all_docs_number.html
index 0461a4b..49d6898 100644
--- a/app/addons/documents/templates/all_docs_number.html
+++ b/app/addons/documents/templates/all_docs_number.html
@@ -12,9 +12,10 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 <% if (totalRows === "unknown" || totalRows === 0){ %>
-Showing 0 documents. <a href="#/database/<%=database%>/new"> Create your first document.</a>
+<p>Showing 0 documents.</p>
 <% } else { %>
-Showing <%=pageStart%> - <%= pageEnd %>
+
+<p>Showing <%=pageStart%> - <%= pageEnd %></p>
 <%}%>
 <% if (updateSeq) { %>
 -- Update Sequence: <%= updateSeq %>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 3cfc229..694ee64 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -240,6 +240,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
         FauxtonAPI.addNotification({
           msg: 'The database <code>' + _.escape(databaseName) + '</code> has been deleted.',
           clear: true,
+          type: "error",
           escape: false // beware of possible XSS when the message changes
         });
       }).fail(function (rsp, error, msg) {
@@ -318,10 +319,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
       if (!window.confirm("Are you sure you want to delete this doc?")) {
         return false;
       }
-
+      var storeID = _.clone(this.model);
       this.model.destroy().then(function(resp) {
         FauxtonAPI.addNotification({
-          msg: "Succesfully deleted your doc",
+          msg: "Doc "+storeID.get('id')+" has been deleted.",
+          type: "error",
           clear:  true
         });
         that.$el.fadeOut(function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index 55f4af4..d225cd9 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -178,6 +178,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
 
   Components.IndexPagination = FauxtonAPI.View.extend({
     className: "pagination pagination-centered",
+    tagName: 'ul',
     template: "addons/fauxton/templates/index_pagination",
     events: {
       "click a": 'scrollTo',

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/addons/fauxton/resizeColumns.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/resizeColumns.js b/app/addons/fauxton/resizeColumns.js
index 98555a9..3fd1883 100644
--- a/app/addons/fauxton/resizeColumns.js
+++ b/app/addons/fauxton/resizeColumns.js
@@ -99,7 +99,7 @@ function(FauxtonAPI) {
 
     setPosition: function(panelWidth){
       var primary = this.getPrimaryNavWidth();
-      $('#right-content').css('left',panelWidth+primary+4);
+      $('.set-left-position').css('left',panelWidth+primary+4);
     },
 
     onResizeHandler: function (){

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/addons/fauxton/templates/index_pagination.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/index_pagination.html b/app/addons/fauxton/templates/index_pagination.html
index 594f6fc..e3b030e 100644
--- a/app/addons/fauxton/templates/index_pagination.html
+++ b/app/addons/fauxton/templates/index_pagination.html
@@ -12,11 +12,11 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 
-<ul>
-  <li <% if (!canShowPreviousfn()) {%> class="disabled" <% } %>>
-     <a id="previous" href="#"> Previous </a>
-   </li>
-   <li <% if (!canShowNextfn()) {%> class="disabled" <% } %>>
-     <a id="next" href="#"> Next </a></li>
-</ul>
+<li <% if (!canShowPreviousfn()) {%> class="disabled" <% } %>>
+ <a id="previous" class="icon fonticon-left-open" href="#"></a>
+</li>
+<li <% if (!canShowNextfn()) {%> class="disabled" <% } %>>
+ <a id="next" class="icon fonticon-right-open" href="#"></a>
+</li>
+
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/addons/indexes/assets/less/doc-item.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/assets/less/doc-item.less b/app/addons/indexes/assets/less/doc-item.less
index a04883a..ea92515 100644
--- a/app/addons/indexes/assets/less/doc-item.less
+++ b/app/addons/indexes/assets/less/doc-item.less
@@ -14,7 +14,7 @@
 }
 
 #doc-list{
-  margin-top: 30px;
+  padding-top: 30px;
   div.doc-row {
     margin-bottom:20px;
     div.select {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/templates/layouts/one_pane.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/one_pane.html b/app/templates/layouts/one_pane.html
index c7adf1f..0bbc989 100644
--- a/app/templates/layouts/one_pane.html
+++ b/app/templates/layouts/one_pane.html
@@ -14,6 +14,7 @@ the License.
 
 <div id="primary-navbar"></div>
 <div id="dashboard" class="container-fluid one-pane">
+  <div id="global-notifications" class="container errors-container window-resizeable"></div>
   <div class="fixed-header">
     <div id="breadcrumbs"></div>
     <div id="api-navbar"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/templates/layouts/two_pane.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/two_pane.html b/app/templates/layouts/two_pane.html
index 0174a5a..053285a 100644
--- a/app/templates/layouts/two_pane.html
+++ b/app/templates/layouts/two_pane.html
@@ -14,7 +14,7 @@ the License.
 
 <div id="primary-navbar"></div>
 <div id="dashboard" class="container-fluid two-pane">
-
+  <div id="global-notifications" class="container errors-container window-resizeable set-left-position"></div>
   <header class="fixed-header row-fluid">
     <div id="breadcrumbs" class="window-resizeable"></div>
     <div id="api-navbar" class="window-resizeable"></div>
@@ -22,6 +22,6 @@ the License.
 
   <div class="content-area two-pane">
     <div id="left-content" class="span6 window-resizeable"></div>
-    <div id="right-content" class="span6 window-resizeable"></div>
+    <div id="right-content" class="span6 window-resizeable set-left-position"></div>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/templates/layouts/with_sidebar.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/with_sidebar.html b/app/templates/layouts/with_sidebar.html
index 7fc64db..2d0f4fa 100644
--- a/app/templates/layouts/with_sidebar.html
+++ b/app/templates/layouts/with_sidebar.html
@@ -15,6 +15,7 @@ the License.
 
 <div id="primary-navbar"></div>
 <div id="dashboard" class="container-fluid with-sidebar">
+  <div id="global-notifications" class="container errors-container window-resizeable"></div>
   <header class="fixed-header row-fluid">
     <div id="breadcrumbs" class="sidebar"></div>
     <div id="api-navbar" class="window-resizeable"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/templates/layouts/with_tabs.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/with_tabs.html b/app/templates/layouts/with_tabs.html
index 074385f..2d03d19 100644
--- a/app/templates/layouts/with_tabs.html
+++ b/app/templates/layouts/with_tabs.html
@@ -14,7 +14,7 @@ the License.
 
 <div id="primary-navbar"></div>
 <div id="dashboard" class="container-fluid">
-
+  <div id="global-notifications" class="container errors-container window-resizeable"></div>
   <header class="fixed-header row-fluid">
     <div id="breadcrumbs" class="sidebar"></div>
     <div id="api-navbar" class="window-resizeable"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/app/templates/layouts/with_tabs_sidebar.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/with_tabs_sidebar.html b/app/templates/layouts/with_tabs_sidebar.html
index de4bdee..0a7c661 100644
--- a/app/templates/layouts/with_tabs_sidebar.html
+++ b/app/templates/layouts/with_tabs_sidebar.html
@@ -14,7 +14,7 @@ the License.
 
 <div id="primary-navbar"></div>
 <div id="dashboard" class="container-fluid with-sidebar">
-
+  <div id="global-notifications" class="container errors-container window-resizeable"></div>
   <header class="fixed-header row-fluid">
     <div id="breadcrumbs" class="sidebar"></div>
     <div id="api-navbar" class="window-resizeable"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/assets/index.underscore
----------------------------------------------------------------------
diff --git a/assets/index.underscore b/assets/index.underscore
index 6a887b5..94befb9 100644
--- a/assets/index.underscore
+++ b/assets/index.underscore
@@ -33,7 +33,6 @@
 <body id="home">
   <!-- Main container. -->
   <div role="main" id="main">
-    <div id="global-notifications" class="container errors-container"></div>
     <div id="app-container"></div>
   </div>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/assets/less/bootstrap/alerts.less
----------------------------------------------------------------------
diff --git a/assets/less/bootstrap/alerts.less b/assets/less/bootstrap/alerts.less
index 0116b19..281b88f 100644
--- a/assets/less/bootstrap/alerts.less
+++ b/assets/less/bootstrap/alerts.less
@@ -8,11 +8,9 @@
 
 .alert {
   padding: 8px 35px 8px 14px;
-  margin-bottom: @baseLineHeight;
-  text-shadow: 0 1px 0 rgba(255,255,255,.5);
+  min-height: 60px;
   background-color: @warningBackground;
   border: 1px solid @warningBorder;
-  .border-radius(@baseBorderRadius);
 }
 .alert,
 .alert h4 {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/assets/less/bootstrap/pagination.less
----------------------------------------------------------------------
diff --git a/assets/less/bootstrap/pagination.less b/assets/less/bootstrap/pagination.less
index a789db2..c1f6a26 100644
--- a/assets/less/bootstrap/pagination.less
+++ b/assets/less/bootstrap/pagination.less
@@ -7,22 +7,22 @@
   margin: @baseLineHeight 0;
 }
 
-.pagination ul {
+ul.pagination {
   // Allow for text-based alignment
   display: inline-block;
   .ie7-inline-block();
-  // Reset default ul styles
+  // Reset default styles
   margin-left: 0;
   margin-bottom: 0;
   // Visuals
   .border-radius(@baseBorderRadius);
   .box-shadow(0 1px 2px rgba(0,0,0,.05));
 }
-.pagination ul > li {
+ul.pagination > li {
   display: inline; // Remove list-style and block-level defaults
 }
-.pagination ul > li > a,
-.pagination ul > li > span {
+ul.pagination > li > a,
+ul.pagination > li > span {
   float: left; // Collapse white-space
   padding: 4px 12px;
   line-height: @baseLineHeight;
@@ -31,32 +31,32 @@
   border: 1px solid @paginationBorder;
   border-left-width: 0;
 }
-.pagination ul > li > a:hover,
-.pagination ul > li > a:focus,
-.pagination ul > .active > a,
-.pagination ul > .active > span {
+ul.pagination > li > a:hover,
+ul.pagination > li > a:focus,
+ul.pagination > .active > a,
+ul.pagination > .active > span {
   background-color: @paginationActiveBackground;
 }
-.pagination ul > .active > a,
-.pagination ul > .active > span {
+ul.pagination > .active > a,
+ul.pagination > .active > span {
   color: @grayLight;
   cursor: default;
 }
-.pagination ul > .disabled > span,
-.pagination ul > .disabled > a,
-.pagination ul > .disabled > a:hover,
-.pagination ul > .disabled > a:focus {
+ul.pagination > .disabled > span,
+ul.pagination > .disabled > a,
+ul.pagination > .disabled > a:hover,
+ul.pagination > .disabled > a:focus {
   color: @grayLight;
   background-color: transparent;
   cursor: default;
 }
-.pagination ul > li:first-child > a,
-.pagination ul > li:first-child > span {
+ul.pagination > li:first-child > a,
+ul.pagination > li:first-child > span {
   border-left-width: 1px;
   .border-left-radius(@baseBorderRadius);
 }
-.pagination ul > li:last-child > a,
-.pagination ul > li:last-child > span {
+ul.pagination > li:last-child > a,
+ul.pagination > li:last-child > span {
   .border-right-radius(@baseBorderRadius);
 }
 
@@ -77,17 +77,17 @@
 
 // Large
 .pagination-large {
-  ul > li > a,
-  ul > li > span {
+  > li > a,
+  > li > span {
     padding: @paddingLarge;
     font-size: @fontSizeLarge;
   }
-  ul > li:first-child > a,
-  ul > li:first-child > span {
+  > li:first-child > a,
+  > li:first-child > span {
     .border-left-radius(@borderRadiusLarge);
   }
-  ul > li:last-child > a,
-  ul > li:last-child > span {
+  > li:last-child > a,
+  > li:last-child > span {
     .border-right-radius(@borderRadiusLarge);
   }
 }
@@ -95,28 +95,28 @@
 // Small and mini
 .pagination-mini,
 .pagination-small {
-  ul > li:first-child > a,
-  ul > li:first-child > span {
+  > li:first-child > a,
+  > li:first-child > span {
     .border-left-radius(@borderRadiusSmall);
   }
-  ul > li:last-child > a,
-  ul > li:last-child > span {
+  > li:last-child > a,
+  > li:last-child > span {
     .border-right-radius(@borderRadiusSmall);
   }
 }
 
 // Small
 .pagination-small {
-  ul > li > a,
-  ul > li > span {
+  > li > a,
+  > li > span {
     padding: @paddingSmall;
     font-size: @fontSizeSmall;
   }
 }
 // Mini
 .pagination-mini {
-  ul > li > a,
-  ul > li > span {
+  > li > a,
+  > li > span {
     padding: @paddingMini;
     font-size: @fontSizeMini;
   }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/assets/less/bootstrap/variables.less
----------------------------------------------------------------------
diff --git a/assets/less/bootstrap/variables.less b/assets/less/bootstrap/variables.less
index f52b2cb..eee77a0 100644
--- a/assets/less/bootstrap/variables.less
+++ b/assets/less/bootstrap/variables.less
@@ -234,16 +234,16 @@
 @warningBackground:       #fcf8e3;
 @warningBorder:           darken(spin(@warningBackground, -10), 3%);
 
-@errorText:               #b94a48;
-@errorBackground:         #f2dede;
+@errorText:               #fff;
+@errorBackground:         #C55C56;
 @errorBorder:             darken(spin(@errorBackground, -10), 3%);
 
-@successText:             #468847;
-@successBackground:       #dff0d8;
+@successText:             #CBDFBD;
+@successBackground:       #448C11;
 @successBorder:           darken(spin(@successBackground, -10), 5%);
 
-@infoText:                #3a87ad;
-@infoBackground:          #d9edf7;
+@infoText:                #fff;
+@infoBackground:          #339999;
 @infoBorder:              darken(spin(@infoBackground, -10), 7%);
 
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/assets/less/headers.less b/assets/less/headers.less
index 0323e3b..149e90b 100644
--- a/assets/less/headers.less
+++ b/assets/less/headers.less
@@ -10,6 +10,18 @@
  *  License for the specific language governing permissions and limitations under
  *  the License.
  */
+
+.left-shadow-border{
+  border-left: 1px solid #999;
+  .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));
+}
+
+.bottom-shadow-border{
+  border-bottom: 1px solid #999;
+  .box-shadow(0px 6px 0 0 rgba(0, 0, 0, 0.1));
+}
+
+
 .fixed-header{
   height: 60px;
   background-color: @breadcrumbBG;
@@ -71,6 +83,11 @@
     > div{
       display:inline-block;
     }
+    .breadcrumb {
+      li:first-child{
+        border-right: 1px solid #ccc;
+      }
+    }
   }
   .breadcrumb {
     margin-bottom: 0;
@@ -86,7 +103,6 @@
         .two-pane & {
           padding:20px 10px;
           font-size: 19px;
-          border-right: 1px solid #ccc;
         }
       }
       color: @breadcrumbText;
@@ -109,16 +125,20 @@
     position: absolute;
     right: 0;
     top: 0;
+    .dropdown-toggle {
+      color: #666666;
+    }
     a {
+      padding: 10px 20px;
       text-decoration: none;
     }
     .dropdown {
       border-left: 1px solid #ccc;
-      padding: 20px;
+      padding: 20px 0px;
     }
     .dropdown-menu {
-      left: -105px;
-      top: 56px;
+      left: -109px;
+      top: 48px;
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/assets/less/pagination.less
----------------------------------------------------------------------
diff --git a/assets/less/pagination.less b/assets/less/pagination.less
index 0137699..df0740a 100644
--- a/assets/less/pagination.less
+++ b/assets/less/pagination.less
@@ -14,8 +14,38 @@ footer.pagination-footer {
   position:fixed;
   background-color:#fff;
   bottom:0;
+  height: 50px;
   border-top:1px solid #ccc;
   .pagination{
-    margin: 15px 0 10px;
+    .box-shadow(none);
+    position: absolute;
+    right:0;
+    top: 0;
+    margin:0px;
+    height: 50px;
+    border-left: 1px solid #ccc;
+    li {
+      display: inline-block;
+      a {
+        padding: 15px 10px 15px 15px;
+        border: none;
+      }
+    }
+  }
+}
+
+#item-numbers{
+  p {
+    margin: 20px;
+    font-size: 14px;
+  }
+}
+
+div#per-page {
+  position: absolute;
+  right: 86px;
+  top: 2px;
+  #select-per-page {
+    margin-top: 10px;
   }
 }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/assets/less/templates.less
----------------------------------------------------------------------
diff --git a/assets/less/templates.less b/assets/less/templates.less
index 062cd32..3ab7d19 100644
--- a/assets/less/templates.less
+++ b/assets/less/templates.less
@@ -335,13 +335,17 @@
   }
 }
 
+#right-content,
 #dashboard-lower-content{
-  background-color: #F1F1F1;
   .view {
-    padding: 20px;
+    background-color:#A8A1A1;
   }
 }
 
+#dashboard-lower-content .view{
+  padding: 20px;
+}
+
 #dashboard-upper-content{
   .tab-content {
     padding-top: 70px;
@@ -382,6 +386,14 @@
   }
 }
 
+#global-notifications{
+  .with-sidebar & {
+    left: @sidebarWidth+@navWidth;
+    .closeMenu & {
+      left: @sidebarWidth+@collapsedNavWidth;
+    }
+  }
+}
 /*
   Sidenav:
   USED IN DOCUMENT ADDON & EXTERNAL ADDONS

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/45f082a1/index.html
----------------------------------------------------------------------
diff --git a/index.html b/index.html
index 892f499..844e9c9 100644
--- a/index.html
+++ b/index.html
@@ -36,7 +36,7 @@
 <body id="home">
   <!-- Main container. -->
   <div role="main" id="main">
-    <div id="global-notifications" class="container errors-container"></div>
+    <div id="global-notifications" class="container errors-container window-resizeable"></div>
     <div id="app-container"></div>
     <hr>
 


[40/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
fix api bar help icon
style api bar button on fixed header
refactor css for header trays
use Events to close trays
Fix for the header on view save


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/f5fd76db
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/f5fd76db
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/f5fd76db

Branch: refs/heads/secondary-indexes
Commit: f5fd76db072d5f6b6bba7a2249cd93f17a2dc033
Parents: 18839b8
Author: Jenn Schiffer <je...@pancaketheorem.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 .../documents/assets/less/advancedOptions.less  | 35 ++-------
 .../documents/templates/advanced_options.html   |  2 +-
 app/addons/documents/views-advancedopts.js      | 15 ++--
 app/addons/fauxton/components.js                | 13 +++-
 app/addons/fauxton/templates/api_bar.html       |  4 +-
 app/addons/indexes/routes-core.js               | 20 +++++-
 app/addons/indexes/routes-viewindexes.js        | 13 +---
 assets/less/fauxton.less                        | 37 ++--------
 assets/less/headers.less                        | 76 ++++++++++++++------
 9 files changed, 112 insertions(+), 103 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f5fd76db/app/addons/documents/assets/less/advancedOptions.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/advancedOptions.less b/app/addons/documents/assets/less/advancedOptions.less
index 6febf3b..16ddb2b 100644
--- a/app/addons/documents/assets/less/advancedOptions.less
+++ b/app/addons/documents/assets/less/advancedOptions.less
@@ -13,27 +13,17 @@
 
 /*for advanced options css*/
 .advanced-options.well {
-  display: inline-block;
-  background: none;
-  border: none;
   box-shadow: none;
+  border: none;
+  background: none;
+}
+
+#query-options-tray:before {
+  right: 140px;
 }
+
 #query-options-tray {
-  display: none;
-  .border-radius(5px);
   width: 490px;
-  position: absolute;
-  right: 5px;
-  z-index: 11;
-  background-color: #333;
-  color: #fff;
-  padding: 0;
-  margin: 0;
-  .add-on {
-    padding: 0;
-    margin: 0;
-    line-height: 1em;
-  }
   .query-group {
     padding: 20px;
     border-bottom: 1px solid #555;
@@ -126,15 +116,4 @@
   #skipRows {
     margin-left: 5px;
   }
-}
-#query-options-tray:before {
-  content: '';
-  position: absolute;
-  top: -25px;
-  right: 140px;
-  border-color: transparent transparent #333 transparent;
-  border-style: solid;
-  border-width: 15px;
-  width: 0;
-  height: 0;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f5fd76db/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/advanced_options.html b/app/addons/documents/templates/advanced_options.html
index 5e0e77f..95bbe5c 100644
--- a/app/addons/documents/templates/advanced_options.html
+++ b/app/addons/documents/templates/advanced_options.html
@@ -16,7 +16,7 @@ the License.
   Query Options
 </a>
 
-<div id="query-options-tray">
+<div id="query-options-tray" class="tray">
   <form class="js-view-query-update custom-inputs">
 
     <div class="query-group">

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f5fd76db/app/addons/documents/views-advancedopts.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-advancedopts.js b/app/addons/documents/views-advancedopts.js
index 0a91914..993750f 100644
--- a/app/addons/documents/views-advancedopts.js
+++ b/app/addons/documents/views-advancedopts.js
@@ -26,6 +26,7 @@ function(app, FauxtonAPI, resizeColumns ) {
     className: "advanced-options well",
 
     initialize: function (options) {
+      FauxtonAPI.Events.on('AdvancedOptions:closeTray', this.closeTray);
       this.database = options.database;
       this.ddocName = options.ddocName;
       this.viewName = options.viewName;
@@ -64,18 +65,22 @@ function(app, FauxtonAPI, resizeColumns ) {
     toggleQuery: function(event) {
       $('#dashboard-content').scrollTop(0);
       this.$('#query-options-tray').toggle();
-      $('.api-navbar').hide();
+      FauxtonAPI.Events.trigger('APIbar:closeTray');
     }, 
 
+    closeTray: function(){
+      $('#query-options-tray').hide();
+    },
+
     resetForm: function() {
-      $('input, textarea').each(function(){
+      this.$('input, textarea').each(function(){
         $(this).val('');
       });
-      $('input:checkbox').attr('checked', false);
-      $("select").each(function(){
+      this.$('input:checkbox').attr('checked', false);
+      this.$("select").each(function(){
         this.selectedIndex = 0;
       });
-      $('#query-options-tray').hide();
+      this.$('#query-options-tray').hide();
     },
 
     showKeys: function(){

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f5fd76db/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index 3784b8d..e8bd559 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -97,6 +97,7 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
     },
 
     initialize: function(options){
+      FauxtonAPI.Events.on('APIbar:closeTray', this.closeTray);
       var _options = options || {};
       this.endpoint = _options.endpoint || '_all_docs';
       this.documentation = _options.documentation || 'docs';
@@ -109,8 +110,8 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
       }else{
         $currentTarget.removeClass("fonticon-minus").addClass("fonticon-plus");
       }
-      $('#query-options-tray').hide();
-      $('.api-navbar').toggle();
+      FauxtonAPI.Events.trigger('AdvancedOptions:closeTray');
+      this.$('.api-navbar').toggle();
     },
 
     serialize: function() {
@@ -123,15 +124,22 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
     hide: function(){
       this.$el.addClass('hide');
     },
+
     show: function(){
       this.$el.removeClass('hide');
     },
+
+    closeTray: function(){
+      $('.api-navbar').hide();
+    },
+
     update: function(endpoint) {
       this.show();
       this.endpoint = endpoint[0];
       this.documentation = endpoint[1];
       this.render();
     },
+
     afterRender: function(){
       ZeroClipboard.config({ moviePath: "/assets/js/plugins/zeroclipboard/ZeroClipboard.swf" });
       var client = new ZeroClipboard(this.$(".copy-url"));
@@ -147,7 +155,6 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
         });
       });
     }
-
   });
 
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f5fd76db/app/addons/fauxton/templates/api_bar.html
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/templates/api_bar.html b/app/addons/fauxton/templates/api_bar.html
index 255087d..9db0d7b 100644
--- a/app/addons/fauxton/templates/api_bar.html
+++ b/app/addons/fauxton/templates/api_bar.html
@@ -17,12 +17,12 @@ the License.
   API URL
 </a>
 <div class="clearfix"></div>
-<div class="api-navbar" style="display: none">
+<div class="api-navbar tray">
     <div class="input-prepend input-append">
       <span class="add-on">
         API URL
         <a class="help-link" data-bypass="true" href="<%-getDocUrl(documentation)%>" target="_blank">
-          <i class="fonticon-link"></i>
+          <i class="icon-question-sign"></i>
         </a>
       </span>
       <input id="api-url-text" type="text" class="input-xxlarge" value="<%- endpoint %>">

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f5fd76db/app/addons/indexes/routes-core.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-core.js b/app/addons/indexes/routes-core.js
index 65f33bc..402ae99 100644
--- a/app/addons/indexes/routes-core.js
+++ b/app/addons/indexes/routes-core.js
@@ -24,6 +24,11 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
     layout: "two_pane",
 
     initialize: function (route, masterLayout, options) {
+      _.bindAll(this);
+      var params = this.createParams(),
+      urlParams = params.urlParams,
+      docParams = params.docParams;
+
       this.databaseName = options[0];
 
       this.data = {
@@ -42,6 +47,19 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
           limit: 500
         }
       });
+
+
+      /* --------------------------------------------------
+        Set up right header
+      ----------------------------------------------------*/
+
+      this.rightHeader = this.setView("#api-navbar", new Views.RightHeader({
+        database: this.data.database,
+        model: this.data.database,
+        endpoint: this.data.designDocs.urlRef("apiurl", urlParams),
+        documentation: "docs"
+      }));
+
     },
 
     events: {
@@ -162,8 +180,6 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
       this.documentsView.setParams(docParams, urlParams);
 
       this.documentsView.forceRender();
-
-      this.rightHeader.updateApiUrl([collection.urlRef("apiurl", urlParams), "docs"]);
     },
 
     /* --------------------------------------------------

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f5fd76db/app/addons/indexes/routes-viewindexes.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-viewindexes.js b/app/addons/indexes/routes-viewindexes.js
index f3bb65b..546d72c 100644
--- a/app/addons/indexes/routes-viewindexes.js
+++ b/app/addons/indexes/routes-viewindexes.js
@@ -37,7 +37,7 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore, Co
       /* --------------------------------------------------
         remove right header
       ----------------------------------------------------*/
-      this.rightheader && this.rightheader.remove();
+      this.rightHeader && this.rightHeader.remove();
 
       /* --------------------------------------------------
         Insert Preview Screen View
@@ -116,17 +116,6 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore, Co
 
 
       /* --------------------------------------------------
-        Set up right header
-      ----------------------------------------------------*/
-
-      this.rightheader = this.setView("#api-navbar", new Views.RightHeader({
-        database: this.data.database,
-        model: this.data.database,
-        endpoint: this.data.indexedDocs.urlRef("apiurl", urlParams),
-        documentation: "docs"
-      }));
-
-      /* --------------------------------------------------
         Insert View Editor
       ----------------------------------------------------*/
       this.viewEditor = this.setView("#left-content", new Views.ViewEditor({

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f5fd76db/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index e8a9fdb..74c698a 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -249,37 +249,25 @@ div.spinner {
 }
 
 .api-url-btn {
-  margin-top: 5px;
-  margin-bottom: 5px;
   .icon {
     font-size: 11px;
   }
+  background: none;
+  border: none;
+  padding: 0;
+  margin: 0;
+}
+.api-url-btn:hover {
+  background: none;
 }
-
 .api-navbar {
-  .border-radius(5px);
-  position: absolute;
-  right: 5px;
-  background-color: #333;
   padding: 5px 20px;
-  z-index: 2;
   .input-append.input-prepend {
     margin-bottom: 0px;
     .copying {
       background-color: #999;
       transition: background-color 5ms linear;
     }
-    .add-on {
-      background: none;
-      padding: 0px;
-      margin: 10px 0;
-      border: none;
-      display: block;
-      text-align: left;
-      color: #fff;
-      text-shadow: none;
-      height: auto;
-    }
     .input-xxlarge {
       .border-radius(5px 0 0 5px);
       border: none;
@@ -315,17 +303,6 @@ div.spinner {
     }
   }
 }
-.api-navbar:before {
-  content: '';
-  position: absolute;
-  top: -25px;
-  right: 30px;
-  border-color: transparent transparent #333 transparent;
-  border-style: solid;
-  border-width: 15px;
-  width: 0;
-  height: 0;
-}
 
 .js-filter-form {
   .help-block {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f5fd76db/assets/less/headers.less
----------------------------------------------------------------------
diff --git a/assets/less/headers.less b/assets/less/headers.less
index 149e90b..a110714 100644
--- a/assets/less/headers.less
+++ b/assets/less/headers.less
@@ -21,7 +21,6 @@
   .box-shadow(0px 6px 0 0 rgba(0, 0, 0, 0.1));
 }
 
-
 .fixed-header{
   height: 60px;
   background-color: @breadcrumbBG;
@@ -119,6 +118,10 @@
   }
 }
 
+.fixed-header {
+
+}
+
 .header-left{
   position: relative;
   #header-dropdown-menu {
@@ -143,11 +146,58 @@
   }
 }
 
+.tray {
+  display: none;
+  .border-radius(5px);
+  position: absolute;
+  right: 5px;
+  top: 55px;
+  z-index: 11;
+  background-color: #333;
+  color: #fff;
+  margin: 0;
+   .add-on {
+    font-size: 16px;
+    background: none;
+    padding: 0px;
+    margin: 10px 0;
+    border: none;
+    display: block;
+    text-align: left;
+    color: #fff;
+    text-shadow: none;
+    height: auto;
+    line-height: 1em;
+  }
+}
+.tray:before {
+  content: '';
+  position: absolute;
+  top: -25px;
+  border-color: transparent transparent #333 transparent;
+  border-style: solid;
+  border-width: 15px;
+  width: 0;
+  height: 0;
+}
 
+.fixed-header,
 .header-right {
-  .add-on {
-    font-size: 16px;
+  > .btn {
+    padding: 0;
+    margin: 0;
+  }
+  > .button,
+  > .button a,
+  .api-url-btn > button,
+  .btn-primary {
+    color: #666;
+    font-size: 13px;
+    line-height: 3em;
   }
+}
+
+.header-right {
   .well {
     padding: 0;
     margin: 0;
@@ -171,17 +221,6 @@
       color: #999;
     }
   }
-  > .btn {
-    padding: 0;
-    margin: 0;
-  }
-  > .button,
-  > .button a,
-  .api-url-btn > button {
-    color: #666;
-    font-size: 13px;
-    line-height: 3em;
-  }
   > div {
     float: right;
     height: 60px;
@@ -193,11 +232,8 @@
   > div:last-child {
     border-left: none;
   }
-  .api-url-btn {
-    background: none;
-    border: none;
-    padding: 0;
-    margin: 0;
-  }
+}
+.api-navbar:before {
+  right: 25px;
 }
 


[39/48] fauxton commit: updated refs/heads/secondary-indexes to 8688d16

Posted by de...@apache.org.
Change the all docs select header to be it's own view


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/18839b89
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/18839b89
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/18839b89

Branch: refs/heads/secondary-indexes
Commit: 18839b897c6c38a6bfdb6772ebb14f0a7afaf406
Parents: 3f9f381
Author: deathbearbrown <de...@gmail.com>
Authored: Sun Aug 24 16:33:43 2014 +0200
Committer: deathbearbrown <de...@gmail.com>
Committed: Mon Aug 25 09:37:36 2014 -0400

----------------------------------------------------------------------
 app/addons/documents/routes.js                  | 25 ++++++++---
 .../documents/templates/header_alldocs.html     |  2 -
 .../documents/templates/select-doc-menu.html    | 25 ++++++-----
 app/addons/documents/views.js                   | 44 ++++++--------------
 4 files changed, 47 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/18839b89/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index 7f71bb9..46fbc51 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -158,7 +158,8 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
       "route:paginate": "paginate",
       "route:perPageChange": "perPageChange",
       "route:changesFilterAdd": "addFilter",
-      "route:changesFilterRemove": "removeFilter"
+      "route:changesFilterRemove": "removeFilter",
+      "route:toggleSelectHeader": "toggleSelectheader"
     },
 
     initialize: function (route, masterLayout, options) {
@@ -202,7 +203,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
         Show right header for all docs that includes:
         query options, api bar, search and select
       ----------------------------------------------------*/
-      this.changesHeader = true;
+      this.allDocsHeader = false;
       this.resetAllDocsHeader();
 
       /* --------------------------------------------------
@@ -263,12 +264,26 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
 
     },
 
+    toggleSelectheader: function(){
+      /* --------------------------------------------------
+        Set up right header for the document select menu
+        or reset back to all docs header
+      ----------------------------------------------------*/
+      if (this.allDocsHeader){
+        this.allDocsHeader = false;
+        this.rightHeader = this.setView("#api-navbar", new Documents.Views.SelectMenuHeader({}));
+        this.rightHeader.forceRender();
+      } else {
+        this.resetAllDocsHeader();
+      }
+
+    },
     resetAllDocsHeader: function(){
-      if (this.changesHeader){
+      if (!this.allDocsHeader){
         this.rightHeader = this.setView("#api-navbar", new Documents.Views.RightAllDocsHeader({
           database: this.data.database
         }));
-        this.changesHeader = false;
+        this.allDocsHeader = true;
       }
     },
 
@@ -502,7 +517,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
         documentation: this.data.database.documentation()
       }));
 
-      this.changesHeader = true;
+      this.allDocsHeader = true;
 
       /* --------------------------------------------------
         Set sidebar highlight

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/18839b89/app/addons/documents/templates/header_alldocs.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html
index 36d62f8..ff6d8a8 100644
--- a/app/addons/documents/templates/header_alldocs.html
+++ b/app/addons/documents/templates/header_alldocs.html
@@ -26,8 +26,6 @@ the License.
   <div id="header-search" class="js-search searchbox-container"></div>
 
   <!-- Select toggle -->
-  <div id="header-select-menu"></div>
-
   <div id="header-select-all" class="button">
     <span class="toggle-select-menu icon fonticon-ok-circled">Select</span>
   </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/18839b89/app/addons/documents/templates/select-doc-menu.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/select-doc-menu.html b/app/addons/documents/templates/select-doc-menu.html
index bad70a7..a00c851 100644
--- a/app/addons/documents/templates/select-doc-menu.html
+++ b/app/addons/documents/templates/select-doc-menu.html
@@ -11,14 +11,19 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 -->
-<div class="row">
-  <div class="btn-toolbar span6">
-    <button type="button" class="btn btn-small all" data-toggle="button">✓ All</button>
-    <button class="btn btn-small disabled js-bulk-delete"><i class="icon-trash"></i></button>
-    <% if (expandDocs) { %>
-    <button id="collapse" class="btn btn-small"><i class="icon-minus"></i> Collapse</button>
-    <% } else { %>
-    <button id="collapse" class="btn btn-small"><i class="icon-plus"></i> Expand</button>
-    <% } %>
-  </div>
+
+<!-- Select toggle -->
+<div id="header-select-all active" class="button">
+  <span class="toggle-select-menu icon fonticon-ok-circled">Select</span>
 </div>
+
+<button type="button" class="button btn btn-small all" data-toggle="button">✓ All</button>
+
+<button class="button btn btn-small disabled js-bulk-delete"><i class="icon-trash"></i></button>
+
+<% if (expandDocs) { %>
+<button id="collapse" class="button btn btn-small"><i class="icon-minus"></i> Collapse</button>
+<% } else { %>
+<button id="collapse" class="button btn btn-small"><i class="icon-plus"></i> Expand</button>
+<% } %>
+

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/18839b89/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index cf17559..b292663 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -56,36 +56,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
     },
 
     selectAllMenu: function(e){
-      //trigger event to select all in other view
-      this.$('.toggle-select-menu').toggleClass('active');
-
-      //trigger event to change the header
-      this.toggleSelectMenu();
+      FauxtonAPI.triggerRouteEvent("toggleSelectHeader");
       FauxtonAPI.Events.trigger("documents:show-select-all",this.selectVisible);
-
-    },
-
-    toggleSelectMenu: function(){
-      if (this.selectVisible){
-        this.selectVisible = false;
-        this.selectMenu.remove();
-        this.addAllDocsMenu();
-      } else {
-        this.removeAllDocsMenu();
-        this.addSelectMenu();
-      }
-    },
-
-    addSelectMenu: function(){
-      this.selectVisible = true;
-      this.selectMenu =  this.insertView('#header-select-menu', new Views.SelectMenu({}));
-      this.selectMenu.render();
-    },
-
-    removeAllDocsMenu: function(){
-      this.headerSearch.remove();
-      this.queryOptions.remove();
-      this.apiBar.remove();
     },
 
     addAllDocsMenu: function(){
@@ -188,13 +160,21 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
   });
 
   // select docs header
-  Views.SelectMenu = FauxtonAPI.View.extend({
+  Views.SelectMenuHeader = FauxtonAPI.View.extend({
+    className: "header-right",
     template:"addons/documents/templates/select-doc-menu",
     events: {
       "click button.all": "selectAll",
       "click button.js-bulk-delete": "bulkDelete",
-      "click #collapse": "collapse"
+      "click #collapse": "collapse",
+      'click .toggle-select-menu': 'selectAllMenu'
+    },
+
+    selectAllMenu: function(e){
+      FauxtonAPI.triggerRouteEvent("toggleSelectHeader");
+      FauxtonAPI.Events.trigger("documents:show-select-all",this.selectVisible);
     },
+
     bulkDelete: function(){
       FauxtonAPI.Events.trigger("documents:bulkDelete");
     },
@@ -258,7 +238,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
   Views.Document = FauxtonAPI.View.extend({
     template: "addons/documents/templates/all_docs_item",
     className: function(){
-      return (this.showSelect? "showSelect":"") + " all-docs-item doc-row"
+      return (this.showSelect? "showSelect":"") + " all-docs-item doc-row";
     },
     initialize: function (options) {
       this.checked = options.checked;