GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — changes · bpan2/fullstack-javascript@90418f4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • README.md
  • backbone
    • amd
      • apple-app.js
      • apple-home.tpl.js
      • apple-home.view.js
      • apple-item.tpl.js
      • apple-item.view.js
      • apple-spinner.tpl.js
      • apple.tpl.js
      • apple.view.js
      • apples.js
      • backbone.js
      • img
        • fuji.jpg
        • gala.jpg
        • spinner.gif
      • index-old.html
      • index.html
      • jquery.js
      • require.js
      • underscore.js
    • binding
      • backbone.js
      • img
        • fuji.jpg
        • gala.jpg
        • spinner.gif
      • index.html
      • jquery.js
      • underscore.js
    • collections
      • backbone.js
      • img
        • fuji.jpg
        • gala.jpg
      • index.html
      • jquery.js
      • underscore.js
    • hello-world
      • backbone.js
      • index-refactored.html
      • index.html
      • jquery.js
      • underscore.js
    • refactor
      • apple-app.js
      • apple-home.tpl.js
      • apple-home.view.js
      • apple-item.tpl.js
      • apple-item.view.js
      • apple-spinner.tpl.js
      • apple.tpl.js
      • apple.view.js
      • apples.js
      • backbone.js
      • img
        • fuji.jpg
        • gala.jpg
        • spinner.gif
      • index-old.html
      • index.html
      • jquery.js
      • underscore.js
    • r
      • app.build.js
      • apple-app.js
      • apple-home.tpl.js
      • apple-home.view.js
      • apple-item.tpl.js
      • apple-item.view.js
      • apple-spinner.tpl.js
      • apple.tpl.js
      • apple.view.js
      • apples.js
      • backbone.js
      • build
        • apple-app.js
        • backbone.js
        • img
          • fuji.jpg
          • gala.jpg
          • spinner.gif
        • index.html
        • jquery.js
        • require.js
        • underscore.js
      • img
        • fuji.jpg
        • gala.jpg
        • spinner.gif
      • index.html
      • jquery.js
      • js
        • app.build.js
        • apple-app.js
        • apple-home.tpl.js
        • apple-home.view.js
        • apple-item.tpl.js
        • apple-item.view.js
        • apple-spinner.tpl.js
        • apple.tpl.js
        • apple.view.js
        • apples.js
        • backbone.js
        • index-old.html
        • index.html
        • jquery.js
        • require.js
        • underscore.js
      • require.js
      • underscore.js
    • subview
      • backbone.js
      • img
        • fuji.jpg
        • gala.jpg
        • spinner.gif
      • index-old.html
      • index.html
      • jquery.js
      • underscore.js
  • board-react-meteor
    • .meteor
      • .finished-upgraders
      • .gitignore
      • .id
      • packages
      • platforms
      • release
      • versions
    • board-react-meteor.css
    • board-react-meteor.html
    • board-react-meteor.jsx
    • readme.md
  • board-react
    • README.md
    • css
      • bootstrap-responsive.css
      • bootstrap-responsive.min.css
      • bootstrap.css
      • bootstrap.min.css
    • index.html
    • js
      • app.jsx
      • app.js
      • bootstrap.min.js
      • jquery-1.11.3.min.js
      • react.js
      • react.min.js
  • board
    • .gitignore
    • .htaccess
    • app.js
    • css
      • bootstrap-responsive.css
      • bootstrap-responsive.min.css
      • bootstrap.css
      • bootstrap.min.css
    • footer.html
    • header.html
    • home.html
    • img
      • glyphicons-halflings-white.png
      • glyphicons-halflings.png
    • index.html
    • index.php
    • js
      • bootstrap.js
      • bootstrap.min.js
    • libs
      • require.min.js
      • text.js
  • bootstrap
    • css
      • bootstrap-responsive.css
      • bootstrap-responsive.min.css
      • bootstrap.css
      • bootstrap.min.css
    • img
      • glyphicons-halflings-white.png
      • glyphicons-halflings.png
    • index.html
  • db
    • Procfile
    • app.js
    • collections.js
    • db.js
    • package.json
  • hello
    • Procfile
    • package.json
    • server.js
  • jquery
    • index.html
  • mongo
    • .gitignore
    • Procfile
    • package.json
    • web.js
  • node
    • .gitignore
    • Procfile
    • package.json
    • web.js
  • parse
    • app.js
    • index.html
  • rest
    • .gitignore
    • css
      • bootstrap-responsive.css
      • bootstrap-responsive.min.css
      • bootstrap.css
      • bootstrap.min.css
      • style.css
    • index.html
    • index.php
    • js
      • app.js
    • readme.md
  • sdk
    • .gitignore
    • README.md
    • app.js
    • css
      • bootstrap-responsive.css
      • bootstrap-responsive.min.css
      • bootstrap.css
      • bootstrap.min.css
    • footer.html
    • header.html
    • home.html
    • img
      • glyphicons-halflings-white.png
      • glyphicons-halflings.png
    • index.html
    • js
      • bootstrap.js
      • bootstrap.min.js
    • libs
      • require.min.js
      • text.js
  • test
    • Procfile
    • mb-server.js
    • package.json
    • test.js

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎README.md‎

Copy file name to clipboard
+94-1Lines changed: 94 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1 +1,94 @@
1-
# fullstack-javascript
1+
# Rapid Prototyping with JS examples
2+
3+
Rapid Prototyping with JS is a JavaScript and Node.js book that will teach you how to build mobile and web apps fast. — Read more at
4+
<http://rapidprototypingwithjs.com>.
5+
6+
## Part II — Building Front-End Application
7+
8+
* [bootstrap](https://github.com/azat-co/rpjs/tree/master/bootstrap)
9+
10+
[Twitter Bootstrap] scaffolding example
11+
12+
13+
* [jQuery](https://github.com/azat-co/rpjs/tree/master/jquery)
14+
15+
[jQuery], Twitter API and JSONP example
16+
17+
* [parse](https://github.com/azat-co/rpjs/tree/master/parse)
18+
19+
Simple example of [Parse.com] JavaScript SDK
20+
21+
* [rest](https://github.com/azat-co/rpjs/tree/master/rest)
22+
23+
Chat front-end: [jQuery] and [Parse.com] REST API; ready for deployment.
24+
25+
* [backbone](https://github.com/azat-co/rpjs/tree/master/backbone)
26+
27+
Diving Deeper into Backbone.js
28+
29+
* [sdk](https://github.com/azat-co/rpjs/tree/master/sdk)
30+
31+
[BackboneJS] and [Parse.com] SDK Chat
32+
33+
## Part III — Building Back-End Application
34+
35+
* [hello](https://github.com/azat-co/rpjs/tree/master/hello)
36+
37+
[NodeJS] "Hello World" app, ready for deployment
38+
39+
* [test](https://github.com/azat-co/rpjs/tree/master/test)
40+
41+
Chat back-end: TDD with run-time storage
42+
43+
* [db](https://github.com/azat-co/rpjs/tree/master/db)
44+
45+
Simple app to test local database connection with MongoDB Native Driver
46+
47+
* [mongo](https://github.com/azat-co/rpjs/tree/master/mongo)
48+
49+
Chat back-end: [MongoDB] storage, ready for deployment
50+
51+
## Part IV — Putting it All Together
52+
53+
* [board](https://github.com/azat-co/rpjs/tree/master/board)
54+
55+
Chat front-end without back end
56+
57+
* [node](https://github.com/azat-co/rpjs/tree/master/node)
58+
59+
Chat back-end with CORS
60+
61+
### Part V — Beyond Core Modules
62+
63+
* [board-react](https://github.com/azat-co/rpjs/tree/master/board-react)
64+
65+
Chat with React.js view layer
66+
67+
[BackboneJS]: http://backbonejs.org
68+
[UnderscoreJS]: http://underscorejs.org
69+
[jQuery]: http://jquery.com
70+
[Parse.com]: http://parse.com
71+
[LESS]: http://lesscss.org
72+
[LESS app]: http://incident57.com/less/
73+
[Twitter Bootstrap]: http://twitter.github.com/bootstrap
74+
[Heroku]: http://heroku.com
75+
[Windows Azure]: http://windowsazure.com
76+
[Git]: http://git-scm.com
77+
[GitHub]: http://github.com
78+
[NodeJS]: http://nodejs.org "NodeJS"
79+
[MongoDB]: http://mongodb.org
80+
[Chrome]: http://www.google.com/chrome
81+
[Safari]: http://www.apple.com/safari/
82+
[Firefox]: http://www.mozilla.org/en-US/firefox/new/
83+
[Firebug]: http://getfirebug.com/
84+
[WebStorm]: http://www.jetbrains.com/webstorm/
85+
[Cygwin]: http://www.cygwin.com/
86+
[PuTTY]: http://www.chiark.greenend.org.uk/~sgtatham/putty/
87+
[NPM]: https://npmjs.org
88+
[MongoHQ]: https://addons.heroku.com/mongohq
89+
[Foreman]: https://github.com/ddollar/foreman
90+
[MAMP]: http://www.mamp.info/en/index.html
91+
[XAMPP]: http://www.apachefriends.org/en/xampp.html
92+
[CORS]: http://www.w3.org/TR/cors/
93+
[MongoHQ]: https://www.mongohq.com/home
94+
[MongoHQ add-on]: https://addons.heroku.com/mongohq
Collapse file

‎backbone/amd/apple-app.js‎

Copy file name to clipboard
+58Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
requirejs.config({
2+
urlArgs: "bust=" + (new Date()).getTime()
3+
});
4+
require([
5+
'apple-item.tpl', //shim, change to test files
6+
'apple-home.tpl',
7+
'apple-spinner.tpl',
8+
'apple.tpl',
9+
'apple-item.view',
10+
'apple-home.view',
11+
'apple.view',
12+
'apples'
13+
],function(
14+
appleItemTpl,
15+
appleHomeTpl,
16+
appleSpinnerTpl,
17+
appleTpl,
18+
appelItemView,
19+
homeView,
20+
appleView,
21+
Apples
22+
){
23+
var appleData = [
24+
{
25+
name: "fuji",
26+
url: "img/fuji.jpg"
27+
},
28+
{
29+
name: "gala",
30+
url: "img/gala.jpg"
31+
}
32+
];
33+
var app;
34+
var router = Backbone.Router.extend({ //check if need to be required
35+
routes: {
36+
'': 'home',
37+
'apples/:appleName': 'loadApple'
38+
},
39+
initialize: function(){
40+
var apples = new Apples();
41+
apples.reset(appleData);
42+
this.homeView = new homeView({collection: apples});
43+
this.appleView = new appleView({collection: apples});
44+
},
45+
home: function(){
46+
this.homeView.render();
47+
},
48+
loadApple: function(appleName){
49+
this.appleView.loadApple(appleName);
50+
51+
}
52+
});
53+
54+
$(document).ready(function(){
55+
app = new router;
56+
Backbone.history.start();
57+
})
58+
});
Collapse file

‎backbone/amd/apple-home.tpl.js‎

Copy file name to clipboard
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
define(function(){
2+
return 'Apple data: \
3+
<ul class="apples-list">\
4+
</ul>\
5+
<div class="cart-box"></div>';
6+
});
Collapse file

‎backbone/amd/apple-home.view.js‎

Copy file name to clipboard
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
define(['apple-home.tpl','apple-item.view'],function(appleHomeTpl,appleItemView){
2+
return Backbone.View.extend({
3+
el: 'body',
4+
listEl: '.apples-list',
5+
cartEl: '.cart-box',
6+
template: _.template(appleHomeTpl),
7+
initialize: function() {
8+
this.$el.html(this.template);
9+
this.collection.on('addToCart', this.showCart, this);
10+
},
11+
showCart: function(appleModel) {
12+
$(this.cartEl).append(appleModel.attributes.name+'<br/>');
13+
},
14+
render: function(){
15+
view = this; //so we can use view inside of closure
16+
this.collection.each(function(apple){
17+
var appleSubView = new appleItemView({model:apple}); // create subview with model apple
18+
appleSubView.render(); // compiles tempalte and single apple data
19+
$(view.listEl).append(appleSubView.$el); //append jQuery object from single apple to apples-list DOM element
20+
});
21+
}
22+
23+
24+
});
25+
})
Collapse file

‎backbone/amd/apple-item.tpl.js‎

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
define(function() {
2+
return '\
3+
<a href="#apples/<%=name%>" target="_blank">\
4+
<%=name%>\
5+
</a>&nbsp;<a class="add-to-cart" href="#">buy</a>\
6+
'
7+
});
8+
9+
Collapse file

‎backbone/amd/apple-item.view.js‎

Copy file name to clipboard
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
define(['apple-item.tpl'],function(appleItemTpl) {
2+
return Backbone.View.extend({
3+
tagName: 'li',
4+
// template: _.template(''
5+
// +'<a href="#apples/<%=name%>" target="_blank">'
6+
// +'<%=name%>'
7+
// +'</a>&nbsp;<a class="add-to-cart" href="#">buy</a>'),
8+
template: _.template(appleItemTpl),
9+
10+
events: {
11+
'click .add-to-cart': 'addToCart'
12+
},
13+
render: function() {
14+
this.$el.html(this.template(this.model.attributes));
15+
},
16+
addToCart: function(){
17+
this.model.collection.trigger('addToCart', this.model);
18+
}
19+
});
20+
});
Collapse file

‎backbone/amd/apple-spinner.tpl.js‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
define(function(){
2+
return '<img src="img/spinner.gif" width="30"/>';
3+
});
Collapse file

‎backbone/amd/apple.tpl.js‎

Copy file name to clipboard
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
define(function(){
2+
return '<figure>\
3+
<img src="<%= attributes.url%>"/>\
4+
<figcaption><%= attributes.name %></figcaption>\
5+
</figure>';
6+
});
Collapse file

‎backbone/amd/apple.view.js‎

Copy file name to clipboard
+32Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
define([
2+
'apple.tpl',
3+
'apple-spinner.tpl'
4+
],function(appleTpl,appleSpinnerTpl){
5+
return Backbone.View.extend({
6+
initialize: function(){
7+
this.model = new (Backbone.Model.extend({}));
8+
this.model.on('change', this.render, this);
9+
this.on('spinner',this.showSpinner, this);
10+
},
11+
template: _.template(appleTpl),
12+
templateSpinner: appleSpinnerTpl,
13+
14+
loadApple:function(appleName){
15+
this.trigger('spinner');
16+
var view = this; //we'll need to access that inside of a closure
17+
setTimeout(function(){ //simulates real time lag when fetching data from the remote server
18+
view.model.set(view.collection.where({name:appleName})[0].attributes);
19+
},1000);
20+
21+
},
22+
23+
render: function(appleName){
24+
var appleHtml = this.template(this.model);
25+
$('body').html(appleHtml);
26+
},
27+
showSpinner: function(){
28+
$('body').html(this.templateSpinner);
29+
}
30+
31+
});
32+
});
Collapse file

‎backbone/amd/apples.js‎

Copy file name to clipboard
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
define(function(){
2+
return Backbone.Collection.extend({})
3+
});
4+

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.