73xt0vitb

Wikia Greasemonkey

Oct 17th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Wikia
  3. // @namespace   wikia
  4. // @description De-clutters Wikia pages
  5. // @include     http://*.wikia.com/*
  6. // @version     1
  7. // @grant       GM_Log
  8. // @run-at      document-start
  9. // @require     https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
  10. // ==/UserScript==
  11.  
  12. // 'use strict';
  13.  
  14. // (function ($) {
  15. //  $(document).ready(function () {
  16. //      console.log('test');
  17. //  });
  18. // })(window.$);
  19.  
  20. var runInterval = setInterval(run, 200);
  21.  
  22. function run() {
  23.     var globalLogo = $('.wds-global-navigation__logo');
  24.    
  25.     if (globalLogo.length) {
  26.         changeLogo();
  27.         clearInterval(runInterval);
  28.     }
  29. }
  30.  
  31. function changeLogo() {
  32.     var globalLogo = $('.wds-global-navigation__logo');
  33.     var img = $('#WikiHeader .wordmark a img').attr('src');
  34.     var link = $('#WikiHeader .wordmark a').attr('href');
  35.  
  36.     $('.wds-global-navigation__logo-fandom').remove();
  37.     globalLogo.append($('<img>').attr('src', img).attr('height', '45'));
  38.     globalLogo.attr('href', link);
  39. }
Advertisement
Add Comment
Please, Sign In to add comment