couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benkeen <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: Add sidebar to compaction page
Date Thu, 08 Jan 2015 18:06:23 GMT
Github user benkeen commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/207#discussion_r22668621
  
    --- Diff: app/addons/documents/shared-resources.js ---
    @@ -0,0 +1,317 @@
    +// Licensed under the Apache License, Version 2.0 (the "License"); you may not
    +// use this file except in compliance with the License. You may obtain a copy of
    +// the License at
    +//
    +//   http://www.apache.org/licenses/LICENSE-2.0
    +//
    +// Unless required by applicable law or agreed to in writing, software
    +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    +// License for the specific language governing permissions and limitations under
    +// the License.
    +
    +define([
    +  'app',
    +  'api',
    +  'cloudant.pagingcollection'
    +], function (app, FauxtonAPI, PagingCollection) {
    +
    +  var Documents = FauxtonAPI.addon();
    --- End diff --
    
    I spent some time trying to define the addon elsewhere, but I'm not sure I can get it
working.
    
    The logical place to define the addon is in `base.js`, I think, but requireJS kind of
inverts everything and makes that impossible. You need to first define the addon in the furthest
leaf in the inheritance tree, rather than the root (`base.js`) because all the dependencies
build upon it up bit by bit. Since `shared-resources.js` contains the basic building blocks
of code - stuff needed all over the place within the addon itself - that ends up being the
code that's included first, hence necessarily the place to define the addon.


---
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.
---

Mime
View raw message