Skip to content

Commit

Permalink
Fetch from mediathread.qa now with CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolas committed Aug 18, 2015
1 parent 80ca35b commit d4217b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
Chrome extension for importing assets to Mediathread - a port of the bookmarklet

## Installation
* Fill in `host_url` and `user_url` in `settings.js`.
* Navigate to chrome://extensions in your browser, and click "Load
unpacked extension".
16 changes: 13 additions & 3 deletions collect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2956,15 +2956,25 @@
MediathreadCollectOptions.host_url,true);


/*$.ajax({
$.ajax({
url: MediathreadCollectOptions.user_url,
dataType: 'jsonp',
dataType: 'json',
crossDomain: true,
cache: false,
xhrFields: {
withCredentials: true
},
success: function(d) {
console.log('!', d);
if (d.logged_in === true) {
console.log('great, you\'re logged in.');
} else {
alert('log in to mediathread!');
}
},
error: function(d) {
console.error('#', d);
}
});*/
});

})();
7 changes: 3 additions & 4 deletions settings.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var MediathreadCollectOptions = {
flickr_apikey: 'fill this in',
youtube_apikey: 'fill this in',
host_url: 'https://mediathread.stage.ccnmtl.columbia.edu/save/',
user_url: 'https://mediathread.stage.ccnmtl.columbia.edu/accounts/logged_in.js',
host_url: 'https://mediathread.qa.ccnmtl.columbia.edu/',
user_url: 'https://mediathread.qa.ccnmtl.columbia.edu/accounts/is_logged_in/',

cross_origin: true
};

0 comments on commit d4217b7

Please sign in to comment.