欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

尝试写了一个thunderbird插件

程序员文章站 2022-07-15 08:25:06
...

觉得thunderbird做个note工具很不错,但是每次新建一个mail,上面的from, to 都好大啊。。。
google了N次,想找个addon,但是没找到,打算自己做一个

下载了tb8.2源码,Highlighter 插件参考

Thunderbird's user interface is written in XUL and JavaScript

    https://developer.mozilla.org/en/Extensions/Thunderbird
        Tutorial: Building a Thunderbird extension , 就是读的这个..赞,读完就懂了
        content   Highlighter                 chrome/content/                                                                                                      
        skin      Highlighter   classic/1.0   chrome/skin/
        locale    Highlighter   en-GB         chrome/locale/en-GB/
        locale    Highlighter   en-US         chrome/locale/en-US/
        locale    Highlighter   fr-FR         chrome/locale/fr-FR/
        locale    Highlighter   sv-SE         chrome/locale/sv-SE/

        # Overlay and styles for the formatting toolbar
        style      chrome://messenger/content/messengercompose/messengercompose.xul    chrome://highlighter/skin/format-tb.css
        overlay    chrome://messenger/content/messengercompose/messengercompose.xul    chrome://highlighter/content/format-tb.xul
        (表示把后面一个文件 merge到前面一个文件, 前面一个是tb标准的xml, 在tb源码 /comm-beta/mail/components/compose/content/messengercompose.xul)
    messengercompose.xul:
              这个被merge进去.
    安装测试方法
        直接放在:
            .thunderbird/vmejnq0q.default/extensions/resizer-compose-header/
        Using a text file to reference your extension files (recommended):
            The file must contain a single line with the absolute path of the extension:
            C:\Documents and Settings\\My Documents\Code\Thunderbird Extensions\myfirstext@jen.zed\
            The text file's name must be exactly the same as the id of the  field in the install.rdf file.
    packaging 发布:
        Zip the contents of your extension's folder (not the extension folder itself), and rename the zip file to have a .xpi extension.

         cd ~/extensions/my_extensions
         zip -r ../sample.xpi *


工具:

    To view this XUL file use theDOM Inspector extension or look inside the omni.jar archive
    sdk:其实不用sdk了, 上面的步骤都不需要sdk  https://addons.mozilla.org/en-US/developers/tools/builder
        有online: offline
    addon: developer assister


我需要的功能关键在于:

  var headerToolbar = document.getElementById("MsgHeadersToolbar");                                                                                        
  headerToolbar.minHeight = headerToolbar.boxObject.height;

所以我的实现:


var resizer =
{
    is_hidden : 0,
    toggleHeader : function(){
        if (!resizer.is_hidden){
            document.getElementById("headers-box").setAttribute("hidden", "true");
            resizer.is_hidden = 1;
        }else {
            document.getElementById("headers-box").setAttribute("hidden", "false");
            resizer.is_hidden = 0;
        }
    }
}
完事~~ 睡觉

具体代码见:
https://idning.googlecode.com/svn/trunk/langtest/thunderbird/resizer-compose-header@idning


尝试写了一个thunderbird插件
            
    
    博客分类: 作品  

 

 

 

尝试写了一个thunderbird插件
            
    
    博客分类: 作品  

  • 尝试写了一个thunderbird插件
            
    
    博客分类: 作品  
  • 大小: 21.9 KB
  • 尝试写了一个thunderbird插件
            
    
    博客分类: 作品  
  • 大小: 79.9 KB