├── .gitignore
├── README.md
├── app.js
├── package.json
├── public
├── 404.html
├── css
│ └── app.css
├── favicon.ico
├── js
│ ├── app.js
│ ├── controllers.js
│ ├── directives.js
│ ├── filters.js
│ ├── lib
│ │ └── angular
│ │ │ ├── angular-bootstrap-prettify.js
│ │ │ ├── angular-bootstrap-prettify.min.js
│ │ │ ├── angular-bootstrap.js
│ │ │ ├── angular-bootstrap.min.js
│ │ │ ├── angular-cookies.js
│ │ │ ├── angular-cookies.min.js
│ │ │ ├── angular-loader.js
│ │ │ ├── angular-loader.min.js
│ │ │ ├── angular-mocks.js
│ │ │ ├── angular-resource.js
│ │ │ ├── angular-resource.min.js
│ │ │ ├── angular-sanitize.js
│ │ │ ├── angular-sanitize.min.js
│ │ │ ├── angular-scenario.js
│ │ │ ├── angular.js
│ │ │ ├── angular.min.js
│ │ │ └── version.txt
│ └── services.js
├── robots.txt
├── scripts
│ ├── app.js
│ ├── controllers
│ │ ├── list.js
│ │ ├── queue.js
│ │ └── view.js
│ ├── directives
│ │ └── scroll.js
│ ├── filters
│ │ └── htmlify.js
│ ├── services
│ │ ├── localstore.js
│ │ ├── queue.js
│ │ ├── socket.js
│ │ └── youtube.js
│ └── vendor
│ │ ├── angular-sanitize.min.js
│ │ ├── angular.js
│ │ ├── angular.min.js
│ │ ├── es5-shim.min.js
│ │ └── json3.min.js
└── styles
│ ├── font-awesome.min.css
│ ├── font
│ ├── FontAwesome.otf
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.ttf
│ └── fontawesome-webfont.woff
│ ├── foundation.css
│ └── toogles.css
├── routes
├── api.js
├── index.js
└── socket.js
└── views
├── index.html
└── partials
├── about.html
├── browse.html
├── contact.html
├── list.html
├── playlists.html
├── queue.html
├── search.html
├── user.html
├── videos.html
└── view.html
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | views_bkp/
3 | config.js
4 | *.log
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Angularjs App on RaspberryPi
2 |
3 | This project combines [RaspberryPiTV](https://github.com/viperfx/RaspberryPiTV) and the AngularJS app [Toogles](https://github.com/mikecrittenden/toogles) to easily browse and stream youtube videos on the raspberrypi.
4 | Clicking on the "Send to RPi" button in the screenshot below processes the youtube id using youtube-dl and lauches the video using omxplayer on raspberrypi.
5 |
6 | 
7 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var express = require('express'),
7 | routes = require('./routes'),
8 | socket = require('./routes/socket.js'),
9 | config = require('./config.js'),
10 | app = module.exports = express(),
11 | server = require('http').createServer(app)
12 | , https = require('https')
13 | , path = require('path')
14 | , io = require('socket.io').listen(server)
15 | , spawn = require('child_process').spawn
16 | , omx = require('omxcontrol')
17 | , EventEmitter = require( "events" ).EventEmitter;
18 |
19 |
20 | // Configuration
21 |
22 | app.configure(function(){
23 | app.set('views', __dirname + '/views');
24 | app.set('view engine', 'html');
25 | app.engine('html', require('ejs').renderFile);
26 | app.use(express.bodyParser());
27 | app.use(express.methodOverride());
28 | app.use(express.static(__dirname + '/public'));
29 | app.use(app.router);
30 | });
31 |
32 | app.configure('development', function(){
33 | app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
34 | });
35 |
36 | app.configure('production', function(){
37 | app.use(express.errorHandler());
38 | });
39 |
40 | // Routes
41 | app.get('/', routes.index);
42 | app.get('/partials/:name', routes.partials);
43 |
44 | // redirect all others to the index (HTML5 history)
45 | app.get('*', routes.index);
46 |
47 | // Socket.io Communication
48 |
49 | //Run and pipe shell script output
50 | function run_shell(cmd, args, cb, end) {
51 | var spawn = require('child_process').spawn,
52 | child = spawn(cmd, args),
53 | me = this;
54 | child.stdout.on('readable', function () { cb(me, child.stdout); });
55 | child.stdout.on('end', end);
56 | }
57 | var ss;
58 | //Socket.io Server
59 | io.sockets.on('connection', function (socket) {
60 |
61 | socket.on("screen", function(data){
62 | socket.type = "screen";
63 | ss = socket;
64 | console.log("Screen ready...");
65 | });
66 | socket.on("remote", function(data){
67 | socket.type = "remote";
68 | console.log("Remote ready...");
69 | });
70 |
71 | socket.on("controll", function(data){
72 | console.log(data);
73 | if(socket.type === "remote"){
74 |
75 | if(data.action === "tap"){
76 | if(ss != undefined){
77 | ss.emit("controlling", {action:"enter"});
78 | }
79 | }
80 | else if(data.action === "swipeLeft"){
81 | if(ss != undefined){
82 | ss.emit("controlling", {action:"goLeft"});
83 | }
84 | }
85 | else if(data.action === "swipeRight"){
86 | if(ss != undefined){
87 | ss.emit("controlling", {action:"goRight"});
88 | }
89 | }
90 | }
91 | });
92 | socket.on("log", function(data){
93 | console.log(data);
94 | });
95 | socket.on("video", function(data){
96 |
97 | if( data.action === "play"){
98 | console.log(data.video_id);
99 | var id = data.video_id,
100 | url = "http://www.youtube.com/watch?v="+id;
101 | var runShell = new run_shell('youtube-dl',['-gf', '18/22/34/35/37', url],
102 | function (me, stdout) {
103 | me.stdout = stdout.read().toString().replace(/[\r\n]/g, "");
104 | socket.emit("video",{output: "loading"});
105 | omx.start(me.stdout);
106 | omx.ev.on('omx_status', function(data) {
107 | socket.emit("video",{status: data, video_id:id});
108 | });
109 | },
110 | function (me) {
111 | socket.emit("video",{status: "now_playing", video_id:id});
112 | });
113 | }
114 | if( data.action == "stream") {
115 | var id = data.video_id,
116 | url = "https://api.put.io/v2/files/"+id+"/mp4/stream/?oauth_token="+config.settings.PUTIO_KEY;
117 | var options = {
118 | host: 'api.put.io',
119 | port: 443,
120 | path: '/v2/files/'+id+'/stream?oauth_token='+config.settings.PUTIO_KEY,
121 | method: 'GET'
122 | };
123 |
124 | var req = https.request(options, function(res) {
125 | console.log('STATUS: ' + res.statusCode);
126 | console.log('HEADERS: ' + JSON.stringify(res.headers));
127 | omx.start(res.headers.location);
128 | });
129 | req.end();
130 | req.on('error', function(e) {
131 | console.log('problem with request: ' + e.message);
132 | });
133 | }
134 | if (data.action == "pause") {
135 | omx.sendKey('p');
136 | }
137 | if (data.action == 'quit') {
138 | omx.sendKey('q');
139 | }
140 | });
141 | });
142 |
143 | // Start server
144 |
145 | server.listen(3000, function(){
146 | console.log("Express server listening on port %d in %s mode", this.address().port, app.settings.env);
147 | });
148 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "application-name"
3 | , "version": "0.0.1"
4 | , "private": true
5 | , "scripts": {
6 | "start": "node app.js"
7 | },
8 | "dependencies": {
9 | "express": "3.0.0",
10 | "socket.io": ">= 0.9.6",
11 | "jade": "*",
12 | "socket.io":"0.9.14",
13 | "omxcontrol":"*"
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Not Found :(
6 |
141 |
142 |
143 |
144 |
Not found :(
145 |
Sorry, but the page you were trying to view does not exist.
146 |
It looks like this was the result of either:
147 |
148 | - a mistyped address
149 | - an out-of-date link
150 |
151 |
154 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/public/css/app.css:
--------------------------------------------------------------------------------
1 | /* app css stylesheet */
2 |
3 | .menu {
4 | list-style: none;
5 | border-bottom: 0.1em solid black;
6 | margin-bottom: 2em;
7 | padding: 0 0 0.5em;
8 | }
9 |
10 | .menu:before {
11 | content: "[";
12 | }
13 |
14 | .menu:after {
15 | content: "]";
16 | }
17 |
18 | .menu > li {
19 | display: inline;
20 | }
21 |
22 | .menu > li:before {
23 | content: "|";
24 | padding-right: 0.3em;
25 | }
26 |
27 | .menu > li:nth-child(1):before {
28 | content: "";
29 | padding: 0;
30 | }
31 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/viperfx/angular-rpitv/eece593d8ea14f1fa88396c9f971770dec519053/public/favicon.ico
--------------------------------------------------------------------------------
/public/js/app.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 |
4 | // Declare app level module which depends on filters, and services
5 | var app = angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives']).
6 | config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
7 | $routeProvider.when('/view1', {templateUrl: 'partials/partial1', controller: MyCtrl1});
8 | $routeProvider.when('/view2', {templateUrl: 'partials/partial2', controller: MyCtrl2});
9 | $routeProvider.otherwise({redirectTo: '/view1'});
10 | $locationProvider.html5Mode(true);
11 | }]);
--------------------------------------------------------------------------------
/public/js/controllers.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* Controllers */
4 |
5 | function AppCtrl($scope, socket) {
6 | socket.on('send:name', function (data) {
7 | $scope.name = data.name;
8 | });
9 | }
10 |
11 | function MyCtrl1($scope, socket) {
12 | socket.on('send:time', function (data) {
13 | $scope.time = data.time;
14 | });
15 | }
16 | MyCtrl1.$inject = ['$scope', 'socket'];
17 |
18 |
19 | function MyCtrl2() {
20 | }
21 | MyCtrl2.$inject = [];
22 |
--------------------------------------------------------------------------------
/public/js/directives.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* Directives */
4 |
5 |
6 | angular.module('myApp.directives', []).
7 | directive('appVersion', ['version', function(version) {
8 | return function(scope, elm, attrs) {
9 | elm.text(version);
10 | };
11 | }]);
12 |
--------------------------------------------------------------------------------
/public/js/filters.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* Filters */
4 |
5 | angular.module('myApp.filters', []).
6 | filter('interpolate', ['version', function(version) {
7 | return function(text) {
8 | return String(text).replace(/\%VERSION\%/mg, version);
9 | }
10 | }]);
11 |
--------------------------------------------------------------------------------
/public/js/lib/angular/angular-bootstrap-prettify.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | AngularJS v1.0.5
3 | (c) 2010-2012 Google, Inc. http://angularjs.org
4 | License: MIT
5 | */
6 | (function(q,k,I){'use strict';function G(c){return c.replace(/\&/g,"&").replace(/\/g,">").replace(/"/g,""")}function D(c,e){var b=k.element(""+e+"
");c.html("");c.append(b.contents());return c}var t={},w={value:{}},L={"angular.js":"http://code.angularjs.org/"+k.version.full+"/angular.min.js","angular-resource.js":"http://code.angularjs.org/"+k.version.full+"/angular-resource.min.js","angular-sanitize.js":"http://code.angularjs.org/"+k.version.full+"/angular-sanitize.min.js",
7 | "angular-cookies.js":"http://code.angularjs.org/"+k.version.full+"/angular-cookies.min.js"};t.jsFiddle=function(c,e,b){return{terminal:!0,link:function(x,a,r){function d(a,b){return''}var H={html:"",css:"",js:""};k.forEach(r.jsFiddle.split(" "),function(a,b){var d=a.split(".")[1];H[d]+=d=="html"?b==0?"\n"+c(a,2):"\n\n\n <\!-- CACHE FILE: "+a+' --\>\n
38 |
39 |
40 | */
41 | factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) {
42 | var cookies = {},
43 | lastCookies = {},
44 | lastBrowserCookies,
45 | runEval = false,
46 | copy = angular.copy,
47 | isUndefined = angular.isUndefined;
48 |
49 | //creates a poller fn that copies all cookies from the $browser to service & inits the service
50 | $browser.addPollFn(function() {
51 | var currentCookies = $browser.cookies();
52 | if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl
53 | lastBrowserCookies = currentCookies;
54 | copy(currentCookies, lastCookies);
55 | copy(currentCookies, cookies);
56 | if (runEval) $rootScope.$apply();
57 | }
58 | })();
59 |
60 | runEval = true;
61 |
62 | //at the end of each eval, push cookies
63 | //TODO: this should happen before the "delayed" watches fire, because if some cookies are not
64 | // strings or browser refuses to store some cookies, we update the model in the push fn.
65 | $rootScope.$watch(push);
66 |
67 | return cookies;
68 |
69 |
70 | /**
71 | * Pushes all the cookies from the service to the browser and verifies if all cookies were stored.
72 | */
73 | function push() {
74 | var name,
75 | value,
76 | browserCookies,
77 | updated;
78 |
79 | //delete any cookies deleted in $cookies
80 | for (name in lastCookies) {
81 | if (isUndefined(cookies[name])) {
82 | $browser.cookies(name, undefined);
83 | }
84 | }
85 |
86 | //update all cookies updated in $cookies
87 | for(name in cookies) {
88 | value = cookies[name];
89 | if (!angular.isString(value)) {
90 | if (angular.isDefined(lastCookies[name])) {
91 | cookies[name] = lastCookies[name];
92 | } else {
93 | delete cookies[name];
94 | }
95 | } else if (value !== lastCookies[name]) {
96 | $browser.cookies(name, value);
97 | updated = true;
98 | }
99 | }
100 |
101 | //verify what was actually stored
102 | if (updated){
103 | updated = false;
104 | browserCookies = $browser.cookies();
105 |
106 | for (name in cookies) {
107 | if (cookies[name] !== browserCookies[name]) {
108 | //delete or reset all cookies that the browser dropped from $cookies
109 | if (isUndefined(browserCookies[name])) {
110 | delete cookies[name];
111 | } else {
112 | cookies[name] = browserCookies[name];
113 | }
114 | updated = true;
115 | }
116 | }
117 | }
118 | }
119 | }]).
120 |
121 |
122 | /**
123 | * @ngdoc object
124 | * @name ngCookies.$cookieStore
125 | * @requires $cookies
126 | *
127 | * @description
128 | * Provides a key-value (string-object) storage, that is backed by session cookies.
129 | * Objects put or retrieved from this storage are automatically serialized or
130 | * deserialized by angular's toJson/fromJson.
131 | * @example
132 | */
133 | factory('$cookieStore', ['$cookies', function($cookies) {
134 |
135 | return {
136 | /**
137 | * @ngdoc method
138 | * @name ngCookies.$cookieStore#get
139 | * @methodOf ngCookies.$cookieStore
140 | *
141 | * @description
142 | * Returns the value of given cookie key
143 | *
144 | * @param {string} key Id to use for lookup.
145 | * @returns {Object} Deserialized cookie value.
146 | */
147 | get: function(key) {
148 | return angular.fromJson($cookies[key]);
149 | },
150 |
151 | /**
152 | * @ngdoc method
153 | * @name ngCookies.$cookieStore#put
154 | * @methodOf ngCookies.$cookieStore
155 | *
156 | * @description
157 | * Sets a value for given cookie key
158 | *
159 | * @param {string} key Id for the `value`.
160 | * @param {Object} value Value to be stored.
161 | */
162 | put: function(key, value) {
163 | $cookies[key] = angular.toJson(value);
164 | },
165 |
166 | /**
167 | * @ngdoc method
168 | * @name ngCookies.$cookieStore#remove
169 | * @methodOf ngCookies.$cookieStore
170 | *
171 | * @description
172 | * Remove given cookie
173 | *
174 | * @param {string} key Id of the key-value pair to delete.
175 | */
176 | remove: function(key) {
177 | delete $cookies[key];
178 | }
179 | };
180 |
181 | }]);
182 |
183 | })(window, window.angular);
184 |
--------------------------------------------------------------------------------
/public/js/lib/angular/angular-cookies.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | AngularJS v1.0.5
3 | (c) 2010-2012 Google, Inc. http://angularjs.org
4 | License: MIT
5 | */
6 | (function(m,f,l){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(d,c){var b={},g={},h,i=!1,j=f.copy,k=f.isUndefined;c.addPollFn(function(){var a=c.cookies();h!=a&&(h=a,j(a,g),j(a,b),i&&d.$apply())})();i=!0;d.$watch(function(){var a,e,d;for(a in g)k(b[a])&&c.cookies(a,l);for(a in b)e=b[a],f.isString(e)?e!==g[a]&&(c.cookies(a,e),d=!0):f.isDefined(g[a])?b[a]=g[a]:delete b[a];if(d)for(a in e=c.cookies(),b)b[a]!==e[a]&&(k(e[a])?delete b[a]:b[a]=e[a])});return b}]).factory("$cookieStore",
7 | ["$cookies",function(d){return{get:function(c){return f.fromJson(d[c])},put:function(c,b){d[c]=f.toJson(b)},remove:function(c){delete d[c]}}}])})(window,window.angular);
8 |
--------------------------------------------------------------------------------
/public/js/lib/angular/angular-loader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license AngularJS v1.0.5
3 | * (c) 2010-2012 Google, Inc. http://angularjs.org
4 | * License: MIT
5 | */
6 |
7 | (
8 |
9 | /**
10 | * @ngdoc interface
11 | * @name angular.Module
12 | * @description
13 | *
14 | * Interface for configuring angular {@link angular.module modules}.
15 | */
16 |
17 | function setupModuleLoader(window) {
18 |
19 | function ensure(obj, name, factory) {
20 | return obj[name] || (obj[name] = factory());
21 | }
22 |
23 | return ensure(ensure(window, 'angular', Object), 'module', function() {
24 | /** @type {Object.
} */
25 | var modules = {};
26 |
27 | /**
28 | * @ngdoc function
29 | * @name angular.module
30 | * @description
31 | *
32 | * The `angular.module` is a global place for creating and registering Angular modules. All
33 | * modules (angular core or 3rd party) that should be available to an application must be
34 | * registered using this mechanism.
35 | *
36 | *
37 | * # Module
38 | *
39 | * A module is a collocation of services, directives, filters, and configuration information. Module
40 | * is used to configure the {@link AUTO.$injector $injector}.
41 | *
42 | *
43 | * // Create a new module
44 | * var myModule = angular.module('myModule', []);
45 | *
46 | * // register a new service
47 | * myModule.value('appName', 'MyCoolApp');
48 | *
49 | * // configure existing services inside initialization blocks.
50 | * myModule.config(function($locationProvider) {
51 | 'use strict';
52 | * // Configure existing providers
53 | * $locationProvider.hashPrefix('!');
54 | * });
55 | *
56 | *
57 | * Then you can create an injector and load your modules like this:
58 | *
59 | *
60 | * var injector = angular.injector(['ng', 'MyModule'])
61 | *
62 | *
63 | * However it's more likely that you'll just use
64 | * {@link ng.directive:ngApp ngApp} or
65 | * {@link angular.bootstrap} to simplify this process for you.
66 | *
67 | * @param {!string} name The name of the module to create or retrieve.
68 | * @param {Array.=} requires If specified then new module is being created. If unspecified then the
69 | * the module is being retrieved for further configuration.
70 | * @param {Function} configFn Optional configuration function for the module. Same as
71 | * {@link angular.Module#config Module#config()}.
72 | * @returns {module} new module with the {@link angular.Module} api.
73 | */
74 | return function module(name, requires, configFn) {
75 | if (requires && modules.hasOwnProperty(name)) {
76 | modules[name] = null;
77 | }
78 | return ensure(modules, name, function() {
79 | if (!requires) {
80 | throw Error('No module: ' + name);
81 | }
82 |
83 | /** @type {!Array.>} */
84 | var invokeQueue = [];
85 |
86 | /** @type {!Array.} */
87 | var runBlocks = [];
88 |
89 | var config = invokeLater('$injector', 'invoke');
90 |
91 | /** @type {angular.Module} */
92 | var moduleInstance = {
93 | // Private state
94 | _invokeQueue: invokeQueue,
95 | _runBlocks: runBlocks,
96 |
97 | /**
98 | * @ngdoc property
99 | * @name angular.Module#requires
100 | * @propertyOf angular.Module
101 | * @returns {Array.} List of module names which must be loaded before this module.
102 | * @description
103 | * Holds the list of modules which the injector will load before the current module is loaded.
104 | */
105 | requires: requires,
106 |
107 | /**
108 | * @ngdoc property
109 | * @name angular.Module#name
110 | * @propertyOf angular.Module
111 | * @returns {string} Name of the module.
112 | * @description
113 | */
114 | name: name,
115 |
116 |
117 | /**
118 | * @ngdoc method
119 | * @name angular.Module#provider
120 | * @methodOf angular.Module
121 | * @param {string} name service name
122 | * @param {Function} providerType Construction function for creating new instance of the service.
123 | * @description
124 | * See {@link AUTO.$provide#provider $provide.provider()}.
125 | */
126 | provider: invokeLater('$provide', 'provider'),
127 |
128 | /**
129 | * @ngdoc method
130 | * @name angular.Module#factory
131 | * @methodOf angular.Module
132 | * @param {string} name service name
133 | * @param {Function} providerFunction Function for creating new instance of the service.
134 | * @description
135 | * See {@link AUTO.$provide#factory $provide.factory()}.
136 | */
137 | factory: invokeLater('$provide', 'factory'),
138 |
139 | /**
140 | * @ngdoc method
141 | * @name angular.Module#service
142 | * @methodOf angular.Module
143 | * @param {string} name service name
144 | * @param {Function} constructor A constructor function that will be instantiated.
145 | * @description
146 | * See {@link AUTO.$provide#service $provide.service()}.
147 | */
148 | service: invokeLater('$provide', 'service'),
149 |
150 | /**
151 | * @ngdoc method
152 | * @name angular.Module#value
153 | * @methodOf angular.Module
154 | * @param {string} name service name
155 | * @param {*} object Service instance object.
156 | * @description
157 | * See {@link AUTO.$provide#value $provide.value()}.
158 | */
159 | value: invokeLater('$provide', 'value'),
160 |
161 | /**
162 | * @ngdoc method
163 | * @name angular.Module#constant
164 | * @methodOf angular.Module
165 | * @param {string} name constant name
166 | * @param {*} object Constant value.
167 | * @description
168 | * Because the constant are fixed, they get applied before other provide methods.
169 | * See {@link AUTO.$provide#constant $provide.constant()}.
170 | */
171 | constant: invokeLater('$provide', 'constant', 'unshift'),
172 |
173 | /**
174 | * @ngdoc method
175 | * @name angular.Module#filter
176 | * @methodOf angular.Module
177 | * @param {string} name Filter name.
178 | * @param {Function} filterFactory Factory function for creating new instance of filter.
179 | * @description
180 | * See {@link ng.$filterProvider#register $filterProvider.register()}.
181 | */
182 | filter: invokeLater('$filterProvider', 'register'),
183 |
184 | /**
185 | * @ngdoc method
186 | * @name angular.Module#controller
187 | * @methodOf angular.Module
188 | * @param {string} name Controller name.
189 | * @param {Function} constructor Controller constructor function.
190 | * @description
191 | * See {@link ng.$controllerProvider#register $controllerProvider.register()}.
192 | */
193 | controller: invokeLater('$controllerProvider', 'register'),
194 |
195 | /**
196 | * @ngdoc method
197 | * @name angular.Module#directive
198 | * @methodOf angular.Module
199 | * @param {string} name directive name
200 | * @param {Function} directiveFactory Factory function for creating new instance of
201 | * directives.
202 | * @description
203 | * See {@link ng.$compileProvider#directive $compileProvider.directive()}.
204 | */
205 | directive: invokeLater('$compileProvider', 'directive'),
206 |
207 | /**
208 | * @ngdoc method
209 | * @name angular.Module#config
210 | * @methodOf angular.Module
211 | * @param {Function} configFn Execute this function on module load. Useful for service
212 | * configuration.
213 | * @description
214 | * Use this method to register work which needs to be performed on module loading.
215 | */
216 | config: config,
217 |
218 | /**
219 | * @ngdoc method
220 | * @name angular.Module#run
221 | * @methodOf angular.Module
222 | * @param {Function} initializationFn Execute this function after injector creation.
223 | * Useful for application initialization.
224 | * @description
225 | * Use this method to register work which should be performed when the injector is done
226 | * loading all modules.
227 | */
228 | run: function(block) {
229 | runBlocks.push(block);
230 | return this;
231 | }
232 | };
233 |
234 | if (configFn) {
235 | config(configFn);
236 | }
237 |
238 | return moduleInstance;
239 |
240 | /**
241 | * @param {string} provider
242 | * @param {string} method
243 | * @param {String=} insertMethod
244 | * @returns {angular.Module}
245 | */
246 | function invokeLater(provider, method, insertMethod) {
247 | return function() {
248 | invokeQueue[insertMethod || 'push']([provider, method, arguments]);
249 | return moduleInstance;
250 | }
251 | }
252 | });
253 | };
254 | });
255 |
256 | }
257 | )(window);
258 |
259 | /**
260 | * Closure compiler type information
261 | *
262 | * @typedef { {
263 | * requires: !Array.,
264 | * invokeQueue: !Array.>,
265 | *
266 | * service: function(string, Function):angular.Module,
267 | * factory: function(string, Function):angular.Module,
268 | * value: function(string, *):angular.Module,
269 | *
270 | * filter: function(string, Function):angular.Module,
271 | *
272 | * init: function(Function):angular.Module
273 | * } }
274 | */
275 | angular.Module;
276 |
277 |
--------------------------------------------------------------------------------
/public/js/lib/angular/angular-loader.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | AngularJS v1.0.5
3 | (c) 2010-2012 Google, Inc. http://angularjs.org
4 | License: MIT
5 | */
6 | (function(i){'use strict';function d(c,b,e){return c[b]||(c[b]=e())}return d(d(i,"angular",Object),"module",function(){var c={};return function(b,e,f){e&&c.hasOwnProperty(b)&&(c[b]=null);return d(c,b,function(){function a(a,b,d){return function(){c[d||"push"]([a,b,arguments]);return g}}if(!e)throw Error("No module: "+b);var c=[],d=[],h=a("$injector","invoke"),g={_invokeQueue:c,_runBlocks:d,requires:e,name:b,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),
7 | value:a("$provide","value"),constant:a("$provide","constant","unshift"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:h,run:function(a){d.push(a);return this}};f&&h(f);return g})}})})(window);
8 |
--------------------------------------------------------------------------------
/public/js/lib/angular/angular-resource.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license AngularJS v1.0.5
3 | * (c) 2010-2012 Google, Inc. http://angularjs.org
4 | * License: MIT
5 | */
6 | (function(window, angular, undefined) {
7 | 'use strict';
8 |
9 | /**
10 | * @ngdoc overview
11 | * @name ngResource
12 | * @description
13 | */
14 |
15 | /**
16 | * @ngdoc object
17 | * @name ngResource.$resource
18 | * @requires $http
19 | *
20 | * @description
21 | * A factory which creates a resource object that lets you interact with
22 | * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.
23 | *
24 | * The returned resource object has action methods which provide high-level behaviors without
25 | * the need to interact with the low level {@link ng.$http $http} service.
26 | *
27 | * @param {string} url A parameterized URL template with parameters prefixed by `:` as in
28 | * `/user/:username`. If you are using a URL with a port number (e.g.
29 | * `http://example.com:8080/api`), you'll need to escape the colon character before the port
30 | * number, like this: `$resource('http://example.com\\:8080/api')`.
31 | *
32 | * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
33 | * `actions` methods.
34 | *
35 | * Each key value in the parameter object is first bound to url template if present and then any
36 | * excess keys are appended to the url search query after the `?`.
37 | *
38 | * Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in
39 | * URL `/path/greet?salutation=Hello`.
40 | *
41 | * If the parameter value is prefixed with `@` then the value of that parameter is extracted from
42 | * the data object (useful for non-GET operations).
43 | *
44 | * @param {Object.