Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/433#discussion_r30990140
  
    --- Diff: app/addons/documents/resources.js ---
    @@ -619,5 +619,43 @@ function (app, FauxtonAPI, Documents, 
PagingCollection) {
         }, menuLinks);
       };
     
    +  Documents.RevTreeDataModel = Backbone.Model.extend({
    +    initialize: function (url) {
    +      this.url = url;
    +      console.log("inside initialize");
    +    },
    +    url: function () {
    +      return this.url;
    +    },
    +
    +    sync: function (method, model, options) {
    +      console.log("inside Sync-----" + this.url);
    +      var params = {
    +        error: options.error,
    +        success: options.success,
    +        url: this.url,
    +        type: 'GET',
    +        dataType: 'text',
    +        async: false
    +      };
    +
    +      return $.ajax(params);
    +    },
    +    parse: function (response) {
    +
    +      var parsedResult = [];
    +      var splitResponse = response.split(/(\n|\r\n|\r)/);
    +
    +      for (var i = 0; i < splitResponse.length; i++) {
    +        if (String(splitResponse[i]).charAt(0) == "{") {
    +          parsedResult.push(JSON.parse(splitResponse[i]));
    +        }
    +      }
    +      console.log(parsedResult);
    +
    +      return {content: parsedResult};
    +    }
    +  });
    +
    --- End diff --
    
    this needs tests


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to