Thread Closed

#1
Hello,
Is it possible to change the HTML mode button (or add another button with requested functionality) which will not rotate 4 display modes, but will only switch between "All body parts" mode and previously used mode?
Thank you.
ReportQuote
#2
in the prerelease i believe i made it so it will only cycle through 3 depending on a config setting
details are in this thread
http://codefisher.org/forum/viewtopic.php?id=1072
ReportQuote
#3
I have installed this prerelease (toolbar-buttons-1.0.1b3Pre3.xpi). I have installed also "Show All Body Parts" addon, so all 4 modes are visible in the menu. The button rotates between these 4 modes actually.

I would like a button with functionality something like:
- on first click it will set "All body parts" HTML mode
- on second click it will set previously used HTML mode
ReportQuote
#4
toggleHtmlMode: function(e) {
	if(e.which==3){
		return;
	}
	var prefs = toolbar_buttons.interfaces.PrefBranch;
	if(e.which==2){
		prefs.setBoolPref("mailnews.display.prefer_plaintext", false);
		prefs.setIntPref("mailnews.display.html_as",2);
		prefs.setIntPref("mailnews.display.disallow_mime_handlers", gDisallow_classes_no_html);
		ReloadMessage();
		return;
	}
	value = prefs.getIntPref("mailnews.display.html_as");
	if(prefs.getBoolPref("mailnews.display.show_all_body_parts_menu")||value==4){
		[MsgBodyAsPlaintext, MsgBodySanitized, MsgBodySanitized, MsgBodyAllParts, MsgBodyAllowHTML][value]();// why do i need 2 MsgBodySanitized in here?
	}
	else{
		[MsgBodyAsPlaintext, MsgBodySanitized, MsgBodySanitized, MsgBodyAllowHTML][value]();
	}
	//[MsgBodyAsPlaintext, MsgBodySanitized, MsgBodySanitized, MsgBodyAllowHTML][value]();
	/*
	 * 0 (default): Display the HTML normally
	 * 1: Convert it to text and then back again
	 * 2: Display the HTML source
	 * 3: Sanitize the HTML
	 * 4: (in trunk builds later than 2011-07-23) Display all body parts (see bug 602718 and comm-central changeset c1ef44a22eb2) 
	*/
}

toolbar_buttons.loadPrefWatcher("mailnews.display.html_as", "html-mode");

that is the code that makes the html mode button work
if you can mode the code to do what you want i will make make it into a unsupported button
ReportQuote
#5
Hello,
I am no coder so I was a bit scared by all that code :) Anyway, it seems TB developers fixed the issue with bad displayed attachments in new version 9. So now I have no need to switch between different HTML modes.
ReportQuote

Thread Closed