Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Wyszukiwarka panelowa
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @require http://code.jquery.com/jquery-3.2.1.min.js#sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=
  8. // @grant none
  9. // @namespace http://iai-shop.com
  10. // @include http://*.iai-shop.com/panel/main.php*
  11. // @include https://*.iai-shop.com/panel/main.php*
  12. // @include //*.iai-shop.com/panel/main.php*
  13.  
  14. // @include http://*.iai-shop.com/panel/main-new.php*
  15. // @include https://*.iai-shop.com/panel/main-new.php*
  16. // @include //*.iai-shop.com/panel/main-new.php*
  17.  
  18. // @include http://*.iai-shop.com/panel/
  19. // @include https://*.iai-shop.com/panel/
  20. // @include //*.iai-shop.com/panel/
  21.  
  22. // @include http://*.emporium.idosell.com/panel/
  23. // @include https://*.emporium.idosell.com/panel/
  24. // @include //*.emporium.idosell.com/panel/
  25.  
  26. // ==/UserScript==
  27. function installCss(css) {
  28. var head = document.head || document.getElementsByTagName('head')[0];
  29. var style = document.createElement('style');
  30. style.type = 'text/css';
  31. style.appendChild(document.createTextNode(css));
  32. head.appendChild(style);
  33. }
  34. var css = '.menu-filter-wrapper {width: 20%;display: inline;float: left;margin-top: 7px;} .menu-filter-wrapper .cell a {background: none !important;} .menu-filter {width: 100%;} .menu-filter-wrapper .cell { list-style-type: none;} ';
  35. installCss(css);
  36. $('.navbar-menu').after('<div class="menu-filter-wrapper"><input type="text" class="menu-filter"/><ul class="menu-filter-list"></ul></div>')
  37.  
  38. $('input.menu-filter').on('keyup', function () {
  39. var input = $(this);
  40. var filter = input.val().toUpperCase();
  41. var ul = $('.sidebar.h-sidebar .nav-list');
  42. var li = ul.find('li');
  43.  
  44. $('.menu-filter-list li').remove();
  45.  
  46. li.each(function () {
  47. if ($(this).find('span').text().toUpperCase().indexOf(filter) > - 1 || $(this).find('a').text().toUpperCase().indexOf(filter) > - 1) {
  48. var newLi = $(this).clone();
  49. newLi.find('ul').remove();
  50. $('.menu-filter-list').append(newLi);
  51. } else {
  52. var name = $(this).find('span').text();
  53. $('.menu-filter-list span:contains(\'' + name + '\')').parents('li').remove();
  54. }
  55. });
  56.  
  57. if (filter == '') {
  58. $('.menu-filter-list li').remove();
  59. }
  60. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement