Permalink
Browse files

Reorganizing directory structure

  • Loading branch information...
1 parent 3b1d3ba commit a646e0b693140ebbfd78d635a8b99a5343f7d92b @ccoenraets committed Feb 9, 2012
Showing with 716 additions and 14,242 deletions.
  1. 0 {final → }/api/.htaccess
  2. 0 {final → }/api/Slim/Exception/Pass.php
  3. 0 {final → }/api/Slim/Exception/RequestSlash.php
  4. 0 {final → }/api/Slim/Exception/Stop.php
  5. 0 {final → }/api/Slim/Http/Cookie.php
  6. 0 {final → }/api/Slim/Http/CookieJar.php
  7. 0 {final → }/api/Slim/Http/Request.php
  8. 0 {final → }/api/Slim/Http/Response.php
  9. 0 {final → }/api/Slim/Http/Uri.php
  10. 0 {final → }/api/Slim/Log.php
  11. 0 {final → }/api/Slim/Logger.php
  12. 0 {final → }/api/Slim/Route.php
  13. 0 {final → }/api/Slim/Router.php
  14. 0 {final → }/api/Slim/Session/Flash.php
  15. 0 {final → }/api/Slim/Session/Handler.php
  16. 0 {final → }/api/Slim/Session/Handler/Cookies.php
  17. 0 {final → }/api/Slim/Slim.php
  18. 0 {final → }/api/Slim/View.php
  19. 0 {final → }/api/index.php
  20. +85 −0 css/styles.css
  21. +0 −80 final/css/styles.css
  22. +8 −6 final/index.html
  23. +24 −24 final/js/main.js
  24. +13 −13 final/js/models/winemodel.js
  25. +5 −5 final/js/utils.js
  26. +10 −10 final/js/views/header.js
  27. +42 −42 final/js/views/winedetails.js
  28. +0 −33 final/lib/backbone-min.js
  29. +0 −31 final/lib/underscore-min.js
  30. +1 −1 final/tpl/wine-details.html
  31. +1 −1 final/tpl/wine-list-item.html
  32. +37 −0 lib/backbone-min.js
  33. 0 {final → }/lib/jquery-1.7.1.min.js
  34. +31 −0 lib/underscore-min.js
  35. +0 −10 part1/api/.htaccess
  36. +0 −45 part1/api/Slim/Exception/Pass.php
  37. +0 −46 part1/api/Slim/Exception/RequestSlash.php
  38. +0 −43 part1/api/Slim/Exception/Stop.php
  39. +0 −222 part1/api/Slim/Http/Cookie.php
  40. +0 −401 part1/api/Slim/Http/CookieJar.php
  41. +0 −405 part1/api/Slim/Http/Request.php
  42. +0 −321 part1/api/Slim/Http/Response.php
  43. +0 −131 part1/api/Slim/Http/Uri.php
  44. +0 −155 part1/api/Slim/Log.php
  45. +0 −200 part1/api/Slim/Logger.php
  46. +0 −398 part1/api/Slim/Route.php
  47. +0 −203 part1/api/Slim/Router.php
  48. +0 −192 part1/api/Slim/Session/Flash.php
  49. +0 −125 part1/api/Slim/Session/Handler.php
  50. +0 −71 part1/api/Slim/Session/Handler/Cookies.php
  51. +0 −1,174 part1/api/Slim/Slim.php
  52. +0 −167 part1/api/Slim/View.php
  53. +0 −131 part1/api/index.php
  54. +0 −78 part1/css/styles.css
  55. +36 −40 part1/index.html
  56. +0 −4 part1/js/jquery-1.7.1.min.js
  57. +54 −38 part1/js/main.js
  58. BIN part1/pics/block_nine.jpg
  59. BIN part1/pics/bodega_lurton.jpg
  60. BIN part1/pics/bouscat.jpg
  61. BIN part1/pics/domaine_serene.jpg
  62. BIN part1/pics/ex_umbris.jpg
  63. BIN part1/pics/generic.jpg
  64. BIN part1/pics/lan_rioja.jpg
  65. BIN part1/pics/le_doyenne.jpg
  66. BIN part1/pics/lurton-pinot-gris.jpg
  67. BIN part1/pics/margerum.jpg
  68. BIN part1/pics/morizottes.jpg
  69. BIN part1/pics/rex_hill.jpg
  70. BIN part1/pics/saint_cosme.jpg
  71. BIN part1/pics/viticcio.jpg
  72. +0 −10 part2/api/.htaccess
  73. +0 −45 part2/api/Slim/Exception/Pass.php
  74. +0 −46 part2/api/Slim/Exception/RequestSlash.php
  75. +0 −43 part2/api/Slim/Exception/Stop.php
  76. +0 −222 part2/api/Slim/Http/Cookie.php
  77. +0 −401 part2/api/Slim/Http/CookieJar.php
  78. +0 −405 part2/api/Slim/Http/Request.php
  79. +0 −321 part2/api/Slim/Http/Response.php
  80. +0 −131 part2/api/Slim/Http/Uri.php
  81. +0 −155 part2/api/Slim/Log.php
  82. +0 −200 part2/api/Slim/Logger.php
  83. +0 −398 part2/api/Slim/Route.php
  84. +0 −203 part2/api/Slim/Router.php
  85. +0 −192 part2/api/Slim/Session/Flash.php
  86. +0 −125 part2/api/Slim/Session/Handler.php
  87. +0 −71 part2/api/Slim/Session/Handler/Cookies.php
  88. +0 −1,174 part2/api/Slim/Slim.php
  89. +0 −167 part2/api/Slim/View.php
  90. +0 −131 part2/api/index.php
  91. +0 −82 part2/css/styles.css
  92. +41 −45 part2/index.html
  93. +0 −4 part2/js/jquery-1.7.1.min.js
  94. +120 −114 part2/js/main.js
  95. BIN part2/pics/block_nine.jpg
  96. BIN part2/pics/bodega_lurton.jpg
  97. BIN part2/pics/bouscat.jpg
  98. BIN part2/pics/domaine_serene.jpg
  99. BIN part2/pics/ex_umbris.jpg
  100. BIN part2/pics/generic.jpg
  101. BIN part2/pics/lan_rioja.jpg
  102. BIN part2/pics/le_doyenne.jpg
  103. BIN part2/pics/lurton-pinot-gris.jpg
  104. BIN part2/pics/margerum.jpg
  105. BIN part2/pics/morizottes.jpg
  106. BIN part2/pics/rex_hill.jpg
  107. BIN part2/pics/saint_cosme.jpg
  108. BIN part2/pics/viticcio.jpg
  109. +0 −10 part3/api/.htaccess
  110. +0 −45 part3/api/Slim/Exception/Pass.php
  111. +0 −46 part3/api/Slim/Exception/RequestSlash.php
  112. +0 −43 part3/api/Slim/Exception/Stop.php
  113. +0 −222 part3/api/Slim/Http/Cookie.php
  114. +0 −401 part3/api/Slim/Http/CookieJar.php
  115. +0 −405 part3/api/Slim/Http/Request.php
  116. +0 −321 part3/api/Slim/Http/Response.php
  117. +0 −131 part3/api/Slim/Http/Uri.php
  118. +0 −155 part3/api/Slim/Log.php
  119. +0 −200 part3/api/Slim/Logger.php
  120. +0 −398 part3/api/Slim/Route.php
  121. +0 −203 part3/api/Slim/Router.php
  122. +0 −192 part3/api/Slim/Session/Flash.php
  123. +0 −125 part3/api/Slim/Session/Handler.php
  124. +0 −71 part3/api/Slim/Session/Handler/Cookies.php
  125. +0 −1,174 part3/api/Slim/Slim.php
  126. +0 −167 part3/api/Slim/View.php
  127. +0 −131 part3/api/index.php
  128. +0 −82 part3/css/styles.css
  129. +41 −44 part3/index.html
  130. +0 −4 part3/js/jquery-1.7.1.min.js
  131. +143 −139 part3/js/main.js
  132. BIN part3/pics/block_nine.jpg
  133. BIN part3/pics/bodega_lurton.jpg
  134. BIN part3/pics/bouscat.jpg
  135. BIN part3/pics/domaine_serene.jpg
  136. BIN part3/pics/ex_umbris.jpg
  137. BIN part3/pics/generic.jpg
  138. BIN part3/pics/lan_rioja.jpg
  139. BIN part3/pics/le_doyenne.jpg
  140. BIN part3/pics/lurton-pinot-gris.jpg
  141. BIN part3/pics/margerum.jpg
  142. BIN part3/pics/morizottes.jpg
  143. BIN part3/pics/rex_hill.jpg
  144. BIN part3/pics/saint_cosme.jpg
  145. BIN part3/pics/viticcio.jpg
  146. BIN {final → }/pics/block_nine.jpg
  147. BIN {final → }/pics/bodega_lurton.jpg
  148. BIN {final → }/pics/bouscat.jpg
  149. BIN {final → }/pics/domaine_serene.jpg
  150. BIN {final → }/pics/ex_umbris.jpg
  151. BIN {final → }/pics/generic.jpg
  152. BIN {final → }/pics/lan_rioja.jpg
  153. BIN {final → }/pics/le_doyenne.jpg
  154. BIN {final → }/pics/lurton-pinot-gris.jpg
  155. BIN {final → }/pics/margerum.jpg
  156. BIN {final → }/pics/morizottes.jpg
  157. BIN {final → }/pics/rex_hill.jpg
  158. BIN {final → }/pics/saint_cosme.jpg
  159. BIN {final → }/pics/viticcio.jpg
  160. +24 −2 readme.md
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,85 @@
+* {
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 18px;
+}
+
+#header {
+ padding-top: 5px;
+}
+
+#sidebar {
+ position: absolute;
+ left: 10px;
+ top: 70px;
+ bottom: 20px;
+ width: 260px;
+ border: solid 1px #CCCCCC;
+ overflow-y: scroll;
+}
+
+#content {
+ position: absolute;
+ top: 70px;
+ bottom: 20px;
+ left: 300px;
+ right: 20px;
+}
+
+.form-left-col {
+ width: 310px;
+ float: left;
+}
+
+.form-right-col {
+}
+
+.title {
+ font-size: 20px;
+ font-weight: bold;
+}
+
+ul {
+ list-style-type: none;
+ padding-left: 0px;
+ margin-top: 0px;
+}
+
+li a {
+ text-decoration: none;
+ display: block;
+ color: #000000;
+ border-bottom: solid 1px #CCCCCC;
+ padding: 8px;
+}
+
+li a:hover {
+ background-color: #4B0A1E;
+ color: #BA8A92;
+}
+
+input, textarea {
+ border: 1px solid #ccc;
+ min-height: 30px;
+ outline: none;
+}
+
+.form-left-col input {
+ margin-bottom: 15px;
+ margin-top: 5px;
+ width: 280px;
+}
+
+textarea {
+ margin-bottom: 15px;
+ margin-top: 5px;
+ height: 200px;
+ width: 250px;
+}
+
+label {
+ display: block;
+}
+
+button {
+ padding: 6px;
+}
View
@@ -1,80 +0,0 @@
-* {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 18px;
-}
-
-#header {
- padding-top: 5px;
-}
-
-#sidebar {
- position: absolute;
- left: 10px;
- top: 70px;
- bottom: 20px;
- width: 260px;
- border:solid 1px #CCCCCC;
- overflow-y: scroll;
-}
-
-#content {
- position: absolute;
- top: 70px;
- bottom: 20px;
- left:300px;
- right:20px;
-}
-
-.form-left-col {
- width:310px;
- float: left;
-}
-
-.form-right-col {
-}
-
-ul {
- list-style-type: none;
- padding-left: 0px;
- margin-top: 0px;
-}
-
-li a {
- text-decoration:none;
- display: block;
- color: #000000;
- border-bottom:solid 1px #CCCCCC;
- padding: 8px;
-}
-
-li a:hover {
- background-color: #4B0A1E;
- color: #BA8A92;
-}
-
-input, textarea {
- border:1px solid #ccc;
- min-height:30px;
- outline: none;
-}
-
-.form-left-col input {
- margin-bottom:15px;
- margin-top:5px;
- width:280px;
-}
-
-textarea {
- margin-bottom:15px;
- margin-top:5px;
- height: 200px;
- width:250px;
-}
-
-label {
- display:block;
-}
-
-button {
- padding:6px;
-}
View
@@ -2,7 +2,7 @@
<html>
<head>
<title>Backbone Cellar</title>
-<link rel="stylesheet" href="css/styles.css" />
+<link rel="stylesheet" href="../css/styles.css" />
</head>
<body>
@@ -12,13 +12,15 @@
<div id="sidebar"></div>
<div id="content">
- <h1>Welcome to Backbone Wine Cellar</h1>
+<h2>Welcome to Backbone Cellar</h2>
+<p>
+This is a sample application part of of three-part tutorial showing how to build a CRUD application with Backbone.js.
+</p>
</div>
-<script src="lib/jquery-1.7.1.min.js"></script>
-<script src="lib/underscore-min.js"></script>
-<script src="lib/backbone-min.js"></script>
-
+<script src="../lib/jquery-1.7.1.min.js"></script>
+<script src="../lib/underscore-min.js"></script>
+<script src="../lib/backbone-min.js"></script>
<script src="js/utils.js"></script>
<script src="js/models/winemodel.js"></script>
View
@@ -9,56 +9,56 @@ Backbone.View.prototype.close = function () {
var AppRouter = Backbone.Router.extend({
- initialize: function() {
- $('#header').html( new HeaderView().render().el );
+ initialize:function () {
+ $('#header').html(new HeaderView().render().el);
},
- routes: {
- "" : "list",
- "wines/new" : "newWine",
- "wines/:id" : "wineDetails"
- },
+ routes:{
+ "":"list",
+ "wines/new":"newWine",
+ "wines/:id":"wineDetails"
+ },
- list: function() {
+ list:function () {
this.before();
- },
+ },
- wineDetails: function(id) {
- this.before(function() {
- var wine = app.wineList.get(id);
- app.showView( '#content', new WineView({model: wine}) );
+ wineDetails:function (id) {
+ this.before(function () {
+ var wine = app.wineList.get(id);
+ app.showView('#content', new WineView({model:wine}));
});
- },
+ },
- newWine: function() {
- this.before(function() {
- app.showView( '#content', new WineView({model: new Wine()}) );
+ newWine:function () {
+ this.before(function () {
+ app.showView('#content', new WineView({model:new Wine()}));
});
- },
+ },
- showView: function(selector, view) {
+ showView:function (selector, view) {
if (this.currentView)
this.currentView.close();
$(selector).html(view.render().el);
this.currentView = view;
return view;
},
- before: function(callback) {
+ before:function (callback) {
if (this.wineList) {
if (callback) callback();
} else {
this.wineList = new WineCollection();
- this.wineList.fetch({success: function() {
- $('#sidebar').html( new WineListView({model: app.wineList}).render().el );
- if (callback) callback();
+ this.wineList.fetch({success:function () {
+ $('#sidebar').html(new WineListView({model:app.wineList}).render().el);
+ if (callback) callback();
}});
}
}
});
-tpl.loadTemplates(['header', 'wine-details', 'wine-list-item'], function() {
+tpl.loadTemplates(['header', 'wine-details', 'wine-list-item'], function () {
app = new AppRouter();
Backbone.history.start();
});
@@ -1,18 +1,18 @@
window.Wine = Backbone.Model.extend({
- urlRoot: "api/wines",
- defaults: {
- "id": null,
- "name": "",
- "grapes": "",
- "country": "USA",
- "region": "California",
- "year": "",
- "description": "",
- "picture": ""
- }
+ urlRoot:"../api/wines",
+ defaults:{
+ "id":null,
+ "name":"",
+ "grapes":"",
+ "country":"USA",
+ "region":"California",
+ "year":"",
+ "description":"",
+ "picture":""
+ }
});
window.WineCollection = Backbone.Collection.extend({
- model: Wine,
- url: "api/wines"
+ model:Wine,
+ url:"../api/wines"
});
View
@@ -1,19 +1,19 @@
tpl = {
// Hash of preloaded templates for the app
- templates: {},
+ templates:{},
// Recursively pre-load all the templates for the app.
// This implementation should be changed in a production environment. All the template files should be
// concatenated in a single file.
- loadTemplates: function(names, callback) {
+ loadTemplates:function (names, callback) {
var that = this;
- var loadTemplate = function(index) {
+ var loadTemplate = function (index) {
var name = names[index];
console.log('Loading template: ' + name);
- $.get('tpl/' + name + '.html', function(data) {
+ $.get('tpl/' + name + '.html', function (data) {
that.templates[name] = data;
index++;
if (index < names.length) {
@@ -28,7 +28,7 @@ tpl = {
},
// Get template by name from hash of preloaded templates
- get: function(name) {
+ get:function (name) {
return this.templates[name];
}
View
@@ -1,21 +1,21 @@
window.HeaderView = Backbone.View.extend({
- initialize: function() {
+ initialize:function () {
this.template = _.template(tpl.get('header'));
},
- render: function(eventName) {
- $(this.el).html(this.template());
- return this;
+ render:function (eventName) {
+ $(this.el).html(this.template());
+ return this;
},
- events: {
- "click .new" : "newWine"
+ events:{
+ "click .new":"newWine"
},
- newWine: function(event) {
- app.navigate("wines/new", true);
- return false;
- }
+ newWine:function (event) {
+ app.navigate("wines/new", true);
+ return false;
+ }
});
Oops, something went wrong.

0 comments on commit a646e0b

Please sign in to comment.