diff --git a/bower.json b/bower.json index 67da4c3f..2a17d199 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "hello", - "version": "0.1.4", + "version": "0.1.5", "homepage": "http://adodson.com/hello.js/", "license" : "https://github.com/MrSwitch/hello.js/blob/master/LICENSE", "repository": { diff --git a/dist/hello.all.js b/dist/hello.all.js index 36c6c093..76db50b5 100644 --- a/dist/hello.all.js +++ b/dist/hello.all.js @@ -3320,6 +3320,12 @@ hello.init({ return o; } + function formatPerson(o){ + o.name = o.displayName || o.name; + o.picture = o.picture || ( o.image ? o.image.url : null); + o.thumbnail = o.picture; + } + function formatFriends(o){ paging(o); var r = []; @@ -3691,7 +3697,7 @@ hello.init({ events : '', photos : 'https://picasaweb.google.com/data/', videos : 'http://gdata.youtube.com', - friends : 'https://www.google.com/m8/feeds', + friends : 'https://www.google.com/m8/feeds, https://www.googleapis.com/auth/plus.login', files : 'https://www.googleapis.com/auth/drive.readonly', publish : '', @@ -3711,9 +3717,10 @@ hello.init({ 'me' : 'oauth2/v1/userinfo?alt=json', // https://developers.google.com/+/api/latest/people/list - 'me/friends' : contacts_url, + 'me/friends' : 'plus/v1/people/me/people/visible?maxResults=@{limit|100}', 'me/following' : contacts_url, 'me/followers' : contacts_url, + 'me/contacts' : contacts_url, 'me/share' : 'plus/v1/people/me/activities/public?maxResults=@{limit|100}', 'me/feed' : 'plus/v1/people/me/activities/public?maxResults=@{limit|100}', 'me/albums' : 'https://picasaweb.google.com/data/feed/api/user/default?alt=json&max-results=@{limit|100}&start-index=@{start|1}', @@ -3776,13 +3783,23 @@ hello.init({ o.last_name = o.family_name || (o.name? o.name.familyName : null); o.first_name = o.given_name || (o.name? o.name.givenName : null); // o.name = o.first_name + ' ' + o.last_name; - o.picture = o.picture || ( o.image ? o.image.url : null); - o.thumbnail = o.picture; - o.name = o.displayName || o.name; + + formatPerson(o); } return o; }, - 'me/friends' : formatFriends, + 'me/friends' : function(o){ + if(o.items){ + paging(o); + o.data = o.items; + delete o.items; + for(var i=0;i0?i.link[0].href+"?access_token="+r:null;n.push({id:i.id.$t,name:i.title.$t,email:i.gd$email&&i.gd$email.length>0?i.gd$email[0].address:null,updated_time:i.updated.$t,picture:s,thumbnail:s})}t.data=n,delete t.feed}return t}function a(e){if("feed"in e&&e.feed.openSearch$itemsPerPage){var t=n(e.feed.openSearch$itemsPerPage.$t),r=n(e.feed.openSearch$startIndex.$t),o=n(e.feed.openSearch$totalResults.$t);o>r+t&&(e.paging={next:"?start="+(r+t)})}else"nextPageToken"in e&&(e.paging={next:"?pageToken="+e.nextPageToken})}function s(){function e(e){var t=new FileReader;t.onload=function(t){n(btoa(t.target.result),e.type+a+"Content-Transfer-Encoding: base64")},t.readAsBinaryString(e)}function n(e,t){r.push(a+"Content-Type: "+t+a+a+e),i--,l()}var r=[],o=(1e10*Math.random()).toString(32),i=0,a="\r\n",s=a+"--"+o,l=function(){},c=/^data\:([^;,]+(\;charset=[^;,]+)?)(\;base64)?,/i;this.append=function(r,o){"string"!=typeof r&&"length"in Object(r)||(r=[r]);for(var s=0;s0?i.link[0].href+"?access_token="+r:null;n.push({id:i.id.$t,name:i.title.$t,email:i.gd$email&&i.gd$email.length>0?i.gd$email[0].address:null,updated_time:i.updated.$t,picture:a,thumbnail:a})}t.data=n,delete t.feed}return t}function s(e){if("feed"in e&&e.feed.openSearch$itemsPerPage){var t=n(e.feed.openSearch$itemsPerPage.$t),r=n(e.feed.openSearch$startIndex.$t),o=n(e.feed.openSearch$totalResults.$t);o>r+t&&(e.paging={next:"?start="+(r+t)})}else"nextPageToken"in e&&(e.paging={next:"?pageToken="+e.nextPageToken})}function l(){function e(e){var t=new FileReader;t.onload=function(t){n(btoa(t.target.result),e.type+a+"Content-Transfer-Encoding: base64")},t.readAsBinaryString(e)}function n(e,t){r.push(a+"Content-Type: "+t+a+a+e),i--,l()}var r=[],o=(1e10*Math.random()).toString(32),i=0,a="\r\n",s=a+"--"+o,l=function(){},c=/^data\:([^;,]+(\;charset=[^;,]+)?)(\;base64)?,/i;this.append=function(r,o){"string"!=typeof r&&"length"in Object(r)||(r=[r]);for(var s=0;s