Advertisement
Guest User

SkyDrive APi1 : helper.js

a guest
Jun 23rd, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // The callback URL to redirect to after authentication
  2. redirectUri = "http://external.codecademy.com/skydrive.html";
  3.  
  4. // Initialize the JavaScript SDK
  5. WL.init({
  6.     client_id: '000000004C0E2C11',
  7.     redirect_uri: redirectUri
  8. });
  9.  
  10. $(document).ready(function() {
  11.     //TODO: add WL.ui here
  12.    
  13. });
  14.  
  15. // WL.ui calls this once the user has successfully
  16. // selected file(s) on SkyDrive
  17. function handleDownload(response) {
  18.     //TODO: Add WL.download here
  19.    
  20.     showResult(response);
  21. }
  22.  
  23. // WL.ui calls this if there was an error in selecting
  24. // a file(s) on SkyDrive, or if the user canceled
  25. function handleError(failureResponse) {
  26.     $('#result').html(failureResponse.error.message);
  27. }
  28.  
  29. // Show the fruits of your labor and submit answer for evaluation
  30. // Don't edit this!
  31. function showResult(response) {
  32.     $('#result').html("<h3>Woot! You should see your files downloading.</h3>");
  33.     answer = response;
  34.     $('#result').trigger('c');
  35. }
  36.  
  37. var answer;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement