crowy 未読解除
by
den2sn
2011-10-07 [2011/10/07 11:56:20]
crowy に未読解除ボタンを配置します。 #crowy
-
/*
* @title crowy 未読解除
* @description crowy に未読解除ボタンを配置します。 #crowy
* @include http://www.crowy.net*
* @license MIT License
* @require
*/
(function(){
function setHover() {
this.style.color = '#666';
this.firstChild.style.backgroundPosition = '0 -20px';
}
function delHover() {
this.style.color = '#444';
this.firstChild.style.backgroundPosition = '0 0';
}
var imgDiv = document.createElement('div');
imgDiv.setAttribute('style', 'height: 20px; left: 0; position: absolute; top: 9px; width: 20px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sKBwIbENRPacQAAAINSURBVEjH7VU/a1NxFD1Pgu+cX8D37BDIUOsUKlgyBPINgoVKhmoHW5dUg62DJVuGtA72C1jTKZPd0gp1ChUqVLLlQ9iPkfE6vLwQzZ+2qYuSC5fH793Leece7vsdYBY3jUQiYYPnO7cBSyaTFoYh5h/M90G9acHm5u6b6CAnSFF2Oh1vKsB0Om1iBEInOAntdtsbx9AmMX+4sGCUg0RIgpPD+fdzb9zIgwIPgWYyGYtABPbGbLVav/V5Y8AgCd1ut19/vLRkrgdCEY4Op19Phz46xND37/ZEdiCFy8ufXi6Xsz4rJ4hCs9kcKcvQy1QqZXIOIuHkQAlO7D0d6Iijz0djNR5ZyGazFq/Cn9loNCZuxtjik+XlvmaSIBL1w8Mr12zsn/Lt7MwLggBBECIIw2uBzWIW/00Ui8W/5ylrz9fsXhCgXC7f3lM2Nl6aRNAnKEIkPuzvT+cpm682TRRIgozAaru73siRFxcf2SSwt9vbFgYhoosjyhhsaORsNmtiNMLFxY8h9pVKxWJWFCGfeLezM9pT8vm8SQLpw2fU3Dw+7ter1arFesVjvtnamuwpxWLRBkX2RRx8PPDe7+2Z37tkY4alUul6nlJ+XbaYRcREGDyTwvr6i5t5Sq1WM0nw6fdYKUoRz1ZXp/OU+qe6UT5IQSJ8Ck9XVq5cs4kNJ19OIk1JFAqFmaf8q/ELSGZyYHHakXMAAAAASUVORK5CYII=) 0 0 no-repeat;');
var buttonName = document.createElement('div');
buttonName.innerHTML = '既読';
buttonName = buttonName.firstChild;
var link = document.createElement('a');
link .setAttribute('href', 'javascript:(function(){$(\'.new-count\').click()})()');
link .setAttribute('style', 'text-decoration: none; height: 16px; color: #444; padding-left: 24px; text-shadow: 0 1px 0 white; line-height: 37px;');
link.addEventListener('mouseover', setHover, true);
link.addEventListener('mouseout', delHover, true);
link.appendChild(imgDiv);
link.appendChild(buttonName);
var button = document.createElement('div');
button.setAttribute('id', 'reset-count');
button.setAttribute('style', 'float: left; height: 37px; font-size: 12px; font-weight: bolder; line-height: 100%; margin: 0 8px; position: relative;');
button.setAttribute('title', '既読');
button.appendChild(link);
var buttons = document.getElementById('tab-tool-bar');
buttons.appendChild(button);
})();
-
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。