Advertisement
opsftw

[PLUGIN] Set Nicknames in Slack

Aug 24th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.42 KB | None | 0 0
  1. // * * * * * * * *
  2. // *    About    *
  3. // * * * * * * * *
  4. // Author: Andrew J. Blalock
  5. // Date: 8/24/2017
  6. // Description: Set Nicknames in Slack's desktop application.
  7. //
  8. // * * * * * * * * *
  9. // *  INSTRUCTIONS *
  10. // * * * * * * * * *
  11. // Append this to the end of the file:
  12. // C:\Users\{USERNAME}\AppData\Local\slack\app-{SLACK-VERSION}\resources\app.asar.unpacked\src\static\ssb-interop.js
  13. //
  14. // Add entries in the array 'nicks'. The first value it the persons
  15. // display name, and the second is the nickname to display for them.
  16.  
  17. var nicks = [
  18.   ["Name1", "Nickname1"],
  19.   ["Name2", "Nickname2"],
  20.   ["Name3", "Nickname3"]
  21. ];
  22.  
  23. document.addEventListener('DOMContentLoaded', function() {
  24.     $.each( nicks, function( key, value ) {
  25.         $("<script></script>").appendTo('head').html('$(document).ready(function(){ \
  26.             $("*").mouseover(function() { $(".p-channel_sidebar__name:contains(\'' + value[0] + '\'):not(:contains(\',\'))").each(function(){$(this).text(\'' + value[1] + '\');});}); \
  27.             $("*").mouseover(function() { $(".p-channel_sidebar__name:contains(\',\')").each(function(){$(this).css("color", "#5876a7");});}); \
  28.             $("*").mouseover(function() { $("a.message_sender:contains(\'' + value[0] + '\')").each(function(){$(this).text("' + value[1] + '");}); }); \
  29.             $("*").mouseover(function() { $("button#im_title:contains(\'' + value[0] + '\')").each(function(){$(this).text("' + value[1] + '");}); });});');
  30.     });
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement