Skip to content

Commit b868462

Browse files
committed
small updates
1 parent 48b1801 commit b868462

6 files changed

Lines changed: 234 additions & 234 deletions

File tree

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

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": "github plugin for apiNG",
7+
"version": "0.7.5",
8+
"description": "GitHub plugin for apiNG",
99
"main": "dist/aping-plugin-github.min.js",
1010
"moduleType": [],
1111
"keywords": [

dist/aping-plugin-github.js

Lines changed: 114 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
@name: aping-plugin-github
3-
@version: 0.7.0 (09-01-2016)
3+
@version: 0.7.5 (10-01-2016)
44
@author: Jonathan Hornung
5-
@url: https://github.com/JohnnyTheTank/apiNG-plugin-github#readme
5+
@url: https://github.com/JohnnyTheTank/apiNG-plugin-github
66
@license: MIT
77
*/
88
"use strict";
@@ -127,41 +127,41 @@ jjtApingGithub.service('apingGithubHelper', ['apingModels', 'apingTimeHelper', '
127127

128128
var _this = this;
129129

130-
if(_data.data.constructor === Array) {
130+
if (_data.data.constructor === Array) {
131131

132132
angular.forEach(_data.data, function (value, key) {
133133
var tempResult;
134-
if(_helperObject.getNativeData === true || _helperObject.getNativeData === "true") {
134+
if (_helperObject.getNativeData === true || _helperObject.getNativeData === "true") {
135135
tempResult = value;
136136
} else {
137137
tempResult = _this.getItemByJsonData(value, _helperObject.model);
138138
}
139-
if(tempResult) {
139+
if (tempResult) {
140140
requestResults.push(tempResult);
141141
}
142142
});
143143
} else {
144144

145-
if(_data.data.items) {
145+
if (_data.data.items) {
146146
angular.forEach(_data.data.items, function (value, key) {
147147
var tempResult;
148-
if(_helperObject.getNativeData === true || _helperObject.getNativeData === "true") {
148+
if (_helperObject.getNativeData === true || _helperObject.getNativeData === "true") {
149149
tempResult = value;
150150
} else {
151151
tempResult = _this.getItemByJsonData(value, _helperObject.model);
152152
}
153-
if(tempResult) {
153+
if (tempResult) {
154154
requestResults.push(tempResult);
155155
}
156156
});
157157
} else {
158158
var tempResult;
159-
if(_helperObject.getNativeData === true || _helperObject.getNativeData === "true") {
159+
if (_helperObject.getNativeData === true || _helperObject.getNativeData === "true") {
160160
tempResult = _data.data;
161161
} else {
162162
tempResult = _this.getItemByJsonData(_data, _helperObject.model);
163163
}
164-
if(tempResult) {
164+
if (tempResult) {
165165
requestResults.push(tempResult);
166166
}
167167
}
@@ -179,10 +179,10 @@ jjtApingGithub.service('apingGithubHelper', ['apingModels', 'apingTimeHelper', '
179179
returnObject = this.getRepoItemByJsonData(_item);
180180
break;
181181
/*
182-
case "activity":
183-
returnObject = this.getActivityItemByJsonData(_item);
184-
break;
185-
*/
182+
case "activity":
183+
returnObject = this.getActivityItemByJsonData(_item);
184+
break;
185+
*/
186186

187187
default:
188188
return false;
@@ -195,116 +195,116 @@ jjtApingGithub.service('apingGithubHelper', ['apingModels', 'apingTimeHelper', '
195195
var repoObject = apingModels.getNew("repo", this.getThisPlattformString());
196196

197197
$.extend(true, repoObject, {
198-
owner_name : _item.owner ? _item.owner.login : undefined,
199-
owner_id : _item.owner ? _item.owner.id : undefined,
200-
owner_link : _item.owner ? _item.owner.html_url : undefined,
201-
owner_img_url : _item.owner ? _item.owner.avatar_url : undefined,
202-
name : _item.name,
198+
owner_name: _item.owner ? _item.owner.login : undefined,
199+
owner_id: _item.owner ? _item.owner.id : undefined,
200+
owner_link: _item.owner ? _item.owner.html_url : undefined,
201+
owner_img_url: _item.owner ? _item.owner.avatar_url : undefined,
202+
name: _item.name,
203203
id: _item.id,
204204
fullname: _item.full_name,
205-
description : _item.description || undefined,
206-
url : _item.html_url,
207-
homepage : _item.homepage || undefined,
208-
language : _item.language || undefined,
209-
clone_url : _item.clone_url,
210-
git_url : _item.git_url,
211-
ssh_url : _item.ssh_url,
212-
svn_url : _item.svn_url,
213-
isFork : _item.fork,
214-
openIssues : _item.open_issues_count,
215-
watchers : _item.watchers_count,
216-
stargazers : _item.stargazers_count,
217-
forks : _item.forks_count,
218-
created_timestamp : apingTimeHelper.getTimestampFromDateString(_item.created_at, 1000, 3600*1000),
205+
description: _item.description || undefined,
206+
url: _item.html_url,
207+
homepage: _item.homepage || undefined,
208+
language: _item.language || undefined,
209+
clone_url: _item.clone_url,
210+
git_url: _item.git_url,
211+
ssh_url: _item.ssh_url,
212+
svn_url: _item.svn_url,
213+
isFork: _item.fork,
214+
openIssues: _item.open_issues_count,
215+
watchers: _item.watchers_count,
216+
stargazers: _item.stargazers_count,
217+
forks: _item.forks_count,
218+
created_timestamp: apingTimeHelper.getTimestampFromDateString(_item.created_at, 1000, 3600 * 1000),
219219
created_date_time: new Date(_item.created_at),
220-
updated_timestamp: _item.updated_at ? apingTimeHelper.getTimestampFromDateString(_item.updated_at, 1000, 3600*1000) : undefined,
220+
updated_timestamp: _item.updated_at ? apingTimeHelper.getTimestampFromDateString(_item.updated_at, 1000, 3600 * 1000) : undefined,
221221
updated_date_time: _item.updated_at ? new Date(_item.updated_at) : undefined,
222-
pushed_timestamp: _item.pushed_at ? apingTimeHelper.getTimestampFromDateString(_item.pushed_at, 1000, 3600*1000) : undefined,
222+
pushed_timestamp: _item.pushed_at ? apingTimeHelper.getTimestampFromDateString(_item.pushed_at, 1000, 3600 * 1000) : undefined,
223223
pushed_date_time: _item.pushed_at ? new Date(_item.pushed_at) : undefined,
224224
});
225225

226226
return repoObject;
227227
};
228228
/*
229-
this.getActivityItemByJsonData = function (_item) {
230-
var activityObject = apingModels.getNew("activity", this.getThisPlattformString());
231-
232-
$.extend(true, activityObject, {
233-
body : undefined,
234-
235-
actor_name : _item.actor ? _item.actor.login : undefined, //who?
236-
actor_id : _item.actor ? _item.actor.id : undefined,
237-
actor_url : _item.actor ? this.getThisPlatformLink()+_item.actor.login : undefined,
238-
actor_img_url : _item.actor ? _item.actor.avatar_url : undefined,
239-
actor_type: undefined,
240-
241-
//action_name : undefined,
242-
//action_message : undefined,
243-
action_id : _item.id,
244-
//action_url : undefined,
245-
//action_img : undefined,
246-
action_type: _item.type,
247-
248-
object_name : _item.repo ? _item.repo.name : undefined,
249-
object_id : _item.repo ? _item.repo.id : undefined,
250-
object_img : undefined,
251-
object_url : _item.repo ? this.getThisPlatformLink()+_item.repo.name : undefined,
252-
object_type: _item.repo ? "repository" : undefined,
253-
254-
//context : undefined,
255-
timestamp : apingTimeHelper.getTimestampFromDateString(_item.created_at, 1000, 3600*1000),
256-
date_time: new Date(_item.created_at),
257-
258-
});
259-
260-
var actionTempObject = this.getActionMessageByTypeAndPayload(_item.type, _item.payload);
261-
262-
activityObject.action_message = actionTempObject.message;
263-
activityObject.action_name = actionTempObject.name;
264-
activityObject.action_url = actionTempObject.url;
265-
266-
return activityObject;
267-
};
268-
269-
this.getActionMessageByTypeAndPayload = function (_type, _payload) {
270-
271-
var returnObject ={
272-
name : undefined,
273-
message : "",
274-
url : undefined,
275-
};
276-
277-
switch(_type) {
278-
case "PushEvent":
279-
280-
returnObject.name = "pushed";
281-
282-
if(_payload.commits && _payload.commits.constructor === Array) {
283-
angular.forEach(_payload.commits, function (value, key) {
284-
if(returnObject.message === "") {
285-
returnObject.message += value.message;
286-
} else {
287-
returnObject.message += "\n"+value.message;
288-
}
289-
});
290-
}
291-
break;
292-
293-
case "PullRequestReviewCommentEvent":
294-
returnObject.name = _payload.action + " pull request review comment";
295-
returnObject.message = _payload.pull_request.title;
296-
returnObject.url = _payload.pull_request.html_url;
297-
298-
break;
299-
}
300-
301-
if(returnObject.message === "") {
302-
returnObject.message = undefined;
303-
}
304-
305-
return returnObject;
306-
};
307-
*/
229+
this.getActivityItemByJsonData = function (_item) {
230+
var activityObject = apingModels.getNew("activity", this.getThisPlattformString());
231+
232+
$.extend(true, activityObject, {
233+
body : undefined,
234+
235+
actor_name : _item.actor ? _item.actor.login : undefined, //who?
236+
actor_id : _item.actor ? _item.actor.id : undefined,
237+
actor_url : _item.actor ? this.getThisPlatformLink()+_item.actor.login : undefined,
238+
actor_img_url : _item.actor ? _item.actor.avatar_url : undefined,
239+
actor_type: undefined,
240+
241+
//action_name : undefined,
242+
//action_message : undefined,
243+
action_id : _item.id,
244+
//action_url : undefined,
245+
//action_img : undefined,
246+
action_type: _item.type,
247+
248+
object_name : _item.repo ? _item.repo.name : undefined,
249+
object_id : _item.repo ? _item.repo.id : undefined,
250+
object_img : undefined,
251+
object_url : _item.repo ? this.getThisPlatformLink()+_item.repo.name : undefined,
252+
object_type: _item.repo ? "repository" : undefined,
253+
254+
//context : undefined,
255+
timestamp : apingTimeHelper.getTimestampFromDateString(_item.created_at, 1000, 3600*1000),
256+
date_time: new Date(_item.created_at),
257+
258+
});
259+
260+
var actionTempObject = this.getActionMessageByTypeAndPayload(_item.type, _item.payload);
261+
262+
activityObject.action_message = actionTempObject.message;
263+
activityObject.action_name = actionTempObject.name;
264+
activityObject.action_url = actionTempObject.url;
265+
266+
return activityObject;
267+
};
268+
269+
this.getActionMessageByTypeAndPayload = function (_type, _payload) {
270+
271+
var returnObject ={
272+
name : undefined,
273+
message : "",
274+
url : undefined,
275+
};
276+
277+
switch(_type) {
278+
case "PushEvent":
279+
280+
returnObject.name = "pushed";
281+
282+
if(_payload.commits && _payload.commits.constructor === Array) {
283+
angular.forEach(_payload.commits, function (value, key) {
284+
if(returnObject.message === "") {
285+
returnObject.message += value.message;
286+
} else {
287+
returnObject.message += "\n"+value.message;
288+
}
289+
});
290+
}
291+
break;
292+
293+
case "PullRequestReviewCommentEvent":
294+
returnObject.name = _payload.action + " pull request review comment";
295+
returnObject.message = _payload.pull_request.title;
296+
returnObject.url = _payload.pull_request.html_url;
297+
298+
break;
299+
}
300+
301+
if(returnObject.message === "") {
302+
returnObject.message = undefined;
303+
}
304+
305+
return returnObject;
306+
};
307+
*/
308308

309309
}]);;"use strict";
310310

dist/aping-plugin-github.min.js

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "aping-plugin-github",
3-
"version": "0.7.0",
4-
"description": "github plugin for apiNG",
3+
"version": "0.7.5",
4+
"description": "GitHub plugin for apiNG",
55
"main": "dist/aping-plugin-github.min.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
@@ -24,7 +24,7 @@
2424
"bugs": {
2525
"url": "https://github.com/JohnnyTheTank/apiNG-plugin-github/issues"
2626
},
27-
"homepage": "https://github.com/JohnnyTheTank/apiNG-plugin-github#readme",
27+
"homepage": "https://github.com/JohnnyTheTank/apiNG-plugin-github",
2828
"devDependencies": {
2929
"grunt": "^0.4.5",
3030
"grunt-contrib-concat": "^0.5.1",

0 commit comments

Comments
 (0)