You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by sebastianrothbucher <gi...@git.apache.org> on 2014/07/18 08:21:11 UTC

[GitHub] couchdb-fauxton pull request: 2160

GitHub user sebastianrothbucher opened a pull request:

    https://github.com/apache/couchdb-fauxton/pull/6

    2160

    Basically the follow-up to https://github.com/apache/couchdb/pull/251
    The hidden lines of the map function were mean, but are fixed. I put CSP into a separate PR (it applies even now on master). Finally the "you've edited the page" is fixed. New one on apache:master

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sebastianrothbucher/couchdb-fauxton 2160-string-edit-new

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fauxton/pull/6.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #6
    
----
commit b340f1dd3b04e41c4bdc28d8a4e2d9524053a6f8
Author: sebastianrothbucher <se...@googlemail.com>
Date:   2014-07-14T21:08:18Z

    restore state of couchdb in couchdb-fauxon
    
    automatically expand ace correctly
    
    remove unnecessary resize, improve comments
    
    have save warning right in principle
    
    final brush-up

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by sebastianrothbucher <gi...@git.apache.org>.
Github user sebastianrothbucher closed the pull request at:

    https://github.com/apache/couchdb-fauxton/pull/6


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/6#issuecomment-50110458
  
    +1 and thank you for your patience! :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/6#issuecomment-49766699
  
    There is a conflict, can you rebase against master?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/6#issuecomment-50183853
  
    Yes
    
    On Friday, July 25, 2014, Sebastian Rothbucher <no...@github.com>
    wrote:
    
    > you mean close the PR?
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/couchdb-fauxton/pull/6#issuecomment-50183644>.
    >


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/6#discussion_r15239192
  
    --- Diff: app/addons/documents/views.js ---
    @@ -765,6 +822,57 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
           FauxtonAPI.navigate(this.database.url("index") + "?limit=100");
         },
     
    +    determineStringEditMatch: function(event) {
    +      var selStart = this.editor.getSelectionStart().row;
    +      var selEnd = this.editor.getSelectionEnd().row;
    +      /* one JS(ON) string can't span more than one line - we edit one string, so ensure we don't select several lines */
    +      if (selStart >=0 && selEnd >= 0 && selStart === selEnd && this.editor.isRowExpanded(selStart)) {    
    +        var editLine = this.editor.getLine(selStart);
    +	var editMatch = editLine.match(/^([ \t]*)("[a-zA-Z0-9_]*": )?(".*",?[ \t]*)$/);
    +	if (editMatch) {
    +          return editMatch;
    +	} else {
    +          return null;
    +	}
    +      } else {
    +        return null;
    +      }
    +    }, 
    +
    +    showHideEditDocString: function (event) {
    +      this.$("button.string-edit").attr("disabled", "true");
    +      if (!this.hasValidCode()) {
    +        return false;
    +      }
    +      var editMatch = this.determineStringEditMatch(event);
    +      if (editMatch) {
    +        this.$("button.string-edit").removeAttr("disabled");
    +	/* remove the following line (along with CSS) to go back to the toolbar */
    +        this.$("button.string-edit").css("top", (this.$("#editor-container")[0].offsetTop - 2 + this.editor.getRowHeight() * this.editor.documentToScreenRow(this.editor.getSelectionStart().row)) + "px");
    --- End diff --
    
    I have several points here:
    
     - `this.$("#editor-container")[0].offsetTop`: you can use jquery here: `this.$("#editor-container").offset().top`
     - can we split this into two lines for a better readability, like:
    
    ```javascript
    var positionFromTop = ...
    this.$("button...
    ```
    - I am not sure what the `2` is? is it a border or padding?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by sebastianrothbucher <gi...@git.apache.org>.
Github user sebastianrothbucher commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/6#issuecomment-50185851
  
    And Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by sebastianrothbucher <gi...@git.apache.org>.
Github user sebastianrothbucher commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/6#issuecomment-50183644
  
    you mean close the PR?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/6#issuecomment-49767190
  
    Really cool feature! 
    
    Beside the questions/suggestions I added for this one line of code I am +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by sebastianrothbucher <gi...@git.apache.org>.
Github user sebastianrothbucher commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/6#issuecomment-50078049
  
    puh - what a merge. Should be current with master again ow - and include Robert's suggestions


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/6#issuecomment-49705555
  
    @sebastianrothbucher this is so awesome. I would like @robertkowalski and @deathbearbrown to review as well. But its working for me. +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: 2160 string edit

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/6#issuecomment-50125201
  
    Sorry for the bad merge. Hopefully now that the components are broken up into different files we won't have this issue again. I'm +1. I've merged this in. You can close this ticket. Thanks again @sebastianrothbucher 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---