我怎样才能“破解” Thunderbird Lightning 扩展至全彩色类别

发布于 2024-10-20 12:48:33 字数 363 浏览 2 评论 0原文

(注意:虽然我不完全确定这是否更好地询问超级用户,但我想您可能必须在 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)

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

冬天的雪花 2024-10-27 12:48:33

category-overlay.png 图像只是一个渐变叠加,为类别栏提供正确的外观。

这里有两个选择。一种更简单,但不太可靠,另一种则有点困难:

选项 A:简单

在 $profile/chrome/ 目录中创建一个 userChrome.css。它应包含以下内容:

.calendar-color-box[categories~="mycategory"],
.calendar-event-box-container[categories~="mycategory"] { 
   background-color: #abc123 !important;
}

您需要为每个要更改颜色的类别执行此操作。请注意,更改 Lightning 选项中的类别颜色不会更改您在此处设置的类别颜色。

选项 B:更完整

您需要在此处修改 Lightning.xpi 内的一些文件。此解决方案仅需要您在 Lightning 中设置类别颜色,并且也适用于新添加的类别。请注意,这样没有类别的事件是透明的,如果您想要更多,则必须自己完成。

  1. 使用zip程序打开lightning.xpi
  2. 进入目录chrome/
  3. 使用zip程序打开包含的calendar.jar
  4. 下降到content/calendar/
  5. 打开calendar-multiday-view.xml
    • 搜索“calendar-color-box”并将其从类属性中删除
    • 上面几行有一个;标签,添加 class="category-color-box" 到它
  6. calendar-month-view.xml 和 calendar-view-core.xml 并执行相同的操作
  7. 将文件保存回 calendar.jar
  8. 将 calendar.jar 保存回 Lightning。 xpi
  9. 安装修改后的 lighting.xpi

如果您希望查看补丁,这适用于最新的 comm-central 源:

diff --git a/calendar/base/content/calendar-month-view.xml b/calendar/base/content/calendar-month-view.xml
--- a/calendar/base/content/calendar-month-view.xml
+++ b/calendar/base/content/calendar-month-view.xml
@@ -52,21 +52,20 @@

 <bindings id="calendar-month-view-bindings"
   xmlns="http://www.mozilla.org/xbl"
   xmlns:html="http://www.w3.org/1999/xhtml"
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   xmlns:xbl="http://www.mozilla.org/xbl">

   <binding id="calendar-month-day-box-item" extends="chrome://calendar/content/calendar-view-core.xml#calendar-editable-item">
-    <content mousethrough="never" tooltip="itemTooltip">
+    <content mousethrough="never" tooltip="itemTooltip" class="category-color-box">
       <xul:vbox flex="1">
         <xul:hbox>
           <xul:box anonid="event-container"
-                   class="calendar-color-box"
                    xbl:inherits="calendar-uri,calendar-id"
                    flex="1">
             <xul:box class="calendar-event-selection" orient="horizontal" flex="1">
               <xul:stack anonid="eventbox"
                          class="calendar-event-box-container"
                          xbl:inherits="readonly,flashing,alarm,allday,priority,progress,status,calendar,categories"
                          flex="1">
                 <xul:hbox class="calendar-event-details">
diff --git a/calendar/base/content/calendar-multiday-view.xml b/calendar/base/content/calendar-multiday-view.xml
--- a/calendar/base/content/calendar-multiday-view.xml
+++ b/calendar/base/content/calendar-multiday-view.xml
@@ -2119,20 +2119,19 @@
       ]]></handler>
     </handlers>
   </binding>

   <!--
      -  An individual event box, to be inserted into a column.
     -->
   <binding id="calendar-event-box" extends="chrome://calendar/content/calendar-view-core.xml#calendar-editable-item">
-    <content mousethrough="never" tooltip="itemTooltip">
+    <content mousethrough="never" tooltip="itemTooltip" class="category-color-box">
         <xul:box xbl:inherits="orient,width,height" flex="1">
           <xul:box anonid="event-container"
-                   class="calendar-color-box"
                    xbl:inherits="orient,readonly,flashing,alarm,allday,priority,progress,status,calendar,categories,calendar-uri,calendar-id"
                    flex="1">
             <xul:box class="calendar-event-selection" orient="horizontal" flex="1">
               <xul:stack anonid="eventbox"
                          align="stretch"
                          class="calendar-event-box-container"
                          flex="1"
                          xbl:inherits="context,parentorient=orient,readonly,flashing,alarm,allday,priority,progress,status,calendar,categories">
