Skip to content

Commit a7a8e1f

Browse files
committed
small updates
1 parent de935e9 commit a7a8e1f

8 files changed

Lines changed: 90 additions & 90 deletions

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Jonathan Hornung
3+
Copyright (c) 2016 Jonathan Hornung
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var app = angular.module('app', ['jtt_aping', 'jtt_aping_codebird']);
5353
```
5454

5555
### IV. Add the plugin
56-
Add the plugin's directive `aping-codebird="[]"` to your apiNG directive and configure your requests [configure your requests](#ii-requests)
56+
Add the plugin's directive `aping-codebird="[]"` to your apiNG directive and [configure your requests](#ii-requests)
5757
```html
5858
<aping
5959
template-url="templates/social.html"

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"authors": [
55
"Jonathan Hornung <jonathan.hornung@gmail.com>"
66
],
7-
"version": "0.7.0",
8-
"description": "twitter plugin for apiNG",
7+
"version": "0.7.5",
8+
"description": "Twitter plugin for apiNG",
99
"main": "dist/aping-plugin-codebird.min.js",
1010
"moduleType": [],
1111
"keywords": [

dist/aping-plugin-codebird.js

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
@name: aping-plugin-codebird
3-
@version: 0.7.0 (09-01-2016)
4-
@author: Jonathan Hornung
5-
@url: https://github.com/JohnnyTheTank/apiNG-plugin-codebird#readme
3+
@version: 0.7.5 (10-01-2016)
4+
@author: Jonathan Hornung <jonathan.hornung@gmail.com>
5+
@url: https://github.com/JohnnyTheTank/apiNG-plugin-codebird
66
@license: MIT
77
*/
88
"use strict";
@@ -28,46 +28,46 @@ var jjtApingCodebird = angular.module("jtt_aping_codebird", [])
2828
//create helperObject for helper function call
2929
var helperObject = {
3030
model: appSettings.model,
31-
showAvatar : request.showAvatar || false,
31+
showAvatar: request.showAvatar || false,
3232
};
33-
if(typeof appSettings.getNativeData !== "undefined") {
33+
if (typeof appSettings.getNativeData !== "undefined") {
3434
helperObject.getNativeData = appSettings.getNativeData;
3535
} else {
3636
helperObject.getNativeData = false;
3737
}
3838

3939
//create requestObject for api request call
4040
var requestObject = {};
41-
if(typeof request.items !== "undefined") {
41+
if (typeof request.items !== "undefined") {
4242
requestObject.count = request.items;
4343
} else {
4444
requestObject.count = appSettings.items;
4545
}
4646

47-
if(requestObject.count == 0) {
47+
if (requestObject.count == 0) {
4848
return false;
4949
}
5050

5151
// -1 is "no explicit limit". same for NaN value
52-
if(requestObject.count < 0 || isNaN(requestObject.count)) {
52+
if (requestObject.count < 0 || isNaN(requestObject.count)) {
5353
requestObject.count = undefined;
5454
}
5555

5656
// the api has a limit of 100 items per request
57-
if(requestObject.count > 100) {
57+
if (requestObject.count > 100) {
5858
requestObject.count = 100;
5959
}
6060

61-
if(request.search) {
61+
if (request.search) {
6262
// https://dev.twitter.com/rest/reference/get/search/tweets
6363
requestObject.q = request.search;
6464
requestObject.result_type = request.result_type || "mixed";
6565

66-
if(typeof request.lat !== "undefined" && typeof request.lng !== "undefined") {
67-
requestObject.geocode = request.lat+","+request.lng+","+(request.distance || "1" )+"km";
66+
if (typeof request.lat !== "undefined" && typeof request.lng !== "undefined") {
67+
requestObject.geocode = request.lat + "," + request.lng + "," + (request.distance || "1" ) + "km";
6868
}
6969

70-
if(typeof request.language !== "undefined") {
70+
if (typeof request.language !== "undefined") {
7171
requestObject.lang = request.language;
7272
}
7373

@@ -81,17 +81,17 @@ var jjtApingCodebird = angular.module("jtt_aping_codebird", [])
8181
true
8282
);
8383

84-
} else if(request.user) {
84+
} else if (request.user) {
8585
// https://dev.twitter.com/rest/reference/get/statuses/user_timeline
8686

8787
requestObject.screen_name = request.user;
8888
requestObject.contributor_details = true;
8989

90-
if(request.exclude_replies === true || request.exclude_replies === "true"){
90+
if (request.exclude_replies === true || request.exclude_replies === "true") {
9191
requestObject.exclude_replies = true;
9292
}
9393

94-
if(request.include_rts === false || request.include_rts === "false"){
94+
if (request.include_rts === false || request.include_rts === "false") {
9595
requestObject.include_rts = false;
9696
}
9797

@@ -124,22 +124,22 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper
124124
return _smallImageUrl.replace("_normal", "");
125125
};
126126
this.getImageUrlFromMediaObject = function (_item) {
127-
if(_item) {
128-
if(_item.media_url_https) {
127+
if (_item) {
128+
if (_item.media_url_https) {
129129
return this.getBigImageUrlFromSmallImageUrl(_item.media_url_https);
130130
}
131-
if(_item.media_url) {
131+
if (_item.media_url) {
132132
return this.getBigImageUrlFromSmallImageUrl(_item.media_url);
133133
}
134134
}
135135
return undefined;
136136
};
137137
this.getImageUrlFromUserObject = function (_item) {
138-
if(_item) {
139-
if(_item.profile_image_url_https) {
138+
if (_item) {
139+
if (_item.profile_image_url_https) {
140140
return this.getBigImageUrlFromSmallImageUrl(_item.profile_image_url_https);
141141
}
142-
if(_item.profile_image_url) {
142+
if (_item.profile_image_url) {
143143
return this.getBigImageUrlFromSmallImageUrl(_item.profile_image_url);
144144
}
145145
}
@@ -161,25 +161,25 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper
161161

162162
var baseUrl = this.getImageUrlFromMediaObject(_item);
163163

164-
if(_item.sizes) {
165-
if(typeof _item.sizes['small'] !== "undefined") {
166-
returnObject.thumb_url = baseUrl+":small";
164+
if (_item.sizes) {
165+
if (typeof _item.sizes['small'] !== "undefined") {
166+
returnObject.thumb_url = baseUrl + ":small";
167167
returnObject.thumb_width = _item.sizes['small'].w || undefined;
168168
returnObject.thumb_height = _item.sizes['small'].h || undefined;
169169
} else {
170170
returnObject.thumb_url = baseUrl;
171171
}
172172

173-
if(typeof _item.sizes['medium'] !== "undefined") {
174-
returnObject.img_url = baseUrl+":medium";
173+
if (typeof _item.sizes['medium'] !== "undefined") {
174+
returnObject.img_url = baseUrl + ":medium";
175175
returnObject.img_width = _item.sizes['medium'].w || undefined;
176176
returnObject.img_height = _item.sizes['medium'].h || undefined;
177177
} else {
178178
returnObject.img_url = baseUrl;
179179
}
180180

181-
if(typeof _item.sizes['large'] !== "undefined") {
182-
returnObject.native_url = baseUrl+":large";
181+
if (typeof _item.sizes['large'] !== "undefined") {
182+
returnObject.native_url = baseUrl + ":large";
183183
returnObject.native_width = _item.sizes['large'].w || undefined;
184184
returnObject.native_height = _item.sizes['large'].h || undefined;
185185
} else {
@@ -200,14 +200,14 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper
200200

201201
angular.forEach(_data.statuses, function (value, key) {
202202
var tempResult = _this.getItemByJsonData(value, _helperObject);
203-
if(tempResult) {
203+
if (tempResult) {
204204
requestResults.push(tempResult);
205205
}
206206
});
207207
} else if (_data.length > 0) {
208208
angular.forEach(_data, function (value, key) {
209209
var tempResult = _this.getItemByJsonData(value, _helperObject);
210-
if(tempResult) {
210+
if (tempResult) {
211211
requestResults.push(tempResult);
212212
}
213213
});
@@ -222,7 +222,7 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper
222222
var returnObject = {};
223223
if (_item && _helperObject.model) {
224224

225-
if(_helperObject.getNativeData === true || _helperObject.getNativeData === "true") {
225+
if (_helperObject.getNativeData === true || _helperObject.getNativeData === "true") {
226226
returnObject = this.getNativeItemByJsonData(_item, _helperObject.model);
227227
} else {
228228
switch (_helperObject.model) {
@@ -258,21 +258,21 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper
258258

259259
socialObject.date_time = new Date(socialObject.timestamp);
260260

261-
if(_item.entities && _item.entities.media && _item.entities.media.length>0) {
261+
if (_item.entities && _item.entities.media && _item.entities.media.length > 0) {
262262
socialObject.source = _item.entities.media;
263263
socialObject.img_url = this.getImageUrlFromMediaObject(_item.entities.media[0]);
264264
}
265265

266-
if(socialObject.img_url) {
266+
if (socialObject.img_url) {
267267
socialObject.type = "image";
268268
} else {
269269
socialObject.type = "tweet";
270-
if(_item.user && (_helperObject.showAvatar === true || _helperObject.showAvatar === 'true' ) ) {
270+
if (_item.user && (_helperObject.showAvatar === true || _helperObject.showAvatar === 'true' )) {
271271
socialObject.img_url = this.getImageUrlFromUserObject(_item.user);
272272
}
273273
}
274274

275-
socialObject.post_url = socialObject.blog_link+"status/"+socialObject.intern_id;
275+
socialObject.post_url = socialObject.blog_link + "status/" + socialObject.intern_id;
276276

277277
return socialObject;
278278
};
@@ -293,23 +293,23 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper
293293

294294
imageObject.date_time = new Date(imageObject.timestamp);
295295

296-
if(_item.entities && _item.entities.media && _item.entities.media.length>0) {
296+
if (_item.entities && _item.entities.media && _item.entities.media.length > 0) {
297297

298298
imageObject.source = _item.entities.media;
299299

300300
var tempImageArray = this.getImagesObjectFromMediaObject(_item.entities.media[0]);
301301
$.extend(true, imageObject, tempImageArray);
302302

303-
if(!imageObject.img_url) {
303+
if (!imageObject.img_url) {
304304
imageObject.img_url = this.getImageUrlFromMediaObject(_item.entities.media[0]);
305305
}
306306
}
307307

308-
if(!imageObject.img_url) {
308+
if (!imageObject.img_url) {
309309
return false;
310310
}
311311

312-
imageObject.post_url = imageObject.blog_link+"status/"+imageObject.intern_id;
312+
imageObject.post_url = imageObject.blog_link + "status/" + imageObject.intern_id;
313313

314314
return imageObject;
315315
};
@@ -320,7 +320,7 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper
320320

321321
switch (_model) {
322322
case "image":
323-
if(!_item.entities || !_item.entities.media || !_item.entities.media.length>0 || !this.getImageUrlFromMediaObject(_item.entities.media[0])) {
323+
if (!_item.entities || !_item.entities.media || !_item.entities.media.length > 0 || !this.getImageUrlFromMediaObject(_item.entities.media[0])) {
324324
return false;
325325
} else {
326326
nativeItem = _item;

dist/aping-plugin-codebird.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "aping-plugin-codebird",
3-
"version": "0.7.0",
4-
"description": "twitter plugin for apiNG",
3+
"version": "0.7.5",
4+
"description": "Twitter plugin for apiNG",
55
"main": "dist/aping-plugin-codebird.min.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
@@ -19,12 +19,12 @@
1919
"json",
2020
"angular"
2121
],
22-
"author": "Jonathan Hornung",
22+
"author": "Jonathan Hornung <jonathan.hornung@gmail.com>",
2323
"license": "MIT",
2424
"bugs": {
2525
"url": "https://github.com/JohnnyTheTank/apiNG-plugin-codebird/issues"
2626
},
27-
"homepage": "https://github.com/JohnnyTheTank/apiNG-plugin-codebird#readme",
27+
"homepage": "https://github.com/JohnnyTheTank/apiNG-plugin-codebird",
2828
"devDependencies": {
2929
"codebird": "*",
3030
"grunt": "^0.4.5",

src/aping-codebird-directive.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,46 @@ var jjtApingCodebird = angular.module("jtt_aping_codebird", [])
2121
//create helperObject for helper function call
2222
var helperObject = {
2323
model: appSettings.model,
24-
showAvatar : request.showAvatar || false,
24+
showAvatar: request.showAvatar || false,
2525
};
26-
if(typeof appSettings.getNativeData !== "undefined") {
26+
if (typeof appSettings.getNativeData !== "undefined") {
2727
helperObject.getNativeData = appSettings.getNativeData;
2828
} else {
2929
helperObject.getNativeData = false;
3030
}
3131

3232
//create requestObject for api request call
3333
var requestObject = {};
34-
if(typeof request.items !== "undefined") {
34+
if (typeof request.items !== "undefined") {
3535
requestObject.count = request.items;
3636
} else {
3737
requestObject.count = appSettings.items;
3838
}
3939

40-
if(requestObject.count == 0) {
40+
if (requestObject.count == 0) {
4141
return false;
4242
}
4343

4444
// -1 is "no explicit limit". same for NaN value
45-
if(requestObject.count < 0 || isNaN(requestObject.count)) {
45+
if (requestObject.count < 0 || isNaN(requestObject.count)) {
4646
requestObject.count = undefined;
4747
}
4848

4949
// the api has a limit of 100 items per request
50-
if(requestObject.count > 100) {
50+
if (requestObject.count > 100) {
5151
requestObject.count = 100;
5252
}
5353

54-
if(request.search) {
54+
if (request.search) {
5555
// https://dev.twitter.com/rest/reference/get/search/tweets
5656
requestObject.q = request.search;
5757
requestObject.result_type = request.result_type || "mixed";
5858

59-
if(typeof request.lat !== "undefined" && typeof request.lng !== "undefined") {
60-
requestObject.geocode = request.lat+","+request.lng+","+(request.distance || "1" )+"km";
59+
if (typeof request.lat !== "undefined" && typeof request.lng !== "undefined") {
60+
requestObject.geocode = request.lat + "," + request.lng + "," + (request.distance || "1" ) + "km";
6161
}
6262

63-
if(typeof request.language !== "undefined") {
63+
if (typeof request.language !== "undefined") {
6464
requestObject.lang = request.language;
6565
}
6666

@@ -74,17 +74,17 @@ var jjtApingCodebird = angular.module("jtt_aping_codebird", [])
7474
true
7575
);
7676

77-
} else if(request.user) {
77+
} else if (request.user) {
7878
// https://dev.twitter.com/rest/reference/get/statuses/user_timeline
7979

8080
requestObject.screen_name = request.user;
8181
requestObject.contributor_details = true;
8282

83-
if(request.exclude_replies === true || request.exclude_replies === "true"){
83+
if (request.exclude_replies === true || request.exclude_replies === "true") {
8484
requestObject.exclude_replies = true;
8585
}
8686

87-
if(request.include_rts === false || request.include_rts === "false"){
87+
if (request.include_rts === false || request.include_rts === "false") {
8888
requestObject.include_rts = false;
8989
}
9090

0 commit comments

Comments
 (0)