Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
junior-example
===================

Working on an actual example of [https://github.com/justspamjustin/junior](Junior).

So far the example instructions don't seem to work, just beginning to debug now.
Working on an actual example of [https://github.com/justspamjustin/junior](Junior).
28 changes: 14 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<title>Junior PhoneGap Example</title>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />

<script src="lib/javascripts/modernizr.custom.15848.js"></script>
<script src="lib/javascripts/zepto.min.js"></script>
<script src="lib/javascripts/zepto.flickable.min.js"></script>
<script src="lib/javascripts/lodash.min.js"></script>
<script src="lib/javascripts/backbone-min.js"></script>
<script src="src/javascripts/junior.js"></script>
<script src="main.js"></script>

<link rel="stylesheet" href="lib/stylesheets/ratchet.css"/>
<link rel="stylesheet" href="src/stylesheets/junior.css"/>
<link rel="stylesheet" href="stylesheets/vendor/ratchet.css"/>
<link rel="stylesheet" href="stylesheets/vendor/junior.css"/>
</head>
<body>
<div id="app-container">
<div id="app-main">
<div>
<div>
<div id="app-container">
<div id="app-main">
</div>
</div>

<script src="javascripts/vendor/modernizr.custom.15848.js"></script>
<script src="javascripts/vendor/zepto.min.js"></script>
<script src="javascripts/vendor/zepto.flickable.min.js"></script>
<script src="javascripts/vendor/lodash.min.js"></script>
<script src="javascripts/vendor/backbone-min.js"></script>
<script src="javascripts/vendor/junior.js"></script>
<script src="javascripts/app.js"></script>
</body>
</html>
88 changes: 88 additions & 0 deletions javascripts/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Use ratchet as a reference for your template markup

var HomeTemplate = [
'<div class="content">',
' <h1>Hello World!</h1>',
' <div class="button-block click-me">Click Me!</div>',
'</div>'
].join('\n');

var HomeView = Jr.View.extend({
render: function() {
this.$el.html(HomeTemplate);
return this;
},

events: {
'click .click-me': 'onClickClickMeButton'
},

onClickClickMeButton: function() {
this.goToNextPage();
},

goToNextPage: function() {
Jr.Navigator.navigate('cool',{
trigger: true,
animation: {
type: Jr.Navigator.animations.SLIDE_STACK,
direction: Jr.Navigator.directions.LEFT
}
})
}
});

var CoolTemplate = [
'<header class="bar-title">',
' <div class="header-animated">',
' <div class="button-prev">Back</div>',
' <h1 class="title">Cool Page</h1>',
'</header>',
'<div class="content">',
' <summary>This page is just really cool!</summary>',
'</div> '
].join('\n');

var CoolView = Jr.View.extend({
render: function() {
this.$el.html(CoolTemplate);
return this;
},

events: {
'click .button-prev': 'onClickButtonPrev'
},

onClickButtonPrev: function() {
this.goToHomePage();
},

goToHomePage: function() {
Jr.Navigator.navigate('',{
trigger: true,
animation: {
type: Jr.Navigator.animations.SLIDE_STACK,
direction: Jr.Navigator.directions.RIGHT
}
})
}

});

var AppRouter = Jr.Router.extend({
routes: {
'': 'home',
'cool': 'cool'
},

home: function() {
this.renderView(new HomeView());
},

cool: function() {
this.renderView(new CoolView());
}
});

var appRouter = new AppRouter();
Backbone.history.start();
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
209 changes: 0 additions & 209 deletions main.js

This file was deleted.

File renamed without changes.
File renamed without changes.