gavin19

usernameHider

May 23rd, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     go: function() {
  2.         if ((this.isEnabled()) && (this.isMatchURL())) {
  3.             if (this.tryAgain && RESUtils.loggedInUser()) {
  4.                 this.hideUsername();
  5.                 GM_addStyle(RESUtils.css);
  6.             }
  7.             var username = '/' + RESUtils.loggedInUser();
  8.            
  9.             // As these are one-off instances, hide the two user names on the user's
  10.             // profile page and the entry in the moderators list, if any
  11.             $('#header-bottom-left .selected:contains(' + username + '), .titlebox > h1:contains(' + username + '), .helplink ~ .content a:contains(' + username + ')').empty().text(this.options.displayText.value);
  12.             this.hideUsername();
  13.            
  14.             RESUtils.watchForElement('siteTable', modules['usernameHider'].hideUsername);
  15.             RESUtils.watchForElement('newComments', modules['usernameHider'].hideUsername);
  16.         }
  17.     },
  18.     hideUsername: function() {
  19.         var username = '/' + RESUtils.loggedInUser();
  20.         $('.tagline a[href*="' + username + '"], .user > a[href*="' + username + '/"], .titlebox .tagline a.author').empty().text(modules['usernameHider'].options.displayText.value);
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment