You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2013/09/09 11:53:21 UTC

[01/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Updated Branches:
  refs/heads/1867-feature-plugins 0ba9c5a8e -> 8aad4507f


Fauxton: Move logout to footer bar


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

Branch: refs/heads/1867-feature-plugins
Commit: 17a58fb580f32702fc53eb580ef9c33c3372cea7
Parents: 2560aea
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Aug 13 14:23:14 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:41 2013 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js                        |   6 +-
 src/fauxton/app/addons/auth/base.js             |  10 ++
 src/fauxton/app/addons/auth/resources.js        |  15 ++-
 .../app/addons/auth/templates/nav_dropdown.html |   1 -
 src/fauxton/app/api.js                          |   4 +
 src/fauxton/app/modules/fauxton/base.js         |  35 +++++-
 src/fauxton/app/templates/fauxton/nav_bar.html  |  10 ++
 src/fauxton/test/core/navbarSpec.js             | 107 +++++++++++++++++++
 8 files changed, 177 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/17a58fb5/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 9cb7e2e..e9cb13c 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -214,9 +214,9 @@ module.exports = function(grunt) {
       port: 8000,
       proxy: {
         target: {
-          host: 'localhost',
-          port: 5984,
-          https: false
+          host: 'garrensmith.cloudant.com',
+          port: 443,
+          https: true
         },
         // This sets the Host header in the proxy so that you can use external
         // CouchDB instances and not have the Host set to 'localhost'

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17a58fb5/src/fauxton/app/addons/auth/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/base.js b/src/fauxton/app/addons/auth/base.js
index 78f95e0..3502edd 100644
--- a/src/fauxton/app/addons/auth/base.js
+++ b/src/fauxton/app/addons/auth/base.js
@@ -32,6 +32,7 @@ function(app, FauxtonAPI, Auth) {
       bottomNav: true,
       establish: [FauxtonAPI.session.fetchUser()]
     });
+      
 
     var auth = function (session, roles) {
       var deferred = $.Deferred();
@@ -54,7 +55,16 @@ function(app, FauxtonAPI, Auth) {
 
     FauxtonAPI.auth.registerAuth(auth);
     FauxtonAPI.auth.registerAuthDenied(authDenied);
+
+    FauxtonAPI.session.on('change', function () {
+      if (FauxtonAPI.session.isLoggedIn()) {
+        FauxtonAPI.addHeaderLink({footerNav: true, href:"#logout", title:"Logout", icon: "", className: 'logout'});
+      } else {
+        FauxtonAPI.removeHeaderLink({title: "Logout", footerNav: true});
+      }
+    });
   };
 
+
   return Auth;
 });

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17a58fb5/src/fauxton/app/addons/auth/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/resources.js b/src/fauxton/app/addons/auth/resources.js
index da3acb2..dd900c5 100644
--- a/src/fauxton/app/addons/auth/resources.js
+++ b/src/fauxton/app/addons/auth/resources.js
@@ -72,6 +72,16 @@ function (app, FauxtonAPI) {
       return false;
     },
 
+    isLoggedIn: function () {
+      var userCtx = this.get('userCtx');
+
+      if (userCtx.name) {
+        return true;
+      }
+
+      return false;
+    },
+
     userRoles: function () {
       var user = this.user();
 
@@ -237,7 +247,7 @@ function (app, FauxtonAPI) {
       "submit #login": "login"
     },
 
-    login: function () {
+    login: function (event) {
       event.preventDefault();
 
       var that = this,
@@ -251,7 +261,7 @@ function (app, FauxtonAPI) {
       });
 
       promise.fail(function (xhr, type, msg) {
-        if (arguments.length === 3 && msg === 'Unauthorized') {
+        if (arguments.length === 3) {
           msg = FauxtonAPI.session.messages.incorrectCredentials;
         } else {
           msg = xhr;
@@ -349,6 +359,5 @@ function (app, FauxtonAPI) {
     template: "addons/auth/templates/noAccess"
   });
 
-
   return Auth;
 });

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17a58fb5/src/fauxton/app/addons/auth/templates/nav_dropdown.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/templates/nav_dropdown.html b/src/fauxton/app/addons/auth/templates/nav_dropdown.html
index 880a7c1..d61c24a 100644
--- a/src/fauxton/app/addons/auth/templates/nav_dropdown.html
+++ b/src/fauxton/app/addons/auth/templates/nav_dropdown.html
@@ -20,7 +20,6 @@ the License.
 <ul class="nav nav-list">
   <li class="active" ><a data-select="change-password" id="user-change-password" href="#changePassword"> Change Password </a></li>
   <li ><a data-select="add-admin" href="#addAdmin"> Create Admins </a></li>
-  <li ><a data-select"user-logout" href="#logout"> Logout </a> </li> 
 </ul>
 </nav>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17a58fb5/src/fauxton/app/api.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/api.js b/src/fauxton/app/api.js
index 5e8e424..0a2351d 100644
--- a/src/fauxton/app/api.js
+++ b/src/fauxton/app/api.js
@@ -65,6 +65,10 @@ function(app, Fauxton) {
     app.masterLayout.navBar.addLink(link);
   };
 
+  FauxtonAPI.removeHeaderLink = function(link) {
+    app.masterLayout.navBar.removeLink(link);
+  };
+
   FauxtonAPI.Deferred = function() {
     return $.Deferred();
   };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17a58fb5/src/fauxton/app/modules/fauxton/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/fauxton/base.js b/src/fauxton/app/modules/fauxton/base.js
index ea5f3ec..2715ab2 100644
--- a/src/fauxton/app/modules/fauxton/base.js
+++ b/src/fauxton/app/modules/fauxton/base.js
@@ -77,23 +77,28 @@ function(app, Backbone, resizeColumns) {
     ],
 
     bottomNavLinks: [],
-
-    initialize: function() {
-    },
+    footerNavLinks: [],
 
     serialize: function() {
-      return {navLinks: this.navLinks, bottomNavLinks: this.bottomNavLinks};
+      return {
+        navLinks: this.navLinks,
+        bottomNavLinks: this.bottomNavLinks,
+        footerNavLinks: this.footerNavLinks
+      };
     },
 
     addLink: function(link) {
       // link.top means it gets pushed to the top of the array,
       // link.bottomNav means it goes to the additional bottom nav
+      // link.footerNav means goes to the footer nav
       if (link.top && !link.bottomNav){
         this.navLinks.unshift(link);
       } else if (link.top && link.bottomNav){
         this.bottomNavLinks.unshift(link);
       } else if (link.bottomNav) {
         this.bottomNavLinks.push(link);
+      } else if (link.footerNav) {
+        this.footerNavLinks.push(link);
       } else {
         this.navLinks.push(link);
       }
@@ -103,6 +108,28 @@ function(app, Backbone, resizeColumns) {
       //this.render();
     },
 
+    removeLink: function (removeLink) {
+      var links = this.navlinks;
+
+      if (removeLink.bottomNav) {
+        links = this.bottomNavLinks;
+      } else if (removeLink.footerNav) {
+        links = this.footerNavLinks;
+      }
+
+      var foundIndex = -1;
+
+      _.each(links, function (link, index) {
+        if (link.title === removeLink.title) {
+          foundIndex = index;
+        }
+      });
+
+      if (foundIndex === -1) {return;}
+      links.splice(foundIndex, 1);
+      this.render();
+    },
+
     afterRender: function(){
 
       $('#primary-navbar li[data-nav-name="' + app.selectedHeader + '"]').addClass('active');

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17a58fb5/src/fauxton/app/templates/fauxton/nav_bar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/fauxton/nav_bar.html b/src/fauxton/app/templates/fauxton/nav_bar.html
index 3733775..636d176 100644
--- a/src/fauxton/app/templates/fauxton/nav_bar.html
+++ b/src/fauxton/app/templates/fauxton/nav_bar.html
@@ -39,6 +39,16 @@ the License.
       </li>
     <% }); %>
   </ul>
+  <ul id="footer-nav-links" class="nav">
+    <% _.each(footerNavLinks, function(link) { %>
+    <% if (link.view) {return;}  %>
+      <li data-nav-name= "<%= link.title %>">
+          <a class="<%= link.icon %> fonticon" href="<%= link.href %>">
+              <%= link.title %>
+          </a>
+      </li>
+    <% }); %>
+  </ul>
 </nav>
 
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/17a58fb5/src/fauxton/test/core/navbarSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/test/core/navbarSpec.js b/src/fauxton/test/core/navbarSpec.js
new file mode 100644
index 0000000..ec3e71f
--- /dev/null
+++ b/src/fauxton/test/core/navbarSpec.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([
+       'modules/fauxton/base',
+      'testUtils'
+], function (Fauxton, testUtils) {
+  var assert = testUtils.assert,
+      NavBar = Fauxton.NavBar;
+
+  describe('NavBar', function () {
+
+    describe('adding links', function () {
+      var navBar;
+
+      beforeEach(function () {
+        navBar = new NavBar();
+        navBar.navLinks = [];
+        navBar.bottomNavLinks = [];
+        navBar.footerNavLinks = [];
+      });
+
+      it('Should add link to navlinks', function () {
+        navBar.addLink({href: '#/test', title: 'Test Title'});
+
+        assert.equal(navBar.navLinks.length, 1);
+        assert.equal(navBar.footerNavLinks.length, 0);
+        assert.equal(navBar.bottomNavLinks.length, 0);
+      });
+
+      it('Should add link to bottom links', function () {
+        navBar.addLink({href: '#/test', bottomNav: true, title: 'Test Title'});
+
+        assert.equal(navBar.bottomNavLinks.length, 1);
+        assert.equal(navBar.navLinks.length, 0);
+        assert.equal(navBar.footerNavLinks.length, 0);
+      });
+
+      it('Should add link to footer links', function () {
+        navBar.addLink({href: '#/test', footerNav: true, title: 'Test Title'});
+
+        assert.equal(navBar.footerNavLinks.length, 1);
+        assert.equal(navBar.bottomNavLinks.length, 0);
+        assert.equal(navBar.navLinks.length, 0);
+      });
+    });
+
+    describe('removing links', function () {
+      var navBar;
+
+      beforeEach(function () {
+        navBar = new NavBar();
+        navBar.navLinks = [];
+        navBar.bottomNavLinks = [];
+        navBar.footerNavLinks = [];
+        navBar.addLink({
+          href: '#/test', 
+          footerNav: true, 
+          title: 'Test Title Footer'
+        });
+
+        navBar.addLink({
+          href: '#/test', 
+          bottomNav: true, 
+          title: 'Test Title Bottom'
+        });
+
+        navBar.addLink({
+          href: '#/test', 
+          title: 'Test Title'
+        });
+      });
+
+      it("should remove links from list", function () {
+        navBar.removeLink({
+          title: 'Test Title Footer',
+          footerNav: true
+        });
+
+        assert.equal(navBar.footerNavLinks.length, 0);
+        assert.equal(navBar.bottomNavLinks.length, 1);
+        assert.equal(navBar.navLinks.length, 1);
+      });
+
+      it("Should call render after removing links", function () {
+        var renderSpy = sinon.stub(navBar,'render');
+
+        navBar.removeLink({
+          title: 'Test Title Footer',
+          footerNav: true
+        });
+
+        assert.ok(renderSpy.calledOnce);
+      });
+
+    });
+  });
+
+});


[48/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
update docs


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

Branch: refs/heads/1867-feature-plugins
Commit: addaccb48c68950f2a25de8740de29843d70bc8a
Parents: f5cd4b3
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Sep 9 11:11:43 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:52:24 2013 +0200

----------------------------------------------------------------------
 src/fauxton/writing_addons.md | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/addaccb4/src/fauxton/writing_addons.md
----------------------------------------------------------------------
diff --git a/src/fauxton/writing_addons.md b/src/fauxton/writing_addons.md
index 85d1e7a..08f44fc 100644
--- a/src/fauxton/writing_addons.md
+++ b/src/fauxton/writing_addons.md
@@ -15,10 +15,11 @@ have the following structure:
 
 ## Generating an addon
 We have a `grunt-init` template that lets you create a skeleton addon,
-including all the boiler plate code. Run `grunt-init tasks/addon` and answer
-the questions it asks to create an addon:
+including all the boiler plate code. Run
+`./node_modules/.bin/grunt-init tasks/addon` and answer the questions
+it asks to create an addon:
 
-    ± grunt-init tasks/addon
+    $ ./node_modules/.bin/grunt-init tasks/addon
     path.existsSync is now called `fs.existsSync`.
     Running "addon" task
 


[47/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fix order of action buttons in the editor


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

Branch: refs/heads/1867-feature-plugins
Commit: f44dd92bc6d4d3180524a3a7e877e6f7150551ba
Parents: 2cb5799
Author: suelockwood <de...@gmail.com>
Authored: Fri Sep 6 14:19:39 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:46 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js      | 127 +++++++++----------
 src/fauxton/app/templates/documents/doc.html    |  15 ++-
 .../documents/doc_field_editor_tabs.html        |  15 +--
 src/fauxton/assets/less/database.less           |   9 ++
 4 files changed, 85 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f44dd92b/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 805116e..83e1e8f 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -298,71 +298,7 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns)
     },
 
     events: {
-      "click button.delete": "destroy",
-      "click button.duplicate": "duplicate",
-      "click button.upload": "upload"
-    },
-
-    destroy: function(event) {
-      if (this.model.isNewDoc()) {
-        FauxtonAPI.addNotification({
-          msg: 'This document has not been saved yet.',
-          type: 'warning'
-        });
-        return;
-      }
-
-      if (!window.confirm("Are you sure you want to delete this doc?")) {
-        return false;
-      }
-
-      var database = this.model.database;
-
-      this.model.destroy().then(function(resp) {
-        FauxtonAPI.addNotification({
-          msg: "Succesfully destroyed your doc"
-        });
-        FauxtonAPI.navigate(database.url("index"));
-      }, function(resp) {
-        FauxtonAPI.addNotification({
-          msg: "Failed to destroy your doc!",
-          type: "error"
-        });
-      });
-    },
-
-    beforeRender: function () {
-      this.uploadModal = this.setView('#upload-modal', new Views.UploadModal({model: this.model}));
-      this.uploadModal.render();
-
-      this.duplicateModal = this.setView('#duplicate-modal', new Views.DuplicateDocModal({model: this.model}));
-      this.duplicateModal.render();
-    },
-
-    upload: function (event) {
-      event.preventDefault();
-      if (this.model.isNewDoc()) {
-        FauxtonAPI.addNotification({
-          msg: 'Please save the document before uploading an attachment.',
-          type: 'warning'
-        });
-        return;
-      }
-      this.uploadModal.showModal();
-    },
-
-    duplicate: function(event) {
-      if (this.model.isNewDoc()) {
-        FauxtonAPI.addNotification({
-          msg: 'Please save the document before duplicating it.',
-          type: 'warning'
-        });
-        return;
-      }
-      event.preventDefault();
-      this.duplicateModal.showModal();
     },
-
     updateSelected: function (selected) {
       this.selected = selected;
       this.$('.active').removeClass('active');
@@ -590,13 +526,74 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns)
   Views.Doc = FauxtonAPI.View.extend({
     template: "templates/documents/doc",
     events: {
-      "click button.save-doc": "saveDoc"
+      "click button.save-doc": "saveDoc",
+      "click button.delete": "destroy",
+      "click button.duplicate": "duplicate",
+      "click button.upload": "upload"
     },
     disableLoader: true,
     initialize: function (options) {
       this.database = options.database;
     },
+    destroy: function(event) {
+      if (this.model.isNewDoc()) {
+        FauxtonAPI.addNotification({
+          msg: 'This document has not been saved yet.',
+          type: 'warning'
+        });
+        return;
+      }
+
+      if (!window.confirm("Are you sure you want to delete this doc?")) {
+        return false;
+      }
+
+      var database = this.model.database;
+
+      this.model.destroy().then(function(resp) {
+        FauxtonAPI.addNotification({
+          msg: "Succesfully destroyed your doc"
+        });
+        FauxtonAPI.navigate(database.url("index"));
+      }, function(resp) {
+        FauxtonAPI.addNotification({
+          msg: "Failed to destroy your doc!",
+          type: "error"
+        });
+      });
+    },
 
+    beforeRender: function () {
+      this.uploadModal = this.setView('#upload-modal', new Views.UploadModal({model: this.model}));
+      this.uploadModal.render();
+
+      this.duplicateModal = this.setView('#duplicate-modal', new Views.DuplicateDocModal({model: this.model}));
+      this.duplicateModal.render();
+    },
+
+    upload: function (event) {
+      event.preventDefault();
+      if (this.model.isNewDoc()) {
+        FauxtonAPI.addNotification({
+          msg: 'Please save the document before uploading an attachment.',
+          type: 'warning'
+        });
+        return;
+      }
+      this.uploadModal.showModal();
+    },
+
+    duplicate: function(event) {
+      if (this.model.isNewDoc()) {
+        FauxtonAPI.addNotification({
+          msg: 'Please save the document before duplicating it.',
+          type: 'warning'
+        });
+        return;
+      }
+      event.preventDefault();
+      this.duplicateModal.showModal();
+    },
     updateValues: function() {
       var notification;
       if (this.model.changedAttributes()) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f44dd92b/src/fauxton/app/templates/documents/doc.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/doc.html b/src/fauxton/app/templates/documents/doc.html
index d6577af..6d4c8e5 100644
--- a/src/fauxton/app/templates/documents/doc.html
+++ b/src/fauxton/app/templates/documents/doc.html
@@ -14,8 +14,9 @@ the License.
 
 <div id="doc">
   <div class="errors-container"></div>
+   
+<div class="btn-group" style="margin-bottom: 15px"> 
   <% if (attachments) { %>
-  <div class="btn-group pull-right" style="margin-bottom: 15px">
     <a class="btn dropdown-toggle btn" data-toggle="dropdown" href="#">
       View Attachments
       <span class="caret"></span>
@@ -29,8 +30,16 @@ the License.
       </li>
       <% }) %>
     </ul>
-  </div>
-  <% } %>
+
+  <% } %> 
+  <button class="btn btn-small upload"><i class="icon-circle-arrow-up"></i> Upload Attachment</button>
+  <button class="btn btn-small duplicate"><i class="icon-repeat"></i> Duplicate document</button>
+  <button class="btn btn-small delete"><i class="icon-trash"></i> Delete document</button>
+  </ul>
+
+<div id="upload-modal"> </div>
+<div id="duplicate-modal"> </div> 
+</div>
 
   <textarea class="doc-code"><%- JSON.stringify(doc.attributes, null, "  ") %></textarea>
   <br />

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f44dd92b/src/fauxton/app/templates/documents/doc_field_editor_tabs.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/doc_field_editor_tabs.html b/src/fauxton/app/templates/documents/doc_field_editor_tabs.html
index 29c6d8b..af34b71 100644
--- a/src/fauxton/app/templates/documents/doc_field_editor_tabs.html
+++ b/src/fauxton/app/templates/documents/doc_field_editor_tabs.html
@@ -14,17 +14,6 @@ the License.
 
 <ul class="nav nav-tabs">
   <!--<li id="field_editor" class="<%= isSelectedClass('field_editor') %>"><a href="#<%= doc.url('app') %>/field_editor">Doc fields</a></li>-->
-  <li id="code_editor" class="<%= isSelectedClass('code_editor') %>"><a href="#<%= doc.url('app') %>/code_editor"><i class="icon-pencil"></i> Code editor</a></li>
-  <ul class="nav pull-right" style="margin:5px 10px 0px 10px;">
-    <li>
-      <div class="btn-group">
-        <button class="btn btn-small upload"><i class="icon-circle-arrow-up"></i> Upload Attachment</button>
-        <button class="btn btn-small duplicate"><i class="icon-repeat"></i> Duplicate document</button>
-        <button class="btn btn-small delete"><i class="icon-trash"></i> Delete document</button>
-      </div>
-    </li>
-  </ul>
+  <li id="code_editor" class="<%= isSelectedClass('code_editor') %>"><a href="#<%= doc.url('app') %>/code_editor"><i class="icon-pencil"> </i> Code editor</a>
+  </li>
 </ul>
-
-<div id="upload-modal"> </div>
-<div id="duplicate-modal"> </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f44dd92b/src/fauxton/assets/less/database.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/database.less b/src/fauxton/assets/less/database.less
index 3854bcd..e1862d9 100644
--- a/src/fauxton/assets/less/database.less
+++ b/src/fauxton/assets/less/database.less
@@ -191,3 +191,12 @@ table.active-tasks{
     } 
 }
 
+
+#doc {
+    .dropdown-menu{
+        width: auto;
+    }
+}
+#tabs {
+    height: 40px;
+}


[24/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Typo - no such function couch_httpd:send_method_not_allowd/2

Signed-off-by: Peter Lemenkov <le...@gmail.com>


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

Branch: refs/heads/1867-feature-plugins
Commit: b18cdca1ae18b151ab9590aa011c079bb8a079b5
Parents: 27b9feb
Author: Peter Lemenkov <le...@gmail.com>
Authored: Sat Aug 17 18:57:56 2013 +0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:43 2013 +0200

----------------------------------------------------------------------
 src/couch_mrview/src/couch_mrview_http.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b18cdca1/src/couch_mrview/src/couch_mrview_http.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview/src/couch_mrview_http.erl b/src/couch_mrview/src/couch_mrview_http.erl
index 6e571f3..b8c4465 100644
--- a/src/couch_mrview/src/couch_mrview_http.erl
+++ b/src/couch_mrview/src/couch_mrview_http.erl
@@ -87,7 +87,7 @@ handle_compact_req(#httpd{method='POST'}=Req, Db, DDoc) ->
     ok = couch_mrview:compact(Db, DDoc),
     couch_httpd:send_json(Req, 202, {[{ok, true}]});
 handle_compact_req(Req, _Db, _DDoc) ->
-    couch_httpd:send_method_not_allowd(Req, "POST").
+    couch_httpd:send_method_not_allowed(Req, "POST").
 
 
 handle_cleanup_req(#httpd{method='POST'}=Req, Db) ->


[36/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: Factor disk size to own method


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

Branch: refs/heads/1867-feature-plugins
Commit: 5ea41518965c1dd7cd3353e42c02c17be06ca75b
Parents: 370dd17
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Aug 27 16:08:53 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js                       | 1 +
 src/fauxton/app/modules/databases/resources.js | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/5ea41518/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index a548a9d..29a70ba 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -245,6 +245,7 @@ module.exports = function(grunt) {
       },
       options: {
         nospawn: true,
+        debounceDelay: 500
       }
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5ea41518/src/fauxton/app/modules/databases/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/databases/resources.js b/src/fauxton/app/modules/databases/resources.js
index 04e6c1e..e019bdd 100644
--- a/src/fauxton/app/modules/databases/resources.js
+++ b/src/fauxton/app/modules/databases/resources.js
@@ -115,13 +115,17 @@ function(app, FauxtonAPI, Documents) {
       // cribbed from http://stackoverflow.com/questions/10420352/converting-file-size-in-bytes-to-human-readable
       var i = -1;
       var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
-      var fileSizeInBytes = this.get("disk_size");
+      var fileSizeInBytes = this.diskSize();
       do {
           fileSizeInBytes = fileSizeInBytes / 1024;
           i++;
       } while (fileSizeInBytes > 1024);
 
       return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
+    },
+
+    diskSize: function () {
+      return this.get("disk_size");
     }
   });
 


[09/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: add permissions button in database dropdown


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

Branch: refs/heads/1867-feature-plugins
Commit: 34006fe3e041435eba731e75922fb525ea1cf689
Parents: 89868bc
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Aug 15 10:46:38 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js       | 3 ++-
 src/fauxton/app/templates/documents/sidebar.html | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/34006fe3/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 5f61f95..74698ef 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -47,7 +47,7 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint) {
       return {
         // TODO make this not hard coded here
         changes_url: '#' + this.database.url('changes'),
-        db_url: '#' + this.database.url('index') + '?limit=100'
+        db_url: '#' + this.database.url('index') + '?limit=100',
       };
     },
 
@@ -1333,6 +1333,7 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint) {
     serialize: function() {
       return {
         changes_url: '#' + this.database.url('changes'),
+        permissions_url: '#' + this.database.url('app') + '/permissions',
         db_url: '#' + this.database.url('index') + '?limit=100',
         index: [1,2,3],
         view: [1,2],

http://git-wip-us.apache.org/repos/asf/couchdb/blob/34006fe3/src/fauxton/app/templates/documents/sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/sidebar.html b/src/fauxton/app/templates/documents/sidebar.html
index 7d283d5..18c6856 100644
--- a/src/fauxton/app/templates/documents/sidebar.html
+++ b/src/fauxton/app/templates/documents/sidebar.html
@@ -24,9 +24,9 @@ the License.
           <!-- dropdown menu links -->
           <li><a href="<%= db_url %>">Docs</a></li>
           <!-- TODO::REENABLE
-          <li><a href="#">Permissions</a></li>
           <li><a href="#">Stats</a></li>
           -->
+          <li><a href="<%= permissions_url %>">Permissions</a></li>
           <li><a  href="<%= changes_url %>">Changes</a></li>
         </ul>
       </div>


[26/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fixed typos in Vagrantfile


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

Branch: refs/heads/1867-feature-plugins
Commit: dadd9354faea9ebf471c15efe7e1522199552b7b
Parents: 611c2b9
Author: nvdev <mo...@gmail.com>
Authored: Fri Aug 23 18:57:56 2013 +0300
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:44 2013 +0200

----------------------------------------------------------------------
 Vagrantfile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/dadd9354/Vagrantfile
----------------------------------------------------------------------
diff --git a/Vagrantfile b/Vagrantfile
index 465d5a6..4b5eee1 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -15,7 +15,7 @@ Vagrant::Config.run do |config|
   if Dir.glob("#{File.dirname(__FILE__)}/.vagrant/machines/default/*/id").empty?
     # install build-essential
     pkg_cmd = "apt-get update -qq; apt-get install -q -y build-essential git " 
-        "autoconf autoconf-archive gnu-standards help2man textinfo; "
+        "autoconf autoconf-archive gnu-standards help2man texinfo; "
 
     # Install erlang
     pkg_cmd << "apt-get install -q -y erlang-base-hipe erlang-dev " \
@@ -26,8 +26,7 @@ Vagrant::Config.run do |config|
         "curl libcurl4-gnutls-dev libtool; "
 
     # doc dependencies
-    pkg_cmd << "apt-get install -q -y apt-get install -q -y help2man " \
-        "textinfo python-sphix python-pip; " \
+    pkg_cmd << "apt-get install -q -y help2man texinfo python-sphinx python-pip; " \
         "pip install -U pygments; "
 
     config.vm.provision :shell, :inline => pkg_cmd


[42/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Bootstrap CSS fixes for our theme.


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

Branch: refs/heads/1867-feature-plugins
Commit: e67f0a71c4773c1123d94f41cc411e7a1977c415
Parents: 9a5fe75
Author: suelockwood <de...@gmail.com>
Authored: Wed Sep 4 16:51:32 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 src/fauxton/assets/less/fauxton.less | 64 +++++++++++++++++++++++--------
 1 file changed, 49 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e67f0a71/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index fcaf884..8111f0f 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -556,11 +556,12 @@ footer#mainFooter{
   width: 100%;
   margin-bottom: 10px;
 }
-.navbar-form input{
-  margin-top: -5px;
-}
+
 .navbar-form.pull-right.database-search {
   margin-right: 36px;
+    input[type=text]{
+      margin-top: -4px;
+    }
 }
 
 #db-views-tabs-nav{
@@ -648,7 +649,11 @@ tbody {padding-top: 10px;}
   }
 }
 
-
+.btn {
+  padding-top: 12px;
+  padding-bottom: 12px;
+  margin-top: 0px;
+}
 
 .button{
   .transition(all @transitionSpeed @transitionEaseType);
@@ -700,10 +705,10 @@ input[type=text], input[type=password],
 .navbar-form input{
   .border-radius(0);
   padding: 12px;
-  margin-top: -4px;
   border: 1px solid #ccc;
   height: auto;
   font-size: 16px;
+  margin-top: 0;
 }
 
 
@@ -733,6 +738,13 @@ label.fonticon-search {
   }
 }
 
+
+.form-inline {
+  input[type=password],
+  input[type=text]{
+    width: auto;
+  }
+}
 *, *:before, *:after {
   .box-sizing(border-box);
 }
@@ -756,15 +768,28 @@ form.custom .hidden-field {
   visibility: hidden;
 }
 
-label{
-  padding-left: 25px;  
+
+.checkbox {
+  label{
+    display: inline-block;
+    padding-left:25px;
+  }
+}
+
+label{ 
   margin-right: 15px; 
-  display: inline-block;  
+  padding-left:0;
+  display: block;  
   cursor: pointer;  
   position: relative;  
-  font-size: 14px;  
+  font-size: 14px; 
+  &.inline{
+    display: inline-block;
+  } 
+}
+.help-block{
+  font-size: 12px;
 }
-
 .custom-inputs{
 
   input[type=radio], 
@@ -841,12 +866,23 @@ label{
 .input-append,
 .input-prepend {
   .add-on {
-    font-size: 15px;
-    padding: 7px 5px;
-    margin-top: -5px;
+    font-size: 18px;
+    padding: 14px 5px 30px;
   }
 }
 
+.input-append .btn:last-child, 
+.input-append .btn-group:last-child > .dropdown-toggle {
+  padding: 10px 5px 14px;
+}
+.input-append .btn{
+  padding: 10px 5px 14px;
+}
+.row-fluid .input-append [class*="span"],
+.input-prepend input[class*="span"]{
+  width: auto;
+}
+
 /*pretty print*/
 pre.prettyprint {
   background: #E5E0DD;
@@ -914,14 +950,12 @@ div.spinner {
   .input-append.input-prepend {
     margin-bottom: 0px;
     .add-on {
-      margin-top: -4px;
       background: none;
       padding: 14px 12px 32px 12px;
       border: none;
     }
     .btn:last-child{
       margin-left: -1px;
-      margin-top: -4px;
       background: none;
       padding: 13px 12px 11px 12px;
       &:hover{


[23/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Expose get_compactor_pid/1


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

Branch: refs/heads/1867-feature-plugins
Commit: b5c044f3161043ff236176b4ce93ef7bec7af532
Parents: b18cdca
Author: Robert Newson <rn...@apache.org>
Authored: Tue Aug 20 12:32:29 2013 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:43 2013 +0200

----------------------------------------------------------------------
 src/couch_index/src/couch_index.erl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b5c044f3/src/couch_index/src/couch_index.erl
----------------------------------------------------------------------
diff --git a/src/couch_index/src/couch_index.erl b/src/couch_index/src/couch_index.erl
index 5bf322e..df004b4 100644
--- a/src/couch_index/src/couch_index.erl
+++ b/src/couch_index/src/couch_index.erl
@@ -16,7 +16,7 @@
 
 %% API
 -export([start_link/1, stop/1, get_state/2, get_info/1]).
--export([compact/1, compact/2]).
+-export([compact/1, compact/2, get_compactor_pid/1]).
 -export([config_change/3]).
 
 %% gen_server callbacks
@@ -67,6 +67,9 @@ compact(Pid, Options) ->
     end.
 
 
+get_compactor_pid(Pid) ->
+    gen_server:call(Pid, get_compactor_pid).
+
 config_change("query_server_config", "commit_freq", NewValue) ->
     ok = gen_server:cast(?MODULE, {config_update, NewValue}).
 


[35/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Update version in documentation.


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

Branch: refs/heads/1867-feature-plugins
Commit: 611c2b9f64cec1e250fb8d2ff789a373db6d0bc0
Parents: 529c447
Author: Dirkjan Ochtman <dj...@apache.org>
Authored: Fri Aug 23 16:55:42 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:44 2013 +0200

----------------------------------------------------------------------
 share/doc/src/conf.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/611c2b9f/share/doc/src/conf.py
----------------------------------------------------------------------
diff --git a/share/doc/src/conf.py b/share/doc/src/conf.py
index 6fd9112..8c352d6 100644
--- a/share/doc/src/conf.py
+++ b/share/doc/src/conf.py
@@ -20,9 +20,9 @@ master_doc = "index"
 
 nitpicky = True
 
-version = "1.3"
+version = "1.4"
 
-release = "1.3.0"
+release = "1.4.0"
 
 project = u"Apache CouchDB"
 


[08/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Making nav bar match the comps with bottom footer
Add documentation link


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

Branch: refs/heads/1867-feature-plugins
Commit: 613c965317122a41b92e927ae50549dd959e9fe2
Parents: a36168a
Author: suelockwood <de...@gmail.com>
Authored: Tue Aug 13 11:07:18 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/templates/fauxton/nav_bar.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/613c9653/src/fauxton/app/templates/fauxton/nav_bar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/fauxton/nav_bar.html b/src/fauxton/app/templates/fauxton/nav_bar.html
index 64a0336..f851975 100644
--- a/src/fauxton/app/templates/fauxton/nav_bar.html
+++ b/src/fauxton/app/templates/fauxton/nav_bar.html
@@ -33,7 +33,7 @@ the License.
 
     <ul id="bottom-nav-links" class="nav">
         <li data-nav-name= "Documentation">
-            <a class="fonticon-bookmark fonticon" target="_blank" href="http://docs.couchdb.org/en/latest/">
+            <a class="fonticon-bookmark fonticon" href="http://wiki.apache.org/couchdb/">
                 Documentation
             </a>
         </li>


[43/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Cleaning up resize collumns to use a class selector instead of an ID. Also added cleanup method to remove callback.


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

Branch: refs/heads/1867-feature-plugins
Commit: d1e0c8dbcc871634411383ae2d5d622420d685fd
Parents: e67f0a7
Author: suelockwood <de...@gmail.com>
Authored: Thu Sep 5 12:12:16 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/resizeColumns.js                          | 6 +++++-
 src/fauxton/app/templates/layouts/one_pane.html           | 2 +-
 src/fauxton/app/templates/layouts/with_right_sidebar.html | 2 +-
 src/fauxton/app/templates/layouts/with_sidebar.html       | 2 +-
 src/fauxton/app/templates/layouts/with_tabs.html          | 2 +-
 src/fauxton/app/templates/layouts/with_tabs_sidebar.html  | 2 +-
 6 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d1e0c8db/src/fauxton/app/resizeColumns.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/resizeColumns.js b/src/fauxton/app/resizeColumns.js
index 0073690..687b9d3 100644
--- a/src/fauxton/app/resizeColumns.js
+++ b/src/fauxton/app/resizeColumns.js
@@ -25,7 +25,7 @@ function(mixins) {
 
   var Resize = function(options){
     this.options = options;
-    this.options.selectorElements = options.selectorElements || "#dashboard-content";
+    this.options.selectorElements = options.selectorElements || ".window-resizeable";
   };
 
   Resize.prototype = {
@@ -49,10 +49,14 @@ function(mixins) {
     updateOptions:function(options){
       this.options = {};
       this.options = options;
+      this.options.selectorElements = options.selectorElements || ".window-resizeable";
     },
     turnOff:function(){
       mixins.removeWindowResize("animation");
     },
+    cleanupCallback: function(){
+      this.callback = null;
+    },
     onResizeHandler: function (){
       //if there is an override, do that instead
       if (this.options.onResizeHandler){

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d1e0c8db/src/fauxton/app/templates/layouts/one_pane.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/layouts/one_pane.html b/src/fauxton/app/templates/layouts/one_pane.html
index baafbf8..c7adf1f 100644
--- a/src/fauxton/app/templates/layouts/one_pane.html
+++ b/src/fauxton/app/templates/layouts/one_pane.html
@@ -22,7 +22,7 @@ the License.
 
   <div class="row-fluid content-area">
   	<div id="tabs" class="row"></div>
-    <div id="dashboard-content"></div>
+    <div id="dashboard-content" class="window-resizeable"></div>
   </div>
 </div>
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d1e0c8db/src/fauxton/app/templates/layouts/with_right_sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/layouts/with_right_sidebar.html b/src/fauxton/app/templates/layouts/with_right_sidebar.html
index 1923ced..ade5b82 100644
--- a/src/fauxton/app/templates/layouts/with_right_sidebar.html
+++ b/src/fauxton/app/templates/layouts/with_right_sidebar.html
@@ -20,7 +20,7 @@ the License.
   </div>
   <div class="with-sidebar-right content-area">
     <div id="dashboard-content" class="list"></div>
-    <div id="sidebar-content" class="sidebar pull-right"></div>
+    <div id="sidebar-content" class="sidebar pull-right window-resizeable"></div>
   </div>
 </div>
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d1e0c8db/src/fauxton/app/templates/layouts/with_sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/layouts/with_sidebar.html b/src/fauxton/app/templates/layouts/with_sidebar.html
index bd26e5b..0bba4a1 100644
--- a/src/fauxton/app/templates/layouts/with_sidebar.html
+++ b/src/fauxton/app/templates/layouts/with_sidebar.html
@@ -21,7 +21,7 @@ the License.
 </header>
   <div class="with-sidebar content-area">
     <div id="sidebar-content" class="sidebar"></div>
-    <div id="dashboard-content" class="list"></div>
+    <div id="dashboard-content" class="list window-resizeable"></div>
   </div>
 </div>
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d1e0c8db/src/fauxton/app/templates/layouts/with_tabs.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/layouts/with_tabs.html b/src/fauxton/app/templates/layouts/with_tabs.html
index bf63517..8bfc7e0 100644
--- a/src/fauxton/app/templates/layouts/with_tabs.html
+++ b/src/fauxton/app/templates/layouts/with_tabs.html
@@ -22,7 +22,7 @@ the License.
 
   <div class="row-fluid content-area">
   	<div id="tabs" class="row-fluid"></div>
-    <div id="dashboard-content" class="list span12"></div>
+    <div id="dashboard-content" class="list span12 window-resizeable"></div>
   </div>
 
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d1e0c8db/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/layouts/with_tabs_sidebar.html b/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
index e7a524f..69d723b 100644
--- a/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
+++ b/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
@@ -27,7 +27,7 @@ the License.
 
     <aside id="sidebar-content" class="sidebar"></aside>
 
-    <section id="dashboard-content" class="list pull-right">
+    <section id="dashboard-content" class="list pull-right window-resizeable">
       <div class="inner">
         <div id="dashboard-upper-menu"></div>
         <div id="dashboard-upper-content"></div>


[04/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: fix watch task failing for no include pattern


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

Branch: refs/heads/1867-feature-plugins
Commit: d0a35ce012d0f7c90d9de93f2a10e0b59aa61bc5
Parents: b7ec4fb
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Aug 19 11:35:06 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d0a35ce0/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index f25e3b8..1c58bb6 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -234,7 +234,9 @@ module.exports = function(grunt) {
         tasks: ['clean:watch', 'dependencies','less', 'concat:index_css'],
       },
       html: {
-        files: helper.watchFiles(['.html'], []),
+        // the index.html is added in as a dummy file incase there is no
+        // html dependancies this will break. So we need one include pattern
+        files: helper.watchFiles(['.html'], ['./index.html']),
         tasks: ['clean:watch', 'dependencies']
       },
       options: {


[29/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fixed line wrapping in Vagrantfile.


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

Branch: refs/heads/1867-feature-plugins
Commit: 370dd1747dfa708a182b5a653bca5b39af3fce2d
Parents: dadd935
Author: nvdev <mo...@gmail.com>
Authored: Sat Aug 24 18:49:38 2013 +0300
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:44 2013 +0200

----------------------------------------------------------------------
 Vagrantfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/370dd174/Vagrantfile
----------------------------------------------------------------------
diff --git a/Vagrantfile b/Vagrantfile
index 4b5eee1..d4e93d7 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -14,7 +14,7 @@ Vagrant::Config.run do |config|
   # Install couchdb dependencies if deployment was not done
   if Dir.glob("#{File.dirname(__FILE__)}/.vagrant/machines/default/*/id").empty?
     # install build-essential
-    pkg_cmd = "apt-get update -qq; apt-get install -q -y build-essential git " 
+    pkg_cmd = "apt-get update -qq; apt-get install -q -y build-essential git " \
         "autoconf autoconf-archive gnu-standards help2man texinfo; "
 
     # Install erlang


[12/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fix typo, consistency with vertical whitespace.


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

Branch: refs/heads/1867-feature-plugins
Commit: b7ec4fbea816a8a3bacc093247a4fa1006828adf
Parents: d5c28f2
Author: Dirkjan Ochtman <dj...@apache.org>
Authored: Mon Aug 19 15:10:20 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 share/doc/src/api/database.rst | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b7ec4fbe/share/doc/src/api/database.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/api/database.rst b/share/doc/src/api/database.rst
index 4ef330d..2ef4ad7 100644
--- a/share/doc/src/api/database.rst
+++ b/share/doc/src/api/database.rst
@@ -998,7 +998,7 @@ should use a defined view if you want to achieve the best performance.
 * **Response**: JSON structure with purged documents and purge sequence
 * **Admin Privileges Required**: no
 
-Occasionaly something into ends up in your database that should never have
+Occasionally something into ends up in your database that should never have
 written to it, like a password or private key. Purge can help you here.
 
 A database purge permanently removes the references to deleted documents
@@ -1009,7 +1009,6 @@ deleted documents are replicated to other databases as having been
 deleted. This also means that you can check the status of a document and
 identify that the document has been deleted.
 
-
 .. note::
 
     Don't use purge as a regular operation, it is designed to be used


[06/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Update the addon's hello world tutorial to have routeObjects


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

Branch: refs/heads/1867-feature-plugins
Commit: ae74a332f629b8921124454a9528979ed1ae0fbe
Parents: 613c965
Author: suelockwood <de...@gmail.com>
Authored: Tue Aug 13 11:07:57 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/templates/fauxton/nav_bar.html |  2 +-
 src/fauxton/writing_addons.md                  | 55 ++++++++++++---------
 2 files changed, 33 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ae74a332/src/fauxton/app/templates/fauxton/nav_bar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/fauxton/nav_bar.html b/src/fauxton/app/templates/fauxton/nav_bar.html
index f851975..64a0336 100644
--- a/src/fauxton/app/templates/fauxton/nav_bar.html
+++ b/src/fauxton/app/templates/fauxton/nav_bar.html
@@ -33,7 +33,7 @@ the License.
 
     <ul id="bottom-nav-links" class="nav">
         <li data-nav-name= "Documentation">
-            <a class="fonticon-bookmark fonticon" href="http://wiki.apache.org/couchdb/">
+            <a class="fonticon-bookmark fonticon" target="_blank" href="http://docs.couchdb.org/en/latest/">
                 Documentation
             </a>
         </li>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ae74a332/src/fauxton/writing_addons.md
----------------------------------------------------------------------
diff --git a/src/fauxton/writing_addons.md b/src/fauxton/writing_addons.md
index e0a85fa..85d1e7a 100644
--- a/src/fauxton/writing_addons.md
+++ b/src/fauxton/writing_addons.md
@@ -110,28 +110,41 @@ Then define a route in `routes.js` that the addon is accessible at:
     ],
 
     function(app, FauxtonAPI, Resources) {
-      var helloRoute = function () {
-        console.log('helloRoute callback yo');
-        return {
-          layout: "one_pane",
-          crumbs: [
-            {"name": "Hello","link": "_hello"}
-          ],
-          views: {
-            "#dashboard-content": new Resources.Hello({})
-          },
-          apiUrl: 'hello'
-        };
-      };
+      var  HelloRouteObject = FauxtonAPI.RouteObject.extend({
+        layout: "one_pane",
 
-      Routes = {
-        "_hello": helloRoute
-      };
+        crumbs: [
+          {"name": "Hello","link": "_hello"}
+        ],
+
+        routes: {
+           "_hello": "helloRoute"
+        },
+
+        selectedHeader: "Hello",
+
+        roles: ["_admin"],
+
+        apiUrl:'hello',
+
+        initialize: function () {
+            //put common views used on all your routes here (eg:  sidebars )
+        },
+
+        helloRoute: function () {
+          this.setView("#dashboard-content", new Resources.Hello({}));
+        }
+      });
+
+      Resources.RouteObjects = [HelloRouteObject];
+
+      return Resources;
 
-      return Routes;
     });
 
 
+
+
 Then wire it all together in base.js:
 
     define([
@@ -141,16 +154,12 @@ Then wire it all together in base.js:
     ],
 
     function(app, FauxtonAPI, HelloRoutes) {
-      var Hello = new FauxtonAPI.addon();
-      console.log('hello from hello');
 
-      Hello.initialize = function() {
+      HelloRoutes.initialize = function() {
         FauxtonAPI.addHeaderLink({title: "Hello", href: "#_hello"});
       };
 
-      Hello.Routes = HelloRoutes;
-      console.log(Hello);
-      return Hello;
+      return HelloRoutes;
     });
 
 Once the code is in place include the add on in your `settings.json` so that it


[14/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
move documents options to tabs


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

Branch: refs/heads/1867-feature-plugins
Commit: 8a1f49ec6c729b5fba1f18af72703b97e0974550
Parents: 8905089
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Aug 19 13:20:01 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:43 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js      |   6 +
 .../app/templates/documents/view_editor.html    | 323 +++++++++----------
 2 files changed, 160 insertions(+), 169 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8a1f49ec/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 74698ef..71bd4ad 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -1201,6 +1201,12 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint) {
       }
 
       this.updateDesignDoc();
+      // This is a hack around a bug in backbone.layoutmanager with grunt dev
+      // When in grunt dev mode we load templates asynchronously
+      // and this can cause a double render which then gives us two 
+      // mapeditors
+      if (this.mapViewSet) { return;}
+      this.mapViewSet = true;
 
       this.mapEditor = Codemirror.fromTextArea(mapFun.get()[0], {
         mode: "javascript",

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8a1f49ec/src/fauxton/app/templates/documents/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/view_editor.html b/src/fauxton/app/templates/documents/view_editor.html
index 70d30df..4b58e61 100644
--- a/src/fauxton/app/templates/documents/view_editor.html
+++ b/src/fauxton/app/templates/documents/view_editor.html
@@ -12,184 +12,169 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 <div class="row">
+  <ul class="nav nav-tabs" id="myTab">
+    <li class="active"> <a data-toggle="tab" href="#index"><i class="icon-wrench"></i> <% if (newView) { %> Create Index <% } else { %> Edit Index <% } %></a></li>
+    <li><a href="#query" data-toggle="tab"> <i class="icon-plus"></i> Advanced Options</a></li>
+    <li><a href="#metadata" data-toggle="tab">Design Doc Metadata</a></li>
+  </ul>
   <div class="all-docs-list errors-container"></div>
-  <div id="edit-index-container">
-    <div id="ddoc-info"> </div>
-
-    <div class="accordion" id="edit-index-accordion">
-      <div class="accordion-group">
-        <div class="accordion-heading">
-          <a class="accordion-toggle" data-bypass="true" data-toggle="collapse" data-parent="#edit-index-accordion" href="#collapse-edit-index">
-            <i class="icon-wrench"></i> <% if (newView) { %> Create Index <% } else { %> Edit Index <% } %>
-          </a>
-        </div>
-        <div id="collapse-edit-index" class="accordion-body <% if (!newView) { %> collapse <% } %>">
-          <div class="accordion-inner">
-            <div id="define-view" class="ddoc-alert well">
-              <div class="errors-container"></div>
-              <form class="form-horizontal">
-                <h3>Define your index</h3>
-                <div class="control-group">
-                  <div class="row" style="margin-left:10px">
-                    <div class="span3">
-                      <label class="control-label" for="ddoc">Design document <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#design-docs"><i class="icon-question-sign"></i></a></label>
-                      <div class="controls">
-                        <select id="ddoc">
-                          <optgroup label="Select a document">
-                            <option id="new-doc">New document</option>
-                            <% ddocs.each(function(ddoc) { %>
-                            <% if (ddoc.id === ddocName) { %>
-                            <option selected="selected"><%= ddoc.id %></option>
-                            <% } else { %>
-                            <option><%= ddoc.id %></option>
-                            <% } %>
-                            <% }); %>
-                          </optgroup>
-                        </select>
-                      </div>
-                    </div>
-                    <div id="new-ddoc-section" class="span5 offset1" 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>
-                  </div>
-                </div>
-                <div class="control-group">
-                  <label class="control-label" for="index-name">Index name <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#view-functions"><i class="icon-question-sign"></i></a></label>
-                  <div class="controls">
-                    <input type="text" id="index-name" value="<%= viewName %>" placeholder="Index name" />
-                  </div>
-                </div>
-                <div class="control-group">
-                  <label class="control-label" for="map-function">Map function <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#map-functions"><i class="icon-question-sign"></i></a></label>
-                  <div class="controls">
-                    <% if (newView) { %>
-                    <textarea class="js-editor" id="map-function"><%= langTemplates.map %></textarea>
-                    <% } else { %>
-                    <textarea class="js-editor" id="map-function"><%= ddoc.get('views')[viewName].map %></textarea>
-                    <% } %>
-                  </div>
-                </div>
-                <div class="control-group">
-                  <label class="control-label" for="reduce-function-selector">Reduce function <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs.html#reduce-and-rereduce-functions"><i class="icon-question-sign"></i></a></label>
-                  <div class="controls">
-                    <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</option>
-                    </select>
-                    <span class="help-block">Reduce functions are optional.</span>
-                  </div>
-                </div>
-                <div class="control-group reduce-function">
-                  <label class="control-label" for="reduce-function">Custom Reduce</label>
-                  <div class="controls">
-                    <% if (newView) { %>
-                    <textarea class="js-editor" id="reduce-function"><%= langTemplates.reduce %></textarea>
-                    <% } else { %>
-                    <textarea class="js-editor" id="reduce-function"><%= ddoc.get('views')[viewName].reduce %></textarea>
-                    <% } %>
-                  </div>
+  <div class="tab-content">
+    <div class="tab-pane active" id="index">
+      <div id="define-view" class="ddoc-alert well">
+        <div class="errors-container"></div>
+        <form class="form-horizontal">
+          <h3>Define your index</h3>
+          <div class="control-group">
+            <div class="row" style="margin-left:10px">
+              <div class="span3">
+                <label class="control-label" for="ddoc">Design document <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#design-docs"><i class="icon-question-sign"></i></a></label>
+                <div class="controls">
+                  <select id="ddoc">
+                    <optgroup label="Select a document">
+                      <option id="new-doc">New document</option>
+                      <% ddocs.each(function(ddoc) { %>
+                      <% if (ddoc.id === ddocName) { %>
+                      <option selected="selected"><%= ddoc.id %></option>
+                      <% } else { %>
+                      <option><%= ddoc.id %></option>
+                      <% } %>
+                      <% }); %>
+                    </optgroup>
+                  </select>
                 </div>
-                <div class="control-group">
-                  <hr />
-                  <div class="controls">
-                    <button class="btn btn-success save">Save</button>
-                    <% if (!this.newView) { %>
-                    <button class="btn btn-danger delete">Delete</button>
-                    <% } %>
-                  </div>
+              </div>
+              <div id="new-ddoc-section" class="span5 offset1" 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 class="clearfix"></div>
-              </form>
+              </div>
             </div>
           </div>
-        </div>
-
+          <div class="control-group">
+            <label class="control-label" for="index-name">Index name <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#view-functions"><i class="icon-question-sign"></i></a></label>
+            <div class="controls">
+              <input type="text" id="index-name" value="<%= viewName %>" placeholder="Index name" />
+            </div>
+          </div>
+          <div class="control-group">
+            <label class="control-label" for="map-function">Map function <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#map-functions"><i class="icon-question-sign"></i></a></label>
+            <div class="controls">
+              <% if (newView) { %>
+              <textarea class="js-editor" id="map-function"><%= langTemplates.map %></textarea>
+              <% } else { %>
+              <textarea class="js-editor" id="map-function"><%= ddoc.get('views')[viewName].map %></textarea>
+              <% } %>
+            </div>
+          </div>
+          <div class="control-group">
+            <label class="control-label" for="reduce-function-selector">Reduce function <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs.html#reduce-and-rereduce-functions"><i class="icon-question-sign"></i></a></label>
+            <div class="controls">
+              <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</option>
+              </select>
+              <span class="help-block">Reduce functions are optional.</span>
+            </div>
+          </div>
+          <div class="control-group reduce-function">
+            <label class="control-label" for="reduce-function">Custom Reduce</label>
+            <div class="controls">
+              <% if (newView) { %>
+              <textarea class="js-editor" id="reduce-function"><%= langTemplates.reduce %></textarea>
+              <% } else { %>
+              <textarea class="js-editor" id="reduce-function"><%= ddoc.get('views')[viewName].reduce %></textarea>
+              <% } %>
+            </div>
+          </div>
+          <div class="control-group">
+            <hr />
+            <div class="controls">
+              <button class="btn btn-success save">Save</button>
+              <% if (!this.newView) { %>
+              <button class="btn btn-danger delete">Delete</button>
+              <% } %>
+            </div>
+          </div>
+          <div class="clearfix"></div>
+        </form>
       </div>
     </div>
-    <div class="accordion" id="advanced-options-accordion">
-      <div class="accordion-group">
-        <div class="accordion-heading">
-          <a class="accordion-toggle" data-bypass="true" data-toggle="collapse" data-parent="#advanced-options-accordion" href="#collapse-advanced-options">
-            <i class="icon-plus"></i> Advanced Options
-          </a>
-        </div>
-        <div id="collapse-advanced-options" class="accordion-body collapse">
-          <div class="accordion-inner advanced-options">
-            <form class="view-query-update">
-              <div class="controls controls-row">
-                <label class="span3 inline">
-                  Limit:
-                  <select name="limit" class="input-small">
-                    <option>5</option>
-                    <option selected="selected">10</option>
-                    <option>25</option>
-                    <option>50</option>
-                    <option>100</option>
-                  </select>
-                </label>
-                <label class="span3 checkbox inline">
-                  <input name="include_docs" type="checkbox" value="true"> Include Docs
-                </label>
-                <% if (hasReduce) { %>
-                <label class="span2 checkbox inline">
-                  <input name="reduce" type="checkbox" value="true"> Reduce
-                </label>
-                <label class="span4 inline">
-                  Group Level:
-                  <select 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 class="controls controls-row">
-                <input name="key" class="span4" type="text" placeholder="Key">
-                <input name="keys" class="span8" type="text" placeholder="Keys">
-              </div>
-              <div class="controls controls-row">
-                <input name="startkey" class="span6" type="text" placeholder="Start Key">
-                <input name="endkey" class="span6" type="text" placeholder="End Key">
-              </div>
-              <div class="controls controls-row">
-                <label class="span2 checkbox inline">
-                  <input name="stale" type="checkbox" value="ok"> Stale
-                </label>
-                <label class="span2 checkbox inline">
-                  <input name="descending" type="checkbox" value="true"> Descending
-                </label>
-                <label class="span4 checkbox inline">
-                  <input name="inclusive_end" type="checkbox" value="false"> Disable Inclusive End
-                </label>
-                <label class="span4 checkbox inline">
-                  <input name="update_seq" type="checkbox" value="true"> Include Update Sequence
-                </label>
-              </div>
-              <div class="controls controls-row">
-                <button type="submit" class="btn btn-primary">Query</button>
-                <button class="btn btn-info preview">Preview</button>
-              </div>
-            </form>
-
+    <div class="tab-pane" id="metadata">
+      <div id="ddoc-info"> </div>
+    </div>
+    <div class="tab-pane" id="query">
+      <div class="advanced-options">
+        <form class="view-query-update">
+          <div class="controls controls-row">
+            <label class="span3 inline">
+              Limit:
+              <select name="limit" class="input-small">
+                <option>5</option>
+                <option selected="selected">10</option>
+                <option>25</option>
+                <option>50</option>
+                <option>100</option>
+              </select>
+            </label>
+            <label class="span3 checkbox inline">
+              <input name="include_docs" type="checkbox" value="true"> Include Docs
+            </label>
+            <% if (hasReduce) { %>
+            <label class="span2 checkbox inline">
+              <input name="reduce" type="checkbox" value="true"> Reduce
+            </label>
+            <label class="span4 inline">
+              Group Level:
+              <select 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 class="controls controls-row">
+            <input name="key" class="span4" type="text" placeholder="Key">
+            <input name="keys" class="span8" type="text" placeholder="Keys">
+          </div>
+          <div class="controls controls-row">
+            <input name="startkey" class="span6" type="text" placeholder="Start Key">
+            <input name="endkey" class="span6" type="text" placeholder="End Key">
+          </div>
+          <div class="controls controls-row">
+            <label class="span2 checkbox inline">
+              <input name="stale" type="checkbox" value="ok"> Stale
+            </label>
+            <label class="span2 checkbox inline">
+              <input name="descending" type="checkbox" value="true"> Descending
+            </label>
+            <label class="span4 checkbox inline">
+              <input name="inclusive_end" type="checkbox" value="false"> Disable Inclusive End
+            </label>
+            <label class="span4 checkbox inline">
+              <input name="update_seq" type="checkbox" value="true"> Include Update Sequence
+            </label>
+          </div>
+          <div class="controls controls-row">
+            <button type="submit" class="btn btn-primary">Query</button>
+            <button class="btn btn-info preview">Preview</button>
+          </div>
+        </form>
       </div>
     </div>
   </div>
+</div>
+


[02/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
fixing failing test


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

Branch: refs/heads/1867-feature-plugins
Commit: 2560aeac374bb64d6bb03421fcb242e80d4e5b21
Parents: 7c6998b
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Aug 13 10:50:50 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:41 2013 +0200

----------------------------------------------------------------------
 .gitignore                               |  1 +
 src/fauxton/test/core/routeObjectSpec.js | 15 +++++-
 src/fauxton/test/test.config.js          | 71 ---------------------------
 3 files changed, 14 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2560aeac/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 31bed6a..6c67ab7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -123,3 +123,4 @@ test/javascript/run_js_tests.sh
 test/local.ini
 tmp
 utils/run
+src/fauxton/test/test.config.js

http://git-wip-us.apache.org/repos/asf/couchdb/blob/2560aeac/src/fauxton/test/core/routeObjectSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/test/core/routeObjectSpec.js b/src/fauxton/test/core/routeObjectSpec.js
index 45d95ac..d043d63 100644
--- a/src/fauxton/test/core/routeObjectSpec.js
+++ b/src/fauxton/test/core/routeObjectSpec.js
@@ -1,3 +1,14 @@
+// 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([
        'api',
       'testUtils'
@@ -65,7 +76,7 @@ define([
             getViewsSpy = sinon.stub(testRouteObject,"getViews"),
             viewSpy = sinon.stub(view, "establish");
         
-        sinon.stub(view, "hasRendered").returns(false);
+        view.hasRendered = false;
         getViewsSpy.returns({'#view': view});
 
         testRouteObject.renderWith('the-route', mockLayout, 'args');
@@ -77,7 +88,7 @@ define([
             getViewsSpy = sinon.stub(testRouteObject,"getViews"),
             viewSpy = sinon.stub(view, "establish");
         
-        sinon.stub(view, "hasRendered").returns(true);
+        view.hasRendered = true;
         getViewsSpy.returns({'#view': view});
 
         testRouteObject.renderWith('the-route', mockLayout, 'args');

http://git-wip-us.apache.org/repos/asf/couchdb/blob/2560aeac/src/fauxton/test/test.config.js
----------------------------------------------------------------------
diff --git a/src/fauxton/test/test.config.js b/src/fauxton/test/test.config.js
deleted file mode 100644
index f876bb3..0000000
--- a/src/fauxton/test/test.config.js
+++ /dev/null
@@ -1,71 +0,0 @@
-// vim: set ft=javascript:
-// Set the require.js configuration for your test setup.
-require.config(
-{
-	"paths": {
-		"libs": "../assets/js/libs",
-		"plugins": "../assets/js/plugins",
-		"jquery": "../assets/js/libs/jquery",
-		"lodash": "../assets/js/libs/lodash",
-		"backbone": "../assets/js/libs/backbone",
-		"bootstrap": "../assets/js/libs/bootstrap",
-		"codemirror": "../assets/js/libs/codemirror",
-		"jshint": "../assets/js/libs/jshint",
-		"d3": "../assets/js/libs/d3",
-		"nv.d3": "../assets/js/libs/nv.d3",
-		"chai": "../test/mocha/chai",
-		"sinon-chai": "../test/mocha/sinon-chai",
-		"testUtils": "../test/mocha/testUtils"
-	},
-	"baseUrl": "../app",
-	"shim": {
-		"backbone": {
-			"deps": [
-				"lodash",
-				"jquery"
-			],
-			"exports": "Backbone"
-		},
-		"bootstrap": {
-			"deps": [
-				"jquery"
-			],
-			"exports": "Bootstrap"
-		},
-		"codemirror": {
-			"deps": [
-				"jquery"
-			],
-			"exports": "CodeMirror"
-		},
-		"jshint": {
-			"deps": [
-				"jquery"
-			],
-			"exports": "JSHINT"
-		},
-		"plugins/backbone.layoutmanager": [
-			"backbone"
-		],
-		"plugins/codemirror-javascript": [
-			"codemirror"
-		],
-		"plugins/prettify": [],
-		"plugins/jquery.form": [
-			"jquery"
-		]
-	}
-}
-);
-
-require([
-        
-           '.././test/core/routeObjectSpec.js',
-        
-           '.././app/addons/logs/tests/logSpec.js',
-        
-], function() {
-  if (window.mochaPhantomJS) { mochaPhantomJS.run(); }
-  else { mocha.run(); }
-});
-


[20/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
DB view style updates. Button style updates. Red color updates


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

Branch: refs/heads/1867-feature-plugins
Commit: 95860029749008143f2a8fba169b9548511f1bb5
Parents: 8a1f49e
Author: sean barclay <fu...@hotmail.com>
Authored: Tue Aug 20 07:58:49 2013 -0700
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:43 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js      | 10 ++-
 src/fauxton/app/modules/fauxton/base.js         |  3 +-
 .../app/templates/documents/ddoc_info.html      |  2 +-
 .../app/templates/documents/view_editor.html    | 63 +++++++++--------
 src/fauxton/assets/less/fauxton.less            | 72 ++++++++++++++++++--
 5 files changed, 112 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/95860029/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 71bd4ad..9e1279f 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -21,6 +21,7 @@ define([
        // Libs
        "codemirror",
        "jshint",
+       "resizeColumns",
 
        // Plugins
        "plugins/codemirror-javascript",
@@ -28,7 +29,7 @@ define([
 
 ],
 
-function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint) {
+function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns) {
   var Views = {};
 
   Views.Tabs = FauxtonAPI.View.extend({
@@ -1191,6 +1192,13 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint) {
     },
 
     afterRender: function() {
+
+      //resizeAnimation
+      app.resizeColumns = new resizeColumns({
+            selectorElements: '#dashboard-content, #dashboard-upper-menu, #db-views-tabs-nav'
+      });
+      app.resizeColumns.onResizeHandler();
+
       var that = this, 
           mapFun = this.$("#map-function"),
           reduceFun = this.$("#reduce-function");

http://git-wip-us.apache.org/repos/asf/couchdb/blob/95860029/src/fauxton/app/modules/fauxton/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/fauxton/base.js b/src/fauxton/app/modules/fauxton/base.js
index 2715ab2..0b11849 100644
--- a/src/fauxton/app/modules/fauxton/base.js
+++ b/src/fauxton/app/modules/fauxton/base.js
@@ -23,8 +23,9 @@ function(app, Backbone, resizeColumns) {
 
    //resizeAnimation
    app.resizeColumns = new resizeColumns({
-        selectorElements: '#dashboard-content'
+        selectorElements: '#dashboard-content, #dashboard-upper-menu'
    });
+   app.resizeColumns.onResizeHandler();
 
   var Fauxton = app.module();
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/95860029/src/fauxton/app/templates/documents/ddoc_info.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/ddoc_info.html b/src/fauxton/app/templates/documents/ddoc_info.html
index 508cba3..ed0aed6 100644
--- a/src/fauxton/app/templates/documents/ddoc_info.html
+++ b/src/fauxton/app/templates/documents/ddoc_info.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="well" >
+<div>
   <h2> Design Doc MetaData </h2>
   <div class="row-fluid">
 	<% i=0; _.map(view_index, function (val, key) { %>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/95860029/src/fauxton/app/templates/documents/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/view_editor.html b/src/fauxton/app/templates/documents/view_editor.html
index 4b58e61..9a7c8dd 100644
--- a/src/fauxton/app/templates/documents/view_editor.html
+++ b/src/fauxton/app/templates/documents/view_editor.html
@@ -12,9 +12,9 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 <div class="row">
-  <ul class="nav nav-tabs" id="myTab">
-    <li class="active"> <a data-toggle="tab" href="#index"><i class="icon-wrench"></i> <% if (newView) { %> Create Index <% } else { %> Edit Index <% } %></a></li>
-    <li><a href="#query" data-toggle="tab"> <i class="icon-plus"></i> Advanced Options</a></li>
+  <ul class="nav nav-tabs" id="db-views-tabs-nav">
+    <li class="active"> <a class="fonticon-wrench fonticon" data-toggle="tab" href="#index"><% if (newView) { %>Create Index <% } else { %>Edit Index <% } %></a></li>
+    <li><a class="fonticon-plus fonticon" href="#query" data-toggle="tab">Advanced Options</a></li>
     <li><a href="#metadata" data-toggle="tab">Design Doc Metadata</a></li>
   </ul>
   <div class="all-docs-list errors-container"></div>
@@ -104,10 +104,10 @@ the License.
       </div>
     </div>
     <div class="tab-pane" id="metadata">
-      <div id="ddoc-info"> </div>
+      <div id="ddoc-info" class="well"> </div>
     </div>
     <div class="tab-pane" id="query">
-      <div class="advanced-options">
+      <div class="advanced-options well">
         <form class="view-query-update">
           <div class="controls controls-row">
             <label class="span3 inline">
@@ -145,32 +145,39 @@ the License.
             </label>
             <% } %>
           </div>
-
-          <div class="controls controls-row">
-            <input name="key" class="span4" type="text" placeholder="Key">
-            <input name="keys" class="span8" type="text" placeholder="Keys">
+          <div class="row-fluid">
+            <div class="controls controls-row">
+              <input name="key" class="span6" type="text" placeholder="Key">
+              <input name="keys" class="span6" type="text" placeholder="Keys">
+            </div>
           </div>
-          <div class="controls controls-row">
-            <input name="startkey" class="span6" type="text" placeholder="Start Key">
-            <input name="endkey" class="span6" type="text" placeholder="End Key">
+          <div class="row-fluid">
+            <div class="controls controls-row">
+              <input name="startkey" class="span6" type="text" placeholder="Start Key">
+              <input name="endkey" class="span6" type="text" placeholder="End Key">
+            </div>
           </div>
-          <div class="controls controls-row">
-            <label class="span2 checkbox inline">
-              <input name="stale" type="checkbox" value="ok"> Stale
-            </label>
-            <label class="span2 checkbox inline">
-              <input name="descending" type="checkbox" value="true"> Descending
-            </label>
-            <label class="span4 checkbox inline">
-              <input name="inclusive_end" type="checkbox" value="false"> Disable Inclusive End
-            </label>
-            <label class="span4 checkbox inline">
-              <input name="update_seq" type="checkbox" value="true"> Include Update Sequence
-            </label>
+          <div class="row-fluid">
+            <div class="controls controls-row">
+              <label class="span2 checkbox inline">
+                <input name="stale" type="checkbox" value="ok"> Stale
+              </label>
+              <label class="span2 checkbox inline">
+                <input name="descending" type="checkbox" value="true"> Descending
+              </label>
+              <label class="span4 checkbox inline">
+                <input name="inclusive_end" type="checkbox" value="false"> Disable Inclusive End
+              </label>
+              <label class="span4 checkbox inline">
+                <input name="update_seq" type="checkbox" value="true"> Include Update Sequence
+              </label>
+            </div>
           </div>
-          <div class="controls controls-row">
-            <button type="submit" class="btn btn-primary">Query</button>
-            <button class="btn btn-info preview">Preview</button>
+          <div class="row-fluid">
+            <div class="controls controls-row">
+              <button type="submit" class="btn btn-primary">Query</button>
+              <button class="btn btn-info preview">Preview</button>
+            </div>
           </div>
         </form>
       </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/95860029/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 0b72c6d..d19813f 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -17,6 +17,7 @@
  *
  */
 @import "bootstrap/bootstrap.less";
+@import "bootstrap/mixins.less";
 @import "config.less";
 @import "logs.less";
 @import "prettyprint.less";
@@ -28,8 +29,8 @@
 /*define variable for color here, remove to seperate file later*/
 
 @brown: #3A2C2B;
-@red: #E93F33;
-@darkred: #73161E;
+@red: #E33F3B;
+@darkRed: #AF2D24;
 @linkRed: #DA4F49;
 @greyBrown: #554D4C;
 @fontGrey: #808080;
@@ -40,10 +41,10 @@
 
 /*nav*/
 @primaryNav : @brown;
-@navBG: @darkred;
+@navBG: @darkRed;
 @navBGHighlight: @red;
 @navBGHover: @red;
-@navIconColor: @darkred;
+@navIconColor: @darkRed;
 @navIconHighlight: #FFFFFF;
 @bottomNav: @greyBrown;
 
@@ -73,7 +74,7 @@
 
 /*buttons */
 @redButton: @red;
-@linkColor: @darkred;
+@linkColor: @darkRed;
 
 @boxShadow: 2px 2px rgba(0,0,0,0.2);
 @boxShadowOff: 2px 2px rgba(0,0,0,0);
@@ -121,6 +122,14 @@ body {
     padding-top: 90px;
   }
   background-color: @sidebarBG;
+  /* OVERRIDE BOOTSTRAP BTN STYLES */
+  .btn{
+    .box-shadow(none);
+    .border-radius(0);
+    background-image: none;
+    text-shadow: none;
+    background-repeat: no-repeat;
+  }
 }
 
 h2,h3,h4 {font-weight: 600;}
@@ -455,11 +464,13 @@ footer#mainFooter{
 .topmenu-defaults {
   height: 70px;
   padding: 20px 10px 0;
-  border-bottom: 1px solid @darkred;
+  border-bottom: 1px solid @darkRed;
   .box-sizing(border-box);
 }
 
 #dashboard-upper-menu{
+  position: fixed;
+  z-index: 11;
   .topmenu-defaults;
   background-color: #CBCBCB;
 }
@@ -468,6 +479,15 @@ footer#mainFooter{
   padding: 20px;
   background-color: #F1F1F1;
 }
+
+#dashboard-upper-content{
+  .well{
+    padding: 20px;
+    .border-radius(0);
+    .box-shadow(none);
+  }
+}
+
 #sidenav{
   padding: 0;
   header {
@@ -482,7 +502,7 @@ footer#mainFooter{
         border: none;
       }
       li.active a {
-        background-color: @darkred;
+        background-color: @darkRed;
         color: #fff;
         i {
           background-image: url("../img/glyphicons-halflings-white.png");
@@ -539,6 +559,44 @@ footer#mainFooter{
   margin-right: 36px;
 }
 
+#db-views-tabs-nav{
+  position: fixed;
+  z-index: 12;
+  margin-top: 31px;
+  margin-bottom: 0;
+  /*background-color: #f4f4f4;*/
+  padding: 0 20px;
+}
+
+.nav-tabs > li > a {
+  border-color: #eeeeee #eeeeee #dddddd;
+  text-decoration: none;
+  background-color: #eeeeee;
+  border-radius: 0;
+  border-left: none;
+  border-right: none;
+  &.fonticon:before{
+    margin-right: 6px;
+    font-size: 16px;
+  }
+}
+
+.nav-tabs > li > a:hover, .nav-tabs > li > a:focus {
+  background-color: @linkRed;
+  border-top: 1px solid @red;
+  color: white;
+}
+
+.nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus {
+  color: white;
+  background-color: @darkRed;
+  border: 1px solid @darkRed;
+}
+
+.tab-content {
+  margin-top: 70px;
+}
+
 /*TABLE STYLES*/
 table.databases {clear: both;}
 thead {border-bottom: 2px solid @redButton;}


[30/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: Add active task tests
Also improve testing framework


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

Branch: refs/heads/1867-feature-plugins
Commit: 284c78780d2407134368772a3dba482775e46f2f
Parents: 41203f8
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Aug 21 16:50:35 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:44 2013 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js                        |  12 +-
 .../app/addons/activetasks/tests/viewsSpec.js   | 139 +++++++++++++++++++
 src/fauxton/app/addons/activetasks/views.js     |  41 +++---
 src/fauxton/test/core/layoutSpec.js             |  94 +++++++++++++
 src/fauxton/test/mocha/testUtils.js             |  27 +++-
 src/fauxton/test/runner.html                    |   1 +
 6 files changed, 290 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/284c7878/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 1c58bb6..a548a9d 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -180,8 +180,12 @@ module.exports = function(grunt) {
       index_css: {
         src: ["dist/debug/css/*.css", 'assets/css/*.css'],
         dest: 'dist/debug/css/index.css'
-      }
+      },
 
+      test_config_js: {
+        src: ["dist/debug/templates.js", "test/test.config.js"],
+        dest: 'test/test.config.js'
+      }
     },
 
     cssmin: {
@@ -330,12 +334,12 @@ module.exports = function(grunt) {
 
   // on watch events configure jshint:all to only run on changed file
   grunt.event.on('watch', function(action, filepath) {
-    if (!!filepath.match(/.js$/)) {
+    if (!!filepath.match(/.js$/) && filepath.indexOf('test.config.js') === -1) {
       grunt.config(['jshint', 'all'], filepath);
     }
 
     if (!!filepath.match(/[Ss]pec.js$/)) {
-      grunt.task.run(['mochaSetup','mocha_phantomjs']);
+      grunt.task.run(['mochaSetup','jst', 'concat:test_config_js', 'mocha_phantomjs']);
     }
   });
 
@@ -381,7 +385,7 @@ module.exports = function(grunt) {
    */
   // clean out previous build artefactsa and lint
   grunt.registerTask('lint', ['clean', 'jshint']);
-  grunt.registerTask('test', ['lint', 'mochaSetup', 'mocha_phantomjs']);
+  grunt.registerTask('test', ['lint', 'mochaSetup','jst', 'concat:test_config_js', 'mocha_phantomjs']);
   // Fetch dependencies (from git or local dir), lint them and make load_addons
   grunt.registerTask('dependencies', ['get_deps', 'gen_load_addons:default']);
   // build templates, js and css

http://git-wip-us.apache.org/repos/asf/couchdb/blob/284c7878/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/tests/viewsSpec.js b/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
new file mode 100644
index 0000000..395b60a
--- /dev/null
+++ b/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
@@ -0,0 +1,139 @@
+// 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([
+       'api',
+       'addons/activetasks/views',
+       'addons/activetasks/resources',
+      'testUtils'
+], function (FauxtonAPI, Views, Models, testUtils) {
+  var assert = testUtils.assert,
+      ViewSandbox = testUtils.ViewSandbox;
+  
+  describe("TabMenu", function () {
+    var tabMenu;
+
+    beforeEach(function () {
+      var newtasks = new Models.Tasks({
+        currentView: "all", 
+        id:'activeTasks'
+      });
+
+      tabMenu = new Views.TabMenu({
+        currentView: "all",
+        model: newtasks
+      });
+    });
+
+    describe("on change polling rate", function () {
+      var viewSandbox;
+      beforeEach(function () {
+        viewSandbox = new ViewSandbox();
+        viewSandbox.renderView(tabMenu); 
+      });
+
+      afterEach(function () {
+        viewSandbox.remove();
+      });
+
+      it("Should set polling rate", function () {
+        $range = tabMenu.$('#pollingRange');
+        $range.val(15);
+        $range.trigger('change');
+
+        assert.equal(tabMenu.$('span').text(), 15);
+      });
+
+      it("Should clearInterval", function () {
+        $range = tabMenu.$('#pollingRange');
+        clearIntervalMock = sinon.spy(window,'clearInterval');
+        $range.trigger('change');
+
+        assert.ok(clearIntervalMock.calledOnce);
+
+      });
+
+      it("Should trigger update:poll event", function () {
+        var spy = sinon.spy();
+        Views.Events.on('update:poll', spy);
+        $range = tabMenu.$('#pollingRange');
+        $range.trigger('change');
+
+        assert.ok(spy.calledOnce);
+      });
+
+    });
+
+    describe('on request by type', function () {
+      var viewSandbox;
+      beforeEach(function () {
+        viewSandbox = new ViewSandbox();
+        viewSandbox.renderView(tabMenu); 
+      });
+
+      afterEach(function () {
+        viewSandbox.remove();
+      });
+
+      it("should change model view", function () {
+        var spy = sinon.spy(tabMenu.model, 'changeView');
+        var $rep = tabMenu.$('li[data-type="replication"]');
+        $rep.click();
+        assert.ok(spy.calledOnce);
+      });
+
+      it("should set correct active tab", function () {
+        var spy = sinon.spy(tabMenu.model, 'changeView');
+        var $rep = tabMenu.$('li[data-type="replication"]');
+        $rep.click();
+        assert.ok($rep.hasClass('active'));
+      });
+
+    });
+
+  });
+
+  describe('DataSection', function () {
+    var viewSandbox, dataSection;
+    beforeEach(function () {
+      var newtasks = new Models.Tasks({
+        currentView: "all", 
+        id:'activeTasks'
+      });
+      newtasks.parse([]);
+
+      dataSection = new Views.DataSection({
+        currentView: "all",
+        model: newtasks
+      });
+
+      viewSandbox = new ViewSandbox();
+      viewSandbox.renderView(dataSection); 
+    });
+
+    afterEach(function () {
+      viewSandbox.remove();
+    });
+
+    describe('#setPolling', function () {
+
+      it('Should set polling interval', function () {
+        var spy = sinon.spy(window, 'setInterval');
+        dataSection.setPolling();
+        assert.ok(spy.calledOnce);
+      });
+
+    });
+
+
+
+  });
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/284c7878/src/fauxton/app/addons/activetasks/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/views.js b/src/fauxton/app/addons/activetasks/views.js
index 89feff2..005d487 100644
--- a/src/fauxton/app/addons/activetasks/views.js
+++ b/src/fauxton/app/addons/activetasks/views.js
@@ -26,7 +26,7 @@ function (app, FauxtonAPI, activetasks) {
       };
 
 
-  _.extend(Events, Backbone.Events);
+  Views.Events = _.extend(Events, Backbone.Events);
 
   Views.TabMenu = FauxtonAPI.View.extend({
     template: "addons/activetasks/templates/tabs",
@@ -43,11 +43,11 @@ function (app, FauxtonAPI, activetasks) {
       };
     },
     afterRender: function(){
-      $('.task-tabs').find('li').eq(0).addClass('active');
+      this.$('.task-tabs').find('li').eq(0).addClass('active');
     },
     changePollInterval: function(e){
-      var range = $(e.currentTarget).val();
-      $('label[for="pollingRange"] span').text(range);
+      var range = this.$(e.currentTarget).val();
+      this.$('label[for="pollingRange"] span').text(range);
       pollingInfo.rate = range;
       clearInterval(pollingInfo.intervalId);
       Events.trigger('update:poll');
@@ -59,33 +59,30 @@ function (app, FauxtonAPI, activetasks) {
 
     requestByType: function(e){
       var currentTarget = e.currentTarget;
-      datatype = $(currentTarget).attr("data-type");
+      datatype = this.$(currentTarget).attr("data-type");
 
-      $('.task-tabs').find('li').removeClass('active');
-      $(currentTarget).addClass('active');
+      this.$('.task-tabs').find('li').removeClass('active');
+      this.$(currentTarget).addClass('active');
       this.model.changeView(datatype);
     }
   });
 
   Views.DataSection = FauxtonAPI.View.extend({
     showData: function(){
-      var that = this,
-      currentData = this.model.getCurrentViewData();
-      //remove the old stuff in a nice clean way
+      var currentData = this.model.getCurrentViewData();
+
       if (this.dataView) {
-        this.dataView.remove();
+       this.dataView.update(currentData, this.model.get('currentView').replace('_',' '));
+      } else {
+        this.dataView = this.insertView( new Views.TableData({ 
+          collection: currentData,
+          currentView: this.model.get('currentView').replace('_',' ')
+        }));
       }
-
-      //add the new stuff
-      this.dataView = that.insertView( new Views.TableData({ 
-        collection: currentData,
-        currentView: this.model.get('currentView').replace('_',' ')
-      }));
-
     },
     showDataAndRender: function () {
       this.showData();
-      this.render();
+      this.dataView.render();
     },
 
     beforeRender: function () {
@@ -133,6 +130,12 @@ function (app, FauxtonAPI, activetasks) {
         collection: this.collection
       };
     },
+
+    update: function (collection, currentView) {
+      this.collection = collection;
+      this.currentView = currentView;
+    },
+
     beforeRender: function(){
       //iterate over the collection to add each
       this.collection.forEach(function(item) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/284c7878/src/fauxton/test/core/layoutSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/test/core/layoutSpec.js b/src/fauxton/test/core/layoutSpec.js
new file mode 100644
index 0000000..3876b70
--- /dev/null
+++ b/src/fauxton/test/core/layoutSpec.js
@@ -0,0 +1,94 @@
+// 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([
+       'modules/fauxton/layout',
+      'testUtils'
+], function (Layout, testUtils) {
+  var assert = testUtils.assert;
+
+  describe("Faxuton Layout", function () {
+    var layout;
+
+    beforeEach(function () {
+      var navBar = new Backbone.View();
+      var apiBar = new Backbone.View();
+      layout = new Layout(navBar, apiBar);
+    });
+
+    describe('#setTemplate', function () {
+
+      it("Should set template without prefix", function () {
+        layout.setTemplate('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.layout.template, 'myPrefix/myTemplate');
+      });
+
+      it("Should remove old views", function () {
+        var view = {
+          remove: function () {}
+        };
+
+        layout.layoutViews = {
+          'selector': view
+        };
+
+        var mockRemove = sinon.spy(view, 'remove');
+        layout.setTemplate('myTemplate');
+        assert.ok(mockRemove.calledOnce);
+
+      });
+
+      it("Should render", function () {
+        var mockRender = sinon.spy(layout, 'render');
+
+        layout.setTemplate('myTemplate');
+
+        assert.ok(mockRender.calledOnce);
+
+      });
+
+    });
+
+    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/blob/284c7878/src/fauxton/test/mocha/testUtils.js
----------------------------------------------------------------------
diff --git a/src/fauxton/test/mocha/testUtils.js b/src/fauxton/test/mocha/testUtils.js
index 08b46de..3eb1118 100644
--- a/src/fauxton/test/mocha/testUtils.js
+++ b/src/fauxton/test/mocha/testUtils.js
@@ -13,13 +13,38 @@
 define([
        "chai",
        "sinon-chai",
+       "underscore"
 ],
 function(chai, sinonChai) {
   chai.use(sinonChai);
 
+  var ViewSandbox = function () {
+    this.initialize();
+  };
+   
+   _.extend(ViewSandbox.prototype, {
+    initialize: function () {
+      this.$el = $('<div></div>');
+      this.$ = this.$el.find;
+    },
+    views: [],
+    renderView: function (view) {
+      this.views.push(view);
+      this.$el.append(view.el);
+      view.render();
+    },
+
+    remove: function () {
+      _.each(this.views, function (view) {
+        view.remove();
+      }, this);
+    }
+  });
+
   return {
     chai: chai,
-    assert: chai.assert
+    assert: chai.assert,
+    ViewSandbox: ViewSandbox
   };
 });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/284c7878/src/fauxton/test/runner.html
----------------------------------------------------------------------
diff --git a/src/fauxton/test/runner.html b/src/fauxton/test/runner.html
index b86855e..b27fdda 100644
--- a/src/fauxton/test/runner.html
+++ b/src/fauxton/test/runner.html
@@ -11,6 +11,7 @@
     <script type="text/javascript">
       // MOCHA SETUP
       mocha.setup('bdd');
+      mocha.reporter('html');
     </script>
     <script data-main="./test.config.js" src="../assets/js/libs/require.js"></script>
   </body>


[49/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
fix addon template, s/route/routes/.js


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

Branch: refs/heads/1867-feature-plugins
Commit: f5cd4b3f79dc395341cf8e0ed5b14a35b2a6fa72
Parents: f44dd92
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Sep 9 11:12:36 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:52:24 2013 +0200

----------------------------------------------------------------------
 src/fauxton/tasks/addon/rename.json             |  2 +-
 .../tasks/addon/root/route.js.underscore        | 21 --------------------
 .../tasks/addon/root/routes.js.underscore       | 21 ++++++++++++++++++++
 3 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f5cd4b3f/src/fauxton/tasks/addon/rename.json
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/addon/rename.json b/src/fauxton/tasks/addon/rename.json
index 1f326e9..046ca50 100644
--- a/src/fauxton/tasks/addon/rename.json
+++ b/src/fauxton/tasks/addon/rename.json
@@ -1,5 +1,5 @@
 {
-  "route.js.underscore": "{%= path %}/{%= name.toLowerCase() %}/route.js",
+  "routes.js.underscore": "{%= path %}/{%= name.toLowerCase() %}/routes.js",
   "resources.js.underscore": "{%= path %}/{%= name.toLowerCase() %}/resources.js",
   "base.js.underscore": "{%= path %}/{%= name.toLowerCase() %}/base.js"
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f5cd4b3f/src/fauxton/tasks/addon/root/route.js.underscore
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/addon/root/route.js.underscore b/src/fauxton/tasks/addon/root/route.js.underscore
deleted file mode 100644
index 859e5bb..0000000
--- a/src/fauxton/tasks/addon/root/route.js.underscore
+++ /dev/null
@@ -1,21 +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/{%= name.toLowerCase() %}/resources"
-],
-function(app, FauxtonAPI, {%= name %}) {
-  {%= name %}.Routes = {};
-  return {%= name %};
-});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f5cd4b3f/src/fauxton/tasks/addon/root/routes.js.underscore
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/addon/root/routes.js.underscore b/src/fauxton/tasks/addon/root/routes.js.underscore
new file mode 100644
index 0000000..859e5bb
--- /dev/null
+++ b/src/fauxton/tasks/addon/root/routes.js.underscore
@@ -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.
+
+define([
+  "app",
+  "api",
+  "addons/{%= name.toLowerCase() %}/resources"
+],
+function(app, FauxtonAPI, {%= name %}) {
+  {%= name %}.Routes = {};
+  return {%= name %};
+});


[15/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: fix establish and error notification issue
I've implemented a clean of an old route object's views as it seemed
that if an error occurs on the establish of a route object not all
the views were getting garbage collected.

fixes #COUCHDB-1873


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

Branch: refs/heads/1867-feature-plugins
Commit: 1cf161285555a0d7f7d2a5a64e398dd9d071d710
Parents: 5962904
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Aug 21 11:04:26 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:43 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/api.js    | 18 +++++++++++++++---
 src/fauxton/app/router.js |  5 ++++-
 2 files changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/1cf16128/src/fauxton/app/api.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/api.js b/src/fauxton/app/api.js
index 0a2351d..5cf59a2 100644
--- a/src/fauxton/app/api.js
+++ b/src/fauxton/app/api.js
@@ -295,7 +295,7 @@ function(app, Fauxton) {
          $('.spinner').append(routeObjectSpinner.el);
        }
 
-      FauxtonAPI.when(this.establish()).done(function(resp) {
+      FauxtonAPI.when(this.establish()).then(function(resp) {
         _.each(routeObject.getViews(), function(view, selector) {
           if(view.hasRendered) { return; }
 
@@ -336,7 +336,7 @@ function(app, Fauxton) {
               };
 
               FauxtonAPI.addNotification({
-                msg: 'An Error occurred ' + resp,
+                msg: 'An Error occurred ' + resp.responseText,
                 type: 'error' 
               });
               masterLayout.renderView(selector);
@@ -351,7 +351,12 @@ function(app, Fauxton) {
             }
           });
         });
-      }.bind(this));
+      }.bind(this), function (resp) {
+          FauxtonAPI.addNotification({
+                msg: 'An Error occurred ' + resp.responseText,
+                type: 'error' 
+          });
+      });
 
       if (this.get('apiUrl')) masterLayout.apiBar.update(this.get('apiUrl'));
 
@@ -394,6 +399,13 @@ function(app, Fauxton) {
       return this.views;
     },
 
+    removeViews: function () {
+      _.each(this.views, function (view, selector) {
+        view.remove();
+        delete this.views[selector];
+      }, this);
+    },
+
     getRouteUrls: function () {
       return _.keys(this.get('routes'));
     },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1cf16128/src/fauxton/app/router.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/router.js b/src/fauxton/app/router.js
index c12d951..509cff4 100644
--- a/src/fauxton/app/router.js
+++ b/src/fauxton/app/router.js
@@ -51,7 +51,7 @@ function(req, app, Initialize, FauxtonAPI, Fauxton, Layout, Databases, Documents
     routes: {},
 
     addModuleRouteObject: function(RouteObject) {
-      var that = this; //change that to that
+      var that = this;
       var masterLayout = this.masterLayout,
       routeUrls = RouteObject.prototype.getRouteUrls();
 
@@ -63,6 +63,9 @@ function(req, app, Initialize, FauxtonAPI, Fauxton, Layout, Databases, Documents
 
           authPromise.then(function () {
             if (!that.activeRouteObject || !that.activeRouteObject.hasRoute(route)) {
+              if (that.activeRouteObject) {
+                that.activeRouteObject.removeViews();
+              }
               that.activeRouteObject = new RouteObject(route, masterLayout, args);
             }
 


[16/50] [abbrv] Fauxton: update jquery to 1.10.2

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/59629049/src/fauxton/assets/js/libs/jquery.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/jquery.js b/src/fauxton/assets/js/libs/jquery.js
index e2c203f..c5c6482 100644
--- a/src/fauxton/assets/js/libs/jquery.js
+++ b/src/fauxton/assets/js/libs/jquery.js
@@ -1,15 +1,15 @@
 /*!
- * jQuery JavaScript Library v1.9.1
+ * jQuery JavaScript Library v1.10.2
  * http://jquery.com/
  *
  * Includes Sizzle.js
  * http://sizzlejs.com/
  *
- * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
+ * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
  * Released under the MIT license
  * http://jquery.org/license
  *
- * Date: 2013-2-4
+ * Date: 2013-07-03T13:48Z
  */
 (function( window, undefined ) {
 
@@ -25,13 +25,14 @@ var
 	// A central reference to the root jQuery(document)
 	rootjQuery,
 
-	// Support: IE<9
-	// For `typeof node.method` instead of `node.method !== undefined`
+	// Support: IE<10
+	// For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
 	core_strundefined = typeof undefined,
 
 	// Use the correct document accordingly with window argument (sandbox)
-	document = window.document,
 	location = window.location,
+	document = window.document,
+	docElem = document.documentElement,
 
 	// Map over jQuery in case of overwrite
 	_jQuery = window.jQuery,
@@ -45,7 +46,7 @@ var
 	// List of deleted data cache ids, so we can reuse them
 	core_deletedIds = [],
 
-	core_version = "1.9.1",
+	core_version = "1.10.2",
 
 	// Save a reference to some core methods
 	core_concat = core_deletedIds.concat,
@@ -74,7 +75,7 @@ var
 	// A simple way to check for HTML strings
 	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
 	// Strict HTML recognition (#11290: must start with <)
-	rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+	rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
 
 	// Match a standalone tag
 	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
@@ -227,11 +228,6 @@ jQuery.fn = jQuery.prototype = {
 	// The default length of a jQuery object is 0
 	length: 0,
 
-	// The number of elements contained in the matched element set
-	size: function() {
-		return this.length;
-	},
-
 	toArray: function() {
 		return core_slice.call( this );
 	},
@@ -380,6 +376,10 @@ jQuery.extend = jQuery.fn.extend = function() {
 };
 
 jQuery.extend({
+	// Unique for each copy of jQuery on the page
+	// Non-digits removed to match rinlinejQuery
+	expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
+
 	noConflict: function( deep ) {
 		if ( window.$ === jQuery ) {
 			window.$ = _$;
@@ -450,6 +450,7 @@ jQuery.extend({
 	},
 
 	isWindow: function( obj ) {
+		/* jshint eqeqeq: false */
 		return obj != null && obj == obj.window;
 	},
 
@@ -467,6 +468,8 @@ jQuery.extend({
 	},
 
 	isPlainObject: function( obj ) {
+		var key;
+
 		// Must be an Object.
 		// Because of IE, we also have to check the presence of the constructor property.
 		// Make sure that DOM nodes and window objects don't pass through, as well
@@ -486,10 +489,16 @@ jQuery.extend({
 			return false;
 		}
 
+		// Support: IE<9
+		// Handle iteration over inherited properties before own properties.
+		if ( jQuery.support.ownLast ) {
+			for ( key in obj ) {
+				return core_hasOwn.call( obj, key );
+			}
+		}
+
 		// Own properties are enumerated firstly, so to speed up,
 		// if last one is own, then all properties are own.
-
-		var key;
 		for ( key in obj ) {}
 
 		return key === undefined || core_hasOwn.call( obj, key );
@@ -879,6 +888,29 @@ jQuery.extend({
 
 	now: function() {
 		return ( new Date() ).getTime();
+	},
+
+	// A method for quickly swapping in/out CSS properties to get correct calculations.
+	// Note: this method belongs to the css module but it's needed here for the support module.
+	// If support gets modularized, this method should be moved back to the css module.
+	swap: function( elem, options, callback, args ) {
+		var ret, name,
+			old = {};
+
+		// Remember the old values, and insert the new ones
+		for ( name in options ) {
+			old[ name ] = elem.style[ name ];
+			elem.style[ name ] = options[ name ];
+		}
+
+		ret = callback.apply( elem, args || [] );
+
+		// Revert the old values
+		for ( name in options ) {
+			elem.style[ name ] = old[ name ];
+		}
+
+		return ret;
 	}
 });
 
@@ -967,4585 +999,4707 @@ function isArraylike( obj ) {
 
 // All jQuery objects should point back to these
 rootjQuery = jQuery(document);
-// String to Object options format cache
-var optionsCache = {};
-
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
-	var object = optionsCache[ options ] = {};
-	jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
-		object[ flag ] = true;
-	});
-	return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- *	options: an optional list of space-separated options that will change how
- *			the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- *	once:			will ensure the callback list can only be fired once (like a Deferred)
- *
- *	memory:			will keep track of previous values and will call any callback added
- *					after the list has been fired right away with the latest "memorized"
- *					values (like a Deferred)
- *
- *	unique:			will ensure a callback can only be added once (no duplicate in the list)
+/*!
+ * Sizzle CSS Selector Engine v1.10.2
+ * http://sizzlejs.com/
  *
- *	stopOnFalse:	interrupt callings when a callback returns false
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
  *
+ * Date: 2013-07-03
  */
-jQuery.Callbacks = function( options ) {
-
-	// Convert options from String-formatted to Object-formatted if needed
-	// (we check in cache first)
-	options = typeof options === "string" ?
-		( optionsCache[ options ] || createOptions( options ) ) :
-		jQuery.extend( {}, options );
+(function( window, undefined ) {
 
-	var // Flag to know if list is currently firing
-		firing,
-		// Last fire value (for non-forgettable lists)
-		memory,
-		// Flag to know if list was already fired
-		fired,
-		// End of the loop when firing
-		firingLength,
-		// Index of currently firing callback (modified by remove if needed)
-		firingIndex,
-		// First callback to fire (used internally by add and fireWith)
-		firingStart,
-		// Actual callback list
-		list = [],
-		// Stack of fire calls for repeatable lists
-		stack = !options.once && [],
-		// Fire callbacks
-		fire = function( data ) {
-			memory = options.memory && data;
-			fired = true;
-			firingIndex = firingStart || 0;
-			firingStart = 0;
-			firingLength = list.length;
-			firing = true;
-			for ( ; list && firingIndex < firingLength; firingIndex++ ) {
-				if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
-					memory = false; // To prevent further calls using add
-					break;
-				}
-			}
-			firing = false;
-			if ( list ) {
-				if ( stack ) {
-					if ( stack.length ) {
-						fire( stack.shift() );
-					}
-				} else if ( memory ) {
-					list = [];
-				} else {
-					self.disable();
-				}
-			}
-		},
-		// Actual Callbacks object
-		self = {
-			// Add a callback or a collection of callbacks to the list
-			add: function() {
-				if ( list ) {
-					// First, we save the current length
-					var start = list.length;
-					(function add( args ) {
-						jQuery.each( args, function( _, arg ) {
-							var type = jQuery.type( arg );
-							if ( type === "function" ) {
-								if ( !options.unique || !self.has( arg ) ) {
-									list.push( arg );
-								}
-							} else if ( arg && arg.length && type !== "string" ) {
-								// Inspect recursively
-								add( arg );
-							}
-						});
-					})( arguments );
-					// Do we need to add the callbacks to the
-					// current firing batch?
-					if ( firing ) {
-						firingLength = list.length;
-					// With memory, if we're not firing then
-					// we should call right away
-					} else if ( memory ) {
-						firingStart = start;
-						fire( memory );
-					}
-				}
-				return this;
-			},
-			// Remove a callback from the list
-			remove: function() {
-				if ( list ) {
-					jQuery.each( arguments, function( _, arg ) {
-						var index;
-						while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
-							list.splice( index, 1 );
-							// Handle firing indexes
-							if ( firing ) {
-								if ( index <= firingLength ) {
-									firingLength--;
-								}
-								if ( index <= firingIndex ) {
-									firingIndex--;
-								}
-							}
-						}
-					});
-				}
-				return this;
-			},
-			// Check if a given callback is in the list.
-			// If no argument is given, return whether or not list has callbacks attached.
-			has: function( fn ) {
-				return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
-			},
-			// Remove all callbacks from the list
-			empty: function() {
-				list = [];
-				return this;
-			},
-			// Have the list do nothing anymore
-			disable: function() {
-				list = stack = memory = undefined;
-				return this;
-			},
-			// Is it disabled?
-			disabled: function() {
-				return !list;
-			},
-			// Lock the list in its current state
-			lock: function() {
-				stack = undefined;
-				if ( !memory ) {
-					self.disable();
-				}
-				return this;
-			},
-			// Is it locked?
-			locked: function() {
-				return !stack;
-			},
-			// Call all callbacks with the given context and arguments
-			fireWith: function( context, args ) {
-				args = args || [];
-				args = [ context, args.slice ? args.slice() : args ];
-				if ( list && ( !fired || stack ) ) {
-					if ( firing ) {
-						stack.push( args );
-					} else {
-						fire( args );
-					}
-				}
-				return this;
-			},
-			// Call all the callbacks with the given arguments
-			fire: function() {
-				self.fireWith( this, arguments );
-				return this;
-			},
-			// To know if the callbacks have already been called at least once
-			fired: function() {
-				return !!fired;
-			}
-		};
+var i,
+	support,
+	cachedruns,
+	Expr,
+	getText,
+	isXML,
+	compile,
+	outermostContext,
+	sortInput,
 
-	return self;
-};
-jQuery.extend({
+	// Local document vars
+	setDocument,
+	document,
+	docElem,
+	documentIsHTML,
+	rbuggyQSA,
+	rbuggyMatches,
+	matches,
+	contains,
 
-	Deferred: function( func ) {
-		var tuples = [
-				// action, add listener, listener list, final state
-				[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
-				[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
-				[ "notify", "progress", jQuery.Callbacks("memory") ]
-			],
-			state = "pending",
-			promise = {
-				state: function() {
-					return state;
-				},
-				always: function() {
-					deferred.done( arguments ).fail( arguments );
-					return this;
-				},
-				then: function( /* fnDone, fnFail, fnProgress */ ) {
-					var fns = arguments;
-					return jQuery.Deferred(function( newDefer ) {
-						jQuery.each( tuples, function( i, tuple ) {
-							var action = tuple[ 0 ],
-								fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
-							// deferred[ done | fail | progress ] for forwarding actions to newDefer
-							deferred[ tuple[1] ](function() {
-								var returned = fn && fn.apply( this, arguments );
-								if ( returned && jQuery.isFunction( returned.promise ) ) {
-									returned.promise()
-										.done( newDefer.resolve )
-										.fail( newDefer.reject )
-										.progress( newDefer.notify );
-								} else {
-									newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
-								}
-							});
-						});
-						fns = null;
-					}).promise();
-				},
-				// Get a promise for this deferred
-				// If obj is provided, the promise aspect is added to the object
-				promise: function( obj ) {
-					return obj != null ? jQuery.extend( obj, promise ) : promise;
-				}
-			},
-			deferred = {};
-
-		// Keep pipe for back-compat
-		promise.pipe = promise.then;
+	// Instance-specific data
+	expando = "sizzle" + -(new Date()),
+	preferredDoc = window.document,
+	dirruns = 0,
+	done = 0,
+	classCache = createCache(),
+	tokenCache = createCache(),
+	compilerCache = createCache(),
+	hasDuplicate = false,
+	sortOrder = function( a, b ) {
+		if ( a === b ) {
+			hasDuplicate = true;
+			return 0;
+		}
+		return 0;
+	},
 
-		// Add list-specific methods
-		jQuery.each( tuples, function( i, tuple ) {
-			var list = tuple[ 2 ],
-				stateString = tuple[ 3 ];
+	// General-purpose constants
+	strundefined = typeof undefined,
+	MAX_NEGATIVE = 1 << 31,
 
-			// promise[ done | fail | progress ] = list.add
-			promise[ tuple[1] ] = list.add;
+	// Instance methods
+	hasOwn = ({}).hasOwnProperty,
+	arr = [],
+	pop = arr.pop,
+	push_native = arr.push,
+	push = arr.push,
+	slice = arr.slice,
+	// Use a stripped-down indexOf if we can't use a native one
+	indexOf = arr.indexOf || function( elem ) {
+		var i = 0,
+			len = this.length;
+		for ( ; i < len; i++ ) {
+			if ( this[i] === elem ) {
+				return i;
+			}
+		}
+		return -1;
+	},
 
-			// Handle state
-			if ( stateString ) {
-				list.add(function() {
-					// state = [ resolved | rejected ]
-					state = stateString;
+	booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
 
-				// [ reject_list | resolve_list ].disable; progress_list.lock
-				}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
-			}
+	// Regular expressions
 
-			// deferred[ resolve | reject | notify ]
-			deferred[ tuple[0] ] = function() {
-				deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
-				return this;
-			};
-			deferred[ tuple[0] + "With" ] = list.fireWith;
-		});
+	// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+	whitespace = "[\\x20\\t\\r\\n\\f]",
+	// http://www.w3.org/TR/css3-syntax/#characters
+	characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
 
-		// Make the deferred a promise
-		promise.promise( deferred );
+	// Loosely modeled on CSS identifier characters
+	// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+	// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+	identifier = characterEncoding.replace( "w", "w#" ),
 
-		// Call given func if any
-		if ( func ) {
-			func.call( deferred, deferred );
-		}
+	// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
+	attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+		"*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
 
-		// All done!
-		return deferred;
-	},
+	// Prefer arguments quoted,
+	//   then not containing pseudos/brackets,
+	//   then attribute selectors/non-parenthetical expressions,
+	//   then anything else
+	// These preferences are here to reduce the number of selectors
+	//   needing tokenize in the PSEUDO preFilter
+	pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
 
-	// Deferred helper
-	when: function( subordinate /* , ..., subordinateN */ ) {
-		var i = 0,
-			resolveValues = core_slice.call( arguments ),
-			length = resolveValues.length,
+	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
 
-			// the count of uncompleted subordinates
-			remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+	rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
 
-			// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
-			deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+	rsibling = new RegExp( whitespace + "*[+~]" ),
+	rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
 
-			// Update function for both resolve and progress values
-			updateFunc = function( i, contexts, values ) {
-				return function( value ) {
-					contexts[ i ] = this;
-					values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
-					if( values === progressValues ) {
-						deferred.notifyWith( contexts, values );
-					} else if ( !( --remaining ) ) {
-						deferred.resolveWith( contexts, values );
-					}
-				};
-			},
+	rpseudo = new RegExp( pseudos ),
+	ridentifier = new RegExp( "^" + identifier + "$" ),
 
-			progressValues, progressContexts, resolveContexts;
+	matchExpr = {
+		"ID": new RegExp( "^#(" + characterEncoding + ")" ),
+		"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+		"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+		"ATTR": new RegExp( "^" + attributes ),
+		"PSEUDO": new RegExp( "^" + pseudos ),
+		"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+			"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+			"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+		"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+		// For use in libraries implementing .is()
+		// We use this for POS matching in `select`
+		"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+			whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+	},
 
-		// add listeners to Deferred subordinates; treat others as resolved
-		if ( length > 1 ) {
-			progressValues = new Array( length );
-			progressContexts = new Array( length );
-			resolveContexts = new Array( length );
-			for ( ; i < length; i++ ) {
-				if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
-					resolveValues[ i ].promise()
-						.done( updateFunc( i, resolveContexts, resolveValues ) )
-						.fail( deferred.reject )
-						.progress( updateFunc( i, progressContexts, progressValues ) );
-				} else {
-					--remaining;
-				}
-			}
-		}
+	rnative = /^[^{]+\{\s*\[native \w/,
 
-		// if we're not waiting on anything, resolve the master
-		if ( !remaining ) {
-			deferred.resolveWith( resolveContexts, resolveValues );
-		}
+	// Easily-parseable/retrievable ID or TAG or CLASS selectors
+	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
 
-		return deferred.promise();
-	}
-});
-jQuery.support = (function() {
+	rinputs = /^(?:input|select|textarea|button)$/i,
+	rheader = /^h\d$/i,
 
-	var support, all, a,
-		input, select, fragment,
-		opt, eventName, isSupported, i,
-		div = document.createElement("div");
+	rescape = /'|\\/g,
 
-	// Setup
-	div.setAttribute( "className", "t" );
-	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+	// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+	runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+	funescape = function( _, escaped, escapedWhitespace ) {
+		var high = "0x" + escaped - 0x10000;
+		// NaN means non-codepoint
+		// Support: Firefox
+		// Workaround erroneous numeric interpretation of +"0x"
+		return high !== high || escapedWhitespace ?
+			escaped :
+			// BMP codepoint
+			high < 0 ?
+				String.fromCharCode( high + 0x10000 ) :
+				// Supplemental Plane codepoint (surrogate pair)
+				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+	};
 
-	// Support tests won't run in some limited or non-browser environments
-	all = div.getElementsByTagName("*");
-	a = div.getElementsByTagName("a")[ 0 ];
-	if ( !all || !a || !all.length ) {
-		return {};
-	}
+// Optimize for push.apply( _, NodeList )
+try {
+	push.apply(
+		(arr = slice.call( preferredDoc.childNodes )),
+		preferredDoc.childNodes
+	);
+	// Support: Android<4.0
+	// Detect silently failing push.apply
+	arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+	push = { apply: arr.length ?
 
-	// First batch of tests
-	select = document.createElement("select");
-	opt = select.appendChild( document.createElement("option") );
-	input = div.getElementsByTagName("input")[ 0 ];
+		// Leverage slice if possible
+		function( target, els ) {
+			push_native.apply( target, slice.call(els) );
+		} :
 
-	a.style.cssText = "top:1px;float:left;opacity:.5";
-	support = {
-		// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-		getSetAttribute: div.className !== "t",
-
-		// IE strips leading whitespace when .innerHTML is used
-		leadingWhitespace: div.firstChild.nodeType === 3,
-
-		// Make sure that tbody elements aren't automatically inserted
-		// IE will insert them into empty tables
-		tbody: !div.getElementsByTagName("tbody").length,
-
-		// Make sure that link elements get serialized correctly by innerHTML
-		// This requires a wrapper element in IE
-		htmlSerialize: !!div.getElementsByTagName("link").length,
-
-		// Get the style information from getAttribute
-		// (IE uses .cssText instead)
-		style: /top/.test( a.getAttribute("style") ),
-
-		// Make sure that URLs aren't manipulated
-		// (IE normalizes it by default)
-		hrefNormalized: a.getAttribute("href") === "/a",
-
-		// Make sure that element opacity exists
-		// (IE uses filter instead)
-		// Use a regex to work around a WebKit issue. See #5145
-		opacity: /^0.5/.test( a.style.opacity ),
-
-		// Verify style float existence
-		// (IE uses styleFloat instead of cssFloat)
-		cssFloat: !!a.style.cssFloat,
-
-		// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
-		checkOn: !!input.value,
-
-		// Make sure that a selected-by-default option has a working selected property.
-		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
-		optSelected: opt.selected,
-
-		// Tests for enctype support on a form (#6743)
-		enctype: !!document.createElement("form").enctype,
-
-		// Makes sure cloning an html5 element does not cause problems
-		// Where outerHTML is undefined, this still works
-		html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
-
-		// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
-		boxModel: document.compatMode === "CSS1Compat",
-
-		// Will be defined later
-		deleteExpando: true,
-		noCloneEvent: true,
-		inlineBlockNeedsLayout: false,
-		shrinkWrapBlocks: false,
-		reliableMarginRight: true,
-		boxSizingReliable: true,
-		pixelPosition: false
+		// Support: IE<9
+		// Otherwise append directly
+		function( target, els ) {
+			var j = target.length,
+				i = 0;
+			// Can't trust NodeList.length
+			while ( (target[j++] = els[i++]) ) {}
+			target.length = j - 1;
+		}
 	};
+}
 
-	// Make sure checked status is properly cloned
-	input.checked = true;
-	support.noCloneChecked = input.cloneNode( true ).checked;
-
-	// Make sure that the options inside disabled selects aren't marked as disabled
-	// (WebKit marks them as disabled)
-	select.disabled = true;
-	support.optDisabled = !opt.disabled;
+function Sizzle( selector, context, results, seed ) {
+	var match, elem, m, nodeType,
+		// QSA vars
+		i, groups, old, nid, newContext, newSelector;
 
-	// Support: IE<9
-	try {
-		delete div.test;
-	} catch( e ) {
-		support.deleteExpando = false;
+	if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+		setDocument( context );
 	}
 
-	// Check if we can trust getAttribute("value")
-	input = document.createElement("input");
-	input.setAttribute( "value", "" );
-	support.input = input.getAttribute( "value" ) === "";
+	context = context || document;
+	results = results || [];
 
-	// Check if an input maintains its value after becoming a radio
-	input.value = "t";
-	input.setAttribute( "type", "radio" );
-	support.radioValue = input.value === "t";
+	if ( !selector || typeof selector !== "string" ) {
+		return results;
+	}
 
-	// #11217 - WebKit loses check when the name is after the checked attribute
-	input.setAttribute( "checked", "t" );
-	input.setAttribute( "name", "t" );
+	if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+		return [];
+	}
 
-	fragment = document.createDocumentFragment();
-	fragment.appendChild( input );
+	if ( documentIsHTML && !seed ) {
 
-	// Check if a disconnected checkbox will retain its checked
-	// value of true after appended to the DOM (IE6/7)
-	support.appendChecked = input.checked;
-
-	// WebKit doesn't clone checked state correctly in fragments
-	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-	// Support: IE<9
-	// Opera does not clone events (and typeof div.attachEvent === undefined).
-	// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
-	if ( div.attachEvent ) {
-		div.attachEvent( "onclick", function() {
-			support.noCloneEvent = false;
-		});
-
-		div.cloneNode( true ).click();
-	}
-
-	// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
-	// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
-	for ( i in { submit: true, change: true, focusin: true }) {
-		div.setAttribute( eventName = "on" + i, "t" );
-
-		support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
-	}
-
-	div.style.backgroundClip = "content-box";
-	div.cloneNode( true ).style.backgroundClip = "";
-	support.clearCloneStyle = div.style.backgroundClip === "content-box";
+		// Shortcuts
+		if ( (match = rquickExpr.exec( selector )) ) {
+			// Speed-up: Sizzle("#ID")
+			if ( (m = match[1]) ) {
+				if ( nodeType === 9 ) {
+					elem = context.getElementById( m );
+					// Check parentNode to catch when Blackberry 4.6 returns
+					// nodes that are no longer in the document #6963
+					if ( elem && elem.parentNode ) {
+						// Handle the case where IE, Opera, and Webkit return items
+						// by name instead of ID
+						if ( elem.id === m ) {
+							results.push( elem );
+							return results;
+						}
+					} else {
+						return results;
+					}
+				} else {
+					// Context is not a document
+					if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+						contains( context, elem ) && elem.id === m ) {
+						results.push( elem );
+						return results;
+					}
+				}
 
-	// Run tests that need a body at doc ready
-	jQuery(function() {
-		var container, marginDiv, tds,
-			divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
-			body = document.getElementsByTagName("body")[0];
+			// Speed-up: Sizzle("TAG")
+			} else if ( match[2] ) {
+				push.apply( results, context.getElementsByTagName( selector ) );
+				return results;
 
-		if ( !body ) {
-			// Return for frameset docs that don't have a body
-			return;
+			// Speed-up: Sizzle(".CLASS")
+			} else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+				push.apply( results, context.getElementsByClassName( m ) );
+				return results;
+			}
 		}
 
-		container = document.createElement("div");
-		container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
-
-		body.appendChild( container ).appendChild( div );
-
-		// Support: IE8
-		// Check if table cells still have offsetWidth/Height when they are set
-		// to display:none and there are still other visible table cells in a
-		// table row; if so, offsetWidth/Height are not reliable for use when
-		// determining if an element has been hidden directly using
-		// display:none (it is still safe to use offsets if a parent element is
-		// hidden; don safety goggles and see bug #4512 for more information).
-		div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
-		tds = div.getElementsByTagName("td");
-		tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
-		isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
-		tds[ 0 ].style.display = "";
-		tds[ 1 ].style.display = "none";
-
-		// Support: IE8
-		// Check if empty table cells still have offsetWidth/Height
-		support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
-		// Check box-sizing and margin behavior
-		div.innerHTML = "";
-		div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
-		support.boxSizing = ( div.offsetWidth === 4 );
-		support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
-
-		// Use window.getComputedStyle because jsdom on node.js will break without it.
-		if ( window.getComputedStyle ) {
-			support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
-			support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
-
-			// Check if div with explicit width and no margin-right incorrectly
-			// gets computed margin-right based on width of container. (#3333)
-			// Fails in WebKit before Feb 2011 nightlies
-			// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-			marginDiv = div.appendChild( document.createElement("div") );
-			marginDiv.style.cssText = div.style.cssText = divReset;
-			marginDiv.style.marginRight = marginDiv.style.width = "0";
-			div.style.width = "1px";
+		// QSA path
+		if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+			nid = old = expando;
+			newContext = context;
+			newSelector = nodeType === 9 && selector;
 
-			support.reliableMarginRight =
-				!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
-		}
+			// qSA works strangely on Element-rooted queries
+			// We can work around this by specifying an extra ID on the root
+			// and working up from there (Thanks to Andrew Dupont for the technique)
+			// IE 8 doesn't work on object elements
+			if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+				groups = tokenize( selector );
 
-		if ( typeof div.style.zoom !== core_strundefined ) {
-			// Support: IE<8
-			// Check if natively block-level elements act like inline-block
-			// elements when setting their display to 'inline' and giving
-			// them layout
-			div.innerHTML = "";
-			div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
-			support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+				if ( (old = context.getAttribute("id")) ) {
+					nid = old.replace( rescape, "\\$&" );
+				} else {
+					context.setAttribute( "id", nid );
+				}
+				nid = "[id='" + nid + "'] ";
 
-			// Support: IE6
-			// Check if elements with layout shrink-wrap their children
-			div.style.display = "block";
-			div.innerHTML = "<div></div>";
-			div.firstChild.style.width = "5px";
-			support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
+				i = groups.length;
+				while ( i-- ) {
+					groups[i] = nid + toSelector( groups[i] );
+				}
+				newContext = rsibling.test( selector ) && context.parentNode || context;
+				newSelector = groups.join(",");
+			}
 
-			if ( support.inlineBlockNeedsLayout ) {
-				// Prevent IE 6 from affecting layout for positioned elements #11048
-				// Prevent IE from shrinking the body in IE 7 mode #12869
-				// Support: IE<8
-				body.style.zoom = 1;
+			if ( newSelector ) {
+				try {
+					push.apply( results,
+						newContext.querySelectorAll( newSelector )
+					);
+					return results;
+				} catch(qsaError) {
+				} finally {
+					if ( !old ) {
+						context.removeAttribute("id");
+					}
+				}
 			}
 		}
+	}
 
-		body.removeChild( container );
+	// All others
+	return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
 
-		// Null elements to avoid leaks in IE
-		container = div = tds = marginDiv = null;
-	});
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ *	deleting the oldest entry
+ */
+function createCache() {
+	var keys = [];
 
-	// Null elements to avoid leaks in IE
-	all = select = fragment = opt = a = input = null;
+	function cache( key, value ) {
+		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+		if ( keys.push( key += " " ) > Expr.cacheLength ) {
+			// Only keep the most recent entries
+			delete cache[ keys.shift() ];
+		}
+		return (cache[ key ] = value);
+	}
+	return cache;
+}
 
-	return support;
-})();
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+	fn[ expando ] = true;
+	return fn;
+}
 
-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
-	rmultiDash = /([A-Z])/g;
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+	var div = document.createElement("div");
 
-function internalData( elem, name, data, pvt /* Internal Use Only */ ){
-	if ( !jQuery.acceptData( elem ) ) {
-		return;
+	try {
+		return !!fn( div );
+	} catch (e) {
+		return false;
+	} finally {
+		// Remove from its parent by default
+		if ( div.parentNode ) {
+			div.parentNode.removeChild( div );
+		}
+		// release memory in IE
+		div = null;
 	}
+}
 
-	var thisCache, ret,
-		internalKey = jQuery.expando,
-		getByName = typeof name === "string",
-
-		// We have to handle DOM nodes and JS objects differently because IE6-7
-		// can't GC object references properly across the DOM-JS boundary
-		isNode = elem.nodeType,
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+	var arr = attrs.split("|"),
+		i = attrs.length;
 
-		// Only DOM nodes need the global jQuery cache; JS object data is
-		// attached directly to the object so GC can occur automatically
-		cache = isNode ? jQuery.cache : elem,
+	while ( i-- ) {
+		Expr.attrHandle[ arr[i] ] = handler;
+	}
+}
 
-		// Only defining an ID for JS objects if its cache already exists allows
-		// the code to shortcut on the same path as a DOM node with no cache
-		id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+	var cur = b && a,
+		diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+			( ~b.sourceIndex || MAX_NEGATIVE ) -
+			( ~a.sourceIndex || MAX_NEGATIVE );
 
-	// Avoid doing any more work than we need to when trying to get data on an
-	// object that has no data at all
-	if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
-		return;
+	// Use IE sourceIndex if available on both nodes
+	if ( diff ) {
+		return diff;
 	}
 
-	if ( !id ) {
-		// Only DOM nodes need a new unique ID for each element since their data
-		// ends up in the global cache
-		if ( isNode ) {
-			elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
-		} else {
-			id = internalKey;
+	// Check if b follows a
+	if ( cur ) {
+		while ( (cur = cur.nextSibling) ) {
+			if ( cur === b ) {
+				return -1;
+			}
 		}
 	}
 
-	if ( !cache[ id ] ) {
-		cache[ id ] = {};
+	return a ? 1 : -1;
+}
 
-		// Avoids exposing jQuery metadata on plain JS objects when the object
-		// is serialized using JSON.stringify
-		if ( !isNode ) {
-			cache[ id ].toJSON = jQuery.noop;
-		}
-	}
-
-	// An object can be passed to jQuery.data instead of a key/value pair; this gets
-	// shallow copied over onto the existing cache
-	if ( typeof name === "object" || typeof name === "function" ) {
-		if ( pvt ) {
-			cache[ id ] = jQuery.extend( cache[ id ], name );
-		} else {
-			cache[ id ].data = jQuery.extend( cache[ id ].data, name );
-		}
-	}
-
-	thisCache = cache[ id ];
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+	return function( elem ) {
+		var name = elem.nodeName.toLowerCase();
+		return name === "input" && elem.type === type;
+	};
+}
 
-	// jQuery data() is stored in a separate object inside the object's internal data
-	// cache in order to avoid key collisions between internal data and user-defined
-	// data.
-	if ( !pvt ) {
-		if ( !thisCache.data ) {
-			thisCache.data = {};
-		}
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+	return function( elem ) {
+		var name = elem.nodeName.toLowerCase();
+		return (name === "input" || name === "button") && elem.type === type;
+	};
+}
 
-		thisCache = thisCache.data;
-	}
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+	return markFunction(function( argument ) {
+		argument = +argument;
+		return markFunction(function( seed, matches ) {
+			var j,
+				matchIndexes = fn( [], seed.length, argument ),
+				i = matchIndexes.length;
 
-	if ( data !== undefined ) {
-		thisCache[ jQuery.camelCase( name ) ] = data;
-	}
+			// Match elements found at the specified indexes
+			while ( i-- ) {
+				if ( seed[ (j = matchIndexes[i]) ] ) {
+					seed[j] = !(matches[j] = seed[j]);
+				}
+			}
+		});
+	});
+}
 
-	// Check for both converted-to-camel and non-converted data property names
-	// If a data property was specified
-	if ( getByName ) {
+/**
+ * Detect xml
+ * @param {Element|Object} elem An element or a document
+ */
+isXML = Sizzle.isXML = function( elem ) {
+	// documentElement is verified for cases where it doesn't yet exist
+	// (such as loading iframes in IE - #4833)
+	var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+	return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
 
-		// First Try to find as-is property data
-		ret = thisCache[ name ];
+// Expose support vars for convenience
+support = Sizzle.support = {};
 
-		// Test for null|undefined property data
-		if ( ret == null ) {
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+	var doc = node ? node.ownerDocument || node : preferredDoc,
+		parent = doc.defaultView;
 
-			// Try to find the camelCased property
-			ret = thisCache[ jQuery.camelCase( name ) ];
-		}
-	} else {
-		ret = thisCache;
+	// If no document and documentElement is available, return
+	if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+		return document;
 	}
 
-	return ret;
-}
+	// Set our document
+	document = doc;
+	docElem = doc.documentElement;
 
-function internalRemoveData( elem, name, pvt ) {
-	if ( !jQuery.acceptData( elem ) ) {
-		return;
+	// Support tests
+	documentIsHTML = !isXML( doc );
+
+	// Support: IE>8
+	// If iframe document is assigned to "document" variable and if iframe has been reloaded,
+	// IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+	// IE6-8 do not support the defaultView property so parent will be undefined
+	if ( parent && parent.attachEvent && parent !== parent.top ) {
+		parent.attachEvent( "onbeforeunload", function() {
+			setDocument();
+		});
 	}
 
-	var i, l, thisCache,
-		isNode = elem.nodeType,
+	/* Attributes
+	---------------------------------------------------------------------- */
 
-		// See jQuery.data for more information
-		cache = isNode ? jQuery.cache : elem,
-		id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+	// Support: IE<8
+	// Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+	support.attributes = assert(function( div ) {
+		div.className = "i";
+		return !div.getAttribute("className");
+	});
 
-	// If there is already no cache entry for this object, there is no
-	// purpose in continuing
-	if ( !cache[ id ] ) {
-		return;
-	}
+	/* getElement(s)By*
+	---------------------------------------------------------------------- */
 
-	if ( name ) {
+	// Check if getElementsByTagName("*") returns only elements
+	support.getElementsByTagName = assert(function( div ) {
+		div.appendChild( doc.createComment("") );
+		return !div.getElementsByTagName("*").length;
+	});
 
-		thisCache = pvt ? cache[ id ] : cache[ id ].data;
+	// Check if getElementsByClassName can be trusted
+	support.getElementsByClassName = assert(function( div ) {
+		div.innerHTML = "<div class='a'></div><div class='a i'></div>";
+
+		// Support: Safari<4
+		// Catch class over-caching
+		div.firstChild.className = "i";
+		// Support: Opera<10
+		// Catch gEBCN failure to find non-leading classes
+		return div.getElementsByClassName("i").length === 2;
+	});
 
-		if ( thisCache ) {
+	// Support: IE<10
+	// Check if getElementById returns elements by name
+	// The broken getElementById methods don't pick up programatically-set names,
+	// so use a roundabout getElementsByName test
+	support.getById = assert(function( div ) {
+		docElem.appendChild( div ).id = expando;
+		return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+	});
 
-			// Support array or space separated string names for data keys
-			if ( !jQuery.isArray( name ) ) {
+	// ID find and filter
+	if ( support.getById ) {
+		Expr.find["ID"] = function( id, context ) {
+			if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+				var m = context.getElementById( id );
+				// Check parentNode to catch when Blackberry 4.6 returns
+				// nodes that are no longer in the document #6963
+				return m && m.parentNode ? [m] : [];
+			}
+		};
+		Expr.filter["ID"] = function( id ) {
+			var attrId = id.replace( runescape, funescape );
+			return function( elem ) {
+				return elem.getAttribute("id") === attrId;
+			};
+		};
+	} else {
+		// Support: IE6/7
+		// getElementById is not reliable as a find shortcut
+		delete Expr.find["ID"];
 
-				// try the string as a key before any manipulation
-				if ( name in thisCache ) {
-					name = [ name ];
-				} else {
+		Expr.filter["ID"] =  function( id ) {
+			var attrId = id.replace( runescape, funescape );
+			return function( elem ) {
+				var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+				return node && node.value === attrId;
+			};
+		};
+	}
 
-					// split the camel cased version by spaces unless a key with the spaces exists
-					name = jQuery.camelCase( name );
-					if ( name in thisCache ) {
-						name = [ name ];
-					} else {
-						name = name.split(" ");
+	// Tag
+	Expr.find["TAG"] = support.getElementsByTagName ?
+		function( tag, context ) {
+			if ( typeof context.getElementsByTagName !== strundefined ) {
+				return context.getElementsByTagName( tag );
+			}
+		} :
+		function( tag, context ) {
+			var elem,
+				tmp = [],
+				i = 0,
+				results = context.getElementsByTagName( tag );
+
+			// Filter out possible comments
+			if ( tag === "*" ) {
+				while ( (elem = results[i++]) ) {
+					if ( elem.nodeType === 1 ) {
+						tmp.push( elem );
 					}
 				}
-			} else {
-				// If "name" is an array of keys...
-				// When data is initially created, via ("key", "val") signature,
-				// keys will be converted to camelCase.
-				// Since there is no way to tell _how_ a key was added, remove
-				// both plain key and camelCase key. #12786
-				// This will only penalize the array argument path.
-				name = name.concat( jQuery.map( name, jQuery.camelCase ) );
-			}
 
-			for ( i = 0, l = name.length; i < l; i++ ) {
-				delete thisCache[ name[i] ];
+				return tmp;
 			}
+			return results;
+		};
 
-			// If there is no data left in the cache, we want to continue
-			// and let the cache object itself get destroyed
-			if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
-				return;
-			}
+	// Class
+	Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+		if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+			return context.getElementsByClassName( className );
 		}
-	}
+	};
 
-	// See jQuery.data for more information
-	if ( !pvt ) {
-		delete cache[ id ].data;
+	/* QSA/matchesSelector
+	---------------------------------------------------------------------- */
 
-		// Don't destroy the parent cache unless the internal data object
-		// had been the only thing left in it
-		if ( !isEmptyDataObject( cache[ id ] ) ) {
-			return;
-		}
-	}
+	// QSA and matchesSelector support
 
-	// Destroy the cache
-	if ( isNode ) {
-		jQuery.cleanData( [ elem ], true );
+	// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+	rbuggyMatches = [];
 
-	// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
-	} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
-		delete cache[ id ];
+	// qSa(:focus) reports false when true (Chrome 21)
+	// We allow this because of a bug in IE8/9 that throws an error
+	// whenever `document.activeElement` is accessed on an iframe
+	// So, we allow :focus to pass through QSA all the time to avoid the IE error
+	// See http://bugs.jquery.com/ticket/13378
+	rbuggyQSA = [];
 
-	// When all else fails, null
-	} else {
-		cache[ id ] = null;
-	}
-}
+	if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+		// Build QSA regex
+		// Regex strategy adopted from Diego Perini
+		assert(function( div ) {
+			// Select is set to empty string on purpose
+			// This is to test IE's treatment of not explicitly
+			// setting a boolean content attribute,
+			// since its presence should be enough
+			// http://bugs.jquery.com/ticket/12359
+			div.innerHTML = "<select><option selected=''></option></select>";
 
-jQuery.extend({
-	cache: {},
+			// Support: IE8
+			// Boolean attributes and "value" are not treated correctly
+			if ( !div.querySelectorAll("[selected]").length ) {
+				rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+			}
 
-	// Unique for each copy of jQuery on the page
-	// Non-digits removed to match rinlinejQuery
-	expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
+			// Webkit/Opera - :checked should return selected option elements
+			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+			// IE8 throws error here and will not see later tests
+			if ( !div.querySelectorAll(":checked").length ) {
+				rbuggyQSA.push(":checked");
+			}
+		});
 
-	// The following elements throw uncatchable exceptions if you
-	// attempt to add expando properties to them.
-	noData: {
-		"embed": true,
-		// Ban all objects except for Flash (which handle expandos)
-		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
-		"applet": true
-	},
+		assert(function( div ) {
 
-	hasData: function( elem ) {
-		elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
-		return !!elem && !isEmptyDataObject( elem );
-	},
+			// Support: Opera 10-12/IE8
+			// ^= $= *= and empty values
+			// Should not select anything
+			// Support: Windows 8 Native Apps
+			// The type attribute is restricted during .innerHTML assignment
+			var input = doc.createElement("input");
+			input.setAttribute( "type", "hidden" );
+			div.appendChild( input ).setAttribute( "t", "" );
 
-	data: function( elem, name, data ) {
-		return internalData( elem, name, data );
-	},
-
-	removeData: function( elem, name ) {
-		return internalRemoveData( elem, name );
-	},
+			if ( div.querySelectorAll("[t^='']").length ) {
+				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+			}
 
-	// For internal use only.
-	_data: function( elem, name, data ) {
-		return internalData( elem, name, data, true );
-	},
+			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+			// IE8 throws error here and will not see later tests
+			if ( !div.querySelectorAll(":enabled").length ) {
+				rbuggyQSA.push( ":enabled", ":disabled" );
+			}
 
-	_removeData: function( elem, name ) {
-		return internalRemoveData( elem, name, true );
-	},
+			// Opera 10-11 does not throw on post-comma invalid pseudos
+			div.querySelectorAll("*,:x");
+			rbuggyQSA.push(",.*:");
+		});
+	}
 
-	// A method for determining if a DOM node can handle the data expando
-	acceptData: function( elem ) {
-		// Do not set data on non-element because it will not be cleared (#8335).
-		if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
-			return false;
-		}
+	if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
+		docElem.mozMatchesSelector ||
+		docElem.oMatchesSelector ||
+		docElem.msMatchesSelector) )) ) {
 
-		var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
+		assert(function( div ) {
+			// Check to see if it's possible to do matchesSelector
+			// on a disconnected node (IE 9)
+			support.disconnectedMatch = matches.call( div, "div" );
 
-		// nodes accept data unless otherwise specified; rejection can be conditional
-		return !noData || noData !== true && elem.getAttribute("classid") === noData;
+			// This should fail with an exception
+			// Gecko does not error, returns false instead
+			matches.call( div, "[s!='']:x" );
+			rbuggyMatches.push( "!=", pseudos );
+		});
 	}
-});
-
-jQuery.fn.extend({
-	data: function( key, value ) {
-		var attrs, name,
-			elem = this[0],
-			i = 0,
-			data = null;
-
-		// Gets all values
-		if ( key === undefined ) {
-			if ( this.length ) {
-				data = jQuery.data( elem );
 
-				if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
-					attrs = elem.attributes;
-					for ( ; i < attrs.length; i++ ) {
-						name = attrs[i].name;
+	rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+	rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
 
-						if ( !name.indexOf( "data-" ) ) {
-							name = jQuery.camelCase( name.slice(5) );
+	/* Contains
+	---------------------------------------------------------------------- */
 
-							dataAttr( elem, name, data[ name ] );
-						}
+	// Element contains another
+	// Purposefully does not implement inclusive descendent
+	// As in, an element does not contain itself
+	contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
+		function( a, b ) {
+			var adown = a.nodeType === 9 ? a.documentElement : a,
+				bup = b && b.parentNode;
+			return a === bup || !!( bup && bup.nodeType === 1 && (
+				adown.contains ?
+					adown.contains( bup ) :
+					a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+			));
+		} :
+		function( a, b ) {
+			if ( b ) {
+				while ( (b = b.parentNode) ) {
+					if ( b === a ) {
+						return true;
 					}
-					jQuery._data( elem, "parsedAttrs", true );
 				}
 			}
+			return false;
+		};
 
-			return data;
-		}
+	/* Sorting
+	---------------------------------------------------------------------- */
 
-		// Sets multiple values
-		if ( typeof key === "object" ) {
-			return this.each(function() {
-				jQuery.data( this, key );
-			});
-		}
+	// Document order sorting
+	sortOrder = docElem.compareDocumentPosition ?
+	function( a, b ) {
 
-		return jQuery.access( this, function( value ) {
+		// Flag for duplicate removal
+		if ( a === b ) {
+			hasDuplicate = true;
+			return 0;
+		}
 
-			if ( value === undefined ) {
-				// Try to fetch any internally stored data first
-				return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
-			}
+		var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
 
-			this.each(function() {
-				jQuery.data( this, key, value );
-			});
-		}, null, value, arguments.length > 1, null, true );
-	},
+		if ( compare ) {
+			// Disconnected nodes
+			if ( compare & 1 ||
+				(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
 
-	removeData: function( key ) {
-		return this.each(function() {
-			jQuery.removeData( this, key );
-		});
-	}
-});
+				// Choose the first element that is related to our preferred document
+				if ( a === doc || contains(preferredDoc, a) ) {
+					return -1;
+				}
+				if ( b === doc || contains(preferredDoc, b) ) {
+					return 1;
+				}
 
-function dataAttr( elem, key, data ) {
-	// If nothing was found internally, try to fetch any
-	// data from the HTML5 data-* attribute
-	if ( data === undefined && elem.nodeType === 1 ) {
+				// Maintain original order
+				return sortInput ?
+					( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+					0;
+			}
 
-		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+			return compare & 4 ? -1 : 1;
+		}
 
-		data = elem.getAttribute( name );
+		// Not directly comparable, sort on existence of method
+		return a.compareDocumentPosition ? -1 : 1;
+	} :
+	function( a, b ) {
+		var cur,
+			i = 0,
+			aup = a.parentNode,
+			bup = b.parentNode,
+			ap = [ a ],
+			bp = [ b ];
 
-		if ( typeof data === "string" ) {
-			try {
-				data = data === "true" ? true :
-					data === "false" ? false :
-					data === "null" ? null :
-					// Only convert to a number if it doesn't change the string
-					+data + "" === data ? +data :
-					rbrace.test( data ) ? jQuery.parseJSON( data ) :
-						data;
-			} catch( e ) {}
+		// Exit early if the nodes are identical
+		if ( a === b ) {
+			hasDuplicate = true;
+			return 0;
 
-			// Make sure we set the data so it isn't changed later
-			jQuery.data( elem, key, data );
+		// Parentless nodes are either documents or disconnected
+		} else if ( !aup || !bup ) {
+			return a === doc ? -1 :
+				b === doc ? 1 :
+				aup ? -1 :
+				bup ? 1 :
+				sortInput ?
+				( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+				0;
 
-		} else {
-			data = undefined;
+		// If the nodes are siblings, we can do a quick check
+		} else if ( aup === bup ) {
+			return siblingCheck( a, b );
 		}
-	}
 
-	return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
-	var name;
-	for ( name in obj ) {
-
-		// if the public data object is empty, the private is still empty
-		if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
-			continue;
+		// Otherwise we need full lists of their ancestors for comparison
+		cur = a;
+		while ( (cur = cur.parentNode) ) {
+			ap.unshift( cur );
 		}
-		if ( name !== "toJSON" ) {
-			return false;
+		cur = b;
+		while ( (cur = cur.parentNode) ) {
+			bp.unshift( cur );
 		}
-	}
-
-	return true;
-}
-jQuery.extend({
-	queue: function( elem, type, data ) {
-		var queue;
-
-		if ( elem ) {
-			type = ( type || "fx" ) + "queue";
-			queue = jQuery._data( elem, type );
 
-			// Speed up dequeue by getting out quickly if this is just a lookup
-			if ( data ) {
-				if ( !queue || jQuery.isArray(data) ) {
-					queue = jQuery._data( elem, type, jQuery.makeArray(data) );
-				} else {
-					queue.push( data );
-				}
-			}
-			return queue || [];
+		// Walk down the tree looking for a discrepancy
+		while ( ap[i] === bp[i] ) {
+			i++;
 		}
-	},
 
-	dequeue: function( elem, type ) {
-		type = type || "fx";
+		return i ?
+			// Do a sibling check if the nodes have a common ancestor
+			siblingCheck( ap[i], bp[i] ) :
 
-		var queue = jQuery.queue( elem, type ),
-			startLength = queue.length,
-			fn = queue.shift(),
-			hooks = jQuery._queueHooks( elem, type ),
-			next = function() {
-				jQuery.dequeue( elem, type );
-			};
+			// Otherwise nodes in our document sort first
+			ap[i] === preferredDoc ? -1 :
+			bp[i] === preferredDoc ? 1 :
+			0;
+	};
 
-		// If the fx queue is dequeued, always remove the progress sentinel
-		if ( fn === "inprogress" ) {
-			fn = queue.shift();
-			startLength--;
-		}
+	return doc;
+};
 
-		hooks.cur = fn;
-		if ( fn ) {
+Sizzle.matches = function( expr, elements ) {
+	return Sizzle( expr, null, null, elements );
+};
 
-			// Add a progress sentinel to prevent the fx queue from being
-			// automatically dequeued
-			if ( type === "fx" ) {
-				queue.unshift( "inprogress" );
-			}
+Sizzle.matchesSelector = function( elem, expr ) {
+	// Set document vars if needed
+	if ( ( elem.ownerDocument || elem ) !== document ) {
+		setDocument( elem );
+	}
 
-			// clear up the last queue stop function
-			delete hooks.stop;
-			fn.call( elem, next, hooks );
-		}
+	// Make sure that attribute selectors are quoted
+	expr = expr.replace( rattributeQuotes, "='$1']" );
 
-		if ( !startLength && hooks ) {
-			hooks.empty.fire();
-		}
-	},
+	if ( support.matchesSelector && documentIsHTML &&
+		( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+		( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
 
-	// not intended for public consumption - generates a queueHooks object, or returns the current one
-	_queueHooks: function( elem, type ) {
-		var key = type + "queueHooks";
-		return jQuery._data( elem, key ) || jQuery._data( elem, key, {
-			empty: jQuery.Callbacks("once memory").add(function() {
-				jQuery._removeData( elem, type + "queue" );
-				jQuery._removeData( elem, key );
-			})
-		});
+		try {
+			var ret = matches.call( elem, expr );
+
+			// IE 9's matchesSelector returns false on disconnected nodes
+			if ( ret || support.disconnectedMatch ||
+					// As well, disconnected nodes are said to be in a document
+					// fragment in IE 9
+					elem.document && elem.document.nodeType !== 11 ) {
+				return ret;
+			}
+		} catch(e) {}
 	}
-});
 
-jQuery.fn.extend({
-	queue: function( type, data ) {
-		var setter = 2;
+	return Sizzle( expr, document, null, [elem] ).length > 0;
+};
 
-		if ( typeof type !== "string" ) {
-			data = type;
-			type = "fx";
-			setter--;
-		}
+Sizzle.contains = function( context, elem ) {
+	// Set document vars if needed
+	if ( ( context.ownerDocument || context ) !== document ) {
+		setDocument( context );
+	}
+	return contains( context, elem );
+};
 
-		if ( arguments.length < setter ) {
-			return jQuery.queue( this[0], type );
-		}
+Sizzle.attr = function( elem, name ) {
+	// Set document vars if needed
+	if ( ( elem.ownerDocument || elem ) !== document ) {
+		setDocument( elem );
+	}
 
-		return data === undefined ?
-			this :
-			this.each(function() {
-				var queue = jQuery.queue( this, type, data );
+	var fn = Expr.attrHandle[ name.toLowerCase() ],
+		// Don't get fooled by Object.prototype properties (jQuery #13807)
+		val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+			fn( elem, name, !documentIsHTML ) :
+			undefined;
 
-				// ensure a hooks for this queue
-				jQuery._queueHooks( this, type );
+	return val === undefined ?
+		support.attributes || !documentIsHTML ?
+			elem.getAttribute( name ) :
+			(val = elem.getAttributeNode(name)) && val.specified ?
+				val.value :
+				null :
+		val;
+};
 
-				if ( type === "fx" && queue[0] !== "inprogress" ) {
-					jQuery.dequeue( this, type );
-				}
-			});
-	},
-	dequeue: function( type ) {
-		return this.each(function() {
-			jQuery.dequeue( this, type );
-		});
-	},
-	// Based off of the plugin by Clint Helfers, with permission.
-	// http://blindsignals.com/index.php/2009/07/jquery-delay/
-	delay: function( time, type ) {
-		time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
-		type = type || "fx";
+Sizzle.error = function( msg ) {
+	throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
 
-		return this.queue( type, function( next, hooks ) {
-			var timeout = setTimeout( next, time );
-			hooks.stop = function() {
-				clearTimeout( timeout );
-			};
-		});
-	},
-	clearQueue: function( type ) {
-		return this.queue( type || "fx", [] );
-	},
-	// Get a promise resolved when queues of a certain type
-	// are emptied (fx is the type by default)
-	promise: function( type, obj ) {
-		var tmp,
-			count = 1,
-			defer = jQuery.Deferred(),
-			elements = this,
-			i = this.length,
-			resolve = function() {
-				if ( !( --count ) ) {
-					defer.resolveWith( elements, [ elements ] );
-				}
-			};
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+	var elem,
+		duplicates = [],
+		j = 0,
+		i = 0;
 
-		if ( typeof type !== "string" ) {
-			obj = type;
-			type = undefined;
-		}
-		type = type || "fx";
+	// Unless we *know* we can detect duplicates, assume their presence
+	hasDuplicate = !support.detectDuplicates;
+	sortInput = !support.sortStable && results.slice( 0 );
+	results.sort( sortOrder );
 
-		while( i-- ) {
-			tmp = jQuery._data( elements[ i ], type + "queueHooks" );
-			if ( tmp && tmp.empty ) {
-				count++;
-				tmp.empty.add( resolve );
+	if ( hasDuplicate ) {
+		while ( (elem = results[i++]) ) {
+			if ( elem === results[ i ] ) {
+				j = duplicates.push( i );
 			}
 		}
-		resolve();
-		return defer.promise( obj );
+		while ( j-- ) {
+			results.splice( duplicates[ j ], 1 );
+		}
 	}
-});
-var nodeHook, boolHook,
-	rclass = /[\t\r\n]/g,
-	rreturn = /\r/g,
-	rfocusable = /^(?:input|select|textarea|button|object)$/i,
-	rclickable = /^(?:a|area)$/i,
-	rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
-	ruseDefault = /^(?:checked|selected)$/i,
-	getSetAttribute = jQuery.support.getSetAttribute,
-	getSetInput = jQuery.support.input;
 
-jQuery.fn.extend({
-	attr: function( name, value ) {
-		return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
-	},
+	return results;
+};
 
-	removeAttr: function( name ) {
-		return this.each(function() {
-			jQuery.removeAttr( this, name );
-		});
-	},
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+	var node,
+		ret = "",
+		i = 0,
+		nodeType = elem.nodeType;
 
-	prop: function( name, value ) {
-		return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
-	},
+	if ( !nodeType ) {
+		// If no nodeType, this is expected to be an array
+		for ( ; (node = elem[i]); i++ ) {
+			// Do not traverse comment nodes
+			ret += getText( node );
+		}
+	} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+		// Use textContent for elements
+		// innerText usage removed for consistency of new lines (see #11153)
+		if ( typeof elem.textContent === "string" ) {
+			return elem.textContent;
+		} else {
+			// Traverse its children
+			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+				ret += getText( elem );
+			}
+		}
+	} else if ( nodeType === 3 || nodeType === 4 ) {
+		return elem.nodeValue;
+	}
+	// Do not include comment or processing instruction nodes
 
-	removeProp: function( name ) {
-		name = jQuery.propFix[ name ] || name;
-		return this.each(function() {
-			// try/catch handles cases where IE balks (such as removing a property on window)
-			try {
-				this[ name ] = undefined;
-				delete this[ name ];
-			} catch( e ) {}
-		});
-	},
+	return ret;
+};
 
-	addClass: function( value ) {
-		var classes, elem, cur, clazz, j,
-			i = 0,
-			len = this.length,
-			proceed = typeof value === "string" && value;
+Expr = Sizzle.selectors = {
 
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).addClass( value.call( this, j, this.className ) );
-			});
-		}
+	// Can be adjusted by the user
+	cacheLength: 50,
 
-		if ( proceed ) {
-			// The disjunction here is for better compressibility (see removeClass)
-			classes = ( value || "" ).match( core_rnotwhite ) || [];
+	createPseudo: markFunction,
 
-			for ( ; i < len; i++ ) {
-				elem = this[ i ];
-				cur = elem.nodeType === 1 && ( elem.className ?
-					( " " + elem.className + " " ).replace( rclass, " " ) :
-					" "
-				);
+	match: matchExpr,
 
-				if ( cur ) {
-					j = 0;
-					while ( (clazz = classes[j++]) ) {
-						if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
-							cur += clazz + " ";
-						}
-					}
-					elem.className = jQuery.trim( cur );
+	attrHandle: {},
 
-				}
-			}
-		}
+	find: {},
 
-		return this;
+	relative: {
+		">": { dir: "parentNode", first: true },
+		" ": { dir: "parentNode" },
+		"+": { dir: "previousSibling", first: true },
+		"~": { dir: "previousSibling" }
 	},
 
-	removeClass: function( value ) {
-		var classes, elem, cur, clazz, j,
-			i = 0,
-			len = this.length,
-			proceed = arguments.length === 0 || typeof value === "string" && value;
+	preFilter: {
+		"ATTR": function( match ) {
+			match[1] = match[1].replace( runescape, funescape );
 
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).removeClass( value.call( this, j, this.className ) );
-			});
-		}
-		if ( proceed ) {
-			classes = ( value || "" ).match( core_rnotwhite ) || [];
+			// Move the given value to match[3] whether quoted or unquoted
+			match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
 
-			for ( ; i < len; i++ ) {
-				elem = this[ i ];
-				// This expression is here for better compressibility (see addClass)
-				cur = elem.nodeType === 1 && ( elem.className ?
-					( " " + elem.className + " " ).replace( rclass, " " ) :
-					""
-				);
+			if ( match[2] === "~=" ) {
+				match[3] = " " + match[3] + " ";
+			}
 
-				if ( cur ) {
-					j = 0;
-					while ( (clazz = classes[j++]) ) {
-						// Remove *all* instances
-						while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
-							cur = cur.replace( " " + clazz + " ", " " );
-						}
-					}
-					elem.className = value ? jQuery.trim( cur ) : "";
-				}
-			}
-		}
-
-		return this;
-	},
-
-	toggleClass: function( value, stateVal ) {
-		var type = typeof value,
-			isBool = typeof stateVal === "boolean";
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-			});
-		}
-
-		return this.each(function() {
-			if ( type === "string" ) {
-				// toggle individual class names
-				var className,
-					i = 0,
-					self = jQuery( this ),
-					state = stateVal,
-					classNames = value.match( core_rnotwhite ) || [];
+			return match.slice( 0, 4 );
+		},
 
-				while ( (className = classNames[ i++ ]) ) {
-					// check each className given, space separated list
-					state = isBool ? state : !self.hasClass( className );
-					self[ state ? "addClass" : "removeClass" ]( className );
-				}
+		"CHILD": function( match ) {
+			/* matches from matchExpr["CHILD"]
+				1 type (only|nth|...)
+				2 what (child|of-type)
+				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+				4 xn-component of xn+y argument ([+-]?\d*n|)
+				5 sign of xn-component
+				6 x of xn-component
+				7 sign of y-component
+				8 y of y-component
+			*/
+			match[1] = match[1].toLowerCase();
 
-			// Toggle whole class name
-			} else if ( type === core_strundefined || type === "boolean" ) {
-				if ( this.className ) {
-					// store className if set
-					jQuery._data( this, "__className__", this.className );
+			if ( match[1].slice( 0, 3 ) === "nth" ) {
+				// nth-* requires argument
+				if ( !match[3] ) {
+					Sizzle.error( match[0] );
 				}
 
-				// If the element has a class name or if we're passed "false",
-				// then remove the whole classname (if there was one, the above saved it).
-				// Otherwise bring back whatever was previously saved (if anything),
-				// falling back to the empty string if nothing was stored.
-				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
-			}
-		});
-	},
+				// numeric x and y parameters for Expr.filter.CHILD
+				// remember that false/true cast respectively to 0/1
+				match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+				match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
 
-	hasClass: function( selector ) {
-		var className = " " + selector + " ",
-			i = 0,
-			l = this.length;
-		for ( ; i < l; i++ ) {
-			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
-				return true;
+			// other types prohibit arguments
+			} else if ( match[3] ) {
+				Sizzle.error( match[0] );
 			}
-		}
 
-		return false;
-	},
+			return match;
+		},
 
-	val: function( value ) {
-		var ret, hooks, isFunction,
-			elem = this[0];
+		"PSEUDO": function( match ) {
+			var excess,
+				unquoted = !match[5] && match[2];
 
-		if ( !arguments.length ) {
-			if ( elem ) {
-				hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+			if ( matchExpr["CHILD"].test( match[0] ) ) {
+				return null;
+			}
 
-				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-					return ret;
-				}
+			// Accept quoted arguments as-is
+			if ( match[3] && match[4] !== undefined ) {
+				match[2] = match[4];
 
-				ret = elem.value;
+			// Strip excess characters from unquoted arguments
+			} else if ( unquoted && rpseudo.test( unquoted ) &&
+				// Get excess from tokenize (recursively)
+				(excess = tokenize( unquoted, true )) &&
+				// advance to the next closing parenthesis
+				(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
 
-				return typeof ret === "string" ?
-					// handle most common string cases
-					ret.replace(rreturn, "") :
-					// handle cases where value is null/undef or number
-					ret == null ? "" : ret;
+				// excess is a negative index
+				match[0] = match[0].slice( 0, excess );
+				match[2] = unquoted.slice( 0, excess );
 			}
 
-			return;
+			// Return only captures needed by the pseudo filter method (type and argument)
+			return match.slice( 0, 3 );
 		}
+	},
 
-		isFunction = jQuery.isFunction( value );
-
-		return this.each(function( i ) {
-			var val,
-				self = jQuery(this);
+	filter: {
 
-			if ( this.nodeType !== 1 ) {
-				return;
-			}
+		"TAG": function( nodeNameSelector ) {
+			var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+			return nodeNameSelector === "*" ?
+				function() { return true; } :
+				function( elem ) {
+					return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+				};
+		},
 
-			if ( isFunction ) {
-				val = value.call( this, i, self.val() );
-			} else {
-				val = value;
-			}
+		"CLASS": function( className ) {
+			var pattern = classCache[ className + " " ];
 
-			// Treat null/undefined as ""; convert numbers to string
-			if ( val == null ) {
-				val = "";
-			} else if ( typeof val === "number" ) {
-				val += "";
-			} else if ( jQuery.isArray( val ) ) {
-				val = jQuery.map(val, function ( value ) {
-					return value == null ? "" : value + "";
+			return pattern ||
+				(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+				classCache( className, function( elem ) {
+					return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
 				});
-			}
+		},
 
-			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+		"ATTR": function( name, operator, check ) {
+			return function( elem ) {
+				var result = Sizzle.attr( elem, name );
 
-			// If set returns undefined, fall back to normal setting
-			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-				this.value = val;
-			}
-		});
-	}
-});
+				if ( result == null ) {
+					return operator === "!=";
+				}
+				if ( !operator ) {
+					return true;
+				}
 
-jQuery.extend({
-	valHooks: {
-		option: {
-			get: function( elem ) {
-				// attributes.value is undefined in Blackberry 4.7 but
-				// uses .value. See #6932
-				var val = elem.attributes.value;
-				return !val || val.specified ? elem.value : elem.text;
-			}
+				result += "";
+
+				return operator === "=" ? result === check :
+					operator === "!=" ? result !== check :
+					operator === "^=" ? check && result.indexOf( check ) === 0 :
+					operator === "*=" ? check && result.indexOf( check ) > -1 :
+					operator === "$=" ? check && result.slice( -check.length ) === check :
+					operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+					operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+					false;
+			};
 		},
-		select: {
-			get: function( elem ) {
-				var value, option,
-					options = elem.options,
-					index = elem.selectedIndex,
-					one = elem.type === "select-one" || index < 0,
-					values = one ? null : [],
-					max = one ? index + 1 : options.length,
-					i = index < 0 ?
-						max :
-						one ? index : 0;
 
-				// Loop through all the selected options
-				for ( ; i < max; i++ ) {
-					option = options[ i ];
+		"CHILD": function( type, what, argument, first, last ) {
+			var simple = type.slice( 0, 3 ) !== "nth",
+				forward = type.slice( -4 ) !== "last",
+				ofType = what === "of-type";
 
-					// oldIE doesn't update selected after form reset (#2551)
-					if ( ( option.selected || i === index ) &&
-							// Don't return options that are disabled or in a disabled optgroup
-							( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
-							( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+			return first === 1 && last === 0 ?
 
-						// Get the specific value for the option
-						value = jQuery( option ).val();
+				// Shortcut for :nth-*(n)
+				function( elem ) {
+					return !!elem.parentNode;
+				} :
 
-						// We don't need an array for one selects
-						if ( one ) {
-							return value;
-						}
+				function( elem, context, xml ) {
+					var cache, outerCache, node, diff, nodeIndex, start,
+						dir = simple !== forward ? "nextSibling" : "previousSibling",
+						parent = elem.parentNode,
+						name = ofType && elem.nodeName.toLowerCase(),
+						useCache = !xml && !ofType;
 
-						// Multi-Selects return an array
-						values.push( value );
-					}
-				}
+					if ( parent ) {
 
-				return values;
-			},
+						// :(first|last|only)-(child|of-type)
+						if ( simple ) {
+							while ( dir ) {
+								node = elem;
+								while ( (node = node[ dir ]) ) {
+									if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+										return false;
+									}
+								}
+								// Reverse direction for :only-* (if we haven't yet done so)
+								start = dir = type === "only" && !start && "nextSibling";
+							}
+							return true;
+						}
 
-			set: function( elem, value ) {
-				var values = jQuery.makeArray( value );
+						start = [ forward ? parent.firstChild : parent.lastChild ];
 
-				jQuery(elem).find("option").each(function() {
-					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
-				});
+						// non-xml :nth-child(...) stores cache data on `parent`
+						if ( forward && useCache ) {
+							// Seek `elem` from a previously-cached index
+							outerCache = parent[ expando ] || (parent[ expando ] = {});
+							cache = outerCache[ type ] || [];
+							nodeIndex = cache[0] === dirruns && cache[1];
+							diff = cache[0] === dirruns && cache[2];
+							node = nodeIndex && parent.childNodes[ nodeIndex ];
 
-				if ( !values.length ) {
-					elem.selectedIndex = -1;
-				}
-				return values;
-			}
-		}
-	},
+							while ( (node = ++nodeIndex && node && node[ dir ] ||
 
-	attr: function( elem, name, value ) {
-		var hooks, notxml, ret,
-			nType = elem.nodeType;
+								// Fallback to seeking `elem` from the start
+								(diff = nodeIndex = 0) || start.pop()) ) {
 
-		// don't get/set attributes on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
+								// When found, cache indexes on `parent` and break
+								if ( node.nodeType === 1 && ++diff && node === elem ) {
+									outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+									break;
+								}
+							}
 
-		// Fallback to prop when attributes are not supported
-		if ( typeof elem.getAttribute === core_strundefined ) {
-			return jQuery.prop( elem, name, value );
-		}
+						// Use previously-cached element index if available
+						} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+							diff = cache[1];
 
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+						// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+						} else {
+							// Use the same loop as above to seek `elem` from the start
+							while ( (node = ++nodeIndex && node && node[ dir ] ||
+								(diff = nodeIndex = 0) || start.pop()) ) {
 
-		// All attributes are lowercase
-		// Grab necessary hook if one is defined
-		if ( notxml ) {
-			name = name.toLowerCase();
-			hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
-		}
+								if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+									// Cache the index of each encountered element
+									if ( useCache ) {
+										(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+									}
 
-		if ( value !== undefined ) {
+									if ( node === elem ) {
+										break;
+									}
+								}
+							}
+						}
 
-			if ( value === null ) {
-				jQuery.removeAttr( elem, name );
+						// Incorporate the offset, then check against cycle size
+						diff -= last;
+						return diff === first || ( diff % first === 0 && diff / first >= 0 );
+					}
+				};
+		},
 
-			} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
+		"PSEUDO": function( pseudo, argument ) {
+			// pseudo-class names are case-insensitive
+			// http://www.w3.org/TR/selectors/#pseudo-classes
+			// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+			// Remember that setFilters inherits from pseudos
+			var args,
+				fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+					Sizzle.error( "unsupported pseudo: " + pseudo );
 
-			} else {
-				elem.setAttribute( name, value + "" );
-				return value;
+			// The user may use createPseudo to indicate that
+			// arguments are needed to create the filter function
+			// just as Sizzle does
+			if ( fn[ expando ] ) {
+				return fn( argument );
 			}
 
-		} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-			return ret;
-
-		} else {
-
-			// In IE9+, Flash objects don't have .getAttribute (#12945)
-			// Support: IE9+
-			if ( typeof elem.getAttribute !== core_strundefined ) {
-				ret =  elem.getAttribute( name );
+			// But maintain support for old signatures
+			if ( fn.length > 1 ) {
+				args = [ pseudo, pseudo, "", argument ];
+				return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+					markFunction(function( seed, matches ) {
+						var idx,
+							matched = fn( seed, argument ),
+							i = matched.length;
+						while ( i-- ) {
+							idx = indexOf.call( seed, matched[i] );
+							seed[ idx ] = !( matches[ idx ] = matched[i] );
+						}
+					}) :
+					function( elem ) {
+						return fn( elem, 0, args );
+					};
 			}
 
-			// Non-existent attributes return null, we normalize to undefined
-			return ret == null ?
-				undefined :
-				ret;
+			return fn;
 		}
 	},
 
-	removeAttr: function( elem, value ) {
-		var name, propName,
-			i = 0,
-			attrNames = value && value.match( core_rnotwhite );
+	pseudos: {
+		// Potentially complex pseudos
+		"not": markFunction(function( selector ) {
+			// Trim the selector passed to compile
+			// to avoid treating leading and trailing
+			// spaces as combinators
+			var input = [],
+				results = [],
+				matcher = compile( selector.replace( rtrim, "$1" ) );
 
-		if ( attrNames && elem.nodeType === 1 ) {
-			while ( (name = attrNames[i++]) ) {
-				propName = jQuery.propFix[ name ] || name;
+			return matcher[ expando ] ?
+				markFunction(function( seed, matches, context, xml ) {
+					var elem,
+						unmatched = matcher( seed, null, xml, [] ),
+						i = seed.length;
 
-				// Boolean attributes get special treatment (#10870)
-				if ( rboolean.test( name ) ) {
-					// Set corresponding property to false for boolean attributes
-					// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
-					if ( !getSetAttribute && ruseDefault.test( name ) ) {
-						elem[ jQuery.camelCase( "default-" + name ) ] =
-							elem[ propName ] = false;
-					} else {
-						elem[ propName ] = false;
+					// Match elements unmatched by `matcher`
+					while ( i-- ) {
+						if ( (elem = unmatched[i]) ) {
+							seed[i] = !(matches[i] = elem);
+						}
 					}
+				}) :
+				function( elem, context, xml ) {
+					input[0] = elem;
+					matcher( input, null, xml, results );
+					return !results.pop();
+				};
+		}),
 
-				// See #9699 for explanation of this approach (setting first, then removal)
-				} else {
-					jQuery.attr( elem, name, "" );
-				}
+		"has": markFunction(function( selector ) {
+			return function( elem ) {
+				return Sizzle( selector, elem ).length > 0;
+			};
+		}),
 
-				elem.removeAttribute( getSetAttribute ? name : propName );
+		"contains": markFunction(function( text ) {
+			return function( elem ) {
+				return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+			};
+		}),
+
+		// "Whether an element is represented by a :lang() selector
+		// is based solely on the element's language value
+		// being equal to the identifier C,
+		// or beginning with the identifier C immediately followed by "-".
+		// The matching of C against the element's language value is performed case-insensitively.
+		// The identifier C does not have to be a valid language name."
+		// http://www.w3.org/TR/selectors/#lang-pseudo
+		"lang": markFunction( function( lang ) {
+			// lang value must be a valid identifier
+			if ( !ridentifier.test(lang || "") ) {
+				Sizzle.error( "unsupported lang: " + lang );
 			}
-		}
-	},
+			lang = lang.replace( runescape, funescape ).toLowerCase();
+			return function( elem ) {
+				var elemLang;
+				do {
+					if ( (elemLang = documentIsHTML ?
+						elem.lang :
+						elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
 
-	attrHooks: {
-		type: {
-			set: function( elem, value ) {
-				if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
-					// Setting the type on a radio button after the value resets the value in IE6-9
-					// Reset value to default in case type is set after value during creation
-					var val = elem.value;
-					elem.setAttribute( "type", value );
-					if ( val ) {
-						elem.value = val;
+						elemLang = elemLang.toLowerCase();
+						return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
 					}
-					return value;
-				}
-			}
-		}
-	},
+				} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+				return false;
+			};
+		}),
 
-	propFix: {
-		tabindex: "tabIndex",
-		readonly: "readOnly",
-		"for": "htmlFor",
-		"class": "className",
-		maxlength: "maxLength",
-		cellspacing: "cellSpacing",
-		cellpadding: "cellPadding",
-		rowspan: "rowSpan",
-		colspan: "colSpan",
-		usemap: "useMap",
-		frameborder: "frameBorder",
-		contenteditable: "contentEditable"
-	},
+		// Miscellaneous
+		"target": function( elem ) {
+			var hash = window.location && window.location.hash;
+			return hash && hash.slice( 1 ) === elem.id;
+		},
 
-	prop: function( elem, name, value ) {
-		var ret, hooks, notxml,
-			nType = elem.nodeType;
+		"root": function( elem ) {
+			return elem === docElem;
+		},
 
-		// don't get/set properties on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
+		"focus": function( elem ) {
+			return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+		},
 
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+		// Boolean properties
+		"enabled": function( elem ) {
+			return elem.disabled === false;
+		},
 
-		if ( notxml ) {
-			// Fix name and attach hooks
-			name = jQuery.propFix[ name ] || name;
-			hooks = jQuery.propHooks[ name ];
-		}
+		"disabled": function( elem ) {
+			return elem.disabled === true;
+		},
 
-		if ( value !== undefined ) {
-			if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
+		"checked": function( elem ) {
+			// In CSS3, :checked should return both checked and selected elements
+			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+			var nodeName = elem.nodeName.toLowerCase();
+			return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+		},
 
-			} else {
-				return ( elem[ name ] = value );
+		"selected": function( elem ) {
+			// Accessing this property makes selected-by-default
+			// options in Safari work properly
+			if ( elem.parentNode ) {
+				elem.parentNode.selectedIndex;
 			}
 
-		} else {
-			if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-				return ret;
+			return elem.selected === true;
+		},
 
-			} else {
-				return elem[ name ];
+		// Contents
+		"empty": function( elem ) {
+			// http://www.w3.org/TR/selectors/#empty-pseudo
+			// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
+			//   not comment, processing instructions, or others
+			// Thanks to Diego Perini for the nodeName shortcut
+			//   Greater than "@" means alpha characters (specifically not starting with "#" or "?")
+			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+				if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
+					return false;
+				}
 			}
-		}
-	},
+			return true;
+		},
 
-	propHooks: {
-		tabIndex: {
-			get: function( elem ) {
-				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-				var attributeNode = elem.getAttributeNode("tabindex");
-
-				return attributeNode && attributeNode.specified ?
-					parseInt( attributeNode.value, 10 ) :
-					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-						0 :
-						undefined;
-			}
-		}
-	}
-});
-
-// Hook for boolean attributes
-boolHook = {
-	get: function( elem, name ) {
-		var
-			// Use .prop to determine if this attribute is understood as boolean
-			prop = jQuery.prop( elem, name ),
-
-			// Fetch it accordingly
-			attr = typeof prop === "boolean" && elem.getAttribute( name ),
-			detail = typeof prop === "boolean" ?
-
-				getSetInput && getSetAttribute ?
-					attr != null :
-					// oldIE fabricates an empty string for missing boolean attributes
-					// and conflates checked/selected into attroperties
-					ruseDefault.test( name ) ?
-						elem[ jQuery.camelCase( "default-" + name ) ] :
-						!!attr :
-
-				// fetch an attribute node for properties not recognized as boolean
-				elem.getAttributeNode( name );
-
-		return detail && detail.value !== false ?
-			name.toLowerCase() :
-			undefined;
-	},
-	set: function( elem, value, name ) {
-		if ( value === false ) {
-			// Remove boolean attributes when set to false
-			jQuery.removeAttr( elem, name );
-		} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
-			// IE<8 needs the *property* name
-			elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
-
-		// Use defaultChecked and defaultSelected for oldIE
-		} else {
-			elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
-		}
-
-		return name;
-	}
-};
-
-// fix oldIE value attroperty
-if ( !getSetInput || !getSetAttribute ) {
-	jQuery.attrHooks.value = {
-		get: function( elem, name ) {
-			var ret = elem.getAttributeNode( name );
-			return jQuery.nodeName( elem, "input" ) ?
+		"parent": function( elem ) {
+			return !Expr.pseudos["empty"]( elem );
+		},
 
-				// Ignore the value *property* by using defaultValue
-				elem.defaultValue :
+		// Element/input types
+		"

<TRUNCATED>

[27/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: add in error messages for view query


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

Branch: refs/heads/1867-feature-plugins
Commit: 41203f8ba30efd7ad1258aaf7ed363f32dba0684
Parents: 613821a
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Aug 22 12:43:04 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:44 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js           | 8 +++-----
 src/fauxton/app/templates/documents/view_editor.html | 1 +
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/41203f8b/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 9e1279f..d43f06c 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -919,18 +919,16 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns)
           // 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: ".view.show .all-docs-list.errors-container"
+            selector: ".advanced-options .errors-container"
           });
         });
-
         FauxtonAPI.addNotification({
           msg: "Make sure that strings are properly quoted and any other values are valid JSON structures",
           type: "warning",
-          selector: ".view.show .all-docs-list.errors-container"
+          selector: ".advanced-options .errors-container"
         });
 
         return false;
@@ -994,7 +992,7 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns)
       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",
+        selector: ".advanced-options .errors-container",
         fade: true
       });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/41203f8b/src/fauxton/app/templates/documents/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/view_editor.html b/src/fauxton/app/templates/documents/view_editor.html
index b584208..9aaa503 100644
--- a/src/fauxton/app/templates/documents/view_editor.html
+++ b/src/fauxton/app/templates/documents/view_editor.html
@@ -107,6 +107,7 @@ the License.
     </div>
     <div class="tab-pane" id="query">
       <div class="advanced-options well">
+        <div class="errors-container"></div>
         <form class="view-query-update custom-inputs">
           <div class="controls-group">
             <div class="row-fluid">


[25/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: Fix auth bug not showing accessible page


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

Branch: refs/heads/1867-feature-plugins
Commit: 27b9feb910229ca3ec01f79b7671dd7a9b9adc01
Parents: d8f1201
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Aug 19 17:01:39 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:43 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/auth/base.js   | 3 +--
 src/fauxton/app/addons/auth/routes.js | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/27b9feb9/src/fauxton/app/addons/auth/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/base.js b/src/fauxton/app/addons/auth/base.js
index 3502edd..9f9a332 100644
--- a/src/fauxton/app/addons/auth/base.js
+++ b/src/fauxton/app/addons/auth/base.js
@@ -49,8 +49,7 @@ function(app, FauxtonAPI, Auth) {
     };
 
     var authDenied = function () {
-      app.masterLayout.setView('#dashboard', new Auth.NoAccessView());
-      app.masterLayout.renderView('#dashboard');
+      FauxtonAPI.navigate('/noAccess');
     };
 
     FauxtonAPI.auth.registerAuth(auth);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/27b9feb9/src/fauxton/app/addons/auth/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/routes.js b/src/fauxton/app/addons/auth/routes.js
index ecd45f2..fe40a77 100644
--- a/src/fauxton/app/addons/auth/routes.js
+++ b/src/fauxton/app/addons/auth/routes.js
@@ -52,6 +52,7 @@ function(app, FauxtonAPI, Auth) {
     noAccess: function () {
       this.crumbs = [{name: 'Access Denied', link:"#"}];
       this.setView('#dashboard-content', new Auth.NoAccessView());
+      this.apiUrl = 'noAccess';
     },
   });
 


[34/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Add missing etap file.


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

Branch: refs/heads/1867-feature-plugins
Commit: 529c44705279db5ba36ba05879213df835f8b4a2
Parents: 163a721
Author: Dirkjan Ochtman <dj...@apache.org>
Authored: Wed Aug 7 18:04:05 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:44 2013 +0200

----------------------------------------------------------------------
 test/etap/Makefile.am | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/529c4470/test/etap/Makefile.am
----------------------------------------------------------------------
diff --git a/test/etap/Makefile.am b/test/etap/Makefile.am
index 529cf27..66048a9 100644
--- a/test/etap/Makefile.am
+++ b/test/etap/Makefile.am
@@ -63,6 +63,7 @@ tap_files = \
     074-doc-update-conflicts.t \
     075-auth-cache.t \
     076-file-compression.t \
+    077-couch-db-fast-db-delete-create.t \
     080-config-get-set.t \
     081-config-override.1.ini \
     081-config-override.2.ini \


[03/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: fix pretty print issue by escaping json


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

Branch: refs/heads/1867-feature-plugins
Commit: d8f12018ec0580d2d187fef317487c96c6093588
Parents: d0a35ce
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Aug 19 16:38:06 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/templates/documents/all_docs_item.html     | 2 +-
 src/fauxton/app/templates/documents/doc.html               | 2 +-
 src/fauxton/app/templates/documents/index_row_docular.html | 4 ++--
 src/fauxton/app/templates/documents/index_row_tabular.html | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d8f12018/src/fauxton/app/templates/documents/all_docs_item.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/all_docs_item.html b/src/fauxton/app/templates/documents/all_docs_item.html
index c4c0754..c0e61cf 100644
--- a/src/fauxton/app/templates/documents/all_docs_item.html
+++ b/src/fauxton/app/templates/documents/all_docs_item.html
@@ -15,7 +15,7 @@ the License.
 <td class="select"><input type="checkbox" class="row-select"></td>
 <td>
   <div>
-    <pre class="prettyprint"><%= doc.prettyJSON() %></pre>
+    <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
     <% if (doc.isEditable()) { %>
       <div class="btn-group">
         <a href="#<%= doc.url('app') %>" class="btn btn-small edits">Edit <%= doc.docType() %></a>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d8f12018/src/fauxton/app/templates/documents/doc.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/doc.html b/src/fauxton/app/templates/documents/doc.html
index 92c29ff..81c74c4 100644
--- a/src/fauxton/app/templates/documents/doc.html
+++ b/src/fauxton/app/templates/documents/doc.html
@@ -32,7 +32,7 @@ the License.
   </div>
   <% } %>
 
-  <textarea class="doc-code"><%= JSON.stringify(doc.attributes, null, "  ") %></textarea>
+  <textarea class="doc-code"><%- JSON.stringify(doc.attributes, null, "  ") %></textarea>
   <br />
   <p>
     <button class="save-doc button" type="button">Save</button>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d8f12018/src/fauxton/app/templates/documents/index_row_docular.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/index_row_docular.html b/src/fauxton/app/templates/documents/index_row_docular.html
index 26c0280..3835453 100644
--- a/src/fauxton/app/templates/documents/index_row_docular.html
+++ b/src/fauxton/app/templates/documents/index_row_docular.html
@@ -15,7 +15,7 @@ the License.
 <td class="select"><input type="checkbox"></td>
 <td>
   <div>
-    <pre class="prettyprint"><%= doc.prettyJSON() %></pre>
+    <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
     <% if (doc.isEditable()) { %>
       <div class="btn-group">
         <a href="#<%= doc.url('app') %>" class="btn btn-small edits">Edit <%= doc.docType() %></a>
@@ -23,4 +23,4 @@ the License.
       </div>
     <% } %>
   </div>
-</td>
\ No newline at end of file
+</td>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/d8f12018/src/fauxton/app/templates/documents/index_row_tabular.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/index_row_tabular.html b/src/fauxton/app/templates/documents/index_row_tabular.html
index f52c48c..f211f9e 100644
--- a/src/fauxton/app/templates/documents/index_row_tabular.html
+++ b/src/fauxton/app/templates/documents/index_row_tabular.html
@@ -22,4 +22,4 @@ the License.
   <div>
     <pre class="prettyprint"><%= JSON.stringify(doc.get("value")) %></pre>
   </div>
-</td>
\ No newline at end of file
+</td>


[50/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
add plugins plugin for Fauxton


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

Branch: refs/heads/1867-feature-plugins
Commit: 8aad4507f963439001ad91ef2064bc3e4698baf9
Parents: addaccb
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Sep 9 11:22:01 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:52:25 2013 +0200

----------------------------------------------------------------------
 .gitignore                                      |  1 +
 src/fauxton/app/addons/plugins/base.js          | 24 ++++++
 src/fauxton/app/addons/plugins/resources.js     | 26 ++++++
 src/fauxton/app/addons/plugins/routes.js        | 47 +++++++++++
 .../app/addons/plugins/templates/plugins.html   | 88 ++++++++++++++++++++
 src/fauxton/settings.json.default               |  1 +
 6 files changed, 187 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8aad4507/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 6c67ab7..d93c545 100644
--- a/.gitignore
+++ b/.gitignore
@@ -90,6 +90,7 @@ src/fauxton/app/load_addons.js
 src/fauxton/app/addons/*
 !src/fauxton/app/addons/activetasks
 !src/fauxton/app/addons/config
+!src/fauxton/app/addons/plugins
 !src/fauxton/app/addons/logs
 !src/fauxton/app/addons/stats
 !src/fauxton/app/addons/contribute

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8aad4507/src/fauxton/app/addons/plugins/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/plugins/base.js b/src/fauxton/app/addons/plugins/base.js
new file mode 100644
index 0000000..140a1f8
--- /dev/null
+++ b/src/fauxton/app/addons/plugins/base.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/plugins/routes"
+],
+
+function(app, FauxtonAPI, plugins) {
+  plugins.initialize = function() {
+    FauxtonAPI.addHeaderLink({title: "Plugins", href: "#_plugins", icon: "fonticon-plugins", className: 'plugins'});
+  };
+  return plugins;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8aad4507/src/fauxton/app/addons/plugins/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/plugins/resources.js b/src/fauxton/app/addons/plugins/resources.js
new file mode 100644
index 0000000..d00fada
--- /dev/null
+++ b/src/fauxton/app/addons/plugins/resources.js
@@ -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.
+
+define([
+  "app",
+  "api"
+],
+
+function (app, FauxtonAPI) {
+  var plugins = FauxtonAPI.addon();
+
+  plugins.Hello = FauxtonAPI.View.extend({
+    template: "addons/plugins/templates/plugins"
+  });
+
+  return plugins;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8aad4507/src/fauxton/app/addons/plugins/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/plugins/routes.js b/src/fauxton/app/addons/plugins/routes.js
new file mode 100644
index 0000000..24d47f0
--- /dev/null
+++ b/src/fauxton/app/addons/plugins/routes.js
@@ -0,0 +1,47 @@
+// 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/plugins/resources"
+],
+function(app, FauxtonAPI, plugins) {
+      var  PluginsRouteObject = FauxtonAPI.RouteObject.extend({
+        layout: "one_pane",
+
+        crumbs: [
+          {"name": "Plugins","link": "_plugins"}
+        ],
+
+        routes: {
+           "_plugins": "pluginsRoute"
+        },
+
+        selectedHeader: "Plugins",
+
+        roles: ["_admin"],
+
+        apiUrl:'plugins',
+
+        initialize: function () {
+            //put common views used on all your routes here (eg:  sidebars )
+        },
+
+        pluginsRoute: function () {
+          this.setView("#dashboard-content", new plugins.Hello({}));
+        }
+      });
+
+      plugins.RouteObjects = [PluginsRouteObject];
+  return plugins;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8aad4507/src/fauxton/app/addons/plugins/templates/plugins.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/plugins/templates/plugins.html b/src/fauxton/app/addons/plugins/templates/plugins.html
new file mode 100644
index 0000000..3a49c28
--- /dev/null
+++ b/src/fauxton/app/addons/plugins/templates/plugins.html
@@ -0,0 +1,88 @@
+    <div id="content">
+      <div class="row">
+        <h2>GeoCouch</h2>
+        <p>Version: <strong>couchdb1.2.x_v0.3.0-11-g66e6219</strong></p>
+        <p>Author: Volker Mische</p>
+        <p>
+          Available Erlang Versions:
+          <ul>
+            <li>CouchDB 1.4.0-XXX R15B01</li>
+          </ul>
+        </p>
+        <p>
+          <button href="#" class="install-plugin" data-url="http://people.apache.org/~jan" data-checksums='{"1.4.0": {"R15B03":"D5QPhrJTAifM42DXqAj4RxzfEtI="}}' data-name="geocouch" data-version="couchdb1.2.x_v0.3.0-16-g66e6219">Install GeoCouch Now</button>
+        </p>
+      </div>
+      <div class="row">
+        <h2>CouchPerUser</h2>
+        <p>Version: <strong>1.0.0</strong></p>
+        <p>Author: Bob Ippolito</p>
+        <p>
+          Available Erlang Versions:
+          <ul>
+            <li>CouchDB 1.4.0-XXX R15B01</li>
+          </ul>
+        </p>
+        <p>
+          <button href="#" class="install-plugin" data-url="http://people.apache.org/~jan" data-checksums='{"1.4.0": {"R15B03":"Aj3mjC6M75NA62q5/xkP0tl8Hws="}}' data-name="couchperuser" data-version="1.0.0">Install CouchPerUser Now</button>
+        </p>
+      </div>
+    </div>
+  </div></body>
+  <script>
+    $('.install-plugin').each(function() {
+      var button = $(this);
+      var name = button.data('name');
+      var version = button.data('version');
+      $.get("/_config/plugins/" + name + "/", function(body, textStatus) {
+        body = JSON.parse(body);
+        if(body == version) {
+          button.html('Already Installed. Click to Uninstall');
+          button.data('delete', true);
+        } else {
+          button.html('Other Version Installed: ' + body);
+          button.attr('disabled', true);
+        }
+      });
+    });
+
+    $('.install-plugin').click(function(event) {
+      var button = $(this);
+      var delete_plugin = button.data('delete') || false;
+      var plugin_spec = JSON.stringify({
+        name: button.data('name'),
+        url: button.data('url'),
+        version: button.data('version'),
+        checksums: button.data('checksums'),
+        "delete": delete_plugin
+      });
+      var url = '/_plugins'
+      $.ajax({
+        url: url,
+        type: 'POST',
+        data: plugin_spec,
+        contentType: 'application/json', // what we send to the server
+        dataType: 'json', // expected from the server
+        processData: false, // keep our precious JSON
+        success: function(data, textStatus, jqXhr) {
+          if(textStatus == "success") {
+            var action = delete_plugin ? 'Uninstalled' : 'Installed';
+            button.html('Sucessfully ' + action);
+            button.attr('disabled', true);
+          } else {
+            button.html(textStatus);
+          }
+        },
+        beforeSend: function(xhr) {
+          xhr.setRequestHeader('Accept', 'application/json');
+        },
+      });
+    });
+  </script>
+  <style type="text/css">
+  .row {
+    background-color: #FFF;
+    padding:1em;
+    margin-bottom:1em;
+  }
+  </style>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8aad4507/src/fauxton/settings.json.default
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default
index 2b7fe89..1218700 100644
--- a/src/fauxton/settings.json.default
+++ b/src/fauxton/settings.json.default
@@ -4,6 +4,7 @@
   { "name": "config" },
   { "name": "logs" },
   { "name": "stats" },
+  { "name": "plugins" },
   { "name": "contribute" },
   { "name": "auth" }
   ],


[41/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fixing cases of resize collumns to use the generic selectors


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

Branch: refs/heads/1867-feature-plugins
Commit: e422d9ee6a79df041a4b843849ac6143b8789381
Parents: e361dcc
Author: suelockwood <de...@gmail.com>
Authored: Fri Sep 6 10:51:15 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js               | 5 -----
 src/fauxton/app/modules/fauxton/base.js                  | 4 +---
 src/fauxton/app/templates/documents/view_editor.html     | 2 +-
 src/fauxton/app/templates/layouts/with_tabs_sidebar.html | 2 +-
 4 files changed, 3 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e422d9ee/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 8f9af49..6b63c15 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -1192,11 +1192,6 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns)
 
     afterRender: function() {
 
-      //resizeAnimation
-      app.resizeColumns = new resizeColumns({
-            selectorElements: '#dashboard-content, #dashboard-upper-menu, #db-views-tabs-nav'
-      });
-      app.resizeColumns.onResizeHandler();
 
       var that = this, 
           mapFun = this.$("#map-function"),

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e422d9ee/src/fauxton/app/modules/fauxton/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/fauxton/base.js b/src/fauxton/app/modules/fauxton/base.js
index 0b11849..8fa40fa 100644
--- a/src/fauxton/app/modules/fauxton/base.js
+++ b/src/fauxton/app/modules/fauxton/base.js
@@ -22,9 +22,7 @@ function(app, Backbone, resizeColumns) {
 
 
    //resizeAnimation
-   app.resizeColumns = new resizeColumns({
-        selectorElements: '#dashboard-content, #dashboard-upper-menu'
-   });
+   app.resizeColumns = new resizeColumns({});
    app.resizeColumns.onResizeHandler();
 
   var Fauxton = app.module();

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e422d9ee/src/fauxton/app/templates/documents/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/view_editor.html b/src/fauxton/app/templates/documents/view_editor.html
index 9aaa503..13b92b1 100644
--- a/src/fauxton/app/templates/documents/view_editor.html
+++ b/src/fauxton/app/templates/documents/view_editor.html
@@ -12,7 +12,7 @@ License for the specific language governing permissions and limitations under
 the License.
 -->
 <div class="row">
-  <ul class="nav nav-tabs" id="db-views-tabs-nav">
+  <ul class="nav nav-tabs window-resizeable" id="db-views-tabs-nav">
     <li class="active"> <a class="fonticon-wrench fonticon" data-toggle="tab" href="#index"><% if (newView) { %>Create Index <% } else { %>Edit Index <% } %></a></li>
     <li><a class="fonticon-plus fonticon" href="#query" data-toggle="tab">Advanced Options</a></li>
     <li><a href="#metadata" data-toggle="tab">Design Doc Metadata</a></li>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e422d9ee/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/layouts/with_tabs_sidebar.html b/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
index 69d723b..d4efc8d 100644
--- a/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
+++ b/src/fauxton/app/templates/layouts/with_tabs_sidebar.html
@@ -29,7 +29,7 @@ the License.
 
     <section id="dashboard-content" class="list pull-right window-resizeable">
       <div class="inner">
-        <div id="dashboard-upper-menu"></div>
+        <div id="dashboard-upper-menu" class="window-resizeable"></div>
         <div id="dashboard-upper-content"></div>
 
         <div id="dashboard-lower-content"></div>


[28/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
improved styling for query controls


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

Branch: refs/heads/1867-feature-plugins
Commit: 613821a548ab5f2c61f274ef67beb6e56c21709f
Parents: 0cfd582
Author: sean barclay <fu...@hotmail.com>
Authored: Wed Aug 21 10:25:31 2013 -0700
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:44 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/templates/documents/doc.html    |   2 +-
 .../app/templates/documents/view_editor.html    | 142 ++++++++-------
 src/fauxton/assets/less/fauxton.less            | 174 +++++++++++++++++--
 3 files changed, 228 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/613821a5/src/fauxton/app/templates/documents/doc.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/doc.html b/src/fauxton/app/templates/documents/doc.html
index 81c74c4..d6577af 100644
--- a/src/fauxton/app/templates/documents/doc.html
+++ b/src/fauxton/app/templates/documents/doc.html
@@ -35,7 +35,7 @@ the License.
   <textarea class="doc-code"><%- JSON.stringify(doc.attributes, null, "  ") %></textarea>
   <br />
   <p>
-    <button class="save-doc button" type="button">Save</button>
+    <button class="save-doc btn btn-success btn-large save" type="button">Save</button>
   </p>
 
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/613821a5/src/fauxton/app/templates/documents/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/view_editor.html b/src/fauxton/app/templates/documents/view_editor.html
index 3f0d959..b584208 100644
--- a/src/fauxton/app/templates/documents/view_editor.html
+++ b/src/fauxton/app/templates/documents/view_editor.html
@@ -91,11 +91,10 @@ the License.
             </div>
           </div>
           <div class="control-group">
-            <hr />
             <div class="controls">
-              <button class="btn btn-success save">Save</button>
+              <button class="btn btn-success btn-large save">Save</button>
               <% if (!this.newView) { %>
-              <button class="btn btn-danger delete">Delete</button>
+              <button class="btn btn-danger btn-large delete">Delete</button>
               <% } %>
             </div>
           </div>
@@ -108,80 +107,79 @@ the License.
     </div>
     <div class="tab-pane" id="query">
       <div class="advanced-options well">
-        <form class="view-query-update">
-          <div class="row-fluid">
-            <div class="controls controls-row">
-              <input name="key" class="span6" type="text" placeholder="Key">
-              <input name="keys" class="span6" type="text" placeholder="Keys">
+        <form class="view-query-update custom-inputs">
+          <div class="controls-group">
+            <div class="row-fluid">
+              <div class="controls controls-row">
+                <input name="key" class="span6" type="text" placeholder="Key">
+                <input name="keys" class="span6" type="text" placeholder="Keys">
+              </div>
             </div>
-          </div>
-          <div class="row-fluid">
-            <div class="controls controls-row">
-              <input name="startkey" class="span6" type="text" placeholder="Start Key">
-              <input name="endkey" class="span6" type="text" placeholder="End Key">
+            <div class="row-fluid">
+              <div class="controls controls-row">
+                <input name="startkey" class="span6" type="text" placeholder="Start Key">
+                <input name="endkey" class="span6" type="text" placeholder="End Key">
+              </div>
             </div>
           </div>
-          <div class="row-fluid">
-            <div class="controls controls-row">
-
-              <label class="checkbox inline">
-                <input name="include_docs" type="checkbox" value="true"> Include Docs
-              </label>
-
-              <% if (hasReduce) { %>
-              <label class="checkbox inline">
-                <input name="reduce" type="checkbox" value="true"> Reduce
-              </label>
-
-              <label class="checkbox inline">
-                Group Level:
-                <select 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 class="controls controls-row">
-              <label class="checkbox inline">
-                <input name="stale" type="checkbox" value="ok"> Stale
-              </label>
-              <label class="checkbox inline">
-                <input name="descending" type="checkbox" value="true"> Descending
-              </label>
-              <label class="checkbox inline">
-                Limit:
-                <select name="limit" class="input-small">
-                  <option>5</option>
-                  <option selected="selected">10</option>
-                  <option>25</option>
-                  <option>50</option>
-                  <option>100</option>
-                </select>
-              </label>
-            </div>
-            <div class="controls controls-row">
-              <label class="checkbox inline">
-                <input name="inclusive_end" type="checkbox" value="false"> Disable Inclusive End
-              </label>
-              <label class="checkbox inline">
-                <input name="update_seq" type="checkbox" value="true"> Include Update Sequence
-              </label>
+          <div class="controls-group">
+            <div class="row-fluid">
+              <div class="controls controls-row">
+                <div class="checkbox inline">  
+                  <input id="check1" type="checkbox" name="include_docs" value="true">  
+                  <label name="include_docs" for="check1">Include Docs</label>  
+                  <% if (hasReduce) { %>
+                  <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="checkbox inline">  
+                  <input id="check3" name="stale" type="checkbox" value="ok">
+                  <label for="check3">Stale</label>
+                  <input id="check4" name="descending" type="checkbox" value="true">  
+                  <label for="check4">Descending</label>  
+                </div> 
+                <label class="drop-down inline">
+                  Limit:
+                  <select name="limit" class="input-small">
+                    <option>5</option>
+                    <option selected="selected">10</option>
+                    <option>25</option>
+                    <option>50</option>
+                    <option>100</option>
+                  </select>
+                </label>
+                <div class="checkbox inline">  
+                  <input id="check5" name="inclusive_end" type="checkbox" value="false">
+                  <label for="check5">Disable Inclusive End</label>
+                  <input id="check6" name="update_seq" type="checkbox" value="true">  
+                  <label for="check6">Descending</label>  
+                </div>
+              </div>
             </div>
           </div>
-          <div class="row-fluid">
-            <div class="controls controls-row">
-              <button type="submit" class="btn btn-primary">Query</button>
-              <button class="btn btn-info preview">Preview</button>
+          <div class="controls-group">
+            <div class="row-fluid">
+              <div class="controls controls-row">
+                <button type="submit" class="btn btn-primary btn-large">Query</button>
+                <button class="btn btn-info btn-large preview">Preview</button>
+              </div>
             </div>
           </div>
         </form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/613821a5/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 49c973a..fcaf884 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -74,7 +74,7 @@
 
 /*buttons */
 @redButton: @red;
-@linkColor: @darkRed;
+@linkColor: @red;
 
 @boxShadow: 2px 2px rgba(0,0,0,0.2);
 @boxShadowOff: 2px 2px rgba(0,0,0,0);
@@ -207,6 +207,7 @@ a:hover{
 
   .navbar {
     .brand {
+      .box-sizing(content-box);
       .hide-text;
       .customTransition(left, 1s, 0.805, 0.005, 0.165, 0.985);
       margin: 10px 0 6px;
@@ -214,6 +215,7 @@ a:hover{
       height: 40px;
       padding: 10px;
       .icon{
+        .box-sizing(content-box);
         background: url(../img/minilogo.png) no-repeat 0 0;
         display: block;
         height: 100%;
@@ -430,7 +432,6 @@ a:hover{
 }
 
 #breadcrumbs {
-   
    padding: 15px 20px;
    .breadcrumb {
     margin-bottom: 0;
@@ -447,6 +448,9 @@ a:hover{
       color: @breadcrumbText;
       font-size: 18px;
       text-shadow: none;
+      &.active{
+        color: #333;
+      }
       a{
         color: @breadcrumbText;
       }
@@ -568,16 +572,20 @@ footer#mainFooter{
   padding: 0 20px;
 }
 
-.nav-tabs > li > a {
+.nav-tabs > li{
+  margin-right: 2px;
+  > a {
+  color: #333;
   border-color: #eeeeee #eeeeee #dddddd;
   text-decoration: none;
   background-color: #eeeeee;
   border-radius: 0;
   border-left: none;
   border-right: none;
-  &.fonticon:before{
-    margin-right: 6px;
-    font-size: 16px;
+    &.fonticon:before{
+      margin-right: 6px;
+      font-size: 16px;
+    }
   }
 }
 
@@ -597,6 +605,18 @@ footer#mainFooter{
   margin-top: 70px;
 }
 
+.well { 
+  .controls-group {
+  &:first-child, &:last-child{
+    margin-top: 24px;
+  }
+  margin-bottom: 8px;
+  }
+  .controls-row {
+    margin-bottom: 8px;
+  }
+}
+
 /*TABLE STYLES*/
 table.databases {clear: both;}
 thead {border-bottom: 2px solid @redButton;}
@@ -678,10 +698,12 @@ tbody {padding-top: 10px;}
 
 input[type=text], input[type=password],
 .navbar-form input{
-  padding: 7px;
-  margin-top: -5px;
-  border: 1px solid @inputBorder;
   .border-radius(0);
+  padding: 12px;
+  margin-top: -4px;
+  border: 1px solid #ccc;
+  height: auto;
+  font-size: 16px;
 }
 
 
@@ -689,19 +711,128 @@ input[type=checkbox]{
 
 }
 label.fonticon-search {
+  .box-sizing(content-box);
   position: relative;
   &:before {
+    .transition(all .25s linear);
+    font-size: 16px;
     position: absolute;
-    right: -35px;
+    right: -47px;
     background-color: #E1E1E1;
-    height: 18px;
-    width: 18px;
-    border: 1px solid @inputBorder;
-    padding: 8px;
-    top: -5px;
+    height: 46px;
+    width: 48px;
+    border: 1px solid #cccccc;
+    padding: 14px;
+    top: -4px;
   }
+  &:hover{
+    color:white;
+    &:before {
+      background-color: @red;
+    }
+  }
+}
+
+*, *:before, *:after {
+  .box-sizing(border-box);
+}
+
+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;
+}
+
+.well select {
+  margin: 0;
 }
 
+form.custom .hidden-field {
+  margin-left: -99999px;
+  position: absolute;
+  visibility: hidden;
+}
+
+label{
+  padding-left: 25px;  
+  margin-right: 15px; 
+  display: inline-block;  
+  cursor: pointer;  
+  position: relative;  
+  font-size: 14px;  
+}
+
+.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-actions {
   background: none;
   border: none;
@@ -783,11 +914,20 @@ div.spinner {
   .input-append.input-prepend {
     margin-bottom: 0px;
     .add-on {
+      margin-top: -4px;
+      background: none;
+      padding: 14px 12px 32px 12px;
       border: none;
-      padding-right: 25px;
     }
     .btn:last-child{
-      margin-left: 15px;
+      margin-left: -1px;
+      margin-top: -4px;
+      background: none;
+      padding: 13px 12px 11px 12px;
+      &:hover{
+        background-color: @red;
+        color: white;
+      }
     }
   }
 }


[07/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Making nav bar match the comps with bottom footer
Add documentation link


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

Branch: refs/heads/1867-feature-plugins
Commit: a36168aae6129922922ee51d4fed9d953bcacc7f
Parents: 6eb21ed
Author: suelockwood <de...@gmail.com>
Authored: Tue Aug 13 11:07:18 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/templates/fauxton/nav_bar.html | 50 +++++++++++++--------
 src/fauxton/assets/less/fauxton.less           |  6 +--
 2 files changed, 34 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/a36168aa/src/fauxton/app/templates/fauxton/nav_bar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/fauxton/nav_bar.html b/src/fauxton/app/templates/fauxton/nav_bar.html
index 636d176..64a0336 100644
--- a/src/fauxton/app/templates/fauxton/nav_bar.html
+++ b/src/fauxton/app/templates/fauxton/nav_bar.html
@@ -29,26 +29,38 @@ the License.
     <% }); %>
   </ul>
 
+  <div id="footer-links">
+
     <ul id="bottom-nav-links" class="nav">
-    <% _.each(bottomNavLinks, function(link) { %>
-    <% if (link.view) {return;}  %>
-      <li data-nav-name= "<%= link.title %>">
-          <a class="<%= link.icon %> fonticon" href="<%= link.href %>">
-              <%= link.title %>
-          </a>
-      </li>
-    <% }); %>
-  </ul>
-  <ul id="footer-nav-links" class="nav">
-    <% _.each(footerNavLinks, function(link) { %>
-    <% if (link.view) {return;}  %>
-      <li data-nav-name= "<%= link.title %>">
-          <a class="<%= link.icon %> fonticon" href="<%= link.href %>">
-              <%= link.title %>
-          </a>
-      </li>
-    <% }); %>
-  </ul>
+        <li data-nav-name= "Documentation">
+            <a class="fonticon-bookmark fonticon" target="_blank" href="http://docs.couchdb.org/en/latest/">
+                Documentation
+            </a>
+        </li>
+
+
+      <% _.each(bottomNavLinks, function(link) { %>
+      <% if (link.view) {return;}  %>
+        <li data-nav-name= "<%= link.title %>">
+            <a class="<%= link.icon %> fonticon" href="<%= link.href %>">
+                <%= link.title %>
+            </a>
+        </li>
+      <% }); %>
+    </ul>
+
+    <ul id="footer-nav-links" class="nav">
+      <% _.each(footerNavLinks, function(link) { %>
+      <% if (link.view) {return;}  %>
+        <li data-nav-name= "<%= link.title %>">
+            <a class="<%= link.icon %> fonticon" href="<%= link.href %>">
+                <%= link.title %>
+            </a>
+        </li>
+      <% }); %>
+    </ul>
+
+  </div>
 </nav>
 
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/a36168aa/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 4beb18c..0b72c6d 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -31,7 +31,7 @@
 @red: #E93F33;
 @darkred: #73161E;
 @linkRed: #DA4F49;
-
+@greyBrown: #554D4C;
 @fontGrey: #808080;
 @secondarySidebar: #E4DFDC;
 
@@ -40,12 +40,12 @@
 
 /*nav*/
 @primaryNav : @brown;
-@navBG: @bottomNav;
+@navBG: @darkred;
 @navBGHighlight: @red;
 @navBGHover: @red;
 @navIconColor: @darkred;
 @navIconHighlight: #FFFFFF;
-@bottomNav: @darkred;
+@bottomNav: @greyBrown;
 
 /*top header*/
 @breadcrumbBG: #F1F1F1;


[11/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Added Sue and Garren to the list of authors


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

Branch: refs/heads/1867-feature-plugins
Commit: 8a7b9caee2ec789ac4e71d1f872912c35c070b70
Parents: ae74a33
Author: suelockwood <de...@gmail.com>
Authored: Wed Aug 14 11:00:38 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 AUTHORS | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8a7b9cae/AUTHORS
----------------------------------------------------------------------
diff --git a/AUTHORS b/AUTHORS
index dd44fda..37f9c05 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -24,5 +24,7 @@ documentation or developing software. Some of these people are:
  * Dale Harvey <da...@apache.org>
  * Dirkjan Ochtman <dj...@apache.org>
  * Alexander Shorin <kx...@apache.org>
+ * Garren Smith <ga...@apache.org>
+ * Sue Lockwood <de...@apache.org>
 
 For a list of other credits see the `THANKS` file.


[10/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: update watch file to run on addon html and less changes


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

Branch: refs/heads/1867-feature-plugins
Commit: 89868bc1b67dd017f543fda260e45e4b12975d2d
Parents: 8a7b9ca
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Aug 15 10:46:14 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/89868bc1/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 9cb7e2e..f25e3b8 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -231,7 +231,11 @@ module.exports = function(grunt) {
       },
       style: {
         files: helper.watchFiles(['.less','.css'],["./app/**/*.css","./app/**/*.less","./assets/**/*.css", "./assets/**/*.less"]),
-        tasks: ['less', 'concat:index_css'],
+        tasks: ['clean:watch', 'dependencies','less', 'concat:index_css'],
+      },
+      html: {
+        files: helper.watchFiles(['.html'], []),
+        tasks: ['clean:watch', 'dependencies']
       },
       options: {
         nospawn: true,
@@ -328,7 +332,6 @@ module.exports = function(grunt) {
       grunt.config(['jshint', 'all'], filepath);
     }
 
-    console.log(filepath);
     if (!!filepath.match(/[Ss]pec.js$/)) {
       grunt.task.run(['mochaSetup','mocha_phantomjs']);
     }


[32/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Remove couchdb_updates files (content already in top-level LICENSE/NOTICE).


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

Branch: refs/heads/1867-feature-plugins
Commit: 163a721023ef2b514d0509fa81cc038e85f784ba
Parents: 7b2ef85
Author: Dirkjan Ochtman <dj...@apache.org>
Authored: Wed Aug 7 18:00:37 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:44 2013 +0200

----------------------------------------------------------------------
 src/couch_dbupdates/LICENSE   | 22 ----------------------
 src/couch_dbupdates/NOTICE    |  6 ------
 src/couch_dbupdates/README.md | 32 --------------------------------
 3 files changed, 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/163a7210/src/couch_dbupdates/LICENSE
----------------------------------------------------------------------
diff --git a/src/couch_dbupdates/LICENSE b/src/couch_dbupdates/LICENSE
deleted file mode 100644
index a089916..0000000
--- a/src/couch_dbupdates/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-2009-2012 (c) Benoît Chesneau <be...@e-engura.org>
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/163a7210/src/couch_dbupdates/NOTICE
----------------------------------------------------------------------
diff --git a/src/couch_dbupdates/NOTICE b/src/couch_dbupdates/NOTICE
deleted file mode 100644
index ee00a85..0000000
--- a/src/couch_dbupdates/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-couch_dbupdates
----------------
-
-2012 (c) Benoît Chesneau <be...@refuge.io>
-
-couch_dbupdates is released under the Apache License 2.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/163a7210/src/couch_dbupdates/README.md
----------------------------------------------------------------------
diff --git a/src/couch_dbupdates/README.md b/src/couch_dbupdates/README.md
deleted file mode 100644
index c683102..0000000
--- a/src/couch_dbupdates/README.md
+++ /dev/null
@@ -1,32 +0,0 @@
-# couch_dbupdates
-
-`couch_dbupdates` is a simple couchdb modules to receive databases
-events in couchdb node.
-
-It's actually **supported by all the [refuge](http://refuge.io) projects**:
-
-- [refuge](https://github.com/refuge/refuge)
-- [rcouch](https://github.com/refuge/rcouch)
-- [rcouch_template](https://github.com/refuge/rcouch_template)
-
-
-## HTTP API
-
-To get db events, do a GET to `/_db_updates` .
-
-You can pass an optional query parameters:
-
-* `feed` The feed can be `longpoll` (default) for longpolling, `eventsource`
-  for event stream or `continuous` for continuous feed.
-* `timeout`: timeout before the longpolling connection close or when the
-  heartbeat is emitted.
-* `heartbeat`: true, or false. an empty line is emittend when the
-  timeout occurs to maintain the connection active.
-
-
-## Example of usage
-
-    $ curl http://127.0.0.1:5984/_db_updates?feed=continuous
-    {"type":"created","db_name":"testdb"}
-    {"type":"updated","db_name":"testdb"}
-    {"type":"deleted","db_name":"testdb"}


[33/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Add empty line to LICENSE for readability.


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

Branch: refs/heads/1867-feature-plugins
Commit: 7b2ef8563eead44fbbc11f1525332282a9f51e90
Parents: b536843
Author: Dirkjan Ochtman <dj...@apache.org>
Authored: Wed Aug 7 17:57:18 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:44 2013 +0200

----------------------------------------------------------------------
 LICENSE | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b2ef856/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 9f9d856..5acc95e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -895,6 +895,7 @@ For the src/couch_dbupdates component
   2009-2012 (c) Benoît Chesneau <be...@e-engura.org>
 
   Apache 2 License, see above.
+
 For src/fauxton/test/mocha/mocha.js and src/fauxton/test/mocha/mocha.js
 
   Copyright (c) 2011-2013 TJ Holowaychuk <tj...@vision-media.ca>


[19/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Update codemirror to v2.38


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

Branch: refs/heads/1867-feature-plugins
Commit: 8905089f3f94e7b0ad781e9cbdd57f5127830c0a
Parents: 1cf1612
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Aug 19 13:19:37 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:43 2013 +0200

----------------------------------------------------------------------
 src/fauxton/assets/css/codemirror.css    |   31 +-
 src/fauxton/assets/js/libs/codemirror.js | 1596 ++++++++++++-------------
 2 files changed, 798 insertions(+), 829 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8905089f/src/fauxton/assets/css/codemirror.css
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/css/codemirror.css b/src/fauxton/assets/css/codemirror.css
index fb5b6d5..3fcbc44 100644
--- a/src/fauxton/assets/css/codemirror.css
+++ b/src/fauxton/assets/css/codemirror.css
@@ -9,8 +9,7 @@
 }
 
 .CodeMirror-scroll {
-  overflow-x: auto;
-  overflow-y: hidden;
+  overflow: auto;
   height: 300px;
   /* This is needed to prevent an IE[67] bug where the scrolled content
      is visible outside of the scrolling box. */
@@ -20,13 +19,11 @@
 
 /* Vertical scrollbar */
 .CodeMirror-scrollbar {
-  float: right;
+  position: absolute;
+  right: 0; top: 0;
   overflow-x: hidden;
   overflow-y: scroll;
-
-  /* This corrects for the 1px gap introduced to the left of the scrollbar
-     by the rule for .CodeMirror-scrollbar-inner. */
-  margin-left: -1px;
+  z-index: 5;
 }
 .CodeMirror-scrollbar-inner {
   /* This needs to have a nonzero width in order for the scrollbar to appear
@@ -69,10 +66,6 @@
   white-space: pre;
   cursor: text;
 }
-.CodeMirror-lines * {
-  /* Necessary for throw-scrolling to decelerate properly on Safari. */
-  pointer-events: none;
-}
 
 .CodeMirror pre {
   -moz-border-radius: 0;
@@ -87,6 +80,7 @@
   word-wrap: normal;
   line-height: inherit;
   color: inherit;
+  overflow: visible;
 }
 
 .CodeMirror-wrap pre {
@@ -152,18 +146,31 @@ div.CodeMirror-selected { background: #d9d9d9; }
 .cm-s-default span.cm-error {color: #f00;}
 .cm-s-default span.cm-qualifier {color: #555;}
 .cm-s-default span.cm-builtin {color: #30a;}
-.cm-s-default span.cm-bracket {color: #cc7;}
+.cm-s-default span.cm-bracket {color: #997;}
 .cm-s-default span.cm-tag {color: #170;}
 .cm-s-default span.cm-attribute {color: #00c;}
 .cm-s-default span.cm-header {color: blue;}
 .cm-s-default span.cm-quote {color: #090;}
 .cm-s-default span.cm-hr {color: #999;}
 .cm-s-default span.cm-link {color: #00c;}
+span.cm-negative {color: #d44;}
+span.cm-positive {color: #292;}
 
 span.cm-header, span.cm-strong {font-weight: bold;}
 span.cm-em {font-style: italic;}
 span.cm-emstrong {font-style: italic; font-weight: bold;}
 span.cm-link {text-decoration: underline;}
 
+span.cm-invalidchar {color: #f00;}
+
 div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
 div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
+
+@media print {
+
+  /* Hide the cursor when printing */
+  .CodeMirror pre.CodeMirror-cursor {
+    visibility: hidden;
+  }
+}
+


[31/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fixed a typo on --db-dir description

Signed-off-by: Alexander Shorin <kx...@apache.org>


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

Branch: refs/heads/1867-feature-plugins
Commit: b536843ffc7ff25c4eb4bc4ceedaecc770e4aaa4
Parents: 284c787
Author: Filippo Fadda <fi...@gmail.com>
Authored: Thu Aug 22 18:05:59 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:44 2013 +0200

----------------------------------------------------------------------
 bin/couch-config.tpl.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b536843f/bin/couch-config.tpl.in
----------------------------------------------------------------------
diff --git a/bin/couch-config.tpl.in b/bin/couch-config.tpl.in
index dee337d..bd27d0e 100644
--- a/bin/couch-config.tpl.in
+++ b/bin/couch-config.tpl.in
@@ -56,7 +56,7 @@ Options:
   --erl-libs-dir    Erlang library directory
   --erl-bin         Erlang binary
   --config-dir      configuration directory
-  --db-dir          database dirrectory
+  --db-dir          database directory
   --view-dir        view index directory
   --static-dir      static asset directory
   --doc-dir         documentation directory


[40/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Update minor version number for next release


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

Branch: refs/heads/1867-feature-plugins
Commit: 9a5fe75b78d5e37992e98891618d403addd92882
Parents: 3e3f266
Author: Dirkjan Ochtman <dj...@apache.org>
Authored: Wed Sep 4 09:32:54 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 acinclude.m4.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9a5fe75b/acinclude.m4.in
----------------------------------------------------------------------
diff --git a/acinclude.m4.in b/acinclude.m4.in
index 6423cfc..cdd931f 100644
--- a/acinclude.m4.in
+++ b/acinclude.m4.in
@@ -17,7 +17,7 @@ m4_define([LOCAL_PACKAGE_TARNAME], [apache-couchdb])
 m4_define([LOCAL_PACKAGE_NAME], [Apache CouchDB])
 m4_define([LOCAL_BUG_URI], [https://issues.apache.org/jira/browse/COUCHDB])
 m4_define([LOCAL_VERSION_MAJOR], [1])
-m4_define([LOCAL_VERSION_MINOR], [4])
+m4_define([LOCAL_VERSION_MINOR], [5])
 m4_define([LOCAL_VERSION_REVISION], [0])
 m4_define([LOCAL_VERSION_STAGE], [+build])
 m4_define([LOCAL_VERSION_RELEASE], [.%revision%])


[17/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: update jquery to 1.10.2


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

Branch: refs/heads/1867-feature-plugins
Commit: 59629049dd856260711c22c807012b5352354be2
Parents: 32153bf
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Aug 20 15:32:59 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:43 2013 +0200

----------------------------------------------------------------------
 src/fauxton/assets/js/libs/jquery.js | 8596 +++++++++++++++--------------
 1 file changed, 4394 insertions(+), 4202 deletions(-)
----------------------------------------------------------------------



[05/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
document header config for cors


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

Branch: refs/heads/1867-feature-plugins
Commit: ce71976a6bd68bd05cc8bc82743cc81dd60721bb
Parents: 34006fe
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Aug 16 18:18:51 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 share/doc/src/configuring.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ce71976a/share/doc/src/configuring.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/configuring.rst b/share/doc/src/configuring.rst
index 2684024..f2def90 100644
--- a/share/doc/src/configuring.rst
+++ b/share/doc/src/configuring.rst
@@ -583,6 +583,16 @@ Specific HTTP methods may also be restricted:
     ; refer to http://tools.ietf.org/html/rfc2616, rfc2817, rfc5789
     methods = GET, POST, PUT, DELETE
 
+You can allow additional HTTP header fields to be allowed:
+
+.. code-block:: ini
+
+    [cors]
+    ; List of accepted headers separated by a comma
+    headers = Authorization, Cookie
+
+Note that `Authorization` and `Cookie` are not part of the standard set.
+
 Configuration per vhost
 -----------------------
 


[45/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Check if codemirror has already been added and remove


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

Branch: refs/heads/1867-feature-plugins
Commit: 2cb57998af6e842fb824d030d3359a5838819a76
Parents: e422d9e
Author: suelockwood <de...@gmail.com>
Authored: Fri Sep 6 11:56:42 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2cb57998/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 6b63c15..805116e 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -707,6 +707,9 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns)
     afterRender: function() {
       this.model.on("sync", this.updateValues, this);
       var that = this;
+      if ($('.CodeMirror').length > 0){
+        $('.CodeMirror').remove();
+      }
       this.editor = Codemirror.fromTextArea(this.$el.find("textarea.doc-code").get()[0], {
         mode: "application/json",
         json: false,


[22/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Document routes lost their selected headers for primary nav


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

Branch: refs/heads/1867-feature-plugins
Commit: 32153bf9fb0b00c6e48bd5fccfd0a7e7f1853ea4
Parents: b5c044f
Author: suelockwood <de...@gmail.com>
Authored: Tue Aug 20 16:52:05 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:43 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/routes.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/32153bf9/src/fauxton/app/modules/documents/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/routes.js b/src/fauxton/app/modules/documents/routes.js
index 6a7d4b4..23ebc1e 100644
--- a/src/fauxton/app/modules/documents/routes.js
+++ b/src/fauxton/app/modules/documents/routes.js
@@ -28,6 +28,7 @@ function(app, FauxtonAPI, Documents, Databases) {
   var DocEditorRouteObject = FauxtonAPI.RouteObject.extend({
     layout: "one_pane",
     disableLoader: true,
+    selectedHeader: "Databases",
     initialize: function(route, masterLayout, options) {
       var databaseName = options[0], docID = options[1]||'new';
 
@@ -132,12 +133,13 @@ function(app, FauxtonAPI, Documents, Databases) {
     routes: {
       "database/:database/new": "code_editor"
     },
+    selectedHeader: "Databases",
 
   });
 
   var DocumentsRouteObject = FauxtonAPI.RouteObject.extend({
     layout: "with_tabs_sidebar",
-    navSelector: '.databases',
+    selectedHeader: "Databases",
     routes: {
       "database/:database/_all_docs(:extra)": "allDocs", 
       "database/:database/_design/:ddoc/_view/:view": {
@@ -330,7 +332,7 @@ function(app, FauxtonAPI, Documents, Databases) {
 
   var ChangesRouteObject = FauxtonAPI.RouteObject.extend({
     layout: "with_tabs",
-    navSelector: '.databases',
+    selectedHeader: "Databases",
     crumbs: function () {
       return [
         {"name": "Databases", "link": "/_all_dbs"},


[44/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fixing table to wrap long words.


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

Branch: refs/heads/1867-feature-plugins
Commit: ceab856d1678523073fb185fb73a2b8a0c37e850
Parents: d1e0c8d
Author: suelockwood <de...@gmail.com>
Authored: Thu Sep 5 12:30:06 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 src/fauxton/assets/less/fauxton.less | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ceab856d/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 8111f0f..02fcef6 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -371,6 +371,10 @@ a:hover{
 /*dashboard content can be in multiple templates*/
 
 #dashboard-content{
+  &.row-fluid{
+    /*remove gutter without rewriting variable*/
+    margin-left: 0px;
+  }
   padding: 20px;
   .with-sidebar &{
     border-left: 1px solid #999;
@@ -619,6 +623,19 @@ footer#mainFooter{
 }
 
 /*TABLE STYLES*/
+table.table {
+  table-layout: fixed;
+}
+table {
+  tr{
+    td{
+      word-wrap: break-word;
+      &.select {
+        width: 20px;
+      }
+    }
+  }
+}
 table.databases {clear: both;}
 thead {border-bottom: 2px solid @redButton;}
 tbody {padding-top: 10px;}


[37/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
More Json Pretty print fixes.  Css fixes for documents. Make code editor height size of page.


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

Branch: refs/heads/1867-feature-plugins
Commit: e361dcc8e6713f579f18f2a45405727d1c1098f5
Parents: ebd5ea1
Author: suelockwood <de...@gmail.com>
Authored: Thu Sep 5 16:39:23 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js                 | 1 +
 src/fauxton/app/templates/documents/index_row_tabular.html | 4 ++--
 src/fauxton/assets/less/fauxton.less                       | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e361dcc8/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index d43f06c..8f9af49 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -725,6 +725,7 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns)
           "Ctrl-/": "undo"
         }
       });
+      setTimeout(function(){that.editor.setSize(null,$('#dashboard').outerHeight()-250);},200);
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e361dcc8/src/fauxton/app/templates/documents/index_row_tabular.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/index_row_tabular.html b/src/fauxton/app/templates/documents/index_row_tabular.html
index f211f9e..f5f68fa 100644
--- a/src/fauxton/app/templates/documents/index_row_tabular.html
+++ b/src/fauxton/app/templates/documents/index_row_tabular.html
@@ -15,11 +15,11 @@ the License.
 <td class="select"><input type="checkbox"></td>
 <td>
   <div>
-    <pre class="prettyprint"><%= JSON.stringify(doc.get("key")) %></pre>
+    <pre class="prettyprint"><%- JSON.stringify(doc.get("key")) %></pre>
   </div>
 </td>
 <td>
   <div>
-    <pre class="prettyprint"><%= JSON.stringify(doc.get("value")) %></pre>
+    <pre class="prettyprint"><%- JSON.stringify(doc.get("value")) %></pre>
   </div>
 </td>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e361dcc8/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 02fcef6..185113e 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -371,7 +371,8 @@ a:hover{
 /*dashboard content can be in multiple templates*/
 
 #dashboard-content{
-  &.row-fluid{
+  &.row-fluid,
+  &.window-resizeable{
     /*remove gutter without rewriting variable*/
     margin-left: 0px;
   }


[46/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fixes Active Tasks text size and bottom scrollbar issue with windowResize


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

Branch: refs/heads/1867-feature-plugins
Commit: 9a9a5a33c92bc16f22d39f6d41f1a215c80a5843
Parents: ceab856
Author: suelockwood <de...@gmail.com>
Authored: Thu Sep 5 14:26:48 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/activetasks/assets/less/activetasks.less | 2 +-
 src/fauxton/app/resizeColumns.js                                | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9a9a5a33/src/fauxton/app/addons/activetasks/assets/less/activetasks.less
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/assets/less/activetasks.less b/src/fauxton/app/addons/activetasks/assets/less/activetasks.less
index 5ba394f..695799d 100644
--- a/src/fauxton/app/addons/activetasks/assets/less/activetasks.less
+++ b/src/fauxton/app/addons/activetasks/assets/less/activetasks.less
@@ -2,5 +2,5 @@
   cursor: pointer;
 }
 table.active-tasks{
-	font-size: 12px;
+	font-size: 16px;
 }

http://git-wip-us.apache.org/repos/asf/couchdb/blob/9a9a5a33/src/fauxton/app/resizeColumns.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/resizeColumns.js b/src/fauxton/app/resizeColumns.js
index 687b9d3..9cf7115 100644
--- a/src/fauxton/app/resizeColumns.js
+++ b/src/fauxton/app/resizeColumns.js
@@ -30,7 +30,7 @@ function(mixins) {
 
   Resize.prototype = {
     getPrimaryNavWidth: function(){
-      var primaryNavWidth  = $('body').hasClass('closeMenu')? 66:220;
+      var primaryNavWidth  = $('body').hasClass('closeMenu')? 64:224;
       return primaryNavWidth;
     },
     getPanelWidth: function(){


[39/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fauxton: View test sandbox renders to DOM in hidden div


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

Branch: refs/heads/1867-feature-plugins
Commit: 3e3f26665fd93ad5c22a216ccc3008a20e0bdf7d
Parents: 5ea4151
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Aug 29 21:48:43 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 src/fauxton/test/mocha/testUtils.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3e3f2666/src/fauxton/test/mocha/testUtils.js
----------------------------------------------------------------------
diff --git a/src/fauxton/test/mocha/testUtils.js b/src/fauxton/test/mocha/testUtils.js
index 3eb1118..f9643e8 100644
--- a/src/fauxton/test/mocha/testUtils.js
+++ b/src/fauxton/test/mocha/testUtils.js
@@ -24,7 +24,7 @@ function(chai, sinonChai) {
    
    _.extend(ViewSandbox.prototype, {
     initialize: function () {
-      this.$el = $('<div></div>');
+      this.$el = $('<div style="display:none"></div>').appendTo('body');
       this.$ = this.$el.find;
     },
     views: [],


[38/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
Fixing PrettyPrint issue on _changes


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

Branch: refs/heads/1867-feature-plugins
Commit: ebd5ea1479b52366c7ce78606193dd52534986a7
Parents: 9a9a5a3
Author: suelockwood <de...@gmail.com>
Authored: Thu Sep 5 15:21:43 2013 -0400
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:45 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/templates/documents/changes.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ebd5ea14/src/fauxton/app/templates/documents/changes.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/changes.html b/src/fauxton/app/templates/documents/changes.html
index e528a1c..5a29644 100644
--- a/src/fauxton/app/templates/documents/changes.html
+++ b/src/fauxton/app/templates/documents/changes.html
@@ -29,7 +29,7 @@ the License.
         <td> <a href="#<%= database.url('app') %>/<%= change.id %>"><%= change.id %></a> </td>
       <% } %>
         <td> 
-          <pre class="prettyprint">  <%= JSON.stringify({changes: change.changes, doc: change.doc}, null, " ") %> </pre>
+          <pre class="prettyprint">  <%- JSON.stringify({changes: change.changes, doc: change.doc}, null, " ") %> </pre>
       </td>
       <td><%= change.deleted ? "true" : "false" %></td>
     </tr>


[18/50] [abbrv] Update codemirror to v2.38

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/8905089f/src/fauxton/assets/js/libs/codemirror.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/codemirror.js b/src/fauxton/assets/js/libs/codemirror.js
index 532dd89..cac755e 100644
--- a/src/fauxton/assets/js/libs/codemirror.js
+++ b/src/fauxton/assets/js/libs/codemirror.js
@@ -1,11 +1,12 @@
-// CodeMirror version 2.32
+// CodeMirror version 2.38
 //
 // All functions that need access to the editor's state live inside
 // the CodeMirror function. Below that, at the bottom of the file,
 // some utilities are defined.
 
 // CodeMirror is the only global var we claim
-var CodeMirror = (function() {
+window.CodeMirror = (function() {
+  "use strict";
   // This is the function that produces an editor instance. Its
   // closure is used to store the editor state.
   function CodeMirror(place, givenOptions) {
@@ -15,38 +16,33 @@ var CodeMirror = (function() {
       if (defaults.hasOwnProperty(opt))
         options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt];
 
+    var input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em");
+    input.setAttribute("wrap", "off"); input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off");
+    // Wraps and hides input textarea
+    var inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
+    // The empty scrollbar content, used solely for managing the scrollbar thumb.
+    var scrollbarInner = elt("div", null, "CodeMirror-scrollbar-inner");
+    // The vertical scrollbar. Horizontal scrolling is handled by the scroller itself.
+    var scrollbar = elt("div", [scrollbarInner], "CodeMirror-scrollbar");
+    // DIVs containing the selection and the actual code
+    var lineDiv = elt("div"), selectionDiv = elt("div", null, null, "position: relative; z-index: -1");
+    // Blinky cursor, and element used to ensure cursor fits at the end of a line
+    var cursor = elt("pre", "\u00a0", "CodeMirror-cursor"), widthForcer = elt("pre", "\u00a0", "CodeMirror-cursor", "visibility: hidden");
+    // Used to measure text size
+    var measure = elt("div", null, null, "position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;");
+    var lineSpace = elt("div", [measure, cursor, widthForcer, selectionDiv, lineDiv], null, "position: relative; z-index: 0");
+    var gutterText = elt("div", null, "CodeMirror-gutter-text"), gutter = elt("div", [gutterText], "CodeMirror-gutter");
+    // Moved around its parent to cover visible view
+    var mover = elt("div", [gutter, elt("div", [lineSpace], "CodeMirror-lines")], null, "position: relative");
+    // Set to the height of the text, causes scrolling
+    var sizer = elt("div", [mover], null, "position: relative");
+    // Provides scrolling
+    var scroller = elt("div", [sizer], "CodeMirror-scroll");
+    scroller.setAttribute("tabIndex", "-1");
     // The element in which the editor lives.
-    var wrapper = document.createElement("div");
-    wrapper.className = "CodeMirror" + (options.lineWrapping ? " CodeMirror-wrap" : "");
-    // This mess creates the base DOM structure for the editor.
-    wrapper.innerHTML =
-      '<div style="overflow: hidden; position: relative; width: 3px; height: 0px;">' + // Wraps and hides input textarea
-        '<textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" ' +
-          'autocorrect="off" autocapitalize="off"></textarea></div>' +
-      '<div class="CodeMirror-scrollbar">' + // The vertical scrollbar. Horizontal scrolling is handled by the scroller itself.
-        '<div class="CodeMirror-scrollbar-inner">' + // The empty scrollbar content, used solely for managing the scrollbar thumb.
-      '</div></div>' + // This must be before the scroll area because it's float-right.
-      '<div class="CodeMirror-scroll" tabindex="-1">' +
-        '<div style="position: relative">' + // Set to the height of the text, causes scrolling
-          '<div style="position: relative">' + // Moved around its parent to cover visible view
-            '<div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div>' +
-            // Provides positioning relative to (visible) text origin
-            '<div class="CodeMirror-lines"><div style="position: relative; z-index: 0">' +
-              // Used to measure text size
-              '<div style="position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;"></div>' +
-              '<pre class="CodeMirror-cursor">&#160;</pre>' + // Absolutely positioned blinky cursor
-              '<pre class="CodeMirror-cursor" style="visibility: hidden">&#160;</pre>' + // Used to force a width
-              '<div style="position: relative; z-index: -1"></div><div></div>' + // DIVs containing the selection and the actual code
-            '</div></div></div></div></div>';
+    var wrapper = elt("div", [inputDiv, scrollbar, scroller], "CodeMirror" + (options.lineWrapping ? " CodeMirror-wrap" : ""));
     if (place.appendChild) place.appendChild(wrapper); else place(wrapper);
-    // I've never seen more elegant code in my life.
-    var inputDiv = wrapper.firstChild, input = inputDiv.firstChild,
-        scroller = wrapper.lastChild, code = scroller.firstChild,
-        mover = code.firstChild, gutter = mover.firstChild, gutterText = gutter.firstChild,
-        lineSpace = gutter.nextSibling.firstChild, measure = lineSpace.firstChild,
-        cursor = measure.nextSibling, widthForcer = cursor.nextSibling,
-        selectionDiv = widthForcer.nextSibling, lineDiv = selectionDiv.nextSibling,
-        scrollbar = inputDiv.nextSibling, scrollbarInner = scrollbar.firstChild;
+
     themeChanged(); keyMapChanged();
     // Needed to hide big blue blinking cursor on Mobile Safari
     if (ios) input.style.width = "0px";
@@ -58,33 +54,21 @@ var CodeMirror = (function() {
     // Needed to handle Tab key in KHTML
     if (khtml) inputDiv.style.height = "1px", inputDiv.style.position = "absolute";
 
-    // Check for OS X >= 10.7. If so, we need to force a width on the scrollbar, and 
-    // make it overlap the content. (But we only do this if the scrollbar doesn't already
-    // have a natural width. If the mouse is plugged in or the user sets the system pref
-    // to always show scrollbars, the scrollbar shouldn't overlap.)
-    if (mac_geLion) {
-      scrollbar.className += (overlapScrollbars() ? " cm-sb-overlap" : " cm-sb-nonoverlap");
-    } else if (ie_lt8) {
-      // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
-      scrollbar.className += " cm-sb-ie7";
-    }
-
-    // Check for problem with IE innerHTML not working when we have a
-    // P (or similar) parent node.
-    try { stringWidth("x"); }
-    catch (e) {
-      if (e.message.match(/runtime/i))
-        e = new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)");
-      throw e;
-    }
+    // Check for OS X >= 10.7. This has transparent scrollbars, so the
+    // overlaying of one scrollbar with another won't work. This is a
+    // temporary hack to simply turn off the overlay scrollbar. See
+    // issue #727.
+    if (mac_geLion) { scrollbar.style.zIndex = -2; scrollbar.style.visibility = "hidden"; }
+    // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
+    else if (ie_lt8) scrollbar.style.minWidth = "18px";
 
     // Delayed object wrap timeouts, making sure only one is active. blinker holds an interval.
     var poll = new Delayed(), highlight = new Delayed(), blinker;
 
     // mode holds a mode API object. doc is the tree of Line objects,
-    // work an array of lines that should be parsed, and history the
-    // undo history (instance of History constructor).
-    var mode, doc = new BranchChunk([new LeafChunk([new Line("")])]), work, focused;
+    // frontier is the point up to which the content has been parsed,
+    // and history the undo history (instance of History constructor).
+    var mode, doc = new BranchChunk([new LeafChunk([new Line("")])]), frontier = 0, focused;
     loadMode();
     // The selection. These are always maintained to point at valid
     // positions. Inverted is used to remember that the user is
@@ -92,11 +76,11 @@ var CodeMirror = (function() {
     var sel = {from: {line: 0, ch: 0}, to: {line: 0, ch: 0}, inverted: false};
     // Selection-related flags. shiftSelecting obviously tracks
     // whether the user is holding shift.
-    var shiftSelecting, lastClick, lastDoubleClick, lastScrollTop = 0, lastScrollLeft = 0, draggingText,
-        overwrite = false, suppressEdits = false;
+    var shiftSelecting, lastClick, lastDoubleClick, lastScrollTop = 0, draggingText,
+        overwrite = false, suppressEdits = false, pasteIncoming = false;
     // Variables used by startOperation/endOperation to track what
     // happened during the operation.
-    var updateInput, userSelChange, changes, textChanged, selectionChanged, leaveInputAlone,
+    var updateInput, userSelChange, changes, textChanged, selectionChanged,
         gutterDirty, callbacks;
     // Current visible range (may be bigger than the view window).
     var displayOffset = 0, showingFrom = 0, showingTo = 0, lastSizeC = 0;
@@ -105,8 +89,9 @@ var CodeMirror = (function() {
     var bracketHighlighted;
     // Tracks the maximum line length so that the horizontal scrollbar
     // can be kept static when scrolling.
-    var maxLine = "", updateMaxLine = false, maxLineChanged = true;
-    var tabCache = {};
+    var maxLine = getLine(0), updateMaxLine = false, maxLineChanged = true;
+    var pollingFast = false; // Ensures slowPoll doesn't cancel fastPoll
+    var goalColumn = null;
 
     // Initialize the content.
     operation(function(){setValue(options.value || ""); updateInput = false;})();
@@ -120,12 +105,13 @@ var CodeMirror = (function() {
     // which point we can't mess with it anymore. Context menu is
     // handled in onMouseDown for Gecko.
     if (!gecko) connect(scroller, "contextmenu", onContextMenu);
-    connect(scroller, "scroll", onScroll);
-    connect(scrollbar, "scroll", onScroll);
+    connect(scroller, "scroll", onScrollMain);
+    connect(scrollbar, "scroll", onScrollBar);
     connect(scrollbar, "mousedown", function() {if (focused) setTimeout(focusInput, 0);});
-    connect(scroller, "mousewheel", onMouseWheel);
-    connect(scroller, "DOMMouseScroll", onMouseWheel);
-    connect(window, "resize", function() {updateDisplay(true);});
+    var resizeHandler = connect(window, "resize", function() {
+      if (wrapper.parentNode) updateDisplay(true);
+      else resizeHandler();
+    }, true);
     connect(input, "keyup", operation(onKeyUp));
     connect(input, "input", fastPoll);
     connect(input, "keydown", operation(onKeyDown));
@@ -133,24 +119,24 @@ var CodeMirror = (function() {
     connect(input, "focus", onFocus);
     connect(input, "blur", onBlur);
 
+    function drag_(e) {
+      if (options.onDragEvent && options.onDragEvent(instance, addStop(e))) return;
+      e_stop(e);
+    }
     if (options.dragDrop) {
       connect(scroller, "dragstart", onDragStart);
-      function drag_(e) {
-        if (options.onDragEvent && options.onDragEvent(instance, addStop(e))) return;
-        e_stop(e);
-      }
       connect(scroller, "dragenter", drag_);
       connect(scroller, "dragover", drag_);
       connect(scroller, "drop", operation(onDrop));
     }
     connect(scroller, "paste", function(){focusInput(); fastPoll();});
-    connect(input, "paste", fastPoll);
+    connect(input, "paste", function(){pasteIncoming = true; fastPoll();});
     connect(input, "cut", operation(function(){
       if (!options.readOnly) replaceSelection("");
     }));
 
     // Needed to handle Tab key in KHTML
-    if (khtml) connect(code, "mouseup", function() {
+    if (khtml) connect(sizer, "mouseup", function() {
         if (document.activeElement == input) input.blur();
         focusInput();
     });
@@ -183,12 +169,16 @@ var CodeMirror = (function() {
         else if (option == "lineWrapping" && oldVal != value) operation(wrappingChanged)();
         else if (option == "tabSize") updateDisplay(true);
         else if (option == "keyMap") keyMapChanged();
-        if (option == "lineNumbers" || option == "gutter" || option == "firstLineNumber" || option == "theme") {
+        else if (option == "tabindex") input.tabIndex = value;
+        else if (option == "showCursorWhenSelecting") updateSelection();
+        if (option == "lineNumbers" || option == "gutter" || option == "firstLineNumber" ||
+            option == "theme" || option == "lineNumberFormatter") {
           gutterChanged();
           updateDisplay(true);
         }
       },
       getOption: function(option) {return options[option];},
+      getMode: function() {return mode;},
       undo: operation(undo),
       redo: operation(redo),
       indentLine: operation(function(n, dir) {
@@ -207,13 +197,23 @@ var CodeMirror = (function() {
         history.undone = histData.undone;
       },
       getHistory: function() {
-        history.time = 0;
-        return {done: history.done.concat([]), undone: history.undone.concat([])};
+        function cp(arr) {
+          for (var i = 0, nw = [], nwelt; i < arr.length; ++i) {
+            nw.push(nwelt = []);
+            for (var j = 0, elt = arr[i]; j < elt.length; ++j) {
+              var old = [], cur = elt[j];
+              nwelt.push({start: cur.start, added: cur.added, old: old});
+              for (var k = 0; k < cur.old.length; ++k) old.push(hlText(cur.old[k]));
+            }
+          }
+          return nw;
+        }
+        return {done: cp(history.done), undone: cp(history.undone)};
       },
       matchBrackets: operation(function(){matchBrackets(true);}),
       getTokenAt: operation(function(pos) {
         pos = clipPos(pos);
-        return getLine(pos.line).getTokenAt(mode, getStateBefore(pos.line), pos.ch);
+        return getLine(pos.line).getTokenAt(mode, getStateBefore(pos.line), options.tabSize, pos.ch);
       }),
       getStateAfter: function(line) {
         line = clipLine(line == null ? doc.size - 1: line);
@@ -233,6 +233,7 @@ var CodeMirror = (function() {
         var off = eltOffset(lineSpace);
         return coordsChar(coords.x - off.left, coords.y - off.top);
       },
+      defaultTextHeight: function() { return textHeight(); },
       markText: operation(markText),
       setBookmark: setBookmark,
       findMarksAt: findMarksAt,
@@ -250,15 +251,16 @@ var CodeMirror = (function() {
         return line;
       },
       lineInfo: lineInfo,
+      getViewport: function() { return {from: showingFrom, to: showingTo};},
       addWidget: function(pos, node, scroll, vert, horiz) {
         pos = localCoords(clipPos(pos));
         var top = pos.yBot, left = pos.x;
         node.style.position = "absolute";
-        code.appendChild(node);
+        sizer.appendChild(node);
         if (vert == "over") top = pos.y;
         else if (vert == "near") {
           var vspace = Math.max(scroller.offsetHeight, doc.height * textHeight()),
-              hspace = Math.max(code.clientWidth, lineSpace.clientWidth) - paddingLeft();
+              hspace = Math.max(sizer.clientWidth, lineSpace.clientWidth) - paddingLeft();
           if (pos.yBot + node.offsetHeight > vspace && pos.y > node.offsetHeight)
             top = pos.y - node.offsetHeight;
           if (left + node.offsetWidth > hspace)
@@ -267,11 +269,11 @@ var CodeMirror = (function() {
         node.style.top = (top + paddingTop()) + "px";
         node.style.left = node.style.right = "";
         if (horiz == "right") {
-          left = code.clientWidth - node.offsetWidth;
+          left = sizer.clientWidth - node.offsetWidth;
           node.style.right = "0px";
         } else {
           if (horiz == "left") left = 0;
-          else if (horiz == "middle") left = (code.clientWidth - node.offsetWidth) / 2;
+          else if (horiz == "middle") left = (sizer.clientWidth - node.offsetWidth) / 2;
           node.style.left = (left + paddingLeft()) + "px";
         }
         if (scroll)
@@ -281,7 +283,9 @@ var CodeMirror = (function() {
       lineCount: function() {return doc.size;},
       clipPos: clipPos,
       getCursor: function(start) {
-        if (start == null) start = sel.inverted;
+        if (start == null || start == "head") start = sel.inverted;
+        if (start == "anchor") start = !sel.inverted;
+        if (start == "end") start = false;
         return copyPos(start ? sel.from : sel.to);
       },
       somethingSelected: function() {return !posEq(sel.from, sel.to);},
@@ -339,13 +343,18 @@ var CodeMirror = (function() {
       },
       scrollTo: function(x, y) {
         if (x != null) scroller.scrollLeft = x;
-        if (y != null) scrollbar.scrollTop = y;
+        if (y != null) scrollbar.scrollTop = scroller.scrollTop = y;
         updateDisplay([]);
       },
       getScrollInfo: function() {
         return {x: scroller.scrollLeft, y: scrollbar.scrollTop,
                 height: scrollbar.scrollHeight, width: scroller.scrollWidth};
       },
+      scrollIntoView: function(pos) {
+        var coords = localCoords(pos ? clipPos(pos) : sel.inverted ? sel.from : sel.to);
+        scrollIntoView(coords.x, coords.y, coords.x, coords.yBot);
+      },
+
       setSize: function(width, height) {
         function interpret(val) {
           val = String(val);
@@ -353,6 +362,7 @@ var CodeMirror = (function() {
         }
         if (width != null) wrapper.style.width = interpret(width);
         if (height != null) scroller.style.height = interpret(height);
+        instance.refresh();
       },
 
       operation: function(f){return operation(f)();},
@@ -375,6 +385,12 @@ var CodeMirror = (function() {
       for (var n = line; n; n = n.parent) n.height += diff;
     }
 
+    function lineContent(line, wrapAt) {
+      if (!line.styles)
+        line.highlight(mode, line.stateAfter = getStateBefore(lineNo(line)), options.tabSize);
+      return line.getContent(options.tabSize, wrapAt, options.lineWrapping);
+    }
+
     function setValue(code) {
       var top = {line: 0, ch: 0};
       updateLines(top, {line: doc.size - 1, ch: getLine(doc.size-1).text.length},
@@ -387,25 +403,30 @@ var CodeMirror = (function() {
       return text.join(lineSep || "\n");
     }
 
-    function onScroll(e) {
-      if (scroller.scrollTop) {
-        scrollbar.scrollTop += scroller.scrollTop;
-        scroller.scrollTop = 0;
+    function onScrollBar(e) {
+      if (Math.abs(scrollbar.scrollTop - lastScrollTop) > 1) {
+        lastScrollTop = scroller.scrollTop = scrollbar.scrollTop;
+        updateDisplay([]);
       }
-      if (lastScrollTop != scrollbar.scrollTop || lastScrollLeft != scroller.scrollLeft) {
-        lastScrollTop = scrollbar.scrollTop;
-        lastScrollLeft = scroller.scrollLeft;
+    }
+
+    function onScrollMain(e) {
+      if (options.fixedGutter && gutter.style.left != scroller.scrollLeft + "px")
+        gutter.style.left = scroller.scrollLeft + "px";
+      if (Math.abs(scroller.scrollTop - lastScrollTop) > 1) {
+        lastScrollTop = scroller.scrollTop;
+        if (scrollbar.scrollTop != lastScrollTop)
+          scrollbar.scrollTop = lastScrollTop;
         updateDisplay([]);
-        if (options.fixedGutter) gutter.style.left = scroller.scrollLeft + "px";
-        if (options.onScroll) options.onScroll(instance);
       }
+      if (options.onScroll) options.onScroll(instance);
     }
 
     function onMouseDown(e) {
       setShift(e_prop(e, "shiftKey"));
       // Check whether this is a click in a widget
       for (var n = e_target(e); n != wrapper; n = n.parentNode)
-        if (n.parentNode == code && n != mover) return;
+        if (n.parentNode == sizer && n != mover) return;
 
       // See if this is a click in the gutter
       for (var n = e_target(e); n != wrapper; n = n.parentNode)
@@ -448,21 +469,21 @@ var CodeMirror = (function() {
         setSelectionUser(word.from, word.to);
       } else { lastClick = {time: now, pos: start}; }
 
+      function dragEnd(e2) {
+        if (webkit) scroller.draggable = false;
+        draggingText = false;
+        up(); drop();
+        if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
+          e_preventDefault(e2);
+          setCursor(start.line, start.ch, true);
+          focusInput();
+        }
+      }
       var last = start, going;
       if (options.dragDrop && dragAndDrop && !options.readOnly && !posEq(sel.from, sel.to) &&
           !posLess(start, sel.from) && !posLess(sel.to, start) && type == "single") {
         // Let the drag handler handle this.
         if (webkit) scroller.draggable = true;
-        function dragEnd(e2) {
-          if (webkit) scroller.draggable = false;
-          draggingText = false;
-          up(); drop();
-          if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
-            e_preventDefault(e2);
-            setCursor(start.line, start.ch, true);
-            focusInput();
-          }
-        }
         var up = connect(document, "mouseup", operation(dragEnd), true);
         var drop = connect(scroller, "drop", operation(dragEnd), true);
         draggingText = true;
@@ -477,8 +498,12 @@ var CodeMirror = (function() {
 
       function doSelect(cur) {
         if (type == "single") {
-          setSelectionUser(start, cur);
-        } else if (type == "double") {
+          setSelectionUser(clipPos(start), cur);
+          return;
+        }
+        startstart = clipPos(startstart);
+        startend = clipPos(startend);
+        if (type == "double") {
           var word = findWordAt(cur);
           if (posLess(cur, startstart)) setSelectionUser(word.from, startend);
           else setSelectionUser(startstart, word.to);
@@ -525,11 +550,12 @@ var CodeMirror = (function() {
     }
     function onDrop(e) {
       if (options.onDragEvent && options.onDragEvent(instance, addStop(e))) return;
-      e.preventDefault();
+      e_preventDefault(e);
       var pos = posFromMouse(e, true), files = e.dataTransfer.files;
       if (!pos || options.readOnly) return;
       if (files && files.length && window.FileReader && window.File) {
-        function loadFile(file, i) {
+        var n = files.length, text = Array(n), read = 0;
+        var loadFile = function(file, i) {
           var reader = new FileReader;
           reader.onload = function() {
             text[i] = reader.result;
@@ -542,8 +568,7 @@ var CodeMirror = (function() {
             }
           };
           reader.readAsText(file);
-        }
-        var n = files.length, text = Array(n), read = 0;
+        };
         for (var i = 0; i < n; ++i) loadFile(files[i], i);
       } else {
         // Don't do a replace if the drop happened inside of the selected text.
@@ -566,13 +591,10 @@ var CodeMirror = (function() {
     function onDragStart(e) {
       var txt = getSelection();
       e.dataTransfer.setData("Text", txt);
-      
+
       // Use dummy image instead of default browsers image.
-      if (gecko || chrome || opera) {
-        var img = document.createElement('img');
-        img.scr = 'data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs='; //1x1 image
-        e.dataTransfer.setDragImage(img, 0, 0);
-      }
+      if (e.dataTransfer.setDragImage)
+        e.dataTransfer.setDragImage(elt('img'), 0, 0);
     }
 
     function doHandleBinding(bound, dropShift) {
@@ -594,6 +616,7 @@ var CodeMirror = (function() {
       }
       return true;
     }
+    var maybeTransition;
     function handleKeyBinding(e) {
       // Handle auto keymap transitions
       var startMap = getKeyMap(options.keyMap), next = startMap.auto;
@@ -607,8 +630,8 @@ var CodeMirror = (function() {
       var name = keyNames[e_prop(e, "keyCode")], handled = false;
       if (name == null || e.altGraphKey) return false;
       if (e_prop(e, "altKey")) name = "Alt-" + name;
-      if (e_prop(e, "ctrlKey")) name = "Ctrl-" + name;
-      if (e_prop(e, "metaKey")) name = "Cmd-" + name;
+      if (e_prop(e, flipCtrlCmd ? "metaKey" : "ctrlKey")) name = "Ctrl-" + name;
+      if (e_prop(e, flipCtrlCmd ? "ctrlKey" : "metaKey")) name = "Cmd-" + name;
 
       var stopped = false;
       function stop() { stopped = true; }
@@ -626,7 +649,7 @@ var CodeMirror = (function() {
       if (handled) {
         e_preventDefault(e);
         restartBlink();
-        if (ie) { e.oldKeyCode = e.keyCode; e.keyCode = 0; }
+        if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; }
       }
       return handled;
     }
@@ -640,7 +663,7 @@ var CodeMirror = (function() {
       return handled;
     }
 
-    var lastStoppedKey = null, maybeTransition;
+    var lastStoppedKey = null;
     function onKeyDown(e) {
       if (!focused) onFocus();
       if (ie && e.keyCode == 27) { e.returnValue = false; }
@@ -684,7 +707,6 @@ var CodeMirror = (function() {
         focused = true;
         if (scroller.className.search(/\bCodeMirror-focused\b/) == -1)
           scroller.className += " CodeMirror-focused";
-        if (!leaveInputAlone) resetInput(true);
       }
       slowPoll();
       restartBlink();
@@ -703,53 +725,20 @@ var CodeMirror = (function() {
       setTimeout(function() {if (!focused) shiftSelecting = null;}, 150);
     }
 
-    function chopDelta(delta) {
-      // Make sure we always scroll a little bit for any nonzero delta.
-      if (delta > 0.0 && delta < 1.0) return 1;
-      else if (delta > -1.0 && delta < 0.0) return -1;
-      else return Math.round(delta);
-    }
-
-    function onMouseWheel(e) {
-      var deltaX = 0, deltaY = 0;
-      if (e.type == "DOMMouseScroll") { // Firefox
-        var delta = -e.detail * 8.0;
-        if (e.axis == e.HORIZONTAL_AXIS) deltaX = delta;
-        else if (e.axis == e.VERTICAL_AXIS) deltaY = delta;
-      } else if (e.wheelDeltaX !== undefined && e.wheelDeltaY !== undefined) { // WebKit
-        deltaX = e.wheelDeltaX / 3.0;
-        deltaY = e.wheelDeltaY / 3.0;
-      } else if (e.wheelDelta !== undefined) { // IE or Opera
-        deltaY = e.wheelDelta / 3.0;
-      }
-
-      var scrolled = false;
-      deltaX = chopDelta(deltaX);
-      deltaY = chopDelta(deltaY);
-      if ((deltaX > 0 && scroller.scrollLeft > 0) ||
-          (deltaX < 0 && scroller.scrollLeft + scroller.clientWidth < scroller.scrollWidth)) {
-        scroller.scrollLeft -= deltaX;
-        scrolled = true;
-      }
-      if ((deltaY > 0 && scrollbar.scrollTop > 0) ||
-          (deltaY < 0 && scrollbar.scrollTop + scrollbar.clientHeight < scrollbar.scrollHeight)) {
-        scrollbar.scrollTop -= deltaY;
-        scrolled = true;
-      }
-      if (scrolled) e_stop(e);
-    }
-
     // Replace the range from from to to by the strings in newText.
     // Afterwards, set the selection to selFrom, selTo.
     function updateLines(from, to, newText, selFrom, selTo) {
       if (suppressEdits) return;
+      var old = [];
+      doc.iter(from.line, to.line + 1, function(line) {
+        old.push(newHL(line.text, line.markedSpans));
+      });
       if (history) {
-        var old = [];
-        doc.iter(from.line, to.line + 1, function(line) { old.push(line.text); });
         history.addChange(from.line, newText.length, old);
         while (history.done.length > options.undoDepth) history.done.shift();
       }
-      updateLinesNoUndo(from, to, newText, selFrom, selTo);
+      var lines = updateMarkedSpans(hlSpans(old[0]), hlSpans(lst(old)), from.ch, to.ch, newText);
+      updateLinesNoUndo(from, to, lines, selFrom, selTo);
     }
     function unredoHelper(from, to) {
       if (!from.length) return;
@@ -757,11 +746,12 @@ var CodeMirror = (function() {
       for (var i = set.length - 1; i >= 0; i -= 1) {
         var change = set[i];
         var replaced = [], end = change.start + change.added;
-        doc.iter(change.start, end, function(line) { replaced.push(line.text); });
+        doc.iter(change.start, end, function(line) { replaced.push(newHL(line.text, line.markedSpans)); });
         out.push({start: change.start, added: change.old.length, old: replaced});
         var pos = {line: change.start + change.old.length - 1,
-                   ch: editEnd(replaced[replaced.length-1], change.old[change.old.length-1])};
-        updateLinesNoUndo({line: change.start, ch: 0}, {line: end - 1, ch: getLine(end-1).text.length}, change.old, pos, pos);
+                   ch: editEnd(hlText(lst(replaced)), hlText(lst(change.old)))};
+        updateLinesNoUndo({line: change.start, ch: 0}, {line: end - 1, ch: getLine(end-1).text.length},
+                          change.old, pos, pos);
       }
       updateInput = true;
       to.push(out);
@@ -769,95 +759,86 @@ var CodeMirror = (function() {
     function undo() {unredoHelper(history.done, history.undone);}
     function redo() {unredoHelper(history.undone, history.done);}
 
-    function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
+    function updateLinesNoUndo(from, to, lines, selFrom, selTo) {
       if (suppressEdits) return;
-      var recomputeMaxLength = false, maxLineLength = maxLine.length;
+      var recomputeMaxLength = false, maxLineLength = maxLine.text.length;
       if (!options.lineWrapping)
         doc.iter(from.line, to.line + 1, function(line) {
           if (!line.hidden && line.text.length == maxLineLength) {recomputeMaxLength = true; return true;}
         });
-      if (from.line != to.line || newText.length > 1) gutterDirty = true;
+      if (from.line != to.line || lines.length > 1) gutterDirty = true;
 
       var nlines = to.line - from.line, firstLine = getLine(from.line), lastLine = getLine(to.line);
-      // First adjust the line structure, taking some care to leave highlighting intact.
-      if (from.ch == 0 && to.ch == 0 && newText[newText.length - 1] == "") {
+      var lastHL = lst(lines);
+
+      // First adjust the line structure
+      if (from.ch == 0 && to.ch == 0 && hlText(lastHL) == "") {
         // This is a whole-line replace. Treated specially to make
         // sure line objects move the way they are supposed to.
         var added = [], prevLine = null;
-        if (from.line) {
-          prevLine = getLine(from.line - 1);
-          prevLine.fixMarkEnds(lastLine);
-        } else lastLine.fixMarkStarts();
-        for (var i = 0, e = newText.length - 1; i < e; ++i)
-          added.push(Line.inheritMarks(newText[i], prevLine));
+        for (var i = 0, e = lines.length - 1; i < e; ++i)
+          added.push(new Line(hlText(lines[i]), hlSpans(lines[i])));
+        lastLine.update(lastLine.text, hlSpans(lastHL));
         if (nlines) doc.remove(from.line, nlines, callbacks);
         if (added.length) doc.insert(from.line, added);
       } else if (firstLine == lastLine) {
-        if (newText.length == 1)
-          firstLine.replace(from.ch, to.ch, newText[0]);
-        else {
-          lastLine = firstLine.split(to.ch, newText[newText.length-1]);
-          firstLine.replace(from.ch, null, newText[0]);
-          firstLine.fixMarkEnds(lastLine);
-          var added = [];
-          for (var i = 1, e = newText.length - 1; i < e; ++i)
-            added.push(Line.inheritMarks(newText[i], firstLine));
-          added.push(lastLine);
+        if (lines.length == 1) {
+          firstLine.update(firstLine.text.slice(0, from.ch) + hlText(lines[0]) + firstLine.text.slice(to.ch), hlSpans(lines[0]));
+        } else {
+          for (var added = [], i = 1, e = lines.length - 1; i < e; ++i)
+            added.push(new Line(hlText(lines[i]), hlSpans(lines[i])));
+          added.push(new Line(hlText(lastHL) + firstLine.text.slice(to.ch), hlSpans(lastHL)));
+          firstLine.update(firstLine.text.slice(0, from.ch) + hlText(lines[0]), hlSpans(lines[0]));
           doc.insert(from.line + 1, added);
         }
-      } else if (newText.length == 1) {
-        firstLine.replace(from.ch, null, newText[0]);
-        lastLine.replace(null, to.ch, "");
-        firstLine.append(lastLine);
+      } else if (lines.length == 1) {
+        firstLine.update(firstLine.text.slice(0, from.ch) + hlText(lines[0]) + lastLine.text.slice(to.ch), hlSpans(lines[0]));
         doc.remove(from.line + 1, nlines, callbacks);
       } else {
         var added = [];
-        firstLine.replace(from.ch, null, newText[0]);
-        lastLine.replace(null, to.ch, newText[newText.length-1]);
-        firstLine.fixMarkEnds(lastLine);
-        for (var i = 1, e = newText.length - 1; i < e; ++i)
-          added.push(Line.inheritMarks(newText[i], firstLine));
+        firstLine.update(firstLine.text.slice(0, from.ch) + hlText(lines[0]), hlSpans(lines[0]));
+        lastLine.update(hlText(lastHL) + lastLine.text.slice(to.ch), hlSpans(lastHL));
+        for (var i = 1, e = lines.length - 1; i < e; ++i)
+          added.push(new Line(hlText(lines[i]), hlSpans(lines[i])));
         if (nlines > 1) doc.remove(from.line + 1, nlines - 1, callbacks);
         doc.insert(from.line + 1, added);
       }
       if (options.lineWrapping) {
         var perLine = Math.max(5, scroller.clientWidth / charWidth() - 3);
-        doc.iter(from.line, from.line + newText.length, function(line) {
+        doc.iter(from.line, from.line + lines.length, function(line) {
           if (line.hidden) return;
           var guess = Math.ceil(line.text.length / perLine) || 1;
           if (guess != line.height) updateLineHeight(line, guess);
         });
       } else {
-        doc.iter(from.line, from.line + newText.length, function(line) {
+        doc.iter(from.line, from.line + lines.length, function(line) {
           var l = line.text;
           if (!line.hidden && l.length > maxLineLength) {
-            maxLine = l; maxLineLength = l.length; maxLineChanged = true;
+            maxLine = line; maxLineLength = l.length; maxLineChanged = true;
             recomputeMaxLength = false;
           }
         });
         if (recomputeMaxLength) updateMaxLine = true;
       }
 
-      // Add these lines to the work array, so that they will be
-      // highlighted. Adjust work lines if lines were added/removed.
-      var newWork = [], lendiff = newText.length - nlines - 1;
-      for (var i = 0, l = work.length; i < l; ++i) {
-        var task = work[i];
-        if (task < from.line) newWork.push(task);
-        else if (task > to.line) newWork.push(task + lendiff);
-      }
-      var hlEnd = from.line + Math.min(newText.length, 500);
-      highlightLines(from.line, hlEnd);
-      newWork.push(hlEnd);
-      work = newWork;
-      startWorker(100);
+      // Adjust frontier, schedule worker
+      frontier = Math.min(frontier, from.line);
+      startWorker(400);
+
+      var lendiff = lines.length - nlines - 1;
       // Remember that these lines changed, for updating the display
       changes.push({from: from.line, to: to.line + 1, diff: lendiff});
-      var changeObj = {from: from, to: to, text: newText};
-      if (textChanged) {
-        for (var cur = textChanged; cur.next; cur = cur.next) {}
-        cur.next = changeObj;
-      } else textChanged = changeObj;
+      if (options.onChange) {
+        // Normalize lines to contain only strings, since that's what
+        // the change event handler expects
+        for (var i = 0; i < lines.length; ++i)
+          if (typeof lines[i] != "string") lines[i] = lines[i].text;
+        var changeObj = {from: from, to: to, text: lines};
+        if (textChanged) {
+          for (var cur = textChanged; cur.next; cur = cur.next) {}
+          cur.next = changeObj;
+        } else textChanged = changeObj;
+      }
 
       // Update the selection
       function updateLine(n) {return n <= Math.min(to.line, to.line + lendiff) ? n : n + lendiff;}
@@ -867,46 +848,43 @@ var CodeMirror = (function() {
 
     function needsScrollbar() {
       var realHeight = doc.height * textHeight() + 2 * paddingTop();
-      return realHeight - 1 > scroller.offsetHeight ? realHeight : false;
+      return realHeight * .99 > scroller.offsetHeight ? realHeight : false;
     }
 
     function updateVerticalScroll(scrollTop) {
       var scrollHeight = needsScrollbar();
       scrollbar.style.display = scrollHeight ? "block" : "none";
       if (scrollHeight) {
-        scrollbarInner.style.height = scrollHeight + "px";
-        scrollbar.style.height = scroller.offsetHeight + "px";
-        if (scrollTop != null) scrollbar.scrollTop = scrollTop;
+        scrollbarInner.style.height = sizer.style.minHeight = scrollHeight + "px";
+        scrollbar.style.height = scroller.clientHeight + "px";
+        if (scrollTop != null) {
+          scrollbar.scrollTop = scroller.scrollTop = scrollTop;
+          // 'Nudge' the scrollbar to work around a Webkit bug where,
+          // in some situations, we'd end up with a scrollbar that
+          // reported its scrollTop (and looked) as expected, but
+          // *behaved* as if it was still in a previous state (i.e.
+          // couldn't scroll up, even though it appeared to be at the
+          // bottom).
+          if (webkit) setTimeout(function() {
+            if (scrollbar.scrollTop != scrollTop) return;
+            scrollbar.scrollTop = scrollTop + (scrollTop ? -1 : 1);
+            scrollbar.scrollTop = scrollTop;
+          }, 0);
+        }
+      } else {
+        sizer.style.minHeight = "";
       }
       // Position the mover div to align with the current virtual scroll position
-      mover.style.top = (displayOffset * textHeight() - scrollbar.scrollTop) + "px";
-    }
-  
-    // On Mac OS X Lion and up, detect whether the mouse is plugged in by measuring 
-    // the width of a div with a scrollbar in it. If the width is <= 1, then
-    // the mouse isn't plugged in and scrollbars should overlap the content.
-    function overlapScrollbars() {
-      var tmpSb = document.createElement('div'),
-          tmpSbInner = document.createElement('div');
-      tmpSb.className = "CodeMirror-scrollbar";
-      tmpSb.style.cssText = "position: absolute; left: -9999px; height: 100px;";
-      tmpSbInner.className = "CodeMirror-scrollbar-inner";
-      tmpSbInner.style.height = "200px";
-      tmpSb.appendChild(tmpSbInner);
-
-      document.body.appendChild(tmpSb);
-      var result = (tmpSb.offsetWidth <= 1);
-      document.body.removeChild(tmpSb);
-      return result;
+      mover.style.top = displayOffset * textHeight() + "px";
     }
 
     function computeMaxLength() {
-      var maxLineLength = 0; 
-      maxLine = ""; maxLineChanged = true;
-      doc.iter(0, doc.size, function(line) {
+      maxLine = getLine(0); maxLineChanged = true;
+      var maxLineLength = maxLine.text.length;
+      doc.iter(1, doc.size, function(line) {
         var l = line.text;
         if (!line.hidden && l.length > maxLineLength) {
-          maxLineLength = l.length; maxLine = l;
+          maxLineLength = l.length; maxLine = line;
         }
       });
       updateMaxLine = false;
@@ -922,7 +900,7 @@ var CodeMirror = (function() {
         var line = pos.line + code.length - (to.line - from.line) - 1;
         var ch = pos.ch;
         if (pos.line == to.line)
-          ch += code[code.length-1].length - (to.ch - (to.line == from.line ? from.ch : 0));
+          ch += lst(code).length - (to.ch - (to.line == from.line ? from.ch : 0));
         return {line: line, ch: ch};
       }
       var end;
@@ -940,7 +918,7 @@ var CodeMirror = (function() {
       });
     }
     function replaceRange1(code, from, to, computeSel) {
-      var endch = code.length == 1 ? code[0].length + from.ch : code[code.length-1].length;
+      var endch = code.length == 1 ? code[0].length + from.ch : lst(code).length;
       var newSel = computeSel({line: from.line + code.length - 1, ch: endch});
       updateLines(from, to, code, newSel.from, newSel.to);
     }
@@ -957,25 +935,20 @@ var CodeMirror = (function() {
       return getRange(sel.from, sel.to, lineSep);
     }
 
-    var pollingFast = false; // Ensures slowPoll doesn't cancel fastPoll
     function slowPoll() {
       if (pollingFast) return;
       poll.set(options.pollInterval, function() {
-        startOperation();
         readInput();
         if (focused) slowPoll();
-        endOperation();
       });
     }
     function fastPoll() {
       var missed = false;
       pollingFast = true;
       function p() {
-        startOperation();
         var changed = readInput();
         if (!changed && !missed) {missed = true; poll.set(60, p);}
         else {pollingFast = false; slowPoll();}
-        endOperation();
       }
       poll.set(20, p);
     }
@@ -987,43 +960,54 @@ var CodeMirror = (function() {
     // supported or compatible enough yet to rely on.)
     var prevInput = "";
     function readInput() {
-      if (leaveInputAlone || !focused || hasSelection(input) || options.readOnly) return false;
+      if (!focused || hasSelection(input) || options.readOnly) return false;
       var text = input.value;
       if (text == prevInput) return false;
+      if (!nestedOperation) startOperation();
       shiftSelecting = null;
       var same = 0, l = Math.min(prevInput.length, text.length);
       while (same < l && prevInput[same] == text[same]) ++same;
       if (same < prevInput.length)
         sel.from = {line: sel.from.line, ch: sel.from.ch - (prevInput.length - same)};
-      else if (overwrite && posEq(sel.from, sel.to))
+      else if (overwrite && posEq(sel.from, sel.to) && !pasteIncoming)
         sel.to = {line: sel.to.line, ch: Math.min(getLine(sel.to.line).text.length, sel.to.ch + (text.length - same))};
       replaceSelection(text.slice(same), "end");
       if (text.length > 1000) { input.value = prevInput = ""; }
       else prevInput = text;
+      if (!nestedOperation) endOperation();
+      pasteIncoming = false;
       return true;
     }
     function resetInput(user) {
       if (!posEq(sel.from, sel.to)) {
         prevInput = "";
         input.value = getSelection();
-        selectInput(input);
+        if (focused) selectInput(input);
       } else if (user) prevInput = input.value = "";
     }
 
     function focusInput() {
-      if (options.readOnly != "nocursor") input.focus();
+      if (options.readOnly != "nocursor" && (ie_lt9 || document.activeElement != input))
+        input.focus();
     }
 
-    function scrollEditorIntoView() {
-      var rect = cursor.getBoundingClientRect();
-      // IE returns bogus coordinates when the instance sits inside of an iframe and the cursor is hidden
-      if (ie && rect.top == rect.bottom) return;
-      var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
-      if (rect.top < 0 || rect.bottom > winH) scrollCursorIntoView();
-    }
     function scrollCursorIntoView() {
       var coords = calculateCursorCoords();
-      return scrollIntoView(coords.x, coords.y, coords.x, coords.yBot);
+      scrollIntoView(coords.x, coords.y, coords.x, coords.yBot);
+      if (!focused) return;
+      var box = sizer.getBoundingClientRect(), doScroll = null;
+      if (coords.y + box.top < 0) doScroll = true;
+      else if (coords.y + box.top + textHeight() > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false;
+      if (doScroll != null) {
+        var hidden = cursor.style.display == "none";
+        if (hidden) {
+          cursor.style.display = "";
+          cursor.style.left = coords.x + "px";
+          cursor.style.top = (coords.y - displayOffset) + "px";
+        }
+        cursor.scrollIntoView(doScroll);
+        if (hidden) cursor.style.display = "none";
+      }
     }
     function calculateCursorCoords() {
       var cursor = localCoords(sel.inverted ? sel.from : sel.to);
@@ -1031,17 +1015,16 @@ var CodeMirror = (function() {
       return {x: x, y: cursor.y, yBot: cursor.yBot};
     }
     function scrollIntoView(x1, y1, x2, y2) {
-      var scrollPos = calculateScrollPos(x1, y1, x2, y2), scrolled = false;
-      if (scrollPos.scrollLeft != null) {scroller.scrollLeft = scrollPos.scrollLeft; scrolled = true;}
-      if (scrollPos.scrollTop != null) {scrollbar.scrollTop = scrollPos.scrollTop; scrolled = true;}
-      if (scrolled && options.onScroll) options.onScroll(instance);
+      var scrollPos = calculateScrollPos(x1, y1, x2, y2);
+      if (scrollPos.scrollLeft != null) {scroller.scrollLeft = scrollPos.scrollLeft;}
+      if (scrollPos.scrollTop != null) {scrollbar.scrollTop = scroller.scrollTop = scrollPos.scrollTop;}
     }
     function calculateScrollPos(x1, y1, x2, y2) {
       var pl = paddingLeft(), pt = paddingTop();
       y1 += pt; y2 += pt; x1 += pl; x2 += pl;
       var screen = scroller.clientHeight, screentop = scrollbar.scrollTop, result = {};
-      var docBottom = scroller.scrollHeight;
-      var atTop = y1 < pt + 10, atBottom = y2 + pt > docBottom - 10;;
+      var docBottom = needsScrollbar() || Infinity;
+      var atTop = y1 < pt + 10, atBottom = y2 + pt > docBottom - 10;
       if (y1 < screentop) result.scrollTop = atTop ? 0 : Math.max(0, y1);
       else if (y2 > screentop + screen) result.scrollTop = (atBottom ? docBottom : y2) - screen;
 
@@ -1113,8 +1096,13 @@ var CodeMirror = (function() {
       // This is just a bogus formula that detects when the editor is
       // resized or the font size changes.
       if (different) lastSizeC = scroller.clientHeight + th;
+      if (from != showingFrom || to != showingTo && options.onViewportChange)
+        setTimeout(function(){
+          if (options.onViewportChange) options.onViewportChange(instance, from, to);
+        });
       showingFrom = from; showingTo = to;
       displayOffset = heightAtLine(doc, from);
+      startWorker(100);
 
       // Since this is all rather error prone, it is honoured with the
       // only assertion in the whole file.
@@ -1125,6 +1113,10 @@ var CodeMirror = (function() {
       function checkHeights() {
         var curNode = lineDiv.firstChild, heightChanged = false;
         doc.iter(showingFrom, showingTo, function(line) {
+          // Work around bizarro IE7 bug where, sometimes, our curNode
+          // is magically replaced with a new node in the DOM, leaving
+          // us with a reference to an orphan (nextSibling-less) node.
+          if (!curNode) return;
           if (!line.hidden) {
             var height = Math.round(curNode.offsetHeight / th) || 1;
             if (line.height != height) {
@@ -1137,16 +1129,7 @@ var CodeMirror = (function() {
         return heightChanged;
       }
 
-      if (options.lineWrapping) {
-        checkHeights();
-        var scrollHeight = needsScrollbar();
-        var shouldHaveScrollbar = scrollHeight ? "block" : "none";
-        if (scrollbar.style.display != shouldHaveScrollbar) {
-          scrollbar.style.display = shouldHaveScrollbar;
-          if (scrollHeight) scrollbarInner.style.height = scrollHeight + "px";
-          checkHeights();
-        }
-      }
+      if (options.lineWrapping) checkHeights();
 
       gutter.style.display = gutterDisplay;
       if (different || gutterDirty) {
@@ -1183,14 +1166,14 @@ var CodeMirror = (function() {
     }
 
     function patchDisplay(from, to, intact) {
+      function killNode(node) {
+        var tmp = node.nextSibling;
+        node.parentNode.removeChild(node);
+        return tmp;
+      }
       // The first pass removes the DOM nodes that aren't intact.
-      if (!intact.length) lineDiv.innerHTML = "";
+      if (!intact.length) removeChildren(lineDiv);
       else {
-        function killNode(node) {
-          var tmp = node.nextSibling;
-          node.parentNode.removeChild(node);
-          return tmp;
-        }
         var domPos = 0, curNode = lineDiv.firstChild, n;
         for (var i = 0; i < intact.length; ++i) {
           var cur = intact[i];
@@ -1201,21 +1184,20 @@ var CodeMirror = (function() {
       }
       // This pass fills in the lines that actually changed.
       var nextIntact = intact.shift(), curNode = lineDiv.firstChild, j = from;
-      var scratch = document.createElement("div");
       doc.iter(from, to, function(line) {
         if (nextIntact && nextIntact.to == j) nextIntact = intact.shift();
         if (!nextIntact || nextIntact.from > j) {
-          if (line.hidden) var html = scratch.innerHTML = "<pre></pre>";
+          if (line.hidden) var lineElement = elt("pre");
           else {
-            var html = '<pre' + (line.className ? ' class="' + line.className + '"' : '') + '>'
-              + line.getHTML(makeTab) + '</pre>';
+            var lineElement = lineContent(line);
+            if (line.className) lineElement.className = line.className;
             // Kludge to make sure the styled element lies behind the selection (by z-index)
-            if (line.bgClassName)
-              html = '<div style="position: relative"><pre class="' + line.bgClassName +
-              '" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>' + html + "</div>";
+            if (line.bgClassName) {
+              var pre = elt("pre", "\u00a0", line.bgClassName, "position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2");
+              lineElement = elt("div", [pre, lineElement], null, "position: relative");
+            }
           }
-          scratch.innerHTML = html;
-          lineDiv.insertBefore(scratch.firstChild, curNode);
+          lineDiv.insertBefore(lineElement, curNode);
         } else {
           curNode = curNode.nextSibling;
         }
@@ -1227,10 +1209,10 @@ var CodeMirror = (function() {
       if (!options.gutter && !options.lineNumbers) return;
       var hText = mover.offsetHeight, hEditor = scroller.clientHeight;
       gutter.style.height = (hText - hEditor < 2 ? hEditor : hText) + "px";
-      var html = [], i = showingFrom, normalNode;
+      var fragment = document.createDocumentFragment(), i = showingFrom, normalNode;
       doc.iter(showingFrom, Math.max(showingTo, showingFrom + 1), function(line) {
         if (line.hidden) {
-          html.push("<pre></pre>");
+          fragment.appendChild(elt("pre"));
         } else {
           var marker = line.gutterMarker;
           var text = options.lineNumbers ? options.lineNumberFormatter(i + options.firstLineNumber) : null;
@@ -1238,15 +1220,18 @@ var CodeMirror = (function() {
             text = marker.text.replace("%N%", text != null ? text : "");
           else if (text == null)
             text = "\u00a0";
-          html.push((marker && marker.style ? '<pre class="' + marker.style + '">' : "<pre>"), text);
-          for (var j = 1; j < line.height; ++j) html.push("<br/>&#160;");
-          html.push("</pre>");
+          var markerElement = fragment.appendChild(elt("pre", null, marker && marker.style));
+          markerElement.innerHTML = text;
+          for (var j = 1; j < line.height; ++j) {
+            markerElement.appendChild(elt("br"));
+            markerElement.appendChild(document.createTextNode("\u00a0"));
+          }
           if (!marker) normalNode = i;
         }
         ++i;
       });
       gutter.style.display = "none";
-      gutterText.innerHTML = html.join("");
+      removeChildrenAndAdd(gutterText, fragment);
       // Make sure scrolling doesn't cause number gutter size to pop
       if (normalNode != null && options.lineNumbers) {
         var node = gutterText.childNodes[normalNode - showingFrom];
@@ -1268,21 +1253,23 @@ var CodeMirror = (function() {
       var wrapOff = eltOffset(wrapper), lineOff = eltOffset(lineDiv);
       inputDiv.style.top = Math.max(0, Math.min(scroller.offsetHeight, headPos.y + lineOff.top - wrapOff.top)) + "px";
       inputDiv.style.left = Math.max(0, Math.min(scroller.offsetWidth, headPos.x + lineOff.left - wrapOff.left)) + "px";
-      if (collapsed) {
+      if (collapsed || options.showCursorWhenSelecting) {
         cursor.style.top = headPos.y + "px";
         cursor.style.left = (options.lineWrapping ? Math.min(headPos.x, lineSpace.offsetWidth) : headPos.x) + "px";
         cursor.style.display = "";
-        selectionDiv.style.display = "none";
       } else {
-        var sameLine = fromPos.y == toPos.y, html = "";
+        cursor.style.display = "none";
+      }
+      if (!collapsed) {
+        var sameLine = fromPos.y == toPos.y, fragment = document.createDocumentFragment();
         var clientWidth = lineSpace.clientWidth || lineSpace.offsetWidth;
         var clientHeight = lineSpace.clientHeight || lineSpace.offsetHeight;
-        function add(left, top, right, height) {
+        var add = function(left, top, right, height) {
           var rstyle = quirksMode ? "width: " + (!right ? clientWidth : clientWidth - right - left) + "px"
-                                  : "right: " + right + "px";
-          html += '<div class="CodeMirror-selected" style="position: absolute; left: ' + left +
-            'px; top: ' + top + 'px; ' + rstyle + '; height: ' + height + 'px"></div>';
-        }
+                                  : "right: " + (right - 1) + "px";
+          fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left +
+                                   "px; top: " + top + "px; " + rstyle + "; height: " + height + "px"));
+        };
         if (sel.from.ch && fromPos.y >= 0) {
           var right = sameLine ? clientWidth - toPos.x : 0;
           add(fromPos.x, fromPos.y, right, th);
@@ -1293,9 +1280,10 @@ var CodeMirror = (function() {
           add(0, middleStart, 0, middleHeight);
         if ((!sameLine || !sel.from.ch) && toPos.y < clientHeight - .5 * th)
           add(0, toPos.y, clientWidth - toPos.x, th);
-        selectionDiv.innerHTML = html;
-        cursor.style.display = "none";
+        removeChildrenAndAdd(selectionDiv, fragment);
         selectionDiv.style.display = "";
+      } else {
+        selectionDiv.style.display = "none";
       }
     }
 
@@ -1425,13 +1413,16 @@ var CodeMirror = (function() {
       else replaceRange("", sel.from, findPosH(dir, unit));
       userSelChange = true;
     }
-    var goalColumn = null;
     function moveV(dir, unit) {
       var dist = 0, pos = localCoords(sel.inverted ? sel.from : sel.to, true);
       if (goalColumn != null) pos.x = goalColumn;
-      if (unit == "page") dist = Math.min(scroller.clientHeight, window.innerHeight || document.documentElement.clientHeight);
-      else if (unit == "line") dist = textHeight();
-      var target = coordsChar(pos.x, pos.y + dist * dir + 2);
+      if (unit == "page") {
+        var screen = Math.min(scroller.clientHeight, window.innerHeight || document.documentElement.clientHeight);
+        var target = coordsChar(pos.x, pos.y + screen * dir);
+      } else if (unit == "line") {
+        var th = textHeight();
+        var target = coordsChar(pos.x, pos.y + .5 * th + dir * th);
+      }
       if (unit == "page") scrollbar.scrollTop += localCoords(target, true).y - pos.y;
       setCursor(target.line, target.ch, true);
       goalColumn = pos.x;
@@ -1440,10 +1431,15 @@ var CodeMirror = (function() {
     function findWordAt(pos) {
       var line = getLine(pos.line).text;
       var start = pos.ch, end = pos.ch;
-      var check = isWordChar(line.charAt(start < line.length ? start : start - 1)) ?
-        isWordChar : function(ch) {return !isWordChar(ch);};
-      while (start > 0 && check(line.charAt(start - 1))) --start;
-      while (end < line.length && check(line.charAt(end))) ++end;
+      if (line) {
+        if (pos.after === false || end == line.length) --start; else ++end;
+        var startChar = line.charAt(start);
+        var check = isWordChar(startChar) ? isWordChar :
+                    /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} :
+                    function(ch) {return !/\s/.test(ch) && isWordChar(ch);};
+        while (start > 0 && check(line.charAt(start - 1))) --start;
+        while (end < line.length && check(line.charAt(end))) ++end;
+      }
       return {from: {line: pos.line, ch: start}, to: {line: pos.line, ch: end}};
     }
     function selectLine(line) {
@@ -1480,16 +1476,18 @@ var CodeMirror = (function() {
       var indentString = "", pos = 0;
       if (options.indentWithTabs)
         for (var i = Math.floor(indentation / options.tabSize); i; --i) {pos += options.tabSize; indentString += "\t";}
-      while (pos < indentation) {++pos; indentString += " ";}
+      if (pos < indentation) indentString += spaceStr(indentation - pos);
 
-      replaceRange(indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length});
+      if (indentString != curSpaceString)
+        replaceRange(indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length});
+      line.stateAfter = null;
     }
 
     function loadMode() {
       mode = CodeMirror.getMode(options, options.mode);
       doc.iter(0, doc.size, function(line) { line.stateAfter = null; });
-      work = [0];
-      startWorker();
+      frontier = 0;
+      startWorker(100);
     }
     function gutterChanged() {
       var visible = options.gutter || options.lineNumbers;
@@ -1506,24 +1504,16 @@ var CodeMirror = (function() {
           var guess = Math.ceil(line.text.length / perLine) || 1;
           if (guess != 1) updateLineHeight(line, guess);
         });
-        lineSpace.style.width = code.style.width = "";
-        widthForcer.style.left = "";
+        lineSpace.style.minWidth = widthForcer.style.left = "";
       } else {
         wrapper.className = wrapper.className.replace(" CodeMirror-wrap", "");
-        maxLine = ""; maxLineChanged = true;
+        computeMaxLength();
         doc.iter(0, doc.size, function(line) {
           if (line.height != 1 && !line.hidden) updateLineHeight(line, 1);
-          if (line.text.length > maxLine.length) maxLine = line.text;
         });
       }
       changes.push({from: 0, to: doc.size});
     }
-    function makeTab(col) {
-      var w = options.tabSize - col % options.tabSize, cached = tabCache[w];
-      if (cached) return cached;
-      for (var str = '<span class="cm-tab">', i = 0; i < w; ++i) str += " ";
-      return (tabCache[w] = {html: str + "</span>", width: w});
-    }
     function themeChanged() {
       scroller.className = scroller.className.replace(/\s*cm-s-\S+/g, "") +
         options.theme.replace(/(^|\s)\s*/g, " cm-s-");
@@ -1534,74 +1524,71 @@ var CodeMirror = (function() {
         (style ? " cm-keymap-" + style : "");
     }
 
-    function TextMarker() { this.set = []; }
+    function TextMarker(type, style) { this.lines = []; this.type = type; if (style) this.style = style; }
     TextMarker.prototype.clear = operation(function() {
-      var min = Infinity, max = -Infinity;
-      for (var i = 0, e = this.set.length; i < e; ++i) {
-        var line = this.set[i], mk = line.marked;
-        if (!mk || !line.parent) continue;
-        var lineN = lineNo(line);
-        min = Math.min(min, lineN); max = Math.max(max, lineN);
-        for (var j = 0; j < mk.length; ++j)
-          if (mk[j].marker == this) mk.splice(j--, 1);
-      }
-      if (min != Infinity)
-        changes.push({from: min, to: max + 1});
+      var min, max;
+      for (var i = 0; i < this.lines.length; ++i) {
+        var line = this.lines[i];
+        var span = getMarkedSpanFor(line.markedSpans, this);
+        if (span.from != null) min = lineNo(line);
+        if (span.to != null) max = lineNo(line);
+        line.markedSpans = removeMarkedSpan(line.markedSpans, span);
+      }
+      if (min != null) changes.push({from: min, to: max + 1});
+      this.lines.length = 0;
+      this.explicitlyCleared = true;
     });
     TextMarker.prototype.find = function() {
       var from, to;
-      for (var i = 0, e = this.set.length; i < e; ++i) {
-        var line = this.set[i], mk = line.marked;
-        for (var j = 0; j < mk.length; ++j) {
-          var mark = mk[j];
-          if (mark.marker == this) {
-            if (mark.from != null || mark.to != null) {
-              var found = lineNo(line);
-              if (found != null) {
-                if (mark.from != null) from = {line: found, ch: mark.from};
-                if (mark.to != null) to = {line: found, ch: mark.to};
-              }
-            }
-          }
+      for (var i = 0; i < this.lines.length; ++i) {
+        var line = this.lines[i];
+        var span = getMarkedSpanFor(line.markedSpans, this);
+        if (span.from != null || span.to != null) {
+          var found = lineNo(line);
+          if (span.from != null) from = {line: found, ch: span.from};
+          if (span.to != null) to = {line: found, ch: span.to};
         }
       }
-      return {from: from, to: to};
+      if (this.type == "bookmark") return from;
+      return from && {from: from, to: to};
     };
 
-    function markText(from, to, className) {
+    function markText(from, to, className, options) {
       from = clipPos(from); to = clipPos(to);
-      var tm = new TextMarker();
-      if (!posLess(from, to)) return tm;
-      function add(line, from, to, className) {
-        getLine(line).addMark(new MarkedText(from, to, className, tm));
-      }
-      if (from.line == to.line) add(from.line, from.ch, to.ch, className);
-      else {
-        add(from.line, from.ch, null, className);
-        for (var i = from.line + 1, e = to.line; i < e; ++i)
-          add(i, null, null, className);
-        add(to.line, null, to.ch, className);
-      }
+      var marker = new TextMarker("range", className);
+      if (options) for (var opt in options) if (options.hasOwnProperty(opt))
+        marker[opt] = options[opt];
+      var curLine = from.line;
+      doc.iter(curLine, to.line + 1, function(line) {
+        var span = {from: curLine == from.line ? from.ch : null,
+                    to: curLine == to.line ? to.ch : null,
+                    marker: marker};
+        line.markedSpans = (line.markedSpans || []).concat([span]);
+        marker.lines.push(line);
+        ++curLine;
+      });
       changes.push({from: from.line, to: to.line + 1});
-      return tm;
+      return marker;
     }
 
     function setBookmark(pos) {
       pos = clipPos(pos);
-      var bm = new Bookmark(pos.ch);
-      getLine(pos.line).addMark(bm);
-      return bm;
+      var marker = new TextMarker("bookmark"), line = getLine(pos.line);
+      history.addChange(pos.line, 1, [newHL(line.text, line.markedSpans)], true);
+      var span = {from: pos.ch, to: pos.ch, marker: marker};
+      line.markedSpans = (line.markedSpans || []).concat([span]);
+      marker.lines.push(line);
+      return marker;
     }
 
     function findMarksAt(pos) {
       pos = clipPos(pos);
-      var markers = [], marked = getLine(pos.line).marked;
-      if (!marked) return markers;
-      for (var i = 0, e = marked.length; i < e; ++i) {
-        var m = marked[i];
-        if ((m.from == null || m.from <= pos.ch) &&
-            (m.to == null || m.to >= pos.ch))
-          markers.push(m.marker || m);
+      var markers = [], spans = getLine(pos.line).markedSpans;
+      if (spans) for (var i = 0; i < spans.length; ++i) {
+        var span = spans[i];
+        if ((span.from == null || span.from <= pos.ch) &&
+            (span.to == null || span.to >= pos.ch))
+          markers.push(span.marker);
       }
       return markers;
     }
@@ -1641,11 +1628,10 @@ var CodeMirror = (function() {
         if (line.hidden != hidden) {
           line.hidden = hidden;
           if (!options.lineWrapping) {
-            var l = line.text;
-            if (hidden && l.length == maxLine.length) {
+            if (hidden && line.text.length == maxLine.text.length) {
               updateMaxLine = true;
-            } else if (!hidden && l.length > maxLine.length) {
-              maxLine = l; updateMaxLine = false;
+            } else if (!hidden && line.text.length > maxLine.text.length) {
+              maxLine = line; updateMaxLine = false;
             }
           }
           updateLineHeight(line, hidden ? 0 : 1);
@@ -1677,53 +1663,16 @@ var CodeMirror = (function() {
               markerClass: marker && marker.style, lineClass: line.className, bgClass: line.bgClassName};
     }
 
-    function stringWidth(str) {
-      measure.innerHTML = "<pre><span>x</span></pre>";
-      measure.firstChild.firstChild.firstChild.nodeValue = str;
-      return measure.firstChild.firstChild.offsetWidth || 10;
-    }
-    // These are used to go from pixel positions to character
-    // positions, taking varying character widths into account.
-    function charFromX(line, x) {
-      if (x <= 0) return 0;
-      var lineObj = getLine(line), text = lineObj.text;
-      function getX(len) {
-        return measureLine(lineObj, len).left;
-      }
-      var from = 0, fromX = 0, to = text.length, toX;
-      // Guess a suitable upper bound for our search.
-      var estimated = Math.min(to, Math.ceil(x / charWidth()));
-      for (;;) {
-        var estX = getX(estimated);
-        if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));
-        else {toX = estX; to = estimated; break;}
-      }
-      if (x > toX) return to;
-      // Try to guess a suitable lower bound as well.
-      estimated = Math.floor(to * 0.8); estX = getX(estimated);
-      if (estX < x) {from = estimated; fromX = estX;}
-      // Do a binary search between these bounds.
-      for (;;) {
-        if (to - from <= 1) return (toX - x > x - fromX) ? from : to;
-        var middle = Math.ceil((from + to) / 2), middleX = getX(middle);
-        if (middleX > x) {to = middle; toX = middleX;}
-        else {from = middle; fromX = middleX;}
-      }
-    }
-
-    var tempId = "CodeMirror-temp-" + Math.floor(Math.random() * 0xffffff).toString(16);
     function measureLine(line, ch) {
       if (ch == 0) return {top: 0, left: 0};
-      var wbr = options.lineWrapping && ch < line.text.length &&
-                spanAffectsWrapping.test(line.text.slice(ch - 1, ch + 1));
-      measure.innerHTML = "<pre>" + line.getHTML(makeTab, ch, tempId, wbr) + "</pre>";
-      var elt = document.getElementById(tempId);
-      var top = elt.offsetTop, left = elt.offsetLeft;
+      var pre = lineContent(line, ch);
+      removeChildrenAndAdd(measure, pre);
+      var anchor = pre.anchor;
+      var top = anchor.offsetTop, left = anchor.offsetLeft;
       // Older IEs report zero offsets for spans directly after a wrap
       if (ie && top == 0 && left == 0) {
-        var backup = document.createElement("span");
-        backup.innerHTML = "x";
-        elt.parentNode.insertBefore(backup, elt.nextSibling);
+        var backup = elt("span", "x");
+        anchor.parentNode.insertBefore(backup, anchor.nextSibling);
         top = backup.offsetTop;
       }
       return {top: top, left: left};
@@ -1740,17 +1689,19 @@ var CodeMirror = (function() {
     }
     // Coords must be lineSpace-local
     function coordsChar(x, y) {
-      if (y < 0) y = 0;
       var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);
+      if (heightPos < 0) return {line: 0, ch: 0};
       var lineNo = lineAtHeight(doc, heightPos);
       if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};
       var lineObj = getLine(lineNo), text = lineObj.text;
       var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;
       if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};
+      var wrongLine = false;
       function getX(len) {
         var sp = measureLine(lineObj, len);
         if (tw) {
           var off = Math.round(sp.top / th);
+          wrongLine = off != innerOff;
           return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);
         }
         return sp.left;
@@ -1769,9 +1720,12 @@ var CodeMirror = (function() {
       if (estX < x) {from = estimated; fromX = estX;}
       // Do a binary search between these bounds.
       for (;;) {
-        if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};
+        if (to - from <= 1) {
+          var after = x - fromX < toX - x;
+          return {line: lineNo, ch: after ? from : to, after: after};
+        }
         var middle = Math.ceil((from + to) / 2), middleX = getX(middle);
-        if (middleX > x) {to = middle; toX = middleX;}
+        if (middleX > x) {to = middle; toX = middleX; if (wrongLine) toX += 1000; }
         else {from = middle; fromX = middleX;}
       }
     }
@@ -1780,26 +1734,32 @@ var CodeMirror = (function() {
       return {x: off.left + local.x, y: off.top + local.y, yBot: off.top + local.yBot};
     }
 
-    var cachedHeight, cachedHeightFor, measureText;
+    var cachedHeight, cachedHeightFor, measurePre;
     function textHeight() {
-      if (measureText == null) {
-        measureText = "<pre>";
-        for (var i = 0; i < 49; ++i) measureText += "x<br/>";
-        measureText += "x</pre>";
+      if (measurePre == null) {
+        measurePre = elt("pre");
+        for (var i = 0; i < 49; ++i) {
+          measurePre.appendChild(document.createTextNode("x"));
+          measurePre.appendChild(elt("br"));
+        }
+        measurePre.appendChild(document.createTextNode("x"));
       }
       var offsetHeight = lineDiv.clientHeight;
       if (offsetHeight == cachedHeightFor) return cachedHeight;
       cachedHeightFor = offsetHeight;
-      measure.innerHTML = measureText;
+      removeChildrenAndAdd(measure, measurePre.cloneNode(true));
       cachedHeight = measure.firstChild.offsetHeight / 50 || 1;
-      measure.innerHTML = "";
+      removeChildren(measure);
       return cachedHeight;
     }
     var cachedWidth, cachedWidthFor = 0;
     function charWidth() {
       if (scroller.clientWidth == cachedWidthFor) return cachedWidth;
       cachedWidthFor = scroller.clientWidth;
-      return (cachedWidth = stringWidth("x"));
+      var anchor = elt("span", "x");
+      var pre = elt("pre", [anchor]);
+      removeChildrenAndAdd(measure, pre);
+      return (cachedWidth = anchor.offsetWidth || 10);
     }
     function paddingTop() {return lineSpace.offsetTop;}
     function paddingLeft() {return lineSpace.offsetLeft;}
@@ -1816,6 +1776,7 @@ var CodeMirror = (function() {
       var offL = eltOffset(lineSpace, true);
       return coordsChar(x - offL.left, y - offL.top);
     }
+    var detectingSelectAll;
     function onContextMenu(e) {
       var pos = posFromMouse(e), scrollPos = scrollbar.scrollTop;
       if (!pos || opera) return; // Opera is difficult.
@@ -1827,19 +1788,30 @@ var CodeMirror = (function() {
       input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) +
         "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; " +
         "border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
-      leaveInputAlone = true;
-      var val = input.value = getSelection();
       focusInput();
-      selectInput(input);
+      resetInput(true);
+      // Adds "Select all" to context menu in FF
+      if (posEq(sel.from, sel.to)) input.value = prevInput = " ";
+
       function rehide() {
-        var newVal = splitLines(input.value).join("\n");
-        if (newVal != val && !options.readOnly) operation(replaceSelection)(newVal, "end");
         inputDiv.style.position = "relative";
         input.style.cssText = oldCSS;
         if (ie_lt9) scrollbar.scrollTop = scrollPos;
-        leaveInputAlone = false;
-        resetInput(true);
         slowPoll();
+
+        // Try to detect the user choosing select-all 
+        if (input.selectionStart != null) {
+          clearTimeout(detectingSelectAll);
+          var extval = input.value = " " + (posEq(sel.from, sel.to) ? "" : input.value), i = 0;
+          prevInput = " ";
+          input.selectionStart = 1; input.selectionEnd = extval.length;
+          detectingSelectAll = setTimeout(function poll(){
+            if (prevInput == " " && input.selectionStart == 0)
+              operation(commands.selectAll)(instance);
+            else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500);
+            else resetInput();
+          }, 200);
+        }
       }
 
       if (gecko) {
@@ -1860,7 +1832,7 @@ var CodeMirror = (function() {
       cursor.style.visibility = "";
       blinker = setInterval(function() {
         cursor.style.visibility = (on = !on) ? "" : "hidden";
-      }, 650);
+      }, options.cursorBlinkRate);
     }
 
     var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
@@ -1923,70 +1895,39 @@ var CodeMirror = (function() {
       return minline;
     }
     function getStateBefore(n) {
-      var start = findStartLine(n), state = start && getLine(start-1).stateAfter;
+      var pos = findStartLine(n), state = pos && getLine(pos-1).stateAfter;
       if (!state) state = startState(mode);
       else state = copyState(mode, state);
-      doc.iter(start, n, function(line) {
-        line.highlight(mode, state, options.tabSize);
-        line.stateAfter = copyState(mode, state);
+      doc.iter(pos, n, function(line) {
+        line.process(mode, state, options.tabSize);
+        line.stateAfter = (pos == n - 1 || pos % 5 == 0) ? copyState(mode, state) : null;
       });
-      if (start < n) changes.push({from: start, to: n});
-      if (n < doc.size && !getLine(n).stateAfter) work.push(n);
       return state;
     }
-    function highlightLines(start, end) {
-      var state = getStateBefore(start);
-      doc.iter(start, end, function(line) {
-        line.highlight(mode, state, options.tabSize);
-        line.stateAfter = copyState(mode, state);
-      });
-    }
     function highlightWorker() {
-      var end = +new Date + options.workTime;
-      var foundWork = work.length;
-      while (work.length) {
-        if (!getLine(showingFrom).stateAfter) var task = showingFrom;
-        else var task = work.pop();
-        if (task >= doc.size) continue;
-        var start = findStartLine(task), state = start && getLine(start-1).stateAfter;
-        if (state) state = copyState(mode, state);
-        else state = startState(mode);
-
-        var unchanged = 0, compare = mode.compareStates, realChange = false,
-            i = start, bail = false;
-        doc.iter(i, doc.size, function(line) {
-          var hadState = line.stateAfter;
-          if (+new Date > end) {
-            work.push(i);
-            startWorker(options.workDelay);
-            if (realChange) changes.push({from: task, to: i + 1});
-            return (bail = true);
-          }
-          var changed = line.highlight(mode, state, options.tabSize);
-          if (changed) realChange = true;
+      if (frontier >= showingTo) return;
+      var end = +new Date + options.workTime, state = copyState(mode, getStateBefore(frontier));
+      var startFrontier = frontier;
+      doc.iter(frontier, showingTo, function(line) {
+        if (frontier >= showingFrom) { // Visible
+          line.highlight(mode, state, options.tabSize);
           line.stateAfter = copyState(mode, state);
-          var done = null;
-          if (compare) {
-            var same = hadState && compare(hadState, state);
-            if (same != Pass) done = !!same;
-          }
-          if (done == null) {
-            if (changed !== false || !hadState) unchanged = 0;
-            else if (++unchanged > 3 && (!mode.indent || mode.indent(hadState, "") == mode.indent(state, "")))
-              done = true;
-          }
-          if (done) return true;
-          ++i;
-        });
-        if (bail) return;
-        if (realChange) changes.push({from: task, to: i + 1});
-      }
-      if (foundWork && options.onHighlightComplete)
-        options.onHighlightComplete(instance);
+        } else {
+          line.process(mode, state, options.tabSize);
+          line.stateAfter = frontier % 5 == 0 ? copyState(mode, state) : null;
+        }
+        ++frontier;
+        if (+new Date > end) {
+          startWorker(options.workDelay);
+          return true;
+        }
+      });
+      if (showingTo > startFrontier && frontier >= showingFrom)
+        operation(function() {changes.push({from: startFrontier, to: frontier});})();
     }
     function startWorker(time) {
-      if (!work.length) return;
-      highlight.set(time, operation(highlightWorker));
+      if (frontier < showingTo)
+        highlight.set(time, highlightWorker);
     }
 
     // Operations are used to wrap changes in such a way that each
@@ -2000,9 +1941,11 @@ var CodeMirror = (function() {
     function endOperation() {
       if (updateMaxLine) computeMaxLength();
       if (maxLineChanged && !options.lineWrapping) {
-        var cursorWidth = widthForcer.offsetWidth, left = stringWidth(maxLine);
-        widthForcer.style.left = left + "px";
-        lineSpace.style.minWidth = (left + cursorWidth) + "px";
+        var cursorWidth = widthForcer.offsetWidth, left = measureLine(maxLine, maxLine.text.length).left;
+        if (!ie_lt8) {
+          widthForcer.style.left = left + "px";
+          lineSpace.style.minWidth = (left + cursorWidth) + "px";
+        }
         maxLineChanged = false;
       }
       var newScrollPos, updated;
@@ -2010,16 +1953,16 @@ var CodeMirror = (function() {
         var coords = calculateCursorCoords();
         newScrollPos = calculateScrollPos(coords.x, coords.y, coords.x, coords.yBot);
       }
-      if (changes.length) updated = updateDisplay(changes, true, (newScrollPos ? newScrollPos.scrollTop : null));
-      else {
+      if (changes.length || newScrollPos && newScrollPos.scrollTop != null)
+        updated = updateDisplay(changes, true, newScrollPos && newScrollPos.scrollTop);
+      if (!updated) {
         if (selectionChanged) updateSelection();
         if (gutterDirty) updateGutter();
       }
       if (newScrollPos) scrollCursorIntoView();
-      if (selectionChanged) {scrollEditorIntoView(); restartBlink();}
+      if (selectionChanged) restartBlink();
 
-      if (focused && !leaveInputAlone &&
-          (updateInput === true || (updateInput !== false && selectionChanged)))
+      if (focused && (updateInput === true || (updateInput !== false && selectionChanged)))
         resetInput(userSelChange);
 
       if (selectionChanged && options.matchBrackets)
@@ -2054,6 +1997,7 @@ var CodeMirror = (function() {
       if (extensions.propertyIsEnumerable(ext) &&
           !instance.propertyIsEnumerable(ext))
         instance[ext] = extensions[ext];
+    for (var i = 0; i < initHooks.length; ++i) initHooks[i](instance);
     return instance;
   } // (end of function CodeMirror)
 
@@ -2077,15 +2021,17 @@ var CodeMirror = (function() {
     gutter: false,
     fixedGutter: false,
     firstLineNumber: 1,
+    showCursorWhenSelecting: false,
     readOnly: false,
     dragDrop: true,
     onChange: null,
     onCursorActivity: null,
+    onViewportChange: null,
     onGutterClick: null,
-    onHighlightComplete: null,
     onUpdate: null,
     onFocus: null, onBlur: null, onScroll: null,
     matchBrackets: false,
+    cursorBlinkRate: 530,
     workTime: 100,
     workDelay: 200,
     pollInterval: 100,
@@ -2124,7 +2070,17 @@ var CodeMirror = (function() {
     var spec = CodeMirror.resolveMode(spec);
     var mfactory = modes[spec.name];
     if (!mfactory) return CodeMirror.getMode(options, "text/plain");
-    return mfactory(options, spec);
+    var modeObj = mfactory(options, spec);
+    if (modeExtensions.hasOwnProperty(spec.name)) {
+      var exts = modeExtensions[spec.name];
+      for (var prop in exts) {
+        if (!exts.hasOwnProperty(prop)) continue;
+        if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop];
+        modeObj[prop] = exts[prop];
+      }
+    }
+    modeObj.name = spec.name;
+    return modeObj;
   };
   CodeMirror.listModes = function() {
     var list = [];
@@ -2144,6 +2100,16 @@ var CodeMirror = (function() {
     extensions[name] = func;
   };
 
+  var initHooks = [];
+  CodeMirror.defineInitHook = function(f) {initHooks.push(f);};
+
+  var modeExtensions = CodeMirror.modeExtensions = {};
+  CodeMirror.extendMode = function(mode, properties) {
+    var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});
+    for (var prop in properties) if (properties.hasOwnProperty(prop))
+      exts[prop] = properties[prop];
+  };
+
   var commands = CodeMirror.commands = {
     selectAll: function(cm) {cm.setSelection({line: 0, ch: 0}, {line: cm.lineCount() - 1});},
     killLine: function(cm) {
@@ -2229,7 +2195,7 @@ var CodeMirror = (function() {
   keyMap.emacsy = {
     "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
     "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
-    "Ctrl-V": "goPageUp", "Shift-Ctrl-V": "goPageDown", "Ctrl-D": "delCharRight", "Ctrl-H": "delCharLeft",
+    "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharRight", "Ctrl-H": "delCharLeft",
     "Alt-D": "delWordRight", "Alt-Backspace": "delWordLeft", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars"
   };
 
@@ -2241,6 +2207,10 @@ var CodeMirror = (function() {
     function lookup(map) {
       map = getKeyMap(map);
       var found = map[name];
+      if (found === false) {
+        if (stop) stop();
+        return true;
+      }
       if (found != null && handle(found)) return true;
       if (map.nofallthrough) {
         if (stop) stop();
@@ -2262,29 +2232,34 @@ var CodeMirror = (function() {
     var name = keyNames[e_prop(event, "keyCode")];
     return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod";
   }
+  CodeMirror.isModifierKey = isModifierKey;
 
   CodeMirror.fromTextArea = function(textarea, options) {
     if (!options) options = {};
     options.value = textarea.value;
     if (!options.tabindex && textarea.tabindex)
       options.tabindex = textarea.tabindex;
-    if (options.autofocus == null && textarea.getAttribute("autofocus") != null)
-      options.autofocus = true;
+    // Set autofocus to true if this textarea is focused, or if it has
+    // autofocus and no other element is focused.
+    if (options.autofocus == null) {
+      var hasFocus = document.body;
+      // doc.activeElement occasionally throws on IE
+      try { hasFocus = document.activeElement; } catch(e) {}
+      options.autofocus = hasFocus == textarea ||
+        textarea.getAttribute("autofocus") != null && hasFocus == document.body;
+    }
 
     function save() {textarea.value = instance.getValue();}
     if (textarea.form) {
       // Deplorable hack to make the submit method do the right thing.
       var rmSubmit = connect(textarea.form, "submit", save, true);
-      if (typeof textarea.form.submit == "function") {
-        var realSubmit = textarea.form.submit;
-        function wrappedSubmit() {
-          save();
-          textarea.form.submit = realSubmit;
-          textarea.form.submit();
-          textarea.form.submit = wrappedSubmit;
-        }
-        textarea.form.submit = wrappedSubmit;
-      }
+      var form = textarea.form, realSubmit = form.submit;
+      textarea.form.submit = function wrappedSubmit() {
+        save();
+        form.submit = realSubmit;
+        form.submit();
+        form.submit = wrappedSubmit;
+      };
     }
 
     textarea.style.display = "none";
@@ -2306,6 +2281,24 @@ var CodeMirror = (function() {
     return instance;
   };
 
+  var gecko = /gecko\/\d/i.test(navigator.userAgent);
+  var ie = /MSIE \d/.test(navigator.userAgent);
+  var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent);
+  var ie_lt9 = /MSIE [1-8]\b/.test(navigator.userAgent);
+  var quirksMode = ie && document.documentMode == 5;
+  var webkit = /WebKit\//.test(navigator.userAgent);
+  var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent);
+  var chrome = /Chrome\//.test(navigator.userAgent);
+  var opera = /Opera\//.test(navigator.userAgent);
+  var safari = /Apple Computer/.test(navigator.vendor);
+  var khtml = /KHTML\//.test(navigator.userAgent);
+  var mac_geLion = /Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent);
+
+  var opera_version = opera && navigator.userAgent.match(/Version\/(\d*\.\d*)/);
+  if (opera_version) opera_version = Number(opera_version[1]);
+  // Some browsers use the wrong event properties to signal cmd/ctrl on OS X
+  var flipCtrlCmd = mac && (qtwebkit || opera && (opera_version == null || opera_version < 12.11));
+
   // Utility functions for working with state. Exported because modes
   // sometimes need to do this.
   function copyState(mode, state) {
@@ -2324,6 +2317,14 @@ var CodeMirror = (function() {
     return mode.startState ? mode.startState(a1, a2) : true;
   }
   CodeMirror.startState = startState;
+  CodeMirror.innerMode = function(mode, state) {
+    while (mode.innerMode) {
+      var info = mode.innerMode(state);
+      state = info.state;
+      mode = info.mode;
+    }
+    return info || {mode: mode, state: state};
+  };
 
   // The character stream used by a mode's parser.
   function StringStream(string, tabSize) {
@@ -2334,7 +2335,7 @@ var CodeMirror = (function() {
   StringStream.prototype = {
     eol: function() {return this.pos >= this.string.length;},
     sol: function() {return this.pos == 0;},
-    peek: function() {return this.string.charAt(this.pos);},
+    peek: function() {return this.string.charAt(this.pos) || undefined;},
     next: function() {
       if (this.pos < this.string.length)
         return this.string.charAt(this.pos++);
@@ -2365,13 +2366,14 @@ var CodeMirror = (function() {
     indentation: function() {return countColumn(this.string, null, this.tabSize);},
     match: function(pattern, consume, caseInsensitive) {
       if (typeof pattern == "string") {
-        function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
+        var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
         if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
           if (consume !== false) this.pos += pattern.length;
           return true;
         }
       } else {
         var match = this.string.slice(this.pos).match(pattern);
+        if (match && match.index > 0) return null;
         if (match && consume !== false) this.pos += match[0].length;
         return match;
       }
@@ -2380,210 +2382,174 @@ var CodeMirror = (function() {
   };
   CodeMirror.StringStream = StringStream;
 
-  function MarkedText(from, to, className, marker) {
-    this.from = from; this.to = to; this.style = className; this.marker = marker;
+  function MarkedSpan(from, to, marker) {
+    this.from = from; this.to = to; this.marker = marker;
   }
-  MarkedText.prototype = {
-    attach: function(line) { this.marker.set.push(line); },
-    detach: function(line) {
-      var ix = indexOf(this.marker.set, line);
-      if (ix > -1) this.marker.set.splice(ix, 1);
-    },
-    split: function(pos, lenBefore) {
-      if (this.to <= pos && this.to != null) return null;
-      var from = this.from < pos || this.from == null ? null : this.from - pos + lenBefore;
-      var to = this.to == null ? null : this.to - pos + lenBefore;
-      return new MarkedText(from, to, this.style, this.marker);
-    },
-    dup: function() { return new MarkedText(null, null, this.style, this.marker); },
-    clipTo: function(fromOpen, from, toOpen, to, diff) {
-      if (fromOpen && to > this.from && (to < this.to || this.to == null))
-        this.from = null;
-      else if (this.from != null && this.from >= from)
-        this.from = Math.max(to, this.from) + diff;
-      if (toOpen && (from < this.to || this.to == null) && (from > this.from || this.from == null))
-        this.to = null;
-      else if (this.to != null && this.to > from)
-        this.to = to < this.to ? this.to + diff : from;
-    },
-    isDead: function() { return this.from != null && this.to != null && this.from >= this.to; },
-    sameSet: function(x) { return this.marker == x.marker; }
-  };
 
-  function Bookmark(pos) {
-    this.from = pos; this.to = pos; this.line = null;
-  }
-  Bookmark.prototype = {
-    attach: function(line) { this.line = line; },
-    detach: function(line) { if (this.line == line) this.line = null; },
-    split: function(pos, lenBefore) {
-      if (pos < this.from) {
-        this.from = this.to = (this.from - pos) + lenBefore;
-        return this;
-      }
-    },
-    isDead: function() { return this.from > this.to; },
-    clipTo: function(fromOpen, from, toOpen, to, diff) {
-      if ((fromOpen || from < this.from) && (toOpen || to > this.to)) {
-        this.from = 0; this.to = -1;
-      } else if (this.from > from) {
-        this.from = this.to = Math.max(to, this.from) + diff;
-      }
-    },
-    sameSet: function(x) { return false; },
-    find: function() {
-  

<TRUNCATED>

[13/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
[docs] clariy purpose of purge


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

Branch: refs/heads/1867-feature-plugins
Commit: d5c28f25e1832b36b60d1c9acde051fc75cc11c7
Parents: ce71976
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Aug 19 15:02:51 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:42 2013 +0200

----------------------------------------------------------------------
 share/doc/src/api/database.rst | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d5c28f25/share/doc/src/api/database.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/api/database.rst b/share/doc/src/api/database.rst
index ba2195c..4ef330d 100644
--- a/share/doc/src/api/database.rst
+++ b/share/doc/src/api/database.rst
@@ -998,6 +998,9 @@ should use a defined view if you want to achieve the best performance.
 * **Response**: JSON structure with purged documents and purge sequence
 * **Admin Privileges Required**: no
 
+Occasionaly something into ends up in your database that should never have
+written to it, like a password or private key. Purge can help you here.
+
 A database purge permanently removes the references to deleted documents
 from the database. Deleting a document within CouchDB does not actually
 remove the document from the database, instead, the document is marked as
@@ -1006,6 +1009,12 @@ deleted documents are replicated to other databases as having been
 deleted. This also means that you can check the status of a document and
 identify that the document has been deleted.
 
+
+.. note::
+
+    Don't use purge as a regular operation, it is designed to be used
+    in exceptional cases.
+
 The purge operation removes the references to the deleted documents from
 the database. The purging of old documents is not replicated to other
 databases. If you are replicating between databases and have deleted a


[21/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450

Posted by ja...@apache.org.
reordering query buttons


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

Branch: refs/heads/1867-feature-plugins
Commit: 0cfd582a87bda8c4d3420891184ed312b55ac33b
Parents: 9586002
Author: sean barclay <fu...@hotmail.com>
Authored: Tue Aug 20 21:29:00 2013 -0700
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 9 11:16:43 2013 +0200

----------------------------------------------------------------------
 .../app/templates/documents/view_editor.html    | 85 +++++++++++---------
 src/fauxton/assets/less/fauxton.less            |  7 +-
 2 files changed, 50 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/0cfd582a/src/fauxton/app/templates/documents/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/view_editor.html b/src/fauxton/app/templates/documents/view_editor.html
index 9a7c8dd..3f0d959 100644
--- a/src/fauxton/app/templates/documents/view_editor.html
+++ b/src/fauxton/app/templates/documents/view_editor.html
@@ -109,42 +109,6 @@ the License.
     <div class="tab-pane" id="query">
       <div class="advanced-options well">
         <form class="view-query-update">
-          <div class="controls controls-row">
-            <label class="span3 inline">
-              Limit:
-              <select name="limit" class="input-small">
-                <option>5</option>
-                <option selected="selected">10</option>
-                <option>25</option>
-                <option>50</option>
-                <option>100</option>
-              </select>
-            </label>
-            <label class="span3 checkbox inline">
-              <input name="include_docs" type="checkbox" value="true"> Include Docs
-            </label>
-            <% if (hasReduce) { %>
-            <label class="span2 checkbox inline">
-              <input name="reduce" type="checkbox" value="true"> Reduce
-            </label>
-            <label class="span4 inline">
-              Group Level:
-              <select 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 class="row-fluid">
             <div class="controls controls-row">
               <input name="key" class="span6" type="text" placeholder="Key">
@@ -159,16 +123,57 @@ the License.
           </div>
           <div class="row-fluid">
             <div class="controls controls-row">
-              <label class="span2 checkbox inline">
+
+              <label class="checkbox inline">
+                <input name="include_docs" type="checkbox" value="true"> Include Docs
+              </label>
+
+              <% if (hasReduce) { %>
+              <label class="checkbox inline">
+                <input name="reduce" type="checkbox" value="true"> Reduce
+              </label>
+
+              <label class="checkbox inline">
+                Group Level:
+                <select 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 class="controls controls-row">
+              <label class="checkbox inline">
                 <input name="stale" type="checkbox" value="ok"> Stale
               </label>
-              <label class="span2 checkbox inline">
+              <label class="checkbox inline">
                 <input name="descending" type="checkbox" value="true"> Descending
               </label>
-              <label class="span4 checkbox inline">
+              <label class="checkbox inline">
+                Limit:
+                <select name="limit" class="input-small">
+                  <option>5</option>
+                  <option selected="selected">10</option>
+                  <option>25</option>
+                  <option>50</option>
+                  <option>100</option>
+                </select>
+              </label>
+            </div>
+            <div class="controls controls-row">
+              <label class="checkbox inline">
                 <input name="inclusive_end" type="checkbox" value="false"> Disable Inclusive End
               </label>
-              <label class="span4 checkbox inline">
+              <label class="checkbox inline">
                 <input name="update_seq" type="checkbox" value="true"> Include Update Sequence
               </label>
             </div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/0cfd582a/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index d19813f..49c973a 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -610,10 +610,11 @@ tbody {padding-top: 10px;}
 
 
 /*form elements and buttons*/
-
 .btn-group {
   > .btn + .dropdown-toggle,
-  > .btn:first-child
+  > .btn:first-child,
+  > .btn:last-child,
+  > .dropdown-toggle
   {
     .border-radius(0);
     background-image: none;
@@ -680,6 +681,7 @@ input[type=text], input[type=password],
   padding: 7px;
   margin-top: -5px;
   border: 1px solid @inputBorder;
+  .border-radius(0);
 }
 
 
@@ -743,6 +745,7 @@ tr.all-docs-item{
 /*documents and databases */
 .view.show{
   color: @fontGrey;
+  margin-top: 56px;
 }
 
 div.spinner {