Last active
December 15, 2015 02:29
-
-
Save tjmcewan/5187623 to your computer and use it in GitHub Desktop.
Sync or Unsync all Box folders on the current page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#mod-item-list>li').each(function(index, el){ | |
// defaults to unsync; to sync, set unsync to 0 | |
var unsync = 1; | |
var folder_id = el.attributes['data-view_id'].textContent; | |
var data = ["q[items][0]=", folder_id, "&q[unsync]=", unsync, "&request_token=", request_token, "&realtime_subscriber_id=", realtime_subscriber_id].join(''); | |
var url = ["https://", location.host, "/index.php?rm=box_sync_mark_item_sync"].join(''); | |
$.post(url, data, function(x,status,z){ console.log(folder_id, ': ', status) }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment