up2k-hook-ytid: comment-field example

This commit is contained in:
ed 2022-09-04 00:06:42 +02:00
parent 89d1af7f33
commit 5fa8aaabb9

View file

@ -14,6 +14,8 @@ function up2k_namefilter(good_files, nil_files, bad_files, hooks) {
a_up2k_namefilter(good_files, nil_files, bad_files, hooks).then(() => { }); a_up2k_namefilter(good_files, nil_files, bad_files, hooks).then(() => { });
} }
// ebi('op_up2k').appendChild(mknod('input','unick'));
function bstrpos(buf, ptn) { function bstrpos(buf, ptn) {
var ofs = 0, var ofs = 0,
ch0 = ptn[0], ch0 = ptn[0],
@ -167,6 +169,16 @@ async function a_up2k_namefilter(good_files, nil_files, bad_files, hooks) {
return hooks[0]([], [], [], hooks.slice(1)); return hooks[0]([], [], [], hooks.slice(1));
} }
var el = ebi('unick'), unick = el ? el.value : '';
if (unick) {
console.log(`sending uploader nickname [${unick}]`);
fetch(document.location, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
body: 'msg=' + encodeURIComponent(unick)
});
}
toast.inf(5, `running query for ${yt_ids.size} youtube-IDs...`); toast.inf(5, `running query for ${yt_ids.size} youtube-IDs...`);
var xhr = new XHR(); var xhr = new XHR();