Skip to content

Commit 0dbfdf1

Browse files
committed
Merge branch 'develop'
Conflicts: bower.json dist/oauth.js dist/oauth.min.js
2 parents 2ef0cf4 + 79370bf commit 0dbfdf1

34 files changed

+1526
-1742
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ coverage
44
!/js/tools
55
/js/tools/*
66
!/js/tools/jquery-lite.js
7+
*sublime*

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Usage
4040

4141
To connect your user using facebook, 2 methods:
4242

43-
Mode popup
43+
Popup mode
4444
----------
4545

4646
```javascript
@@ -55,7 +55,7 @@ OAuth.popup('facebook')
5555
});
5656
```
5757

58-
Mode redirection
58+
Redirection mode
5959
----------------
6060

6161
```javascript
@@ -290,4 +290,4 @@ This SDK is published under the Apache2 License.
290290

291291

292292

293-
More information in [oauth.io documentation](http://oauth.io/#/docs)
293+
More information in [oauth.io documentation](http://oauth.io/#/docs)

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oauth-js",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"main": "dist/oauth.min.js",
55
"description": "OAuth that just works",
66
"license": "apache2",

coffee/lib/api.coffee

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"use strict"
2+
3+
module.exports = (Materia) ->
4+
$ = Materia.getJquery()
5+
return {
6+
get: (url, params) =>
7+
base = Materia.getOAuthdURL()
8+
$.ajax
9+
url: base + url
10+
type: 'get'
11+
data: params
12+
post: (url, params) =>
13+
base = Materia.getOAuthdURL()
14+
$.ajax
15+
url: base + url
16+
type: 'post'
17+
data: params
18+
put: (url, params) =>
19+
base = Materia.getOAuthdURL()
20+
$.ajax
21+
url: base + url
22+
type: 'put'
23+
data: params
24+
del: (url, params) =>
25+
base = Materia.getOAuthdURL()
26+
$.ajax
27+
url: base + url
28+
type: 'delete'
29+
data: params
30+
}

coffee/lib/core.coffee

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"use strict"
2+
3+
config = require('../config')
4+
Url = require("../tools/url")
5+
Location = require('../tools/location_operations')
6+
cookies = require("../tools/cookies")
7+
cache = require("../tools/cache")
8+
9+
module.exports = (window, document, jquery, navigator) ->
10+
Url = Url(document)
11+
cookies.init config, document
12+
location_operations = Location document
13+
14+
cache.init cookies, config
15+
16+
Materia =
17+
initialize: (public_key, options) ->
18+
config.key = public_key
19+
if options
20+
for i of options
21+
config.options[i] = options[i]
22+
return
23+
24+
setOAuthdURL: (url) ->
25+
config.oauthd_url = url
26+
config.oauthd_base = Url.getAbsUrl(config.oauthd_url).match(/^.{2,5}:\/\/[^/]+/)[0]
27+
return
28+
29+
getOAuthdURL: () -> return config.oauthd_url
30+
getVersion: () -> return config.version
31+
32+
extend: (name, module) ->
33+
@[name] = module @
34+
35+
# private
36+
getConfig: () -> return config
37+
getWindow: () -> return window
38+
getDocument: () -> return document
39+
getNavigator: () -> return navigator
40+
getJquery: () -> return jquery
41+
getUrl: () -> return Url
42+
getCache: () -> return cache
43+
getCookies: () -> return cookies
44+
getLocationOperations: () -> return location_operations
45+
46+
return Materia

0 commit comments

Comments
 (0)