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のフィルタ機能で、マッチングルールを複数行のテキストエリアに置き換えます。

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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"));
    }
    
});