3 $(document).ready(function () {
4 function makeAbsolute(url) {
5 var a = document.createElement('a');
10 if (OSM.oauth_token) {
11 var headerGenerator = window.ohauth.headerGenerator({
12 consumer_key: OSM.oauth_consumer_key,
13 consumer_secret: OSM.oauth_consumer_secret,
14 token: OSM.oauth_token,
15 token_secret: OSM.oauth_token_secret
18 $.ajaxPrefilter(function(options, jqxhr) {
20 options.headers = options.headers || {};
21 options.headers.Authorization = headerGenerator(options.type, makeAbsolute(options.url), jqxhr.data);