-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
134 lines (124 loc) · 3.96 KB
/
app.js
File metadata and controls
134 lines (124 loc) · 3.96 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
$(function() {
App = Ember.Application.create({});
App.Router.map(function(){
this.route('home', {path: '/'});
this.route('web-dev');
this.route('music');
this.route('menu');
this.route('blog', function() {
this.route('post', {path: '/:post_id'});
});
this.route('contact');
});
App.PostAdapter = DS.FirebaseAdapter.extend({
firebase: new Firebase('https://master-chu.firebaseio.com/blog')
});
App.Post = DS.Model.extend({
title: DS.attr('string'),
body: DS.attr('string')
});
App.BlogRoute = Ember.Route.extend({
model: function(params) {
return this.store.findAll('post');
}
});
App.BlogPostRoute = Ember.Route.extend({
model: function(params) {
return this.store.findRecord('post', params["post_id"]);
}
});
App.SiteNavbarLinkComponent = Ember.Component.extend({
colorClass: 'white',
tagName: 'div',
classNames: ['navbar-link col-sm-2'],
attributeBindings: ['id'],
safeName: Ember.computed('name', function() {
return this.get('name').replace(" ", "-");
}),
id: Ember.computed('safeName', function() {
return `navbar-link-${this.get('safeName')}`;
}),
displayName: Ember.computed('name', function() {
return this.get('name').toUpperCase();
})
});
App.SiteNavbarLinkComponent.reopenClass({
positionalParams: ['name', 'colorClass']
});
App.PageHeaderComponent = Ember.Component.extend({
colorClass: 'white'
});
App.PageHeaderComponent.reopenClass({
positionalParams: ['pageName', 'colorClass']
});
var ANGULAR = 'Angular';
var JQUERY = 'jQuery';
var MONGO = 'MongoDB';
var PHP = 'PHP';
var MYSQL = 'MySQL';
var NODE = 'Node';
var EMBER = 'Ember';
var BACKBONE = 'Backbone';
var PYTHON = 'Python';
var FIREBASE = 'Firebase';
App.PageGalleryComponent = Ember.Component.extend({
tagName: 'div',
// classNames: ['container'],
galleryItems: [{
title: 'Jake and Amir Scripts',
description: 'The official searchable script archive of popular web series Jake and Amir',
url: 'http://scripts.jakeandamir.com',
imageUrl: 'images/janda.jpg',
stack: [JQUERY, PHP, MYSQL, PYTHON]
}, {
title: 'Nutraction',
description: 'A school project for tracking nutritional information',
url: 'http://lumpymunch-tunataco.rhcloud.com',
imageUrl: 'images/lumpymunch.jpg',
stack: [ANGULAR, MONGO, NODE]
}, {
title: 'Fake Terminal',
description: 'A fake terminal in the style of the computer on LOST',
url: 'http://www.ccs.neu.edu/home/812chuc/chartreuse-emu/',
imageUrl: 'images/terminal.jpg',
stack: [JQUERY]
}, {
title: 'Stdashboard',
description: 'A dashboard for displaying open pull requests in Stash',
url: 'https://github.com/master-chu/ember-stash',
imageUrl: 'images/stdashboard.jpg',
stack: [EMBER, NODE]
}, {
title: 'Sticky Notes',
description: 'A sticky note app leveraging local storage',
url: 'https://github.com/master-chu/backbone-sticky-notes',
imageUrl: 'images/stickynotes.jpg',
stack: [BACKBONE, JQUERY]
}, {
title: 'This site',
description: 'You\'re looking at it',
url: 'http://master-chu.github.io',
imageUrl: 'images/masterchu.jpg',
stack: [EMBER, FIREBASE]
}]
});
App.PageGalleryComponent.reopenClass({
positionalParams: ['title']
});
App.PageGalleryItemComponent = Ember.Component.extend({
tagName: 'a',
classNames: ['gallery-item'],
href: Ember.computed.alias('url'),
attributeBindings: ['href'],
formattedStack: Ember.computed('stack', function() {
var stack = this.get('stack');
var length = stack.length;
return stack.reduce(function(previousValue, item, index, enumerable) {
return previousValue + ", " + item;
});
})
});
App.PageGalleryItemComponent.reopenClass({
positionalParams: ['title', 'description', 'url', 'imageUrl', 'stack']
});
});