Firefox Showcase by: joseprio
Buttons
Description:
The function of this button is to group all the buttons of the Firefox Showcase extension in one. Includes a drop down with all the available options, and will remember the last one. Clicking on the button (instead of the drop down arrow) will open the last used mode.
_________________
My extension: Firefox Showcase
Behavior
| Action | Behavior |
|---|---|
Revisions
Code
if (event.target.localName == "toolbarbutton") { try { var targetCommand = gPrefService.getCharPref("custombuttons.showcaseButton.showcaseCommand"); eval(targetCommand); } catch (e) { showShowcase(false, false); } }
Init
function showcaseButtonMenuClicked(event) { var targetCommand = document.getElementById(event.target.getAttribute("command")); gPrefService.setCharPref("custombuttons.showcaseButton.showcaseCommand", targetCommand.getAttribute("oncommand")); gPrefService.setCharPref("custombuttons.showcaseButton.showcaseType", event.target.getAttribute("showcaseType")); event.target.parentNode.parentNode.setAttribute("showcaseType", event.target.getAttribute("showcaseType")); } function showcaseButtonSidebarMenuClicked(event) { gPrefService.setCharPref("custombuttons.showcaseButton.showcaseCommand", "toggleSidebar(\"" + event.target.getAttribute("targetObserver") + "\");"); gPrefService.setCharPref("custombuttons.showcaseButton.showcaseType", event.target.getAttribute("showcaseType")); event.target.parentNode.parentNode.setAttribute("showcaseType", event.target.getAttribute("showcaseType")); toggleSidebar(event.target.getAttribute("targetObserver")); } var mPopup = document.createElement("menupopup"); //mPopup.setAttribute("oncommand", "event.stopPropagation(); //this.parentNode.savePrefs(event)"); try { this.setAttribute("showcaseType", gPrefService.getCharPref("custombuttons.showcaseButton.showcaseType")); } catch (e) { } var showcaseType = this.getAttribute("showcaseType"); var sm = document.getElementById("menu_showcase").firstChild; var selectedMenuItem = null; for(var i = 0; i < sm.childNodes.length; i++) { var cmi = sm.childNodes[i]; if (cmi.localName == "menuseparator") { mPopup.appendChild(document.createElement("menuseparator")); var mi = mPopup.appendChild(document.createElement("menuitem")); mi.addEventListener("click", showcaseButtonSidebarMenuClicked, false); mi.setAttribute("label", document.getElementById("viewShowcaseThisWindowSidebar").getAttribute("label")); mi.setAttribute("targetObserver", "viewShowcaseThisWindowSidebar"); mi.setAttribute("showcaseType", "CBshowcaseThisWindowSidebarMenuItem"); mi.setAttribute("type", "radio"); mi.setAttribute("name", "CBShowcaseButton"); if (mi.getAttribute("showcaseType") == showcaseType) { selectedMenuItem = mi; } mi = mPopup.appendChild(document.createElement("menuitem")); mi.addEventListener("click", showcaseButtonSidebarMenuClicked, false); mi.setAttribute("label", document.getElementById("viewShowcaseSidebar").getAttribute("label")); mi.setAttribute("targetObserver", "viewShowcaseSidebar"); mi.setAttribute("showcaseType", "CBshowcaseSidebarMenuItem"); mi.setAttribute("type", "radio"); mi.setAttribute("name", "CBShowcaseButton"); if (mi.getAttribute("showcaseType") == showcaseType) { selectedMenuItem = mi; } mPopup.appendChild(document.createElement("menuseparator")); } else { var mi = mPopup.appendChild(document.createElement("menuitem")); mi.setAttribute("label", cmi.getAttribute("label")); mi.setAttribute("image", cmi.getAttribute("image")); mi.setAttribute("command", cmi.getAttribute("command")); mi.setAttribute("showcaseType", "CB" + cmi.getAttribute("id")); if (cmi.getAttribute("id") != "showcaseOptionsMenuItem") { mi.setAttribute("type", "radio"); mi.setAttribute("name", "CBShowcaseButton"); mi.addEventListener("click", showcaseButtonMenuClicked, false); } if (mi.getAttribute("showcaseType") == showcaseType) { selectedMenuItem = mi; } } } this.appendChild(mPopup); this.type = "menu-button"; if (selectedMenuItem != null) { selectedMenuItem.setAttribute("checked", true); }this.setAttribute('homepage', 'http://custombuttons2.com/forum/buttons/buttons-database/firefox-showcase-joseprio.html');
Help
Field Empty
Details
These do?
HTH 
Computers ONLY do what you TOLD them to do - which is NOT necessarily what you THINK you told them to do!
Custom Buttons² v.3.0.1
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)
Posted with the theme Pluralism
look just right. now, can yu tell me how to put them in your button to replace the BIG button image?
when i save the image to disk, then browse to it in "edit button - image" it disables the pull-down arrow. i'm not doing something right.
thanks.
Custom Buttons² v.3.0.1
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.0.6, Ant.com Toolbar 1.3 (.NET CLR 3.5.30729)
Posted with the theme Pluralism
Hiya,
This link should help:-
changing button images
If it still goes wrong after that, come back and we'll investigate 
Computers ONLY do what you TOLD them to do - which is NOT necessarily what you THINK you told them to do!
Custom Buttons² v.3.0.1
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)
Posted with the theme Pluralism









can you (or I - with a bit of help) make a version of this button with a smaller image? that would sure be good for me... thx, ken
i tried to set up an alternate (smaller) image, but failed. feel free to delete.
Custom Buttons² v.3.0.1
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.0.6, Ant.com Toolbar 1.3 (.NET CLR 3.5.30729)
Posted with the theme Pluralism