Updated Branches: refs/heads/route-events 0ebef26c3 -> c33e3903c (forced update)
initial addon created Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/d85ac225 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/d85ac225 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/d85ac225 Branch: refs/heads/route-events Commit: d85ac2259c9be4f865b671f9b624f1a925de2d00 Parents: 4e3d674 Author: Garren Smith <[email protected]> Authored: Sat Mar 9 10:08:54 2013 +0200 Committer: Garren Smith <[email protected]> Committed: Wed Mar 20 09:43:56 2013 +0200 ---------------------------------------------------------------------- src/fauxton/app/addons/user/base.js | 26 +++++++++++++++++ src/fauxton/app/addons/user/resources.js | 38 +++++++++++++++++++++++++ src/fauxton/app/addons/user/routes.js | 9 ++++++ 3 files changed, 73 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/d85ac225/src/fauxton/app/addons/user/base.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/user/base.js b/src/fauxton/app/addons/user/base.js new file mode 100644 index 0000000..fd9d9c6 --- /dev/null +++ b/src/fauxton/app/addons/user/base.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", + "addons/user/resources" +], + +function(app, FauxtonAPI, User) { + + User.initialize = function() { + FauxtonAPI.addHeaderLink({title: "User", href: "#user"}); + }; + + return User; +}); http://git-wip-us.apache.org/repos/asf/couchdb/blob/d85ac225/src/fauxton/app/addons/user/resources.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/user/resources.js b/src/fauxton/app/addons/user/resources.js new file mode 100644 index 0000000..1410164 --- /dev/null +++ b/src/fauxton/app/addons/user/resources.js @@ -0,0 +1,38 @@ +define([ + "app", + "api" +], + +function (app, FauxtonAPI) { + var User = new FauxtonAPI.addon(); + + User.Session = Backbone.Model.extend({ + url: '/_session', + }); + + User.Info = FauxtonAPI.View.extend({ + + initialize:function (options) { + this.model.on('change', this.update_session, this); + }, + + update_session: function () { + console.log('update session'); + console.log(this.model); + } + }); + + var session = new User.Session(); + + User.Layout = Backbone.Layout.extend({ + views: { + 'a[href="#user"]': new User.Info({model: session}) + } + }); + + var layout = new User.Layout(); + + layout.render(); + session.fetch(); + return User; +}); http://git-wip-us.apache.org/repos/asf/couchdb/blob/d85ac225/src/fauxton/app/addons/user/routes.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/user/routes.js b/src/fauxton/app/addons/user/routes.js new file mode 100644 index 0000000..010ab24 --- /dev/null +++ b/src/fauxton/app/addons/user/routes.js @@ -0,0 +1,9 @@ +define([ + "app", + "api", + "addons/user/resources" +], + +function(app, FauxtonAPI, User) { + return User; +});
