Show2TaobaoSearchBox

Show 2.taobao.com SearchBox

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         Show2TaobaoSearchBox
// @name:zh-CN   闲鱼显示搜索栏
// @namespace    BlueFire
// @version      0.1
// @description  Show 2.taobao.com SearchBox
// @description:zh-CN  显示闲鱼的搜索栏
// @author       BlueFire
// @include      https://2.taobao.com/*
// @include      http://2.taobao.com/*
// @include      https://s.2.taobao.com/*
// @include      http://s.2.taobao.com/*
// @grant        unsafeWindow
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    window.onload = function(){
    var header = document.getElementById("J_IdleHeader");
    console.log(header.innerHTML);
    var searchBoxHtml = "<div class=\"idle-search\">" + 
  "<form method=\"get\" action=\"//s.2.taobao.com/list/list.htm\" name=\"search\" target=\"_top\">" + 
    "<input class=\"input-search\" id=\"J_HeaderSearchQuery\" name=\"q\" type=\"text\" value=\"\" placeholder=\"搜闲鱼\" />" + 
    "<input type=\"hidden\" name=\"search_type\" value=\"item\" autocomplete=\"off\" />" + 
    "<input type=\"hidden\" name=\"app\" value=\"shopsearch\" autocomplete=\"off\" />" + 
    "<button class=\"btn-search\" type=\"submit\"><i class=\"iconfont\">&#xe602;</i><span class=\"search-img\"></span></button>" + 
  "</form>" + 
"</div>";
    header.innerHTML += searchBoxHtml;
    var search_filters = document.getElementsByClassName("search-filters")[0];
    search_filters.style.display = "block";
};
})();