crowy 未読解除
by
den2sn
2011-10-07 [2011/10/07 11:56:20]
crowy に未読解除ボタンを配置します。 #crowy
@@ -8,19 +8,24 @@
(function(){
function setHover() {
- this.className = this.className + " ui-state-hover";
+ this.style.color = '#666';
}
function delHover() {
- this.className = this.className.substring(0, this.className.length - 15);
+ this.style.color = '#444';
}
- var button = document.createElement('a');
- button.setAttribute('href', 'javascript:(function(){$(\'.new-count\').click()})()');
- button.setAttribute('class', 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only');
- button.setAttribute('role', 'button');
- button.innerHTML = '<span class="ui-button-text">既読</span>';
- button.addEventListener('mouseover', setHover, true);
- button.addEventListener('mouseout', delHover, true);
+ var link = document.createElement('a');
+ link .setAttribute('href', 'javascript:(function(){$(\'.new-count\').click()})()');
+ link .setAttribute('style', 'text-decoration: none; height: 16px; color: #444; text-shadow: 0 1px 0 white; line-height: 37px;');
+ link.innerHTML = '既読';
+ link.addEventListener('mouseover', setHover, true);
+ link.addEventListener('mouseout', delHover, true);
- var buttons = document.getElementById('command-menu').firstChild.nextSibling;
+ 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);
})();
/*
* @title crowy 未読解除
* @description crowy に未読解除ボタンを配置します。 #crowy
* @include http://www.crowy.net*
* @license MIT License
* @require
*/
(function(){
function setHover() {
this.style.color = '#666';
}
function delHover() {
this.style.color = '#444';
}
var link = document.createElement('a');
link .setAttribute('href', 'javascript:(function(){$(\'.new-count\').click()})()');
link .setAttribute('style', 'text-decoration: none; height: 16px; color: #444; text-shadow: 0 1px 0 white; line-height: 37px;');
link.innerHTML = '既読';
link.addEventListener('mouseover', setHover, true);
link.addEventListener('mouseout', delHover, true);
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 です。