Created
May 15, 2009 22:18
-
-
Save hail2u/112465 to your computer and use it in GitHub Desktop.
えこ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Gomidashi | |
// @namespace http://hail2u.net/ | |
// @description eco. | |
// @include http://mail.google.com/* | |
// @include https://mail.google.com/* | |
// ==/UserScript== | |
window.addEventListener('load', function () { | |
var garbageSchedule = [ | |
["-"], // 日曜日 | |
["燃やせるゴミ", "生ゴミ"], | |
["紙", "布"], | |
["ペットボトル"], | |
["燃やせるゴミ", "生ゴミ"], | |
["缶", "びん", "蛍光管", "電球", "乾電池", "その他プラスチック", "燃やせないごみ"], | |
["容器包装プラスチック", "使用済み食用油"] //土曜日 | |
]; | |
if (unsafeWindow.gmonkey) { | |
unsafeWindow.gmonkey.load('1.0', function (gmail) { | |
var masthead = gmail.getMastheadElement(); | |
var searchBox = masthead.getElementsByTagName("input")[0]; | |
var garbageTypes = garbageSchedule[new Date(Date.now() + 14 * 60 * 60 * 1000).getDay()].join("、"); | |
window.setTimeout(function () { | |
if (!searchBox.value) { | |
searchBox.addEventListener("focus", function (e) { | |
this.select(); | |
}, false); | |
searchBox.value = garbageTypes; | |
} | |
}, 1000); | |
}); | |
} | |
}, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment