Skip to content

Commit ce14351

Browse files
committed
converting to JS
1 parent b624509 commit ce14351

28 files changed

+133
-144
lines changed

app/app.coffee

Lines changed: 0 additions & 20 deletions
This file was deleted.

app/app.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var BaseApp = require('rendr/shared/app');
2+
3+
var handlebarsHelpers = require('./helpers/handlebars_helpers');
4+
_.each(handlebarsHelpers, function(value, key) {
5+
Handlebars.registerHelper(key, value);
6+
});
7+
8+
module.exports = BaseApp.extend({
9+
defaults: {
10+
loading: false
11+
},
12+
13+
// @client
14+
start: function() {
15+
// Show a loading indicator when the app is fetching.
16+
this.router.on('action:start', function() { this.set({loading: true}); }, this);
17+
this.router.on('action:end', function() { this.set({loading: false}); }, this);
18+
19+
BaseApp.prototype.start.call(this);
20+
}
21+
22+
});

app/helpers/handlebars_helpers.coffee

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/helpers/handlebars_helpers.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var manifest = null;
2+
3+
module.exports = {
4+
asset_url: function(path) {
5+
if (!manifest && global.isServer) {
6+
manifest = require(__dirname + '/../../public/manifest');
7+
}
8+
return manifest[path];
9+
}
10+
};

app/router.coffee

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/router.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var BaseClientRouter = require('rendr/client/router');
2+
3+
var Router = module.exports = function Router(options) {
4+
BaseClientRouter.call(this, options);
5+
};
6+
7+
Router.prototype.__proto__ = BaseClientRouter.prototype;
8+
9+
Router.prototype.postInitialize = function() {
10+
this.on('action:start', this.trackImpression, this);
11+
};
12+
13+
Router.prototype.trackImpression = function() {
14+
if (window._gaq) {
15+
_gaq.push(['_trackPageview']);
16+
}
17+
};

app/routes.coffee

Lines changed: 0 additions & 4 deletions
This file was deleted.

app/routes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = function(match) {
2+
match('', 'home#index');
3+
match('repos/:owner/:name', 'repos#show');
4+
match('users/:login', 'users#show');
5+
};

app/templates/__layout.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset='utf-8'/>
6-
<title>Rendr Boilerplate</title>
6+
<title>Rendr Example App</title>
77

88
<link href="{{asset_url "styles.css"}}" media="screen" rel="stylesheet" type="text/css" />
99
</head>

app/templates/error_view.hbs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)