You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2013/12/16 21:03:25 UTC
[05/50] git commit: updated refs/heads/1744-single-config-file to
1c344a9
Fauxton fixes
Remove white space in editor
Interior tabs on views now collapse
Reworded preview button
Change Advanced Options -> Query Options
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/2824db13
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/2824db13
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/2824db13
Branch: refs/heads/1744-single-config-file
Commit: 2824db1371d8349e2488fff41a580cf17e7a87a5
Parents: 6350e52
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Dec 2 17:30:42 2013 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Mon Dec 2 17:30:42 2013 +0200
----------------------------------------------------------------------
src/fauxton/app/modules/documents/views.js | 13 +++++++++----
src/fauxton/app/modules/fauxton/components.js | 16 ++++++++++++++++
.../app/templates/documents/advanced_options.html | 2 +-
.../app/templates/documents/view_editor.html | 5 ++---
src/fauxton/assets/less/fauxton.less | 1 -
5 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/2824db13/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 39e210d..af08974 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -1408,17 +1408,22 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) {
},
toggleIndexNav: function (event) {
- var $index = this.$('#index'),
- $targetId = this.$(event.target).attr('id');
+ var $targetId = this.$(event.target).attr('id'),
+ $previousTab = this.$(this.$('li.active a').attr('href')),
+ $targetTab = this.$(this.$(event.target).attr('href'));
+
+ if ($targetTab.attr('id') !== $previousTab.attr('id')) {
+ $previousTab.removeAttr('style');
+ }
if ($targetId === 'index-nav') {
if (this.newView) { return; }
var that = this;
- $index.toggle('slow', function(){
+ $targetTab.toggle('slow', function(){
that.showEditors();
});
} else {
- $index.removeAttr('style');
+ $targetTab.toggle('slow');
}
},
http://git-wip-us.apache.org/repos/asf/couchdb/blob/2824db13/src/fauxton/app/modules/fauxton/components.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/fauxton/components.js b/src/fauxton/app/modules/fauxton/components.js
index 1263bd4..0443573 100644
--- a/src/fauxton/app/modules/fauxton/components.js
+++ b/src/fauxton/app/modules/fauxton/components.js
@@ -201,6 +201,7 @@ function(app, FauxtonAPI, ace) {
afterRender: function () {
this.editor = ace.edit(this.editorId);
+ this.setHeightToLineCount();
this.editor.setTheme("ace/theme/" + this.theme);
this.editor.getSession().setMode("ace/mode/" + this.mode);
this.editor.getSession().setUseWrapMode(true);
@@ -211,6 +212,21 @@ function(app, FauxtonAPI, ace) {
if (this.couchJSHINT) {
this.removeIncorrectAnnotations();
}
+
+ var that = this;
+
+ this.editor.getSession().on('change', function () {
+ that.setHeightToLineCount();
+ });
+ },
+
+ setHeightToLineCount: function () {
+ var lines = this.editor.getSession().getDocument().getLength();
+ this.editor.setOptions({
+ maxLines: lines
+ });
+
+ this.editor.resize();
},
addCommands: function () {
http://git-wip-us.apache.org/repos/asf/couchdb/blob/2824db13/src/fauxton/app/templates/documents/advanced_options.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/advanced_options.html b/src/fauxton/app/templates/documents/advanced_options.html
index df28203..3562f7b 100644
--- a/src/fauxton/app/templates/documents/advanced_options.html
+++ b/src/fauxton/app/templates/documents/advanced_options.html
@@ -87,7 +87,7 @@ the License.
<div id="button-options" class="controls controls-row">
<button type="submit" class="button btn-primary btn-large">Query</button>
<% if (showPreview) { %>
- <button class="button btn-info btn-large preview">Preview</button>
+ <button class="button btn-info btn-large preview">Browser Preview</button>
<% } %>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/couchdb/blob/2824db13/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 8fcd07a..f35b8ab 100644
--- a/src/fauxton/app/templates/documents/view_editor.html
+++ b/src/fauxton/app/templates/documents/view_editor.html
@@ -14,8 +14,8 @@ the License.
<div class="row">
<ul class="nav nav-tabs window-resizeable" id="db-views-tabs-nav">
<li class="active"> <a id="index-nav" 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>
+ <li><a id="query-nav" class="fonticon-plus fonticon" href="#query" data-toggle="tab">Query Options</a></li>
+ <li><a id="meta-nav" href="#metadata" data-toggle="tab">Design Doc Metadata</a></li>
</ul>
<div class="all-docs-list errors-container"></div>
<div class="tab-content">
@@ -56,7 +56,6 @@ the License.
<span class="help-block">Reduce functions are optional.</span>
</div>
-
<div class="control-group reduce-function">
<label for="reduce-function">Custom Reduce</label>
<% if (newView) { %>
http://git-wip-us.apache.org/repos/asf/couchdb/blob/2824db13/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index 252391e..3d8d97a 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -991,7 +991,6 @@ div.spinner {
#map-function, #reduce-function{
width: 100%;
- height: 300px;
font-size: 16px;
}