diff --git a/bower.json b/bower.json
index 70b54bb..9e9416a 100644
--- a/bower.json
+++ b/bower.json
@@ -1,9 +1,11 @@
{
"name": "angularFlickr",
"version": "0.0.1",
+ "main": ["dist/angular-flickr.min.js", "dist/angular-flickr.min.css"],
"dependencies": {
"angular": "~1.0.7",
- "angular-resource": "~1.0.7"
+ "angular-resource": "~1.0.7",
+ "angular-recursion": "~1.0.5"
},
"devDependencies": {
"angular-mocks": "~1.0.7",
diff --git a/dist/angular-flickr.min.js b/dist/angular-flickr.min.js
index 24700a8..029ce2e 100644
--- a/dist/angular-flickr.min.js
+++ b/dist/angular-flickr.min.js
@@ -1 +1 @@
-"use strict";angular.module("flickr.config",[]).value("flickrConfig",{}),angular.module("flickr.services",["flickr.config","ngResource"]),angular.module("flickr.plugins",["flickr.config","flickr.services"]),angular.module("flickr.filters",["flickr.config","flickr.services"]),angular.module("flickr.directives",["flickr.config","flickr.services"]),angular.module("flickr",["flickr.config","flickr.services","flickr.plugins","flickr.filters","flickr.directives"]),angular.module("flickr.services").factory("Photo",["$resource","flickrConfig",function(a,b){var c=angular.extend({url:"https://api.flickr.com/services/rest/",params:{common:{format:"json",api_key:"8f423858224200b697154135ac10103a",jsoncallback:"JSON_CALLBACK"},get:{photoset_id:"",extras:"",privacy_filter:"",per_page:"",page:"",media:"",method:"flickr.photosets.getPhotos"},query:{user_id:"",page:"",per_page:"",method:"flickr.photosets.getList"}}},b.photoSet);return a(c.url,c.params.common,{get:{method:"JSONP",params:c.params.get,callback:c.params.jsoncallback},query:{method:"JSONP",params:c.params.query,callback:c.params.jsoncallback,isArray:!1}})}]),angular.module("flickr.services").factory("Photoset",["$resource","flickrConfig",function(a,b){var c=angular.extend({url:"https://api.flickr.com/services/rest/",params:{common:{format:"json",api_key:b.api_key||b.apiKey||"006d5ace5a1ec6e87d501a2753da1bc7",jsoncallback:"JSON_CALLBACK"},get:{photoset_id:"",extras:"",privacy_filter:"",per_page:"",page:"",media:"",method:"flickr.photosets.getPhotos"},query:{page:"",per_page:"",method:"flickr.photosets.getList"}}},b.photoset);return a(c.url,c.params.common,{get:{method:"JSONP",params:c.params.get,callback:c.params.jsoncallback,transformResponse:function(a){return a&&a.photoset&&a.photoset.photo?(angular.forEach(a.photoset.photo,function(a){var b="https://farm"+a.farm+".staticflickr.com/"+a.server+"/"+a.id+"_"+a.secret;angular.extend(a,{small:b+"_s.jpg",medium:b+"_z.jpg",large:b+"_b.jpg"})}),a.photoset):void 0}},query:{method:"JSONP",params:c.params.query,callback:c.params.jsoncallback,isArray:!1}})}]),angular.module("flickr.services").factory("flickrLoading",function(){return{isLoading:!1}}),angular.module("flickr.directives").directive("eatClick",function(){return function(a,b){b.bind("click",function(a){a.preventDefault()})}}),angular.module("flickr.directives").directive("imgAnimate",["$animator",function(a){return function(b,c,d){var e=a(b,d);c.bind("load",function(){console.log("here................"),e.animate("photoset-thumbnails",c)})}}]),angular.module("flickr.directives").directive("loadingBalls",["flickrLoading",function(a){return{scope:{search:"="},restrict:"EA",replace:!0,template:'
',link:function(b){b.flickrLoading=a}}}]),angular.module("flickr.directives").directive("photoFilter",["Photoset",function(){return{scope:{search:"="},restrict:"EA",replace:!0,template:'',link:function(a){a.search||(a.orders=[{text:"Date",value:"date"}],a.limits=[{text:"25",value:"25"},{text:"50",value:"50"},{text:"75",value:"75"},{text:"100",value:"100"},{text:"No Limit",value:""}],a.search={filter:"",order:"",limit:100})}}}]),angular.module("flickr.directives").directive("photosetList",["flickrConfig","flickrLoading","Photoset",function(a,b,c){var d=angular.extend({autoSelectIndex:0,user_id:a.user_id||"99179128@N07"},a.photosetList);return{scope:{sets:"=",set:"=",setId:"=",listClass:"@"},restrict:"EA",replace:!0,template:'',link:function(a,e,f){b.isLoading=!0,a.$sets=c.query({user_id:d.user_id},function(c){c&&c.photosets&&c.photosets.photoset&&c.photosets.photoset.length&&d.autoSelectIndex>-1&&a.setSelected(c.photosets.photoset[0]),b.isLoading=!1}),f.sets&&(a.sets=a.$sets),a.setSelected=function(b){f.setId&&(a.setId=b.id),f.set&&(a.set=b)}}}}]),angular.module("flickr.directives").directive("photosetPanel",["flickrLoading",function(a){return{scope:{panelTitle:"@",panelClass:"@"},restrict:"EA",replace:!0,template:'',link:function(b){b.flickrLoading=a}}}]),angular.module("flickr.directives").directive("photosetSlideshow",["$rootScope","$timeout","Photoset",function(a,b,c){return{scope:{photo:"=",next:"&",previous:"&",size:"@",interval:"@",setId:"@",outerClass:"@",photoClass:"@"},restrict:"EA",replace:!0,template:'',link:function(d,e,f){var g,h;d.$size=d.size||"large";var i=function(){var a=-1;return g&&d.$photo&&angular.forEach(g.photo,function(b,c){b.id===d.$photo.id&&(a=c)}),a},j=function(a){g&&g.photo&&g.photo.length&&(a>=g.photo.length?a=0:0>a&&(a=g.photo.length-1),d.$photo=g.photo[a])};f.$observe("setId",function(a){a&&(g=c.get({photoset_id:a},function(a){a.photo&&a.photo.length&&(d.$photo=a.photo[0])}))});var k=function(){h&&b.cancel(h)},l=function(){k(),f.interval&&(h=b(function(){console.log("Setting timer",f.interval),d.$next(),l()},f.interval))};f.$observe("interval",function(a){a&&l()}),d.$next=function(){j(i()+1),d.next&&d.next(),a.$broadcast("photoset.photo.request.next")},d.$previous=function(){j(i()-1),d.previous&&d.previous(),a.$broadcast("photoset.photo.request.previous")},d.$watch("photo",function(a,b){a&&a!==b&&(d.$photo=a)})}}}]),angular.module("flickr.directives").directive("photosetThumbnails",["flickrConfig","flickrLoading","Photoset",function(a,b,c){var d=angular.extend({autoSelectIndex:0},a.photosetThumbnails);return{scope:{setId:"@",photo:"=",thumbnailClass:"@"},restrict:"EA",replace:!0,template:'',link:function(a,e,f){var g={clicky:!0,"photoset-thumbnail":!0};f.thumbnailClass&&(g[f.thumbnailClass]=!0),a.classNames=function(b){return angular.extend(g,{active:a.photo&&a.photo.id&&b.id===a.photo.id})},a.thumbnailClick=function(b){b&&f.photo&&(a.photo=b)},f.$observe("setId",function(e){e&&(b.isLoading=!0,a.photoset=c.get({photoset_id:e},function(c){c&&c.photo&&c.photo.length&&d.autoSelectIndex>-1&&(a.thumbnailClick(c.photo[d.autoSelectIndex]),b.isLoading=!1)}))}),f.$observe("thumbnailClass",function(){g[f.thumbnailClass]=!0});var h=function(){var b=-1;return angular.forEach(a.photoset.photo,function(c,d){c.id===a.photo.id&&(b=d)}),b},i=function(b){b>=a.photoset.photo.length?b=0:0>b&&(b=a.photoset.photo.length-1),a.thumbnailClick(a.photoset.photo[b])},j=function(){i(h()+1)},k=function(){i(h()-1)};a.$on("photoset.photo.request.previous",k),a.$on("photoset.photo.request.next",j)}}}]);
\ No newline at end of file
+"use strict";angular.module("flickr.config",[]).value("flickrConfig",{}),angular.module("flickr.services",["flickr.config","ngResource"]),angular.module("flickr.plugins",["flickr.config","flickr.services"]),angular.module("flickr.filters",["flickr.config","flickr.services"]),angular.module("flickr.directives",["flickr.config","flickr.services"]),angular.module("flickr",["flickr.config","flickr.services","flickr.plugins","flickr.filters","flickr.directives"]),angular.module("flickr.services").factory("Photo",["$resource","flickrConfig",function(a,b){var c=angular.extend({url:"https://api.flickr.com/services/rest/",params:{common:{format:"json",api_key:"8f423858224200b697154135ac10103a",jsoncallback:"JSON_CALLBACK"},get:{photoset_id:"",extras:"",privacy_filter:"",per_page:"",page:"",media:"",method:"flickr.photosets.getPhotos"},query:{user_id:"",page:"",per_page:"",method:"flickr.photosets.getList"}}},b.photoSet);return a(c.url,c.params.common,{get:{method:"JSONP",params:c.params.get,callback:c.params.jsoncallback},query:{method:"JSONP",params:c.params.query,callback:c.params.jsoncallback,isArray:!1}})}]),angular.module("flickr.services").factory("Photoset",["$resource","flickrConfig",function(a,b){var c=angular.extend({url:"https://api.flickr.com/services/rest/",params:{common:{format:"json",api_key:b.api_key||b.apiKey||"006d5ace5a1ec6e87d501a2753da1bc7",jsoncallback:"JSON_CALLBACK"},get:{photoset_id:"",extras:"",privacy_filter:"",per_page:"",page:"",media:"",method:"flickr.photosets.getPhotos"},query:{page:"",per_page:"",method:"flickr.photosets.getList"}}},b.photoset);return a(c.url,c.params.common,{get:{method:"JSONP",params:c.params.get,callback:c.params.jsoncallback},query:{method:"JSONP",params:c.params.query,callback:c.params.jsoncallback,isArray:!1}})}]),angular.module("flickr.services").factory("flickrLoading",function(){return{isLoading:!1}}),angular.module("flickr.directives").directive("eatClick",function(){return function(a,b){b.bind("click",function(a){a.preventDefault()})}}),angular.module("flickr.directives").directive("imgAnimate",["$animator",function(a){return function(b,c,d){var e=a(b,d);c.bind("load",function(a){console.log("here................"),e.animate("photoset-thumbnails",c)})}}]),angular.module("flickr.directives").directive("loadingBalls",["flickrLoading",function(a){return{scope:{search:"="},restrict:"EA",replace:!0,template:'',link:function(b){b.flickrLoading=a}}}]),angular.module("flickr.directives").directive("photoFilter",["Photoset",function(a){return{scope:{search:"="},restrict:"EA",replace:!0,template:'',link:function(a){a.search||(a.orders=[{text:"Date",value:"date"}],a.limits=[{text:"25",value:"25"},{text:"50",value:"50"},{text:"75",value:"75"},{text:"100",value:"100"},{text:"No Limit",value:""}],a.search={filter:"",order:"",limit:100})}}}]),angular.module("flickr.directives").directive("photosetList",["flickrConfig","flickrLoading","Photoset",function(a,b,c){var d=angular.extend({autoSelectIndex:0,user_id:a.user_id||"99179128@N07"},a.photosetList);return{scope:{sets:"=",set:"=",setId:"=",listClass:"@",itemClass:"@"},restrict:"EA",replace:!0,template:'',link:function(a,e,f){b.isLoading=!0,a.$sets=c.query({user_id:d.user_id},function(c){c&&c.photosets&&c.photosets.photoset&&c.photosets.photoset.length&&d.autoSelectIndex>-1&&a.setSelected(c.photosets.photoset[0]),b.isLoading=!1}),f.sets&&(a.sets=a.$sets),a.setSelected=function(b){f.setId&&(a.setId=b.id),f.set&&(a.set=b)}}}}]),angular.module("flickr.directives").directive("photosetPanel",["flickrLoading",function(a){return{scope:{panelTitle:"@",panelClass:"@"},restrict:"EA",replace:!0,template:'',link:function(b){b.flickrLoading=a}}}]),angular.module("flickr.directives").directive("photosetSlideshow",["$rootScope","$timeout","Photoset",function(a,b,c){return{scope:{photo:"=",next:"&",previous:"&",size:"@",interval:"@",setId:"@",outerClass:"@",photoClass:"@"},restrict:"EA",replace:!0,template:'',link:function(d,e,f){var g,h;d.$size=d.size||"large";var i=function(){var a=-1;return g&&d.$photo&&angular.forEach(g.photo,function(b,c){b.id===d.$photo.id&&(a=c)}),a},j=function(a){g&&g.photo&&g.photo.length&&(a>=g.photo.length?a=0:0>a&&(a=g.photo.length-1),d.$photo=g.photo[a])};f.$observe("setId",function(a){a&&(g=c.get({photoset_id:a},function(a){a.photo&&a.photo.length&&(d.$photo=a.photo[0])}))});var k=function(){h&&b.cancel(h)},l=function(){k(),f.interval&&(h=b(function(){console.log("Setting timer",f.interval),d.$next(),l()},f.interval))};f.$observe("interval",function(a){a&&l()}),d.$next=function(){j(i()+1),d.next&&d.next(),a.$broadcast("photoset.photo.request.next")},d.$previous=function(){j(i()-1),d.previous&&d.previous(),a.$broadcast("photoset.photo.request.previous")},d.$watch("photo",function(a,b){a&&a!==b&&(d.$photo=a)})}}}]),angular.module("flickr.directives").directive("photosetThumbnails",["flickrConfig","flickrLoading","Photoset",function(a,b,c){var d=angular.extend({},a.photosetThumbnails);return{scope:{setId:"@",photos:"=",thumbnailClass:"@",useFilter:"=",multiSelect:"=",selectCallback:"="},restrict:"EA",replace:!0,template:'![]()
',link:function(a,e,f){var g={clicky:!0,"photoset-thumbnail":!0};a.multiSelect&&(a.photos=[]),f.thumbnailClass&&(g[f.thumbnailClass]=!0),a.classNames=function(a){return angular.extend(g,{active:a.selected})},a.thumbnailClick=function(b,c){return a.selectCallback?void a.selectCallback(b):void console.error("no callback found, we can't assign the picture")},a.selectAll=function(){angular.forEach(a.photoset.photo,function(b){a.thumbnailClick(b,!0)})},a.deselectAll=function(){angular.forEach(a.photoset.photo,function(b){a.thumbnailClick(b,!1)})},f.$observe("setId",function(e){e&&(b.isLoading=!0,c.get({photoset_id:e},function(c){angular.forEach(c.photoset.photo,function(a){var b="http://farm"+a.farm+".staticflickr.com/"+a.server+"/"+a.id+"_"+a.secret;angular.extend(a,{small:b+"_s.jpg",medium:b+"_q.jpg",large:b+"_b.jpg"})}),c&&c.photo&&c.photo.length&&d.autoSelectIndex>-1&&(a.thumbnailClick(c.photo[d.autoSelectIndex]),b.isLoading=!1),a.photoset=c.photoset}))}),f.$observe("thumbnailClass",function(a){g[f.thumbnailClass]=!0});var h=function(){var b=-1;return angular.forEach(a.photoset.photo,function(c,d){c.id===a.photo.id&&(b=d)}),b},i=function(b){b>=a.photoset.photo.length?b=0:0>b&&(b=a.photoset.photo.length-1),a.thumbnailClick(a.photoset.photo[b])},j=function(){i(h()+1)},k=function(){i(h()-1)};a.$on("photoset.photo.request.previous",k),a.$on("photoset.photo.request.next",j)}}}]);
\ No newline at end of file
diff --git a/modules/directives/photoset/photosetList.js b/modules/directives/photoset/photosetList.js
index 0d71437..4f6a61d 100644
--- a/modules/directives/photoset/photosetList.js
+++ b/modules/directives/photoset/photosetList.js
@@ -12,16 +12,23 @@ angular.module('flickr.directives')
sets: '=',
set: '=',
setId: '=',
- listClass: '@'
+ listClass: '@',
+ itemClass: '@'
},
restrict: 'EA',
replace: true,
- template: '' +
- '- ' +
+ // templateUrl: 'directives/photoset/photosetList.html',
+ template: '',
link: function (scope, element, attrs) {
flickrLoading.isLoading = true;
diff --git a/modules/directives/photoset/photosetThumbnails.js b/modules/directives/photoset/photosetThumbnails.js
index 983ed8d..1faa730 100644
--- a/modules/directives/photoset/photosetThumbnails.js
+++ b/modules/directives/photoset/photosetThumbnails.js
@@ -3,19 +3,31 @@
angular.module('flickr.directives')
.directive('photosetThumbnails', function (flickrConfig, flickrLoading, Photoset) {
var config = angular.extend({
- autoSelectIndex: 0
+ // autoSelectIndex: 0
}, flickrConfig.photosetThumbnails);
return {
scope: {
setId: '@',
- photo: '=',
- thumbnailClass: '@'
+ photos: '=',
+ thumbnailClass: '@',
+ useFilter: '=',
+ multiSelect: '=',
+ selectCallback: '='
},
+
restrict: 'EA',
replace: true,
- template: '
' +
- '
' +
+
+ template: '
' +
+
+ '
' +
+
+ '
' +
+ '' +
+ '' +
+ '
' +
+
// Note that we don't have an href tag on this anchor and we have to manually set the cursor to a pointer (by using 'clicky' class). Not sure
// why this occurs but if we set an href="" it will refresh the page only if we have the ng-animate tag associated as well - weird huh?
'
-1) {
// Set the initial selected thumbnail to the configured index.
scope.thumbnailClick(set.photo[config.autoSelectIndex]);
flickrLoading.isLoading = false;
}
+
+ scope.photoset = set.photoset;
+
});
}
});
diff --git a/modules/services/Photo.js b/modules/services/Photo.js
index 61760b0..0c6073d 100644
--- a/modules/services/Photo.js
+++ b/modules/services/Photo.js
@@ -3,7 +3,7 @@
angular.module('flickr.services')
.factory('Photo', function ($resource, flickrConfig) {
var config = angular.extend({
- url: 'http://api.flickr.com/services/rest/',
+ url: 'https://api.flickr.com/services/rest/',
params: {
common: {
format: 'json', // Optional.
diff --git a/modules/services/PhotoSet.js b/modules/services/PhotoSet.js
index e0f1e95..1857224 100644
--- a/modules/services/PhotoSet.js
+++ b/modules/services/PhotoSet.js
@@ -3,7 +3,7 @@
angular.module('flickr.services')
.factory('Photoset', function ($resource, flickrConfig) {
var config = angular.extend({
- url: 'http://api.flickr.com/services/rest/',
+ url: 'https://api.flickr.com/services/rest/',
params: {
common: {
format: 'json', // Optional.
@@ -32,42 +32,44 @@ angular.module('flickr.services')
return $resource(config.url, config.params.common, {
get: { method: 'JSONP',
params: config.params.get,
- callback: config.params.jsoncallback,
- transformResponse: function (data) {
- if (!data || !data.photoset || !data.photoset.photo) {
- return;
- }
+ callback: config.params.jsoncallback
-// TODO: Add the next/previous functionality here.
-// data.photoset.next = function(){
-// };
-//
-// data.photoset.previous = function(){
-// };
+// transformResponse: function (data) {
+// console.log("!!!transform!!!!");
+// if (!data || !data.photoset || !data.photoset.photo) {
+// return;
+// }
- angular.forEach(data.photoset.photo, function (photo) {
- var url = 'http://farm' + photo.farm + '.staticflickr.com/' + photo.server + '/' + photo.id + '_' + photo.secret;
- angular.extend(photo, {
- small: url + '_s.jpg',
- medium: url + '_z.jpg',
- large: url + '_b.jpg'
- });
- });
+// // TODO: Add the next/previous functionality here.
+// // data.photoset.next = function(){
+// // };
+// //
+// // data.photoset.previous = function(){
+// // };
-// s small square 75x75
-// q large square 150x150
-// t thumbnail, 100 on longest side
-// m small, 240 on longest side
-// n small, 320 on longest side
-// - medium, 500 on longest side
-// z medium 640, 640 on longest side
-// c medium 800, 800 on longest side†
-// b large, 1024 on longest side*
-// o original image, either a jpg, gif or png, depending on source format
+// angular.forEach(data.photoset.photo, function (photo) {
+// var url = 'http://farm' + photo.farm + '.staticflickr.com/' + photo.server + '/' + photo.id + '_' + photo.secret;
+// angular.extend(photo, {
+// small: url + '_s.jpg',
+// medium: url + '_z.jpg',
+// large: url + '_b.jpg'
+// });
+// });
+// // s small square 75x75
+// // q large square 150x150
+// // t thumbnail, 100 on longest side
+// // m small, 240 on longest side
+// // n small, 320 on longest side
+// // - medium, 500 on longest side
+// // z medium 640, 640 on longest side
+// // c medium 800, 800 on longest side†
+// // b large, 1024 on longest side*
+// // o original image, either a jpg, gif or png, depending on source format
- return data.photoset;
- }
+
+// return data.photoset;
+// }
},
query: { method: 'JSONP',
params: config.params.query,