Patreon Creator Activity Only

Hides non-creator comments on a projects Activity page

  1. // ==UserScript==
  2. // @name Patreon Creator Activity Only
  3. // @namespace https://github.com/ToostInc/userscripts
  4. // @description Hides non-creator comments on a projects Activity page
  5. // @include http://www.patreon.com/*?ty=a
  6. // @version 1.0
  7. // @date 18-08-2014
  8. // @author Joost Bremmer < toost dot b at gmail dot com >
  9. // @copyright 2014, Joost Bremmer
  10. // @licence MIT
  11. // @require http://code.jquery.com/jquery-latest.min.js
  12. // @updateurl https://github.com/ToostInc/userscripts/raw/master/patreon-creator-activity-only/Patreon_Creator_Activity_Only.meta.js
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16.  
  17. // The MIT License
  18. //
  19. // Copyright (c) 2014 Joost Bremmer
  20. //
  21. // Permission is hereby granted, free of charge, to any person obtaining a
  22. // copy of this software and associated documentation files
  23. // (the "Software"), to deal in the Software without restriction,
  24. // including without limitation the rights to use, copy, modify, merge,
  25. // publish, distribute, sublicense, and/or sell copies of the Software, and
  26. // to permit persons to whom the Software is furnished to do so, subject to
  27. // the following conditions:
  28. //
  29. // The above copyright notice and this permission notice shall be included
  30. // in all copies or substantial portions of the Software.
  31. //
  32. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  33. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  34. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  35. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  36. // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  37. // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  38. // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  39. //
  40.  
  41. $(document).ready (function() {
  42.  
  43. //inserting checkbox
  44. var buttan = "<div id='ipressbuttan' class='double box' width='300px' style='background:#ffffff;'><input type='checkbox' id='buttan' checked='checked'>Hide non-creator posts</input></div>";
  45. $("div#inline-post").after(buttan);
  46.  
  47. //adding id to creatorposts and marking them clearly
  48. var creatorurl = location.href.replace(/\?.*/g, "");
  49. $("div.box .boxExtra .infoDiv .info a").each(function(){
  50.  
  51. if ( $(this).attr("href") == creatorurl ) {
  52. $(this).append("&nbsp<img src='http://www.patreon.com/images/patreon_tab.png' width='16' height='16' />").attr("id", "creator");
  53. }
  54. })
  55.  
  56.  
  57.  
  58.  
  59.  
  60. $("#buttan").change(function() {
  61. if ($(this).prop("checked") ) {
  62. //console.log("Hide Comments Checked.");
  63. hideComments();
  64. }
  65. else {
  66. //Show Comments
  67. console.log("Hide Comments Unchecked.")
  68. showComments();
  69. }
  70. });
  71.  
  72.  
  73. });
  74.  
  75. function hideComments() {
  76.  
  77. //for each comment, check if it's a creator's post (or in-line comment box), if not, hide it.
  78. $("div.box .boxExtra .infoDiv .info a").each( function() {
  79.  
  80. //console.log($(this).attr("id"));
  81.  
  82.  
  83. if ( $(this).attr("id") != "creator" ) {
  84. //console.log("This post will be hidden");
  85. $(this).parents("div.box").hide(400);
  86. }
  87.  
  88.  
  89. })
  90.  
  91. console.log("Comments hidden.");
  92. }
  93.  
  94. function showComments() {
  95. $("div.box").show(400);
  96. console.log("Other Comments shown.")
  97.  
  98. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址