diff options
author | anekos | 2012-08-04 22:37:19 +0900 |
---|---|---|
committer | anekos | 2012-08-04 22:37:19 +0900 |
commit | 1ed5a77f467e13ad2a55d2dafbedc2c799789b23 (patch) | |
tree | dc2f1667a1c3953d1510e8ffb3bfa6545488ee06 /twittperator | |
parent | dc48a35efc665ef5011abb97bed188faa3c72824 (diff) | |
download | vimperator-plugins-1ed5a77f467e13ad2a55d2dafbedc2c799789b23.tar.bz2 |
Highlight protected user on twsidebar.
Diffstat (limited to 'twittperator')
-rw-r--r-- | twittperator/twsidebar.tw | 12 | ||||
-rw-r--r-- | twittperator/twsidebar/chrome/content/twsidebar.css | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/twittperator/twsidebar.tw b/twittperator/twsidebar.tw index a9cc9ce..13f5b06 100644 --- a/twittperator/twsidebar.tw +++ b/twittperator/twsidebar.tw @@ -125,9 +125,12 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { XML.ignoreWhitespace = true; let xml; let sbWidth = getSidebarWindow().document.width; + let richlistitemClasses = [className('tweet-panel'), className('tweet-' + t.type)]; + if (t.protected) + richlistitemClasses.push(className('tweet-protected')); xml = <richlistitem - class={[className('tweet-panel'), className('tweet-' + t.type)].join(' ')} + class={richlistitemClasses.join(' ')} style={[ "font-size: " + px(Config.fontSize - (t.text.length > 70 ? 2 : 0)), "width: " + px(sbWidth - 100) + ' !important' @@ -283,6 +286,8 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { || (msg.direct_message); + let protected = msg.user && msg.user.protected; + // Fav test try { //liberator.log(JSON.stringify(msg, null, 2)); @@ -291,7 +296,8 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { name: '>' + msg.target_object.user.screen_name + '<', img: msg.target_object.user.profile_image_url, text: msg.target_object.text, - type: 'favorite' + type: 'favorite', + protected: protected }; appendTweet(t, 'home', streamName); } @@ -377,6 +383,8 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { } if (t) { + t.protected = protected; + if (Config.earthquake && /\u5730\u9707/.test(t.text) && msg.text.length < 20 && msg.user && msg.user.location) { t.text += ' [\u5730\u57DF: ' + msg.user.location + ']'; } diff --git a/twittperator/twsidebar/chrome/content/twsidebar.css b/twittperator/twsidebar/chrome/content/twsidebar.css index b835c3d..7081ea2 100644 --- a/twittperator/twsidebar/chrome/content/twsidebar.css +++ b/twittperator/twsidebar/chrome/content/twsidebar.css @@ -11,6 +11,10 @@ padding-left: 2px; } +.tw-anekos-sb-plugin-tweet-protected { + background-color: lightgray !important; +} + .tw-anekos-sb-plugin-tweet-DM-my { background-color: darkred !important; color: white !important; |