GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — angular.js/example/buzz/buzz.js at master · slobo/angular.js Expand file tree/ Copy pathbuzz.jsMore file actions 46 lines (43 loc) · 1.33 KB / Copy pathbuzz.jsFile metadata and controls46 lines (43 loc) · 1.33 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 angular.module.ng('myApplication', function($resource){ this.Activity = $resource( 'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments', {alt:'json', callback:'JSON_CALLBACK'}, { get: {method:'JSON', params:{visibility:'@self'}}, replies: {method:'JSON', params:{visibility:'@self', comments:'@comments'}} }); }, {inject:['$resource']}); function BuzzController() { this.$watch('$location.hashPath', this.userChange); } BuzzController.prototype = { userChange: function() { this.userId = this.$location.hashPath; this.activities = this.Activity.get({userId:this.userId}); }, expandReplies: function(activity) { var self = this; if (activity.replies) { activity.replies.show = !activity.replies.show; } else { activity.replies = this.Activity.replies({userId:this.userId, activityId:activity.id}, function() { activity.replies.show = true; }); } } }; angular.widget('my:expand', function(element){ element.css('display', 'block'); this.descend(true); return function(element) { element.hide(); var watch = element.attr('expand'); this.$watch(watch, function(value){ if (value) { element.delay(0).slideDown('slow'); } else { element.slideUp('slow'); } }); }; }); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |