bunda1 за 2 ответа спасибо.
Как в этой кнопке (прогресс бар) сделать цвет линии индикатора просто темнее (темно-зеленого цвета)?
https://forum.mozilla-russia.org/viewtopic.php?id=62808&p=1
Отсутствует
Есть кнопка
// Контекстное меню "Открыть как ссылку" (function() { if ( document.getElementById("go2link") ) return; var menuItem = document.createElement("menuitem"); menuItem.id = "go2link"; menuItem.setAttribute("label", "Перейти по ссылке"); menuItem.setAttribute("class", "menuitem-iconic"); menuItem.setAttribute("image", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACIUlEQVQ4jZ2STUtUYRSAn3vfj3tnnBybUdEKTZ2gJjDQ/AHt3PWhTNAmadsq2tUPadG2JGWwRZugRbSKSAqHmkUpVMagoo7a1Rnv3Pu+LdJQYYQ6u8N5znM4nOPQJPLj079c1/1ijLlTLhbmmnFuswKQwuGSK9xn+fHpgf8RcHGoVyTbTpx3hfsuPz6d+2fBZhDRf66TdEc6K5QsDd6aGT3KOJncXatbMqiWNNJPIbSP0AqhFReGB4hjQ+dJn6XlLb4vrBiL86r09NroIUH+6k2kcJBSoJWL1gJrQQqXza06rnDItHrUd0KWK1W2g93Z0uT1EQC5b6qUPuOl2tBJHy/p4adTaP2nLIVLUI/ozCTpP93Kh0+Vy8MTL9biRjQmwQKwXd0gjhWNyBBGlkgo/IRFKwGAVoLQwHotoqennW8Ly5lGLF66e/0AWCwH86NRq0dIx2GpUiXYDqOu3o6Bvyv0DA3iJRIIJdFKoH2JtRAE4b6dbKti/usKqytbi6dy3bnnD0ZCCZafs+/RyRTKb0F5HspTKE/R3deF6zokfUkqIZn7uEjYiGdKkzfGSnuDJXClVl0nCg3Ktwgd7Z1Rvs6eiWnPJnGsZfbtvMVx3pgonjj0B832zY9N2b7BszSCHSo/1izw2MTmYblYWD3IySb9AKxUqtQ2AmOMfYK198vFQnCUOVZQ2wh2TWzulYuFR82Y5gLHMSY2t8vFwtRxQ34DLk/NkLifJmMAAAAASUVORK5CYII="); // menuItem.setAttribute("oncommand", "gBrowser.addTab(document.commandDispatcher.focusedWindow.getSelection().toString())"); menuItem.setAttribute("oncommand", "gBrowser.addTab(document.commandDispatcher.focusedWindow.getSelection().toString());gURLBar.handleCommand();"); document.getElementById("context-copy").parentNode.insertBefore( menuItem, document.getElementById("context-sep-open") ); document.getElementById("contentAreaContextMenu").addEventListener("popupshowing", function() { menuItem.hidden = !gContextMenu.isTextSelected; }, false); })();
Отсутствует
Ultima2m
эт плохая кнопка, эт я её собирал когда-то и она работала когда был TabUtils установлен. Ну как плохая, работает как надо убери gURLBar.handleCommand(); Но оно будет открывать вкладку только если выделение ссылка, иначе покажет вкладку "URL недействителен и не может быть загружен." - Ну так и отпрась его в поиск в текущем активном поисковике - так нееееет, надо эту дураццкую вкладку показать.
Смысл был в том, чтоб сделать как в Опере - "открыть выделение как адресс в интронете" - Опера сама определяла как поступить. Сылка это или нужно идти в поиск(проверяет про RegEx , посылая DNS запрос или еще как, хз.) С Мозиллой надо самому это все определять как открывать getBrowser (). addTab (url); или надо идти в поиск. сама мозилла тупизень в этом отношении и это ужасно Когда стоит TU это штука работает почти как дОлжно(без того крайнего gURLBar.handleCommand(); .
Осталься просто как пример создания пункта меню с действием.
Отредактировано mokujin (18-01-2018 19:07:42)
...программисты словно войну какую-то ведут за свои обновления. Блин, почему сейчас повсюду мания ухудшать интерфейсы и делать их максимально неудобными?! Radiation
Отсутствует
будет открывать вкладку только если выделение ссылка,
Ну да. Так смысла особого нет. Текстовые ссылки и линкификаторы обрабатывают, а в поиск выделенное проще жестом закинуть.
Но идея была интересная.
Отсутствует
mokujin пишетбудет открывать вкладку только если выделение ссылка,
Ну да. Так смысла особого нет. Текстовые ссылки и линкификаторы обрабатывают, а в поиск выделенное проще жестом закинуть.
Но идея была интересная.
// Контекстное меню "Открыть как ссылку" (function() { if ( document.getElementById("go2link") ) return; var menuItem = document.createElement("menuitem"); menuItem.id = "go2link"; menuItem.setAttribute("label", "Перейти по ссылке"); menuItem.setAttribute("class", "menuitem-iconic"); menuItem.setAttribute("image", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACIUlEQVQ4jZ2STUtUYRSAn3vfj3tnnBybUdEKTZ2gJjDQ/AHt3PWhTNAmadsq2tUPadG2JGWwRZugRbSKSAqHmkUpVMagoo7a1Rnv3Pu+LdJQYYQ6u8N5znM4nOPQJPLj079c1/1ijLlTLhbmmnFuswKQwuGSK9xn+fHpgf8RcHGoVyTbTpx3hfsuPz6d+2fBZhDRf66TdEc6K5QsDd6aGT3KOJncXatbMqiWNNJPIbSP0AqhFReGB4hjQ+dJn6XlLb4vrBiL86r09NroIUH+6k2kcJBSoJWL1gJrQQqXza06rnDItHrUd0KWK1W2g93Z0uT1EQC5b6qUPuOl2tBJHy/p4adTaP2nLIVLUI/ozCTpP93Kh0+Vy8MTL9biRjQmwQKwXd0gjhWNyBBGlkgo/IRFKwGAVoLQwHotoqennW8Ly5lGLF66e/0AWCwH86NRq0dIx2GpUiXYDqOu3o6Bvyv0DA3iJRIIJdFKoH2JtRAE4b6dbKti/usKqytbi6dy3bnnD0ZCCZafs+/RyRTKb0F5HspTKE/R3deF6zokfUkqIZn7uEjYiGdKkzfGSnuDJXClVl0nCg3Ktwgd7Z1Rvs6eiWnPJnGsZfbtvMVx3pgonjj0B832zY9N2b7BszSCHSo/1izw2MTmYblYWD3IySb9AKxUqtQ2AmOMfYK198vFQnCUOVZQ2wh2TWzulYuFR82Y5gLHMSY2t8vFwtRxQ34DLk/NkLifJmMAAAAASUVORK5CYII="); menuItem.onclick =()=> { gClipboard.write(document.commandDispatcher.focusedWindow.getSelection().toString()); BrowserOpenTab(); goDoCommand("cmd_paste"); gURLBar.handleCommand() }; document.getElementById("context-copy").parentNode.insertBefore(menuItem, document.getElementById("context-sep-open")); addEventListener("popupshowing", ()=> menuItem.hidden = !gContextMenu.isTextSelected, false, document.getElementById("contentAreaContextMenu")); })();
Отредактировано bunda1 (18-01-2018 19:36:04)
Отсутствует
bunda1
и так я тоже тогда пробовал не оно. так у мя отрывается просто новая вкладка в которой SpeedDial загружается. Ежлиб знать ту внутр. ф-цию в FF\PM что проверяет выделение и выбирает показывать или нет те самые пункты меню "Открыть ссылку в новой вкладке" и др.. Вызывать её сначала, проверять что она скажет на выделении, а дальше или открывать адресс или делать поиск по фразе в активном поисковике(это тоже хз. как, но примеры где-то были тут).
На истену не претендую , слабоват я в JS сильно ... кажеццо что так примерно должно_быть\нужно_делать_в_мозилла: колбасить выделение и потом грузить loadOneTab со всей той кучей параметров, ибо отрываться должно в фоне, иначе не нужно оно.
А прекратил пробовать(не получилось ничего у мя), ибо поставил ContextSearchX и ищу с ним, а выделение если ссылко - бравзер пункты выдает. т.е. все вродеб как есть, но раскидано. не очень это удобно.
Отредактировано mokujin (18-01-2018 20:57:15)
...программисты словно войну какую-то ведут за свои обновления. Блин, почему сейчас повсюду мания ухудшать интерфейсы и делать их максимально неудобными?! Radiation
Отсутствует
bunda1 за 2 ответа спасибо.
Как в этой кнопке (прогресс бар) сделать цвет линии индикатора просто темнее (темно-зеленого цвета)?
https://forum.mozilla-russia.org/viewtopic.php?id=62808&p=1
Открой в браузере:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAADCAYAAABPsHHBAAADDElEQVRYhe3Y+U/TdxzHcf+GKYNSoBQoUMtValtpgdZCa60wKFBtAQFndkSzw+ye12Z2GjXOEGOMMcb4zwxK+dJSncect5tzbut9P/cD137QRDRbRb8/PH5/fd755HO8VvVMNPPC+rGZngl1/nOI/jevTahFz4Wmp9L9CPlfy0ryuNnmO9dK8vR7N//Z82Hh/NXQM6Ghd1JD7+S6Rc5JLU6vFqdXh9Oro8+ro8+rp8+rp39KT//U+kUDUy3zDAz4DLh8Blw+Iy6fkS0+I1umWxdtnW5bIrTjFtpxCybcggmPYMIjmPEIZgZnzAzObJhnYXDGwpDfwpC/gyF/B8P/si3QOc/KtoCVkYCVkYBtzqyN0dmNi8Zm7YwG54wFN81zMBZ0sP2CA/l4GasWLqWuySa6vE04vI04phqx+xqw+xqwTddhE+qxCnV0ztTR4Vdh8avYEFiLeVaJKaikPVhL24VaWi/WYLxYg+GnalouVbP+sgL9ZQW6K1Vor1ax7molmp8raL5WgfqanKZf5DReL6fhejn1N2TU3ZShulXG2ltlKG+XUnunhJo7JVTflaK4J6XqXjGVvxZT8ZsE+X0J5feLkP1eRNmDQkofFFLyx6tIHxZQ/LAAyZ9rKPprDYV/r54TEr0cXhGJRCLRf2o1klAB0lAhpSEJspAUebiUyrAMRVhOTbgSZViBKlxLfURJQ0SFOlJPc6QRbUSNLqKhJarFENXTGm2hPWrEHG3DEjPRGbNgi3Vgj1lxxDbSFdtEd3wzvfFu+uK9DMSduOL9uOMuPImtDCc8jCSGGU2MsD0xyo7k67yR3MFbyTfZmXybXcmdvJPcxXupd9mdep8PUrv5KPUhn6Q+5rPUp+xJf86+9F4OpPfzZfoLDqYP8nXmK77NfMP3me84lDnEkcxhjmaO8kP2GMezxxnPjnMie4KT2ZOcyp7idO40Z3JnOJs7y7ncOc7nzi89sESiF0H+f3KiJWKD9XzNPd+5VhKxwVqehTP42RqsgWdosNzLaLCGlt1gWR/RYNmfqMH6B9+z4Mt4YIdNAAAAAElFTkSuQmCC
Потом загрузи изображение линии индикатора на диск и измени его цвет в редакоре изображений, потом исползуй кнопку Кодировать изображение или текстовой файл в base64 и перекодируй изоброжение в base64, потом скопируй полученый base64 код в background: #4fca32 url("тут скопируй с заменой старого значения") no-repeat right;\
Всё просто
Отсутствует
Помогите, если не трудно. Как сделать с помощью СВ скриншот активного окна (Мозиллы) или как нажать сочетание клавиш Alt+PrtScr методом СustomВuttons? Спасибо.
Отредактировано dedfor (22-01-2018 16:43:08)
Отсутствует
Как сделать с помощью СВ скриншот активного окна (Мозиллы)
Добрый день. У меня есть вот такая многофункциональная кнопка. Кнопка большая и если можно так сказать "тяжёлая" но в ней есть всё что касается скриншота активного окна .
self.label = "Save"; self._handleClick =()=> menuPopup.showPopup(this, -1, -1, "popup", "bottomleft", "topleft"); self.image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAACXBIWXMAAAsSAAALEgHS3X78AAACpklEQVQ4jXWRz4tXZRTGP+f9ce977/3aRDKD4JA5KIiIRRG4miBqJME2oYH4H7SKaBFiCxeCuksXUxRBbcKdW4Vx0UIwRkRb6MaJEcRR5us4zsz3x73ve1zcZiS/9MCBszkfnvM8AoCMf0Dn8OcIAxERrWFqv2H3Ls9wCN4qVQGLS7XemRer8cUa61dm0dQDFQDY/es8n/SV6aXoPn2mfLisv1zt66YedlUv/6U6d7+nYeZJ5ON1lclTl1oDIgZcYOLAdsIG5MNIPojk/WhNjKARNP55dxCPf/0w3l9YjDYMlGy15v0zX7Hz2wuoqgGUIFCUUARLESxlYZNxFsSC2KH1ljfH7PLzDat5sOTBalnD1IljYIIDFcoAVQ4+QchAFckNmxrrvODQwSWG/afEci9kmZB7CJJAcAAEC9uA5YTWNQD3FoX5CcPiSkP3eY8v3utzd6FDnXkITskRKm8AHAgUwBggHh1GTAXnr8O5uQQYMNuB8XbdBmIUzQWKtpjWSUnrxDhSJwMDCK+kr9YUgbUInX/vtiCVQAluhzDd3GZ8bYXGuP9wQDGqrIWC6zvfpbdikaLlOwCbReIEHJn7g99+PEEjgqjyupKxlCnyzbGzzB7/DvMgEdtgBaksJJieOcTYyWv06gwvo5CoQu4bPtuYZLYL2rHQpgbk7Ts6NQlVhSfhDKMjCUJA9r3T5hFez8SDaALnaQoDRkadJMVmjhQVPFButVPju49Ss2cvJkbln0dJVvuINSMQSQpVBgf2qdmT428+TgMaHKDNxXlj9SP8l0E4PGNsD1qGtvFvmlKBHNxSlrLfobl02wDqEAap+/PpeDH//m/ztt46+hYr6+CsINKOqqIKMSXeCHDjxir9HxbELP90BhhsPS5gR/v4f0nrMwK8BIfmEF9f/5BGAAAAAElFTkSuQmCC"; var pref = "CB.Shortcuts.pathToSaveShortcuts"; var faviconFolder = "C:\\Documents and Settings\\Favicon\\"; // папка для сохранения иконок для ярлыков и ярлыков сайтов var alertsService = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService); // Создать меню для кнопки ............. var array = [ { label: "Сохранить страницу в html одним файлом", func: "runSaveSnapshotToHtml()", image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACaUlEQVR4AX3BTWvcVRTA4d+592am/5lp0qSxtEtRxI0oVmipuBFEEDfd1IUvCz+RO3du/QAqCgUjxULdWKFV8AUkapg0pplM5uX/cu85x7RQlDb4PPL62++8ubq68cLZjXPnY2hnKYk4JxMgZ/fpvHe6bo72tr745OO0trb+4pVLb1x7/92rFzfXIQr/a1kbX34T2Lrx2d350Uefpq4znc6y/b0Ho8oZVII5J4oC81qZTAL1YhmAXnK12LUqB1O40Br9fkQLT3DAIjQNLBsw1wBIKmahbkucTKFtjdxFioI7T4gRcnG0tJgVASSVUmKXS6hrJXeQC+QC5iD8h0NaAS2Cu6FFAxCCqkZVDWYKIjwiPEZ4SBzMCmo5AJJULWIau7ZlZ6zMZhV1q5g5j0sxcP+gpl4qZhqAmLTkBBbNnZvfjTk8zBxMWprWcAd3HhJxhoNEVSWGowsE0QBI6nIOajnEFEkp8Orl8wxHQ4QCKCJOjByL/PLbnB/u7DIYRFRLAELKucSmzuHPnTmT/TFX33qK61vbLGp479qzbG70eGR9NXHj258Yjc7h5gEIIecS6yaHxaJlWS9ZLjPf3x5z89Yuh9PMA/cnsLsPh9NMFMetYFYCEII7vRh7vapaReQUm2d6fPjBZV678hxrp3s80O9DFJBwin5/QFWtEWMvATGpFp8e3bOd8W0O9u/w1deZiy8/zysvLfj19xk//mzMF4W2c7b/2NPtv+52Kk11eHSPYyKD1bOXzMozpbRPSwjkpgiChJWAZ8UViBwTQSSnldjgVsXUm5Wm+Vz41xDoAwIETuaAAy3QAf4PtuhVEPpvXZEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAAElFTkSuQmCC"}, { separator: ''}, { label: "Сохранить значок веб-сайта", func: "saveFavicon()", image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAACPVBMVEX09ff////C3L+Uq8+Vq8+Uqs+Zr9CZrtCZr9Gfu+ear8+mt9JRf8ORxl3t8vfF06+Twojs8/d9otl8o9s+aquZrs/X9KLp8Pft8fZhisf//+DBzN2hveihv+pii8hti9pgicl6oNlojs1zncNsi836/P2duebx8/eYyWqBp+Gn0IKBvlKHsm9qmaVuk8zt7/FEbauEv1Tp7/JdhL9oi9Pl8e2LwlmdsdD7/P76+/3H7ofo8+peh8eHwFaSteZ0pkp2gl7q8/Ohy5OApt2by2eZuOqbuOWaezWuvtd7nN2HvWxul9Ty9feQxV5ljcqBp+JEcLCVtOOo0nR7odx5n9suX6Z1mtBzmtSXyGPv9PewzfOzx+O6zu/s8fd9o95Xfrthi8lYhMN5oNnw9ffw9Pjw9Pf8/f6ewO/m8O9zmdE6aapsjdyUwouPxWPDzd6XteOSs9B5nNVpnpqHt7h/s6F6n9d7ntSTttGHwVh4qp+Ev1HH7ox6qk5wj+Hm8e3t9fOm0IKAtqOBpNrx+P9ljcyhs9FpkM2hv+/u8/fF0eOLu4N+vFKgzX3p9OSFqN13qExekIl4n9j7/P3x9PhxmNDm8e9Vg8Zfkozr8veq0YTX9qL//92AtamOwnHFz96Fot1diMh+pd13ntmatu+YyW/3+/+Tqs5UgcShzJNbhsdTf8GHs7bo8PaXtuqMr+Ty8/SZt+SUqs7r7Ox3ndb9/f7t8feZyXGYyWWCpNbz9PRuiteNtNDn7/V4ntjx8fGo3JqNAAAAv3RSTlP/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AEVuhDkAAAD+SURBVBhXY5jHzcUMAqxAICq9bx8D96adDFAgaGQOFOBaH7h7zoqZDTlFyptncAAFWBjyi52CXCI0unRLxcECPhsatbbzmlXMnS60hg0kkOxW0uNrq93tNaFpD1ggUm21QK532ZQdSm1hmXKdDCwdnOWVOi1RjNGMQCCrwMDMJ8NZ4LAynVGPkXFp8zpJBubYmn579wXtqhZb0iwn9a1iWLaViYmJ3891obOwYtLEvcYMGyWAAkwJdv6accEhi8LjGVr11SenpC5f61g3NcO0vjCAIc+DjZ2dnWexddWSbYa9nlkM+8BgWsxsK7FZ1VLzRaACNokmtdnyu1QMQgF7Rlh4zWWTAwAAAABJRU5ErkJggg=="}, { label: "Запомнить значок веб-сайта как base64", func: "copyFaviconData()", image: "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAAAAAAAAAAAAAI2bv/9RVpf/AAAAAAAAAAAAAAAAAAAA/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/AAAAAAAAAACIkvD/Jia6/ywpq/8AAAAAAAAAAAAAAAAAAAD/AAAA/wbwAf90qpv/Ymic/1RWqP9OUKr/W2Ch/2dumf9YYKT/Ly/B/xQP3/8MB9P/JCGb/wAAAAAAAAAAAAAAAAAAAP8G8AH/U5ea/ycr8f8VIP3/HiP4/ywo8v8sIvb/LCL2/ywi9v8KBOj/BQDe/wQAtv8tK4P/AAAAAAAAAAAAAAD/BvAB/3Sqm/9iaJz/Tim3/0UuuP9GPrT/R0ex/zk8uf8gIMz/FRDe/xEMzv8jIJz/AAAAAAAAAAAAAAAAAAAA/wbwAf8G8AH/BvAB/wAAAAAAAAAAAAAAAAAAAP8AAAD/SqOR/yImvP8sLKj/AAAAAAAAAAAAAAAAAAAAAAAAAP8G8AH/BvAB/wbwAf8AAAD/AAAA/wAAAP8AAAD/BvAB/3Sqm/9KW5r/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8G8AH/BvAB/wbwAf8AAAAAAAAAAAAAAAAAAAAABvAB/wbwAf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/BvAB/wbwAf8G8AH/AAAAAAAAAAAAAAAAAAAAAAAAAAAG8AH/AAAAAAAAAP8G8AH/AAAAAAAAAAAAAAAAAAAA/wbwAf8G8AH/BvAB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8G8AH/BvAB/wAAAAAAAAAAAAAAAAAAAP8G8AH/BvAB/wbwAf8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/BvAB/wbwAf8AAAAAAAAA/wAAAP8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/AAAAAAAAAAAG8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOesQQBjrEGAAaxBwACsQcABrEHDg6xBwAesQcAPrEHAD6xBw8+sQcPprEHD8axBwAGsQQABrEGAAaxB//+sQQ=="}, { separator: ''}, { label: "Сохранить ярлык страницы как…", func: "saveShortcuts('true')", image: "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADzqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA/5XLDv/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA/5XLDv8E/yT/lcsO//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA/5XLDv8E/yT/BP8k/wT/JP+Vyw7/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA/5XLDv8E/yT/BP8k/wT/JP8E/yT/BP8k/5XLDv/zqgD/86oA//I1///yNf//86oA//OqAP/zqgD/86oA//OqAP+Vyw7/lcsO/wT/JP8E/yT/BP8k/5XLDv+Vyw7/86oA//OqAP/yNf//8jX///OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP+Vyw7/BP8k/5XLDv/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/lcsO/wT/JP+Vyw7/86oA//OqAP/zqgD/86oA//02AP/9NgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA/5XLDv8E/yT/lcsO//OqAP/zqgD/86oA//OqAP/9NgD//TYA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP+Vyw7/BP8k/5XLDv/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/lcsO/wT/JP+Vyw7/86oA//OqAP/zqgD/86oA/wA31v8AN9b/86oA//9If///SH//86oA//OqAP/zqgD/86oA/5XLDv8E/yT/lcsO//OqAP/zqgD/86oA//OqAP8AN9b/ADfW//OqAP//SH///0h///OqAP/zqgD/86oA//OqAP+Vyw7/BP8k/5XLDv/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/lcsO/5XLDv+Vyw7/86oA//OqAP/zqgD/86oA/0CA//9AgP//86oA/07+9f9O/vX/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP9AgP//QID///OqAP9O/vX/Tv71//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/86oA//OqAP/zqgD/AACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQ=="}, { label: "Сохранить ярлык страницы без запроса на сохранение", func: "saveShortcuts()", image: false}, { separator: ''}, { label: "Сохранить всю страницу как PNG", func: "WebScreenShot.captureAll()", image: "data:image/x-icon;base64,AAABAAEAEREAAAEAIADwBAAAFgAAACgAAAARAAAAIgAAAAEAIAAAAAAAyAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAzAAAAiAcFBa4KCQmvCgkJrwoJCa8KCQmvCgkJrwoJCa8KCQmvCgkJrwoJCa8KCQmvCgkJrwsJCaECAQE/BQMDAAAAAJUgICD4V1ZW/2FhYf5hYWH/YmFh/2BgYP9fX1//X19f/19fX/9gYGD/YmFh/2FhYf9gYGD+ZmVl/1RSUuIVFBQtCgkJy1paWv+Li4v9h4eH/oiIiP6FhYX+i4uL/pKSkv6Sk5P+kpKS/ouLi/6FhYX+iIiI/oiIiP6Hh4f7lZaW/25tbYQNDQ3OcHBw/5KSkv6Li4v/i4uL/5mZmf+EhIT/ZGRk/1tbWv9kZGT/hISE/5mZmf+Li4v/jY2N/4yMjPyWl5f/iomJjQ4NDc13d3f/m5ub/pWVlf+goKD/XFxc/ygoKP8fHyD/GBsb/yAhIv8pKSn/W1tb/6CgoP+Wlpb/lpaW/J6env+Jh4eMDg4OzX1+fv+ioqL+qqqq/1hYWP8ZGRn/Ghwb/x4dHP8mIh//FhQR/xUWF/8aGhr/WFhY/6urq/+cnJz8pKSk/4qJiYwPDg7Ng4OD/7W1tf6MjIz/Ghoa/xYYGP8uKCb/ZEAo/5xyOP++saL/RD45/xISE/8bGxv/jY2N/6+vr/ypqan/ioiIjA8PD82IiIj/xMTE/l1cXP8LDAz/JiId/1o3LP9ADgD/mGog//Dt6P/VysX/Ih4Z/wsMDf9eXl7/v7+//K6urv+KiYmMEA8PzY+Pj//Kysr+SEhH/wEDBv9MPi7/hlES/3dCAP+VZAn/tJVO/7eVXf9OQTL/AAIE/0pJSf/FxcX8tLS0/4qJiYwQEBDNm5ub/9/e3/5SUlL/AAAA/0M7Mf/aya7/ybiO/5RmEf9aIAD/cjkX/z80KP8AAAD/U1JS/9nZ2fzAwMD/i4qKjBEREc2oqKn/8O/w/oeGhv8AAAD/DAsK/6qkof/17uj/nW8l/14eCf9hPTr/ExUU/wAAAP+Hh4f/6urq/MzMzf+Mi4uMERERzbCwsv/r6uz+3Nzd/yoqKv8AAAD/ExEP/2heU/9yWjv/UD0u/xcXFv8AAAD/Kioq/93d3v/l5eb81NTV/4yLi4wSERHNuLm5/+/v8P7z8/P/xsbG/yAgIP8AAAD/AQEB/wAAAP8BAQH/AAAA/yAgIP/Gxsb/9PT0/+np6vzb29v/jIuLjBIREc2+vb7/+Pj5/uvr7P/7+/v/4ODg/3Nyc/8uLi7/Hh4d/y0sLP9zc3P/4ODg//v7+//s7O3/8/P0/OHg4f+Mi4uLFBMTyMPDw//////7+Pj4/ff29v38/Pz9/////fr6+v3u7u79+vr6/f////38/Pz99/b2/fn5+f37+/v53t7e/5KSko4GBgZ7m5yc//j4+P/w8fH/8fLy//Dw8P/u7u7/8vLy//X19f/y8vL/7u7u//Dw8P/x8vL/8vLy/uXl5f/BwcH+k5GRUAAAAAQeHR1yb25uxn59fcZ9fHzGfXx8xn18fMZ9e3vGfHt7xn17e8Z9fHzGfXx8xn18fMZ9fHzGgH9/xYmIiGVaV1cAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="}, { label: "Сохранить видимую часть страницы как PNG", func: "WebScreenShot.capturePage()", image: false}, { label: "Сохранить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r/+vn4//r5+P/6+fj/+vn4//r5+P/6+fj/+vn4//r5+P/6+fj/+vn4//r5+P/6+fj/+vn4//r5+P/6+fj/+vn4//r5+P/6+fj/+vn4//r5+P/6+fj/+vn4//r5+P/6+fj/+vn4//r5+P/6+fj/4n0O//X08v/8+/r/6KFU/+J9Dv/ifQ7/4n0O/+J9Dv/ifQ7/4n0O/+J9Dv/ifQ7/4n0O/+J9Dv/ifQ7/4n0O/+J9Dv/ifQ7/4n0O/+J9Dv/ifQ7/4n0O/+J9Dv/ifQ7/4n0O/+J9Dv/ifQ7/4n0O/+J9Dv/ifQ7/4n0O/+J9Dv/ooVT//Pv6/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="}, { label: "Сохранить выбранную область страницы как PNG", func: "WebScreenShotByClipping.init()", image: "data:image/x-icon;base64,AAABAAEAEREAAAEAIADwBAAAFgAAACgAAAARAAAAIgAAAAEAIAAAAAAAyAQAAAAAAAAAAAAAAAAAAAAAAADDn2Hfz5pE/8eVQP7IlkH/yJZB/8iWQf/IlUH/yJVA/8iVQP/IlED/yJQ//8iUP//IlD//yJM+/8iTPv/Hkj3/nI1w//bDbP//8OH//+zW///s1///69b//+rV///p1P//59L//+XQ///izf//38n//9vG///ZxP//1b///dG////Prf/KlkX/88N4/v37///99Pj//fT6//vy9v/68fT/+u/y//rt8P/66u3/+ufq//rl6P/64eT/+93h//3a3//71d7//9LK/86XR//0xHb//vv////18///9fT///f5///4////9f7///P8///v+f//7Pb//+nz///m8f//4eb//9vZ//3Y2v//1Mb/zphH//TGd//+/////Pj1///7///Q58r/m9aV/6TZnv+i15r/otWY/6LTlv+j0pb/mc6M/9DXuf//3+P//Nnc///Wyf/OmUf/9MZ3//7////8+/j//////53WnP+Y5pn/rvGv/6PvpP+e7p//me6b/5nvm/95533/mM+L///j7f/629z//9jL/86ZR//0xnf//v////z9+v//////qtup/8Xzxf/a/tn/z/vO/8n7yf/D+sL/xPvD/6Hzo/+j05b//+Tu//re3///2cz/zplI//XGeP/+/////P36//////+n26f/uvC6/9T71P/K+Mr/xvjG/8D3wP+/+L//nfCf/6LTlf//5u//+t/g///cz//OmUj/9MZ3//7////8/fr//////6rcqv/G9MX/3//f/9n92f/V/NX/0PzQ/9H+0P+s9a7/pdSY///o8f/64OL//9zP/86aSP/0xnf//v////z9+f//////ndid/5TjlP+v7q//qeyp/6jsqf+k7KX/p+6n/4Tlh/+Z0Y7//+r0//rh4v//3tH/zppI//TGd//+/////v77///////Y8Nj/p9+n/6/jr/+t4a3/rd2p/67bpv+u2ab/p9Wc/9jgx///6Oz//OPl///e0f/Omkj/9MV1//7//////fr///78///+/f///////////////////P////j////0+///8fn//+vu///m4v/94+P//97P/86ZSP/zx3v//v/////+/f///////f////v////7////+/////v+///7+///+/f///vz/P/98Pr//+33//3p9///5OL/zppL//a1Sv/0xoL/9cR7//XEfP/1xHz/9cR8//XEfP/1xH3/9cR8//XCev/1wXr/9b94//W9d//1u3X/87l0//y6bP/Llj7/+pMA/vWBAP/1gwD/9YMA//WDAP/1gwD/9YMA//WDAP/1gwD/9YQA//WEAP/1hAD/9YQA//WEAP/zhAH//okA/8qLIv3xpzP/4ptV/+OdU//jnVP/451T/+OdU//jnVP/451T/+OdU//jnVL/451S/+OdUv/jnVL/451S/+GdVf/qnUf/2aRJ/9q0c9/8yn7/98V5/vjGev/4xnr/+MZ6//jGev/4xnr/+MZ6//jGev/4xnr/+MZ6//jGev/4xnr/+MZ6/vrIe/+jj2y4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="}, { separator: ''}, { label: "Сохранить всю страницу как PDF", func: "savePageToPDF()", image: "data:image/x-icon;base64,AAABAAEAEREAAAEAIADwBAAAFgAAACgAAAARAAAAIgAAAAEAIAAAAAAAyAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYUw4pJt3V/+Rb1D8lnFP/55zTf+VcVH/lXJS/5VyUv+VclL/lXJS/5VyUv+VclL/k3BR/J56Wv9cRzSkAAAAAJNvUKTto2L/4ppe/uehZf/Pmmr/noZv/9Scav/Wl17/1plh/9eZYf/XmWH/15lh/9eZYf/WmGD/2Jlg/suRXP9mRiuk8rWA/397dP1akKn/rqqi/3LF3f8Mntj/4dLJ///+9f/48u3/9e7n//bt5v/47+f/+O/n//jv5//rvZP/1ZJX/a9/VP9+lrD8AIvz/xOt+f8Douv/ALb6/wC28/9tmar/z8jJ//Lq5/////7//v////n9///6/P3//////+Ta0P/PjVP/pnpT/IWds/+aiXj/5efl/8Px//951/3/LMz//wCx8/8GltL/NIu3/4ycqf/l29L////+//n6+//8/v//3tXM/8+OVP+oe1P/6K57/86QWP/r6Ob////////++v/r9/z/oOb9/zDL//8Arf//AI/r/ydysv+hpqr//PTr///////d1Mz/0I5U/6h7U//osH//wo5g/+fm5P/7/f//9vf5//z7+////vv/9/r8/5Dc/P8Oqv7/AJf//wF02v9ffZ7/8Ojh/+Ha1P/NjFL/qHtT/+ewf//Ej1//7O3r///////+/v7//v7+//f5+v/6+vv////8/8Tq/f8hp/7/AJH//wB18/8/bqj/1MGu/9mXXv+leVH/569+/8iSYv+/tKn/wLew/8O5sf/P0M////////7+/v/3+fv////7/9Hv/v8hoP3/AIn//wB4/v84ZqL/w4NH/619VP/nsYD/x45c/9W5of/bv6j/0Jxt/6J/YP+spqD/2N3i//7////6+/3///76/8vr/v8Slv7/AIb+/wBz//83VH7/nW1B/+ewfv/Fjl7/7Ozr///////9+/r/9d7K/9Ghdv+jd1D/pJ6Y/+jt8f/9///////7/6fb/v8Ahv7/AYD//wRp6f95YlT/57B//8SOXv/n5uT//v7///r7/P/8/v////////XRsv/DhEv/loBu/9DX3P/9/v/////7/2O6/f8Afv//FnTU/5JtTf/nsH//xY9e/+jn5f/+/f//+fj5//n4+P/5+Pn/+/////Xbxf/Wj1D/nX1h/+Ll6P////7/3+/3/w+V//8tcbP/qHJB/+WuffzCjV7/5efn///////+/v7//////////////v7///////XRsP/TnW3/8fT3//////////z/ddD//0Nxl/+zdkH88LmH/9CRWP2+qJT/0M7N/8/Jxv/Pysf/z8rH/8/Kxv/Py8n/zsO6/7+pmP/PzMv/zsnG/9bNyP+nsK7/h4R3/b2BT/+Sb1Ck7qxw/9GSW/69hlb/wYhX/8CIV//AiFf/wIhX/8CIVv/BiVj/xI1d/8CIVv/BiFf/vYZW/9STW/7ppmv/bE80pAAAAACUd16k+sui/+7AmPzwwpr/8MKa//DCmv/wwpr/8MKa//DCmf/vwZj/8MKa//DCmv/uwJj8+cui/5N3XaQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="}, { label: "Добавить url и сохранить страницу", func: "savePage()", image: "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICAyMjIzwyMjFeLi0tVS8vLlcuLy9XLS4uVywsLFUuLi5aKSkpUggICBMAAAAAAgICAQAAAAAAAAAAAAAAABQTEyOgoJ/yysvL/s3Pz/7Z293/4OPk/+bp6f/t7u7/5eXl/LOysv97e3vLFRUWJQAAAAACAgIDAAAAAAAAAAA8PDxSz9HT/83Qz/fLx8T8z7+5/M/AsPzez8n89e3r/PDx8fyusLL43dzc/52dndMWFhY2AAAAAAICAgIAAAAAODg5T8bEv/+9o476vIR1/7WDcv+uj3v/spCA/8Wqk//Gtab/rqyq/+Pk5fn19fX+np6e4BQUFCgAAAAAAAAAAC4uJU29oYj/wLao+tLDqf/Mv7P/yLik/7zEvP/F0cr/v62Y/6+Kef/Z2NP/6Ors+d3c3P97e3vNBA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7vW7/+93ff/utDm/42fsf9Gjbn/EXS2/ytSbv6Fj5r/WnGc8gAAAFICAwEBepPE/tHk9f/S5PX/vMjV/7fCzP+3w8//uMPP/7XBzP+6ytf/qa+4/3h/hv9Ghaz/JoO+/jNXdP82PVnyAAAAVgACAgCBmcb/2+r3/dHh8fyPkpX/kI6N/5yam/+dnJ3/paWk/6enpf+sr6//mpSR/3Bubf9SjbD8H4C+/QsrSvcCAAB/AAAAA3yVx//j8///3u/7/52gpf6pqKf+uLm5/rq7u/7Ly8v+ycnI/paWlf6LjY/+np2f/Xh+g/5gnL7/MX+y/xcgJ80BAgNNN1OUs6W84fDA1O73mJyj/ainpv+2trb/t7e4/8fHyP/Fxsb/kZGQ/4eGhP+vucT/j6G+/W53k/NlkbnwNoOv/AgiNb8CCBsQDRo/YwsaO3B0d33arKyp9q2trfWvr6/2u7u79ru7vPawr7H1sbCt9nJ2gOQIGD6bFCFEYB0qPE1Bf6SpEz9cggAAAAMCAQEBAQAAADIyMmlDQ0ONQUFBhUFBQYVCQkGFQkJBhUhISIRNTU2OKysrZAEAAAUBAQAAAgEAAAkEAAEDAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="}, { separator: ''}, { label: "Запомнить изображение как base64, в контекстном меню", value: "CB.Save.WebScreenShotOnImage"}, { label: "Сохранить выделенный текст в файл, в контекстном меню", value: "CB.Save.SelectionToFile" }, { label: "Открыть выделенный текст в внешнем редакторе, в контекстном меню", value: "CB.Save.TextToEditor"}, ]; var menuPopup = self.appendChild(document.createElement("menupopup")); array.forEach((m,i)=> { if ("separator" in m) { menuPopup.appendChild(document.createElement("menuseparator")); return }; var mItem = menuPopup.appendChild(document.createElement("menuitem")); mItem.setAttribute("label", m.label); mItem.setAttribute("class", "menuitem-iconic"); if ("image" in m) mItem.setAttribute("image", m.image || array[i-1].image); if ("value" in m) { mItem.setAttribute('type', 'checkbox'); mItem.setAttribute('checked', cbu.getPrefs(m.value) ); mItem.onclick =()=> cbu.setPrefs(m.value, !cbu.getPrefs(m.value)); } if ("func" in m) mItem.addEventListener("command", ()=> eval(m.func.toString())); }); menuPopup.setAttribute("onclick", "event.stopPropagation()"); // Сохранить как PNG страницу или части страницы ............. WebScreenShot = { capture: function(win, x, y, width, height) { var canvas = document.createElementNS(xhtmlns, 'canvas'); canvas.style.display = 'inline'; canvas.width = width; canvas.height = height; var ctx = canvas.getContext("2d"); ctx.clearRect(0, 0, width, height); ctx.save(); try { ctx.scale(1.0, 1.0); } catch(e) { alertsService.showAlertNotification("chrome://global/skin/icons/error-16.png", "Слишком большая страница, не могу сохранить всё", "Кликни чтобы сохранить сколько можно", true, "", (s, t)=> { if ( t == 'alertclickcallback' ) WebScreenShot.capture(content, 0, 0, width, width*17); }, ""); return; } ctx.drawWindow(win, x, y, width, height, "rgb(255,255,255)"); ctx.restore(); var url = canvas.toDataURL("image/png"); var url = Services.io.newURI(url, null, null); var fp = window.makeFilePicker(); fp.init(window, "Сохранить как…", fp.modeSave); fp.appendFilters(fp.filterImages); fp.defaultExtension = "png"; fp.defaultString = getTabLabel() + " " + (new Date().toLocaleFormat("%d.%m.%Y. %H:%M:%S")) + ".png"; if (fp.show() == fp.returnCancel || !fp.file) return; var wbp = window.makeWebBrowserPersist(); parseInt(Services.appinfo.version) < 36 ? wbp.saveURI(url, null, null, null, null, fp.file, null) : wbp.saveURI(url, null, null, null, null, null, fp.file, null); // если FF36+ canvas.remove(); }, captureAll: function() { var win = content; WebScreenShot.capture(win, 0, 0, win.innerWidth + win.scrollMaxX, win.innerHeight + win.scrollMaxY); }, capturePage: function() { var win = content, doc = win.document, body = doc.body, html = doc.documentElement; var scrX = (body.scrollLeft || html.scrollLeft) - html.clientLeft; var scrY = (body.scrollTop || html.scrollTop) - html.clientTop; WebScreenShot.capture(win, scrX, scrY, win.innerWidth, win.innerHeight); }, // Запомнить изображение на странице как base64 .... onImage: function(image) { var canvas = document.createElementNS(xhtmlns, 'canvas'); canvas.width = image.naturalWidth; canvas.height = image.naturalHeight; var ctx = canvas.getContext('2d'); ctx.drawImage(image, 0, 0); var base64 = canvas.toDataURL(); gClipboard.write(base64); // стиль для изображение на сплывающей подсказке .... var sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService); var uri = makeURI('data:text/css,'+ encodeURIComponent('#alertImage { height: 25px !important; width: 25px !important; }')); sss.loadAndRegisterSheet(uri, 0); // всплывающая подсказка .... alertsService.showAlertNotification(base64, self.label, "Запомнил изображение как base64", false, "", (s, t)=> { if (t == 'alertfinished') sss.unregisterSheet(uri, 0); // удалить стиль когда подсказка закрывается }, ""); } }; // Сохранить выбранную область страницы как PNG .... WebScreenShotByClipping = { capture: WebScreenShot.capture, handleEvent: function(e) { if (e.button) return false; e.preventDefault(); e.stopPropagation(); switch(e.type){ case 'mousedown': this.downX = e.pageX; this.downY = e.pageY; this.bs.left = this.downX + 'px'; this.bs.top = this.downY + 'px'; this.body.appendChild(this.box); this.flag = true; break; case 'mousemove': if (!this.flag) return; this.moveX = e.pageX; this.moveY = e.pageY; if (this.downX > this.moveX) this.bs.left = this.moveX + 'px'; if (this.downY > this.moveY) this.bs.top = this.moveY + 'px'; this.bs.width = Math.abs(this.moveX - this.downX) + 'px'; this.bs.height = Math.abs(this.moveY - this.downY) + 'px'; break; case 'mouseup': this.uninit(); break; } }, init: function() { this.win = document.commandDispatcher.focusedWindow; if (this.win == window) this.win = content; this.doc = this.win.document; this.body = this.doc.body; if (!this.body instanceof HTMLBodyElement){ alertsService.showAlertNotification(self.image, self.label, "Не удается захватить!"); return false; } this.flag = null; this.box = this.doc.createElement('div'); this.bs = this.box.style; this.bs.border = '#0f0 dashed 2px'; this.bs.position = 'absolute'; this.bs.zIndex = '2147483647'; this.defaultCursor = getComputedStyle(this.body, '').cursor; this.body.style.cursor = 'crosshair'; ["click", "mouseup", "mousemove", "mousedown"].forEach(type=> this.doc.addEventListener(type, this, true)); }, uninit: function() { var pos = [this.win, parseInt(this.bs.left), parseInt(this.bs.top), parseInt(this.bs.width), parseInt(this.bs.height)]; this.body.style.cursor = this.defaultCursor; this.body.removeChild(this.box); this.capture.apply(this, pos); ["click", "mouseup", "mousemove", "mousedown"].forEach(type=> this.doc.removeEventListener(type, this, true)); }, }; // Сохранить фрейм на странице как PNG .... WebScreenShotByClick = { capture: WebScreenShot.capture, getPosition: function() { var html = this.doc.documentElement; var body = this.doc.body; var rect = this.target.getBoundingClientRect(); return [ this.win ,Math.round(rect.left) + (body.scrollLeft || html.scrollLeft) - html.clientLeft ,Math.round(rect.top) + (body.scrollTop || html.scrollTop) - html.clientTop ,parseInt(rect.width) ,parseInt(rect.height) ]; }, highlight: function() { this.orgStyle = this.target.hasAttribute('style') ? this.target.style.cssText : false; this.target.style.cssText += 'outline: red 2px solid; outline-offset: 2px; -moz-outline-radius: 2px;'; }, lowlight: function(e) { if (this.orgStyle) this.target.style.cssText = this.orgStyle; else this.target.removeAttribute('style'); }, handleEvent: function(e) { switch(e.type){ case 'click': if (e.button) return; e.preventDefault(); e.stopPropagation(); this.lowlight(); var pos = this.getPosition(); this.capture.apply(this, pos); this.uninit(); break; case 'mouseover': if (this.target) this.lowlight(); this.target = e.target; this.highlight(); break; } }, init: function() { this.win = content; this.doc = content.document; ["click", "mouseover"].forEach(type=> this.doc.addEventListener(type, this, true)); }, uninit: function() { this.target = false; ["click", "mouseover"].forEach(type=> this.doc.removeEventListener(type, this, true)); }, }; // Сохранить страницу как PDF файл через сервис 'pdfmyurl.com' ............. function savePageToPDF(loc = content.location) { loc.href.startsWith("http") && loadURI("http://pdfmyurl.com?url=" + loc); }; // Сохранить ярлык страницы в указанную папку или в последнюю папку сохранения .............. function saveShortcuts(saveAs, shortcutName) { var url = content.document.location; cbu.isPref(pref, "C:\\"); // блокируем создание ярлыков для внутренних страниц FF if ( ["about:", "chrome:", "jar:", "data:"].indexOf(url.protocol) !== -1 ) { alertsService.showAlertNotification("chrome://global/skin/icons/error-16.png", self.label, "Не поддерживается"); return; } // получить название ярлыка if ( saveAs ) shortcutName = setPathToShortcut(shortcutName) else shortcutName = shortcutName ? shortcutName : getSiteName() + getTabLabel() + " " + Date.now(); if ( saveAs && shortcutName == false ) return; // сохранить иконку таба в установленную папку var faviconName = "favicon" + Date.now(); var favicon = saveFaviconToFolder(faviconName); // получить путь для сохранения ярлыка из 'about:config' var pathToFolder = gPrefService.getComplexValue(pref, Ci.nsISupportsString).data; var pathToShortcut = pathToFolder + shortcutName + ".url"; // адрес страницы в UTF-8 если это протокол 'file' или в 'Punycode' если это .рф домен if ( url.protocol == 'file:' ) url = convertFromUnicode("UTF-8", url); if ( url.host.slice(-3) == '.рф') url = Services.io.newURI(url, null, null).asciiSpec; // текст ярлыка из адреса страницы и пути к иконке таба var text = "[InternetShortcut]" + "\r\n" + "URL=" + url; var pathToFavicon = "IconFile=" + faviconFolder + faviconName + ".ico" + "\r\n"; if ( favicon == false ) var pathToFavicon = ""; var data = text + "\r\n" + pathToFavicon + "IconIndex=0"; // записать текст в ярлык var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); var foStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); file.initWithPath(pathToShortcut); foStream.init(file, 0x02|0x08|0x20, 0666, 0); foStream.write(data, data.length); foStream.close(); // подсказка var notification = 'Сохранил в: ' + pathToFolder; var image = (favicon == false) ? self.image : gBrowser.selectedBrowser.mIconURL; alertsService.showAlertNotification(image, shortcutName, notification); }; // Установка пути и названия для сохранения ярлыка через диалог сохранения, отмена отдаст 'false' .............. function setPathToShortcut(shortcutName) { var pathToFile = gPrefService.getComplexValue(pref, Ci.nsISupportsString).data; var shortcutName = shortcutName ? shortcutName : getSiteName() + getTabLabel() + " " + Date.now(); // диалог создания и установки пути var fp = window.makeFilePicker(); fp.init(window, "Укажите где сохранить ярлык страницы!", fp.modeSave); fp.appendFilters(fp.filterAll); fp.defaultString = shortcutName; if ( fp.show() == fp.returnCancel ) return false; // убрать название файла из пути к файлу и записать путь в 'about:config' var filePath = fp.file.path.toString(); var fileName = fp.file.leafName.toString(); cbu.setPrefs(pref, convertFromUnicode("UTF-8", filePath.replace(fileName, "")) ); return fileName; }; // Сохранить в указанную папку иконку таба как .ico и без диалога сохранения .............. function saveFaviconToFolder(faviconName) { var url = gBrowser.mCurrentTab.image.replace("#-moz-resolution=16,16",""); if ( !url || content.document.mozSyntheticDocument ) return false; if ( url.startsWith("http") ) url = "moz-anno:favicon:" + url; var img = new Image(); img.onload = function() { var tools = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools); var stream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(Ci.nsIScriptableInputStream); var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); var request = img.QueryInterface(Ci.nsIImageLoadingContent).getRequest(img.CURRENT_REQUEST); var istrm = tools.encodeImage(request.image, "image/vnd.microsoft.icon", "format=bmp;bpp=32"); stream.init(istrm); var data = stream.readBytes(stream.available()); istrm.close(); stream.close(); var path = faviconFolder + faviconName + ".ico"; file.initWithPath(path); file.exists() && file.remove(false); try { file.create(file.NORMAL_FILE_TYPE, 448) } catch(e) { setTimeout(()=> { alertsService.showAlertNotification("chrome://global/skin/icons/error-16.png", self.label, "Не могу сохранить иконку вкладки в " + faviconFolder + "\n" + "Укажите в начале кода кнопки другой диск!"); }, 2500); }; cbu.writeFile(path, data); } img.setAttribute("src", url); }; // Добавить адрес наверху страницы и открыть диалог сохранения страницы ............. function savePage() { var sURL = gURLBar.value; content.document.body.innerHTML = "<table width=100%><tr><td align=left><small><a target=_blank href=" + sURL + ">"+ sURL + "</a></small>\n</td></tr></table>" + content.document.body.innerHTML; saveDocument(window.content.document); }; // Сохранить иконку текущего сайта с диалогом сохранения ............. function saveFavicon() { saveImageURL(gBrowser.mCurrentTab.image, "save", null, false, false, null, content.document) }; // Скопировать иконку текущего сайта как base64 код ............. function copyFaviconData() { var img = new Image(); img.src = gBrowser.mCurrentTab.image; WebScreenShot.onImage(img); }; // Сохранить выделенный текст или весь текст на странице как txt файл ............. function saveSelectionToTxt() { var sel = getSelect(); !sel && document.getElementById("cmd_selectAll").doCommand(); // создать название файла из заголовка страницы и текущего времени и сохранить текст .... var fileTitle = getTabLabel() + ' ' + (new Date()).toLocaleFormat("%H·%M·%S"); saveURL("data:text/plain," + encodeURIComponent(content.location + ("\r\n\r\n" + getSelect())), fileTitle + ".txt", null, false, false, null, content.document); !sel && goDoCommand("cmd_selectNone"); }; // Добавляем в контекстного меню страницы новые пункты ............. ((contextMenu, el)=> { // в контекстного меню изображений .... var baseItem = contextMenu.appendChild(document.createElement("menuitem")); baseItem.id = "content-baseItem"; baseItem.setAttribute("label", "Запомнить изображение как base64"); baseItem.onclick =()=> WebScreenShot.onImage(gContextMenu.target); // в контекстного меню выделенного текста .... var saveItem = contextMenu.insertBefore(document.createElement("menuitem"), el); saveItem.id = "content-saveItem"; saveItem.setAttribute("label", "Сохранить выделенный текст в файл"); saveItem.onclick =()=> saveSelectionToFile(); var editorItem = contextMenu.insertBefore(document.createElement("menuitem"), el); editorItem.id = "content-editorItem"; editorItem.setAttribute("label", "Открыть выделенный текст в внешнем редакторе"); editorItem.onclick =()=> textToEditor(); // устанавливаем где и при каких настройках показывать новые пункты .... addEventListener('popupshowing', e=> { if (e.target != e.currentTarget) return; var sel = gContextMenu.isTextSelected; saveItem.hidden = !sel || !cbu.getPrefs("CB.Save.SelectionToFile"); editorItem.hidden = !sel || !cbu.getPrefs("CB.Save.TextToEditor"); baseItem.hidden = !gContextMenu.onImage || !cbu.getPrefs("CB.Save.WebScreenShotOnImage"); }, false, contextMenu); // удалять новые пункти при изминениях .... addDestructor(()=> { baseItem.remove(); saveItem.remove(); editorItem.remove(); }); })(document.getElementById("contentAreaContextMenu"), document.getElementById("context-sep-open")); // Сохранить выделенный текст в файл на рабочем столе ..................................................................... function saveSelectionToFile() { // создать текст для записи //var text = convertFromUnicode("UTF-8", getSelect()) + "\n\n\n"; var text = convertFromUnicode("UTF-8", (getSelect() + "\n\n\n")); // путь к файлу и название файла var file = Services.dirsvc.get("Desk", Ci.nsIFile); file.append("Save - " + (new Date()).toLocaleFormat("%d.%m.%Y") + ".txt"); // создать файл с текстом или добавлять текст в файл var foStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); file.exists() ? foStream.init(file, 0x02 | 0x10, 0664, 0) : foStream.init(file, 0x02|0x08|0x20, 0666, 0); foStream.write(text, text.length); foStream.close(); // всплывающая подсказка дает возможность открыть файл если кликнуть на подсказке var notification = 'Сохранил выделенный текст в файл на рабочий стол'; var image = gBrowser.mCurrentTab.image || self.image; alertsService.showAlertNotification(image, notification, "Кликни чтобы открыть файл", true, "", (s, t)=> { if (t == 'alertclickcallback') file.launch(); }, ""); }; // Создать текстовой файл с выделенным текстом в папке профиля и открыть в редакторе ............. function textToEditor() { var text = convertFromUnicode("UTF-16", getSelect()); var file = Services.dirsvc.get('Desk', Ci.nsIFile); file.append("TextToEditor.txt"); custombuttonsUtils.writeFile(file.path, text); file.launch(); }; // Конвертировать текст в юникод ............. function convertFromUnicode(charset, str) { var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter); converter.charset = charset; str = converter.ConvertFromUnicode(str); return str + converter.Finish(); }; // Получить название домена с заглавным первым символом и без приставок( типа .ru и .com ) .............. function getSiteName() { try { var domain = content.document.domain.split('.') } catch(e) { return "" }; domain = (domain.length == 2) ? domain[0] : domain[1] return domain[0].toUpperCase() + domain.slice(1).split('.')[0] + " "; }; // Получить название вкладки без не сохраняемых символов и лишних пробелов .............. function getTabLabel() { var label = gBrowser.mCurrentTab.label; var label = label.replace(/[:+.\\\/<>?*|"]+/g, " ").replace(/\s\s+/g, " "); return label.substring(0, 50); }; // Получить выделенный текст из страницы или 'false' .............. function getSelect() { var el = document.commandDispatcher.focusedElement; try { return el.value.substring(el.selectionStart, el.selectionEnd) } catch(e) {}; var sel = document.commandDispatcher.focusedWindow.getSelection(); return (sel == '') ? false : sel.toString().replace(/^\s+|\s+$/g,"").replace(/\u000A/g, "\u000D\u000A").replace(/\u000D\u000D\u000A/g, "\u000D\u000A"); }; function runSaveSnapshotToHtml() { var saveToFile = function (fileContent, fileName) { var uc = Components.classes['@mozilla.org/intl/scriptableunicodeconverter'].createInstance(Components.interfaces.nsIScriptableUnicodeConverter); uc.charset = 'utf-8'; fileContent = uc.ConvertFromUnicode(fileContent); var nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker); fp.init(window, '', fp.modeSave); fp.defaultString = fileName; fp.appendFilters(fp.filterHTML); fp.appendFilters(fp.filterAll); if(fp.show() == fp.returnCancel) return; var stream = Components.classes['@mozilla.org/network/file-output-stream;1'].createInstance(Components.interfaces.nsIFileOutputStream); stream.init(fp.file, 0x02|0x20|0x08, 0666, 0); stream.write(fileContent, fileContent.length); stream.close(); }; var resolveURL = function (url, base) { try { var ioService = Components.classes['@mozilla.org/network/io-service;1'].getService(Components.interfaces.nsIIOService); var baseURI = ioService.newURI(base, null, null); var absURI = ioService.newURI(url, null, baseURI); return absURI.spec; } catch (e) {} }; var getSelWin = function (w) { if (w.getSelection().toString()) return w; for (var i = 0, f, r; f = w.frames[i]; i++) { try { if (r = getSelWin(f)) return r; } catch(e) {} } }; var encodeImg = function (src, obj) { var canvas, img, ret = src; if (/^https?:\/\//.test(src)) { canvas = doc.createElement('canvas'); if (!obj || obj.nodeName.toLowerCase() != 'img') { img = doc.createElement('img'); img.src = src; } else { img = obj; }; if (img.complete) try{ canvas.width = img.width; canvas.height = img.height; canvas.getContext('2d').drawImage(img, 0, 0); ret = canvas.toDataURL((/\.jpe?g/i.test(src) ? 'image/jpeg' : 'image/png')); } catch (e) {}; if (img != obj) img.src = 'about:blank'; }; return ret; }; var toSrc = function (obj) { var strToSrc = function (str) { var chr, ret = '', i = 0, meta = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\x22' : '\\\x22', '\\': '\\\\'}; while (chr = str.charAt(i++)) { ret += meta[chr] || chr; }; return '\x22' + ret + '\x22'; }, arrToSrc = function (arr) { var ret = []; for (var i = 0; i < arr.length; i++) { ret[i] = toSrc(arr[i]) || 'null'; }; return '[' + ret.join(',') + ']'; }, objToSrc = function (obj) { var val, ret = []; for (var prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop) && (val = toSrc(obj[prop]))) ret.push(strToSrc(prop) + ': ' + val); }; return '{' + ret.join(',') + '}'; }; switch (Object.prototype.toString.call(obj).slice(8, -1)) { case 'Array': return arrToSrc(obj); case 'Boolean': case 'Function': case 'RegExp': return obj.toString(); case 'Date': return 'new Date(' + obj.getTime() + ')'; case 'Math': return 'Math'; case 'Number': return isFinite(obj) ? String(obj) : 'null'; case 'Object': return objToSrc(obj); case 'String': return strToSrc(obj); default: return obj ? (obj.nodeType == 1 && obj.id ? 'document.getElementById(' + strToSrc(obj.id) + ')' : '{}') : 'null'; } }; var mainWin = document.commandDispatcher.focusedWindow.top == content ? document.commandDispatcher.focusedWindow : content; var selWin = getSelWin(mainWin), win = selWin || mainWin, doc = win.document, loc = win.location; var ele, pEle, clone, reUrl = /(url\(\x22)(.+?)(\x22\))/g; if (selWin) { var rng = win.getSelection().getRangeAt(0); pEle = rng.commonAncestorContainer; ele = rng.cloneContents(); } else { pEle = doc.documentElement; ele = (doc.body || doc.getElementsByTagName('body')[0]).cloneNode(true); }; while (pEle) { if (pEle.nodeType == 1) { clone = pEle.cloneNode(false); clone.appendChild(ele); ele = clone; }; pEle = pEle.parentNode }; var sel = doc.createElement('div'); sel.appendChild(ele); for (var el, all = sel.getElementsByTagName('*'), i = all.length; i--;) { el = all[i]; if (el.style && el.style.backgroundImage) el.style.backgroundImage = el.style.backgroundImage.replace(reUrl, function (a, prev, url, next) { if (!/^[a-z]+:/.test(url)) url = resolveURL(url, loc.href); return prev + encodeImg(url) + next; }); switch (el.nodeName.toLowerCase()) { case 'link': case 'style': case 'script': el.parentNode.removeChild(el); break; case 'a': case 'area': if (el.hasAttribute('href') && el.getAttribute('href').charAt(0) != '#') el.href = el.href; break; case 'img': case 'input': if (el.hasAttribute('src')) el.src = encodeImg(el.src, el); break; case 'audio': case 'video': case 'embed': case 'frame': case 'iframe': if (el.hasAttribute('src')) el.src = el.src; break; case 'object': if (el.hasAttribute('data')) el.data = el.data; break; case 'form': if (el.hasAttribute('action')) el.action = el.action; break; } }; var head = ele.insertBefore(doc.createElement('head'), ele.firstChild); var meta = doc.createElement('meta'); meta.httpEquiv = 'content-type'; meta.content = 'text/html; charset=utf-8'; head.appendChild(meta); var title = doc.getElementsByTagName('title')[0]; if (title) head.appendChild(title.cloneNode(true)); head.copyScript = function (unsafeWin) { if ('$' in unsafeWin) return; var f = doc.createElement('iframe'); f.src = 'about:blank'; f.setAttribute('style', 'position:fixed;left:0;top:0;visibility:hidden;width:0;height:0;'); doc.documentElement.appendChild(f); var str, script = doc.createElement('script'); script.type = 'text/javascript'; for (var name in unsafeWin) { if (name in f.contentWindow || !/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)) continue; try { str = toSrc(unsafeWin[name]); if (!/\{\s*\[native code\]\s*\}/.test(str)) { script.appendChild(doc.createTextNode('var ' + name + ' = ' + str.replace(/<\/(script>)/ig, '<\\/$1') + ';\n')); } } catch (e) {}; }; f.parentNode.removeChild(f); if (script.childNodes.length) this.nextSibling.appendChild(script); }; head.copyScript(win.wrappedJSObject || win); head.copyStyle = function (s) { if (!s) return; var style = doc.createElement('style'); style.type = 'text/css'; if (s.media && s.media.mediaText) style.media = s.media.mediaText; try { for (var i = 0, rule; rule = s.cssRules[i]; i++) { if (rule.type != 3) { if((!rule.selectorText || rule.selectorText.indexOf(':') != -1) || (!sel.querySelector || sel.querySelector(rule.selectorText))) { var css = !rule.cssText ? '' : rule.cssText.replace(reUrl, function (a, prev, url, next) { if (!/^[a-z]+:/.test(url)) url = resolveURL(url, s.href || loc.href); if(rule.type == 1 && rule.style && rule.style.backgroundImage) url = encodeImg(url); return prev + url + next; }); style.appendChild(doc.createTextNode(css + '\n')); } } else { this.copyStyle(rule.styleSheet); } } } catch(e) { if (s.ownerNode) style = s.ownerNode.cloneNode(false); }; this.appendChild(style); }; var sheets = doc.styleSheets; for (var j = 0; j < sheets.length; j++) head.copyStyle(sheets[j]); head.appendChild(doc.createTextNode('\n')); var doctype = '', dt = doc.doctype; if (dt && dt.name) { doctype += '<!DOCTYPE ' + dt.name; if (dt.publicId) doctype += ' PUBLIC \x22' + dt.publicId + '\x22'; if (dt.systemId) doctype += ' \x22' + dt.systemId + '\x22'; doctype += '>\n'; }; var fileName = selWin ? win.getSelection().toString() : (title && title.text ? title.text : loc.pathname.split('/').pop()); fileName = fileName.replace(/[:\\\/<>?*|"]+/g, '_').replace(/\s+/g, ' ').slice(0, 100).replace(/^\s+|\s+$/g, ''); fileName += (function () { var d = new Date(), z = function(n){return '_' + (n < 10 ? '0' : '') + n}; return z(d.getHours()) + z(d.getMinutes()) + z(d.getSeconds()); })(); if(!/\.html?$/.test(fileName))fileName += '.html'; saveToFile(doctype + sel.innerHTML + '\n<!-- This document saved from ' + (loc.protocol != 'data:' ? loc.href : 'data:uri') + ' -->', fileName); };
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAACXBIWXMAAAsSAAALEgHS3X78AAACpklEQVQ4jXWRz4tXZRTGP+f9ce977/3aRDKD4JA5KIiIRRG4miBqJME2oYH4H7SKaBFiCxeCuksXUxRBbcKdW4Vx0UIwRkRb6MaJEcRR5us4zsz3x73ve1zcZiS/9MCBszkfnvM8AoCMf0Dn8OcIAxERrWFqv2H3Ls9wCN4qVQGLS7XemRer8cUa61dm0dQDFQDY/es8n/SV6aXoPn2mfLisv1zt66YedlUv/6U6d7+nYeZJ5ON1lclTl1oDIgZcYOLAdsIG5MNIPojk/WhNjKARNP55dxCPf/0w3l9YjDYMlGy15v0zX7Hz2wuoqgGUIFCUUARLESxlYZNxFsSC2KH1ljfH7PLzDat5sOTBalnD1IljYIIDFcoAVQ4+QchAFckNmxrrvODQwSWG/afEci9kmZB7CJJAcAAEC9uA5YTWNQD3FoX5CcPiSkP3eY8v3utzd6FDnXkITskRKm8AHAgUwBggHh1GTAXnr8O5uQQYMNuB8XbdBmIUzQWKtpjWSUnrxDhSJwMDCK+kr9YUgbUInX/vtiCVQAluhzDd3GZ8bYXGuP9wQDGqrIWC6zvfpbdikaLlOwCbReIEHJn7g99+PEEjgqjyupKxlCnyzbGzzB7/DvMgEdtgBaksJJieOcTYyWv06gwvo5CoQu4bPtuYZLYL2rHQpgbk7Ts6NQlVhSfhDKMjCUJA9r3T5hFez8SDaALnaQoDRkadJMVmjhQVPFButVPju49Ss2cvJkbln0dJVvuINSMQSQpVBgf2qdmT428+TgMaHKDNxXlj9SP8l0E4PGNsD1qGtvFvmlKBHNxSlrLfobl02wDqEAap+/PpeDH//m/ztt46+hYr6+CsINKOqqIKMSXeCHDjxir9HxbELP90BhhsPS5gR/v4f0nrMwK8BIfmEF9f/5BGAAAAAElFTkSuQmCC
Отсутствует
На 58 перестала работать кнопочка Часы( Firefox24+ ) от 17.10.2016.
Возможно что из-за Warning: Date.prototype.toLocaleFormat is deprecated?
Там есть какая-то замена, но как получить вместо даты время привести его в нужный для кнопки формат?
Отсутствует
на 58 у меня вообще куча кнопок искалечилась или вообще перестала работать. откатил пока, запрещу обновления, а потом посмотрю. увы
У меня пока тьфу-тьфу-тьфу. Но жуткие тормоза при наборе текста из-за какой-то одной (или нескольких) кнопок.
Просто написать что-либо невозможно. Предыдущее сообщение минут 15 набирал.
Вырубил все, кроме рестарта. Буду по одной ставить...
Отсутствует
Нашёл виновника. Может, правда ещё будет. Linkification
Правда код не сравнивал, может какой-нибудь из его вариантов, если они были.
Отредактировано Coroner (24-01-2018 00:08:43)
Отсутствует
Dumby, Infocatcher я читал Ваши прежние посты про не сохранение настроек в about:config для F58. Почему сам Custom Buttons не может сохранять настройки в about:config (например выбор внешнего редактора), а кнопки созданные Custom Buttons могут сохранять настройки в about:config?
Отредактировано Andrey_Krropotkin (24-01-2018 22:29:10)
Отсутствует
Ultima2m Особенности 58 - переделали функцию даты (toLocaleFormat), поэтому надо изменить, либо убрать в коде вывод даты. Или как я сделал, не стал заворачиваться с новыми функциями, криво , но работает. Вот пример
function aDate() { var t=new Date(); var y=1900+t.getYear(); var min=t.getMinutes(); if (min<10){min="0"+min}; var h=t.getHours(); var m=t.getMonth();switch(m){case 0: m="января";break;case 1: m="февраля";break;case 2: m="марта";break;case 3: m="апреля";break;case 4: m="мая";break;case 5: m="июня";break;case 6: m="июля";break;case 7: m="августа";break;case 8: m="сентября";break;case 9: m="октября";break;case 10: m="ноября";break;default: m="декабря";} var d=t.getDate(); var curdate=y+"г."+" "+d+" "+m+" "+h+":"+min; var myfilename=curdate; return myfilename; } И потом вместо например - name = "CB buttons " + new Date().toLocaleFormat("%d.%m.%Y. %H:%M:%S") + ".html"; Я ставлю name = "CB buttons " + aDate().replace(/:/g, ".") + ".html";
var dialog; var defaultFavicon = "http://forum.mozilla-russia.org/uploaded/custombuttons_button.png"; var checkFavicon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAltJREFUOMtt0l9olXUcx/HX8zzThHh07cLQJSZoozXNONMonYxI6zhwhnVnGQldqASZKN50USgWE0ThgCEiZV2JyNDpEnXMLhbuNBC7SOnfVHQj5p/Hmmw+53hxzo7T9bv5Xfy+78/v8/1+P4EnT7NqvIOMVEYkRF6q16hjegxBsVgMgiAoBk/AWRyQminyf2cguzi7veOrjg+xBD8H4+Cd2A7xNJLZxDUkMISrTH8QO7e3R/3z9TCKVSWBJitEOsFC1BOXpZOyfhzFOptPeW3O6wqFgh9Of7/7/bc/2BJoVi11CbVewXziMhiX4SSkY/lx2VktYOOejXJHcwOmeKlKq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9lqt7q/RrlSuWNYBwKkAxx34thfEGSz85eBEvbFiX232Wy+OhWmWq12JU3Th7bz0xHyZGX7mx2/aLfbn/+aRoCNjY2FpQtLK4gCdjE2QVb0YtPP5ea7W1tbw2n/Tyf84OJw4lGJAAAAAElFTkSuQmCC"; var checkStyle = 'background:#FFF1AE url("' + checkFavicon + '") no-repeat left center;color:black;padding-left:24px'; var uncheckStyle = 'background:white url("' + uncheckFavicon + '") no-repeat left center;color:black;padding-left:24px'; var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]. createInstance(Components.interfaces.nsIScriptableUnicodeConverter); converter.charset = "UTF-8"; var t=new Date(); var y=1900+t.getYear(); var min=t.getMinutes(); if (min<10){min="0"+min}; var h=t.getHours(); var m=t.getMonth();switch(m){case 0: m="Января";break;case 1: m="Февраля";break;case 2: m="Марта";break;case 3: m="Апреля";break;case 4: m="Мая";break;case 5: m="Июня";break;case 6: m="Июля";break;case 7: m="Августа";break;case 8: m="Сентября";break;case 9: m="Остября";break;case 10: m="Ноября";break;default: m="Декабря";} var d=t.getDate(); var stream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream); var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker); const text1 = "Активные кнопки"; const text2 = "Неактивные кнопки"; var saveToFile = function (fileContent, fileName) { var uc = Components.classes['@mozilla.org/intl/scriptableunicodeconverter'].createInstance(Components.interfaces.nsIScriptableUnicodeConverter); uc.charset = 'utf-8'; //fileContent = uc.ConvertFromUnicode(fileContent); var nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker); fp.init(window, '', fp.modeSave); fp.defaultString = fileName; fp.appendFilters(fp.filterHTML); fp.appendFilters(fp.filterAll); fp.open(function (rv) { if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) { var stream = Components.classes['@mozilla.org/network/file-output-stream;1'].createInstance(Components.interfaces.nsIFileOutputStream); stream.init(fp.file, 0x02|0x20|0x08, 0666, 0); stream.write(fileContent, fileContent.length); stream.close(); } }); }; function createURI(node) { var name = node.getAttribute("name") || node.getAttribute("label") || ""; var image = node.getAttribute("image") || node.getAttribute("cb-stdicon") || ""; var mode = node.getAttribute("cb-mode") || 0; var initcode = node.getAttribute("cb-init") || ""; var code = node.getAttribute("cb-oncommand") || ""; var accelkey = node.getAttribute("cb-accelkey") || ""; var help = node.getAttribute("Help") || ""; var xhr = new XMLHttpRequest(); xhr.open("GET", "chrome://custombuttons/content/nbftemplate.xml", false); xhr.send(null); var doc = xhr.responseXML; setText(doc, "name", name, 0); setText(doc, "image", image, 1); setText(doc, "mode", mode, 0); setText(doc, "initcode", initcode, 1); setText(doc, "code", code, 1); setText(doc, "accelkey", accelkey, 1); setText(doc, "help", help, 1); var ser = new XMLSerializer(); var data = ser.serializeToString(doc); return "custombutton://" + escape(data); } function setText(doc, nodeName, text, make_CDATASection) { var node = doc.getElementsByTagName(nodeName)[0], cds; if (!node) return; if (make_CDATASection) { try { cds = doc.createCDATASection(text || ""); } catch(e) { cds = doc.createTextNode(text || ""); } node.appendChild(cds); } else { node.textContent = text; } } function aDate() { var t=new Date(); var y=1900+t.getYear(); var min=t.getMinutes(); if (min<10){min="0"+min}; var h=t.getHours(); var m=t.getMonth();switch(m){case 0: m="января";break;case 1: m="февраля";break;case 2: m="марта";break;case 3: m="апреля";break;case 4: m="мая";break;case 5: m="июня";break;case 6: m="июля";break;case 7: m="августа";break;case 8: m="сентября";break;case 9: m="октября";break;case 10: m="ноября";break;default: m="декабря";} var d=t.getDate(); var curdate=y+"г."+" "+d+" "+m+" "+h+":"+min; var myfilename=curdate; return myfilename; } function bDate() { var curdate=y+" "+"год"+" "+d+" "+m+" "+h+":"+min; var myfilename=converter.ConvertFromUnicode(curdate); return myfilename; } this.close = function() { dialog.close(); } const xulNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var data = '<window onload="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").load()', true) + '" title="' + e4xConv_encodeHTML("Инструменты CB", true) + '" xmlns="' + e4xConv_encodeHTML(xulNS, true) + '">\n\ <keyset>\n\ <key keycode="VK_ESCAPE" oncommand="close()"/>\n\ </keyset>\n\ <vbox flex="1">\n\ <listbox flex="1" id="listbox" height="555" width="500" context="menupopup" onclick="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").handle(event)', true) + '"\n\ tooltiptext = "L=Выбрать \n\ M=Выбрать все \n\ R=Копировать/Сохранить как…">\n\ <listhead>\n\ <listheader label="Label" width="300"\n\ tooltiptext = "Активные кнопки выделены жирным шрифтом"/>\n\ <listheader label="Id"\n\ tooltiptext = "Активные кнопки выделены жирным шрифтом"/>\n\ </listhead>\n\ <listcols>\n\ <listcol/>\n\ <listcol flex="1"/>\n\ </listcols>\n\ </listbox>\n\ <popupset>\n\ <menupopup id="menupopup">\n\ <menuitem class="menuitem-iconic" image="data:application/file;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAD///8A////AESqAABHpgAASKAAAEukAQxMpQMYR6MAAEepAQ9MpgOLRKgACUenAABHpgAARKoAAP///wD///8A////AP///wBEqgAARaIAAFS2FVBj0jS3Y9AzyVG0EUROrwt8TKcDs0ikAANInwAAR6YAAESqAAD///8A////AP///wD///8ARKQAAVvJKJtj0jX/SaAJ/0abCv9UtSH/U7QX8lW5IMddwyfQW8Iii0mqBQ1DqQAA////AP///wD///8A////AEWlAAFYwB6YXsYc5F7GFt9bwA+vVbgWvU6rAKBRrgf0RZgA/02oDP9ezCzJR6UBA////wD///8A////AP///wBFrAAASKIAADiGNQAeYIIpF1iJHVa4GKEve0tFLHl1Pla7J51exRnUWL8VjEetAAP///8A////AP///wD///8AC0WuAAk/tAAANdpIAFD6/wA+7f8gd6jqBlPX+QBE9PIGS8uDLnZLADqNJwAzjDMA////AP///wD///8A////AAAw0QAALc0AAEPdegBI4f8AK8P/ADHX/wAwzf8AL8b/AEno/gAz2zYALtEQAC3VAP///wD///8A////AP///wAAMssAADjSMwBA2pIATen/ADG9/wBe1v8ATcz/ADHK/wBN5/4ASeH/AEvl6wA10DP///8A////AP///wD///8AADnTSQBO5/8ANc7/ADnR/xC+9/8C0f//AMj//wCP8P8ALcX/ACrC/wBE3f8ASeOf////AP///wD///8A////AABI4Z4ARN3/ACvG/wJAxP8Z5v//AMT//wDE//8Axv7/AETM/wA51P8AUervADjSPP///wD///8A////AP///wAAOdRiAFry+QBS6/QATOP/H+P8/xDe//8J1///E9H4/wFE2f8AReC6ADTOEwAyywD///8A////AP///wD///8AADDNAAAyzCcARN7WACvG/wVfzf8d0vf/HM30/whf0/8AI7n/ADzV+AA40kUAMswA////AP///wD///8A////AAAwywAAPNdTAEfg/wAsw/8AOdb/ADLP/wAswv8AReP/AC7H/wA40f8AR+GfADDKAP///wD///8A////AP///wAAMswAADfRQgBY8f8AT+j/AE7o7AA+1/8AK8T/AE7o/wBN5f8AVe7/AD/ZbAAwywD///8A////AP///wD///8AADPMAAAyywAANM4vADjSUQA0zikAU+z3AEff/wBJ4sMAN9EtADjROQAyywAAM8wA////AP///wD///8A////AAAzzAAAM8wAADHLAAAwywAAMcsAAD/YXQBK4pYAN9AxAC/KAAAwygAAM8wAADPMAP///wD///8A+R8AAPAfAADABwAAwAMAAPgDAADwHwAA8AcAAOADAADAAwAAwAMAAMAHAADgBwAA4AcAAOAHAADwDwAA/j8AAA==" label="Копировать изображение кнопки в base64"\n\ oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").copyIMG()', true) + '"/>\n\ <menuitem class="menuitem-iconic" image="chrome://custombuttons/skin/copy.png" label="Копировать кнопку в буфер обмена"\n\ oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").copyURI()', true) + '"/>\n\ <menuitem class="menuitem-iconic" image="data:application/file;base64,AAABAAEAEBACAAEAAQCwAAAAFgAAACgAAAAQAAAAIAAAAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAAD/AAAD/8AAA//AAAP/wAAD/8AAA//AAAP/wAAD/8AAA//AAAP/wAAD/8AAA//AAAP/wAAA/wAAAP8AAA" label="Копировать кнопку как BBcode ссылку"\n\ oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").copyBBCode()', true) + '"/>\n\ <menuitem class="menuitem-iconic" image="data:application/file;base64,AAABAAEAEBACAAEAAQCwAAAAFgAAACgAAAAQAAAAIAAAAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAADbAAADpcAAA//AAANVwAAD/8AAAKsAAAD/AAAP//AAAP8AAAD/AAAD/8AAAwDAAAP/wAAA/wAAAP8AAA" label="Копировать кнопку как текст"\n\ oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").copyButtonsCodeText()', true) + '"/>\n\ <menuitem class="menuitem-iconic" image="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAAAP8AAAD/AAAAAAAAAP8AAAD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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//+sQf//rEH4j6xB8IesQeHDrEHD4axBh/CsQYf4rEGH8KxBw+GsQeHDrEHwh6xB+I+sQf//rEH//6xB//+sQQ==" label="Копировать кнопку как HTML ссылку"\n\ oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").copyHTML()', true) + '"/>\n\ <menuseparator id="\' + this.id + \'-separator"/>\n\ <menuitem class="menuitem-iconic" image="data:application/file;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAD///8A////AESqAABHpgAASKAAAEukAQxMpQMYR6MAAEepAQ9MpgOLRKgACUenAABHpgAARKoAAP///wD///8A////AP///wBEqgAARaIAAFS2FVBj0jS3Y9AzyVG0EUROrwt8TKcDs0ikAANInwAAR6YAAESqAAD///8A////AP///wD///8ARKQAAVvJKJtj0jX/SaAJ/0abCv9UtSH/U7QX8lW5IMddwyfQW8Iii0mqBQ1DqQAA////AP///wD///8A////AEWlAAFYwB6YXsYc5F7GFt9bwA+vVbgWvU6rAKBRrgf0RZgA/02oDP9ezCzJR6UBA////wD///8A////AP///wBFrAAASKIAADiGNQAeYIIpF1iJHVa4GKEve0tFLHl1Pla7J51exRnUWL8VjEetAAP///8A////AP///wD///8AC0WuAAk/tAAANdpIAFD6/wA+7f8gd6jqBlPX+QBE9PIGS8uDLnZLADqNJwAzjDMA////AP///wD///8A////AAAw0QAALc0AAEPdegBI4f8AK8P/ADHX/wAwzf8AL8b/AEno/gAz2zYALtEQAC3VAP///wD///8A////AP///wAAMssAADjSMwBA2pIATen/ADG9/wBe1v8ATcz/ADHK/wBN5/4ASeH/AEvl6wA10DP///8A////AP///wD///8AADnTSQBO5/8ANc7/ADnR/xC+9/8C0f//AMj//wCP8P8ALcX/ACrC/wBE3f8ASeOf////AP///wD///8A////AABI4Z4ARN3/ACvG/wJAxP8Z5v//AMT//wDE//8Axv7/AETM/wA51P8AUervADjSPP///wD///8A////AP///wAAOdRiAFry+QBS6/QATOP/H+P8/xDe//8J1///E9H4/wFE2f8AReC6ADTOEwAyywD///8A////AP///wD///8AADDNAAAyzCcARN7WACvG/wVfzf8d0vf/HM30/whf0/8AI7n/ADzV+AA40kUAMswA////AP///wD///8A////AAAwywAAPNdTAEfg/wAsw/8AOdb/ADLP/wAswv8AReP/AC7H/wA40f8AR+GfADDKAP///wD///8A////AP///wAAMswAADfRQgBY8f8AT+j/AE7o7AA+1/8AK8T/AE7o/wBN5f8AVe7/AD/ZbAAwywD///8A////AP///wD///8AADPMAAAyywAANM4vADjSUQA0zikAU+z3AEff/wBJ4sMAN9EtADjROQAyywAAM8wA////AP///wD///8A////AAAzzAAAM8wAADHLAAAwywAAMcsAAD/YXQBK4pYAN9AxAC/KAAAwygAAM8wAADPMAP///wD///8A+R8AAPAfAADABwAAwAMAAPgDAADwHwAA8AcAAOADAADAAwAAwAMAAMAHAADgBwAA4AcAAOAHAADwDwAA/j8AAA==" label="Сохранить изображение кнопки"\n\ oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").saveIMG()', true) + '"/>\n\ <menuitem class="menuitem-iconic" image="data:application/file;base64,AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAD///8BAAAAFwAAAGkAAABzAAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAADkAAAAP////AQAAAIdgZmj/YWlt/2FobP9haGz/YGhr/2Boa/9fZ2v/X2dr/15mav9dZWn/XGRo/0ZNUP8AAACdAAAAFf///wEAAACr2tzc/9ve4P/a3t//1dnZ/7S2tf+foJz/m5ya/6apqP/O0tP/09fZ/9DV1v+hqq//AAAAuQAAABX///8BAAAAq+3u7//e4eL/ub29/2hnXv9oVUX/U0As/zgxGf83Lx3/YWBX/7a5uv/S1tj/o6yx/wAAALkAAAAV////AQAAAKv29/f/19na/1dUQf9jXDv/dmtJ/4FoSP9VQiL/V0Ek/008Iv9HQTP/yc3P/6Wus/8AAAC5AAAAFf///wEAAACr+Pj4/5uamP9tY0L/g31b/6GLa/+McVH/eFY5/4xwUv9yXkD/RTki/4uMiv+nsLT/AAAAuQAAABX///8BAAAAq/n6+v+FfXL/waSM/8qznf/DrZP/ooFi/7WfhP+qh2//blk9/1A+Iv9aWlH/pK2x/wAAALkAAAAV////AQAAAKv6+/v/d3Rr/9zCsP/RxbH/z8Wu/9fJt//Qvab/qItv/5iOb/9tYUH/VVJK/6Wtsf8AAAC5AAAAFf///wEAAACr+/z8/4mHff+3pI//3NK//+HXxf/m3Mz/5trJ/9rMuf+bgWT/d14//2hnYP+osbX/AAAAuQAAABX///8BAAAAq/z9/f/FxL7/j4l+//Xw5f/29ez/8/Dl/+DMuv/VuaP/poZn/2dFKv+srav/oamt/wAAALkAAAAV////AQAAAKv+/v7/+/z8/5iZjf+5uqr/6+PW/+3i1P/kzL3/vZR+/4NhSf+Qh3z/z9HS/4qQkv8AAAC1AAAAFf///wEAAACr/v7+//7+/v/u7u3/tbiv/5WSgP+DfGj/e25Z/29gTv+sppz/vr6+/5aYmP90eHr/AAAApwAAABP///8BAAAAq/////////////////7+/v/9/f3//f39//v8/P/5+fn/1dXV/2pqav9TU1P/QUFB/wEBAYkAAAAJ////AQAAAKv7+/v//////////////////v7+//7+/v/+/v7/+vr6/9fY2P/V1tb/7Ozs/4KCgv8EBAQrAAAAA////wEAAACFlJSU/6ioqP+qqqr/qqqq/6qqqv+qqqr/qKio/6anp/2kpaX9o6Oj/4qKitUZGRk9////Af///wH///8BAAAAFQAAAFUAAABVAAAAVQAAAFUAAABVAAAAVQAAAFUAAABTBAQEUx8fH1dfX18z////Af///wH///8BAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//w==" label="Сохранить кнопку как HTML файл"\n\ oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").SaveButton()', true) + '"/>\n\ <menuitem class="menuitem-iconic" image="data:image/gif;base64,R0lGODlhGAAQALMAAH9AAP+AAP/AgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAGAAQAAAEUFDISaudIevNu/9gKH5SVmIBVnLDILVBO2RyPHOAPAC2K9SwTm5H0wFvnJ+raJwFN8qWwDYc2lZFgBXGddY02kx4zCOHR+i0eg3Wut/wuDsCADs=" label="Сохранить кнопку как XML файл"\n\ oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").save1XML()', true) + '"/>\n\ </menupopup>\n\ </popupset>\n\ <hbox>\n\ <button label="Сохранить избранное" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").exportHTML()', true) + '"\n\ oncontextmenu="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").exportHTML(),opener.document.getElementById("' + this.id + '").close()', true) + '"\n\ tooltiptext = "Left - Сохранить выбранные кнопки\n\ Right - Сохранить выбранные кнопки и закрыть окно"/>\n\ <button label="Сохранить все" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").archiveall()', true) + '"\n\ oncontextmenu="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").archiveall(),opener.document.getElementById("' + this.id + '").close()', true) + '"\n\ tooltiptext = "Left - Сохранить все кнопки \n\ Right - Сохранить все кнопки и закрыть окно"/>\n\ <button label="Выбрать все" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").handle1()', true) + '"\n\ tooltiptext = "Выбрать все кнопки"/>\n\ <button label="Считать кнопки" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").setFolder1()', true) + '"\n\ tooltiptext = "Открыыть файл с кнопками из заданной папки"/>\n\ </hbox>\n\ <hbox> \n\ <spacer flex="1"/>\n\ <button label="Новая кнопка" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").newbutton()', true) + '"\n\ tooltiptext = "Создать новую кнопку рядом с выбранной"/>\n\ <button label="Удалить" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").delete()', true) + '"\n\ tooltiptext = "Удалить выбранную кнопку"/>\n\ <button label="Клонировать" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").clone()', true) + '"\n\ tooltiptext = "Клонировать рядом с собой выбранную кнопку"/> \n\ <button label="Редактировать" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").edit()', true) + '"\n\ tooltiptext = "Редактировать выбранную кнопку"/>\n\ <spacer flex="1"/>\n\ </hbox>\n\ <hbox> \n\ <spacer flex="1"/>\n\ <button label="Инспектор DOM" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").inspect()', true) + '"\n\ oncontextmenu="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").inspect(),opener.document.getElementById("' + this.id + '").close()', true) + '"\n\ tooltiptext = "Left - Открыть кнопку в Инспекторе DOM \n\ Right - Открыть кнопку в Инспекторе DOM и закрыть окно"/>\n\ <button label="Просмотр" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").view()', true) + '"\n\ oncontextmenu="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").view(),opener.document.getElementById("' + this.id + '").close()', true) + '"\n\ tooltiptext = "Left - Просмотреть в новой вкладке код,свойтва, атрибуты \n\ Right - Просмотреть в новой вкладке код,свойтва,атрибуты и закрыть окно"/>\n\ <button label="Открыть архив" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").viewCBOverlay()', true) + '"\n\ tooltiptext = "Открыть файл buttonsoverlay.xul.bak в новой вкладке"/>\n\ <button label="Кнопки из архива" oncommand="' + e4xConv_encodeHTML('opener.document.getElementById("' + this.id + '").importFromCBOverlay()', true) + '"\n\ tooltiptext = "Установить кнопки из файла buttonsoverlay.xul.bak. Надо знать id"/>\n\ <spacer flex="1"/>\n\ </hbox>\n\ </vbox>\n\ </window>'; //var bool = XML.prettyPrinting; // XML.prettyPrinting = false; data = '<?xml version="1.0"?><?xml-stylesheet href="chrome://global/skin/" type="text/css"?>' + data; //XML.prettyPrinting = bool; var url = "data:application/vnd.mozilla.xul+xml;text/plain," + encodeURIComponent(data); //var feature = "chrome,centerscreen,dialog=no"; var feature = "chrome,centerscreen,alwaysRaised"; //this.leftclick = function(event) { //dialog = window.openDialog(url, "", feature); dialog = window.openDialog(url, "_blank", "chrome,centerscreen,dialog=no,resizable=yes"); //} this.reopen = function() { dialog.close(); dialog = window.openDialog(url, "", feature); } this.load = function() { var aList = [], node = /custombuttons-button\d+/; var nodeList = document.getElementsByClassName("toolbarbutton-1 chromeclass-toolbar-additional"); for(var i = 0; i < nodeList.length; i++) if(nodeList[i].id.match(node)) aList.push(nodeList[i]); aList.sort(function (a, b) { a = a.getAttribute("label"); b = b.getAttribute("label"); if(a < b) return -1; if(a > b) return 1; return 0; }) for(var i = 0; i < aList.length; i++) createItem(aList[i]); var bList = [], node = /custombuttons-button\d+/; var nodeList = custombuttons.palette.getElementsByClassName("toolbarbutton-1 chromeclass-toolbar-additional"); for(var i = 0; i < nodeList.length; i++) if(nodeList[i].id.match(node)) bList.push(nodeList[i]); bList.sort(function (a, b) { a = a.getAttribute("label"); b = b.getAttribute("label"); if(a < b) return -1; if(a > b) return 1; return 0; }) for(var i = 0; i < bList.length; i++) createItem(bList[i]); function createItem(button) { var item = document.createElement("listitem"); item.checked = false; item.setAttribute("style", uncheckStyle); item.setAttribute("value", button.id); var cell = document.createElement("listcell"); cell.setAttribute("class", "listcell-iconic"); cell.setAttribute("image", button.getAttribute("image") || getImage(button.getAttribute("cb-stdicon"))); cell.setAttribute("label", button.getAttribute("name") || button.getAttribute("label") || ""); // Style these three if(button.getAttribute("initialized")) cell.style.fontWeight = "bold"; if(button.getAttribute("initialized")) cell.style.fontSize = "12px"; if(button.getAttribute("initialized")) cell.style.textShadow = "#999 2px 2px 2px"; if(!button.getAttribute("initialized")) cell.style.color = "#666"; if(!button.getAttribute("initialized")) item.setAttribute("initialized", true); item.appendChild(cell); var cell = document.createElement("listcell"); cell.setAttribute("label", nodeList[i].id); item.appendChild(cell); dialog.document.getElementById("listbox").appendChild(item); } function getImage(s) { if (s == "custombuttons-stdicon-1") return "chrome://custombuttons/skin/button.png"; if (s == "custombuttons-stdicon-2") return "chrome://custombuttons/skin/stdicons/rbutton.png"; if (s == "custombuttons-stdicon-3") return "chrome://custombuttons/skin/stdicons/gbutton.png"; if (s == "custombuttons-stdicon-4") return "chrome://custombuttons/skin/stdicons/bbutton.png"; return defaultFavicon; } dialog.document.getElementById("listbox").focus(); dialog.document.getElementById("listbox").selectAll(); } function toggleChoice(item) { item.checked = !item.checked; if (item.checked) item.setAttribute("style", checkStyle); else item.setAttribute("style", uncheckStyle); } this.handle = function(event) { var listbox = dialog.document.getElementById("listbox"); if (event.button == 0) toggleChoice(listbox.selectedItem); if (event.button == 1) for (var i = 0; i < listbox.itemCount; i++) toggleChoice(listbox.getItemAtIndex(i)); } this.handle1 = function(event) { var listbox = dialog.document.getElementById("listbox"); for (var i = 0; i < listbox.itemCount; i++) toggleChoice(listbox.getItemAtIndex(i)); } this.copyURI = function() { var listbox = dialog.document.getElementById("listbox"); var button = document.getElementById(listbox.selectedItem.getAttribute("value")); var href, text; if (button) { href = button.URI; text = button.name; } else { var nodeList = custombuttons.palette.getElementsByTagName("toolbarbutton"); for (var i = 0; i < nodeList.length; i++) { if (nodeList[i].id == listbox.selectedItem.getAttribute("value")) { href = createURI(nodeList[i]); text = nodeList[i].getAttribute("name") || nodeList[i].getAttribute("label") || ""; break; } } } custombuttons.cbService.writeToClipboard(href); custombuttons.alertSlide(text, "Код был скопирован в буфер обмена"); } this.copyBBCode = function() { var listbox = dialog.document.getElementById("listbox"); var button = document.getElementById(listbox.selectedItem.getAttribute("value")); var href, text; if (button) { href = button.URI; text = button.name; } else { var nodeList = custombuttons.palette.getElementsByTagName("toolbarbutton"); for (var i = 0; i < nodeList.length; i++) { if (nodeList[i].id == listbox.selectedItem.getAttribute("value")) { href = createURI(nodeList[i]); text = nodeList[i].getAttribute("name") || nodeList[i].getAttribute("label") || ""; break; } } } custombuttons.cbService.writeToClipboard("Install [url=" + href + "][img]" + defaultFavicon + "[/img][B] " + text + "[/B][/url]"); custombuttons.alertSlide(text, "BBCode был скопирован в буфер обмена"); } this.copyButtonsCodeText = function copyButtonsCodeText() { var listbox = dialog.document.getElementById("listbox"); var btn = document.getElementById(listbox.selectedItem.getAttribute("value")); if (!btn) return; var code = ((btn.cbCommand == "") || (btn.Command == "/*CODE*/")) ? "" : ("\n/*CODE*/\n" + btn.cbCommand + "\n"); var init = ((btn.cbInitCode == "") || (btn.cbInitCode == "/*Initialization Code*/")) ? "" : ("\n/*Initialization Code*/\n" + btn.cbInitCode); cbu.gClipboard.write(code + init); custombuttons.alertSlide(btn.name, "Code + INIT Code скопированы в буфер обмена"); } this.copyHTML = function() { var listbox = dialog.document.getElementById("listbox"); var button = document.getElementById(listbox.selectedItem.getAttribute("value")); var href, src, text; if (button) { href = button.URI; src = button.image; text = button.name; } else { var nodeList = custombuttons.palette.getElementsByTagName("toolbarbutton"); for (var i = 0; i < nodeList.length; i++) { if (nodeList[i].id == listbox.selectedItem.getAttribute("value")) { href = createURI(nodeList[i]); src = nodeList[i].getAttribute("image"); text = nodeList[i].getAttribute("name") || nodeList[i].getAttribute("label") || ""; break; } } } if (!src) src = defaultFavicon; custombuttons.cbService.writeToClipboard('<a href="' + href + '"><img alt="" src="' + src + '">' + " " + text + "</a>"); custombuttons.alertSlide(text, "HTML был скопирован в буфер обмена"); } this.copyIMG = function() { var listbox = dialog.document.getElementById("listbox"); var button = document.getElementById(listbox.selectedItem.getAttribute("value")); var href, src, text; if (button) { src = button.image; text = button.name; } else { var nodeList = custombuttons.palette.getElementsByTagName("toolbarbutton"); for (var i = 0; i < nodeList.length; i++) { if (nodeList[i].id == listbox.selectedItem.getAttribute("value")) { src = nodeList[i].getAttribute("image"); text = nodeList[i].getAttribute("name") || nodeList[i].getAttribute("label") || ""; break; } } } if (!src) custombuttons.alertBox(text + "\n" + "Эта кнопка не имеет изображения!"); else {custombuttons.cbService.writeToClipboard(src); custombuttons.alertSlide(text, "Изображение кнопки было скопировано в буфер обмена"); } } this.saveIMG = function() { var listbox = dialog.document.getElementById("listbox"); var button = document.getElementById(listbox.selectedItem.getAttribute("value")); var href, src, text; if (button) { src = button.image; text = button.name; } else { var nodeList = custombuttons.palette.getElementsByTagName("toolbarbutton"); for (var i = 0; i < nodeList.length; i++) { if (nodeList[i].id == listbox.selectedItem.getAttribute("value")) { src = nodeList[i].getAttribute("image"); text = nodeList[i].getAttribute("name") || nodeList[i].getAttribute("label") || ""; break; } } } if (!src) custombuttons.alertBox(text + "\n" + "Эта кнопка не имеет изображения!"); //else saveImageURL(src, text); else if(button.image != "") { var br = gBrowser; var tab = br.mCurrentTab; br.selectedTab = br.addTab(button.image); setTimeout( function() { window.content.document.title = button.name; saveDocument(window.content.document); // br.removeCurrentTab(); br.selectedTab = tab; }, 200); } } this.SaveButton = function() { var listbox = dialog.document.getElementById("listbox"); var id = listbox.selectedItem.getAttribute("value"); var btn = document.getElementById(id); var btnname, btnimage, btnURI, btncbInitCode, btncbCommand, btnHelp; if (btn) { btnname = btn.name; btnimage = btn.image; btnURI = btn.URI; btncbInitCode = btn.cbInitCode; btncbCommand = btn.cbCommand; btnHelp = btn.Help; } else { var nodeList = custombuttons.palette.getElementsByTagName("toolbarbutton"); for (var i = 0; i < nodeList.length; i++) { if (nodeList[i].id == listbox.selectedItem.getAttribute("value")) { btnimage = nodeList[i].getAttribute("image"); btnname = nodeList[i].getAttribute("name") || nodeList[i].getAttribute("label") || ""; btnURI = createURI(nodeList[i]); btncbInitCode = nodeList[i].getAttribute("cb-init"); btncbCommand = nodeList[i].getAttribute("cb-oncommand"); btnHelp = nodeList[i].getAttribute("Help"); break; } } } if (!btnimage) btnimage = defaultFavicon; var xml = '<html xmlns="' + e4xConv_encodeHTML(xhtmlns, true) + '">\n\ <head>\n\ <meta http-equiv=\'Content-Type\' content=\'text/html; charset=utf-8\'/>\n\ <title>' + e4xConv_encodeHTML(btn.name + ' for Custom Buttons') + '</title>\n\ <link rel=\'icon\' type=\'image/vnd.microsoft.icon\' href="' + e4xConv_encodeHTML(btn.image, true) + '"/>\n\ <style type="text/css">\n\ .button a{\n\ background-color: rgb(85, 168, 2);\n\ background-image: linear-gradient(to bottom, rgb(147, 200, 94), rgb(85, 168, 2));\n\ background-image: -moz-linear-gradient(top, rgb(147, 200, 94), rgb(85, 168, 2));\n\ border: 1px solid rgb(58, 116, 4);\n\ border-radius: .5em;\n\ -webkit-border-radius: .5em;\n\ padding: 0;\n\ margin-bottom: 1em;\n\ box-shadow: 1px 2px 3px rgba(0, 0, 0, .25);\n\ -o-box-shadow: 1px 2px 3px rgba(0, 0, 0, .25);\n\ -webkit-box-shadow: 1px 2px 3px rgba(0, 0, 0, .25);\n\ color: #000;\n\ text-shadow: -1pt -1px 0pt rgba(255, 255, 255, .5);\n\ padding: 0.5em;\n\ text-decoration: none;\n\ }\n\ pre { border: 1px inset rgb(170, 170, 170); \n\ background-color: rgb(255, 255, 255);}\n\ body { background-color: rgb(245, 245, 220);} \n\ </style> \n\ </head>\n\ <body>\n\ <section id=\'install\'><h1>' + e4xConv_encodeHTML(btn.name) + '</h1>\n\ </section>\n\ <div class="button"><a href="' + e4xConv_encodeHTML(btn.URI, true) + '">Установить кнопку</a></div>\n\ <section id=\'init\'><h2>Инициализация</h2><pre>' + e4xConv_encodeHTML(btn.cbInitCode) + '</pre></section>\n\ <section id=\'code\'><h2>Код</h2><pre>' + e4xConv_encodeHTML(btn.cbCommand) + '</pre></section>\n\ <section id=\'help\'><h2>Справка</h2><pre>' + e4xConv_encodeHTML(btn.Help) + '</pre></section>\n\ </body>\n\ </html>'; var html = '<!DOCTYPE html>\n' + xml; name = btn.name + ".HTML"; saveToFile(html, name); custombuttons.alertSlide("Кнопка: " + btn.name, "сохранена"); } this.newbutton = function() { var out = new Array(); var listbox = dialog.document.getElementById("listbox"); for (var i = 0; i < listbox.itemCount; i++) { if (listbox.getItemAtIndex(i).checked && document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")) != null) { var button = document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")); custombuttons. cloneButton(document.getElementById(listbox.getItemAtIndex(i).getAttribute("value"))); var newButtonLink = custombuttons. makeButtonLink ("update", document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")).nextSibling. id ); var params = custombuttons. cbService. getButtonParameters (newButtonLink). wrappedJSObject; params. image = ""; params. name = "" params. code = ""; params. initCode = ""; params. wrappedJSObject = params; custombuttons. cbService. installButton (params); this.reopen(); } } } this.edit = function() { var out = new Array(); var listbox = dialog.document.getElementById("listbox"); for (var i = 0; i < listbox.itemCount; i++) { if (listbox.getItemAtIndex(i).checked && document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")) != null) { var button = document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")); custombuttons.editButton(document.getElementById(listbox.getItemAtIndex(i).getAttribute("value"))); } } } this.save1XML = function() { //var button = null; var btn = null; var btns = document.querySelectorAll("toolbarbutton[cb-init]"); for (var i = 0; i < btns.length; i++) { if ("saveXML" in btns[i]) { btn = btns[i]; break; } } if (!btn) { custombuttons.alertBox(this.label, "Кнопка XML Exporter/Importer не установлена"); return; } var listbox = dialog.document.getElementById("listbox"); var id = listbox.selectedItem.getAttribute("value"); btn.saveXML(document.getElementById(id).URI); } this.clone = function() { var out = new Array(); var listbox = dialog.document.getElementById("listbox"); for (var i = 0; i < listbox.itemCount; i++) { if (listbox.getItemAtIndex(i).checked && document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")) != null) { var button = document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")); custombuttons.cloneButton(document.getElementById(listbox.getItemAtIndex(i).getAttribute("value"))); this.reopen(); } } } this.delete = function() { var out = new Array(); var listbox = dialog.document.getElementById("listbox"); for (var i = 0; i < listbox.itemCount; i++) { if (listbox.getItemAtIndex(i).checked && document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")) != null) { var button = document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")); var id = listbox.getItemAtIndex(i).getAttribute("value"); var oRemovedButton = document.getElementById(id); var sParentToolbarId = oRemovedButton.parentNode.id; var sRemovedButtonId = oRemovedButton.getAttribute("id"); var cButtonsToRemove = document.getElementsByAttribute("id", sRemovedButtonId); var bRemoveFromOverlay = cButtonsToRemove.length == 1; custombuttons.cbService.removeButton(oRemovedButton, bRemoveFromOverlay); custombuttons.persistCurrentSets(sParentToolbarId, sRemovedButtonId, null); this.reopen(); } } } this.view = function() { var listbox = dialog.document.getElementById("listbox"); var id = listbox.selectedItem.getAttribute("value"); var box = custombuttons.confirmBox3("CB TOOLS", "Просмотр в новой вкладке:", "Код", "Свойства", "Атрибуты"); if (box == 0) this.link(); if (box == 2) this.attr(); if (box == 1) this.prop(); this.reopen(); } var br = getBrowser(); function openTab(arr) { for (var i = 0; i < arr.length; i++) { arr[i] = converter.ConvertFromUnicode(arr[i]); arr[i] = arr[i].replace(/&/g, "&"); arr[i] = arr[i].replace(/>/g, ">"); arr[i] = arr[i].replace(/</g, "<"); arr[i] = arr[i].replace(/"/g, """); arr[i] = arr[i].replace(/'/g, "'"); } var data = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//En">'; data += "<html><head><title>" + arr[1] + "</title>"; data += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'; data += "</head><body><pre>" + arr.join("\n\n") + "</pre></body></html>"; var info = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo); if (info.name == "Firefox" || info.name == "SeaMonkey") { br.selectedTab = br.addTab("data:text/html;charset=utf-8;base64," + btoa(data)); } if (info.name == "Thunderbird") { openContentTab("data:text/html;charset=utf-8;base64," + btoa(data)); } } this.attr = function() { var listbox = dialog.document.getElementById("listbox"); var id = listbox.selectedItem.getAttribute("value"); var node = document.getElementById(id); var out = new Array(); out.push('windowtype="' + document.documentElement.getAttribute("windowtype") + '" id="' + id + '"'); out.push("Атрибуты"); for (var i = 0; i < node.attributes.length; i++) { if (node.attributes[i].nodeName == "cb-oncommand" || node.attributes[i].nodeName == "cb-init" || node.attributes[i].nodeName == "Help") { out.push(node.attributes[i].nodeName + " " + typeof node.attributes[i].nodeValue + "\n" + "[omitted]"); } else { out.push(node.attributes[i].nodeName + " " + typeof node.attributes[i].nodeValue + "\n" + node.attributes[i].nodeValue); } } openTab(out); } this.prop = function() { var listbox = dialog.document.getElementById("listbox"); var id = listbox.selectedItem.getAttribute("value"); var node = document.getElementById(id); var out = new Array(); out.push('windowtype="' + document.documentElement.getAttribute("windowtype") + '" id="' + id + '"'); out.push("Свойства"); for (var i in node) { if (i == "cbCommand" || i == "cbInitCode" || i == "Help" || i == "URI") { out.push(i + " " + typeof node[i] + "\n" + "[omitted]"); } else { out.push(i + " " + typeof node[i] + "\n" + node[i]); } } openTab(out); } this.link = function() { var listbox = dialog.document.getElementById("listbox"); var id = listbox.selectedItem.getAttribute("value"); var out = new Array(); out.push('windowtype="' + document.documentElement.getAttribute("windowtype") + '" id="' + id + '"'); out.push("Код"); out.push(unescape(document.getElementById(id).URI)); openTab(out); } this.inspect = function() { if (typeof(inspectDOMDocument) == "undefined") { custombuttons.alertBox(this.label, "DOM Инспектор не установлен."); return; } var listbox = dialog.document.getElementById("listbox"); var id = listbox.selectedItem.getAttribute("value"); inspectDOMNode(document.getElementById(id)); } this.setFolder1 = function(){ BrowserOpenFileWindow(); } this.exportHTML = function () { var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]. createInstance(Components.interfaces.nsIScriptableUnicodeConverter); converter.charset = "UTF-8"; var out = new Array(); var listbox = dialog.document.getElementById("listbox"); for (var i = 0; i < listbox.itemCount; i++) { if (listbox.getItemAtIndex(i).checked && document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")) != null) { var button = document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")); var href = button.URI; var src = button.image; var text = button.name; if (!src) src = defaultFavicon; out.push('<li><a href="' + href + '"><img alt="" src="' + src + '">' + converter.ConvertFromUnicode(text) + '</a></li>'); } } var nodeList = custombuttons.palette.getElementsByTagName("toolbarbutton"); for (var i = 0; i < nodeList.length; i++) { if (nodeList[i].id.search("custombuttons-button") == 0 && document.getElementById(nodeList[i].id) == null) { for (var j = 0; j < listbox.itemCount; j++) { if (listbox.getItemAtIndex(j).checked && nodeList[i].id == listbox.getItemAtIndex(j).getAttribute("value")) { var href = createURI(nodeList[i]); var src = nodeList[i].getAttribute("image"); var text = nodeList[i].getAttribute("name") || nodeList[i].getAttribute("label") || ""; if (!src) src = defaultFavicon; out.push('<li><a href="' + href + '"><img alt="" src="' + src + '">' + converter.ConvertFromUnicode(text) + '</a></li>'); } } } } var data = document.getElementById(this.id).getAttribute("Help"). replace("<ol>", bDate() + "\n" + "<ol>" + "\n" + out.join("\n")); name = "CB buttons " + aDate().replace(/:/g, ".") + ".html" // name = "CB buttons " + new Date().toLocaleFormat("%d.%m.%Y. %H·%M·%S") + ".html" saveToFile(data, name); custombuttons.alertSlide("Кнопки", "сохранены"); } this.archiveall = function() { var out = new Array(); out.push('<a><hr><strong>' + converter.ConvertFromUnicode(text1) + '</strong><hr></a>'); var listbox = dialog.document.getElementById("listbox"); for (var i = 0; i < listbox.itemCount; i++) { if (document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")) != null) { var button = document.getElementById(listbox.getItemAtIndex(i).getAttribute("value")); var href = button.URI; var src = button.image; var text = button.name; if (!src) src = defaultFavicon; out.push('<li><a href="' + href + '"><img alt="" src="' + src + '">' + converter.ConvertFromUnicode(text) + '</a></li>'); } } var nodeList = custombuttons.palette.getElementsByTagName("toolbarbutton"); out.push('<a><hr><strong>' + converter.ConvertFromUnicode(text2) + '</strong><hr></a>'); for (var i = 0; i < nodeList.length; i++) { if (nodeList[i].id.search("custombuttons-button") == 0 && document.getElementById(nodeList[i].id) == null) { var href = createURI(nodeList[i]); var src = nodeList[i].getAttribute("image"); var text = nodeList[i].getAttribute("name") || nodeList[i].getAttribute("label") || ""; if (!src) src = defaultFavicon; out.push('<li><a href="' + href + '"><img alt="" src="' + src + '">' + converter.ConvertFromUnicode(text) + '</a></li>'); } } var data = document.getElementById(this.id).getAttribute("Help"). replace("<ol>", bDate() + "\n" + "<ol>" + "\n" + out.join("\n")); name = "CB buttons " + aDate().replace(/:/g, ".") + ".html" saveToFile(data, name); } function readFile(file) { var data = ""; var fstream = Cc["@mozilla.org/network/file-input-stream;1"]. createInstance(Ci.nsIFileInputStream); fstream.init(file, -1, 0, 0); var charset = "UTF-8"; const replacementChar = Ci.nsIConverterInputStream .DEFAULT_REPLACEMENT_CHARACTER; var is = Cc["@mozilla.org/intl/converter-input-stream;1"]. createInstance(Ci.nsIConverterInputStream); is.init(fstream, charset, 1024, replacementChar); var str = {}; while (is.readString(4096, str) != 0) { data += str.value; } is.close(); return data; } function stringToDOM(aString) { // https://developer.mozilla.org/en/Parsing_and_serializing_XML var parser = new DOMParser(); var dom = parser.parseFromString(aString, "text/xml"); if (dom.documentElement.nodeName == "parsererror") { return null; } else { return dom; } } function getCBOverlay() { var dirsvc = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties); var file = dirsvc.get("ProfD", Ci.nsIFile); file.append("custombuttons"); file.append("backup"); file.append("buttonsoverlay.xul.bak"); return file; } this.viewCBOverlay = function viewCBOverlay() { var fileURL = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService).getProtocolHandler("file"). QueryInterface(Ci.nsIFileProtocolHandler). getURLSpecFromFile(getCBOverlay()); gBrowser.selectedTab = gBrowser.addTab("view-source:" + fileURL); } function importXMLtoButton(aStrXMLData) { loadURI("custombutton://" + escape(aStrXMLData)); } this.importFromCBOverlay = function importFromCBOverlay(aTitle) { var id = custombuttons.promptBox(aTitle, "Введитете номер id кнопки:"); if (!id[1] || id[1] == "") return; id = "custombuttons-button" + id[1]; var dom = stringToDOM(readFile(getCBOverlay())); var button = dom.getElementById(id); if (!button) { custombuttons.alertBox(aTitle, "Копка Id " + id + " не найдена!"); return; } var cbName = button.getAttribute("cb-name") || button.getAttribute("label"); var cbImage = button.getAttribute("image") || button.getAttribute("cb-stdicon") || ""; var cbMode = button.getAttribute("mode") || ""; var cbInitCode = button.getAttribute("cb-init"); var cbCode = button.getAttribute("cb-oncommand"); var cbKey = button.getAttribute("accelkey") || ""; var cbHelp = button.getAttribute("Help") || ""; var cbAttr = button.getAttribute("attributes"); var cbXML = '<custombutton xmlns:cb="' + e4xConv_encodeHTML(cbNamespace, true) + '">\n\ <name>' + e4xConv_encodeHTML(cbName) + '</name>\n\ <image>' + e4xConv_encodeHTML(cbImage) + '</image>\n\ <mode>' + e4xConv_encodeHTML(cbMode) + '</mode>\n\ <initcode>' + e4xConv_encodeHTML(cbInitCode) + '</initcode>\n\ <code>' + e4xConv_encodeHTML(cbCode) + '</code>\n\ <accelkey>' + e4xConv_encodeHTML(cbKey) + '</accelkey>\n\ <help>' + e4xConv_encodeHTML(cbHelp) + '</help>\n\ <attributes>' + e4xConv_encodeHTML(cbAttr) + '</attributes>\n\ </custombutton>'; var xml = "<?xml version='1.0' encoding='UTF-8'?>" + cbXML.toString(); importXMLtoButton(xml); } function e4xConv_encodeHTML(s, isAttr) { s = String(s) .replace(/&/g, "&") .replace(/</g, "<") .replace(/>/g, ">") .replace(/"/g, """); if(isAttr) { s = s .replace(/\t/g, "	") .replace(/\n/g, "
") .replace(/\r/g, "
"); } return s; }
Отредактировано Andrey_Krropotkin (24-01-2018 23:24:55)
Отсутствует
не стал заворачиваться с новыми функциями
У меня что-то не вышло. Код кнопки целиком можно?
Или вот кнопка нат 90% рабочая со старых времен
К сожалению, сохранение всех кнопок и не работает - файл сохраняется пустой.
Отсутствует
Ultima2m А Вы кнопки выбираете галочками или кнопку "выбрать все" нажимали?
Вот простой код например для сохранения
/*CODE*/ var saveImg5 = "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU1FQr1FRT7BRUU+wUVFPsFFRT7BRUU+wUVFPsFFRT7BRUU+wUVFPsFFRT7BRUU+wU1FQrwAAAAAAAAAAAAAAAHd0cpz//////////////////////////////////////////////////////////3d0cpwAAAAAAAAAAAAAAAB4d3Sc/////+Dg4P/g4OD/4ODg/+Dg4P/g4OD/4ODg/+Dg4P/g4OD/4ODg//////94d3ScAAAAAAAAAAAAAAAAenh3nP/////i4uL/4uLi/5yiz/9HYcT/PWrR/1qQ3P+nuNr/4uLi/+Li4v//////enh3nAAAAAAAAAAAAAAAAH18eJz/////5OTk/2FluP8IJ6r/D1TU/wli4v8FZeb/D3He/4y+5f/k5OT/+/v7/318eJwAAAAAAAAAAAAAAACBfXyc/////5Wc0v8JKq//E2Pd/yFTrv9EKTn/LjVZ/xaF2/8OdNP/zNnm//z8/P+BfXycAAAAAAAAAAAAAAAAhIGBnP////89Xc7/Dk7N/wpQ0/8zVp//TGCK/4U2Cf9DW2b/Eqj7/5C+5//8/Pz/hIGBnAAAAAAAAAAAAAAAAIaEgZz/////Kmnf/wlFzf8gPZ7/uXcl/8OAK/+UTBL/b1Az/zfG9f9srdX/+fn5/4aEgZwAAAAAAAAAAAAAAACJhoac/////0iN6P8HQtH/EVzd/2mCqf/dqkz/0pY6/6FnKv9Nvt7/kMfs//X19f+JhoacAAAAAAAAAAAAAAAAiomJnP////+Mr+r/FFnU/xVRyv+LorL/8Oqh//nXbP+5omH/Urvf/8bj7v/s7Oz/iomJnAAAAAAAAAAAAAAAAI6Kipz/////2+n3/5aSm/+hcEn/4uXC////2P/25KD/rqSD/7HR5//o6Oj/4eHh/46KipwAAAAAAAAAAAAAAACPjo6c//////j4+P/4+Pj/3s/F/9i/n//p27n/5NG0/+7r6f/r6+v/3t7e/9LS0v+Pjo6cAAAAAAAAAAAAAAAAk4+PnP/////6+vr/+vr6//r6+v/6+vr/+vr6//j4+P/19fX/r66t/62sq/ObmprrkI2NpgAAAAAAAAAAAAAAAJOTk5z//////Pz8//z8/P/8/Pz/+/v7//r6+v/4+Pj/9fX1/66trfHs7Ozrp6emp4aGhhMAAAAAAAAAAAAAAACWlpOc/////////////////v7+//39/f/6+vr/9/f3//Pz8/+bmprrp6enp3NzcxYAAAAAAAAAAAAAAAAAAAAAmJiWnJiYlpyYmJacmJiWnJeTk52SkZGemJiWnJeTk52SkZGej4+LpIaGhhMAAAAAAAAAAAAAAAAAAAAAgAMAAIADAACAAwAAgAMAAIADAACAAwAAgAMAAIADAACAAwAAgAMAAIADAACAAwAAgAMAAIADAACABwAAgA8AAA=="; var saveToFile = function (fileContent, fileName) { var uc = Components.classes['@mozilla.org/intl/scriptableunicodeconverter'].createInstance(Components.interfaces.nsIScriptableUnicodeConverter); uc.charset = 'utf-8'; fileContent = uc.ConvertFromUnicode(fileContent); var nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker); fp.init(window, '', fp.modeSave); fp.defaultString = fileName; fp.appendFilters(fp.filterHTML); fp.appendFilters(fp.filterAll); fp.open(function (rv) { if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) { var stream = Components.classes['@mozilla.org/network/file-output-stream;1'].createInstance(Components.interfaces.nsIFileOutputStream); stream.init(fp.file, 0x02|0x20|0x08, 0666, 0); stream.write(fileContent, fileContent.length); stream.close(); } }); }; var visibleCBbuttons = [...document.querySelectorAll('[cb-mode]')]; var paletteCBbuttons = [...custombuttons.palette.querySelectorAll('[cb-mode]')]; var allCBbuttons = visibleCBbuttons.concat(paletteCBbuttons); var array = []; allCBbuttons.forEach(but=> { var uri = but.URI ? but.URI : getPaleteButtonsURI(but); var name = but.getAttribute("label") || "Без названия"; var image = but.getAttribute("image") || "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAACNFBMVEXDRgDweQDnbwC0NgDCRQC7PQDtpTu+QQD78q3PUwDCRAD//8vbYQDLTgDocAD0iQX1jQbGSgD7iAD4gwDVaw7vdwDyegD+igDweQDlawDyhAXveADmZwDzmBbtcwDwkhHveADmhBTkgxbweADkfRH+igD7hADXZQX0gADyjA/tfgvveQDiawDQVADRXgfnbwD1jAb9iQD9z0PVZAbxpinykRHtdgD5mRbERQDDRgDOYArCRAD9iQD3ewDxegD3dwDFRgDAQAD+hgD4fQDucgDtgQftfwTISQDCRQDvdgD5lxb1kRb2qh7wnynkagD766LDRQDDRwDDRQDspjbtpzbuqDbvqzv//8DUZAbCRQD//83pjhvveQbvggW+QQDfcxLlmUb//8veYADMTwDHSADVVwC8PgDwixb78q3oZgDUWADRVADCRQD9iQDERwDBQQDYVQC+PgC0NgDbYQDWWgDUWADSVQDFSAC+QAC7PAC0NgD+wRL+/kD+/zb+7i3+8Cv+/DX+wBL/+DD/rwz+qgz+rwz/tAz+sQzfbAT+3iP/+jD//Dz1jwP+nwf5iwf7pBz2tRr4lwb/ogfsdQT+2R7/9ET+2iT8yyLmgBL5iQL2egLokhP7zzT60zv1zUr0gAL1ewP50yn9+UL++EXooyngaAH41EPzowzyySj+xxzlhhHvvyruwjXxvTnUag3+zxrwigP+swz86U/ZXwD75lHqegD6xzb//kn+uhPTXAG3OAD/+UC2vFeJAAAAe3RSTlMAAAAAAAAAAAAAAAAAAAAAAAAAAACfnwAIaelpAAA2+wD7UQAAa3oArKzRzMysnwgAvPQA/gAAw3prw0oALr16vS4AACnF6bspAAAA/mIAADQAAAAAAI8AAEwA0vv7kd2yAuuvr+vKABL23U+8Sk/d9vUDIIAQAAAQgCAfvupHAAABB0lEQVR4Xi3IU3fDABgA0C+u26FdZ9u2bdu2vZSzbds2/tyac3IfLxjpGyA6MimqY6gHTNgiiNwkwRM1E7EhTrYyTfMzzsh0ZEPiH+D6+u5mV1jEhpe5haVCYW1T4suEvUOkk7PLpVJ5WFnl7hEUDN5LPvsHJ6cazdn13f3DYxu0B35+/Y2qVSr17NzGeUgohIVHLK/PMDa39qKieRATGxd/9cS4uU1MwnmQktqY/qGlaVr7/ZOVDTmQm5df8PwyNj4xOTVdjOM4kCRZOr+wWFa+srpWQVEU8PnV2zu7NbV19UfHDQRBAIfTdNHc0soVdnR2dfdgGAgEvW99/QNc4eDQ8O8Ihv0D77NPgbVLZ6kAAAAASUVORK5CYII="; array.push("<img src=" + image + "> <a href=" + uri + ">" + name +"</a><br>\n"); }); var before = "<html>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n</head>\n<body>\n"; var after = "\n</body>\n</html>"; var text = before + array.join("") + after; name = "CB buttons " + aDate().replace(/:/g, ".") + ".html" saveToFile(text, name); var alertsService = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService) alertsService.showAlertNotification(saveImg5, "Экспорт в HTML", "Экспортировал все CB кнопки как HTML"); setTimeout(()=> alertsService.closeAlert(), 4000); function aDate() { var t=new Date(); var y=1900+t.getYear(); var min=t.getMinutes(); if (min<10){min="0"+min}; var h=t.getHours(); var m=t.getMonth();switch(m){case 0: m="января";break;case 1: m="февраля";break;case 2: m="марта";break;case 3: m="апреля";break;case 4: m="мая";break;case 5: m="июня";break;case 6: m="июля";break;case 7: m="августа";break;case 8: m="сентября";break;case 9: m="октября";break;case 10: m="ноября";break;default: m="декабря";} var d=t.getDate(); var curdate=y+"г."+" "+d+" "+m+" "+h+":"+min; var myfilename=curdate; return myfilename; } function getPaleteButtonsURI(but) { var doc = document.implementation.createDocument("", "", null); doc.async = false; doc.load("chrome://custombuttons/content/nbftemplate.xml"); ["help,Help", "name,label", "image,image", "mode,cb-mode", "initcode,cb-init", "accelkey,cb-accelkey", "code,cb-oncommand"] .forEach(str=> { var arr = str.split(','); var value = but.getAttribute(arr[1]), name = arr[0]; custombutton.buttonSetText(doc, name, value, true); }); var ser = new XMLSerializer(); return "custombutton://" + escape(ser.serializeToString(doc)); };
Отредактировано Andrey_Krropotkin (25-01-2018 12:03:55)
Отсутствует
Вот простой код например для сохранения
Да это работает. Правда, сохраняет только кнопки с панелей, но это меньшая из бед.
А Вы кнопки выбираете галочками или кнопку "выбрать все" нажимали?
И так и этак - файл пустой.
Отредактировано Ultima2m (25-01-2018 10:34:56)
Отсутствует
Ultima2m
Попробуй отредактированную кнопку Экспорт всех CB кнопок в HTML файл, криво, но работает
self._handleClick =()=> menuPopup.showPopup(this, -1, -1, "popup", "bottomleft", "topleft"); var array = [ [ "Экспорт всех CB кнопок в HTML файл", "setPathToHtmlFile()", "data:image/x-icon;base64,AAABAAEAEhIAAAEAIACABQAAFgAAACgAAAASAAAAJAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADg/o/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADg/o/w4P6P8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADg/o/zUq6P8OD+j/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADg/o/0RC//0cE+X/Dg/o/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQW5/8tMOT/Njfw/0BA+v9JSP//UU///1hT//9aVv3/RU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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//8BB/v/AQfz/wEH4/8BB8P/AQeAAwEHAAMBB4ADAQfAAwEHwAMBB4ADAQcAAwEHgAMBB8P/AQfj/wEH8/8BB/v/AQf//wEE="], [ "separator" ], [ "Открыть папку для экспорта CB кнопок", "openHtmlFileFolder()", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABZ0RVh0Q3JlYXRpb24gVGltZQAwOC8xMS8wNdiEE10AAAAldEVYdFNvZnR3YXJlAE1hY3JvbWVkaWEgRmlyZXdvcmtzIE1YIDIwMDSHdqzPAAACiUlEQVR4nKWTy0uUYRTGf+/np6PTODOmMpaGhJRaZmQgRAQtglaBf4BRtGgTFLUqKjBoF1QQlBLdKCgrscuiFEq6gGmQBWWSYLfpMqXMTM71+773PS0kQXBR9MBvdZ7z8HDgKBHhf2T9jUkdUbVKKTXfzH7eqVpdXbDDzWvRmrDngePyMZniXfsxLtLBFuAWhziqlOoQET0n4dlprk5/uysisTncO7Gqt3s/N5eeWCjD8T5ZcWa5nNvFmc6d7AEKRAQRgaHT9Gcyb0XyB+ain8jGC+ul5/15GXTuSN+3bmntapHj2+kFyv6E2K7DSrw0Yw9v8ys6gS9chfbgWvA5K2qXUb2knAfZflaXrWXTqg2MByNt12sG25JTiaRSqsI2wuLU5HdyU19p2TZOga+IfX27CUdqqG8KMeK9IKdchtLP8GpdaivXcN8S1g3cDwERWxvIJmP4K1qwfRmQl5wc6p450B14dLiHCecTzf5mtp7aC0BlqJx1M44iywjk4q/xVzSDxMEkkYNXkIOXKSsOoESwUChgoS+At/8GI5u7JOswDIhlDKR/DBKoXA4mCiYxS124nBLxqKCQoGjqwuV46QSTH0fIOYwCjm0MuOnPFAXrwB2eKWY8yKdoDJbgd35S5eYJmWkaQqWYfCGf3wyQc4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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//8BB/9/AQf/PwEH/x8BB/8PAQcABwEHAAMBBwAHAQcADwEHAA8BBwAHAQcAAwEHAAcBB/8PAQf/HwEH/z8BB/9/AQf//wEE="] ]; var menuPopup = self.appendChild(document.createElement("menupopup")); array.forEach((m,i)=> { if ( m[0] == "separator" ) { menuPopup.appendChild(document.createElement("menuseparator")); return }; var mItem = menuPopup.appendChild(document.createElement("menuitem")); mItem.setAttribute("label", m[0]); mItem.setAttribute("class", "menuitem-iconic"); mItem.setAttribute("image", m[2]); mItem.addEventListener("command", ()=> eval(m[1])); }); menuPopup.setAttribute("onclick", "event.stopPropagation()"); function openHtmlFileInTab() { var fp = window.makeFilePicker(); fp.init(window, "Выберите HTML-файл для импорта закладок", fp.modeOpen); fp.appendFilters(fp.filterHTML); Cu.import("resource://gre/modules/FileUtils.jsm"); fp.displayDirectory = FileUtils.File(getPathToHtmlFileFolder()); fp.open(re=> { if ( re == fp.returnOK ) gBrowser.selectedTab = gBrowser.addTab(fp.file.path); }) }; function aDate() { var t=new Date(); var y=1900+t.getYear(); var min=t.getMinutes(); if (min<10){min="0"+min}; var h=t.getHours(); var m=t.getMonth();switch(m){case 0: m="января";break;case 1: m="февраля";break;case 2: m="марта";break;case 3: m="апреля";break;case 4: m="мая";break;case 5: m="июня";break;case 6: m="июля";break;case 7: m="августа";break;case 8: m="сентября";break;case 9: m="октября";break;case 10: m="ноября";break;default: m="декабря";} var d=t.getDate(); var curdate=y+"г."+" "+d+" "+m+" "+h+":"+min; var myfilename=curdate; return myfilename; } function exportsButtonsToHtmlFile() { var visibleCBbuttons = [...document.querySelectorAll('[cb-mode]')]; var paletteCBbuttons = [...custombuttons.palette.querySelectorAll('[cb-mode]')]; var allCBbuttons = visibleCBbuttons.concat(paletteCBbuttons); var array = []; allCBbuttons.forEach(but=> { var uri = but.URI ? but.URI : getPaleteButtonsURI(but); var name = but.getAttribute("label") || "Без названия"; var image = but.getAttribute("image") || "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAACNFBMVEXDRgDweQDnbwC0NgDCRQC7PQDtpTu+QQD78q3PUwDCRAD//8vbYQDLTgDocAD0iQX1jQbGSgD7iAD4gwDVaw7vdwDyegD+igDweQDlawDyhAXveADmZwDzmBbtcwDwkhHveADmhBTkgxbweADkfRH+igD7hADXZQX0gADyjA/tfgvveQDiawDQVADRXgfnbwD1jAb9iQD9z0PVZAbxpinykRHtdgD5mRbERQDDRgDOYArCRAD9iQD3ewDxegD3dwDFRgDAQAD+hgD4fQDucgDtgQftfwTISQDCRQDvdgD5lxb1kRb2qh7wnynkagD766LDRQDDRwDDRQDspjbtpzbuqDbvqzv//8DUZAbCRQD//83pjhvveQbvggW+QQDfcxLlmUb//8veYADMTwDHSADVVwC8PgDwixb78q3oZgDUWADRVADCRQD9iQDERwDBQQDYVQC+PgC0NgDbYQDWWgDUWADSVQDFSAC+QAC7PAC0NgD+wRL+/kD+/zb+7i3+8Cv+/DX+wBL/+DD/rwz+qgz+rwz/tAz+sQzfbAT+3iP/+jD//Dz1jwP+nwf5iwf7pBz2tRr4lwb/ogfsdQT+2R7/9ET+2iT8yyLmgBL5iQL2egLokhP7zzT60zv1zUr0gAL1ewP50yn9+UL++EXooyngaAH41EPzowzyySj+xxzlhhHvvyruwjXxvTnUag3+zxrwigP+swz86U/ZXwD75lHqegD6xzb//kn+uhPTXAG3OAD/+UC2vFeJAAAAe3RSTlMAAAAAAAAAAAAAAAAAAAAAAAAAAACfnwAIaelpAAA2+wD7UQAAa3oArKzRzMysnwgAvPQA/gAAw3prw0oALr16vS4AACnF6bspAAAA/mIAADQAAAAAAI8AAEwA0vv7kd2yAuuvr+vKABL23U+8Sk/d9vUDIIAQAAAQgCAfvupHAAABB0lEQVR4Xi3IU3fDABgA0C+u26FdZ9u2bdu2vZSzbds2/tyac3IfLxjpGyA6MimqY6gHTNgiiNwkwRM1E7EhTrYyTfMzzsh0ZEPiH+D6+u5mV1jEhpe5haVCYW1T4suEvUOkk7PLpVJ5WFnl7hEUDN5LPvsHJ6cazdn13f3DYxu0B35+/Y2qVSr17NzGeUgohIVHLK/PMDa39qKieRATGxd/9cS4uU1MwnmQktqY/qGlaVr7/ZOVDTmQm5df8PwyNj4xOTVdjOM4kCRZOr+wWFa+srpWQVEU8PnV2zu7NbV19UfHDQRBAIfTdNHc0soVdnR2dfdgGAgEvW99/QNc4eDQ8O8Ihv0D77NPgbVLZ6kAAAAASUVORK5CYII="; array.push("<img src=" + image + "> <a href=" + uri + ">" + name +"</a><br>\n"); }); var before = "<html>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n</head>\n<body>\n"; var after = "\n</body>\n</html>"; var text = before + array.join("") + after; var text = convertFromUnicode("UTF-8", text); var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); file.initWithPath(getPathToHtmlFileFolder()); file.append("CB buttons " + aDate().replace(/:/g, ".") + ".html"); custombuttonsUtils.writeFile(file.path, text); var alertsService = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService) alertsService.showAlertNotification(self.image, self.label, "Экспортировал все CB кнопки как HTML в " + file.path); setTimeout(()=> alertsService.closeAlert(), 4000); }; function getPaleteButtonsURI(but) { var doc = document.implementation.createDocument("", "", null); doc.async = false; doc.load("chrome://custombuttons/content/nbftemplate.xml"); ["help,Help", "name,label", "image,image", "mode,cb-mode", "initcode,cb-init", "accelkey,cb-accelkey", "code,cb-oncommand"] .forEach(str=> { var arr = str.split(','); var value = but.getAttribute(arr[1]), name = arr[0]; custombutton.buttonSetText(doc, name, value, true); }); var ser = new XMLSerializer(); return "custombutton://" + escape(ser.serializeToString(doc)); }; function openHtmlFileFolder() { var folder = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); folder.initWithPath( getPathToHtmlFileFolder() ); folder.launch(); }; function setPathToHtmlFile() { var fp = window.makeFilePicker(); fp.init(window, "Укажите папку для экспорта CB кнопок!", fp.modeGetFolder); fp.open(re=> { if ( re != fp.returnOK ) return; cbu.setPrefs("custombuttons.CB.exportsButtonsToHtmlFile.path", convertFromUnicode("UTF-8", fp.file.path)); exportsButtonsToHtmlFile(); }) }; function getPathToHtmlFileFolder() { // try { return Services.prefs.getComplexValue("CB.exportsButtonsToHtmlFile.path", Ci.nsISupportsString).data } // catch(e) { return "C:" }; let pref = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefService). getBranch("custombuttons.CB."); let editor = null; if ( editor = pref.getCharPref("exportsButtonsToHtmlFile.path")) return editor; }; function convertFromUnicode(charset, str) { var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter); converter.charset = charset; str = converter.ConvertFromUnicode(str); return str + converter.Finish(); }; this.onmouseover =()=> { this.tooltipText = self.label + "\nЛ: Меню кнопки\nП: CB меню\n\nПапка для экспорта:\n" + getPathToHtmlFileFolder(); };
Отредактировано Andrey_Krropotkin (25-01-2018 12:06:10)
Отсутствует
и подправил чуть выше код, теперь сохраняет все кнопки.
Да, теперь совсем хорошо.
А можно сделать, чтобы сохранялось без подтверждения в папку загрузки?
Отсутствует
Ultima2m в кнопке Экспорт всех CB кнопок в HTML файл, которую я чуть выше подправил, есть в меню пункт - Экспорт всех CB кнопок в HTML файл без запроса. В этой кнопке сначала один раз сохранить с подтверждением, чтобы выбрать папку, а потом можно без подтверждения.
А вот мой код без подтверждения, только в самом начале нужно указать путь
/*CODE*/ // папка для сохранения var folderpath="C:\\Users\\.............\\Desktop\\"; var saveImg5 = "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU1FQr1FRT7BRUU+wUVFPsFFRT7BRUU+wUVFPsFFRT7BRUU+wUVFPsFFRT7BRUU+wU1FQrwAAAAAAAAAAAAAAAHd0cpz//////////////////////////////////////////////////////////3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xYAAAAAAAAAAAAAAAAAAAAAmJiWnJiYlpyYmJacmJiWnJeTk52SkZGemJiWnJeTk52SkZGej4+LpIaGhhMAAAAAAAAAAAAAAAAAAAAAgAMAAIADAACAAwAAgAMAAIADAACAAwAAgAMAAIADAACAAwAAgAMAAIADAACAAwAAgAMAAIADAACABwAAgA8AAA=="; var visibleCBbuttons = [...document.querySelectorAll('[cb-mode]')]; var paletteCBbuttons = [...custombuttons.palette.querySelectorAll('[cb-mode]')]; var allCBbuttons = visibleCBbuttons.concat(paletteCBbuttons); var array = []; allCBbuttons.forEach(but=> { var uri = but.URI ? but.URI : getPaleteButtonsURI(but); var name = but.getAttribute("label") || "Без названия"; var image = but.getAttribute("image") || "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAACNFBMVEXDRgDweQDnbwC0NgDCRQC7PQDtpTu+QQD78q3PUwDCRAD//8vbYQDLTgDocAD0iQX1jQbGSgD7iAD4gwDVaw7vdwDyegD+igDweQDlawDyhAXveADmZwDzmBbtcwDwkhHveADmhBTkgxbweADkfRH+igD7hADXZQX0gADyjA/tfgvveQDiawDQVADRXgfnbwD1jAb9iQD9z0PVZAbxpinykRHtdgD5mRbERQDDRgDOYArCRAD9iQD3ewDxegD3dwDFRgDAQAD+hgD4fQDucgDtgQftfwTISQDCRQDvdgD5lxb1kRb2qh7wnynkagD766LDRQDDRwDDRQDspjbtpzbuqDbvqzv//8DUZAbCRQD//83pjhvveQbvggW+QQDfcxLlmUb//8veYADMTwDHSADVVwC8PgDwixb78q3oZgDUWADRVADCRQD9iQDERwDBQQDYVQC+PgC0NgDbYQDWWgDUWADSVQDFSAC+QAC7PAC0NgD+wRL+/kD+/zb+7i3+8Cv+/DX+wBL/+DD/rwz+qgz+rwz/tAz+sQzfbAT+3iP/+jD//Dz1jwP+nwf5iwf7pBz2tRr4lwb/ogfsdQT+2R7/9ET+2iT8yyLmgBL5iQL2egLokhP7zzT60zv1zUr0gAL1ewP50yn9+UL++EXooyngaAH41EPzowzyySj+xxzlhhHvvyruwjXxvTnUag3+zxrwigP+swz86U/ZXwD75lHqegD6xzb//kn+uhPTXAG3OAD/+UC2vFeJAAAAe3RSTlMAAAAAAAAAAAAAAAAAAAAAAAAAAACfnwAIaelpAAA2+wD7UQAAa3oArKzRzMysnwgAvPQA/gAAw3prw0oALr16vS4AACnF6bspAAAA/mIAADQAAAAAAI8AAEwA0vv7kd2yAuuvr+vKABL23U+8Sk/d9vUDIIAQAAAQgCAfvupHAAABB0lEQVR4Xi3IU3fDABgA0C+u26FdZ9u2bdu2vZSzbds2/tyac3IfLxjpGyA6MimqY6gHTNgiiNwkwRM1E7EhTrYyTfMzzsh0ZEPiH+D6+u5mV1jEhpe5haVCYW1T4suEvUOkk7PLpVJ5WFnl7hEUDN5LPvsHJ6cazdn13f3DYxu0B35+/Y2qVSr17NzGeUgohIVHLK/PMDa39qKieRATGxd/9cS4uU1MwnmQktqY/qGlaVr7/ZOVDTmQm5df8PwyNj4xOTVdjOM4kCRZOr+wWFa+srpWQVEU8PnV2zu7NbV19UfHDQRBAIfTdNHc0soVdnR2dfdgGAgEvW99/QNc4eDQ8O8Ihv0D77NPgbVLZ6kAAAAASUVORK5CYII="; array.push("<img src=" + image + "> <a href=" + uri + ">" + name +"</a><br>\n"); }); var before = "<html>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n</head>\n<body>\n"; var after = "\n</body>\n</html>"; var text = before + array.join("") + after; var text = convertFromUnicode("UTF-8", text); var file = Components.classes["@mozilla.org/file/local;1"]. createInstance(Components.interfaces.nsIFile); file.initWithPath(folderpath); file.append("CB buttons " + aDate().replace(/:/g, ".") + ".html"); custombuttonsUtils.writeFile(file.path, text); var alertsService = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService) alertsService.showAlertNotification(saveImg5, "Экспорт в HTML", "Экспортировал все CB кнопки как HTML"); setTimeout(()=> alertsService.closeAlert(), 4000); function aDate() { var t=new Date(); var y=1900+t.getYear(); var min=t.getMinutes(); if (min<10){min="0"+min}; var h=t.getHours(); var m=t.getMonth();switch(m){case 0: m="января";break;case 1: m="февраля";break;case 2: m="марта";break;case 3: m="апреля";break;case 4: m="мая";break;case 5: m="июня";break;case 6: m="июля";break;case 7: m="августа";break;case 8: m="сентября";break;case 9: m="октября";break;case 10: m="ноября";break;default: m="декабря";} var d=t.getDate(); var curdate=y+"г."+" "+d+" "+m+" "+h+":"+min; var myfilename=curdate; return myfilename; } function convertFromUnicode(charset, str) { var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter); converter.charset = charset; str = converter.ConvertFromUnicode(str); return str + converter.Finish(); }; function getPaleteButtonsURI(but) { var doc = document.implementation.createDocument("", "", null); doc.async = false; doc.load("chrome://custombuttons/content/nbftemplate.xml"); ["help,Help", "name,label", "image,image", "mode,cb-mode", "initcode,cb-init", "accelkey,cb-accelkey", "code,cb-oncommand"] .forEach(str=> { var arr = str.split(','); var value = but.getAttribute(arr[1]), name = arr[0]; custombutton.buttonSetText(doc, name, value, true); }); var ser = new XMLSerializer(); return "custombutton://" + escape(ser.serializeToString(doc)); };
Отредактировано Andrey_Krropotkin (25-01-2018 13:24:24)
Отсутствует