forked from MrSwitch/hello.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodules.html
227 lines (219 loc) · 6.4 KB
/
modules.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<link rel="stylesheet" href="/adorn/adorn.css"/>
<script src="/adorn/adorn.js" async></script>
<title>Hello.js Modules</title>
<h1>HelloJS Modules</h1>
<p>HelloJS is extensible, i.e. you can add new services to it as long as you can get your head around the important parts.
<blockquote>
<p>A module defines a providers Authorisation and RESTful endpoints. It translates the API's nuances for the provider to closely match those of its peers with similar features.
</blockquote>
<h2>HelloJS already has you connected</h2>
<p>The table shows the services which are already documented on HelloJS. Simply include these scripts in your page after your HelloJS script tag.</p>
<table>
<thead>
<tr>
<th>module</th>
<th>demo</th>
<th>credits</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="./src/modules/dropbox.js">dropbox.js</a></td>
<td><a href="demos/dropbox.html">dropbox demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/facebook.js">facebook.js</a></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/foursquare.js">foursquare.js</a></td>
<td><a href="demos/foursquare.html">foursquare demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/flickr.js">flickr.js</a></td>
<td><a href="demos/flickr.html">flickr demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/github.js">github.js</a></td>
<td><a href="demos/github.html">github demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/google.js">google.js</a></td>
<td><a href="demos/google.html">google demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/instagram.js">instagram.js</a></td>
<td><a href="demos/instagram.html">instagram demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/linkedin.js">linkedin.js</a></td>
<td><a href="demos/linkedin.html">linkedin demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/soundcloud.js">soundcloud.js</a></td>
<td><a href="demos/soundcloud.html">soundcloud demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/tumblr.js">tumblr.js</a></td>
<td><a href="demos/tumblr.html">tumblr demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/twitter.js">twitter.js</a></td>
<td><a href="demos/twitter.html">twitter demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/windows.js">windows.js</a></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/yahoo.js">yahoo.js</a></td>
<td><a href="demos/yahoo.html">yahoo demo</a></td>
<td></td>
</tr>
<tr>
<td><a href="./src/modules/dailycred.js">dailycred.js</a></td>
<td><a href="demos/dailycred.html">dailycred demo</a></td>
<td>https://github.com/chrishawn</td>
</tr>
</tbody>
</table>
<h2>Writing your own module</h2>
<p>Modules are loaded into helloJS using the hello.init() method, with a JSON object that has the name of the service as the only key and then whose value consists of an object with the following properties.</p>
<table>
<thead>
<tr>
<th>name</th>
<th>type</th>
<th>example</th>
<th>description</th>
<th>argument</th>
<th>default</th>
</tr>
</thead>
<tbody>
<tr>
<td>oauth</td>
<td colspan="3">
<i>Object</i>
<table>
<thead><tr><th>name</th><th>type</th><th>description</th></tr></thead>
<tbody>
<tr>
<td>version</td>
<td>string</td>
<td>Version of OAuth, <q>1.0</q>, <q>1.0a</q>, <q>2</q></td>
</tr>
<tr>
<td>request</td>
<td>url</td>
<td>Path of the first leg of OAuth 1</td>
</tr>
<tr>
<td>auth</td>
<td>url</td>
<td>Path of the authorization URL, second leg of OAuth 1</td>
</tr>
<tr>
<td>token</td>
<td>url</td>
<td>Path to get the Access token, OAuth 1 only, third leg of flow</td>
</tr>
<tr>
<td>grant</td>
<td>url</td>
<td>Path to get the Access token, OAuth2 only</td>
</tr>
</tbody>
</table>
</td>
<td>required</td>
<td></td>
</tr>
<tr>
<td>login</td>
<td><i>function<i></td>
<td></td>
<td>A function to augment the login request.</td>
<td>optional</td>
<td></td>
</tr>
<tr>
<td>refresh</td>
<td><i>Boolean<i></td>
<td></td>
<td>Indicate that the providers supports silent signin, aka display=none, however if a refresh_token was proffered at signin, then an attempt will be made with that.</td>
<td>optional</td>
<td>false</td>
</tr>
<tr>
<td>scope</td>
<td><i>Object<i></td>
<td></td>
<td>A dictionary of key and value (the providers sudonym or name of comparative scope)</td>
<td>optional</td>
<td></td>
</tr>
<tr>
<td>scope_delim</td>
<td><q>string</q></td>
<td><q>,</q>, <q> </q></td>
<td>Overrides the default delmiter between multiple scopes</td>
<td>optional</td>
<td><q>,</q></td>
</tr>
<tr>
<td>base</td>
<td><q>url</q></td>
<td></td>
<td>Prefix for all API requests</td>
<td>required</td>
<td></td>
</tr>
<tr>
<td>get,post,put,del</td>
<td><i>Object<i></td>
<td></td>
<td>Map of standardized pathnames to an alternative path, or path rendering function, the key 'default' will be used where the path is unrecognised, see examples</td>
<td>optional</td>
<td></td>
</tr>
<tr>
<td>wrap</td>
<td><i>Object<i></td>
<td></td>
<td>Map containing response processing handlers, the key 'default' will be used where the path is unrecognised.</td>
<td>optional</td>
<td></td>
</tr>
<tr>
<td>xhr, jsonp, form</td>
<td><i>function<i></td>
<td></td>
<td>A function called if the browser supports the method requests. Use this function to augment the request. Return truthy value to proceed or false to fallback to another method.</td>
<td>optional</td>
<td>true</td>
</tr>
</tbody>
</table>
<h2>Contributing modules</h2>
<p>That would be fantastic if you could. Please make the following updates so its easiy for people to discover and test.</p>
<ul>
<li>Fork the code from GitHub
<li>Name your script with the label you want it to be identified with and use this as the key name of module settings above
<li>Add your module to tests/hello.all.js
<li>Check your script passes the test in as many browsers as you can.
<li>Update the list of services above with a name and link, also get credit for your hard work by including your name
</ul>