diff options
author | anekos | 2013-01-21 20:27:43 +0900 |
---|---|---|
committer | anekos | 2013-01-21 20:27:43 +0900 |
commit | e475b9252de46119d2bab176c2e2b30ebdccb4bd (patch) | |
tree | e246d097299a21098c9b1070c0a51091c955feff | |
parent | 7c95e94a0037da2098c173bae2972ea230212cb3 (diff) | |
parent | 334c1ad154d3edfb27eba18c583cf4fc40f6cd08 (diff) | |
download | vimperator-plugins-e475b9252de46119d2bab176c2e2b30ebdccb4bd.tar.bz2 |
Merge branch 'twsidebar/sub-on-bottom'
-rw-r--r-- | twittperator/twsidebar.tw | 21 | ||||
-rw-r--r-- | twittperator/twsidebar/chrome/content/twsidebar.css | 23 |
2 files changed, 34 insertions, 10 deletions
diff --git a/twittperator/twsidebar.tw b/twittperator/twsidebar.tw index fccdfa6..ee8ba3b 100644 --- a/twittperator/twsidebar.tw +++ b/twittperator/twsidebar.tw @@ -56,9 +56,6 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { // サイドバーが閉じていても、こっそり開始しておく silentStart: false, - // 時間とかRTした人のIDとかの表示 - tweetTimeVisible: false, - // 配列かオブジェクトを返すと、変更できる。 // 文字列 "reject" を返すと、そもそもツイートが表示されなくなる。 modifier: function (msg, tab, streamName) { @@ -129,7 +126,7 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { let xml; let sbWidth = getSidebarWindow().document.width; let richlistitemClasses = [className('tweet-panel'), className('tweet-' + t.type)]; - let nameClass = t.protected ? className('tweet-protected') : ''; + let nameClass = className('item-name') + ' ' + (t.protected ? className('tweet-protected') : ''); xml = <richlistitem id={t.id} @@ -145,11 +142,15 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { </vbox> <vbox flex="1"> <hbox flex="1"> - <label class={nameClass} style="font-weight: bold">{escapeBreakers(t.name)}</label> - <spacer flex="1"/> - {(Config.tweetTimeVisible && t.sub) ? t.sub : ''} + <label flex="2" class={nameClass}>{escapeBreakers(t.name)}</label> + <spacer hidden={!(t.sub || t.time)} /> + <description flex="1" class={className('item-time-and-sub')} hidden={!(t.sub || t.time)}>{escapeBreakers(t.sub || t.time)}</description> + </hbox> + <description flex="1" class={className('item-text')}>{escapeBreakers(t.text)}</description> + <hbox> + <description flex="1" class={className('item-sub')} hidden={!t.sub}>{escapeBreakers(t.sub || '')}</description> + <description flex="1" class={className('item-time')} hidden={!t.time}>{escapeBreakers(t.time || '')}</description> </hbox> - <description flex="1" style="word-break:break-all;">{escapeBreakers(t.text)}</description> </vbox> </hbox> </richlistitem>; @@ -396,8 +397,8 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { t.text += ' [\u5730\u57DF: ' + msg.user.location + ']'; } - if (!t.sub && msg.created_at) { - t.sub = new Date(msg.created_at).toLocaleTimeString().replace(/:\d+$/,'');; + if (msg.created_at) { + t.time = new Date(msg.created_at).toLocaleTimeString().replace(/:\d+$/,'');; } if (real && dummy) { diff --git a/twittperator/twsidebar/chrome/content/twsidebar.css b/twittperator/twsidebar/chrome/content/twsidebar.css index 7081ea2..e431b3b 100644 --- a/twittperator/twsidebar/chrome/content/twsidebar.css +++ b/twittperator/twsidebar/chrome/content/twsidebar.css @@ -52,3 +52,26 @@ .tw-anekos-sb-plugin-tweet-follow-my { background-color: lightsalmon !important; } + +.tw-anekos-sb-plugin-item-name { + font-weight: bold; +} + +.tw-anekos-sb-plugin-item-text { + word-break: break-all; +} + +.tw-anekos-sb-plugin-item-sub { + background-color: pink; + font-size: 80%; +} + +.tw-anekos-sb-plugin-item-time { + font-size: 80%; +} + +.tw-anekos-sb-plugin-item-time-and-sub { + font-size: 80%; + display: none; +} + |