`
idning
  • 浏览: 135435 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

尝试写了一个thunderbird插件

 
阅读更多

觉得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


 

 

 

  • 大小: 21.9 KB
  • 大小: 79.9 KB
分享到:
评论
1 楼 idning 2011-10-16  
今天加了一个选择 颜色的 下拉框.

相关推荐

Global site tag (gtag.js) - Google Analytics