diff --git a/calendar/base/content/calendar-view-core.xml b/calendar/base/content/calendar-view-core.xml
--- a/calendar/base/content/calendar-view-core.xml
+++ b/calendar/base/content/calendar-view-core.xml
@@ -46,21 +46,21 @@
     xmlns="http://www.mozilla.org/xbl"
     xmlns:html="http://www.w3.org/1999/xhtml"
     xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     xmlns:xbl="http://www.mozilla.org/xbl">

   <binding id="calendar-editable-item">
     <content mousethrough="never"
              tooltip="itemTooltip"
-             tabindex="-1">
+             tabindex="-1"
+             class="category-color-box">
       <xul:vbox flex="1">
         <xul:hbox>
           <xul:box anonid="event-container"
-                   class="calendar-color-box"
                    xbl:inherits="calendar-uri,calendar-id"
                    flex="1">
             <xul:box class="calendar-event-selection" orient="horizontal" flex="1">
               <xul:stack anonid="eventbox"
                          class="calendar-event-box-container"
                          flex="1"
                          xbl:inherits="readonly,flashing,alarm,allday,priority,progress,status,calendar,categories">
                 <xul:hbox class="calendar-event-details">

选项 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:

.calendar-color-box[categories~="mycategory"],
.calendar-event-box-container[categories~="mycategory"] { 
   background-color: #abc123 !important;
}

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.

  1. Open lightning.xpi with a zip program
  2. Enter the directory chrome/
  3. Open the containing calendar.jar with a zip program
  4. Descend into content/calendar/
  5. Open calendar-multiday-view.xml
    • search "calendar-color-box" and remove it from the class attribute
    • a few lines above there is a <content> tag, add class="category-color-box" to it
  6. Open calendar-month-view.xml and calendar-view-core.xml and do the same
  7. Save the files back to calendar.jar
  8. Save calendar.jar back to lightning.xpi
  9. Install the modified lightning.xpi

If you'd rather see a patch, this applies to the latest comm-central source:

diff --git a/calendar/base/content/calendar-month-view.xml b/calendar/base/content/calendar-month-view.xml
--- a/calendar/base/content/calendar-month-view.xml
+++ b/calendar/base/content/calendar-month-view.xml
@@ -52,21 +52,20 @@

 <bindings id="calendar-month-view-bindings"
   xmlns="http://www.mozilla.org/xbl"
   xmlns:html="http://www.w3.org/1999/xhtml"
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   xmlns:xbl="http://www.mozilla.org/xbl">

   <binding id="calendar-month-day-box-item" extends="chrome://calendar/content/calendar-view-core.xml#calendar-editable-item">
-    <content mousethrough="never" tooltip="itemTooltip">
+    <content mousethrough="never" tooltip="itemTooltip" class="category-color-box">
       <xul:vbox flex="1">
         <xul:hbox>
           <xul:box anonid="event-container"
-                   class="calendar-color-box"
                    xbl:inherits="calendar-uri,calendar-id"
                    flex="1">
             <xul:box class="calendar-event-selection" orient="horizontal" flex="1">
               <xul:stack anonid="eventbox"
                          class="calendar-event-box-container"
                          xbl:inherits="readonly,flashing,alarm,allday,priority,progress,status,calendar,categories"
                          flex="1">
                 <xul:hbox class="calendar-event-details">
diff --git a/calendar/base/content/calendar-multiday-view.xml b/calendar/base/content/calendar-multiday-view.xml
--- a/calendar/base/content/calendar-multiday-view.xml
+++ b/calendar/base/content/calendar-multiday-view.xml
@@ -2119,20 +2119,19 @@
       ]]></handler>
     </handlers>
   </binding>

   <!--
      -  An individual event box, to be inserted into a column.
     -->
   <binding id="calendar-event-box" extends="chrome://calendar/content/calendar-view-core.xml#calendar-editable-item">
-    <content mousethrough="never" tooltip="itemTooltip">
+    <content mousethrough="never" tooltip="itemTooltip" class="category-color-box">
         <xul:box xbl:inherits="orient,width,height" flex="1">
           <xul:box anonid="event-container"
-                   class="calendar-color-box"
                    xbl:inherits="orient,readonly,flashing,alarm,allday,priority,progress,status,calendar,categories,calendar-uri,calendar-id"
                    flex="1">
             <xul:box class="calendar-event-selection" orient="horizontal" flex="1">
               <xul:stack anonid="eventbox"
                          align="stretch"
                          class="calendar-event-box-container"
                          flex="1"
                          xbl:inherits="context,parentorient=orient,readonly,flashing,alarm,allday,priority,progress,status,calendar,categories">
diff --git a/calendar/base/content/calendar-view-core.xml b/calendar/base/content/calendar-view-core.xml
--- a/calendar/base/content/calendar-view-core.xml
+++ b/calendar/base/content/calendar-view-core.xml
@@ -46,21 +46,21 @@
     xmlns="http://www.mozilla.org/xbl"
     xmlns:html="http://www.w3.org/1999/xhtml"
     xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     xmlns:xbl="http://www.mozilla.org/xbl">

   <binding id="calendar-editable-item">
     <content mousethrough="never"
              tooltip="itemTooltip"
-             tabindex="-1">
+             tabindex="-1"
+             class="category-color-box">
       <xul:vbox flex="1">
         <xul:hbox>
           <xul:box anonid="event-container"
-                   class="calendar-color-box"
                    xbl:inherits="calendar-uri,calendar-id"
                    flex="1">
             <xul:box class="calendar-event-selection" orient="horizontal" flex="1">
               <xul:stack anonid="eventbox"
                          class="calendar-event-box-container"
                          flex="1"
                          xbl:inherits="readonly,flashing,alarm,allday,priority,progress,status,calendar,categories">
                 <xul:hbox class="calendar-event-details">

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() and updateStyleSheetForCategory(). 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 :)

稀香 2024-10-27 12:48:33

十年后,之前的所有答案要么已经过时,要么过于复杂。

此答案针对最新的 Thunderbird (v102.6.0),支持原生类别颜色,并且仅包含 3 行自定义 CSS。

之前https://i.sstatic.net/
在此处输入图像描述在此处输入图像描述

请请按照以下步骤操作:

  1. 按照 这篇文章

    转到工具>设置>一般>配置编辑器...,并将 toolkit.legacyUserProfileCustomizations.stylesheets 设置为 true

    在此输入图像描述

    在此输入图像描述

  2. 按照 这篇文章

    • Windows:%APPDATA%\Thunderbird\Profiles\xxxxxxxx.default\
    • Linux:~/.thunderbird/profiles/xxxxxxxx.default/
    • Mac:~/Library/Thunderbird/Profiles/xxxxxxxx.default/

    在配置文件文件夹下创建chrome/userChrome.css。例如,Windows 的完整路径如下所示:%APPDATA%\Thunderbird\Profiles\xxxxxxxx.default\chrome\userChrome.css

    修改 chrome/userChrome.css 以包含以下 CSS:

    .calendar-category-box {
        宽度:100%!重要;
    }
    
  3. 重新启动 Thunderbird

  4. 将日历颜色更改为白色以获得更好的视觉效果:

    在此输入图像描述

    在此输入图像描述

  5. (可选)自定义类别颜色:

    转到工具>设置>日历>类别并设置自定义类别颜色。

    在此输入图像描述

  6. 全部完成!

将来,如果 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.

BeforeAfter
enter image description hereenter image description here

Please follow the steps below:

  1. Unlock custom CSS as mentioned in this post:

    Goto Tools > Settings > General > Config Editor..., and set toolkit.legacyUserProfileCustomizations.stylesheets to true.

    enter image description here

    enter image description here

  2. Locate your profile folder as mentioned in this post:

    • Windows: %APPDATA%\Thunderbird\Profiles\xxxxxxxx.default\
    • Linux: ~/.thunderbird/profiles/xxxxxxxx.default/
    • Mac: ~/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:

    .calendar-category-box {
        width: 100% !important;
    }
    
  3. Restart Thunderbird

  4. Change the calendar color to white for better visuals:

    enter image description here

    enter image description here

  5. (Optional) Customize the category colors:

    Goto Tools > Settings > Calendar > Categories and set custom category colors.

    enter image description here

  6. 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.

哀由 2024-10-27 12:48:33

这个扩展看起来非常适合您想要的功能。

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:

  • apply category color to event backgruonds
  • use calendar color if no category color
苍白女子 2024-10-27 12:48:33

您应该安装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.

风追烟花雨 2024-10-27 12:48:33

每日日历图片

周历图片

所有代码均来自:TOUT SÉLECTIONNER

这是我从法国网站翻译的一个步骤过程。我只是记下对我有用的东西。这是针对雷鸟 3.1.9 的。对于 Lightning-1-1.0b2-tb-macosx.xpi 插件。这些说明编写于 2011 年 4 月 8 日。这些说明专门针对 Mac 用户,尽管您也可以将它们用于 Windows。


