-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmergeCustomButtons.html
More file actions
35 lines (33 loc) · 19 KB
/
Copy pathmergeCustomButtons.html
File metadata and controls
35 lines (33 loc) · 19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE HTML>
<meta charset="utf-8"/>
<title>Merge Custom Buttons [0.1.0a6pre2 - 2014-01-27]</title>
<body>
<a href="custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3EMerge%20Custom%20Buttons%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqckk9qg0AUxt+Msw0umk0LzQV6BG+QJmTdvQGL4A0UwQNIwEClpwgE994hJ8jGVSAbEf/XTzqlZOX4wWPmDfw+Zt43zPf9LRE90zxlommalyAIvubQrutavG1b6vue4jimrusmFxiwoq5rhsY0zfFQRWBF8WpsrPN9hKU7nOUq6/+5rOXibcOxgb53T8ozAIsZMDT7003ZAKyoLkly/Hxfy5tMFeecbPuQ8Kqq2BAleZ5HZVlOLjBgxdCw30yVnwBWwCVN01nf8O8GhmGMEalI0zSKoojxPM/HGTiOQ0VRTC4wYEWWZQITDcNQOQWwTNf1jyHC1ZwZDCZXpvr/H/UjwADMOQngguMGnwAAAABJRU5ErkJggg%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20http%3A//infocatcher.ucoz.net/js/cb/mergeCustomButtons.js%0A//%20https%3A//github.com/Infocatcher/Custom_Buttons/tree/master/Merge_Custom_Buttons%0A%0A//%20Merge%20Custom%20Buttons%20button%20for%20Custom%20Buttons%0A//%20%28code%20for%20%22initialization%22%20section%29%0A%0A//%20Place%20this%20button%20before%20other%20custom%20buttons%20and%20separators%20to%20move%20them%20into%20submenu%20of%20this%20button.%0A//%20Use%20two%20separators%20as%20%22stop%22%20flag.%0A//%20May%20not%20work%20for%20buttons%20with%20initialization%20code.%0A//%20Middle-click%20or%20left-click%20with%20any%20modifier%20-%20temporary%20split/merge.%0A%0A//%20%28c%29%20Infocatcher%202011%2C%202013-2014%0A//%20version%200.1.0a6pre2%20-%202014-01-27%0A%0Athis.onmouseover%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09Array.some%28%0A%09%09this.parentNode.getElementsByTagName%28%22*%22%29%2C%0A%09%09function%28node%29%20%7B%0A%09%09%09if%28%0A%09%09%09%09node%20%21%3D%20this%0A%09%09%09%09%26%26%20node.namespaceURI%20%3D%3D%20xulns%0A%09%09%09%09%26%26%20node.boxObject%0A%09%09%09%09%26%26%20node.boxObject%20instanceof%20Components.interfaces.nsIMenuBoxObject%0A%09%09%09%09%26%26%20node.open%0A%09%09%09%29%20%7B%0A%09%09%09%09node.open%20%3D%20false%3B%0A%09%09%09%09this.open%20%3D%20true%3B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%0A%09%09%09return%20false%3B%0A%09%09%7D%2C%0A%09%09this%0A%09%29%3B%0A%7D%3B%0A%0Athis.mergeButtons%20%3D%20%7B%0A%09button%3A%20this%2C%0A%09merged%3A%20false%2C%0A%09get%20mp%28%29%20%7B%0A%09%09var%20mp%20%3D%20this.button.appendChild%28document.createElement%28%22menupopup%22%29%29%3B%0A%09%09mp.className%20%3D%20%22cbMergeButtonsPopup%22%3B%0A%09%09mp.setAttribute%28%22onclick%22%2C%20%22this.parentNode.mergeButtons.closeMenus%28event%29%3B%22%29%3B%0A%09%09mp.setAttribute%28%22onmouseover%22%2C%20%22this.parentNode.mergeButtons.over%28event%29%3B%22%29%3B%0A%09%09mp.setAttribute%28%22onpopupshowing%22%2C%20%22if%28event.target%20%3D%3D%20this%29%20this.parentNode.mergeButtons.merge%28%29%3B%22%29%3B%0A%09%09//%20See%20buttonConstructor%28%29%20in%20chrome%3A//custombuttons/content/cbbutton.js%0A%09%09//%20Custom%20Buttons%20check%20for%20oBtn.parentNode.nodeName%20%3D%3D%20%22toolbar%22%0A%09%09mp.__defineGetter__%28%22nodeName%22%2C%20function%28%29%20%7B%0A%09%09%09return%20%22toolbar%22%3B%0A%09%09%7D%29%3B%0A%09%09delete%20this.mp%3B%0A%09%09return%20this.mp%20%3D%20mp%3B%0A%09%7D%2C%0A%09initProxy%3A%20function%28%29%20%7B%0A%09%09//%20Trick%3A%20wait%20for%20XBL%20binding%20tor%20%5Btype%3D%22menu%22%5D%0A%09%09LOG%28%22initProxy%28%29%22%29%3B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09if%28%22__initTimer%22%20in%20btn%29%0A%09%09%09clearTimeout%28btn.__initTimer%29%3B%0A%09%09if%28btn.type%20%3D%3D%20%22menu%22%29%20%7B%0A%09%09%09LOG%28%22initProxy%28%29%3A%20menu%22%29%3B%0A%09%09%09this.init%28%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09//%20This%20behavior%20may%20be%20changed%20%28fixed%3F%29%20later%2C%20so%20will%20initialize%20anyway%20after%20small%20delay%0A%09%09btn.__initTimer%20%3D%20setTimeout%28function%28_this%29%20%7B%0A%09%09%09LOG%28%22initProxy%28%29%20-%3E%20fallback%20timer%22%29%3B%0A%09%09%09_this.init%28%29%3B%0A%09%09%7D%2C%20500%2C%20this%29%3B%0A%09%7D%2C%0A%09init%3A%20function%28%29%20%7B%0A%09%09this.merge%28%29%3B%0A%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09_this.addStyles%28%29%3B%0A%09%09%09//_this.merge%28%29%3B%0A%09%09%7D%2C%2050%2C%20this%29%3B%0A%09%09function%20hasModifier%28e%29%20%7B%0A%09%09%09return%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%3B%0A%09%09%7D%0A%09%09this.button.onmousedown%20%3D%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%3D%3D%20this%20%26%26%20e.button%20%3D%3D%200%20%26%26%20hasModifier%28e%29%29%0A%09%09%09%09e.preventDefault%28%29%3B%0A%09%09%7D%3B%0A%09%09this.button.onclick%20%3D%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09%09return%3B%0A%09%09%09if%28e.button%20%3D%3D%200%20%26%26%20hasModifier%28e%29%20%7C%7C%20e.button%20%3D%3D%201%29%0A%09%09%09%09this.mergeButtons.toggle%28%29%3B%0A%09%09%7D%3B%0A%09%09addEventListener%28%22beforecustomization%22%2C%20this%2C%20false%29%3B%0A%09%09//addEventListener%28%22aftercustomization%22%2C%20this%2C%20false%29%3B%0A%09%7D%2C%0A%09destroy%3A%20function%28reason%29%20%7B%0A%09%09if%28reason%20%3D%3D%20%22update%22%20%7C%7C%20reason%20%3D%3D%20%22delete%22%29%20%7B%0A%09%09%09this.split%28%29%3B%0A%09%09%09this.removeStyles%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09merge%3A%20function%28%29%20%7B%0A%09%09if%28this.merged%29%0A%09%09%09return%3B%0A%09%09this.merged%20%3D%20true%3B%0A%09%09LOG%28%22merge%28%29%22%29%3B%0A%0A%09%09var%20nodes%20%3D%20%5B%5D%3B%0A%09%09var%20hasSep%20%3D%20false%3B%20//%20Will%20stop%20on%20%3Ctoolbarseparator/%3E%3Ctoolbarseparator/%3E%0A%09%09for%28var%20node%20%3D%20this.button.nextSibling%3B%20node%3B%20node%20%3D%20node.nextSibling%29%20%7B%0A%09%09%09var%20isCb%20%3D%20%28node.id%20%7C%7C%20%22%22%29.substr%280%2C%2020%29%20%3D%3D%20%22custombuttons-button%22%3B%0A%09%09%09var%20isSep%20%3D%20%21isCb%20%26%26%20node.localName%20%3D%3D%20%22toolbarseparator%22%3B%0A%09%09%09if%28%21isCb%20%26%26%20%21isSep%29%0A%09%09%09%09break%3B%0A%09%09%09if%28isSep%20%26%26%20hasSep%29%20%7B%0A%09%09%09%09nodes.pop%28%29.collapsed%20%3D%20node.collapsed%20%3D%20true%3B%0A%09%09%09%09break%3B%0A%09%09%09%7D%0A%09%09%09nodes.push%28node%29%3B%0A%09%09%09hasSep%20%3D%20isSep%3B%0A%09%09%7D%0A%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%09%09nodes.forEach%28function%28node%29%20%7B%0A%09%09%09df.appendChild%28node%29%3B%0A%09%09%7D%29%3B%0A%0A%09%09var%20mp%20%3D%20this.mp%3B%0A%09%09mp.textContent%20%3D%20%22%22%3B%0A%0A%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09if%28%21mp.parentNode%29%20//%20Hack%20for%20SeaMonkey%0A%09%09%09%09mp%20%3D%20_this.mp%20%3D%20_this.button.getElementsByTagName%28%22menupopup%22%29%5B0%5D%3B%0A%09%09%09mp.appendChild%28df%29%3B%0A%0A%09%09%09if%28_this.button.open%29%20%7B%0A%09%09%09%09_this.reinitButtons%28nodes%29%3B%0A%09%09%09%09return%3B%0A%09%09%09%7D%0A%09%09%09mp.collapsed%20%3D%20true%3B%0A%09%09%09mp.openPopup%28%29%3B%20//%20Force%20call%20XBL%20destructors/constructors%0A%09%09%09setTimeout%28function%28%29%20%7B%0A%09%09%09%09mp.hidePopup%28%29%3B%0A%09%09%09%09mp.collapsed%20%3D%20false%3B%0A%09%09%09%09_this.reinitButtons%28nodes%29%3B%0A%09%09%09%7D%2C%200%29%3B%0A%09%09%7D%2C%200%2C%20this%29%3B%0A%09%7D%2C%0A%09split%3A%20function%28temporarily%29%20%7B%0A%09%09if%28%21this.merged%29%0A%09%09%09return%3B%0A%09%09this.merged%20%3D%20false%3B%0A%09%09LOG%28%22split%28%29%22%29%3B%0A%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09var%20next1%20%3D%20btn.nextSibling%3B%0A%09%09var%20next2%20%3D%20next1%20%26%26%20next1.nextSibling%3B%0A%09%09if%28%0A%09%09%09next1%20%26%26%20next1.localName%20%3D%3D%20%22toolbarseparator%22%0A%09%09%09%26%26%20next2%20%26%26%20next2.localName%20%3D%3D%20%22toolbarseparator%22%0A%09%09%29%20%7B%0A%09%09%09next1.collapsed%20%3D%20false%3B%0A%09%09%09if%28%21temporarily%29%0A%09%09%09%09next2.collapsed%20%3D%20false%3B%0A%09%09%7D%0A%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%09%09var%20mp%20%3D%20this.mp%3B%0A%09%09while%28mp.hasChildNodes%28%29%29%20%7B%0A%09%09%09var%20node%20%3D%20mp.firstChild%3B%0A%09%09%09df.appendChild%28node%29%3B%0A%09%09%09this.reinitButton%28node%29%3B%0A%09%09%7D%0A%0A%09%09btn.parentNode.insertBefore%28df%2C%20btn.nextSibling%29%3B%0A%09%7D%2C%0A%09toggle%3A%20function%28%29%20%7B%0A%09%09if%28this.merged%29%0A%09%09%09this.split%28true%29%3B%0A%09%09else%0A%09%09%09this.merge%28%29%3B%0A%09%7D%2C%0A%09reinitButton%3A%20function%28btn%29%20%7B%0A%09%09var%20initCode%20%3D%20btn.getAttribute%28%22cb-init%22%29%3B%0A%09%09if%28%21initCode%20%7C%7C%20initCode%20%3D%3D%20%22/*Initialization%20Code*/%22%29%0A%09%09%09return%3B%0A%09%09setTimeout%28function%28%29%20%7B%0A%09%09%09btn.destroy%28%22update%22%29%3B%0A%09%09%09btn.init%28%29%3B%0A%09%09%7D%2C%200%29%3B%0A%09%7D%2C%0A%09reinitButtons%3A%20function%28btns%29%20%7B%0A%09%09btns.forEach%28this.reinitButton%2C%20this%29%3B%0A%09%7D%2C%0A%09getButtonParameters%3A%20function%28button%29%20%7B%0A%09%09//%20Based%20on%20code%20from%20%5Ccomponents%5CCustomButtonsService.js%2C%20function%20getButtonParameters%28%29%0A%09%09var%20param%20%3D%20%7B%7D%3B%0A%0A%09%09param.id%20%3D%20button.getAttribute%28%22id%22%29%3B%0A%09%09param.name%20%3D%20button.getAttribute%28%22name%22%29%20%7C%7C%20button.getAttribute%28%22label%22%29%20%7C%7C%20%22%22%3B%0A%09%09param.image%20%3D%20button.getAttribute%28%22image%22%29%20%7C%7C%20button.getAttribute%28%22cb-stdicon%22%29%20%7C%7C%20%22%22%3B%0A%09%09param.code%20%3D%20button.getAttribute%28%22cb-oncommand%22%29%20%7C%7C%20%22%22%3B%0A%09%09param.initCode%20%3D%20button.getAttribute%28%22cb-init%22%29%20%7C%7C%20%22%22%3B%0A%09%09param.accelkey%20%3D%20button.getAttribute%28%22cb-accelkey%22%29%20%7C%7C%20%22%22%3B%0A%09%09param.mode%20%3D%20button.getAttribute%28%22cb-mode%22%29%20%7C%7C%200%3B%0A%09%09param.help%20%3D%20button.getAttribute%28%22Help%22%29%20%7C%7C%20%22%22%3B%0A%0A%09%09param.%20wrappedJSObject%20%3D%20param%3B%0A%09%09return%20param%3B%0A%09%7D%2C%0A%09makeButton%3A%20function%20%28button%2C%20param%29%20%7B%0A%09%09function%20allowedSource%28%29%20%7B%0A%09%09%09return%20true%3B%0A%09%09%7D%0A%09%09//%20Code%20from%20%5Ccomponents%5CCustomButtonsService.js%2C%20function%20makeButton%28%29%0A%09%09button.setAttribute%28%22id%22%2C%20param.id%29%3B%0A%09%09button.setAttribute%28%22label%22%2C%20param.name%20%7C%7C%20%22%22%29%3B%0A%09%09button.setAttribute%28%22tooltiptext%22%2C%20param.name%20%7C%7C%20%22%22%29%3B%0A%09%09button.setAttribute%28%22class%22%2C%20%22toolbarbutton-1%20chromeclass-toolbar-additional%22%29%3B%0A%09%09button.setAttribute%28%22context%22%2C%20%22custombuttons-contextpopup%22%29%3B%0A%09%09if%28param.image.indexOf%28%22custombuttons-stdicon%22%29%20%3D%3D%200%29%0A%09%09%09button.setAttribute%28%22cb-stdicon%22%2C%20param.image%29%3B%0A%09%09else%20if%28allowedSource%28param.image%29%29%0A%09%09%09button.setAttribute%28%22image%22%2C%20param.image%20%7C%7C%20%22%22%29%3B%0A%09%09else%0A%09%09%09button.setAttribute%28%22image%22%2C%20%22%22%29%3B%0A%09%09button.setAttribute%28%22cb-oncommand%22%2C%20param.code%20%7C%7C%20%22%22%29%3B%0A%09%09button.setAttribute%28%22cb-init%22%2C%20param.initCode%20%7C%7C%20%22%22%29%3B%0A%09%09if%28param.accelkey%29%0A%09%09%09button.setAttribute%28%22cb-accelkey%22%2C%20param.accelkey%29%3B%0A%09%09button.setAttribute%28%22cb-mode%22%2C%20param.mode%29%3B%0A%09%09if%28param.help%29%0A%09%09%09button.setAttribute%28%22Help%22%2C%20param.help%29%3B%0A%09%09if%28param.attributes%29%20%7B%0A%09%09%09for%28var%20i%20in%20param.attributes%29%20if%28param.attributes.hasOwnProperty%28i%29%29%0A%09%09%09%09button.setAttribute%28i%2C%20param.attributes%5Bi%5D%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%0A%09handleEvent%3A%20function%28e%29%20%7B%0A%09%09if%28e.type%20%3D%3D%20%22beforecustomization%22%29%0A%09%09%09this.split%28%29%3B%0A%09%09//else%20if%28e.type%20%3D%3D%20%22aftercustomization%22%29%0A%09%09//%09this.merge%28%29%3B%0A%09%7D%2C%0A%09closeMenus%3A%20function%28e%29%20%7B%0A%09%09if%28e.button%20%3D%3D%202%29%0A%09%09%09return%3B%0A%09%09var%20trg%20%3D%20e.target%3B%0A%09%09if%28trg.localName%20%3D%3D%20%22toolbarbutton%22%20%26%26%20trg.type%20%21%3D%20%22menu%22%29%0A%09%09%09closeMenus%28trg%29%3B%0A%09%7D%2C%0A%09_overTimer%3A%200%2C%0A%09over%3A%20function%28e%29%20%7B%0A%09%09var%20trg%20%3D%20e.target%3B%0A%09%09if%28trg.parentNode%20%21%3D%20e.currentTarget%29%0A%09%09%09return%3B%0A%09%09if%28%28trg.type%20%7C%7C%20%22%22%29.substr%280%2C%204%29%20%3D%3D%20%22menu%22%29%20%7B%0A%09%09%09clearTimeout%28this._overTimer%29%3B%0A%09%09%09this._overTimer%20%3D%200%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09if%28this._overTimer%29%0A%09%09%09return%3B%0A%09%09this._overTimer%20%3D%20setTimeout%28function%28_this%29%20%7B%0A%09%09%09_this._overTimer%20%3D%200%3B%0A%09%09%09var%20btns%20%3D%20_this.mp.getElementsByTagName%28%22toolbarbutton%22%29%3B%0A%09%09%09for%28var%20i%20%3D%200%2C%20l%20%3D%20btns.length%3B%20i%20%3C%20l%3B%20++i%29%20%7B%0A%09%09%09%09var%20btn%20%3D%20btns%5Bi%5D%3B%0A%09%09%09%09if%28%0A%09%09%09%09%09//btn.boxObject%0A%09%09%09%09%09//%26%26%20btn.boxObject%20instanceof%20Components.interfaces.nsIMenuBoxObject%0A%09%09%09%09%09%28btn.type%20%7C%7C%20%22%22%29.substr%280%2C%204%29%20%3D%3D%20%22menu%22%0A%09%09%09%09%09%26%26%20%22open%22%20in%20btn%0A%09%09%09%09%09%26%26%20btn.open%0A%09%09%09%09%29%20%7B%0A%09%09%09%09%09//btn.open%20%3D%20false%3B%0A%09%09%09%09%09var%20mp%20%3D%20btn.getElementsByTagName%28%22menupopup%22%29%5B0%5D%3B%0A%09%09%09%09%09mp%20%26%26%20mp.hidePopup%28%29%3B%0A%09%09%09%09%09break%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%2C%20350%2C%20this%29%3B%0A%09%7D%2C%0A%0A%09_style%3A%20null%2C%0A%09addStyles%3A%20function%28%29%20%7B%0A%09%09if%28this._style%29%0A%09%09%09return%3B%0A%09%09var%20style%20%3D%20%27%5C%0A%09%09%09@namespace%20url%28%22http%3A//www.mozilla.org/keymaster/gatekeeper/there.is.only.xul%22%29%3B%5Cn%5C%0A%09%09%09%25button%25%20%3E%20.cbMergeButtonsPopup%20%3E%20toolbarbutton%20%7B%5Cn%5C%0A%09%09%09%09-moz-box-orient%3A%20horizontal%20%21important%3B%5Cn%5C%0A%09%09%09%09/*-moz-appearance%3A%20menuitem%20%21important%3B*/%5Cn%5C%0A%09%09%09%09margin%3A%200%20%21important%3B%5Cn%5C%0A%09%09%09%09padding%3A%200%202px%20%21important%3B%5Cn%5C%0A%09%09%09%7D%5Cn%5C%0A%09%09%09%25button%25%20%3E%20.cbMergeButtonsPopup%20%3E%20toolbarbutton%20%3E%20.toolbarbutton-icon%20%7B%5Cn%5C%0A%09%09%09%09display%3A%20-moz-box%20%21important%3B%5Cn%5C%0A%09%09%09%09margin-left%3A%203px%20%21important%3B%5Cn%5C%0A%09%09%09%09margin-right%3A%203px%20%21important%3B%5Cn%5C%0A%09%09%09%09padding%3A%200%20%21important%3B%5Cn%5C%0A%09%09%09%09max-width%3A%2016px%3B%5Cn%5C%0A%09%09%09%09max-height%3A%2016px%3B%5Cn%5C%0A%09%09%09%7D%5Cn%5C%0A%09%09%09%25button%25%20%3E%20.cbMergeButtonsPopup%20%3E%20toolbarbutton%20%3E%20.toolbarbutton-text%20%7B%5Cn%5C%0A%09%09%09%09display%3A%20-moz-box%20%21important%3B%5Cn%5C%0A%09%09%09%09text-align%3A%20left%20%21important%3B%5Cn%5C%0A%09%09%09%09margin-left%3A%206px%20%21important%3B%5Cn%5C%0A%09%09%09%09margin-right%3A%206px%20%21important%3B%5Cn%5C%0A%09%09%09%7D%5Cn%5C%0A%09%09%09%25button%25%20%3E%20.cbMergeButtonsPopup%20%3E%20toolbarbutton%20%3E%20.toolbarbutton-menu-dropmarker%20%7B%5Cn%5C%0A%09%09%09%09display%3A%20-moz-box%20%21important%3B%5Cn%5C%0A%09%09%09%09/*%20See%20styles%20for%20.menu-right%20in%20chrome%3A//global/skin/menu.css%20*/%5Cn%5C%0A%09%09%09%09-moz-appearance%3A%20menuarrow%20%21important%3B%5Cn%5C%0A%09%09%09%09-moz-margin-end%3A%20-2px%20%21important%3B%5Cn%5C%0A%09%09%09%09list-style-image%3A%20none%20%21important%3B%5Cn%5C%0A%09%09%09%09min-width%3A%201.28em%20%21important%3B%5Cn%5C%0A%09%09%09%09padding-top%3A%201px%20%21important%3B%5Cn%5C%0A%09%09%09%7D%5Cn%5C%0A%09%09%09%25button%25%20%3E%20.cbMergeButtonsPopup%20%3E%20toolbarseparator%20%7B%5Cn%5C%0A%09%09%09%09-moz-appearance%3A%20menuseparator%20%21important%3B%5Cn%5C%0A%09%09%09%7D%27%0A%09%09%09.replace%28/%25button%25/g%2C%20%22%23%22%20+%20this.button.id%29%3B%0A%09%09this._style%20%3D%20document.insertBefore%28%0A%09%09%09document.createProcessingInstruction%28%0A%09%09%09%09%22xml-stylesheet%22%2C%0A%09%09%09%09%27href%3D%22%27%20+%20%22data%3Atext/css%2C%22%0A%09%09%09%09%09+%20encodeURIComponent%28style%29%20+%20%27%22%20type%3D%22text/css%22%27%0A%09%09%09%29%2C%0A%09%09%09document.documentElement%0A%09%09%29%3B%0A%09%7D%2C%0A%09removeStyles%3A%20function%28%29%20%7B%0A%09%09var%20s%20%3D%20this._style%3B%0A%09%09if%28s%29%20%7B%0A%09%09%09this._style%20%3D%20null%3B%0A%09%09%09s.parentNode.removeChild%28s%29%3B%0A%09%09%7D%0A%09%7D%0A%7D%3B%0A%0Afunction%20closeMenus%28node%29%20%7B%0A%09//%20Based%20on%20function%20closeMenus%20from%20chrome%3A//browser/content/utilityOverlay.js%0A%09for%28%3B%20node%20%26%26%20%22tagName%22%20in%20node%3B%20node%20%3D%20node.parentNode%29%20%7B%0A%09%09if%28%0A%09%09%09node.namespaceURI%20%3D%3D%20%22http%3A//www.mozilla.org/keymaster/gatekeeper/there.is.only.xul%22%0A%09%09%09%26%26%20%28node.localName%20%3D%3D%20%22menupopup%22%20%7C%7C%20node.localName%20%3D%3D%20%22popup%22%29%0A%09%09%29%0A%09%09%09node.hidePopup%28%29%3B%0A%09%7D%0A%7D%0A%0ALOG%28%22Initialize%20%22%20+%20this.type%29%3B%0Athis.mergeButtons.initProxy%28%29%3B%0Athis.type%20%3D%20%22menu%22%3B%0Athis.orient%20%3D%20%22horizontal%22%3B%0Athis.onDestroy%20%3D%20function%28reason%29%20%7B%0A%09LOG%28%22onDestroy%28%22%20+%20reason%20+%20%22%29%3B%22%29%3B%0A%09if%28reason%20%3D%3D%20%22constructor%22%29%0A%09%09return%3B%20//%20Changed%20XBL%20binding%2C%20ignore%0A%09this.mergeButtons.destroy%28reason%29%3B%0A%7D%3B%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5Bif%28%21event.target%29%20//%20Button%27s%20hotkey%20pressed%0A%09this.open%20%3D%20true%3B%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E"
>Install</a>
| <a href="https://github.com/Infocatcher/Custom_Buttons/tree/master/Merge_Custom_Buttons">Source</a>
| <a href="https://github.com/Infocatcher/Custom_Buttons#usage">Instructions</a>
<script type="text/javascript">
var a = document.getElementsByTagName("a")[0];
a.title = document.title;
if(/%3Cimage%3E%3C%21%5BCDATA%5B(data%3A\S+)%5D%5D%3E%3C\/image%3E/.test(a.href)) {
var icon = decodeURIComponent(RegExp.$1);
var img = document.createElement("img");
img.src = icon;
img.alt = "";
img.style.verticalAlign = "middle";
img.style.marginRight = "4px";
img.style.border = "none";
a.insertBefore(img, a.firstChild);
var link = document.createElement("link");
link.rel = "shortcut icon";
link.href = icon;
document.documentElement.insertBefore(link, document.documentElement.firstChild);
}
</script>
<script type="text/javascript" src="https://infocatcher.github.io/Custom_Buttons/viewCustomButton.js"></script>
<script type="text/javascript">
if("viewCustomButtonCode" in window) setTimeout(function() {
viewCustomButtonCode(a.href);
}, 0);
</script>
</body>