bunda1
chrome://browser/content/nsContextMenu.js
// Save URL of the clicked upon image, video, or audio. saveMedia: function() { var doc = this.target.ownerDocument; ... else if (this.onImage) { urlSecurityCheck(this.mediaURL, doc.nodePrincipal); saveImageURL(this.mediaURL, null, "SaveImageTitle", false, false, doc.documentURIObject, doc); }
(это из Nightly, там надо еще document передавать)
Наверное, так:
var img = content.document.images[0]; var doc = img.ownerDocument; urlSecurityCheck(img.src, doc.nodePrincipal); saveImageURL(img.src, null, "SaveImageTitle", false, false, doc.documentURIObject, doc);
Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела
Отсутствует
Infocatcher
Я не верно выразился, мне бы без запроса на место сохранения. Нужно для сохранения жестом мыши.
// Блокировать повторный запуск функций и обработчиков при открытии настройки панелей .............. if (this.hasAttribute("stop")) return; location == "chrome://browser/content/browser.xul" && (function(event) { var self = arguments.callee; if (!event) { ["dragstart", "dragover", "drop"].forEach(function(type) { gBrowser.mPanelContainer.addEventListener(type, self, false); }); window.addEventListener("unload", function() { ["dragstart", "dragover", "drop"].forEach(function(type) { gBrowser.mPanelContainer.removeEventListener(type, self, false); }); }, false); return; } switch (event.type) { case "dragstart": { self.startPoint = [event.screenX, event.screenY]; self.sourceNode = event.target; event.target.localName == "img" && event.dataTransfer.setData("application/x-moz-file-promise-url", event.target.src); break; } case "dragover": { self.startPoint && (Components.classes["@mozilla.org/widget/dragservice;1"].getService(Components.interfaces.nsIDragService).getCurrentSession().canDrop = true); break; } case "drop": { if (self.startPoint && event.target.localName != "textarea" && (!(event.target.localName == "input" && (event.target.type == "text" || event.target.type == "password"))) && event.target.contentEditable != "true") { event.preventDefault(); event.stopPropagation(); var [subX, subY] = [event.screenX - self.startPoint[0], event.screenY - self.startPoint[1]]; var [distX, distY] = [(subX > 0 ? subX : (-subX)), (subY > 0 ? subY : (-subY))]; var direction; var t = content.getSelection().toString(); if (distX > distY) direction = subX < 0 ? "L" : "R"; else direction = subY < 0 ? "U" : "D"; // изображения .... if ( event.dataTransfer.types.contains("application/x-moz-file-promise-url")) { if ( direction == "U" ) { // Bild in neuem Tab oeffnen[rechts] gBrowser.selectedTab = gBrowser.addTab(event.dataTransfer.getData("application/x-moz-file-promise-url").split("\n")[0]); return; } if ( direction == "D" ) { //Bild in neuem Tab oeffnen[rechts] gBrowser.addTab(event.dataTransfer.getData("application/x-moz-file-promise-url").split("\n")[0]); return; } if ( direction == "L" ) { // Bild speichern[links] saveImageURL(event.dataTransfer.getData("application/x-moz-file-promise-url")); return; } if ( direction == "R" ) { // Bild speichern[links] var url = event.dataTransfer.getData("application/x-moz-file-promise-url") setTimeout(function() { saveImageURL(url, null, "SaveImageTitle", false, true, gBrowser.currentURI) }, 50) //saveImageURL(gContextMenu.imageURL, null, "SaveImageTitle", false, true, makeURI(doc.location.href)); return; } } // выделенный текст .... else if ( getBrowserSelection() ) { if ( direction == "U" ) { //Identifizierung von Text-URLs und Oeffnen in neuem Tab[hoch] /^([a-z]+:\/\/)?([a-z]([a-z0-9\-]*\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(:[0-9]{1,5})?(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?$/.test(event.dataTransfer.getData("text/unicode")) && (gBrowser.selectedTab = gBrowser.addTab(event.dataTransfer.getData("text/unicode"))); return; } if ( direction == "D" ) { // Ausgewaehlen Text speichern[runter] saveImageURL("data:text/plain;charset=UTF-8;base64," + btoa(unescape(encodeURIComponent(event.dataTransfer.getData("text/unicode")))), event.dataTransfer.getData("text/unicode").slice(0, 5) + ".txt"); return; } if ( direction == "L" ) { //Google Uebersetzung aller Sprachen ins Deutsche des ausgewaehlten Textes[links] gBrowser.selectedTab = gBrowser.addTab("http://translate.google.com/translate_t?hl=de-DE#auto|ru|"+t); return; } if ( direction == "R") { //Ausgewaehlten Text mit Google suchen[rechts] gBrowser.selectedTab = gBrowser.addTab("http://www.google.com/search?q=" + t); return; } } // ссылки .... else if ( event.dataTransfer.types.contains("text/x-moz-url")) { if ( direction == "U" ) { // Link in neuem Tab oeffnen[alle Seiten] gBrowser.selectedTab = gBrowser.addTab(event.dataTransfer.getData("text/x-moz-url").split("\n")[0]); return; } if ( direction == "D" ) { // Link in neuem Tab oeffnen[alle Seiten] gBrowser.addTab(event.dataTransfer.getData("text/x-moz-url").split("\n")[0]); return; } } self.startPoint = 0; } } } })() // устанавливаем флаг, чтобы функции и обработчики не исполнялась дважды this.setAttribute("stop","true");
Отредактировано bunda1 (11-10-2012 23:11:43)
Отсутствует
мне бы без запроса на место сохранения
А кто будет расширение файла угадывать?
Видимо, нужна функция internalSave() из chrome://global/content/contentAreaUtils.js.
Вроде, так работает:
var url = "http://img.yandex.net/i/www/logo.png"; var fileName = "test"; var targetFile = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile || Components.interfaces.nsIFile); targetFile.initWithPath("D:\\" + fileName); internalSave( url, content.document, fileName, null, null, false, "SaveImageTitle", { file: targetFile, uri: makeURI(url) }, content.document.documentURIObject, true, null );
Вместо content.document, скорее всего, можно использовать event.view.document.
Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела
Отсутствует
Можно ли сделать замену Hostname in Titlebar?
Уже нашел замену - KeePass AutoType Enhancer. Собственно для KeePass и надо было
Отредактировано Kamui (12-10-2012 18:40:23)
Отсутствует
Infocatcher
Спасибо. Кстати, так тоже сохраняет изображение без запроса на место сохранения:
var imageUrl = 'http://soft.softodrom.ru/screens/soft/79/21289/708610296.png'; saveImageURL(imageUrl, 0, 0, 0, 1);
Добавлено 12-10-2012 23:06:13
Может кому надо:
// Сохранить изображение в папке загрузки двойным правым кликом, без запроса на место сохранения ...................... gBrowser.mPanelContainer.addEventListener("dblclick", function(event) { if ( event.button == 2 && event.target.nodeName == 'IMG') saveImageURL(gContextMenu.imageURL, 0, 0, 0, 1); //.... setTimeout(function() { document.getElementById("contentAreaContextMenu").hidePopup()}, 0) }, false);
Отредактировано bunda1 (12-10-2012 23:06:13)
Отсутствует
Небольшая модификация кнопки Vertical toolbar.
Тулбар настраивается почти как «настоящий», атрибуты пишутся в about:config.
Плюс попытка подружить с боковой панелью, а то у меня автоскрытие/автопоказ срабатывает при
прохождении мыши правой границы side-bar'а, а если тащить за эту границу, то и toolbox размеры меняет.
Кнопка не работает на 3.6.28 (у gNavToolbox нету externalToolbars )
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%3EVT%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/x-icon%3Bbase64%2CAAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/4AAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/4AAKP+AAIX/gAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/4AA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AAAAAAAAAAAAAAA//+sQe//rEHH56xBg8OsQQHDrEEAw6xBEMOsQRDDrEEQw6xBEMOsQRAArEEQAKxBEACsQTkArEH//6xB//+sQQ%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5Bvar%20button%20%3D%20this%3B%0A%0Aconst%20distanceShow%20%3D%202%3B%0Aconst%20distanceHide%20%3D%2064%3B%0Aconst%20toolbarId%20%3D%20%22vertical_toolbar%22%3B%0Aconst%20toolboxId%20%3D%20toolbarId%20+%20%22_toolbox%22%3B%0Aconst%20sep%20%3D%20%22%5Cu00A0%22%3B%0Aconst%20firstAttributes%20%3D%20%22id%20%25id%25%20class%20chromeclass-toolbar%20context%20toolbar-context-menu%20_width%2020%20customizable%20true%20flex%201%20iconize%20large%20mode%20icons%20orient%20vertical%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%28/%20/g%2C%20sep%29.replace%28/%25id%25/%2C%20toolbarId%29%3B%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0Avar%20supportsString%20%3D%20Components.classes%5B%22@mozilla.org/supports-string%3B1%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.createInstance%28Components.interfaces.nsISupportsString%29%3B%0A%0Avar%20prefs%20%3D%20Components.classes%5B%22@mozilla.org/preferences-service%3B1%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20.getService%28Components.interfaces.nsIPrefService%29%0A%20%20%20%20%20%20%20%20%20%20%20%20.getBranch%28%22custombutton.verticaltulbar.%22%29%3B%0Abutton.prefs%20%3D%20prefs%3B%0A%0Atry%20%20%20%20%20%20%20%20%7B%20getAttr_pref%28%29%20%7D%0Acatch%28err%29%20%7B%20setAttr_pref%28firstAttributes%29%20%7D%3B%0A%0Afunction%20getAttr_pref%28%29%20%7B%20return%20button.prefs.getComplexValue%28%22attributes%22%2C%20Components.interfaces.nsISupportsString%2C%20supportsString.data%29%3B%20%7D%0Afunction%20setAttr_pref%28a%29%20%7B%20var%20attrString%20%3D%20%22%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21a%29%20%7B%20var%20attr%20%3D%20document.getElementById%28toolbarId%29.attributes%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20%28var%20i%3D0%3B%20i%3Cattr.length%3B%20i++%29%20%7B%20attrString%20+%3D%20%28attr%5Bi%5D.name%20+%20sep%20+%20attr%5Bi%5D.value%20+%20sep%29%3B%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%20attrString%20%3D%20a%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20supportsString.data%20%3D%20attrString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20button.prefs.setComplexValue%28%22attributes%22%2C%20Components.interfaces.nsISupportsString%2C%20supportsString%29%3B%20%7D%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%09%0Avar%20browser%20%3D%20document.getElementById%28%22browser%22%29%3B%0Avar%20toolbar%20%3D%20document.getElementById%28toolbarId%29%3B%0Avar%20toolbox%20%3D%20document.getElementById%28toolboxId%29%3B%0A%0Aif%20%28%21toolbar%29%20%7B%0A%0A%09toolbox%20%3D%20document.createElement%28%22toolbox%22%29%3B%0A%09toolbox.id%20%3D%20toolboxId%3B%0A%09toolbox.palette%20%3D%20gNavToolbox.palette%3B%0A%09%0A%09toolbar%20%3D%20document.createElement%28%22toolbar%22%29%3B%0A%09toolbar.style.minWidth%20%3D%20%2220px%22%3B%0A%09%0A%09browser.insertBefore%28toolbox%2C%20browser.firstChild%29%3B%0A%09toolbox.appendChild%28toolbar%29%3B%0A%0A//-------------------------------------------------------------------------%0A//%20Thanks%20-%20http%3A//nanto.asablo.jp/blog/2007/04/22/1459018%0A%0A%09const%20style%20%3D%27%5C%0A%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%7B%5Cn%5C%0A%09%09-moz-appearance%3A%20none%3B%5Cn%5C%0A%09%09border-bottom%3A%200px%20none%3B%5Cn%5C%0A%09%09border-top%3A%200px%20none%3B%5Cn%5C%0A%09%09border-right%3A%201px%20solid%20rgb%28170%2C%20188%2C%20207%29%3B%5Cn%5C%0A%09%09background%3A%20none%20repeat%20scroll%200%25%200%25%20rgb%28207%2C%20219%2C%20236%29%3B%5Cn%5C%0A%7D%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20toolbarseparator%2C%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20%5Bid%5E%3D%22wrapper-separator%22%5D%20%7B%5Cn%5C%0A%09%09-moz-appearance%3A%20none%20%21important%3B%5Cn%5C%0A%09%09margin%3A%200.2em%202px%3B%5Cn%5C%0A%09%09border-bottom%3A%201px%20solid%20ThreeDHighlight%3B%5Cn%5C%0A%09%09border-top%3A%201px%20solid%20ThreeDShadow%3B%5Cn%5C%0A%09%09height%3A%202px%3B%5Cn%5C%0A%09%09border-left%3A%20none%3B%5Cn%5C%0A%09%09border-right%3A%20none%3B%5Cn%5C%0A%7D%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20toolbarspacer%2C%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20%5Bid%5E%3D%22wrapper-spacer%22%5D%20%7B%20height%3A%2015px%3B%20%7D%27%0A%0A%09var%20sspi%20%3D%20document.createProcessingInstruction%28%27xml-stylesheet%27%2C%0A%09%09%20%20%27type%3D%22text/css%22%20href%3D%22data%3Atext/css%2C%27%20+%20encodeURI%28style%29%20+%20%27%22%27%29%3B%0A%09document.insertBefore%28sspi%2C%20document.documentElement%29%3B%0A%0A//------------------------------------------------------------------------------%0A%0A%09var%20attr%20%3D%20getAttr_pref%28%29.data.split%28sep%29%3B%0A%09for%20%28var%20i%3D0%3B%20i%3C%28attr.length-1%29%3B%20i+%3D2%29%20%7B%20toolbar.setAttribute%28attr%5Bi%5D%2C%20attr%5Bi+1%5D%29%3B%20%7D%0A%0A%09var%20currentSet%20%3D%20toolbar.getAttribute%28%22currentset%22%29.split%28%22%2C%22%29%3B%0A%09currentSet.forEach%28function%28id%29%7B%20toolbar.insertItem%28id%29%3B%20%7D%29%3B%0A%7D%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0Avar%20et%20%3D%20gNavToolbox.externalToolbars%3B%0Avar%20already%20%3D%20false%3B%0Afor%20%28var%20i%3D0%3B%20i%3Cet.length%3B%20i++%29%20%7B%20if%20%28et%5Bi%5D%20%3D%3D%20toolbar%29%20already%20%3D%20true%3B%20%7D%0Aif%20%28%21already%29%20et%5Bet.length%5D%20%3D%20toolbar%3B%0A%0Afunction%20lock%28%29%20%7B%0A%0A%09toolbox.style.maxWidth%20%3D%0A%09toolbox.style.minWidth%20%3D%0A%09toolbar.getAttribute%28%22_width%22%29%20*%20%21toolbar.collapsed%20+%20%22px%22%3B%0A%7D%0Afunction%20beforeCustomize%28%29%20%7B%0A%0A%09toolbox.removeAttribute%28%22style%22%29%3B%0A%09toolbox.removeAttribute%28%22width%22%29%3B%0A%7D%0Afunction%20customizationChange%28%29%20%7B%0A%09window.setTimeout%28function%28%29%20%7B%0A%09%09toolbar.setAttribute%28%22_width%22%2C%20toolbar.boxObject.width%20+%204%29%3B%0A%09%7D%2C%20640%29%3B%0A%7D%0Afunction%20afterCustomize%28%29%20%7B%0A%0A%09setAttr_pref%28%29%3B%0A%09removeListeners%28%29%3B%0A%09lock%28%29%3B%0A%7D%0Afunction%20collapser%28e%29%20%7B%0A%0A%09if%20%28button.checked%29%20return%3B%0A%09var%20distance%20%3D%20e.screenX%20-%20browser.boxObject.screenX%3B%0A%09if%20%28distance%20%3C%3D%20distanceShow%29%20%7B%20toolbar.collapsed%20%3D%20false%3B%20lock%28%29%3B%20%7D%0A%09if%20%28distance%20%3E%3D%20distanceHide%29%20%7B%20toolbar.collapsed%20%3D%20true%3B%20lock%28%29%3B%20%7D%0A%7D%0Afunction%20removeListeners%28%29%20%7B%0A%0A%09gNavToolbox.removeEventListener%28%22beforecustomization%22%2C%20beforeCustomize%2C%20false%29%3B%0A%09gNavToolbox.removeEventListener%28%22customizationchange%22%2C%20customizationChange%2C%20false%29%3B%0A%09gNavToolbox.removeEventListener%28%22aftercustomization%22%2C%20afterCustomize%2C%20false%29%3B%0A%7D%0A%0Athis.onclick%20%3D%20function%28e%29%20%7B%20%0A%0A%09if%20%28e.button%20%21%3D%200%29%20return%3B%0A%09button.checked%20%3D%20%21button.checked%3B%0A%09toolbar.collapsed%20%3D%20%21button.checked%3B%0A%09toolbox.style.maxWidth%20%3D%0A%09toolbox.style.minWidth%20%3D%0A%09toolbar.getAttribute%28%22_width%22%29%20*%20button.checked%20+%20%22px%22%3B%0A%7D%0A%0Abrowser.addEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%0AgNavToolbox.addEventListener%28%22beforecustomization%22%2C%20beforeCustomize%2C%20false%29%3B%0AgNavToolbox.addEventListener%28%22customizationchange%22%2C%20customizationChange%2C%20false%29%3B%0AgNavToolbox.addEventListener%28%22aftercustomization%22%2C%20afterCustomize%2C%20false%29%3B%0A%0Athis.onDestroy%20%3D%20function%28%29%20%7B%0A%0A%09browser.removeEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09if%20%28%21toolbar.hasAttribute%28%22customizing%22%29%29%20removeListeners%28%29%3B%0A%7D%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%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
Отсутствует
Небольшая модификация кнопки Vertical toolbar.
Даже на Nightly работает, отличная кнопка. Совершенствуй кнопку дальше, пожалуйста. Можно сделать задержку что бы не сразу открывалась боковая панель.
Добавлено 13-10-2012 11:49:04
спасибо,может пригодится!
кстати запости их в тему со сниппетами,там шаблон есть
Хорошо
Отредактировано bunda1 (13-10-2012 11:49:04)
Отсутствует
bunda1
А можно в кнопке CB easy drag and go реализовать пару других функций, что-бы при выделении текста можно было вызвать меню всех установленных поисковиков и поиск по сайту, понравилась кнопка своим минимализмом в отличии от других.
Лучше спросить у знающих - чем лезть не зная.
Отсутствует
bunda1
А можно в кнопке CB easy drag and go реализовать пару других функций, что-бы при выделении текста можно было вызвать меню всех установленных поисковиков и поиск по сайту, понравилась кнопка своим минимализмом в отличии от других.
...вызвать меню всех установленных поисковиков - муторно, но может попробую.
...поиск по сайту - сам сделаешь без проблем где надо, вот код:
var text = getBrowserSelection(); var doc = getBrowser (). contentDocument; try { var url = doc. location. hostname; } catch(e) { var url = ""; } var text = escape (convertFromUnicode ("UTF-8", text)); var url = encodeURIComponent (url); var searchUrl = "http://www.google.com/search?as_q=" + text + "&as_sitesearch=" + url; gBrowser.selectedTab = gBrowser.addTab( searchUrl );
// Блокировать повторный запуск функций и обработчиков при открытии настройки панелей .............. if (this.hasAttribute("stop")) return; location == "chrome://browser/content/browser.xul" && (function(event) { var self = arguments.callee; if (!event) { ["dragstart", "dragover", "drop"].forEach(function(type) { gBrowser.mPanelContainer.addEventListener(type, self, false); }); window.addEventListener("unload", function() { ["dragstart", "dragover", "drop"].forEach(function(type) { gBrowser.mPanelContainer.removeEventListener(type, self, false); }); }, false); return; } switch (event.type) { case "dragstart": { self.startPoint = [event.screenX, event.screenY]; self.sourceNode = event.target; event.target.localName == "img" && event.dataTransfer.setData("application/x-moz-file-promise-url", event.target.src); break; } case "dragover": { self.startPoint && (Components.classes["@mozilla.org/widget/dragservice;1"].getService(Components.interfaces.nsIDragService).getCurrentSession().canDrop = true); break; } case "drop": { if (self.startPoint && event.target.localName != "textarea" && (!(event.target.localName == "input" && (event.target.type == "text" || event.target.type == "password"))) && event.target.contentEditable != "true") { event.preventDefault(); event.stopPropagation(); var [subX, subY] = [event.screenX - self.startPoint[0], event.screenY - self.startPoint[1]]; var [distX, distY] = [(subX > 0 ? subX : (-subX)), (subY > 0 ? subY : (-subY))]; var direction; var t = content.getSelection().toString(); if (distX > distY) direction = subX < 0 ? "L" : "R"; else direction = subY < 0 ? "U" : "D"; // Изображения .... if ( event.dataTransfer.types.contains("application/x-moz-file-promise-url")) { if ( direction == "U" ) { // открыть изображение в новой активной странице gBrowser.selectedTab = gBrowser.addTab(event.dataTransfer.getData("application/x-moz-file-promise-url").split("\n")[0]); return; } if ( direction == "D" ) { // открыть изображение в новой фоновой странице gBrowser.addTab(event.dataTransfer.getData("application/x-moz-file-promise-url").split("\n")[0]); return; } if ( direction == "L" ) { // сохранить изображение или ссылку saveImageURL(event.dataTransfer.getData("application/x-moz-file-promise-url")); return; } if ( direction == "R" ) { // сохранить изображение или ссылку без запроса на место сохранения saveImageURL(event.dataTransfer.getData("application/x-moz-file-promise-url"), 0, 0, 0, 1); return; } } // Выделенный текст .... else if ( getBrowserSelection() ) { if ( direction == "U" ) { // поиск текста в текущем поисковике в новой активной странице gBrowser.selectedTab = gBrowser.addTab("http://www.google.com/search?q=" + getBrowserSelection() ); return; } if ( direction == "D") { // поиск текста в текущем поисковике в новой фоновой странице gBrowser.addTab("http://www.google.com/search?q=" + getBrowserSelection() ); return; } if ( direction == "L" ) { // сохранить выделенный текст как txt файл saveImageURL("data:text/plain;charset=UTF-8;base64," + btoa(unescape(encodeURIComponent(event.dataTransfer.getData("text/unicode")))), event.dataTransfer.getData("text/unicode").slice(0, 5) + ".txt"); return; } if ( direction == "R" ) { // открыть текстовые ссылки /^([a-z]+:\/\/)?([a-z]([a-z0-9\-]*\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(:[0-9]{1,5})?(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?$/.test(event.dataTransfer.getData("text/unicode")) && (gBrowser.selectedTab = gBrowser.addTab(event.dataTransfer.getData("text/unicode"))); return; } } // Ссылки .... else if ( event.dataTransfer.types.contains("text/x-moz-url")) { if ( direction == "U" ) { // открыть ссылку в новой активной странице gBrowser.selectedTab = gBrowser.addTab(event.dataTransfer.getData("text/x-moz-url").split("\n")[0]); return; } if ( direction == "D" ) { // открыть ссылку в новой фоновой странице gBrowser.addTab(event.dataTransfer.getData("text/x-moz-url").split("\n")[0]); return; } } self.startPoint = 0; } } } })(); // устанавливаем флаг, чтобы функции и обработчики не исполнялась дважды this.setAttribute("stop","true");
Отсутствует
bunda1, спасибо за отзыв
Можно сделать задержку что бы не сразу открывалась боковая панель.
Не уверен, что правильно понимаю, но попробую угадать.
Если не угадал, то напиши подробно - что оно должно делать и для чего.
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%3EVT%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/x-icon%3Bbase64%2CAAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAA//gAAP/4AADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//+sQe//rEHH56xBg8OsQQHDrEEAw6xBEMOsQRDDrEEQw6xBEMOsQRAArEEQAKxBEACsQTkArEH//6xB//+sQQ%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5Bvar%20button%20%3D%20this%3B%0A%0Aconst%20showDelay%20%3D%20555%3B%20//ms%0Aconst%20distanceShow%20%3D%202%3B%0Aconst%20distanceHide%20%3D%2064%3B%0Aconst%20toolbarId%20%3D%20%22vertical_toolbar%22%3B%0Aconst%20toolboxId%20%3D%20toolbarId%20+%20%22_toolbox%22%3B%0Aconst%20sep%20%3D%20%22%5Cu00A0%22%3B%0Aconst%20firstAttributes%20%3D%20%22id%20%25id%25%20class%20chromeclass-toolbar%20context%20toolbar-context-menu%20_width%2020%20customizable%20true%20flex%201%20iconize%20large%20mode%20icons%20orient%20vertical%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%28/%20/g%2C%20sep%29.replace%28/%25id%25/%2C%20toolbarId%29%3B%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0Avar%20supportsString%20%3D%20Components.classes%5B%22@mozilla.org/supports-string%3B1%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.createInstance%28Components.interfaces.nsISupportsString%29%3B%0A%0Avar%20prefs%20%3D%20Components.classes%5B%22@mozilla.org/preferences-service%3B1%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20.getService%28Components.interfaces.nsIPrefService%29%0A%20%20%20%20%20%20%20%20%20%20%20%20.getBranch%28%22custombutton.verticaltoolbar.%22%29%3B%0Abutton.prefs%20%3D%20prefs%3B%0A%0Atry%20%20%20%20%20%20%20%20%7B%20getAttr_pref%28%29%20%7D%0Acatch%28err%29%20%7B%20setAttr_pref%28firstAttributes%29%20%7D%3B%0A%0Afunction%20getAttr_pref%28%29%20%7B%20return%20button.prefs.getComplexValue%28%22attributes%22%2C%20Components.interfaces.nsISupportsString%2C%20supportsString.data%29%3B%20%7D%0Afunction%20setAttr_pref%28a%29%20%7B%20var%20attrString%20%3D%20%22%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21a%29%20%7B%20var%20attr%20%3D%20document.getElementById%28toolbarId%29.attributes%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20%28var%20i%3D0%3B%20i%3Cattr.length%3B%20i++%29%20%7B%20attrString%20+%3D%20%28attr%5Bi%5D.name%20+%20sep%20+%20attr%5Bi%5D.value%20+%20sep%29%3B%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%20attrString%20%3D%20a%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20supportsString.data%20%3D%20attrString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20button.prefs.setComplexValue%28%22attributes%22%2C%20Components.interfaces.nsISupportsString%2C%20supportsString%29%3B%20%7D%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%09%0Avar%20browser%20%3D%20document.getElementById%28%22browser%22%29%3B%0Avar%20toolbar%20%3D%20document.getElementById%28toolbarId%29%3B%0Avar%20toolbox%20%3D%20document.getElementById%28toolboxId%29%3B%0A%0Aif%20%28%21toolbar%29%20%7B%0A%0A%09toolbox%20%3D%20document.createElement%28%22toolbox%22%29%3B%0A%09toolbox.id%20%3D%20toolboxId%3B%0A%09toolbox.palette%20%3D%20gNavToolbox.palette%3B%0A%09%0A%09toolbar%20%3D%20document.createElement%28%22toolbar%22%29%3B%0A%09toolbar.style.minWidth%20%3D%20%2220px%22%3B%0A%09%0A%09browser.insertBefore%28toolbox%2C%20browser.firstChild%29%3B%0A%09toolbox.appendChild%28toolbar%29%3B%0A%0A//-------------------------------------------------------------------------%0A//%20Thanks%20-%20http%3A//nanto.asablo.jp/blog/2007/04/22/1459018%0A%0A%09const%20style%20%3D%27%5C%0A%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%7B%5Cn%5C%0A%09%09-moz-appearance%3A%20none%3B%5Cn%5C%0A%09%09border-bottom%3A%200px%20none%3B%5Cn%5C%0A%09%09border-top%3A%200px%20none%3B%5Cn%5C%0A%09%09border-right%3A%201px%20solid%20rgb%28170%2C%20188%2C%20207%29%3B%5Cn%5C%0A%09%09background%3A%20none%20repeat%20scroll%200%25%200%25%20rgb%28207%2C%20219%2C%20236%29%3B%5Cn%5C%0A%7D%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20toolbarseparator%2C%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20%5Bid%5E%3D%22wrapper-separator%22%5D%20%7B%5Cn%5C%0A%09%09-moz-appearance%3A%20none%20%21important%3B%5Cn%5C%0A%09%09margin%3A%200.2em%202px%3B%5Cn%5C%0A%09%09border-bottom%3A%201px%20solid%20ThreeDHighlight%3B%5Cn%5C%0A%09%09border-top%3A%201px%20solid%20ThreeDShadow%3B%5Cn%5C%0A%09%09height%3A%202px%3B%5Cn%5C%0A%09%09border-left%3A%20none%3B%5Cn%5C%0A%09%09border-right%3A%20none%3B%5Cn%5C%0A%7D%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20toolbarspacer%2C%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20%5Bid%5E%3D%22wrapper-spacer%22%5D%20%7B%20height%3A%2015px%3B%20%7D%27%0A%0A%09var%20sspi%20%3D%20document.createProcessingInstruction%28%27xml-stylesheet%27%2C%0A%09%09%20%20%27type%3D%22text/css%22%20href%3D%22data%3Atext/css%2C%27%20+%20encodeURI%28style%29%20+%20%27%22%27%29%3B%0A%09document.insertBefore%28sspi%2C%20document.documentElement%29%3B%0A%0A//------------------------------------------------------------------------------%0A%0A%09var%20attr%20%3D%20getAttr_pref%28%29.data.split%28sep%29%3B%0A%09for%20%28var%20i%3D0%3B%20i%3C%28attr.length-1%29%3B%20i+%3D2%29%20%7B%20toolbar.setAttribute%28attr%5Bi%5D%2C%20attr%5Bi+1%5D%29%3B%20%7D%0A%0A%09var%20currentSet%20%3D%20toolbar.getAttribute%28%22currentset%22%29.split%28%22%2C%22%29%3B%0A%09currentSet.forEach%28function%28id%29%7B%20toolbar.insertItem%28id%29%3B%20%7D%29%3B%0A%7D%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0Avar%20et%20%3D%20gNavToolbox.externalToolbars%3B%0Avar%20already%20%3D%20false%3B%0Afor%20%28var%20i%3D0%3B%20i%3Cet.length%3B%20i++%29%20%7B%20if%20%28et%5Bi%5D%20%3D%3D%20toolbar%29%20already%20%3D%20true%3B%20%7D%0Aif%20%28%21already%29%20et%5Bet.length%5D%20%3D%20toolbar%3B%0A%0Afunction%20lock%28%29%20%7B%0A%0A%09toolbox.style.maxWidth%20%3D%0A%09toolbox.style.minWidth%20%3D%0A%09toolbar.getAttribute%28%22_width%22%29%20*%20%21toolbar.collapsed%20+%20%22px%22%3B%0A%7D%0Afunction%20beforeCustomize%28%29%20%7B%0A%0A%09toolbox.removeAttribute%28%22style%22%29%3B%0A%09toolbox.removeAttribute%28%22width%22%29%3B%0A%7D%0Afunction%20customizationChange%28%29%20%7B%0A%09window.setTimeout%28function%28%29%20%7B%0A%09%09toolbar.setAttribute%28%22_width%22%2C%20toolbar.boxObject.width%20+%204%29%3B%0A%09%7D%2C%20640%29%3B%0A%7D%0Afunction%20afterCustomize%28%29%20%7B%0A%0A%09setAttr_pref%28%29%3B%0A%09removeListeners%28%29%3B%0A%09lock%28%29%3B%0A%7D%0Avar%20distance%3B%0Afunction%20collapser%28e%29%20%7B%0A%0A%09distance%20%3D%20e.screenX%20-%20browser.boxObject.screenX%3B%0A%09if%20%28toolbar.waiting%29%20return%3B%0A%0A%09if%20%28%28distance%20%3C%3D%20distanceShow%29%20%26%26%20%28toolbar.collapsed%29%29%20%7B%0A%0A%09%09if%20%28showDelay%20%3C%201%29%20%7B%20toolbar.collapsed%20%3D%20false%3B%20lock%28%29%3B%20return%3B%20%7D%0A%0A%09%09toolbar.waiting%20%3D%20true%3B%0A%09%09window.setTimeout%28function%28%29%20%7B%0A%0A%09%09%09if%20%28distance%20%3E%3D%20distanceShow%29%20%7B%20toolbar.waiting%20%3D%20false%3B%20return%3B%20%7D%0A%09%09%09toolbar.collapsed%20%3D%20false%3B%0A%09%09%09lock%28%29%3B%0A%09%09%09toolbar.waiting%20%3D%20false%3B%0A%0A%09%09%7D%2C%20showDelay%29%3B%0A%09%7D%0A%09if%20%28%28distance%20%3E%3D%20distanceHide%29%20%26%26%20%28%21toolbar.collapsed%29%29%20%7B%0A%09%09toolbar.collapsed%20%3D%20true%3B%0A%09%09lock%28%29%3B%0A%09%7D%0A%7D%0Afunction%20removeListeners%28%29%20%7B%0A%0A%09gNavToolbox.removeEventListener%28%22beforecustomization%22%2C%20beforeCustomize%2C%20false%29%3B%0A%09gNavToolbox.removeEventListener%28%22customizationchange%22%2C%20customizationChange%2C%20false%29%3B%0A%09gNavToolbox.removeEventListener%28%22aftercustomization%22%2C%20afterCustomize%2C%20false%29%3B%0A%7D%0A%0Athis.onclick%20%3D%20function%28e%29%20%7B%20%0A%0A%09if%20%28e.button%20%21%3D%200%29%20return%3B%0A%09button.checked%20%3D%20%21button.checked%3B%0A%09toolbar.collapsed%20%3D%20%21button.checked%3B%0A%0A%09if%20%28button.checked%29%20%7B%0A%09%09browser.removeEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09%09toolbar.setAttribute%28%22_checked%22%2C%20%22true%22%29%3B%0A%09%7D%0A%09else%20%7B%0A%09%09browser.addEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09%09toolbar.removeAttribute%28%22_checked%22%29%3B%0A%09%7D%0A%09lock%28%29%3B%0A%7D%0A%0Aif%20%28%21toolbar.hasAttribute%28%22_checked%22%29%29%20%7B%0A%09browser.addEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%7D%0Aelse%20%7B%20button.checked%20%3D%20true%3B%20lock%28%29%3B%20%7D%0A%0AgNavToolbox.addEventListener%28%22beforecustomization%22%2C%20beforeCustomize%2C%20false%29%3B%0AgNavToolbox.addEventListener%28%22customizationchange%22%2C%20customizationChange%2C%20false%29%3B%0AgNavToolbox.addEventListener%28%22aftercustomization%22%2C%20afterCustomize%2C%20false%29%3B%0A%0Athis.onDestroy%20%3D%20function%28%29%20%7B%0A%0A%09browser.removeEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09if%20%28%21toolbar.hasAttribute%28%22customizing%22%29%29%20removeListeners%28%29%3B%0A%09try%20%7B%20getAttr_pref%28%29%20%7D%20catch%28err%29%20%7B%20return%3B%20%7D%0A%09setAttr_pref%28%29%3B%0A%7D%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%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
Отредактировано Dumby (14-10-2012 17:15:56)
Отсутствует
Здравствуйте ! На JS никогда не писал. Помогите, плиз !
Проблема такая: на странице пользователь вручную заполняет массу полей (INPUT). Написал прогу, которая автоматически заполняет эти поля из xls-файла. Что значительно упрощает жизнь. Все Ok' для сайтов работавших под IE (он ActiveX). Но попался сайт работающий только под FireFox (Chrome). Поставил CS. Написал прогу на JS - в ней читаю инфу из текстового файла и вставляю в нужные поля. Не могу обратиться к элементам страницы - такие команды как
document.all, document.forms и т.п. возвращают undefined, а document.GetElementsByTagName('INPUT') и вовсе дает ошибку
Чего я не так делаю ?
FireFox 16.0 JS разрешен
Отсутствует
document.all, document.forms и т.п. возвращают undefined, а document.GetElementsByTagName('INPUT') и вовсе дает ошибку
Это другой документ:
Надо использовать content.document и что-нибудь из https://developer.mozilla.org/en-US/doc … nt#Methods.
Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела
Отсутствует
Не уверен, что правильно понимаю, но попробую угадать.
Если не угадал, то напиши подробно - что оно должно делать и для чего.
Да этото что нужно. А можно сделать переключение режима автоскрытия двойним правым кликом на вертикальной панели.
Отсутствует
okkamas_knife
Да, собствено, вот и весь код. Всякую работу с текстовым файлом я закоментировал. Пробовал и из CS и из редактора JS что в Инстркментах FF
var oDk=content.document ;
alert(oDk.location) ;
alert(content.document.all) ;
alert(content.document.GetElementsByTagName("input")) ;
Отредактировано fil (14-10-2012 23:00:51)
Отсутствует
А можно сделать переключение режима автоскрытия двойним правым кликом на вертикальной панели.
Вот, может быть так... Но вопрос: почему именно двойным правым, а не двойным левым ?
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%3EVT%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/x-icon%3Bbase64%2CAAABAAEAEBAAAAEAIABoB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A/4AAEv+AAP//gAD//4AAJ/+AAP//gAD//4AA//+AAP//gAD//4AA//+AAP//gAD//4AAEf+AABIAAAAAAAAAAAAAAAD/gAAV/4AAEgAAAAD/gAAQ/4AAEf+AAA//gAAP/4AAD/+AAA//gAAP/4AADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//+sQe//rEHH56xBg8OsQQHDrEEAw6xBEMOsQRDDrEEQw6xBEMOsQRAArEEQAKxBEACsQTkArEH//6xB//+sQQ%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5Bvar%20button%20%3D%20this%3B%0A%0Aconst%20showDelay%20%3D%20555%3B%20//ms%0Aconst%20distanceShow%20%3D%202%3B%0Aconst%20distanceHide%20%3D%2064%3B%0Aconst%20toolbarId%20%3D%20%22vertical_toolbar%22%3B%0Aconst%20toolboxId%20%3D%20toolbarId%20+%20%22_toolbox%22%3B%0Aconst%20sep%20%3D%20%22%5Cu00A0%22%3B%0Aconst%20firstAttributes%20%3D%20%22id%20%25id%25%20class%20chromeclass-toolbar%20context%20toolbar-context-menu%20_width%2020%20customizable%20true%20flex%201%20iconize%20large%20mode%20icons%20orient%20vertical%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%28/%20/g%2C%20sep%29.replace%28/%25id%25/%2C%20toolbarId%29%3B%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0Avar%20supportsString%20%3D%20Components.classes%5B%22@mozilla.org/supports-string%3B1%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.createInstance%28Components.interfaces.nsISupportsString%29%3B%0A%0Avar%20prefs%20%3D%20Components.classes%5B%22@mozilla.org/preferences-service%3B1%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20.getService%28Components.interfaces.nsIPrefService%29%0A%20%20%20%20%20%20%20%20%20%20%20%20.getBranch%28%22custombutton.verticaltoolbar.%22%29%3B%0Abutton.prefs%20%3D%20prefs%3B%0A%0Atry%20%20%20%20%20%20%20%20%7B%20getAttr_pref%28%29%20%7D%0Acatch%28err%29%20%7B%20setAttr_pref%28firstAttributes%29%20%7D%3B%0A%0Afunction%20getAttr_pref%28%29%20%7B%20return%20button.prefs.getComplexValue%28%22attributes%22%2C%20Components.interfaces.nsISupportsString%2C%20supportsString.data%29%3B%20%7D%0Afunction%20setAttr_pref%28a%29%20%7B%20var%20attrString%20%3D%20%22%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21a%29%20%7B%20var%20attr%20%3D%20document.getElementById%28toolbarId%29.attributes%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20%28var%20i%3D0%3B%20i%3Cattr.length%3B%20i++%29%20%7B%20attrString%20+%3D%20%28attr%5Bi%5D.name%20+%20sep%20+%20attr%5Bi%5D.value%20+%20sep%29%3B%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%20attrString%20%3D%20a%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20supportsString.data%20%3D%20attrString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20button.prefs.setComplexValue%28%22attributes%22%2C%20Components.interfaces.nsISupportsString%2C%20supportsString%29%3B%20%7D%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%09%0Avar%20browser%20%3D%20document.getElementById%28%22browser%22%29%3B%0Avar%20toolbar%20%3D%20document.getElementById%28toolbarId%29%3B%0Avar%20toolbox%20%3D%20document.getElementById%28toolboxId%29%3B%0A%0Aif%20%28%21toolbar%29%20%7B%0A%0A%09toolbox%20%3D%20document.createElement%28%22toolbox%22%29%3B%0A%09toolbox.id%20%3D%20toolboxId%3B%0A%09toolbox.palette%20%3D%20gNavToolbox.palette%3B%0A%09%0A%09toolbar%20%3D%20document.createElement%28%22toolbar%22%29%3B%0A%09toolbar.style.minWidth%20%3D%20%2220px%22%3B%0A%09%0A%09browser.insertBefore%28toolbox%2C%20browser.firstChild%29%3B%0A%09toolbox.appendChild%28toolbar%29%3B%0A%0A//-------------------------------------------------------------------------%0A//%20Thanks%20-%20http%3A//nanto.asablo.jp/blog/2007/04/22/1459018%0A%0A%09const%20style%20%3D%27%5C%0A%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%7B%5Cn%5C%0A%09%09-moz-appearance%3A%20none%3B%5Cn%5C%0A%09%09border-bottom%3A%200px%20none%3B%5Cn%5C%0A%09%09border-top%3A%200px%20none%3B%5Cn%5C%0A%09%09border-right%3A%201px%20solid%20rgb%28170%2C%20188%2C%20207%29%3B%5Cn%5C%0A%09%09background%3A%20none%20repeat%20scroll%200%25%200%25%20rgb%28207%2C%20219%2C%20236%29%3B%5Cn%5C%0A%7D%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20toolbarseparator%2C%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20%5Bid%5E%3D%22wrapper-separator%22%5D%20%7B%5Cn%5C%0A%09%09-moz-appearance%3A%20none%20%21important%3B%5Cn%5C%0A%09%09margin%3A%200.2em%202px%3B%5Cn%5C%0A%09%09border-bottom%3A%201px%20solid%20ThreeDHighlight%3B%5Cn%5C%0A%09%09border-top%3A%201px%20solid%20ThreeDShadow%3B%5Cn%5C%0A%09%09height%3A%202px%3B%5Cn%5C%0A%09%09border-left%3A%20none%3B%5Cn%5C%0A%09%09border-right%3A%20none%3B%5Cn%5C%0A%7D%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20toolbarspacer%2C%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20%5Bid%5E%3D%22wrapper-spacer%22%5D%20%7B%20height%3A%2015px%3B%20%7D%27%0A%0A%09var%20sspi%20%3D%20document.createProcessingInstruction%28%27xml-stylesheet%27%2C%0A%09%09%20%20%27type%3D%22text/css%22%20href%3D%22data%3Atext/css%2C%27%20+%20encodeURI%28style%29%20+%20%27%22%27%29%3B%0A%09document.insertBefore%28sspi%2C%20document.documentElement%29%3B%0A%0A//------------------------------------------------------------------------------%0A%0A%09var%20attr%20%3D%20getAttr_pref%28%29.data.split%28sep%29%3B%0A%09for%20%28var%20i%3D0%3B%20i%3C%28attr.length-1%29%3B%20i+%3D2%29%20%7B%20toolbar.setAttribute%28attr%5Bi%5D%2C%20attr%5Bi+1%5D%29%3B%20%7D%0A%0A%09var%20currentSet%20%3D%20toolbar.getAttribute%28%22currentset%22%29.split%28%22%2C%22%29%3B%0A%09currentSet.forEach%28function%28id%29%7B%20toolbar.insertItem%28id%29%3B%20%7D%29%3B%0A%7D%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0Avar%20et%20%3D%20gNavToolbox.externalToolbars%3B%0Avar%20already%20%3D%20false%3B%0Afor%20%28var%20i%3D0%3B%20i%3Cet.length%3B%20i++%29%20%7B%20if%20%28et%5Bi%5D%20%3D%3D%20toolbar%29%20already%20%3D%20true%3B%20%7D%0Aif%20%28%21already%29%20et%5Bet.length%5D%20%3D%20toolbar%3B%0A%0Afunction%20lock%28%29%20%7B%0A%0A%09toolbox.style.maxWidth%20%3D%0A%09toolbox.style.minWidth%20%3D%0A%09toolbar.getAttribute%28%22_width%22%29%20*%20%21toolbar.collapsed%20+%20%22px%22%3B%0A%7D%0Afunction%20beforeCustomize%28%29%20%7B%0A%0A%09toolbox.removeAttribute%28%22style%22%29%3B%0A%09toolbox.removeAttribute%28%22width%22%29%3B%0A%7D%0Afunction%20customizationChange%28%29%20%7B%0A%09window.setTimeout%28function%28%29%20%7B%0A%09%09toolbar.setAttribute%28%22_width%22%2C%20toolbar.boxObject.width%20+%204%29%3B%0A%09%7D%2C%20640%29%3B%0A%7D%0Afunction%20afterCustomize%28%29%20%7B%0A%0A%09setAttr_pref%28%29%3B%0A%09removeListeners%28%29%3B%0A%09lock%28%29%3B%0A%7D%0Avar%20distance%3B%0Afunction%20collapser%28e%29%20%7B%0A%0A%09distance%20%3D%20e.screenX%20-%20browser.boxObject.screenX%3B%0A%09if%20%28toolbar.waiting%29%20return%3B%0A%0A%09if%20%28%28distance%20%3C%3D%20distanceShow%29%20%26%26%20%28toolbar.collapsed%29%29%20%7B%0A%0A%09%09if%20%28showDelay%20%3C%201%29%20%7B%20toolbar.collapsed%20%3D%20false%3B%20lock%28%29%3B%20return%3B%20%7D%0A%0A%09%09toolbar.waiting%20%3D%20true%3B%0A%09%09window.setTimeout%28function%28%29%20%7B%0A%0A%09%09%09if%20%28distance%20%3E%3D%20distanceShow%29%20%7B%20toolbar.waiting%20%3D%20false%3B%20return%3B%20%7D%0A%09%09%09toolbar.collapsed%20%3D%20false%3B%0A%09%09%09lock%28%29%3B%0A%09%09%09toolbar.waiting%20%3D%20false%3B%0A%0A%09%09%7D%2C%20showDelay%29%3B%0A%09%7D%0A%09if%20%28%28distance%20%3E%3D%20distanceHide%29%20%26%26%20%28%21toolbar.collapsed%29%29%20%7B%0A%09%09toolbar.collapsed%20%3D%20true%3B%0A%09%09lock%28%29%3B%0A%09%7D%0A%7D%0Afunction%20removeListeners%28%29%20%7B%0A%0A%09gNavToolbox.removeEventListener%28%22beforecustomization%22%2C%20beforeCustomize%2C%20false%29%3B%0A%09gNavToolbox.removeEventListener%28%22customizationchange%22%2C%20customizationChange%2C%20false%29%3B%0A%09gNavToolbox.removeEventListener%28%22aftercustomization%22%2C%20afterCustomize%2C%20false%29%3B%0A%7D%0A%0Athis.onclick%20%3D%20function%28e%29%20%7B%20%0A%0A%09if%20%28e.button%20%21%3D%200%29%20return%3B%0A%09button.checked%20%3D%20%21button.checked%3B%0A%09toolbar.collapsed%20%3D%20%21button.checked%3B%0A%0A%09if%20%28button.checked%29%20%7B%0A%09%09browser.removeEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09%09toolbar.setAttribute%28%22_checked%22%2C%20%22true%22%29%3B%0A%09%7D%0A%09else%20%7B%0A%09%09browser.addEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09%09toolbar.removeAttribute%28%22_checked%22%29%3B%0A%09%7D%0A%09lock%28%29%3B%0A%7D%0Atoolbar.ondblclick%20%3D%20function%28e%29%20%7B%0A%0A%09if%20%28%20%20%20%20e.button%20%21%3D%202%20%7C%7C%0A%09%09e.target.nodeName%20%3D%3D%20%22toolbarbutton%22%20%7C%7C%0A%09%09e.target.nodeName%20%3D%3D%20%22toolbaritem%22%0A%09%29%20return%3B%0A%0A%09button.click%28%29%3B%0A%09setTimeout%28function%28%29%20%7B%20document.getElementById%28%22toolbar-context-menu%22%29.hidePopup%28%29%3B%20%7D%2C%2050%29%3B%0A%7D%0A%0Aif%20%28%21toolbar.hasAttribute%28%22_checked%22%29%29%20%7B%0A%09browser.addEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%7D%0Aelse%20%7B%20button.checked%20%3D%20true%3B%20lock%28%29%3B%20%7D%0A%0AgNavToolbox.addEventListener%28%22beforecustomization%22%2C%20beforeCustomize%2C%20false%29%3B%0AgNavToolbox.addEventListener%28%22customizationchange%22%2C%20customizationChange%2C%20false%29%3B%0AgNavToolbox.addEventListener%28%22aftercustomization%22%2C%20afterCustomize%2C%20false%29%3B%0A%0Athis.onDestroy%20%3D%20function%28%29%20%7B%0A%0A%09browser.removeEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09if%20%28%21toolbar.hasAttribute%28%22customizing%22%29%29%20removeListeners%28%29%3B%0A%09try%20%7B%20getAttr_pref%28%29%20%7D%20catch%28err%29%20%7B%20return%3B%20%7D%0A%09setAttr_pref%28%29%3B%0A%7D%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%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
Отсутствует
Вот, может быть так... Но вопрос: почему именно двойным правым, а не двойным левым ?
Ну я так привык. Спасибо.
И было не плохо если при автоматическим режиме вертикальная панель открывалась поверх страницы а не сжимала страницу как сейчас.
Обнаружился один баг, кнопки пропадают из вертикальной панели если включить полный экран.
Отсутствует
Обнаружился один баг, кнопки пропадают из вертикальной панели если включить полный экран.
Вот версия с таким дефолтным атрибутом.
Но придётся: about:config > custombutton.verticaltoolbar.attributes > ПКМ > Сбросить > restart
и настроить тулбар заново.
Кстати, может пригодится - совет по настройке:
Элементы, расположенные на тулбаре следует воспринимать не как вертикальные,
а как горизонтальные, тогда, при настройке
если схватить мышью какой-нибудь элемент (Elm 1)
и отпустить над элементом, расположенным на тулбаре (Elm 2),
то
если отпустить Elm 1 ближе к левому краю Elm 2, то Elm 1 расположится сверху от Elm 2,
а если отпустить Elm 1 ближе к правому краю Elm 2, то Elm 1 расположится снизу от Elm 2.
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%3EVT%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/x-icon%3Bbase64%2CAAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAA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AD//4AA//+AAP//gAD//4AAEf+AABIAAAAAAAAAAAAAAAD/gAAV/4AAEgAAAAD/gAAQ/4AAEf+AAA//gAAP/4AAD/+AAA//gAAP/4AADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//+sQe//rEHH56xBg8OsQQHDrEEAw6xBEMOsQRDDrEEQw6xBEMOsQRAArEEQAKxBEACsQTkArEH//6xB//+sQQ%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5Bvar%20button%20%3D%20this%3B%0A%0Aconst%20showDelay%20%3D%20555%3B%20//ms%0Aconst%20distanceShow%20%3D%202%3B%0Aconst%20distanceHide%20%3D%2064%3B%0Aconst%20toolbarId%20%3D%20%22vertical_toolbar%22%3B%0Aconst%20toolboxId%20%3D%20toolbarId%20+%20%22_toolbox%22%3B%0Aconst%20sep%20%3D%20%22%5Cu00A0%22%3B%0Aconst%20firstAttributes%20%3D%20%22id%20%25id%25%20class%20chromeclass-toolbar%20fullscreentoolbar%20true%20context%20toolbar-context-menu%20_width%2020%20customizable%20true%20flex%201%20iconize%20large%20mode%20icons%20orient%20vertical%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%28/%20/g%2C%20sep%29.replace%28/%25id%25/%2C%20toolbarId%29%3B%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0Avar%20supportsString%20%3D%20Components.classes%5B%22@mozilla.org/supports-string%3B1%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.createInstance%28Components.interfaces.nsISupportsString%29%3B%0A%0Avar%20prefs%20%3D%20Components.classes%5B%22@mozilla.org/preferences-service%3B1%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20.getService%28Components.interfaces.nsIPrefService%29%0A%20%20%20%20%20%20%20%20%20%20%20%20.getBranch%28%22custombutton.verticaltoolbar.%22%29%3B%0Abutton.prefs%20%3D%20prefs%3B%0A%0Atry%20%20%20%20%20%20%20%20%7B%20getAttr_pref%28%29%20%7D%0Acatch%28err%29%20%7B%20setAttr_pref%28firstAttributes%29%20%7D%3B%0A%0Afunction%20getAttr_pref%28%29%20%7B%20return%20button.prefs.getComplexValue%28%22attributes%22%2C%20Components.interfaces.nsISupportsString%2C%20supportsString.data%29%3B%20%7D%0Afunction%20setAttr_pref%28a%29%20%7B%20var%20attrString%20%3D%20%22%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21a%29%20%7B%20var%20attr%20%3D%20document.getElementById%28toolbarId%29.attributes%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20%28var%20i%3D0%3B%20i%3Cattr.length%3B%20i++%29%20%7B%20attrString%20+%3D%20%28attr%5Bi%5D.name%20+%20sep%20+%20attr%5Bi%5D.value%20+%20sep%29%3B%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%20attrString%20%3D%20a%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20supportsString.data%20%3D%20attrString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20button.prefs.setComplexValue%28%22attributes%22%2C%20Components.interfaces.nsISupportsString%2C%20supportsString%29%3B%20%7D%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%09%0Avar%20browser%20%3D%20document.getElementById%28%22browser%22%29%3B%0Avar%20toolbar%20%3D%20document.getElementById%28toolbarId%29%3B%0Avar%20toolbox%20%3D%20document.getElementById%28toolboxId%29%3B%0A%0Aif%20%28%21toolbar%29%20%7B%0A%0A%09toolbox%20%3D%20document.createElement%28%22toolbox%22%29%3B%0A%09toolbox.id%20%3D%20toolboxId%3B%0A%09toolbox.palette%20%3D%20gNavToolbox.palette%3B%0A%09%0A%09toolbar%20%3D%20document.createElement%28%22toolbar%22%29%3B%0A%09toolbar.style.minWidth%20%3D%20%2220px%22%3B%0A%09%0A%09browser.insertBefore%28toolbox%2C%20browser.firstChild%29%3B%0A%09toolbox.appendChild%28toolbar%29%3B%0A%0A//-------------------------------------------------------------------------%0A//%20Thanks%20-%20http%3A//nanto.asablo.jp/blog/2007/04/22/1459018%0A%0A%09const%20style%20%3D%27%5C%0A%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%7B%5Cn%5C%0A%09%09-moz-appearance%3A%20none%3B%5Cn%5C%0A%09%09border-bottom%3A%200px%20none%3B%5Cn%5C%0A%09%09border-top%3A%200px%20none%3B%5Cn%5C%0A%09%09border-right%3A%201px%20solid%20rgb%28170%2C%20188%2C%20207%29%3B%5Cn%5C%0A%09%09background%3A%20none%20repeat%20scroll%200%25%200%25%20rgb%28207%2C%20219%2C%20236%29%3B%5Cn%5C%0A%7D%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20toolbarseparator%2C%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20%5Bid%5E%3D%22wrapper-separator%22%5D%20%7B%5Cn%5C%0A%09%09-moz-appearance%3A%20none%20%21important%3B%5Cn%5C%0A%09%09margin%3A%200.2em%202px%3B%5Cn%5C%0A%09%09border-bottom%3A%201px%20solid%20ThreeDHighlight%3B%5Cn%5C%0A%09%09border-top%3A%201px%20solid%20ThreeDShadow%3B%5Cn%5C%0A%09%09height%3A%202px%3B%5Cn%5C%0A%09%09border-left%3A%20none%3B%5Cn%5C%0A%09%09border-right%3A%20none%3B%5Cn%5C%0A%7D%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20toolbarspacer%2C%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20%5Bid%5E%3D%22wrapper-spacer%22%5D%20%7B%20height%3A%2015px%3B%20%7D%27%0A%0A%09var%20sspi%20%3D%20document.createProcessingInstruction%28%27xml-stylesheet%27%2C%0A%09%09%20%20%27type%3D%22text/css%22%20href%3D%22data%3Atext/css%2C%27%20+%20encodeURI%28style%29%20+%20%27%22%27%29%3B%0A%09document.insertBefore%28sspi%2C%20document.documentElement%29%3B%0A%0A//------------------------------------------------------------------------------%0A%0A%09var%20attr%20%3D%20getAttr_pref%28%29.data.split%28sep%29%3B%0A%09for%20%28var%20i%3D0%3B%20i%3C%28attr.length-1%29%3B%20i+%3D2%29%20%7B%20toolbar.setAttribute%28attr%5Bi%5D%2C%20attr%5Bi+1%5D%29%3B%20%7D%0A%0A%09var%20currentSet%20%3D%20toolbar.getAttribute%28%22currentset%22%29.split%28%22%2C%22%29%3B%0A%09currentSet.forEach%28function%28id%29%7B%20toolbar.insertItem%28id%29%3B%20%7D%29%3B%0A%7D%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0Avar%20et%20%3D%20gNavToolbox.externalToolbars%3B%0Avar%20already%20%3D%20false%3B%0Afor%20%28var%20i%3D0%3B%20i%3Cet.length%3B%20i++%29%20%7B%20if%20%28et%5Bi%5D%20%3D%3D%20toolbar%29%20already%20%3D%20true%3B%20%7D%0Aif%20%28%21already%29%20et%5Bet.length%5D%20%3D%20toolbar%3B%0A%0Afunction%20lock%28%29%20%7B%0A%0A%09toolbox.style.maxWidth%20%3D%0A%09toolbox.style.minWidth%20%3D%0A%09toolbar.getAttribute%28%22_width%22%29%20*%20%21toolbar.collapsed%20+%20%22px%22%3B%0A%7D%0Afunction%20beforeCustomize%28%29%20%7B%0A%0A%09toolbox.removeAttribute%28%22style%22%29%3B%0A%09toolbox.removeAttribute%28%22width%22%29%3B%0A%7D%0Afunction%20customizationChange%28%29%20%7B%0A%09window.setTimeout%28function%28%29%20%7B%0A%09%09toolbar.setAttribute%28%22_width%22%2C%20toolbar.boxObject.width%20+%204%29%3B%0A%09%7D%2C%20640%29%3B%0A%7D%0Afunction%20afterCustomize%28%29%20%7B%0A%0A%09setAttr_pref%28%29%3B%0A%09removeListeners%28%29%3B%0A%09lock%28%29%3B%0A%7D%0Avar%20distance%3B%0Afunction%20collapser%28e%29%20%7B%0A%0A%09distance%20%3D%20e.screenX%20-%20browser.boxObject.screenX%3B%0A%09if%20%28toolbar.waiting%29%20return%3B%0A%0A%09if%20%28%28distance%20%3C%3D%20distanceShow%29%20%26%26%20%28toolbar.collapsed%29%29%20%7B%0A%0A%09%09if%20%28showDelay%20%3C%201%29%20%7B%20toolbar.collapsed%20%3D%20false%3B%20lock%28%29%3B%20return%3B%20%7D%0A%0A%09%09toolbar.waiting%20%3D%20true%3B%0A%09%09window.setTimeout%28function%28%29%20%7B%0A%0A%09%09%09if%20%28distance%20%3E%3D%20distanceShow%29%20%7B%20toolbar.waiting%20%3D%20false%3B%20return%3B%20%7D%0A%09%09%09toolbar.collapsed%20%3D%20false%3B%0A%09%09%09lock%28%29%3B%0A%09%09%09toolbar.waiting%20%3D%20false%3B%0A%0A%09%09%7D%2C%20showDelay%29%3B%0A%09%7D%0A%09if%20%28%28distance%20%3E%3D%20distanceHide%29%20%26%26%20%28%21toolbar.collapsed%29%29%20%7B%0A%09%09toolbar.collapsed%20%3D%20true%3B%0A%09%09lock%28%29%3B%0A%09%7D%0A%7D%0Afunction%20removeListeners%28%29%20%7B%0A%0A%09gNavToolbox.removeEventListener%28%22beforecustomization%22%2C%20beforeCustomize%2C%20false%29%3B%0A%09gNavToolbox.removeEventListener%28%22customizationchange%22%2C%20customizationChange%2C%20false%29%3B%0A%09gNavToolbox.removeEventListener%28%22aftercustomization%22%2C%20afterCustomize%2C%20false%29%3B%0A%7D%0A%0Athis.onclick%20%3D%20function%28e%29%20%7B%20%0A%0A%09if%20%28e.button%20%21%3D%200%29%20return%3B%0A%09button.checked%20%3D%20%21button.checked%3B%0A%09toolbar.collapsed%20%3D%20%21button.checked%3B%0A%0A%09if%20%28button.checked%29%20%7B%0A%09%09browser.removeEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09%09toolbar.setAttribute%28%22_checked%22%2C%20%22true%22%29%3B%0A%09%7D%0A%09else%20%7B%0A%09%09browser.addEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09%09toolbar.removeAttribute%28%22_checked%22%29%3B%0A%09%7D%0A%09lock%28%29%3B%0A%7D%0Atoolbar.ondblclick%20%3D%20function%28e%29%20%7B%0A%0A%09if%20%28%20%20%20%20e.button%20%21%3D%202%20%7C%7C%0A%09%09e.target.nodeName%20%3D%3D%20%22toolbarbutton%22%20%7C%7C%0A%09%09e.target.nodeName%20%3D%3D%20%22toolbaritem%22%0A%09%29%20return%3B%0A%0A%09button.click%28%29%3B%0A%09setTimeout%28function%28%29%20%7B%20document.getElementById%28%22toolbar-context-menu%22%29.hidePopup%28%29%3B%20%7D%2C%2050%29%3B%0A%7D%0A%0Aif%20%28%21toolbar.hasAttribute%28%22_checked%22%29%29%20%7B%0A%09browser.addEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%7D%0Aelse%20%7B%20button.checked%20%3D%20true%3B%20lock%28%29%3B%20%7D%0A%0AgNavToolbox.addEventListener%28%22beforecustomization%22%2C%20beforeCustomize%2C%20false%29%3B%0AgNavToolbox.addEventListener%28%22customizationchange%22%2C%20customizationChange%2C%20false%29%3B%0AgNavToolbox.addEventListener%28%22aftercustomization%22%2C%20afterCustomize%2C%20false%29%3B%0A%0Athis.onDestroy%20%3D%20function%28%29%20%7B%0A%0A%09browser.removeEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09if%20%28%21toolbar.hasAttribute%28%22customizing%22%29%29%20removeListeners%28%29%3B%0A%09try%20%7B%20getAttr_pref%28%29%20%7D%20catch%28err%29%20%7B%20return%3B%20%7D%0A%09setAttr_pref%28%29%3B%0A%7D%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%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
И было не плохо если при автоматическим режиме вертикальная панель открывалась поверх страницы а не сжимала страницу как сейчас.
А вот это никак не получается, наверное придётся помощи просить...
Отсутствует
А вот это никак не получается, наверное придётся помощи просить...
Вот css стиль который делает подобное с панелем закладок, может поможет.
#navigator-toolbox > #PersonalToolbar { z-index:10000; position: fixed; visibility: hidden; margin-top: 32px; padding-top: 2px !important; width: 100%; border-bottom:1px solid rgba(0,0,0,0.5) !important; border-right:1px solid #797979 !important; border-left:1px solid rgba(0,0,0,0.4) !important; box-shadow: 0px 5px 5px rgba(0,0,0,0.10) !important; -moz-transition-property: visibility, opacity, margin; -moz-transition-duration: 0.2s; -moz-transition-delay: 0.7s; -moz-transition-timing-function: ease-in-out; } #navigator-toolbox:hover > #PersonalToolbar { visibility: visible; margin-top: 59px; -moz-transition-delay: 0s; }
Отсутствует
bunda1
Спасибо, весёлый стиль, но CSS мне ещё менее понятен, чем JavaScript.
Однако, всё-таки попробую. Фича переключается, если по кнопке: СКМ или Двойной клик.
Код уже совсем стал кривой и неоптимальный...
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%3EVT%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/x-icon%3Bbase64%2CAAABAAEAEBAAAAEAIABoBAAAFgAAACgA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P//gAD//4AAJ/+AAP//gAD//4AA//+AAP//gAD//4AA//+AAP//gAD//4AAEf+AABIAAAAAAAAAAAAAAAD/gAAV/4AAEgAAAAD/gAAQ/4AAEf+AAA//gAAP/4AAD/+AAA//gAAP/4AADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//+sQe//rEHH56xBg8OsQQHDrEEAw6xBEMOsQRDDrEEQw6xBEMOsQRAArEEQAKxBEACsQTkArEH//6xB//+sQQ%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5Bvar%20button%20%3D%20this%3B%0A%0Aconst%20showDelay%20%3D%20555%3B%20//ms%0Aconst%20distanceShow%20%3D%202%3B%0Aconst%20distanceHide%20%3D%2064%3B%0Aconst%20toolbarId%20%3D%20%22vertical_toolbar%22%3B%0Aconst%20toolboxId%20%3D%20toolbarId%20+%20%22_toolbox%22%3B%0Aconst%20img%20%3D%20%22data%3Aimage/x-icon%3Bbase64%2CAAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/4AAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/4AAKP+AAIX/gAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/4AAFf+AABUAAAAAAAAAAAAAAAAAAAAA/4AAJP+AAP//g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1Q//ANX//wDV//8A1Qv/ANUL/wDVDP8A1SH/ANX//wDV//8A1SH/ANUK/wDVD/8A1f//ANX//wDVEQAAAAD/ANUR/wDV//8A1f//ANUm/wDV//8A1f//ANX//wDV//8A1f//ANX//wDV//8A1f//ANX//wDV//8A1RIAAAAA/wDVEv8A1f//ANX//wDVJ/8A1f//ANX//wDV//8A1f//ANX//wDV//8A1f//ANX//wDVEf8A1RIAAAAAAAAAAAAAAAD/ANUV/wDVEgAAAAD/ANUQ/wDVEf8A1Q//ANUP/wDVD/8A1Q//ANUP/wDVDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//+sQe//rEHH56xBg8OsQQHDrEEAw6xBEMOsQRDDrEEQw6xBEMOsQRAArEEQAKxBEACsQTkArEH//6xB//+sQQ%3D%3D%22%3B%0Aconst%20sep%20%3D%20%22%5Cu00A0%22%3B%0Aconst%20firstAttributes%20%3D%20%22id%20%25id%25%20class%20chromeclass-toolbar%20fullscreentoolbar%20true%20context%20toolbar-context-menu%20_width%2020%20customizable%20true%20flex%201%20iconize%20large%20mode%20icons%20orient%20vertical%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%28/%20/g%2C%20sep%29.replace%28/%25id%25/%2C%20toolbarId%29%3B%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0Avar%20supportsString%20%3D%20Components.classes%5B%22@mozilla.org/supports-string%3B1%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.createInstance%28Components.interfaces.nsISupportsString%29%3B%0A%0Avar%20prefs%20%3D%20Components.classes%5B%22@mozilla.org/preferences-service%3B1%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20.getService%28Components.interfaces.nsIPrefService%29%0A%20%20%20%20%20%20%20%20%20%20%20%20.getBranch%28%22custombutton.verticaltoolbar.%22%29%3B%0Abutton.prefs%20%3D%20prefs%3B%0A%0Atry%20%20%20%20%20%20%20%20%7B%20getAttr_pref%28%29%20%7D%0Acatch%28err%29%20%7B%20setAttr_pref%28firstAttributes%29%20%7D%3B%0A%0Afunction%20getAttr_pref%28%29%20%7B%20return%20button.prefs.getComplexValue%28%22attributes%22%2C%20Components.interfaces.nsISupportsString%2C%20supportsString.data%29%3B%20%7D%0Afunction%20setAttr_pref%28a%29%20%7B%20var%20attrString%20%3D%20%22%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21a%29%20%7B%20var%20attr%20%3D%20document.getElementById%28toolbarId%29.attributes%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20%28var%20i%3D0%3B%20i%3Cattr.length%3B%20i++%29%20%7B%20attrString%20+%3D%20%28attr%5Bi%5D.name%20+%20sep%20+%20attr%5Bi%5D.value%20+%20sep%29%3B%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%20attrString%20%3D%20a%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20supportsString.data%20%3D%20attrString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20button.prefs.setComplexValue%28%22attributes%22%2C%20Components.interfaces.nsISupportsString%2C%20supportsString%29%3B%20%7D%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%09%0Avar%20browser%20%3D%20document.getElementById%28%22browser%22%29%3B%0Avar%20toolbar%20%3D%20document.getElementById%28toolbarId%29%3B%0Avar%20toolbox%20%3D%20document.getElementById%28toolboxId%29%3B%0A%0Aif%20%28%21toolbar%29%20%7B%0A%0A%09toolbox%20%3D%20document.createElement%28%22toolbox%22%29%3B%0A%09toolbox.id%20%3D%20toolboxId%3B%0A%09toolbox.palette%20%3D%20gNavToolbox.palette%3B%0A%09%0A%09toolbar%20%3D%20document.createElement%28%22toolbar%22%29%3B%0A%09toolbar.style.minWidth%20%3D%20%2220px%22%3B%0A%09%0A%09browser.insertBefore%28toolbox%2C%20browser.firstChild%29%3B%0A%09toolbox.appendChild%28toolbar%29%3B%0A%0A//-------------------------------------------------------------------------%0A//%20Thanks%20-%20http%3A//nanto.asablo.jp/blog/2007/04/22/1459018%0A%0A%09const%20style%20%3D%27%5C%0A%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%7B%5Cn%5C%0A%09%09-moz-appearance%3A%20none%3B%5Cn%5C%0A%09%09border-bottom%3A%200px%20none%3B%5Cn%5C%0A%09%09border-top%3A%200px%20none%3B%5Cn%5C%0A%09%09border-right%3A%201px%20solid%20rgb%28170%2C%20188%2C%20207%29%3B%5Cn%5C%0A%09%09background%3A%20none%20repeat%20scroll%200%25%200%25%20rgb%28207%2C%20219%2C%20236%29%3B%5Cn%5C%0A%7D%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20toolbarseparator%2C%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20%5Bid%5E%3D%22wrapper-separator%22%5D%20%7B%5Cn%5C%0A%09%09-moz-appearance%3A%20none%20%21important%3B%5Cn%5C%0A%09%09margin%3A%200.2em%202px%3B%5Cn%5C%0A%09%09border-bottom%3A%201px%20solid%20ThreeDHighlight%3B%5Cn%5C%0A%09%09border-top%3A%201px%20solid%20ThreeDShadow%3B%5Cn%5C%0A%09%09height%3A%202px%3B%5Cn%5C%0A%09%09border-left%3A%20none%3B%5Cn%5C%0A%09%09border-right%3A%20none%3B%5Cn%5C%0A%7D%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20toolbarspacer%2C%5Cn%5C%0A%09toolbar%5Borient%3D%22vertical%22%5D%20%3E%20%5Bid%5E%3D%22wrapper-spacer%22%5D%20%7B%20height%3A%2015px%3B%20%7D%27%0A%0A%09var%20sspi%20%3D%20document.createProcessingInstruction%28%27xml-stylesheet%27%2C%0A%09%09%20%20%27type%3D%22text/css%22%20href%3D%22data%3Atext/css%2C%27%20+%20encodeURI%28style%29%20+%20%27%22%27%29%3B%0A%09document.insertBefore%28sspi%2C%20document.documentElement%29%3B%0A%0A//------------------------------------------------------------------------------%0A%0A%09var%20attr%20%3D%20getAttr_pref%28%29.data.split%28sep%29%3B%0A%09for%20%28var%20i%3D0%3B%20i%3C%28attr.length-1%29%3B%20i+%3D2%29%20%7B%20toolbar.setAttribute%28attr%5Bi%5D%2C%20attr%5Bi+1%5D%29%3B%20%7D%0A%0A%09var%20currentSet%20%3D%20toolbar.getAttribute%28%22currentset%22%29.split%28%22%2C%22%29%3B%0A%09currentSet.forEach%28function%28id%29%7B%20toolbar.insertItem%28id%29%3B%20%7D%29%3B%0A%7D%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0Avar%20et%20%3D%20gNavToolbox.externalToolbars%3B%0Avar%20already%20%3D%20false%3B%0Afor%20%28var%20i%3D0%3B%20i%3Cet.length%3B%20i++%29%20%7B%20if%20%28et%5Bi%5D%20%3D%3D%20toolbar%29%20already%20%3D%20true%3B%20%7D%0Aif%20%28%21already%29%20et%5Bet.length%5D%20%3D%20toolbar%3B%0A%0Afunction%20lock%28%29%20%7B%0A%0A%09toolbox.style.maxWidth%20%3D%0A%09toolbox.style.minWidth%20%3D%0A%09toolbar.getAttribute%28%22_width%22%29%20*%20%21toolbar.collapsed%20+%20%22px%22%3B%0A%7D%0Afunction%20beforeCustomize%28%29%20%7B%0A%0A%09toolbox.removeAttribute%28%22style%22%29%3B%0A%09toolbox.removeAttribute%28%22width%22%29%3B%0A%09toolbar.removeAttribute%28%22style%22%29%3B%0A%09toolbar.style.minWidth%20%3D%20%2220px%22%3B%0A%7D%0Afunction%20customizationChange%28%29%20%7B%0A%09window.setTimeout%28function%28%29%20%7B%0A%09%09toolbar.setAttribute%28%22_width%22%2C%20toolbar.boxObject.width%20+%204%29%3B%0A%09%7D%2C%20640%29%3B%0A%7D%0Afunction%20afterCustomize%28%29%20%7B%0A%0A%09setAttr_pref%28%29%3B%0A%09removeListeners%28%29%3B%0A%09lock%28%29%3B%0A%7D%0Avar%20distance%3B%0Afunction%20collapser%28e%29%20%7B%0A%0A%09distance%20%3D%20e.screenX%20-%20browser.boxObject.screenX%3B%0A%09if%20%28toolbar.waiting%29%20return%3B%0A%0A%09if%20%28%28distance%20%3C%3D%20distanceShow%29%20%26%26%20%28toolbar.collapsed%29%29%20%7B%0A%0A%09%09if%20%28toolbar.hasAttribute%28%22_over%22%29%29%20toolbar.style.height%20%3D%20browser.boxObject.height%20+%20%22px%22%3B%0A%09%09if%20%28showDelay%20%3C%201%29%20%7B%20toolbar.collapsed%20%3D%20false%3B%20lock%28%29%3B%20return%3B%20%7D%0A%0A%09%09toolbar.waiting%20%3D%20true%3B%0A%09%09window.setTimeout%28function%28%29%20%7B%0A%0A%09%09%09if%20%28distance%20%3E%3D%20distanceShow%29%20%7B%20toolbar.waiting%20%3D%20false%3B%20return%3B%20%7D%0A%09%09%09toolbar.collapsed%20%3D%20false%3B%0A%09%09%09lock%28%29%3B%0A%09%09%09toolbar.waiting%20%3D%20false%3B%0A%0A%09%09%7D%2C%20showDelay%29%3B%0A%09%7D%0A%09if%20%28%28distance%20%3E%3D%20distanceHide%29%20%26%26%20%28%21toolbar.collapsed%29%29%20%7B%0A%09%09toolbar.collapsed%20%3D%20true%3B%0A%09%09lock%28%29%3B%0A%09%7D%0A%7D%0Afunction%20removeListeners%28%29%20%7B%0A%0A%09gNavToolbox.removeEventListener%28%22beforecustomization%22%2C%20beforeCustomize%2C%20false%29%3B%0A%09gNavToolbox.removeEventListener%28%22customizationchange%22%2C%20customizationChange%2C%20false%29%3B%0A%09gNavToolbox.removeEventListener%28%22aftercustomization%22%2C%20afterCustomize%2C%20false%29%3B%0A%7D%0A%0Afunction%20setIcon%28%29%20%7B%20button.image%20%3D%20%28%21toolbar.hasAttribute%28%22_over%22%29%29%20%3F%20img%20%3A%20imgOver%3B%20%7D%0A%0Afunction%20setModeOver%28off%29%20%7B%0A%0A%09if%20%28off%29%20toolbar.removeAttribute%28%22_over%22%29%0A%09else%20toolbar.setAttribute%28%22_over%22%2C%20%22true%22%29%3B%0A%0A%09if%20%28button.checked%29%20off%20%3D%20true%3B%0A%09%0A%09toolbox.style.position%20%3D%20off%20%3F%20%22%22%20%3A%20%22fixed%22%3B%0A%09toolbox.style.height%20%3D%0A%09toolbar.style.height%20%3D%20off%20%3F%20%22%22%20%3A%20browser.boxObject.height%20+%20%22px%22%3B%0A%0A%09toolbar.style.maxWidth%20%3D%0A%09toolbar.style.minWidth%20%3D%20off%20%3F%20%22%22%20%3A%20toolbar.getAttribute%28%22_width%22%29+%20%22px%22%3B%0A%09%0A%09setIcon%28%29%3B%0A%7D%0A%0Athis.onclick%20%3D%20function%28e%29%20%7B%20%0A%0A%09if%20%28e.button%20%3D%3D%201%29%20%7B%0A%09%0A%09%09setModeOver%28toolbar.hasAttribute%28%22_over%22%29%29%3B%0A%09%09setIcon%28%29%3B%0A%09%09return%3B%0A%09%7D%0A%09if%20%28e.button%20%21%3D%200%29%20return%3B%0A%09button.checked%20%3D%20%21button.checked%3B%0A%09toolbar.collapsed%20%3D%20%21button.checked%3B%0A%0A%09if%20%28button.checked%29%20%7B%0A%09%09browser.removeEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09%09toolbar.setAttribute%28%22_checked%22%2C%20%22true%22%29%3B%0A%09%09var%20over%20%3D%20toolbar.getAttribute%28%22_over%22%29%3B%0A%09%09setModeOver%28true%29%3B%0A%09%09over%20%3F%20toolbar.setAttribute%28%22_over%22%2C%20over%29%20%3A%0A%09%09toolbar.removeAttribute%28%22_over%22%29%3B%0A%09%09setIcon%28%29%3B%0A%09%7D%0A%09else%20%7B%0A%09%09browser.addEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09%09toolbar.removeAttribute%28%22_checked%22%29%3B%0A%09%09setModeOver%28%21toolbar.hasAttribute%28%22_over%22%29%29%3B%0A%09%7D%0A%09lock%28%29%3B%0A%7D%0Athis.ondblclick%20%3D%20function%28e%29%20%7B%20setModeOver%28toolbar.hasAttribute%28%22_over%22%29%29%3B%20%7D%0A%0Atoolbar.ondblclick%20%3D%20function%28e%29%20%7B%0A%0A%09if%20%28%20%20%20%20e.button%20%21%3D%202%20%7C%7C%0A%09%09e.target.nodeName%20%3D%3D%20%22toolbarbutton%22%20%7C%7C%0A%09%09e.target.nodeName%20%3D%3D%20%22toolbaritem%22%0A%09%29%20return%3B%0A%0A%09button.click%28%29%3B%0A%09setTimeout%28function%28%29%20%7B%20document.getElementById%28%22toolbar-context-menu%22%29.hidePopup%28%29%3B%20%7D%2C%2050%29%3B%0A%09setModeOver%28%21toolbar.hasAttribute%28%22_over%22%29%29%3B%0A%7D%0A%0Aif%20%28%21toolbar.hasAttribute%28%22_checked%22%29%29%20%7B%0A%09browser.addEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%7D%0Aelse%20%7B%20button.checked%20%3D%20true%3B%20lock%28%29%3B%20%7D%0A%0Aif%20%28toolbar.hasAttribute%28%22_over%22%29%29%20%7B%20setModeOver%28false%29%3B%20lock%28%29%3B%20%7D%0A%0AgNavToolbox.addEventListener%28%22beforecustomization%22%2C%20beforeCustomize%2C%20false%29%3B%0AgNavToolbox.addEventListener%28%22customizationchange%22%2C%20customizationChange%2C%20false%29%3B%0AgNavToolbox.addEventListener%28%22aftercustomization%22%2C%20afterCustomize%2C%20false%29%3B%0A%0Athis.onDestroy%20%3D%20function%28%29%20%7B%0A%0A%09browser.removeEventListener%28%22mousemove%22%2C%20collapser%2C%20false%29%3B%0A%09if%20%28%21toolbar.hasAttribute%28%22customizing%22%29%29%20removeListeners%28%29%3B%0A%09try%20%7B%20getAttr_pref%28%29%20%7D%20catch%28err%29%20%7B%20return%3B%20%7D%0A%09setAttr_pref%28%29%3B%0A%7D%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%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
Отредактировано Dumby (17-10-2012 05:40:37)
Отсутствует