E-H Auto Note Favourites

Fills the notes section with the gallery's tags

Stan na 20-10-2017. Zobacz najnowsza wersja.

  1. // ==UserScript==
  2. // @name E-H Auto Note Favourites
  3. // @description Fills the notes section with the gallery's tags
  4. // @author Hen Tie
  5. // @homepage http://hen-tie.tumblr.com/
  6. // @namespace https://greasyfork.org/en/users/8336
  7. // @include http://e-hentai.org/gallerypopups.php?gid=*
  8. // @include https://e-hentai.org/gallerypopups.php?gid=*
  9. // @include http://exhentai.org/gallerypopups.php?gid=*
  10. // @include https://exhentai.org/gallerypopups.php?gid=*
  11. // @include http://e-hentai.org/g/*
  12. // @include https://e-hentai.org/g/*
  13. // @include http://exhentai.org/g/*
  14. // @include https://exhentai.org/g/*
  15. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
  16. // @icon https://i.imgur.com/RPv1X1r.png
  17. // @version 4.1
  18. // ==/UserScript==
  19.  
  20. /*╔════════════════╦═════════════════════════╦═══════════════════╦════════════════════╗
  21. ║ Namespace List ║ Includes & Ordering ║ Excluded Tags ║ Tag Filtering ║
  22. ╠════════════════╬═════════════════════════╬═══════════════════╬════════════════════╣
  23. ║ reclass ║ Ordered namespace list. ║ full censorship ║ List of tag names ║
  24. ║ language ║ Edit line 49. ║ mosaic censorship ║ Edit line 51 ║
  25. ║ parody ║ Format: ║ incomplete ║ Format: ║
  26. ║ character ║ female + male; ║ out of order ║ (/tag1|tag2/g, '') ║
  27. ║ group ║ ║ scanmark ║ ║
  28. ║ artist ║ ║ poor grammar ║ ║
  29. ║ male ║ ║ ║ ║
  30. ║ female ║ ║ ║ ║
  31. ║ misc ║ ║ ║ ║
  32. ╚════════════════╩═════════════════════════╩═══════════════════╩════════════════════╝*/
  33.  
  34. jQuery(document).ready(function ($) {
  35. $("#taglist table td:contains('misc:')").attr('id', 'miscid');
  36. //onclick in popup window
  37. $('input[type="radio"][name="favcat"]').click(function () {
  38. //naviate to parent window, get all tags, delineate with zero-width spaces
  39. //this is the on-site order
  40. var reclass = $('#taglist a[id^="ta_reclass"]', window.opener.document).append('​').text();
  41. var language = $('#taglist a[id^="ta_language"]', window.opener.document).append('​').text();
  42. var parody = $('#taglist a[id^="ta_parody"]', window.opener.document).append('​').text();
  43. var character = $('#taglist a[id^="ta_character"]', window.opener.document).append('​').text();
  44. var group = $('#taglist td[class=""]+td a[id^="ta_group"]', window.opener.document).append('​').text();
  45. var artist = $('#taglist a[id^="ta_artist"]', window.opener.document).append('​').text();
  46. var male = $('#taglist a[id^="ta_male"]', window.opener.document).append('​').text();
  47. var female = $('#taglist a[id^="ta_female"]', window.opener.document).append('​').text();
  48. //helper script needed: greasyfork.org/en/scripts/8281
  49. var misc = $('#taglist td#miscid+td a', window.opener.document).append('​').text();
  50. //set included tags and their order
  51. //var str = parody + group + artist + female + male + misc;
  52. var str = reclass + language + parody + character + group + artist + male + female + misc;
  53. //set tags to remove
  54. str = str.replace(/full censorship|mosaic censorship|incomplete|out of order|scanmark|poor grammar/g, '');
  55. //convert to underscored tag format
  56. str = str.replace(/ /g, '_');
  57. //delineate tags with commas
  58. str = str.replace(/\u200B/g, ', ');
  59. //prevent double commas
  60. str = str.replace(/(, )+/g, ', ');
  61. //remove comma from final tag
  62. str = str.substr(0, str.length - 2);
  63. $('textarea').val(str);
  64. });
  65. //erases notes when remove button is clicked
  66. $('div[onclick*="favdel"]').click(function () {
  67. $('textarea').val('');
  68. });
  69. });