Skip to content

Commit b17e7f5

Browse files
committed
Update to latest Ember and jQuery
1 parent a9f0e6c commit b17e7f5

14 files changed

+22361
-16044
lines changed

TODO.txt

Lines changed: 0 additions & 42 deletions
This file was deleted.

css/jquery-ui.1.9pre.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

css/jquery-ui.1.9pre.min.css

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/app.html

Lines changed: 32 additions & 26 deletions
Large diffs are not rendered by default.

index.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,31 @@
1414
<link rel="shortcut icon" href="/favicon.ico">
1515
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
1616
<link rel="stylesheet" href="css/style.css?v=2">
17-
<link rel="stylesheet" href="css/jquery-ui.1.9pre.css">
17+
<link rel="stylesheet" href="css/jquery-ui.1.9pre.min.css">
1818

1919
<!--[if lt IE 9]>
2020
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
2121
<![endif]-->
2222
</head>
2323
<body>
2424
<script type="text/x-handlebars">
25-
{{view App.Button label="Click to Load People"}}
26-
<br><br>
27-
{{view App.ProgressBar valueBinding="App.controller.progress"}}
28-
<br><br>
29-
{{#collection JQ.Menu contentBinding="App.controller.people" disabledBinding="App.controller.menuDisabled"}}
30-
<a href="#">{{content.name}}
31-
{{else}}
32-
<a href="#">LIST NOT LOADED</a>
33-
{{/collection}}
25+
{{#with App.controller}}
26+
{{view App.Button label="Click to Load People"}}
27+
<br><br>
28+
{{view App.ProgressBar valueBinding="progress"}}
29+
<br><br>
30+
{{#collection JQ.Menu contentBinding="people" disabledBinding="menuDisabled"}}
31+
<a href="#">{{name}}</a>
32+
{{else}}
33+
<a href="#">LIST NOT LOADED</a>
34+
{{/collection}}
35+
{{/with}}
3436
</script>
3537

36-
<script src="js/libs/jquery-1.7.1.min.js"></script>
38+
<script src="js/libs/jquery-1.8.0.min.js"></script>
3739
<script src="js/libs/jquery-ui-1.9pre.js"></script>
38-
<script src="js/libs/ember-0.9.5.min.js"></script>
40+
<script src="js/libs/handlebars-1.0.0.beta.6.js"></script>
41+
<script src="js/libs/ember-1.0.pre.min.js"></script>
3942
<script src="js/app.js"></script>
4043
</body>
4144
</html>

js/app.js

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
var App = Em.Application.create();
1+
window.App = Em.Application.create();
2+
App.initialize();
23

34
// Put jQuery UI inside its own namespace
45
JQ = {};
@@ -129,7 +130,15 @@ JQ.Menu = Em.CollectionView.extend(JQ.Widget, {
129130
ui.refresh();
130131
});
131132
}
132-
}
133+
},
134+
itemViewClass: Em.View.extend({
135+
// Make it so that the default context for evaluating handlebars
136+
// bindings is the content of this child view. In a near-future
137+
// version of Ember, the leading underscore will be unnecessary.
138+
_context: function(){
139+
return this.get('content');
140+
}.property('content')
141+
})
133142
});
134143

135144
// Create a new Ember view for the jQuery UI Progress Bar widget
@@ -143,7 +152,8 @@ JQ.ProgressBar = Em.View.extend(JQ.Widget, {
143152
// views.
144153
App.controller = Em.Object.create({
145154
progress: 0,
146-
menuDisabled: true
155+
menuDisabled: true,
156+
people: []
147157
});
148158

149159
// Create a subclass of `JQ.Button` to define behavior for our button.
@@ -193,7 +203,7 @@ App.ProgressBar = JQ.ProgressBar.extend({
193203
name: "Yehuda Katz"
194204
}),
195205
Em.Object.create({
196-
name: "Majd Potatoes"
206+
name: "Selden Seen"
197207
})
198208
]);
199209

@@ -207,17 +217,15 @@ App.ProgressBar = JQ.ProgressBar.extend({
207217
/**
208218
Template:
209219
210-
{{view App.Button label="Click to Load People"}}
211-
<br><br>
212-
{{view App.ProgressBar valueBinding="App.controller.progress"}}
213-
<br><br>
214-
{{#collection JQ.Menu
215-
contentBinding="App.controller.people"
216-
disabledBinding="App.controller.menuDisabled"}}
217-
<a href="#">
218-
{{content.name}}
219-
</a>
220-
{{else}}
221-
<a href="#">LIST NOT LOADED</a>
222-
{{/collection}}
220+
{{#with App.controller}}
221+
{{view App.Button label="Click to Load People"}}
222+
<br><br>
223+
{{view App.ProgressBar valueBinding="progress"}}
224+
<br><br>
225+
{{#collection JQ.Menu contentBinding="people" disabledBinding="menuDisabled"}}
226+
<a href="#">{{name}}</a>
227+
{{else}}
228+
<a href="#">LIST NOT LOADED</a>
229+
{{/collection}}
230+
{{/with}}
223231
*/

0 commit comments

Comments
 (0)