Skip to content

Commit

Permalink
impr: removed jquery (close #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyTheTank committed Jan 28, 2016
1 parent 05a107f commit adb32e0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 178 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"authors": [
"Jonathan Hornung <jonathan.hornung@gmail.com>"
],
"version": "0.7.7",
"version": "0.7.8",
"description": "GitHub plugin for apiNG",
"main": "dist/aping-plugin-github.min.js",
"moduleType": [],
Expand Down
1 change: 0 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="UTF-8">
<title>Github Demo</title>

<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/apiNG/dist/aping.min.js"></script>
<script src="aping-config.js"></script>
Expand Down
89 changes: 2 additions & 87 deletions dist/aping-plugin-github.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
@name: aping-plugin-github
@version: 0.7.7 (24-01-2016)
@version: 0.7.8 (28-01-2016)
@author: Jonathan Hornung
@url: https://github.com/JohnnyTheTank/apiNG-plugin-github
@license: MIT
Expand Down Expand Up @@ -178,11 +178,6 @@ angular.module("jtt_aping_github")
case "repo":
returnObject = this.getRepoItemByJsonData(_item);
break;
/*
case "activity":
returnObject = this.getActivityItemByJsonData(_item);
break;
*/

default:
return false;
Expand All @@ -194,7 +189,7 @@ angular.module("jtt_aping_github")
this.getRepoItemByJsonData = function (_item) {
var repoObject = apingModels.getNew("repo", this.getThisPlatformString());

$.extend(true, repoObject, {
angular.extend(repoObject, {
owner_name: _item.owner ? _item.owner.login : undefined,
owner_id: _item.owner ? _item.owner.id : undefined,
owner_link: _item.owner ? _item.owner.html_url : undefined,
Expand Down Expand Up @@ -225,86 +220,6 @@ angular.module("jtt_aping_github")

return repoObject;
};
/*
this.getActivityItemByJsonData = function (_item) {
var activityObject = apingModels.getNew("activity", this.getThisPlatformString());
$.extend(true, activityObject, {
body : undefined,
actor_name : _item.actor ? _item.actor.login : undefined, //who?
actor_id : _item.actor ? _item.actor.id : undefined,
actor_url : _item.actor ? this.getThisPlatformLink()+_item.actor.login : undefined,
actor_img_url : _item.actor ? _item.actor.avatar_url : undefined,
actor_type: undefined,
//action_name : undefined,
//action_message : undefined,
action_id : _item.id,
//action_url : undefined,
//action_img : undefined,
action_type: _item.type,
object_name : _item.repo ? _item.repo.name : undefined,
object_id : _item.repo ? _item.repo.id : undefined,
object_img : undefined,
object_url : _item.repo ? this.getThisPlatformLink()+_item.repo.name : undefined,
object_type: _item.repo ? "repository" : undefined,
//context : undefined,
timestamp : apingTimeHelper.getTimestampFromDateString(_item.created_at, 1000, 3600*1000),
date_time: new Date(_item.created_at),
});
var actionTempObject = this.getActionMessageByTypeAndPayload(_item.type, _item.payload);
activityObject.action_message = actionTempObject.message;
activityObject.action_name = actionTempObject.name;
activityObject.action_url = actionTempObject.url;
return activityObject;
};
this.getActionMessageByTypeAndPayload = function (_type, _payload) {
var returnObject ={
name : undefined,
message : "",
url : undefined,
};
switch(_type) {
case "PushEvent":
returnObject.name = "pushed";
if(_payload.commits && _payload.commits.constructor === Array) {
angular.forEach(_payload.commits, function (value, key) {
if(returnObject.message === "") {
returnObject.message += value.message;
} else {
returnObject.message += "\n"+value.message;
}
});
}
break;
case "PullRequestReviewCommentEvent":
returnObject.name = _payload.action + " pull request review comment";
returnObject.message = _payload.pull_request.title;
returnObject.url = _payload.pull_request.html_url;
break;
}
if(returnObject.message === "") {
returnObject.message = undefined;
}
return returnObject;
};
*/
}]);;"use strict";

angular.module("jtt_github", [])
Expand Down
4 changes: 2 additions & 2 deletions dist/aping-plugin-github.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aping-plugin-github",
"version": "0.7.7",
"version": "0.7.8",
"description": "GitHub plugin for apiNG",
"main": "dist/aping-plugin-github.min.js",
"scripts": {
Expand Down
87 changes: 1 addition & 86 deletions src/aping-github-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ angular.module("jtt_aping_github")
case "repo":
returnObject = this.getRepoItemByJsonData(_item);
break;
/*
case "activity":
returnObject = this.getActivityItemByJsonData(_item);
break;
*/

default:
return false;
Expand All @@ -83,7 +78,7 @@ angular.module("jtt_aping_github")
this.getRepoItemByJsonData = function (_item) {
var repoObject = apingModels.getNew("repo", this.getThisPlatformString());

$.extend(true, repoObject, {
angular.extend(repoObject, {
owner_name: _item.owner ? _item.owner.login : undefined,
owner_id: _item.owner ? _item.owner.id : undefined,
owner_link: _item.owner ? _item.owner.html_url : undefined,
Expand Down Expand Up @@ -114,84 +109,4 @@ angular.module("jtt_aping_github")

return repoObject;
};
/*
this.getActivityItemByJsonData = function (_item) {
var activityObject = apingModels.getNew("activity", this.getThisPlatformString());
$.extend(true, activityObject, {
body : undefined,
actor_name : _item.actor ? _item.actor.login : undefined, //who?
actor_id : _item.actor ? _item.actor.id : undefined,
actor_url : _item.actor ? this.getThisPlatformLink()+_item.actor.login : undefined,
actor_img_url : _item.actor ? _item.actor.avatar_url : undefined,
actor_type: undefined,
//action_name : undefined,
//action_message : undefined,
action_id : _item.id,
//action_url : undefined,
//action_img : undefined,
action_type: _item.type,
object_name : _item.repo ? _item.repo.name : undefined,
object_id : _item.repo ? _item.repo.id : undefined,
object_img : undefined,
object_url : _item.repo ? this.getThisPlatformLink()+_item.repo.name : undefined,
object_type: _item.repo ? "repository" : undefined,
//context : undefined,
timestamp : apingTimeHelper.getTimestampFromDateString(_item.created_at, 1000, 3600*1000),
date_time: new Date(_item.created_at),
});
var actionTempObject = this.getActionMessageByTypeAndPayload(_item.type, _item.payload);
activityObject.action_message = actionTempObject.message;
activityObject.action_name = actionTempObject.name;
activityObject.action_url = actionTempObject.url;
return activityObject;
};
this.getActionMessageByTypeAndPayload = function (_type, _payload) {
var returnObject ={
name : undefined,
message : "",
url : undefined,
};
switch(_type) {
case "PushEvent":
returnObject.name = "pushed";
if(_payload.commits && _payload.commits.constructor === Array) {
angular.forEach(_payload.commits, function (value, key) {
if(returnObject.message === "") {
returnObject.message += value.message;
} else {
returnObject.message += "\n"+value.message;
}
});
}
break;
case "PullRequestReviewCommentEvent":
returnObject.name = _payload.action + " pull request review comment";
returnObject.message = _payload.pull_request.title;
returnObject.url = _payload.pull_request.html_url;
break;
}
if(returnObject.message === "") {
returnObject.message = undefined;
}
return returnObject;
};
*/
}]);

0 comments on commit adb32e0

Please sign in to comment.