Hatena::Letに検索の四角いやつを出す

  • /*
     * @title Hatena::Letに検索の四角いやつを出す
     * @description 「ようこそ(アイコン)(ID)さん!」の左のあたりに出てくるので場所は妥当でもはっきり見えない(←うるさい)
     * @include http://let.hatelabo.jp*
     * @license MIT License
     * @require http://oauth.googlecode.com/svn/code/javascript/oauth.js
     * @require http://oauth.googlecode.com/svn/code/javascript/sha1.js
     */
    
    /*
    //https://www.google.co.jp/search?q=+site%3Alet.hatelabo.jp%2F+-%22http%3A%2F%2Flet.hatelabo.jp%2F%22
    document.getElementById('logo').outerHTML+='<form style="float:center" action="#" id="__search" accept-charset="utf-8"><input type="text" name="q"/></form>';
    if(location.pathname.match('^/$')){
    	
    }*/
    if (location.host == "let.hatelabo.jp") {
    	document.querySelectorAll('.menu')[0].innerHTML ='<li class="search"><form action="#" id="search_" style="display:inline;"><input type="text" id="search_q"></form></li>'+ document.querySelectorAll('.menu')[0].innerHTML;
    	document.getElementById('search_').addEventListener('submit',(function() {
    				window.open("https://www.google.co.jp/search?q="
    						+ encodeURIComponent(
    								document.getElementById('search_q').value)
    						+ "&as_sitesearch=let.hatelabo.jp/");
    			}), false);
    }
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2013/04/20 19:19:37 - 2013-04-20
  2. 2013/04/20 19:19:17 - 2013-04-20
  3. 2013/04/20 19:18:36 - 2013-04-20
  4. 2013/04/20 19:15:18 - 2013-04-20
  5. 2013/04/20 19:04:51 - 2013-04-20
  6. 2013/04/20 19:04:11 - 2013-04-20
  7. 2013/04/17 15:10:21 - 2013-04-17
  8. 2013/04/17 15:09:50 - 2013-04-17