全部大写的任何内容都意味着您需要交换自己的信息。示例:[email protected]

第 1 部分:

  1. 找到您的个人资料文件夹。类似于: MachintoshHD/Users/YOURUSERNAME/Library/Thunderbird/Profiles/RANDOMLETTERS.default
  2. 在此处创建一个名为“chrome”的文件夹
  3. 创建一个名为 userChrome.css 的文件并将其保存到 chrome 文件夹中。您可以使用常规文本编辑器创建 .css 文件,只要它具有 .css 扩展名即可。我使用了 Dreamweaver、一个名为 JEdit 的免费程序和文本编辑 - 对我来说一切都很好。
  4. 您将在 CSS 文件内粘贴以下代码。 (请注意,任何由 /* */ 包围的文本都不会被 Thunderbird(或任何读取 .css 的内容)识别为代码。它仅作为编码者的符号存在。示例/*TEXT*/

代码:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */

.calendar-event-box-container[categories] { margin: 1px !important;} /* add margin to the category-box */
.calendar-color-box:not([categories]) { color: black !important; background-color: #A6A6A6 !important;} /* events without category will appear grey */
calendar-category-box:not([categories]) { display: block !important; } /* category-box always displayed even if event doesn't have a category */

/* 2- using the calendar uri (much better) */
.category-color-box[calendar-uri="http://my.caldav.server/path/to/file"]{ background-color: #FF0000 !important; display:block !important; float:right;}
/* display the category-box with the specified color (forced color of the calendar) */

/* for each category, assign a forced color 
each category must be spelled lowercase in the css, spaces replaced with '_'
I didn't make any test with accents... but they may work (lowercase, spaces -> _) eg: "Appel Téléphonique" -> "appel_téléphonique"
*/
.calendar-color-box[categories="CATEGORY_NAME1"] { color: black !important; background-color: #CCCCFF !important;}
.calendar-color-box[categories="CATEGORY_NAME2"] { color: black !important; background-color: #FF99FF !important;}
.calendar-color-box[categories="CATEGORY_NAME3"] { color: black !important; background-color: #FF0000 !important;}
.calendar-color-box[categories="CATEGORY_NAME4"] { color: black !important; background-color: #CC33CC !important;}
.calendar-color-box[categories="CATEGORY_NAME5"] { color: black !important; background-color: #0000FF !important;}

第 2 部分:现在是复杂的部分 - 一步一步地拆开 Lightning 插件,将其重新组合在一起,并将其作为修改后的插件加载到 Thunderbird 中。

  1. 下载 Thunderbird 的 Lightning 插件(lightning-1-1.0b2-tb-macosx.xpi)。它的扩展名为 .xip
  2. 文件,右键单击该文件,然后单击。 “获取信息”并将扩展名更改为 .zip 而不是 .xpi 它应该如下所示。
    Lightning-1-1.0b2-tb-macosx.zip。或者您可以重命名它。示例:ORIGINALPLUGIN.zip
  3. 双击文件将其解压缩。如果这不起作用,您可能需要下载解压软件(例如stuffit Expander for mac)。
  4. 在该文件夹中,找到 calendar.jar 文件。您可以在这里找到它:ORIGINAPLUGIN FOLDER/chrome/calendar.jar
  5. 将calendar.jar 重命名为calendar.zip,解压该文件。
  6. 现在您需要找到另外三个文件(将它们复制到新区域中。)

    /content/calendar/calendar-month-view.xml

    /content/calendar/calendar-multiday-view.xml

    /content/calendar/calendar-view-core.xml
  7. 使用 JEdit 等程序在这些文件中进行以下编辑。

    符号“<”意思是删除这一行

    符号“>”意味着在它的位置添加这一行

    代码由:TOUT SÉLECTIONNER

->日历/内容/日历/calendar-month-view.xml

Line 64
<                    xbl:inherits="calendar-uri,calendar-id"
>                    xbl:inherits="calendar-uri,calendar-id,categories"
Line 95
<                     <xul:calendar-category-box anonid="category-box" xbl:inherits="categories" pack="end"/>
>                     <xul:calendar-category-box anonid="category-box" xbl:inherits="categories,calendar-uri" pack="end"/>

->日历/内容/日历/calendar-multiday-view.xml

Line 2135
<                   <xul:calendar-category-box anonid="category-box" xbl:inherits="categories" pack="end" />
>                   <xul:calendar-category-box anonid="category-box" xbl:inherits="categories,calendar-uri" pack="end" />

-> calendar/content/calendar/calendar-view-core.xml

Line 59
<                    xbl:inherits="calendar-uri,calendar-id"
>                    xbl:inherits="calendar-uri,calendar-id,categories"
Line 84
<                                                xbl:inherits="categories"
>                                                xbl:inherits="categories,calendar-uri"
Line 394
<                 xbl:inherits="categories">
>                 xbl:inherits="categories,calendar-uri">

第 3 部分:

  1. 更改完成后保存每个文件。
  2. 替换解压后的日历文件夹中的原始文件
  3. 选择“skin”和“content”文件夹。右键单击并选择“压缩 2 项”。如果您压缩文件夹而不是单个文件,则这可能不起作用。
  4. 重命名该文件 calendar.jar
  5. 将原始的 calendar.jar 文件替换为您刚刚创建的新文件。 (请参阅第 2 部分的步骤 4) ORIGINALPLUGIN FOLDER/chrome/calendar.jar
  6. 选择 ORIGINALPLUGIN 文件夹的内容。

    <块引用>

    日历-js
    chrome

    chrome.manifest
    组件

    默认值
    install.rdf

    模块
    timezones.sqlite

  7. 右键单击所选项目并选择“压缩 8 个项目”

  8. 将 zip 文件重命名为 ANYNAMEYOUWANT。 xpi 例如,您可以将其命名为 moddedLightningPlug.xpi
  9. 加载插件:打开 Thunderbird>Tools>Add-ons>Plugins>install
  10. 找到 ANYNAMEYOUWANT.xpi 文件,让它加载,然后重新启动 Thunderbird。

。 。 。应该就是这样。这对我有用。我会回来看看其他人是否有幸这样做,如果没有,我会仔细检查我的笔记。感谢 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:

  1. Find your profile folder. Something similar to: MachintoshHD/Users/YOURUSERNAME/Library/Thunderbird/Profiles/RANDOMLETTERS.default
  2. Create a folder in here called "chrome"
  3. Create a file called userChrome.css and save it into the chrome folder. You can create a .css file with a regular text editor, as long as it has a .css extention. I used dreamweaver, and a free program called JEdit, and text edit - all worked fine for me.
  4. Inside of the CSS file you will paste the code below. (Note any text surrounded by /* */ 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:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */

.calendar-event-box-container[categories] { margin: 1px !important;} /* add margin to the category-box */
.calendar-color-box:not([categories]) { color: black !important; background-color: #A6A6A6 !important;} /* events without category will appear grey */
calendar-category-box:not([categories]) { display: block !important; } /* category-box always displayed even if event doesn't have a category */

/* 2- using the calendar uri (much better) */
.category-color-box[calendar-uri="http://my.caldav.server/path/to/file"]{ background-color: #FF0000 !important; display:block !important; float:right;}
/* display the category-box with the specified color (forced color of the calendar) */

/* for each category, assign a forced color 
each category must be spelled lowercase in the css, spaces replaced with '_'
I didn't make any test with accents... but they may work (lowercase, spaces -> _) eg: "Appel Téléphonique" -> "appel_téléphonique"
*/
.calendar-color-box[categories="CATEGORY_NAME1"] { color: black !important; background-color: #CCCCFF !important;}
.calendar-color-box[categories="CATEGORY_NAME2"] { color: black !important; background-color: #FF99FF !important;}
.calendar-color-box[categories="CATEGORY_NAME3"] { color: black !important; background-color: #FF0000 !important;}
.calendar-color-box[categories="CATEGORY_NAME4"] { color: black !important; background-color: #CC33CC !important;}
.calendar-color-box[categories="CATEGORY_NAME5"] { color: black !important; background-color: #0000FF !important;}

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.

  1. Download the lightning plugin for thunderbird (lightning-1-1.0b2-tb-macosx.xpi). It will have a .xpi extension.
  2. An .xip file is the same thing as a zip file. Right-click the file, click on "get info" and change the extension to .zip instead of .xpi. It should look like this
    lightning-1-1.0b2-tb-macosx.zip. Or you can rename it. Example: ORIGINALPLUGIN.zip
  3. Unzip the file by double-clicking on it. If this does not work, you may need to download an unzipping software (such as stuffit expander for mac).
  4. Inside the folder, find the calendar.jar file. You can find it here: ORIGINALPLUGIN FOLDER/chrome/calendar.jar
  5. Rename calendar.jar to calendar.zip, unzip this file.
  6. Now you need to find three more files (copy them into a new area.)

    /content/calendar/calendar-month-view.xml

    /content/calendar/calendar-multiday-view.xml

    /content/calendar/calendar-view-core.xml
  7. Make the following edits in these files using a program such as JEdit.

    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

Line 64
<                    xbl:inherits="calendar-uri,calendar-id"
>                    xbl:inherits="calendar-uri,calendar-id,categories"
Line 95
<                     <xul:calendar-category-box anonid="category-box" xbl:inherits="categories" pack="end"/>
>                     <xul:calendar-category-box anonid="category-box" xbl:inherits="categories,calendar-uri" pack="end"/>

-> calendar/content/calendar/calendar-multiday-view.xml

Line 2135
<                   <xul:calendar-category-box anonid="category-box" xbl:inherits="categories" pack="end" />
>                   <xul:calendar-category-box anonid="category-box" xbl:inherits="categories,calendar-uri" pack="end" />

-> calendar/content/calendar/calendar-view-core.xml

Line 59
<                    xbl:inherits="calendar-uri,calendar-id"
>                    xbl:inherits="calendar-uri,calendar-id,categories"
Line 84
<                                                xbl:inherits="categories"
>                                                xbl:inherits="categories,calendar-uri"
Line 394
<                 xbl:inherits="categories">
>                 xbl:inherits="categories,calendar-uri">

Part 3:

  1. Once the changes are made save each file.
  2. Replace the original files in the unzipped calendar folder
  3. Select the "skin" and "content" folders. Right-click and select "compress 2 items". If you zip the folder and not the individual files, this may not work.
  4. Rename this file calendar.jar
  5. Replace the original calendar.jar file with the new one you just created. (see Part 2, step 4) ORIGINALPLUGIN FOLDER/chrome/calendar.jar
  6. Select the contents of the ORIGINALPLUGIN FOLDER.

    Calendar-js
    chrome

    chrome.manifest
    components

    defaults
    install.rdf

    modules
    timezones.sqlite

  7. Right-click the selected items and select "compress 8 items"

  8. Rename the zip file to ANYNAMEYOUWANT.xpi For instance you can name it modifiedLightningPlug.xpi
  9. Load the plug-in: Open thunderbird>Tools>Add-ons>Plugins>install
  10. Locate the ANYNAMEYOUWANT.xpi file, let it load, and restart Thunderbird.

. . . 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.

恬淡成诗 2024-10-27 12:48:33

只是更新了我用本页上的不同想法做事的方式......
我是“法国邮报”的作者,我只需要另一种反转颜色的方法...

所以这是为了您的高兴(也是我的用户!!)

这是对闪电所做的修改的统一差异输出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 更改为:

    • 始终显示边框和 1 像素的边距(我认为渲染效果更好......)
    • 未分类事件采用灰色 (# ACACAC ")
    • 选择元素时仅更改日历的颜色(即右边框)(通过添加属性“.calendar-event-box-container”)

此外,图像 /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:

    • Always show the border and a margin of 1px (rendering is better I think ...)
    • A gray color (# ACACAC ") to the uncategorized events
    • Change only the color of the calendar (ie the right border) when selecting an element (by adding the property ".calendar-event-box-container")

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

清晰传感 2024-10-27 12:48:33

感谢 speedballs 的回答 我能够找到控制类别叠加的文件:下面有一个PNG文件:

....\extensions\{e2fda1a4-762b-4020-b5ad-a41df1933103}\chrome\calendar.jar\
    skin\calendar\category-overlay.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:

....\extensions\{e2fda1a4-762b-4020-b5ad-a41df1933103}\chrome\calendar.jar\
    skin\calendar\category-overlay.png

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.

梦中楼上月下 2024-10-27 12:48:33

我不是编程人员,所以我找到了修改代码的方法。

您可以通过创建多个单独的日历(例如,您可以将其称为工作日历、个人日历、生日日历等)来解决这个问题。您可以选择每个日历的背景颜色。如果您使所有日历同时可见(通过选中左侧的日历框),您在每个日历中输入的内容将具有不同的背景颜色,而不仅仅是右侧的条纹。

当您创建新事件时,不要选择类别,而是为类别保留“无”,但在日历下拉菜单中选择一个日历,并将您的事件分配给特定日历(每个日历都有不同的背景颜色)。

唯一的缺点是,如果您想在某个时候导出日历,则需要导出所有单独的日历。但除此之外它是有效的。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文