// Concat modules and export them as an app. (function(root) { // All our modules will use global require. (function() { // app.coffee root.require.register('burnchart/src/app.js', function(exports, require, module) { var App, Header, el, mediator, route, router; mediator = require('./modules/mediator'); Header = require('./components/header'); el = '#page'; route = function(page, req, evt) { var Page; document.title = 'BurnChart: GitHub Burndown Chart as a Service'; Page = require("./pages/" + page); return new Page({ el: el }); }; router = { '': _.partial(route, 'index'), 'project/add': _.partial(route, 'addProject') }; App = Ractive.extend({ 'template': require('./templates/layout'), 'components': { Header: Header }, init: function() { return Grapnel.listen(router); } }); module.exports = new App(); }); // addProjectForm.coffee root.require.register('burnchart/src/components/addProjectForm.js', function(exports, require, module) { var firebase, github, mediator, user; firebase = require('../modules/firebase'); user = require('../modules/user'); mediator = require('../modules/mediator'); github = require('../modules/github'); module.exports = Ractive.extend({ 'template': require('../templates/addProjectForm'), 'data': { 'user': user, 'value': null }, 'adapt': [Ractive.adaptors.Ractive], init: function() { var autocomplete; autocomplete = function(value) { return console.log('Autocomplete', value); }; this.observe('value', _.debounce(autocomplete, 200), { 'init': false }); return this.on('submit', function() { var repo, reponame, username, _ref; _ref = this.get('value').split('/'), username = _ref[0], reponame = _ref[1]; repo = github.getRepo(username, reponame); return repo.show(function(err, repo, xhr) { if (err) { throw err; } return window.location.hash = '#'; }); }); } }); }); // header.coffee root.require.register('burnchart/src/components/header.js', function(exports, require, module) { var firebase, mediator, user; firebase = require('../modules/firebase'); user = require('../modules/user'); mediator = require('../modules/mediator'); module.exports = Ractive.extend({ 'template': require('../templates/header'), init: function() { return this.on('!login', function() { return firebase.login(function(err) { if (err) { throw err; } }); }); }, 'data': { user: user }, 'adapt': [Ractive.adaptors.Ractive] }); }); // config.json root.require.register('burnchart/src/models/config.js', function(exports, require, module) { module.exports = { "firebase": "burnchart", "provider": "github" }; }); // firebase.coffee root.require.register('burnchart/src/modules/firebase.js', function(exports, require, module) { var FB, authCb, config, user; config = require('../models/config'); user = require('./user'); authCb = function() {}; FB = (function() { function FB() { this.client = new Firebase("https://" + config.firebase + ".firebaseio.com"); this.auth = new FirebaseSimpleLogin(this.client, function(err, obj) { if (err || !obj) { return authCb(err); } return user.set(obj); }); } FB.prototype.login = function(cb) { if (!this.client) { return cb('Client is not setup'); } authCb = cb; return this.auth.login(config.provider, { 'rememberMe': true, 'scope': 'public_repo' }); }; FB.prototype.logout = function() { var _ref; if ((_ref = this.auth) != null) { _ref.logout; } return user.reset(); }; return FB; })(); module.exports = new FB(); }); // github.coffee root.require.register('burnchart/src/modules/github.js', function(exports, require, module) { var auth, github, setToken, user; user = require('./user'); auth = 'oauth'; github = null; (setToken = function(token) { return github = new Github({ token: token, auth: auth }); })(null); user.observe('accessToken', setToken); module.exports = github; }); // mediator.coffee root.require.register('burnchart/src/modules/mediator.js', function(exports, require, module) { module.exports = new Ractive(); }); // user.coffee root.require.register('burnchart/src/modules/user.js', function(exports, require, module) { module.exports = new Ractive(); }); // addProject.coffee root.require.register('burnchart/src/pages/addProject.js', function(exports, require, module) { var AddProjectForm; AddProjectForm = require('../components/addProjectForm'); module.exports = Ractive.extend({ 'template': require('../templates/pages/addProject'), 'components': { AddProjectForm: AddProjectForm }, init: function() { return console.log('Add a project page'); } }); }); // index.coffee root.require.register('burnchart/src/pages/index.js', function(exports, require, module) { module.exports = Ractive.extend({ 'template': require('../templates/pages/index'), init: function() { return console.log('Index page'); } }); }); // addProjectForm.mustache root.require.register('burnchart/src/templates/addProjectForm.js', function(exports, require, module) { module.exports = ["
","
","

Add a Project

","

Type in the name of the repository as you would normally. If you'd like to add a private GitHub project, Sign In first.

","
","","
"," "," "," "," "," ","
"," "," "," Add","
","
","
"].join("\n"); }); // header.mustache root.require.register('burnchart/src/templates/header.js', function(exports, require, module) { module.exports = ["
","
"," {{#user.displayName}}"," {{user.displayName}} logged in"," {{else}}"," Sign In"," {{/user.displayName}}","
","","

","","
"," "," "," ","
",""," ","
"].join("\n"); }); // layout.mustache root.require.register('burnchart/src/templates/layout.js', function(exports, require, module) { module.exports = ["
","","
"," ","
","","
","
"," © 2012-2014 Radek Stepan","
","
"].join("\n"); }); // addProject.mustache root.require.register('burnchart/src/templates/pages/addProject.js', function(exports, require, module) { module.exports = ["
"," ","
"].join("\n"); }); // index.mustache root.require.register('burnchart/src/templates/pages/index.js', function(exports, require, module) { module.exports = ["
","
","

Disposable Project

"," Milestone 1.0","

The one where we deliver all that we promised.

","
","
","","
","
","
"," ","

See your project progress

","

Not sure where to start? Just add a demo repo to see a chart. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.

"," ","
","
","","
","
"," Sorted by priority","

Projects

","
",""," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","
radekstepan/disposableMilestone 1.0 ","
"," 40%"," due on Friday","
","
","
","
","
radekstepan/burnchartBeta Milestone ","
"," 100%"," due tomorrow","
","
","
","
","
intermine/intermineEmma Release 96 ","
"," 27%"," due in 2 weeks","
","
","
","
","
microsoft/windowsRC 9 ","
"," 90%"," overdue by a month","
","
","
","
","
","","
"," Edit","
","
","
"].join("\n"); }); })(); // Return the main app. var main = root.require("burnchart/src/app.js"); // AMD/RequireJS. if (typeof define !== 'undefined' && define.amd) { define("burnchart", [ /* load deps ahead of time */ ], function () { return main; }); } // CommonJS. else if (typeof module !== 'undefined' && module.exports) { module.exports = main; } // Globally exported. else { root["burnchart"] = main; } // Alias our app. root.require.alias("burnchart/src/app.js", "burnchart/index.js"); })(this);