VKgrupNum

Показывает нумерацию в поиске групп vk.com

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name VKgrupNum
// @namespace Sanek508 
// @description Показывает нумерацию в поиске групп vk.com
// @match       https://vk.com/groups?act=catalog*
// @include 	https://vk.com*
// @author Sanek508
// @version 0.1
// @grant       none
// ==/UserScript==


   // можете добавить сюда свои сайты для подсветки
   url = ['/alpha-t','/alpha_t','/alphat','/alpha','/remontika38']; /* подсвечиваемый домен */
   var start = 0;
  
    [].forEach.call(document.getElementsByClassName("search_results"), function (e) {
     /* Перебор результатов в блоке выдачи */
     [].forEach.call(e.querySelectorAll(".groups_row"), function (d) {
       start++;
       /* Создание элемента нумерации */
       var t = document.createElement("span");
       t.setAttribute("style", "float:left;margin-left:5px;padding-top:0px;");
       t.innerHTML = start + "";
       d.insertBefore(t, d.firstChild);
       /* Перебор ссылок результата и подсветка url */
		 
       [].forEach.call(d.getElementsByClassName("labeled title"), function (f) {
		  url.forEach(function(item) {
           if (f.innerHTML.match(new RegExp(item, "i"))) {
            // alert(f.innerHTML);
             //f.setAttribute("style", "background:#c4df9b;");
			 d.setAttribute('style', 'border:1px solid #c4df9b');
             [].forEach.call(d.getElementsByClassName("flat_button"), function (g) {
					document.getElementById(g.id).focus();
             });                          
           }
		  });
       });

     });
})