Gmail:Filter Query Area Expander (multi line text area)

Gmail filter query input box replace text area. So you can write down multi lines.Gmailのフィルタ機能で、マッチングルールを複数行のテキストエリアに置き換えます。

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Gmail:Filter Query Area Expander (multi line text area)
// @namespace    http://fruitriin.sakura.ne.jp/
// @version      1.00
// @description  Gmail filter query input box replace text area. So you can write down multi lines.Gmailのフィルタ機能で、マッチングルールを複数行のテキストエリアに置き換えます。
// @author       FruitRiin (果物リン)
// @match        http://mail.google.com/*
// @match        https://mail.google.com/*
// @require      http://code.jquery.com/jquery-2.1.4.min.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/autosize.js/3.0.8/autosize.js
// @grant        none
// ==/UserScript==


$(function(){
    expandFilterBox();
    $(document).on("focus","div.ZZ input",function(){
          expandFilterBox();
    });

    function expandFilterBox(){
        $("div.ZZ input[type=text]").each(function(i,e){
            if($(this).attr("class") == "nr") return true;
            var dir = "";
            if( $(this).attr("dir") !== undefined)
                dir =  "dir="+ $(this).attr("dir");
            $(this).replaceWith("<textarea id="+ $(this).attr("id") +" class=\""+ $(this).attr("class") +"\" "+dir+" style=max-height:140px; >" + $(this).attr("value") + "</textarea>");

        })
        autosize($("div.ZZ textarea"));
    }
    
});