titulky.com - show release

zobrazi nalevo od titulku release, neni tedy potreba najizdet na kazde titulky po jednom

  1. // ==UserScript==
  2. // @name titulky.com - show release
  3. // @namespace monnef.tk
  4. // @description zobrazi nalevo od titulku release, neni tedy potreba najizdet na kazde titulky po jednom
  5. // @include http://*.titulky.com/*
  6. // @include https://*.titulky.com/*
  7. // @version 2
  8. // @grant none
  9. // @require https://cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js
  10. // ==/UserScript==
  11.  
  12. var debug = false;
  13.  
  14. this.$ = this.jQuery = jQuery.noConflict(true);
  15.  
  16. function onLoad() {
  17. var lightBg = true;
  18. $('table.soupis a.fixedTip').each(function () {
  19. var elem = $(this);
  20. elem.parent()
  21. .css('position', 'relative')
  22. .css('overflow', 'visible')
  23. ;
  24. var release = elem.attr('title');
  25. var newElem = $('<span>')
  26. .text(release)
  27. .css('position', 'absolute')
  28. .css('left', '-57em')
  29. .css('width', '40em')
  30. .css('text-align', 'right')
  31. .css('border-radius', '3px')
  32. .css('height', '1.8em')
  33. .css('top', '0')
  34. .css('background-color', lightBg ? '#eee' : '#ddd')
  35. .css('display', 'flex')
  36. .css('align-items', 'center')
  37. .css('justify-content', 'right')
  38. .css('padding-right', '0.6em')
  39. .attr('title', 'created by monnef - ' + release)
  40. ;
  41. elem.before(newElem);
  42. lightBg = !lightBg;
  43. });
  44. $('div#pagewrap').css('overflow', 'visible'); // fix main wrapper to show elements outside
  45. }
  46.  
  47. $(onLoad);