Parcourir la Source

Initial commit.

bmallred 13 ans auparavant
Commettre
af5999b973
3 fichiers modifiés avec 81 ajouts et 0 suppressions
  1. 9 0
      armory.js
  2. 26 0
      index.html
  3. 46 0
      sample.json

+ 9 - 0
armory.js

@ -0,0 +1,9 @@
1
angular.module('WowArmory', ['ngResource']);
2
3
function ArmoryController($scope, $resource) {
4
    $scope.armory = $resource('http://us.battle.net/api/wow/guild/hellscream/:action', 
5
        { action: 'alkaline', fields: 'members', jsonp: 'angular.callbacks._0' }, 
6
        { query: { method: 'JSONP' }});
7
8
    $scope.Guild = $scope.armory.get();
9
};

+ 26 - 0
index.html

@ -0,0 +1,26 @@
1
<!doctype html>
2
<html ng-app="WowArmory">
3
<head>
4
    <script type="text/javascript" src="http://code.angularjs.org/1.0.0rc6/angular-1.0.0rc6.min.js"></script>
5
    <script type="text/javascript" src="http://code.angularjs.org/1.0.0rc6/angular-resource-1.0.0rc6.min.js"></script>
6
    <script type="text/javascript" src="armory.js"></script>
7
</head>
8
<body>
9
    <div ng-controller="ArmoryController">
10
        <h2>Members</h2>
11
12
        <div ng-repeat="member in Guild.members" style="clear: both;">
13
            <!--<img src="{{member.character.thumbnail}}" style="float: left;" />-->
14
15
            <h3>Character: {{member.character.name}}</h3>
16
17
            <div>Realm: {{member.character.realm}}</div>
18
            <div>Class: {{member.character.class}}</div>
19
            <div>Race: {{member.character.race}}</div>
20
            <div>Gender: {{member.character.gender}}</div>
21
            <div>Achievement Points: {{member.character.achievementPoints}}</div>
22
            <div>Rank: {{member.rank}}</div>
23
        </div>
24
    </div>
25
</body>
26
</html>

+ 46 - 0
sample.json

@ -0,0 +1,46 @@
1
{
2
    "lastModified": 1335514842000,
3
    "name": "Alkaline",
4
    "realm": "Hellscream",
5
    "battlegroup": "Rampage",
6
    "level": 15,
7
    "side": 1,
8
    "achievementPoints": 1150,
9
    "members": [
10
    {
11
        "character":
12
        {
13
            "name": "Lorn",
14
            "realm": "Hellscream",
15
            "class": 7,
16
            "race": 6,
17
            "gender": 0,
18
            "level": 73,
19
            "achievementPoints": 910,
20
            "thumbnail": "hellscream/8/5008136-avatar.jpg"
21
        },
22
        "rank": 8
23
    },
24
    {
25
        "character":
26
        {
27
            "name": "Lerry",
28
            "realm": "Hellscream",
29
            "class": 1,
30
            "race": 8,
31
            "gender": 0,        
32
            "level": 85,
33
            "achievementPoints":1 420,
34
            "thumbnail": "hellscream/180/5088180-avatar.jpg"
35
        },
36
        "rank": 8
37
    }],
38
    "emblem":
39
    {
40
        "icon": 152,
41
        "iconColor": "ff5d094f",
42
        "border": 2,
43
        "borderColor": "ffffffff",
44
        "backgroundColor": "ff646464"
45
    }
46
}