你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/470448-ao3-re-read-savior-bookmark-tracker-rekudos-converter-mark-for-later-subscribe-buttons-at-bop/discussions/309135,源站連結 點此以跳轉。
Userscripts for an optimized and efficient AO3 experience, particularly rereading. This includes automatically populating bookmark notes with fic title, author, workID and summary alongside whatever existing bookmark notes. Also adds tags based on word count and fic completion status. Converts re-clicks of the Kudos button into a "rekudos" comment. Adds the "subscribe" and "mark for later/mark as read" buttons to the end of the fic.
hey been using this for a while its super useful however ao3 have recently changed the mark for later button and the part of the script that shows the mark for later button in the blurb of a fic now just redirects to an error page do you know if there is any way to fix this happening or could you help thank you so much for making this script its super useful and before the ao3 update it was working perfectly
Got a little help figuring out a solution that works for me. Replace the entire code in the section about the Marked for Later in works to:
var $j = jQuery.noConflict();
$j(document).ready(function() {
// 1. Get the anti-forgery token from the site header
var authToken = $j('meta[name="csrf-token"]').attr('content');
// 2. Loop through works and add the button
// Note: Changed `$` to `$j` in the selector to avoid conflicts
var links = $j("li[role=article] > .header > .heading:first-child > a[href*='/works']");
links.each(function() {
var link = $j(this);
var workUrl = link.attr("href");
// We add a specific class 'mark-later-btn' to hook into later
var buttonHtml = '' +
'Mark For Later' +
'';
link.closest(".header").nextAll(".stats").before(buttonHtml);
});
// 3. Handle the click event globally
$j(document).on('click', '.mark-later-btn', function(e) {
e.preventDefault(); // Stop the link from opening a new page/404
var btn = $j(this);
var url = btn.attr('href');
// Send the POST request with the PATCH method and Token
$j.ajax({
type: "POST",
url: url,
data: {
_method: 'patch', // Rails treats this as a PATCH request
authenticity_token: authToken
},
success: function(data) {
// visual feedback
btn.text("Marked!");
btn.css("color", "green");
btn.css("pointer-events", "none"); // Prevent double-clicking
},
error: function(xhr, status, error) {
console.error("Error marking for later:", error);
btn.text("Error");
btn.css("color", "red");
}
});
});
});
hey been using this for a while its super useful however ao3 have recently changed the mark for later button and the part of the script that shows the mark for later button in the blurb of a fic now just redirects to an error page do you know if there is any way to fix this happening or could you help thank you so much for making this script its super useful and before the ao3 update it was working perfectly