-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
152 lines (129 loc) · 3.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Jabiru test page| Jeremias Menichelli</title>
<style>
body {
background-color: #f7f7f7;
font-family: 'Roboto Condensed', sans-serif;
}
* {
box-sizing: border-box;
}
.row {
margin: 0px auto;
max-width: 950px;
padding: 55px;
}
.column {
float: left;
margin-left: 8%;
min-height: 1px;
}
.column-1 {
width: 28%;
}
.column-2 {
width: 64%;
}
.column-3 {
width: 100%;
}
.column:first-child {
margin: 0;
}
h2 {
position: relative;
margin-top: 0;
text-transform: uppercase;
}
p {
position: relative;
margin-bottom: 0;
}
.status-card {
background-color: #fefefe;
border-radius: 8px;
min-height: 185px;
padding: 20px;
overflow: hidden;
position: relative;
transition: all .35s ease;
}
.done {
background-color: #69f0ae;
}
.status-card:before {
content: '✓';
color: #2e7d32;
font-size: 0;
position: absolute;
top: 50%;
left: 50%;
opacity: 0;
transform: translate(-50%, -50%);
}
.status-card.done:before {
font-size: 20em;
opacity: .25;
}
</style>
</head>
<body>
<div class="row">
<div id="case-1" class="column column-1 status-card">
<h2>case 1</h2>
<p>
<strong>success</strong> callback executed when response comes back with <strong>200</strong> code.
</p>
</div>
<div id="case-2" class="column column-1 status-card">
<h2>case 2</h2>
<p>
<strong>success</strong> callback executed when response comes back with <strong>200</strong> code, but API throws an internal not found <strong>404</strong> code.
</p>
</div>
<div id="case-3" class="column column-1 status-card">
<h2>case 3</h2>
<p><strong>fail</strong> callback executed when url does not respond.</p>
</div>
</div>
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,400italic">
<link rel="stylesheet" href="https://raw.githubusercontent.com/necolas/normalize.css/master/normalize.css">
<script src="dist/jabiru.js"></script>
<script>
(function(_win, _doc) {
'use strict';
jabiru
.naming('test')
.toGlobal();
// case 1
jabiru.get({
url: 'https://api.github.com/users/jeremenichelli',
success: function() {
var el = _doc.getElementById('case-1');
el.className += ' done';
}
});
// case 2
jabiru.get({
url: 'https://api.github.com/users/fgdsahuigshai',
success: function() {
var el = _doc.getElementById('case-2');
el.className += ' done';
}
});
// case 3
jabiru.get({
url: 'https://failapi.github.com/user/bla',
success: function() {},
fail: function() {
var el = _doc.getElementById('case-3');
el.className += ' done';
}
});
})(window, document)
</script>
</body>
</html>