(function (window, $) { function submitJob(userId, items, form) { var targets = $('.chkSyncTarget:checked', form).get().map(function (c) { return c.getAttribute('data-targetid'); }); if (!targets.length) { Dashboard.alert('Please select one or more sync targets.'); return; } var options = { userId: userId, TargetIds: targets.join(','), ItemIds: items.map(function (i) { return i.Id; }).join(','), Quality: $('.radioSyncQuality', form)[0].getAttribute('data-value') }; ApiClient.ajax({ type: "POST", url: ApiClient.getUrl("Sync/Jobs"), data: JSON.stringify(options), contentType: "application/json" }).done(function () { $('.syncPanel').panel('close'); }); } function showSyncMenu(items) { var userId = Dashboard.getCurrentUserId(); ApiClient.getJSON(ApiClient.getUrl('Sync/Targets', { UserId: userId })).done(function (targets) { var html = '