Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Wyszukiwarka panelowa
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @require http://code.jquery.com/jquery-3.2.1.min.js#sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=
- // @grant none
- // @namespace http://iai-shop.com
- // @include http://*.iai-shop.com/panel/main.php*
- // @include https://*.iai-shop.com/panel/main.php*
- // @include //*.iai-shop.com/panel/main.php*
- // @include http://*.iai-shop.com/panel/main-new.php*
- // @include https://*.iai-shop.com/panel/main-new.php*
- // @include //*.iai-shop.com/panel/main-new.php*
- // @include http://*.iai-shop.com/panel/
- // @include https://*.iai-shop.com/panel/
- // @include //*.iai-shop.com/panel/
- // @include http://*.emporium.idosell.com/panel/
- // @include https://*.emporium.idosell.com/panel/
- // @include //*.emporium.idosell.com/panel/
- // ==/UserScript==
- function installCss(css) {
- var head = document.head || document.getElementsByTagName('head')[0];
- var style = document.createElement('style');
- style.type = 'text/css';
- style.appendChild(document.createTextNode(css));
- head.appendChild(style);
- }
- 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;} ';
- installCss(css);
- $('.navbar-menu').after('<div class="menu-filter-wrapper"><input type="text" class="menu-filter"/><ul class="menu-filter-list"></ul></div>')
- $('input.menu-filter').on('keyup', function () {
- var input = $(this);
- var filter = input.val().toUpperCase();
- var ul = $('.sidebar.h-sidebar .nav-list');
- var li = ul.find('li');
- $('.menu-filter-list li').remove();
- li.each(function () {
- if ($(this).find('span').text().toUpperCase().indexOf(filter) > - 1 || $(this).find('a').text().toUpperCase().indexOf(filter) > - 1) {
- var newLi = $(this).clone();
- newLi.find('ul').remove();
- $('.menu-filter-list').append(newLi);
- } else {
- var name = $(this).find('span').text();
- $('.menu-filter-list span:contains(\'' + name + '\')').parents('li').remove();
- }
- });
- if (filter == '') {
- $('.menu-filter-list li').remove();
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement