Created
May 11, 2023 09:38
-
-
Save ViKingIX/43a669ad5b5bacf419d37a39c55b37a8 to your computer and use it in GitHub Desktop.
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
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