Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for TB 57+ #11

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
colorfolders
ColorFolders Revived
============

Color Folders the Thunderbird Add On
Color Folders the Thunderbird Add On...Revived.

Please see below for detail:

[https://addons.mozilla.org/thunderbird/addon/color-folders/](https://addons.mozilla.org/thunderbird/addon/color-folders/)
[https://addons.mozilla.org/thunderbird/addon/color-folders/](https://addons.mozilla.org/thunderbird/addon/color-folders/)
1 change: 1 addition & 0 deletions chrome.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ skin colorfolders classic/1.0 chrome/skin/aero/ os=WINNT osversion>=6
locale colorfolders en-US locale/en-US/
locale colorfolders en-GB locale/en-GB/
locale colorfolders ja-JP locale/ja-JP/
locale colorfolders fr-FR locale/fr-FR/
overlay chrome://messenger/content/messenger.xul chrome://colorfolders/content/colorfolders.xul
style chrome://messenger/content/messenger.xul chrome://colorfolders/content/colorfolders.css
32 changes: 16 additions & 16 deletions chrome/colorfolders.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(!com.fisheater.colorFolders) com.fisheater.colorFolders = {};
com.fisheater.colorFolders = {
init: function() {
window.removeEventListener("load", com.fisheater.colorFolders.init, false);

// override getCellProperties()
gFolderTreeView.originalGetCellProperties = gFolderTreeView.getCellProperties;
gFolderTreeView.getCellProperties = function(row, col) {
Expand All @@ -28,19 +28,19 @@ com.fisheater.colorFolders = {
if (compatibility) {
folderColor = compatibility;
}

// save folder color
props += " " + folderColor;
}
}
return props;
}
// end of override

// addEventListener for onPopupShowing for folderPaneContext
var elm = document.getElementById("folderPaneContext");
elm.addEventListener("popupshowing", com.fisheater.colorFolders.onPopupShowing, false);

// addEventListener for onCommand for folderColorPopup
elm = document.getElementById("folderColorPopup");
elm.addEventListener("command", com.fisheater.colorFolders.setFolderColor, false);
Expand All @@ -64,13 +64,13 @@ com.fisheater.colorFolders = {
folderColor = "";
}
}

// apply for all selected folders
var folders = gFolderTreeView.getSelectedFolders();
for each (var folder in folders) {
for (let folder of folders) {
folder.setStringProperty("folderColor", folderColor)
}

// close popup
// necessary as selecting colorpicker does not close popup
// must be here otherwise 'selectedFolders' are lost and gets back to previous selection
Expand All @@ -90,7 +90,7 @@ com.fisheater.colorFolders = {
| nsMsgFolderFlags.Archive | nsMsgFolderFlags.Junk | nsMsgFolderFlags.Queue;
var folders = gFolderTreeView.getSelectedFolders();
var type = "";
for each (var folder in folders) {
for (let folder of folders) {
if ( folder.isServer || folder.flags & specialFolderFlagsMask ) {
// to disable menu "folderPaneContext-colorFolders" if any one of folders is special
type = "special";
Expand All @@ -105,7 +105,7 @@ com.fisheater.colorFolders = {
type = "normal";
break;
}
}
}
else if ( folder.server.type == "nntp" || folder.server.type == "rss" ) {
// to have standard folder icons in popup if not all types are the same
if (type == "") {
Expand All @@ -131,20 +131,20 @@ com.fisheater.colorFolders = {
if (type == "virtual" ) {
// having virtual folder icons in popup if all folders are virtual
aPopup.setAttribute("class", "folderColorVirtual", "");
}
}
else if (type == "rss" ) {
// having rss folder icons in popup if all folders are rss
aPopup.setAttribute("class", "folderColorRss", "");
}
}
else if (type == "nntp" ) {
// having nntp folder icons in popup if all folders are nntp
aPopup.setAttribute("class", "folderColorNntp", "");
}
}
else {
// having standard folder icons in popup if any one of folders is normal
aPopup.setAttribute("class", "folderColorDefault", "");
}

// set "More Colors..." menu an icon
var folderColor = document.getElementById("folderColorPicker").color;
folderColor = "folderColor" + folderColor.substring( 1, 7 );
Expand All @@ -153,7 +153,7 @@ com.fisheater.colorFolders = {
}
}
},

compatibility: {
folderColorG0: "folderColorCCCCCC",
folderColorG1: "folderColor999999",
Expand All @@ -167,7 +167,7 @@ com.fisheater.colorFolders = {
folderColorViolet: "folderColor6633FF",
folderColorMagenta: "folderColorCC33CC"
}

};

window.addEventListener("load", com.fisheater.colorFolders.init, false);
window.addEventListener("load", com.fisheater.colorFolders.init, false);
Binary file added dist/colorfolders.xpi
Binary file not shown.
19 changes: 13 additions & 6 deletions install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,47 @@

<Description about="urn:mozilla:install-manifest">
<em:type>2</em:type>
<em:name>Color Folders</em:name>
<em:name>Color Folders Revived</em:name>
<em:description>Color Folder Treeview Icons.</em:description>

<em:id>[email protected]</em:id>
<em:creator>fisheater</em:creator>
<em:version>1.1</em:version>
<em:version>2.0</em:version>
<em:iconURL>chrome://colorfolders/content/colorfolders.png</em:iconURL>
<em:localized>
<Description>
<em:locale>en-US</em:locale>
<em:name>Color Folders</em:name>
<em:name>Color Folders Revived</em:name>
<em:description>Color Folder Treeview Icons.</em:description>
</Description>
</em:localized>
<em:localized>
<Description>
<em:locale>en-GB</em:locale>
<em:name>Colour Folders</em:name>
<em:name>Colour Folders Revived</em:name>
<em:description>Colour Folder Treeview Icons.</em:description>
</Description>
</em:localized>
<em:localized>
<Description>
<em:locale>ja-JP</em:locale>
<em:name>Color Folders</em:name>
<em:name>Color Folders Revived</em:name>
<em:description>フォルダツリービューのアイコンの色を変更します。</em:description>
</Description>
</em:localized>
<em:localized>
<Description>
<em:locale>fr-FR</em:locale>
<em:name>Color Folders Revived</em:name>
<em:description>De la couleur pour les icones des dossiers de l'arborescence.</em:description>
</Description>
</em:localized>

<em:targetApplication>
<Description>
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id><!-- Thunderbird -->
<em:minVersion>3.0</em:minVersion>
<em:maxVersion>24.*</em:maxVersion>
<em:maxVersion>65.*</em:maxVersion>
</Description>
</em:targetApplication>

Expand Down
14 changes: 14 additions & 0 deletions locale/fr-FR/colorfolders.dtd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!ENTITY menu_colorfolders.label "Color Folders...">
<!ENTITY menu_default.label "Par défaut">
<!ENTITY menu_gray0.label "Gris clair">
<!ENTITY menu_gray1.label "Gris">
<!ENTITY menu_gray2.label "Gris foncé">
<!ENTITY menu_red.label "Rouge">
<!ENTITY menu_yellow.label "Jaune">
<!ENTITY menu_yellowgreen.label "Citron vert">
<!ENTITY menu_green.label "Vert">
<!ENTITY menu_cyan.label "Cyan">
<!ENTITY menu_blue.label "Bleu">
<!ENTITY menu_violet.label "Violet">
<!ENTITY menu_magenta.label "Magenta">
<!ENTITY menu_morecolors.label "Plus de couleurs...">