-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdinodex.js
108 lines (105 loc) · 2.81 KB
/
dinodex.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Router.map(function(){
this.route('keypad', {
path: '/'
});
this.route('Triceratops');
this.route('Stegosaurus');
this.route('Apatosaurus');
this.route('Archaeopteryx');
this.route('Gojirasaurus');
this.route('TRex');
this.route('Yoshi');
this.route('Thesaurus');
this.route('Philosoraptor');
this.route('Barney');
});
if (Meteor.isClient) {
// counter starts at 0
Session.setDefault('counter', 0);
Template.keypad.helpers({
counter: function () {
return Session.get('counter');
}
});
Template.keypad.events({
'click button': function (e) {
// increment the counter when button is clicked
var id = e.currentTarget.id;
if (id == "1") Router.go('Triceratops');
else if (id == "2") Router.go('Stegosaurus');
else if (id == "3") Router.go('Apatosaurus');
else if (id == "4") Router.go('Archaeopteryx');
else if (id == "5") Router.go('Gojirasaurus');
else if (id == "6") Router.go('TRex');
else if (id == "7") Router.go('Yoshi');
else if (id == "8") Router.go('Thesaurus');
else if (id == "9") Router.go('Philosoraptor');
else if (id == "0") Router.go('Barney');
}
});
Template.Triceratops.events({
'click button': function (e) {
// increment the counter when button is clicked
Router.go('keypad');
}
});
Template.Stegosaurus.events({
'click button': function (e) {
// increment the counter when button is clicked
Router.go('keypad');
}
});
Template.Apatosaurus.events({
'click button': function (e) {
// increment the counter when button is clicked
Router.go('keypad');
}
});
Template.Archaeopteryx.events({
'click button': function (e) {
// increment the counter when button is clicked
Router.go('keypad');
}
});
Template.Gojirasaurus.events({
'click button': function (e) {
// increment the counter when button is clicked
Router.go('keypad');
}
});
Template.TRex.events({
'click button': function (e) {
// increment the counter when button is clicked
Router.go('keypad');
}
});
Template.Yoshi.events({
'click button': function (e) {
// increment the counter when button is clicked
Router.go('keypad');
}
});
Template.Thesaurus.events({
'click button': function (e) {
// increment the counter when button is clicked
Router.go('keypad');
}
});
Template.Philosoraptor.events({
'click button': function (e) {
// increment the counter when button is clicked
Router.go('keypad');
}
});
Template.Barney.events({
'click button': function (e) {
// increment the counter when button is clicked
Router.go('keypad');
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}