Advertisement
Sahuagin

Hide annoying elements on GameFAQs

Aug 31st, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Hide annoying elements on GameFAQs
  3. // @namespace    MyUserScripts
  4. // @version      0.1
  5. // @description  Hide annoying elements on GameFAQs
  6. // @author       Sahuagin
  7. // @match        https://gamefaqs.gamespot.com/boards/*
  8. // @exclude      https://gamefaqs.gamespot.com/boards/*/*
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. var $;
  13. (($) => {
  14.    if (!$) {
  15.       console.log("No JQuery!");
  16.       return;
  17.    }
  18.  
  19.    const smallPadding = "4px";
  20.  
  21.    $("<style>").html(`
  22.       .board_search,
  23.       .topic_filter {
  24.          display: none;
  25.       }
  26.    `).appendTo("head");
  27.  
  28.    $("<style>").html(`
  29.       #gs_search_results #results_table tr td,
  30.       #faq_search_results #results_table tr td,
  31.       #game_search_results #results_table tr td {
  32.          padding: ${smallPadding};
  33.       }
  34.    `).appendTo("head");
  35.  
  36.    $(() => {
  37.       $("#gamespace_search_input").css("padding", `${smallPadding} ${smallPadding} ${smallPadding} 42px`);
  38.       $("#gamespace_search button").css("top", smallPadding);
  39.  
  40.       const buttonList = $("div.body ul");
  41.       const newButton = $("<li><a>Search</a></li>");
  42.       newButton.on("click", () => {
  43.          $(".board_search").toggle(400);
  44.          $(".board_search").css("overflow", "");
  45.          $(".board_search input").focus();
  46.       });
  47.       buttonList.append(newButton);
  48.    });
  49. })($ || ($ = window.jQuery));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement