├── .gitignore
├── README.md
├── app
├── css
│ ├── .gitkeep
│ └── app.css
├── img
│ └── .gitkeep
├── index-async.html
├── index.html
├── js
│ ├── app.js
│ ├── controllers.js
│ ├── directives.js
│ ├── filters.js
│ └── services.js
├── lib
│ ├── angular
│ │ ├── angular-cookies.js
│ │ ├── angular-cookies.min.js
│ │ ├── angular-loader.js
│ │ ├── angular-loader.min.js
│ │ ├── angular-resource.js
│ │ ├── angular-resource.min.js
│ │ ├── angular-sanitize.js
│ │ ├── angular-sanitize.min.js
│ │ ├── angular.js
│ │ ├── angular.min.js
│ │ └── version.txt
│ ├── bootstrap
│ │ ├── css
│ │ │ ├── bootstrap-theme.css
│ │ │ ├── bootstrap-theme.min.css
│ │ │ ├── bootstrap.css
│ │ │ └── bootstrap.min.css
│ │ ├── fonts
│ │ │ ├── glyphicons-halflings-regular.eot
│ │ │ ├── glyphicons-halflings-regular.svg
│ │ │ ├── glyphicons-halflings-regular.ttf
│ │ │ └── glyphicons-halflings-regular.woff
│ │ └── js
│ │ │ ├── bootstrap.js
│ │ │ └── bootstrap.min.js
│ └── vendor
│ │ ├── jquery-1.10.2.min.js
│ │ └── jquery-1.10.2.min.map
└── partials
│ ├── .gitkeep
│ ├── partial1.html
│ ├── partial2.html
│ └── stars.html
├── config
├── karma-e2e.conf.js
└── karma.conf.js
├── feature.md
├── ground
├── Gemfile
├── Gemfile.lock
├── Rakefile
├── activities
│ ├── accu_q_star_assoc.rb
│ ├── build_inverted_star_index.rb
│ ├── insert_star_from_github.rb
│ ├── query_stars_by_word.rb
│ └── search_stars.rb
├── config.ru
├── config
│ ├── database.yml
│ ├── github.example.yml
│ ├── routes.rb
│ ├── schedule.rb
│ └── sets.rb
├── db
│ └── migrations
│ │ ├── 001_create_stars.rb
│ │ ├── 002_create_words.rb
│ │ ├── 003_create_word_stars.rb
│ │ ├── 004_create_q_star_assos.rb
│ │ ├── 005_create_reindex_stars.rb
│ │ └── 006_add_index.rb
├── gstar.rb
├── lib
│ ├── github_api.rb
│ └── github_api
│ │ └── list_starred_repos.rb
├── logs
│ └── keep.txt
├── states
│ ├── home.rb
│ ├── star
│ │ └── save_description.rb
│ └── stars
│ │ └── index.rb
└── tmp
│ └── .gitkeep
├── images
├── Snip20131003_1.png
├── Snip20131003_2.png
├── Snip20131004_3.png
└── Snip20131004_5.png
├── package.json
├── scripts
├── e2e-test.bat
├── e2e-test.sh
├── test.bat
├── test.sh
├── watchr.rb
└── web-server.js
└── test
├── e2e
├── runner.html
└── scenarios.js
├── lib
└── angular
│ ├── angular-mocks.js
│ ├── angular-scenario.js
│ └── version.txt
└── unit
├── controllersSpec.js
├── directivesSpec.js
├── filtersSpec.js
└── servicesSpec.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled source #
2 | ###################
3 | *.com
4 | *.class
5 | *.dll
6 | *.exe
7 | *.o
8 | *.so
9 |
10 | # Packages #
11 | ############
12 | # it's better to unpack these files and commit the raw source
13 | # git has its own built in compression methods
14 | *.7z
15 | *.dmg
16 | *.gz
17 | *.iso
18 | *.jar
19 | *.rar
20 | *.tar
21 | *.zip
22 |
23 | # Logs and databases #
24 | ######################
25 | *.log
26 | *.sql
27 | *.sqlite
28 | *.sqlite3
29 | *.db
30 |
31 | # OS generated files #
32 | ######################
33 | .DS_Store
34 | .DS_Store?
35 | ._*
36 | .Spotlight-V100
37 | .Trashes
38 | ehthumbs.db
39 | Thumbs.db
40 |
41 | github.yml
42 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Gstar
2 | gstar, 帮助我们搜索在github上star过的项目
3 |
4 | ## 安装
5 |
6 | 1. git clone https://github.com/baya/Gstar.git
7 |
8 | 2. cd Gstar/ground
9 |
10 | 3. bundle install
11 |
12 | 4. rake db:migrate
13 |
14 | 5. cp config/github.example.yml config/github.yml
15 |
16 | 在config/github.yml里有三个配置,其中login为必填项,access_token和password选一个填写即可,login和password是你用来登录github的用户名和密码,access_token可以通过下面的步骤得到,
17 | - 点击Account Settings,进入帐号设置页面
18 | - 选择左侧栏的Applications导航,可以看到Personal Access Tokens这个设置,点击右上角的Create new token生成新的access_token即可。
19 | 
20 | 配置完以后,运行下面的rake任务,
21 |
22 | 6. rake maintain:pull_stars_from_github #将你star过的项目从github拉到本地数据库
23 |
24 | 7. whenever --update # 启动定时任务,每分钟检查一次你是否有新的star项目
25 |
26 | 8. rackup -p 9292
27 |
28 | 9. 使用你喜爱的浏览器访问 http://localhost:9292
29 |
30 | 注意操作3到8都是在Gstar/ground目录下进行的。
31 |
32 | ## 功能特点
33 |
34 | ### 1.准确快速的搜索
35 |
36 | github自带的搜星功能不是特别好用,比如说我想找出我收藏的(github的标星功能对我来说就是收藏)与markdown有关的项目,使用github自带的搜星功能只能找到一个叫miclle/Markdown-Editor的项目,因为github是通过项目的名字进行搜索,这导致很多与markdwon有关的项目被忽略了,但是使用Gstar搜索markdwon能找到11个与markdown有关的项目,因为Gstar对项目名和项目描述都进行搜索,这样比github更准确些。
37 |
38 | github的搜星:
39 |
40 | 
41 |
42 | gstar的搜星:
43 | 
44 |
45 | ### 2.可以修改项目的描述(description),实现类似于打标签的功能
46 |
47 | 比如说我给karmi/tire这个项目的描述加上"搜索",那么我就可以通过搜索"搜索"找到tire这个项目了。
48 |
49 | 
50 |
51 | ### 3.自动更新starred projects
52 | Gstar自带一个定时任务,每一分钟会去github那检查是否有新的stars,如果有就会拉到本地,建立索引,方便你以后搜索使用。
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/app/css/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/baya/Gstar/b8d07c7ffc7dd86a2a43f041c8994999ae4c3439/app/css/.gitkeep
--------------------------------------------------------------------------------
/app/css/app.css:
--------------------------------------------------------------------------------
1 | /* http://meyerweb.com/eric/tools/css/reset/
2 | v2.0 | 20110126
3 | License: none (public domain)
4 | */
5 |
6 | html, body, div, span, applet, object, iframe,
7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8 | a, abbr, acronym, address, big, cite, code,
9 | del, dfn, em, img, ins, kbd, q, s, samp,
10 | small, strike, strong, sub, sup, tt, var,
11 | b, u, i, center,
12 | dl, dt, dd, ol, ul, li,
13 | fieldset, form, label, legend,
14 | table, caption, tbody, tfoot, thead, tr, th, td,
15 | article, aside, canvas, details, embed,
16 | figure, figcaption, footer, header, hgroup,
17 | menu, nav, output, ruby, section, summary,
18 | time, mark, audio, video {
19 | margin: 0;
20 | padding: 0;
21 | border: 0;
22 | font-size: 100%;
23 | font: inherit;
24 | vertical-align: baseline;
25 | }
26 | /* HTML5 display-role reset for older browsers */
27 | article, aside, details, figcaption, figure,
28 | footer, header, hgroup, menu, nav, section {
29 | display: block;
30 | }
31 | body {
32 | line-height: 1;
33 | font-size:13px;
34 | line-height:1.231;
35 | }
36 | ol, ul {
37 | list-style: none;
38 | }
39 | blockquote, q {
40 | quotes: none;
41 | }
42 | blockquote:before, blockquote:after,
43 | q:before, q:after {
44 | content: '';
45 | content: none;
46 | }
47 | table {
48 | border-collapse: collapse;
49 | border-spacing: 0;
50 | }
51 |
52 | /* app css stylesheet */
53 | body{
54 | font-family: Arial, sans-serif;
55 | }
56 | a:link, a:visited{
57 | color:#333;
58 | }
59 | a{
60 | text-decoration:none;
61 | }
62 | .header{
63 | padding-top:35px;
64 | margin-left:55px;
65 | }
66 |
67 | .logo{
68 | font-size:25px;
69 | float:left;
70 | margin-right:5px;
71 | text-align:center;
72 | padding: 0 3px;
73 | }
74 |
75 | .search-bar{
76 | float:left;
77 | }
78 |
79 | .btn{
80 | display:inline-block;
81 | padding:6px 12px;
82 | margin-bottom:0;
83 | font-weight:normal;
84 | text-align:center;
85 | vertical-align:center;
86 | cursor:pointer;
87 | border:1px solid transparent;
88 | }
89 |
90 | .btn:hover, .btn:focus{
91 | color: #333333;
92 | text-decoration:none;
93 | }
94 |
95 | .btn-default:hover{
96 | color: #333333;
97 | background-color: #ebebeb;
98 | border-color:#adadad;
99 | }
100 |
101 | .btn-default{
102 | background-color: #ffffff;
103 | border-color:#cccccc;
104 | height: 34px;
105 | margin-bottom: 3px;
106 | }
107 |
108 | .clear{clear:both;}
109 |
110 | .content{
111 | margin-top: 20px;
112 | margin-left: 20px;
113 | }
114 |
115 | ol {
116 | list-style:none;
117 | counter-reset:li;
118 | }
119 |
120 |
121 | #main-input{
122 | width:560px;
123 | height:32px;
124 | font:18px arial,sans-serif;
125 | }
126 |
127 | ol#stars{
128 | padding: 18px 0 0;
129 | list-style-type:none;
130 | }
131 |
132 | ol#stars li{
133 | margin-bottom:25px;
134 | }
135 |
136 | ol#stars article{
137 | z-index:0;
138 | padding-top: 3px;
139 | width:100%;
140 | }
141 |
142 | ol#stars h1{
143 | font-size:19px;
144 | line-height:1em;
145 | display:inline;
146 | }
147 |
148 | ol#stars header{
149 | margin-left: 77px;
150 | }
151 |
152 | ol#stars p, .edit-in-place textarea{
153 | margin-left: 77px;
154 | width:31.5%;
155 | font-size: 13px;
156 | padding-top: 2px;
157 | }
158 |
159 | ol#stars a{
160 | text-decoration:underline;
161 | color:#1b00a6;
162 | }
163 |
164 | .edit-in-place p {
165 | cursor:default;
166 | }
167 |
168 | .edit-in-place textarea{
169 | display: none;
170 | }
171 |
172 | .edit-in-place.active p {
173 | display: none;
174 | }
175 |
176 | .edit-in-place.active textarea {
177 | display: inline-block;
178 | }
179 |
180 | em{
181 | color: #dd4b39;
182 | }
183 |
184 | .pagination{
185 | margin-left: 76px;
186 | margin-top: 5px;
187 | margin-bottom: 20;
188 | }
189 |
190 |
--------------------------------------------------------------------------------
/app/img/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/baya/Gstar/b8d07c7ffc7dd86a2a43f041c8994999ae4c3439/app/img/.gitkeep
--------------------------------------------------------------------------------
/app/index-async.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
44 | My AngularJS App
45 |
46 |
47 |
48 |
52 |
53 |
54 |
55 | Angular seed app: v
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Gstar
6 |
7 |
8 |
9 |
10 |
11 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/js/app.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 |
4 | // Declare app level module which depends on filters, and services
5 | angular.module('gStar', ['ngSanitize', 'gStar.filters', 'gStar.services', 'gStar.directives', 'gStar.controllers']).
6 | config(['$routeProvider', function($routeProvider) {
7 | $routeProvider.when('/stars', {templateUrl: 'partials/stars.html', controller: 'StarsCtrl'});
8 | }]);
9 |
--------------------------------------------------------------------------------
/app/js/controllers.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* Controllers */
4 |
5 | angular.module('gStar.controllers', []).
6 | controller('SearchFormCtrl', ['$scope', '$location', function($scope, $location){
7 | $scope.q = $location.search().q;
8 | $scope.submit = function(){
9 | if(this.q){
10 | $location.path('stars').search({q: this.q});
11 | }
12 | };
13 | }]).
14 | controller('StarsCtrl', ['$scope', '$routeParams', 'SearchStars', function($scope, $routeParams, SearchStars){
15 | var q = $routeParams.q;
16 | var ws = q.split(" ").join("|");
17 | var baseHref = '/#/stars?' + 'q=' + q;
18 | var res = SearchStars.get($routeParams, function(){
19 | $scope.stars = res.stars;
20 | $scope.getPages = function(){
21 | var pages = [];
22 | var pageCount = res.total / res.limit;
23 | if(res.total % res.limit > 0){
24 | pageCount = pageCount + 1;
25 | }
26 | pageCount = Math.floor(pageCount);
27 |
28 |
29 | for(var i = 0; i < pageCount; i++){
30 | var num = i + 1;
31 | var start = i * res.limit;
32 | var current = res.start == start ? 'current' : ''
33 | if(current){
34 | $scope.currentPage = num;
35 | }
36 | var page = {num: num, href: '#', current: current};
37 | page.href = baseHref + '&start=' + start;
38 |
39 | pages[i] = page;
40 | }
41 |
42 | return pages;
43 | };
44 |
45 | $scope.pages = $scope.getPages();
46 | if($scope.currentPage == 1){
47 | $scope.prePageHref = 'nonlink';
48 | } else {
49 | $scope.prePageHref = baseHref + '&start=' + ($scope.currentPage - 2) * res.limit;
50 | }
51 | if($scope.currentPage == $scope.pages.length){
52 | $scope.nextPageHref = 'nonlink';
53 | } else {
54 | $scope.nextPageHref = baseHref + '&start=' + $scope.currentPage * res.limit;
55 | }
56 |
57 | if($scope.pages.length > 1){
58 | $scope.pagination = 'pagination';
59 | }
60 |
61 | $scope.hide = false;
62 | });
63 |
64 | $scope.newRegex = function(){
65 | return new RegExp("("+ ws +")","ig");
66 | };
67 |
68 | $scope.regex = $scope.newRegex();
69 | $scope.hit = '$1';
70 | $scope.hide = true;
71 |
72 | }]);
73 |
--------------------------------------------------------------------------------
/app/js/directives.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* Directives */
4 |
5 | angular.module('gStar.directives', []).
6 | directive('appVersion', ['version', function(version) {
7 | return function(scope, elm, attrs) {
8 | elm.text(version);
9 | };
10 | }]).
11 | directive('editInPlace', ['$compile', 'SaveStarDescription', function($compile, SaveStarDescription){
12 | return {
13 | restrict: 'E',
14 | scope: {descriptionhtml: '@', starid: '@', description: '@', new_regex: '&newRegex', hit: '@'},
15 | template: ''+
16 | '',
17 | link: function( $scope, element, attrs, ctrl ){
18 | var inputElement = $( element.children()[1] );
19 | var textElement = $( element.children()[0] );
20 | var dataCache = {};
21 | var regex = $scope.new_regex();
22 |
23 | element.addClass( 'edit-in-place' );
24 |
25 | $scope.editing = false;
26 |
27 | inputElement.on('focus', function(){
28 | var txt = $(this).val();
29 | $(this).val('');
30 | $(this).val(txt);
31 | })
32 |
33 | $scope.edit = function(){
34 | $scope.editing = true;
35 | element.addClass( 'active' );
36 | var textHeight = textElement.height();
37 | var patchHeight = 16;
38 | dataCache.origDescription = textElement.text();
39 | inputElement.height(textHeight + patchHeight);
40 |
41 | inputElement.focus();
42 | };
43 |
44 | inputElement.on( 'blur', function(){
45 | $scope.editing = false;
46 | $(element).removeClass( 'active' );
47 | if(dataCache.origDescription != $scope.description){
48 | var data = {id: $scope.starid, description: $scope.description};
49 | var nr = new SaveStarDescription(data)
50 | nr.$save();
51 | $scope.descriptionhtml = nr.description.replace(regex, $scope.hit);
52 | }
53 | });
54 | }
55 | };
56 | }])
--------------------------------------------------------------------------------
/app/js/filters.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* Filters */
4 |
5 | angular.module('gStar.filters', []).
6 | filter('interpolate', ['version', function(version) {
7 | return function(text) {
8 | return String(text).replace(/\%VERSION\%/mg, version);
9 | }
10 | }]);
11 |
--------------------------------------------------------------------------------
/app/js/services.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* Services */
4 |
5 | // In this case it is a simple value service.
6 | angular.module('gStar.services', ['ngResource']).
7 | value('version', '0.1').
8 | factory('SearchStars', ['$resource', function($resource){
9 | return $resource('/stars')
10 | }]).
11 | factory('SaveStarDescription', ['$resource', function($resource){
12 | return $resource('/saveStarDescription')
13 | }])
14 |
--------------------------------------------------------------------------------
/app/lib/angular/angular-cookies.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license AngularJS v1.0.7
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 ngCookies
12 | */
13 |
14 |
15 | angular.module('ngCookies', ['ng']).
16 | /**
17 | * @ngdoc object
18 | * @name ngCookies.$cookies
19 | * @requires $browser
20 | *
21 | * @description
22 | * Provides read/write access to browser's cookies.
23 | *
24 | * Only a simple Object is exposed and by adding or removing properties to/from
25 | * this object, new cookies are created/deleted at the end of current $eval.
26 | *
27 | * @example
28 |
29 |
30 |
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 | var value = $cookies[key];
149 | return value ? angular.fromJson(value) : value;
150 | },
151 |
152 | /**
153 | * @ngdoc method
154 | * @name ngCookies.$cookieStore#put
155 | * @methodOf ngCookies.$cookieStore
156 | *
157 | * @description
158 | * Sets a value for given cookie key
159 | *
160 | * @param {string} key Id for the `value`.
161 | * @param {Object} value Value to be stored.
162 | */
163 | put: function(key, value) {
164 | $cookies[key] = angular.toJson(value);
165 | },
166 |
167 | /**
168 | * @ngdoc method
169 | * @name ngCookies.$cookieStore#remove
170 | * @methodOf ngCookies.$cookieStore
171 | *
172 | * @description
173 | * Remove given cookie
174 | *
175 | * @param {string} key Id of the key-value pair to delete.
176 | */
177 | remove: function(key) {
178 | delete $cookies[key];
179 | }
180 | };
181 |
182 | }]);
183 |
184 |
185 | })(window, window.angular);
186 |
--------------------------------------------------------------------------------
/app/lib/angular/angular-cookies.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | AngularJS v1.0.7
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,b){var c={},g={},h,i=!1,j=f.copy,k=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,j(a,g),j(a,c),i&&d.$apply())})();i=!0;d.$watch(function(){var a,e,d;for(a in g)k(c[a])&&b.cookies(a,l);for(a in c)e=c[a],f.isString(e)?e!==g[a]&&(b.cookies(a,e),d=!0):f.isDefined(g[a])?c[a]=g[a]:delete c[a];if(d)for(a in e=b.cookies(),c)c[a]!==e[a]&&(k(e[a])?delete c[a]:c[a]=e[a])});return c}]).factory("$cookieStore",
7 | ["$cookies",function(d){return{get:function(b){return(b=d[b])?f.fromJson(b):b},put:function(b,c){d[b]=f.toJson(c)},remove:function(b){delete d[b]}}}])})(window,window.angular);
8 |
--------------------------------------------------------------------------------
/app/lib/angular/angular-loader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license AngularJS v1.0.7
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 |
258 | )(window);
259 |
260 | /**
261 | * Closure compiler type information
262 | *
263 | * @typedef { {
264 | * requires: !Array.,
265 | * invokeQueue: !Array.>,
266 | *
267 | * service: function(string, Function):angular.Module,
268 | * factory: function(string, Function):angular.Module,
269 | * value: function(string, *):angular.Module,
270 | *
271 | * filter: function(string, Function):angular.Module,
272 | *
273 | * init: function(Function):angular.Module
274 | * } }
275 | */
276 | angular.Module;
277 |
278 |
--------------------------------------------------------------------------------
/app/lib/angular/angular-loader.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | AngularJS v1.0.7
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 |
--------------------------------------------------------------------------------
/app/lib/angular/angular-resource.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license AngularJS v1.0.7
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 | * # Installation
28 | * To use $resource make sure you have included the `angular-resource.js` that comes in Angular
29 | * package. You can also find this file on Google CDN, bower as well as at
30 | * {@link http://code.angularjs.org/ code.angularjs.org}.
31 | *
32 | * Finally load the module in your application:
33 | *
34 | * angular.module('app', ['ngResource']);
35 | *
36 | * and you are ready to get started!
37 | *
38 | * @param {string} url A parameterized URL template with parameters prefixed by `:` as in
39 | * `/user/:username`. If you are using a URL with a port number (e.g.
40 | * `http://example.com:8080/api`), you'll need to escape the colon character before the port
41 | * number, like this: `$resource('http://example.com\\:8080/api')`.
42 | *
43 | * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
44 | * `actions` methods.
45 | *
46 | * Each key value in the parameter object is first bound to url template if present and then any
47 | * excess keys are appended to the url search query after the `?`.
48 | *
49 | * Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in
50 | * URL `/path/greet?salutation=Hello`.
51 | *
52 | * If the parameter value is prefixed with `@` then the value of that parameter is extracted from
53 | * the data object (useful for non-GET operations).
54 | *
55 | * @param {Object.