4 $(document).ready(function () {
5 $.ajaxPrefilter(function(options, jqxhr) {
7 var ohauth = window.ohauth;
8 var url = options.url.replace(/\?$/, "");
10 oauth_consumer_key: OSM.oauth_consumer_key,
11 oauth_token: OSM.oauth_token,
12 oauth_signature_method: "HMAC-SHA1",
13 oauth_timestamp: ohauth.timestamp(),
14 oauth_nonce: ohauth.nonce()
17 for (var name in jqxhr.data) {
18 params[name] = jqxhr.data[name];
21 params.oauth_signature = ohauth.signature(
22 OSM.oauth_consumer_secret,
23 OSM.oauth_token_secret,
24 ohauth.baseString(options.type, url, params)
28 Authorization: "OAuth " + ohauth.authHeader(params)