diff --git a/dist/angular-vimeo-api-factory.min.js b/dist/angular-vimeo-api-factory.min.js index e965fcb..6d5a1b6 100644 --- a/dist/angular-vimeo-api-factory.min.js +++ b/dist/angular-vimeo-api-factory.min.js @@ -1,3 +1,3 @@ -/*! angular-facebook-api-factory v0.2.0 (05-12-2015) by Jonathan Hornung */ +/*! angular-vimeo-api-factory v0.1.0 (05-12-2015) by Jonathan Hornung */ "use strict";angular.module("jtt_vimeo",[]).factory("vimeoFactory",["$http","vimeoSearchDataService",function(a,b){var c={};return c.getVideosFromChannel=function(c){if(!c.channel)return!1;var d=b.getNew("videosFromChannel",c);return a({method:"GET",url:d.url,params:d.object})},c.getVideosFromCategory=function(c){if(!c.category)return!1;var d=b.getNew("videosFromCategory",c);return a({method:"GET",url:d.url,params:d.object})},c.getVideosFromTag=function(c){if(!c.tag)return!1;var d=b.getNew("videosFromTag",c);return a({method:"GET",url:d.url,params:d.object})},c.getVideosFromUser=function(c){if(!c.user)return!1;var d=b.getNew("videosFromUser",c);return a({method:"GET",url:d.url,params:d.object})},c}]).service("vimeoSearchDataService",function(){this.getApiBaseUrl=function(a){return"https://api.vimeo.com/"},this.fillDataInObjectByList=function(a,b,c){return angular.forEach(c,function(c,d){"undefined"!=typeof b[c]&&(a.object[c]=b[c])}),a},this.getNew=function(a,b){var c=20,d={object:{},url:""};switch(a){case"videosFromChannel":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["page","query","filter","filter_embeddable","sort","direction"]),d.url=this.getApiBaseUrl()+"channels/"+b.channel+"/videos";break;case"videosFromCategory":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["page","query","filter","filter_embeddable","sort","direction"]),d.url=this.getApiBaseUrl()+"categories/"+b.category+"/videos";break;case"videosFromTag":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["page","query","sort","direction"]),d.url=this.getApiBaseUrl()+"tags/"+b.tag+"/videos";break;case"videosFromUser":d.object={access_token:b.access_token,per_page:b.per_page||c},d=this.fillDataInObjectByList(d,b,["page","query","filter","filter_embeddable","sort","direction"]),d.url=this.getApiBaseUrl()+"users/"+b.user+"/videos"}return d}}); \ No newline at end of file