source files -> src/ folder

This commit is contained in:
tmshv committed 2016-01-09 17:26:44 +03:00
1 parent f006207112
commit d25f4439fa
144 files changed

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
/**
* Created by tmshv on 22/11/14.
*/
var APINews = require("./news");
var APIGallery = require("./gallery");
module.exports = function(app) {
var minute = 1000 * 60;
app.factory("api", function ($http) {
var api = {};
api.news = new APINews($http);
api.gallery = new APIGallery($http, minute);
return api;
});
};
+22
View File
@@ -0,0 +1,22 @@
/**
* Created by tmshv on 22/11/14.
*/
function APIGallery(http){
this.request = http;
}
APIGallery.prototype.year = function(year) {
return this.request.get("/gallery/" + year, {cache: true});
};
APIGallery.prototype.album = function(year, course, album) {
var url = '/gallery/{year}/{course}/{album}'
.replace('{year}', year)
.replace('{course}', course)
.replace('{album}', album);
return this.request.get(url, {cache: true});
};
module.exports = APIGallery;
+15
View File
@@ -0,0 +1,15 @@
/**
* Created by tmshv on 22/11/14.
*/
var query = require("../../utils/net").query;
function APIFeed(http){
this.request = http;
}
APIFeed.prototype.feed = function(count, portion) {
return this.request.get("/news?"+query([["count", count], ["portion", portion]]));
};
module.exports = APIFeed;