/*
* @title DQ10思い出アルバムDL補助
* @description DQ10 思い出アルバムダウンロード補助 for DownThemAll
* @include http://*
* @license MIT License
* @require jquery
*/
function procDates(dts, id)
{
let dt = dts.children[0].innerText;
dt = dt.replace("/", "");
dt = dt.replace("/", "");
dt = dt.replace(" ", "-");
dt = dt.replace(":", "");
let place = dts.children[1].innerText;
return dt + "_" + id + "_" + place;
}
function procPics(pcs)
{
let parts = pcs.children[0].href.split("/");
let p1 = parts[5];
let p2 = parts[8].slice(0, -5);
let img = `https://img.dqx.jp/smpicture/download/webpicture/${p1}/xl/${p2}/`;
return img;
}
function procPicsParts(pcs)
{
let parts = pcs.children[0].href.split("/");
let p2 = parts[8].slice(0, -5);
return p2;
}
let dates = $(".a-picture-date");
//console.info(dates);
//console.info(procDates(dates[0]));
let navis = $(".a-picture-navi");
//console.info(navis[1].children[0].href);
//console.info(procPics(navis[1]));
for (i = 0; i < navis.length; ++i) {
let iid = procPicsParts(navis[i]);
let title = procDates(dates[i], iid);
let url = procPics(navis[i]);
let link = "<a href='" + url + "' title='" + title + "'>" + title + "</a>";
$(navis[i]).after(link);
}