|
20 | 20 | self.init(); |
21 | 21 | } |
22 | 22 |
|
23 | | - /** |
24 | | - * Initializer |
25 | | - * |
26 | | - */ |
| 23 | + // Initializer |
27 | 24 | Plugin.prototype.init = function () { |
28 | 25 | var self = this, |
29 | 26 | cached = self.getCache(); |
|
36 | 33 | } |
37 | 34 | }; |
38 | 35 |
|
39 | | - /** |
40 | | - * Apply results to HTML template |
41 | | - * |
42 | | - */ |
| 36 | + // Apply results to HTML template |
43 | 37 | Plugin.prototype.applyTemplate = function (repo) { |
44 | 38 | var self = this, |
45 | 39 | $widget = self.parseTemplate(repo); |
46 | 40 |
|
47 | 41 | $widget.appendTo(self.$container); |
48 | 42 | }; |
49 | 43 |
|
50 | | - /** |
51 | | - * Stores repostories in sessionStorage if available |
52 | | - * |
53 | | - */ |
| 44 | + // Stores repostories in sessionStorage if available |
54 | 45 | Plugin.prototype.cacheResults = function (result_data) { |
55 | 46 | var self = this; |
56 | 47 |
|
|
60 | 51 | } |
61 | 52 | }; |
62 | 53 |
|
63 | | - /** |
64 | | - * Grab cached results |
65 | | - * |
66 | | - */ |
| 54 | + // Grab cached results |
67 | 55 | Plugin.prototype.getCache = function () { |
68 | 56 | var self = this; |
69 | 57 |
|
|
75 | 63 | } |
76 | 64 | }; |
77 | 65 |
|
78 | | - /** |
79 | | - * Handle Errors requests |
80 | | - * |
81 | | - */ |
| 66 | + // Handle Errors requests |
82 | 67 | Plugin.prototype.handlerErrorRequests = function (result_data) { |
83 | 68 | var self = this; |
84 | 69 |
|
85 | 70 | console.warn(result_data.message); |
86 | 71 | return; |
87 | 72 | }; |
88 | 73 |
|
89 | | - /** |
90 | | - * Handle Successful request |
91 | | - * |
92 | | - */ |
| 74 | + // Handle Successful request |
93 | 75 | Plugin.prototype.handlerSuccessfulRequest = function (result_data) { |
94 | 76 | var self = this; |
95 | 77 |
|
96 | 78 | self.applyTemplate(result_data); |
97 | 79 | self.cacheResults(result_data); |
98 | 80 | }; |
99 | 81 |
|
100 | | - /** |
101 | | - * Parses Pushed date with date format |
102 | | - * |
103 | | - */ |
| 82 | + // Parses Pushed date with date format |
104 | 83 | Plugin.prototype.parsePushedDate = function (pushed_at) { |
105 | 84 | var self = this, |
106 | 85 | date = new Date(pushed_at); |
107 | 86 |
|
108 | 87 | return date.getDate() + '/' + (date.getMonth() + 1) + '/' + date.getFullYear(); |
109 | 88 | }; |
110 | 89 |
|
111 | | - /** |
112 | | - * Parses repository URL to be friendly |
113 | | - * |
114 | | - */ |
| 90 | + // Parses repository URL to be friendly |
115 | 91 | Plugin.prototype.parseRepositoryURL = function (url) { |
116 | 92 | var self = this; |
117 | 93 |
|
118 | 94 | return url.replace('api.','').replace('repos/',''); |
119 | 95 | }; |
120 | 96 |
|
121 | | - /** |
122 | | - * Parses HTML template |
123 | | - * |
124 | | - */ |
| 97 | + // Parses HTML template |
125 | 98 | Plugin.prototype.parseTemplate = function (repo) { |
126 | 99 | var self = this, |
127 | 100 | pushed_at = self.parsePushedDate(repo.pushed_at), |
|
149 | 122 | ')); |
150 | 123 | }; |
151 | 124 |
|
152 | | - /** |
153 | | - * Request repositories from Github |
154 | | - * |
155 | | - */ |
| 125 | + // Request repositories from Github |
156 | 126 | Plugin.prototype.requestData = function (repo) { |
157 | 127 | var self = this; |
158 | 128 |
|
|
0 commit comments