Skip to content

Commit

Permalink
restructuring, clean up browserify integration
Browse files Browse the repository at this point in the history
  • Loading branch information
dweis committed Mar 8, 2013
1 parent 46192da commit 8326a23
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 42 deletions.
4 changes: 2 additions & 2 deletions client/air_hockey.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var _ = require('underscore')
, GoalView = require('./ui/views/goal')
, PlayerModel = require('./ui/models/player')
, PlayerModel = require('../common/models/player')
, PlayerView = require('./ui/views/player')
, PlayerSetupView = require('./ui/views/player_setup')
, MenuView = require('./ui/views/menu')
, SpectatorsCollection = require('./ui/collections/spectators')
, SpectatorsCollection = require('../common/collections/spectators')
, SpectatorsView = require('./ui/views/spectators')
, Physics = require('../common/physics');

Expand Down
2 changes: 2 additions & 0 deletions client/ui/templates/goal.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GOAL!
<p>{{name}} scored!</p>
9 changes: 0 additions & 9 deletions client/ui/templates/goal.js

This file was deleted.

7 changes: 7 additions & 0 deletions client/ui/templates/player.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<span style="float: left;">
<img src="{{gravatarUrl}}" align="left"/>
</span>
<span>
<h1>{{name}}</h1>
<div class="score">{{score}}</div>
</span>
14 changes: 0 additions & 14 deletions client/ui/templates/player.js

This file was deleted.

4 changes: 4 additions & 0 deletions client/ui/templates/spectator.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="spectator">
<img src="{{gravatarUrl}}"/>
<h1>{{name}}</h1>
</div>
11 changes: 0 additions & 11 deletions client/ui/templates/spectator.js

This file was deleted.

2 changes: 1 addition & 1 deletion client/ui/views/goal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var Backbone = require('backbone')
, _ = require('underscore')
, goalTemplate = require('../templates/goal');
, goalTemplate = require('../templates/goal.hbs');

var GoalView = Backbone.View.extend({
template: goalTemplate,
Expand Down
4 changes: 2 additions & 2 deletions client/ui/views/player.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var Backbone = require('backbone')
, _ = require('underscore')
, PlayerModel = require('../models/player')
, playerTemplate = require('../templates/player');
, PlayerModel = require('../../../common/models/player')
, playerTemplate = require('../templates/player.hbs');

var PlayerView = Backbone.View.extend({
template: playerTemplate,
Expand Down
2 changes: 1 addition & 1 deletion client/ui/views/spectator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var Backbone = require('backbone')
, _ = require('underscore')
, spectatorTemplate = require('../templates/spectator');
, spectatorTemplate = require('../templates/spectator.hbs');

var SpectatorView = Backbone.View.extend({
template: spectatorTemplate,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion public/stylesheets/gameui.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ body {
border: 3px solid rgba(128, 128, 128, 0.8);
border-radius: 10px;
font-size: 10px;
width: 300px;
width: 200px;
margin-right: 5px;
margin-bottom: 5px;
padding: 7px;
Expand Down
5 changes: 4 additions & 1 deletion server/middleware/browserify.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var browserify = require('browserify');
var browserify = require('browserify')
, handleify = require('handleify');

function browserify_middleware(opts, bundleCallback) {
var bundle, cache_time;
Expand All @@ -10,6 +11,8 @@ function browserify_middleware(opts, bundleCallback) {

bundle = browserify(opts.entry);

bundle.transform(handleify);

if (typeof bundleCallback == 'function') bundleCallback(bundle);

opts.bundle_opts = opts.bundle_opts || {};
Expand Down

0 comments on commit 8326a23

Please sign in to comment.