Skip to content

Commit ec17ee8

Browse files
committed
updated to new apiNG structure
1 parent b868462 commit ec17ee8

File tree

8 files changed

+30
-40
lines changed

8 files changed

+30
-40
lines changed

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,17 @@ Add the plugin's directive `aping-github="[]"` to your apiNG directive and [conf
7777
* Generate your access_token
7878

7979
### II. Insert your `access_token` into `aping-config.js`
80-
Open `js/apiNG/aping-config.js` in your application folder. It should be look like this snippet:
80+
Create and open `js/apiNG/aping-config.js` in your application folder. It should be look like this snippet:
8181
```js
8282
apingApp.config(['$provide', function ($provide) {
83-
$provide.constant("apingApiKeys", {
84-
//...
85-
github: [
86-
{'access_token':'<YOUR_GITHUB_ACCESS_TOKEN>'}
87-
],
88-
//...
89-
});
90-
91-
$provide.constant("apingDefaultSettings", {
92-
//...
83+
$provide.value("apingDefaultSettings", {
84+
apingApiKeys : {
85+
//...
86+
github: [
87+
{'access_token':'<YOUR_GITHUB_ACCESS_TOKEN>'}
88+
],
89+
//...
90+
}
9391
});
9492
}]);
9593
```

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"authors": [
55
"Jonathan Hornung <jonathan.hornung@gmail.com>"
66
],
7-
"version": "0.7.5",
7+
"version": "0.7.6",
88
"description": "GitHub plugin for apiNG",
99
"main": "dist/aping-plugin-github.min.js",
1010
"moduleType": [],

demo/aping-config.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
"use strict";
22
apingApp.config(['$provide', function ($provide) {
3-
4-
$provide.constant("apingApiKeys", {
5-
'github': [
6-
{'access_token':'<YOUR_GITHUB_ACCESS_TOKEN>'},
7-
]
3+
$provide.value("apingDefaultSettings", {
4+
orderBy: "updated_timestamp",
5+
orderReverse: "true",
6+
apingApiKeys: {
7+
//...
8+
'github': [
9+
{'access_token':'<YOUR_GITHUB_ACCESS_TOKEN>'},
10+
]
11+
//...
12+
}
813
});
9-
10-
$provide.constant("apingDefaultSettings", {
11-
templateUrl : "template.html",
12-
items : 40, //items per request
13-
maxItems: 100, //max items per aping
14-
orderBy : "updated_timestamp",
15-
orderReverse : "true",
16-
model: "repo",
17-
getNativeData: false
18-
});
19-
20-
}]);
14+
}]);

demo/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
</head>
1414
<body ng-app="app">
1515
<h1>Repos by User</h1>
16-
<aping model="repo" items="40" aping-github="[{'user':'JohnnyTheTank'}]"></aping>
16+
<aping template-url="template.html" model="repo" items="40" aping-github="[{'user':'JohnnyTheTank'}]"></aping>
1717
<hr>
1818
<h1>Repo by User and Name</h1>
19-
<aping model="repo" items="40" aping-github="[{'user':'JohnnyTheTank', 'repo':'apiNG'}]"></aping>
19+
<aping template-url="template.html" model="repo" items="40" aping-github="[{'user':'JohnnyTheTank', 'repo':'apiNG'}]"></aping>
2020
<hr>
2121
<h1>Repos by Name</h1>
22-
<aping model="repo" items="20" aping-github="[{'search':'apiNG', 'sort':'stars', 'order':'desc'}]"></aping>
22+
<aping template-url="template.html" model="repo" items="20" aping-github="[{'search':'apiNG', 'sort':'stars', 'order':'desc'}]"></aping>
2323

2424
<!--
2525
<h1>Activity by User</h1>

dist/aping-plugin-github.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
@name: aping-plugin-github
3-
@version: 0.7.5 (10-01-2016)
3+
@version: 0.7.6 (11-01-2016)
44
@author: Jonathan Hornung
55
@url: https://github.com/JohnnyTheTank/apiNG-plugin-github
66
@license: MIT
@@ -16,7 +16,6 @@ var jjtApingGithub = angular.module("jtt_aping_github", ['jtt_github'])
1616
link: function (scope, element, attrs, apingController) {
1717

1818
var appSettings = apingController.getAppSettings();
19-
2019
var requests = apingUtilityHelper.parseJsonFromAttributes(attrs.apingGithub, apingGithubHelper.getThisPlattformString(), appSettings);
2120

2221
requests.forEach(function (request) {
@@ -42,7 +41,7 @@ var jjtApingGithub = angular.module("jtt_aping_github", ['jtt_github'])
4241
requestObject.per_page = appSettings.items;
4342
}
4443

45-
if (requestObject.per_page == 0) {
44+
if (requestObject.count === 0 || requestObject.count === '0') {
4645
return false;
4746
}
4847

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aping-plugin-github",
3-
"version": "0.7.5",
3+
"version": "0.7.6",
44
"description": "GitHub plugin for apiNG",
55
"main": "dist/aping-plugin-github.min.js",
66
"scripts": {

src/aping-github-directive.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var jjtApingGithub = angular.module("jtt_aping_github", ['jtt_github'])
99
link: function (scope, element, attrs, apingController) {
1010

1111
var appSettings = apingController.getAppSettings();
12-
1312
var requests = apingUtilityHelper.parseJsonFromAttributes(attrs.apingGithub, apingGithubHelper.getThisPlattformString(), appSettings);
1413

1514
requests.forEach(function (request) {
@@ -35,7 +34,7 @@ var jjtApingGithub = angular.module("jtt_aping_github", ['jtt_github'])
3534
requestObject.per_page = appSettings.items;
3635
}
3736

38-
if (requestObject.per_page == 0) {
37+
if (requestObject.count === 0 || requestObject.count === '0') {
3938
return false;
4039
}
4140

0 commit comments

Comments
 (0)