Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 46A471149A for ; Thu, 9 May 2013 14:30:08 +0000 (UTC) Received: (qmail 55168 invoked by uid 500); 9 May 2013 14:02:55 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 54872 invoked by uid 500); 9 May 2013 14:02:41 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 52275 invoked by uid 99); 9 May 2013 14:01:04 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 May 2013 14:01:04 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8399288A847; Thu, 9 May 2013 14:00:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: garren@apache.org To: commits@couchdb.apache.org Date: Thu, 09 May 2013 14:00:58 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/50] git commit: updated refs/heads/route-events to c33e390 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 Authored: Sat Mar 9 10:08:54 2013 +0200 Committer: Garren Smith 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; +});