🏠 返回首頁 

Greasy Fork is available in English.

AO3 clone fic title, author, and summary at bottom

Duplicate the information of fic title, author and summary at the bottom of the page (Note this was an early script in the development of my AO3 Re-read Savior script)


安装此脚本?
  1. // ==UserScript==
  2. // @name AO3 clone fic title, author, and summary at bottom
  3. // @namespace https://greasyfork.org/en/users/876643-elli-lili-lunch
  4. // @version 1.0
  5. // @description Duplicate the information of fic title, author and summary at the bottom of the page (Note this was an early script in the development of my AO3 Re-read Savior script)
  6. // @author Elli-lili-lunch, based off work from scriptfairy
  7. // @include /https?://archiveofourown\.org/works/\d+/
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12. (function($) {
  13. $(document).ready(function() {
  14. // new attempt
  15. var summary = $('div.preface .summary').clone();
  16. $('#feedback').parent().after(summary);
  17. var author = $('div.preface .byline').clone();
  18. //$('#feedback').parent().after(author);
  19. var format = " by "
  20. //$('#feedback').parent().after(format);
  21. var title = $('div.preface .title.heading').clone();
  22. $('#feedback').parent().after(author); + $('#feedback').parent().after(format); + $('#feedback').parent().after(title);
  23. //document.write("test text") #completely overwrote entire page //more research has been done, looks like this is mostly jquery lol
  24. var words = $('.meta .stats dl dd.words').clone();
  25. $('#feedback').parent().after(words);
  26. //var wordlabel = "Words: "
  27. $('#feedback').parent().after("Words: ");
  28. });
  29. })(window.jQuery);
  30. // var test = $('div.preface').clone();
  31. // $('#feedback').parent().after(test);
  32. // old:
  33. //var summary = $('div.preface .summary').clone();
  34. //$('#feedback').parent().after(summary);
  35. ///var author = $('div.preface .byline').clone();
  36. //$('#feedback').parent().after(author);
  37. //var title = $('div.preface .title.heading').clone();
  38. //$('#feedback').parent().after(title);
  39. /*
  40. would be neato frito if upon clicking "bookmark(?) if it was empty, the box would autopopulate with:
  41. title by author
  42. summary: text
  43. ^^ ideal format
  44. potential: (learned from http://www.tizag.com/javascriptT/javascriptif.php)
  45. var bookmark_content = //locate variable from AO3 to identify bookmark box contents;
  46. if(bookmark_content == "null"){
  47. document.write("insert formatted reference info now");
  48. }else{
  49. //dont' do anything ig
  50. }
  51. // If the length of the element's string is 0 then display helper message
  52. function notEmpty(elem, helperMsg){
  53. if(elem.value.length == 0){
  54. alert(helperMsg);
  55. elem.focus(); // set the focus to this input
  56. return false;
  57. }
  58. return true;
  59. }
  60. */
  61. /* IMPORTANT TO IDENITFY ELEMENTS FROM AO3:
  62. words: $('.meta .stats dl dd.words');
  63. current bookmark text:
  64. <textarea rows="4" id="bookmark_notes" class="observe_textlength"
  65. aria-describedby="notes-field-description" name="bookmark[bookmarker_notes]"></textarea>
  66. author: $('div.preface .byline')
  67. title: $('div.preface .title.heading')
  68. */