Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit 6f8571ff63476530e4ddffd95cb5a46c25d7e73c 0 parents
@aflatter authored
Showing with 331 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +12 −0 Buildfile
  3. +4 −0 Gemfile
  4. +38 −0 Gemfile.lock
  5. +6 −0 README
  6. BIN  apps/teams/.core.js.swp
  7. BIN  apps/teams/.main.js.swp
  8. +14 −0 apps/teams/Buildfile
  9. BIN  apps/teams/controllers/.teams_controller.js.swp
  10. +17 −0 apps/teams/controllers/teams_controller.js
  11. +27 −0 apps/teams/core.js
  12. BIN  apps/teams/fixtures/.player_fixtures.js.swp
  13. BIN  apps/teams/fixtures/.team_fixtures.js.swp
  14. +16 −0 apps/teams/fixtures/player_fixtures.js
  15. +14 −0 apps/teams/fixtures/team_fixtures.js
  16. +30 −0 apps/teams/main.js
  17. BIN  apps/teams/models/.player_model.js.swp
  18. BIN  apps/teams/models/.team_model.js.swp
  19. +22 −0 apps/teams/models/player_model.js
  20. +22 −0 apps/teams/models/team_model.js
  21. BIN  apps/teams/resources/.main_page.js.swp
  22. +9 −0 apps/teams/resources/loading.rhtml
  23. +21 −0 apps/teams/resources/main_page.js
  24. BIN  apps/teams/templates/.teams.handlebars.swp
  25. +6 −0 apps/teams/templates/teams.handlebars
  26. +15 −0 apps/teams/tests/controllers/teams_test.js
  27. +15 −0 apps/teams/tests/models/player_test.js
  28. +15 −0 apps/teams/tests/models/team_test.js
  29. +27 −0 apps/teams/theme.js
