覺得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\[email protected]\
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