Skip to content

Instantly share code, notes, and snippets.

@ViKingIX
Created May 11, 2023 09:38
Show Gist options
  • Save ViKingIX/43a669ad5b5bacf419d37a39c55b37a8 to your computer and use it in GitHub Desktop.
Save ViKingIX/43a669ad5b5bacf419d37a39c55b37a8 to your computer and use it in GitHub Desktop.
javascript:(function confirmAssetOnce() {
$.each($('table#countTask1 tr td:nth-child(7) a'), function(i, elem) {
task = $('table#countTask1 tr td:nth-child(2)')[i].innerHTML.split(/\s+/).join(' ');
if (task == localStorage.getItem('task')) {
location.reload();
return false;
}
localStorage.setItem('task', task);
console.log(`working on ${task}`);
$.get(elem.href, function(page) {
let $page = $(page);
$page.find('input[name=action]').val('confirmAsset');
$page.find('input[name=confirmed][value=0]').prop('checked', true);
data = $page.find('#asset_form').serialize();
$.post('asset.do', data, function (resp) {
console.log($page.find('#customizedId')[0].value + ` finished`);
setTimeout(() => {location.reload();}, 1000);
});
});
return false;
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment