search dashboard

shows only posts w specific word(s)

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 search dashboard
// @namespace Violentmonkey Scripts
// @author ghostplantss
// @grant none
// @match *://www.tumblr.com/*
// @description shows only posts w specific word(s)
// @version 1.1
// @require https://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==
// 
// 

var words = ["society"];
(
  function scroll (f) {
  var count = 0;
  window.addEventListener("scroll", ( //every time you scroll
  function fun() //it runs this function!
  {
    $("div.post").each(function() //for each post
    { 
      if(!$(this).hasClass('search'))//if it hasn't been checked already
       {
         count++;
         var boo=true;
         this.className += " search";
          var divs = this.getElementsByTagName('p');
         for(var i = 0; i< divs.length;i++)//it iterates through all paragraphs in the post 
          {
            for(var j = 0; j< words.length;j++)//iterates through the words you want to find
            {
              if(divs[i].innerHTML.indexOf(words[j]) !== -1){boo=false;}//if the word is in the post, you display it
              
             }
          }
         if(boo&&count>1)//make sure word is in post + there's still a post on the dashboard
           {
             $(this).css('display','none');//if the word isn't in the post you hide it 
           }
       }
    });
  }), false);//the end
}

)(window.jQuery);