なろうのスタイルが変更された
サイレントで、スタイル記述が変更されたみたい。自動栞の機能、動かなくなってしまいました。まあ、クラス付けとか内部仕様なので、変更されても文句は言えないのですが。
というわけで、bookmark.jsの修正
bookmark.js
-------
document.addEventListener("DOMContentLoaded", function() {
const sioris = document.querySelectorAll("input[name=auto_siori]");
sioris.forEach((x) => {
x.setAttribute("name", "auto_siori_x");
});
if (sioris.length > 0) {
const no = sioris[0].attributes["data-no"].value - 0;
const favno = sioris[0].attributes["data-favno"].value - 0;
const url = sioris[0].attributes["data-url"].value;
const primary = sioris[0].attributes["data-primary"].value;
const token = sioris[0].attributes["data-token"].value;
window.mover = () => {
try {
const formData = new FormData();
formData.append('no', no);
formData.append('primary', primary);
formData.append('token', token);
fetch(url, {
method: 'POST',
body: formData,
credentials: "include"
})
.then(response => {
return response.json();
})
.then(data => {
if (data.error.code) {
alert("しおりの更新に失敗しました。")
}
else {
document.querySelector(".js-siori").classList.add("is-active");
}
})
.catch (error => {
alert("しおりの更新に失敗しました。")
});
}
catch (error) {
alert("しおりの更新に失敗しました。");
}
};
const parent = document.querySelector("input.js-delconf_bookmark_submit").parentElement;
let newButton = document.createElement("button");
newButton.setAttribute("type", "button");
newButton.setAttribute("class", "c-button c-button--beige c-button--siori siori_setbtn");
newButton.setAttribute("onclick", "window.mover();this.style.display='none';")
newButton.innerText = "しおりをここへ移動";
parent.insertBefore(newButton, parent.firstChild);
if (no == favno + 1) {
const targetElement = document.querySelectorAll("div.c-pager")[1];
if (targetElement) {
const callback = (entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
// TODO
window.mover();
observer.disconnect();
}
});
};
const options = {
root: null,
rootMargin: '0px',
threshold: 1.0
};
const observer = new IntersectionObserver(callback, options);
observer.observe(targetElement);
}
}
}
});
------
個人的には、もうこれが無いとだめですねえ。
詳細なモバイル(Android)での導入方法の解説と、非ストアでのモジュールの提供とか、やろうかと思ったりもしたのだけれど、需要無いですよねえ。