1  .gitignore
@@ -0,0 +1 @@
+tmp
12 Buildfile
@@ -0,0 +1,12 @@
+# ==========================================================================
+# Project: Teams
+# Copyright: @2011 My Company, Inc.
+# ==========================================================================
+
+# This is your Buildfile, which sets build settings for your project.
+# For example, this tells SproutCore's build tools that your requires
+# the SproutCore framework.
+config :all, :required => :sproutcore
+
+# In addition to this Buildfile, which gives settings for your entire project,
+# each of your apps has its own Buildfile with settings specific to that app.
4 Gemfile
@@ -0,0 +1,4 @@
+gem 'sproutcore', '1.6.0.rc.2'
+gem 'chunky_png', '1.1.0'
+
+source :rubygems
38 Gemfile.lock
@@ -0,0 +1,38 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ chunky_png (1.1.0)
+ compass (0.11.1)
+ chunky_png (~> 1.1)
+ fssm (>= 0.2.7)
+ sass (~> 3.1)
+ daemons (1.1.3)
+ erubis (2.7.0)
+ eventmachine (0.12.10)
+ extlib (0.9.15)
+ fssm (0.2.7)
+ haml (3.1.1)
+ json_pure (1.4.6)
+ rack (1.3.0)
+ sass (3.1.1)
+ sproutcore (1.6.0.rc.2)
+ compass (~> 0.11.1)
+ erubis (~> 2.6)
+ extlib (~> 0.9.15)
+ haml (~> 3.1.1)
+ json_pure (~> 1.4.6)
+ rack (~> 1.2)
+ thin (~> 1.2.11)
+ thor (~> 0.14.3)
+ thin (1.2.11)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
+ thor (0.14.6)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ chunky_png (= 1.1.0)
+ sproutcore (= 1.6.0.rc.2)
6 README
@@ -0,0 +1,6 @@
+==========================================================================
+Project: Teams
+Copyright: @2011 My Company, Inc.
+==========================================================================
+
+TODO: Describe Your Project
BIN  apps/teams/.core.js.swp
Binary file not shown
BIN  apps/teams/.main.js.swp
Binary file not shown
14 apps/teams/Buildfile
@@ -0,0 +1,14 @@
+# ==========================================================================
+# Project: Teams
+# Copyright: @2011 My Company, Inc.
+# ==========================================================================
+
+# This is your Buildfile for your app, Teams. This tells SproutCore
+# how to build your app. These settings override those in your project
+# Buildfile, which contains default settings for all apps in your project.
+#
+# This line tells SproutCore's CSS preprocessor what class names to target.
+# Since your app has a theme named 'teams', and it is based on SproutCore's
+# Ace theme (named 'ace'), it is set to 'ace.teams'.
+config :teams, :css_theme => 'ace.teams'
+
BIN  apps/teams/controllers/.teams_controller.js.swp
Binary file not shown
17 apps/teams/controllers/teams_controller.js
@@ -0,0 +1,17 @@
+// ==========================================================================
+// Project: Teams.teamsController
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams */
+
+/** @class
+
+ (Document Your Controller Here)
+
+ @extends SC.Object
+*/
+Teams.teamsController = SC.ObjectController.create(
+/** @scope Teams.teamsController.prototype */ {
+
+
+}) ;
27 apps/teams/core.js
@@ -0,0 +1,27 @@
+// ==========================================================================
+// Project: Teams
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams */
+
+/** @namespace
+
+ My cool new app. Describe your application.
+
+ @extends SC.Object
+*/
+Teams = SC.Application.create(
+ /** @scope Teams.prototype */ {
+
+ NAMESPACE: 'Teams',
+ VERSION: '0.1.0',
+
+ // This is your application store. You will use this store to access all
+ // of your model data. You can also set a data source on this store to
+ // connect to a backend server. The default setup below connects the store
+ // to any fixtures you define.
+ store: SC.Store.create().from(SC.Record.fixtures)
+
+ // TODO: Add global constants or singleton objects needed by your app here.
+
+}) ;
BIN  apps/teams/fixtures/.player_fixtures.js.swp
Binary file not shown
BIN  apps/teams/fixtures/.team_fixtures.js.swp
Binary file not shown
16 apps/teams/fixtures/player_fixtures.js
@@ -0,0 +1,16 @@
+// ==========================================================================
+// Project: Teams.Player Fixtures
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams */
+
+sc_require('models/player_model');
+
+Teams.Player.FIXTURES = [
+
+ {guid: 1, name: 'One', team: 1},
+ {guid: 2, name: 'Two', team: 1},
+ {guid: 3, name: 'Three', team: 2},
+ {guid: 4, name: 'Four', team: 2},
+
+];
14 apps/teams/fixtures/team_fixtures.js
@@ -0,0 +1,14 @@
+// ==========================================================================
+// Project: Teams.Team Fixtures
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams */
+
+sc_require('models/team_model');
+
+Teams.Team.FIXTURES = [
+
+ {guid: 1, name: 'Team Red', players: [1,2]},
+ {guid: 2, name: 'Team Blue', players: [3,4]}
+
+];
30 apps/teams/main.js
@@ -0,0 +1,30 @@
+// ==========================================================================
+// Project: Teams
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams */
+
+// This is the function that will start your app running. The default
+// implementation will load any fixtures you have created then instantiate
+// your controllers and awake the elements on your page.
+//
+// As you develop your application you will probably want to override this.
+// See comments for some pointers on what to do next.
+//
+Teams.main = function main() {
+
+ // Step 1: Instantiate Your Views
+ // The default code here will make the mainPane for your application visible
+ // on screen. If you app gets any level of complexity, you will probably
+ // create multiple pages and panes.
+ Teams.getPath('mainPage.mainPane').append() ;
+
+ // Step 2. Set the content property on your primary controller.
+ // This will make your app come alive!
+
+ Teams.teams = Teams.store.find(Teams.Team);
+ Teams.teamsController.set('content', Teams.teams);
+
+} ;
+
+function main() { Teams.main(); }
BIN  apps/teams/models/.player_model.js.swp
Binary file not shown
BIN  apps/teams/models/.team_model.js.swp
Binary file not shown
22 apps/teams/models/player_model.js
@@ -0,0 +1,22 @@
+// ==========================================================================
+// Project: Teams.Player
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams */
+
+/** @class
+
+ (Document your Model here)
+
+ @extends SC.Record
+ @version 0.1
+*/
+Teams.Player = SC.Record.extend(
+/** @scope Teams.Player.prototype */ {
+ name: SC.Record.attr(String),
+ team: SC.Record.toOne(
+ 'Teams.Team',
+ { isMaster: NO }
+ )
+
+}) ;
22 apps/teams/models/team_model.js
@@ -0,0 +1,22 @@
+// ==========================================================================
+// Project: Teams.Team
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams */
+
+/** @class
+
+ (Document your Model here)
+
+ @extends SC.Record
+ @version 0.1
+*/
+Teams.Team = SC.Record.extend(
+/** @scope Teams.Team.prototype */ {
+ name: SC.Record.attr(String),
+ players: SC.Record.toMany(
+ 'Teams.Player',
+ { isMaster: YES, inverse: 'team' }
+ )
+
+}) ;
BIN  apps/teams/resources/.main_page.js.swp
Binary file not shown
9 apps/teams/resources/loading.rhtml
@@ -0,0 +1,9 @@
+<% content_for :loading do %>
+<% # Any HTML in this file will be visible on screen while your page loads
+ # its application JavaScript. SproutCore applications are optimized for
+ # caching and startup very fast, so your users will often only see this
+ # content for a brief moment on their first app load, if at all.
+%>
+<p class="loading">Loading...<p>
+
+<% end %>
21 apps/teams/resources/main_page.js
@@ -0,0 +1,21 @@
+// ==========================================================================
+// Project: Teams - mainPage
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams */
+
+// This page describes the main user interface for your application.
+Teams.mainPage = SC.Page.design({
+
+ // The main pane is made visible on screen as soon as your app is loaded.
+ // Add childViews to this pane for views to display immediately on page
+ // load.
+ mainPane: SC.MainPane.design({
+ childViews: 'teamsView'.w(),
+
+ teamsView: SC.TemplateView.design({
+ templateName: 'teams'
+ })
+ })
+
+});
BIN  apps/teams/templates/.teams.handlebars.swp
Binary file not shown
6 apps/teams/templates/teams.handlebars
@@ -0,0 +1,6 @@
+{{#collection SC.TemplateCollectionView contentBinding="Teams.teamsController.content"}}
+ Team: {{content.name}}
+ {{#collection SC.TemplateCollectionView contentBinding=".parentView.content.players"}}
+ Player: {{content.name}}
+ {{/collection}}
+{{/collection}}
15 apps/teams/tests/controllers/teams_test.js
@@ -0,0 +1,15 @@
+// ==========================================================================
+// Project: Teams.teamsController Unit Test
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams module test ok equals same stop start */
+
+module("Teams.teamsController");
+
+// TODO: Replace with real unit test for Teams.teamsController
+test("test description", function() {
+ var expected = "test";
+ var result = "test";
+ equals(result, expected, "test should equal test");
+});
+
15 apps/teams/tests/models/player_test.js
@@ -0,0 +1,15 @@
+// ==========================================================================
+// Project: Teams.Player Unit Test
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams module test ok equals same stop start */
+
+module("Teams.Player");
+
+// TODO: Replace with real unit test for Player
+test("test description", function() {
+ var expected = "test";
+ var result = "test";
+ equals(result, expected, "test should equal test");
+});
+
15 apps/teams/tests/models/team_test.js
@@ -0,0 +1,15 @@
+// ==========================================================================
+// Project: Teams.Team Unit Test
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams module test ok equals same stop start */
+
+module("Teams.Team");
+
+// TODO: Replace with real unit test for Team
+test("test description", function() {
+ var expected = "test";
+ var result = "test";
+ equals(result, expected, "test should equal test");
+});
+
27 apps/teams/theme.js
@@ -0,0 +1,27 @@
+// ==========================================================================
+// Project: Teams
+// Copyright: @2011 My Company, Inc.
+// ==========================================================================
+/*globals Teams */
+
+// This is the theme that defines how your app renders.
+//
+// Your app is given its own theme so it is easier and less
+// messy for you to override specific things just for your
+// app.
+//
+// You don't have to create the whole theme on your own, though:
+// your app's theme is based on SproutCore's Ace theme.
+//
+// NOTE: if you want to change the theme this one is based on, don't
+// forget to change the :css_theme property in your buildfile.
+Teams.Theme = SC.AceTheme.create({
+ name: 'teams'
+});
+
+// SproutCore needs to know that your app's theme exists
+SC.Theme.addTheme(Teams.Theme);
+
+// Setting it as the default theme makes every pane SproutCore
+// creates default to this theme unless otherwise specified.
+SC.defaultTheme = 'teams';
Please sign in to comment.
Something went wrong with that request. Please try again.