Permalink
Browse files

display

  • Loading branch information...
1 parent 82b2a0d commit a112a322a691460dacde8563f7a2e0b55197c2a1 @tj tj committed Dec 18, 2011
Showing with 12 additions and 14 deletions.
  1. +12 −14 public/javascripts/app.js
View
@@ -6,22 +6,20 @@ o = $;
// boot
o(function(){
- render('screenshot', {
- title: 'Google',
- url: 'google.com'
- }).appendTo('body');
-
- render('screenshot', {
- title: 'Yahoo',
- url: 'yahoo.com'
- }).appendTo('body');
-
- render('screenshot', {
- title: 'Bing',
- url: 'bing.com'
- }).appendTo('body');
+ screenshots(0, 5, function(objs){
+ objs.forEach(function(obj){
+ render('screenshot', {
+ title: obj.url.replace(/^https?:\/\//, ''),
+ url: obj.url
+ }).appendTo('body');
+ })
+ });
})
+function screenshots(from, to, fn) {
+ o.get('/screenshots/' + from + '..' + to, fn);
+}
+
/**
* Render the given template `name` with `obj`.
*/

0 comments on commit a112a32

Please sign in to comment.