我怎样才能“破解” Thunderbird Lightning 扩展至全彩色类别
(注意:虽然我不完全确定这是否更好地询问超级用户,但我想您可能必须在 xpi/jar 文件中使用 css 设置来搞乱这一事实,应该使其适合 SO .)
Mozilla Thunderbird 的日历扩展 Lightning 将为不同的日历使用不同的颜色,并且仅使用窄竖条作为类别颜色:(浅蓝色作为日历颜色,红色作为类别颜色)
我想知道的是如何改变/“破解”CSS 样式——当然——必须是与此相关的,埋藏在插件目录中的某个位置,因此在上面的示例中,该事件将完全着色为红色。
有人知道如何实现这一目标吗?
(Note: While I'm not entirely sure if this be better asked on SuperUser, I guess the fact that you probably will have to mess around in the xpi/jar file with the css settings, should make it suitable for SO.)
Mozilla Thunderbird's Calendar extension, Lightning, will use different colors for different calendars, and just use a narrow vertical bar for the category color: (Light blue as calendar color and red as category color)
What I would like to find out is how I could go about changing/"hacking" the css styles that - surely - must be associated with this, buried somewhere in the plugin directory, so that in the example above, the event would be fully colored red.
Anyone know how to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
category-overlay.png 图像只是一个渐变叠加,为类别栏提供正确的外观。
这里有两个选择。一种更简单,但不太可靠,另一种则有点困难:
选项 A:简单
在 $profile/chrome/ 目录中创建一个 userChrome.css。它应包含以下内容:
您需要为每个要更改颜色的类别执行此操作。请注意,更改 Lightning 选项中的类别颜色不会更改您在此处设置的类别颜色。
选项 B:更完整
您需要在此处修改 Lightning.xpi 内的一些文件。此解决方案仅需要您在 Lightning 中设置类别颜色,并且也适用于新添加的类别。请注意,这样没有类别的事件是透明的,如果您想要更多,则必须自己完成。
如果您希望查看补丁,这适用于最新的 comm-central 源:
选项 C:更改 Javascript
这将是最好的可行的 hack,尽管它需要 javascript 更改。按照选项B中的描述打开calendar.jar并查看calendar-views.js,有两个函数:
updateStyleSheetForViews()
和updateStyleSheetForCategory()
。我将把它留给那些想要自己修改的人,但想法是为.calendar-color-box[categories~=...]
添加一条规则来覆盖默认值规则以防有类别。这样,如果没有设置类别,则使用日历颜色,否则使用所需的类别颜色。玩得开心 :)
The category-overlay.png image is merely a gradient overlay to give the category bar the right looks.
Two options here. One more easy but not as reliable, the other a bit more difficult:
Option A: Easy
Create a userChrome.css in your $profile/chrome/ directory. It should contain the following:
You'll need to do this for each category you'd like to change the color for. Note that changing the color of the category in the Lightning options won't change the category color you set here.
Option B: More complete
You'll need to modify some files inside lightning.xpi here. This solution merely requires you to set the category colors in Lightning and will also work for newly added categories. Note that this way events without a category are transparent, if you want more you'll have to do it on your own.
If you'd rather see a patch, this applies to the latest comm-central source:
Option C: Change Javascript
This would be the best working hack, although it requires javascript changes. Open calendar.jar as described in Option B and check out calendar-views.js, there are two functions:
updateStyleSheetForViews()
andupdateStyleSheetForCategory()
. I'll leave this to people that want to tinker with it themselves, but the idea would be to add a rule for.calendar-color-box[categories~=...]
that overrides the default rule in case there are categories. This way if there is no category set, the calendar color is used, otherwise the desired category color.Have fun :)
十年后,之前的所有答案要么已经过时,要么过于复杂。
此答案针对最新的 Thunderbird (v102.6.0),支持原生类别颜色,并且仅包含 3 行自定义 CSS。
请请按照以下步骤操作:
按照 这篇文章:
转到
工具>设置>一般>配置编辑器...
,并将toolkit.legacyUserProfileCustomizations.stylesheets
设置为true
。按照 这篇文章:
%APPDATA%\Thunderbird\Profiles\xxxxxxxx.default\
~/.thunderbird/profiles/xxxxxxxx.default/
~/Library/Thunderbird/Profiles/xxxxxxxx.default/
在配置文件文件夹下创建
chrome/userChrome.css
。例如,Windows 的完整路径如下所示:%APPDATA%\Thunderbird\Profiles\xxxxxxxx.default\chrome\userChrome.css
修改
chrome/userChrome.css
以包含以下 CSS:重新启动 Thunderbird
将日历颜色更改为白色以获得更好的视觉效果:
(可选)自定义类别颜色:
转到
工具>设置>日历>类别
并设置自定义类别颜色。全部完成!
将来,如果 Thunderbird 引入重大更改,您可能需要根据
Tools > 中的检查结果稍微修改 CSS。开发者工具>开发者工具箱
。Ten years later, all previous answers are either out-of-date or are too complicated.
This answer targets the latest Thunderbird (v102.6.0), supports native category colors, and only contains 3 lines of custom CSS.
Please follow the steps below:
Unlock custom CSS as mentioned in this post:
Goto
Tools > Settings > General > Config Editor...
, and settoolkit.legacyUserProfileCustomizations.stylesheets
totrue
.Locate your profile folder as mentioned in this post:
%APPDATA%\Thunderbird\Profiles\xxxxxxxx.default\
~/.thunderbird/profiles/xxxxxxxx.default/
~/Library/Thunderbird/Profiles/xxxxxxxx.default/
Create
chrome/userChrome.css
under the profile folder. For example, the full path for Windows will look like:%APPDATA%\Thunderbird\Profiles\xxxxxxxx.default\chrome\userChrome.css
Modify
chrome/userChrome.css
to contain the following CSS:Restart Thunderbird
Change the calendar color to white for better visuals:
(Optional) Customize the category colors:
Goto
Tools > Settings > Calendar > Categories
and set custom category colors.All done!
In the future, if Thunderbird introduce breaking changes, you may need to slightly modify the CSS based on the inspection results in
Tools > Developer Tools > Developer Toolbox
.这个扩展看起来非常适合您想要的功能。
https://addons.mozilla.org/en-us/thunderbird/ addon/calendar-tweaks/
为此,请取消选中所有选项,然后选中这些:
This extension looks perfect for the functionality you want.
https://addons.mozilla.org/en-us/thunderbird/addon/calendar-tweaks/
To have just this, uncheck all the options, and check these:
您应该安装DOM Inspector插件来了解XUL结构一个事件的。与 userChrome.css 一起,您应该能够按照您想要的方式设置其样式。
You should install the DOM Inspector addon to understand the XUL structure of an event. Together with userChrome.css you should be able to style it the way you want it.
每日日历图片
周历图片
所有代码均来自:TOUT SÉLECTIONNER
这是我从法国网站翻译的一个步骤过程。我只是记下对我有用的东西。这是针对雷鸟 3.1.9 的。对于 Lightning-1-1.0b2-tb-macosx.xpi 插件。这些说明编写于 2011 年 4 月 8 日。这些说明专门针对 Mac 用户,尽管您也可以将它们用于 Windows。
全部大写的任何内容都意味着您需要交换自己的信息。示例:[email protected]
第 1 部分:
/* */
包围的文本都不会被 Thunderbird(或任何读取 .css 的内容)识别为代码。它仅作为编码者的符号存在。示例/*TEXT*/
代码:
第 2 部分:现在是复杂的部分 - 一步一步地拆开 Lightning 插件,将其重新组合在一起,并将其作为修改后的插件加载到 Thunderbird 中。
Lightning-1-1.0b2-tb-macosx.zip。或者您可以重命名它。示例:ORIGINALPLUGIN.zip
/content/calendar/calendar-month-view.xml
/content/calendar/calendar-multiday-view.xml
/content/calendar/calendar-view-core.xml
符号“<”意思是删除这一行
符号“>”意味着在它的位置添加这一行
代码由:TOUT SÉLECTIONNER
->日历/内容/日历/calendar-month-view.xml
->日历/内容/日历/calendar-multiday-view.xml
-> calendar/content/calendar/calendar-view-core.xml
第 3 部分:
选择 ORIGINALPLUGIN 文件夹的内容。
<块引用>
日历-js
chrome
chrome.manifest
组件
默认值
install.rdf
模块
timezones.sqlite
右键单击所选项目并选择“压缩 8 个项目”
。 。 。应该就是这样。这对我有用。我会回来看看其他人是否有幸这样做,如果没有,我会仔细检查我的笔记。感谢 TOUT SÉLECTIONNER 编写原始代码。
Image of daily calendar
Image of weekly calendar
ALL CODE BY: TOUT SÉLECTIONNER
This is a several step process that I have translated from a french website. I am simply making a note of what worked for me. This is for thunderbird 3.1.9. for the lightning-1-1.0b2-tb-macosx.xpi plugin. These directions were written April 8th, 2011. These directions are specifically for Mac users, although you can probably use them for windows as well.
Anything in ALL CAPS, means that you need to swap out your own information. Example: [email protected]
Part 1:
/* */
is not recognized as code by thunderbird (or anything that reads .css) It is only there as a notation by the person(s) that coded it. Example/*TEXT*/
The Code:
Part 2: Now comes the complex part - taking apart the lightening plugin, one step at a time, putting it back together and loading it as a modified plugin into Thunderbird.
lightning-1-1.0b2-tb-macosx.zip. Or you can rename it. Example: ORIGINALPLUGIN.zip
/content/calendar/calendar-month-view.xml
/content/calendar/calendar-multiday-view.xml
/content/calendar/calendar-view-core.xml
The symbol "<" means remove this line
The symbol ">" means add this line in it's place
CODE BY: TOUT SÉLECTIONNER
-> calendar/content/calendar/calendar-month-view.xml
-> calendar/content/calendar/calendar-multiday-view.xml
-> calendar/content/calendar/calendar-view-core.xml
Part 3:
Select the contents of the ORIGINALPLUGIN FOLDER.
Right-click the selected items and select "compress 8 items"
. . . and that should be it. It worked for me. I will check back to see if anyone else had luck with this, if not, I will double check my notes.Thanks to TOUT SÉLECTIONNER for writing the oringial code.
只是更新了我用本页上的不同想法做事的方式......
我是“法国邮报”的作者,我只需要另一种反转颜色的方法...
所以这是为了您的高兴(也是我的用户!!)
这是对闪电所做的修改的统一差异输出xpi(更准确地说是里面的calendar.jar包)
你可以在原帖中找到所有信息:
http://www.geckozone.org /forum/viewtopic.php?f=22&t=89384&start=15#p646027
对于非法语人士,这里有一些翻译:
大家好,
这是更正确的更改版本。
与我之前的建议相比,最大的优点是我们不再需要在文件 userChrome.css 中定义类别/日历的颜色,该文件也根本不使用!
总体而言:
对 XML 文件应用更改以允许在 DOM 的各个元素上使用“calendar-id”和“类别”。
更新文件“calendar-views.js”以应用参数化颜色类别和日历,但通过反转它们。
最后,“calendar-views.css”中的一些 css 更改为:
此外,图像 /skin/calendar/category-overlay.png 已展开增加边框的大小...
注意:只需将所有这些东西作为一种选择,但我现在没有时间去看那里...但是如果你们中的一个人能给我一些途径研究,我会尝试一下
:)
文森特
Just updated the way i've done things with the different ideas on this page...
I was the author of the "french post" and I just needed another way to inverse colors...
So there it is for your pleasure (and my users too !!)
This is a unified diff ouptut of the modifications made on the lightning xpi (more precisely the calendar.jar package inside of it)
You may find all the informations on the original post :
http://www.geckozone.org/forum/viewtopic.php?f=22&t=89384&start=15#p646027
For the non french speakers, here is some translation :
Hello everybody,
Here is a more correct version of the changes.
The big plus compared to my previous proposal is that we do not need anymore to define the colors of categories / calendars in the file userChrome.css that is also not used at all!
Overall:
Apply changes to XML files to allow the use of "calendar-id" and "categories" on the various elements of the DOM.
Update the file "calendar-views.js" to apply the parameterized color categories and calendars but by inverting them.
Finally, some css changes in "calendar-views.css" for:
Also, the image /skin/calendar/category-overlay.png has been expanded to increase the size of the border ...
Note: It only remains to put all this stuff as an option, but I did not have time to look over there at the moment ... But if one of you can give me some avenues of research, I will give it a try !
All the best :)
Vincent
感谢 speedballs 的回答 我能够找到控制类别叠加的文件:下面有一个PNG文件:
该文件的宽度为7px,扩大其宽度将放大日历视图中的类别颜色叠加。 (我只是使用 GIMP 对其进行水平缩放。)
因此,使用类别来为整个事件完全着色是不可能,因为它的颜色仅通过覆盖层 png 的“硬连线”像素宽度。Thanks to speedballs answer I was able to locate the file that controls the Category Overlay: There is a PNG file under:
The width of this file is 7px, and enlarging it's width will enlarge the Category Color Overlay in the calendar view. (I just used GIMP to scale it horizontally.)
So it would appear that it is not possible to use the category to fully color the whole event, as it's color is only mapped in via a "hardwired" pixel-width of the overlay png.我不是编程人员,所以我找到了修改代码的方法。
您可以通过创建多个单独的日历(例如,您可以将其称为工作日历、个人日历、生日日历等)来解决这个问题。您可以选择每个日历的背景颜色。如果您使所有日历同时可见(通过选中左侧的日历框),您在每个日历中输入的内容将具有不同的背景颜色,而不仅仅是右侧的条纹。
当您创建新事件时,不要选择类别,而是为类别保留“无”,但在日历下拉菜单中选择一个日历,并将您的事件分配给特定日历(每个日历都有不同的背景颜色)。
唯一的缺点是,如果您想在某个时候导出日历,则需要导出所有单独的日历。但除此之外它是有效的。
I am not a programming person so I found a way around modifying codes.
You can go around that by creating several individual calendars (e.g. that you can call work, personal, birthdays, etc.). You can choose the background color of each calendar. If you make the calendars all visible at the same time (by checking the calendar boxes on the left side), what you enter in each calendar will have a different background color, not just a stripe to the right.
When you create a new event, instead of selecting a category, leave 'none' for category but select a calendar in the calendar dropdown menu and assign your event to a particular calendar (each have different background colors).
The only downside of that is that you need to export all individual calendars if you would like to export your calendars at some point. But otherwise it works.