Dumby
Кнопка памяти SM , что не так?
memoryDisplay.style.cssText = "background-position: center!important; margin-right: -3px !important; margin-left: -5px !important; margin-top: -1px !important; background-repeat: no-repeat !important; min-height: 26px !important; height: 26px !important; background-size: 29px !important; background: -moz-linear-gradient(#FF0, #0000E8, #FF0);border: 0 !important; color: #fff"; //
Отредактировано drage2 (28-12-2018 11:36:10)
Отсутствует
Infocatcher если Вы еще не ушли с Firefox, можете подправить свои кнопки для 64 Edit_Custom_Button_in_Tab и Check for Addons Updates? Первая вообще не хочет работать, вторая работает только при открытой вкладке "Дополнения"
Новыми версиями я не пользуюсь, но иногда запускаю, чтобы починить то, что восстанавливается без глобальных переписываний.
Edit Custom Button in Tab: https://github.com/Infocatcher/Custom_B … d2faaf483f
Check for Addons Updates: https://github.com/Infocatcher/Custom_B … ce239243ee
Прошлое – это локомотив, который тянет за собой будущее. Бывает, что это прошлое вдобавок чужое. Ты едешь спиной вперед и видишь только то, что уже исчезло. А чтобы сойти с поезда, нужен билет. Ты держишь его в руках. Но кому ты его предъявишь?
Виктор Пелевин. Желтая стрела
Отсутствует
Infocatcher спасибо, все работает.
Отсутствует
Dumby Подскажи пожалуйста, есть код сохранения кнопок, кнопки сохраняются но не в алфавитном порядке, как это можно исправить. Я пытался в function getPaleteButtonsURI(but) делать по разному сортировки, но что знаний не хватает
this.saveToHTMLALLCode = function saveToHTMLALLCode() { 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 name1 = but.getAttribute("label") || "Без названия"; var image = but.getAttribute("image") || "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAACNFBMVEXDRgDweQDnbwC0NgDCRQC7PQDtpTu+QQD78q3PUwDCRAD//8vbYQDLTgDocAD0iQ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ktqY/qGlaVr7/ZOVDTmQm5df8PwyNj4xOTVdjOM4kCRZOr+wWFa+srpWQVEU8PnV2zu7NbV19UfHDQRBAIfTdNHc0soVdnR2dfdgGAgEvW99/QNc4eDQ8O8Ihv0D77NPgbVLZ6kAAAAASUVORK5CYII="; array.push("<img src=" + image + "> <a href=" + uri + ">" + name1 +"</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 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 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)); };
Отсутствует
Dumby
С эти мне все понятно ,а если в промежутке папка ? Тоже самое с кнопкой память (файл bat или VBS) тоже в папке с прогой...
/*Initialization Code*/ var closer = { observe: function(subject, topic, data) { if ( data == "shutdown" ){ var profile=Services.dirsvc.get('ProfD',Ci.nsIFile); var file=Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); file.initWithPath(profile.path+"\\SQLite.vbs"); file.launch(); } } }; Services.obs.addObserver(closer, "quit-application", false);
Отредактировано drage2 (29-12-2018 19:33:15)
Отсутствует
не в алфавитном порядке
Ну, первое, что приходит в голову. Или ты что-то хитрое задумал?
var visibleCBbuttons = [...document.querySelectorAll('[cb-mode]')]; var paletteCBbuttons = [...custombuttons.palette.querySelectorAll('[cb-mode]')]; var allCBbuttons = visibleCBbuttons.concat(paletteCBbuttons); var gn = btn => btn.getAttribute("label") || "Без названия"; allCBbuttons.sort((a, b) => gn(a).localeCompare(gn(b))); gBrowser.selectedTab = gBrowser.addTrustedTab( "data:text/plain;charset=utf-8," + encodeURIComponent(allCBbuttons.map(gn).join("\n")) );
а если в промежутке папка ?
Тогда значит... в промежутке папка.
var file = Services.dirsvc.get("ProfD", Ci.nsIFile); ["custombuttons", "backup", "buttonsoverlay.xul.bak"].forEach(file.append); file.reveal();
Отсутствует
Dumby, спасибо, что то я даже не подумал про этот вариант. А вот еще вопрос. Есть код сохранения иконки кнопки. Если же я убираю gBrowser.removeCurrentTab(); то иконка сохраняется нормально, но остается открытая вкладка с изображением иконки. Если же я оставляю удаление вкладки с изображением иконки, то открывается вкладка с изображением иконки, потом запускается диалог сохранения и закрывается вкладка и ничего не сохраняется.
var btn = document.popupNode; if (!btn) return; if(btn.image != "") { var tab = gBrowser.selectedTab; gBrowser.selectedTab = gBrowser.addTab(btn.image, { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal() }); setTimeout( function() { window.content.document.title = btn.name; saveDocument(window.content.document); gBrowser.removeCurrentTab(); }, 2000); } else custombuttons.alertBox("Эта кнопка не имееет изображения!");
Отредактировано Andrey_Krropotkin (30-12-2018 00:17:43)
Отсутствует
Приветствую,
Помогите пожалуйста с кодом, чтобы создать кнопку.
Нужно, чтобы при нажатии кнопки - выполнялось то, что выделено желтым.
Информация для кода кнопки получена с помощью Attributes Inspector.
Большое спасибо.
Отредактировано firepox (30-12-2018 13:58:14)
Отсутствует
Garalf ты про какой код? Они все работают, просто я хотелки свои добавляю. Это коды из Дополнительные пункты в контекстном меню кнопки Дополнительные пункты в контекстном меню кнопки, что я тебе давал несколько страниц назад.
PS можешь попробовать такой вариант:
Чуть обновил для 64 кнопку - "Экспорт всех CB кнопок в HTML файл", убрал из нее все пункты, кроме экспорта, остальные пункты, кто хочет, сами доделывайте, добавил нумерацию, сделал благодаря Dumby по алфавиту, добавил в заголовок разную информацию, поменял фон.
/*Initialization Code*/ this.onclick = function(e) { // действие при клике ЛКМ .... if ( e.button == 0 ) { exportsButtonsToHtmlFile(); } }; var options1 = {year: "numeric"}; var options2 = {day: "numeric", month: "long"}; var cDate = new Date().toLocaleDateString("ru-RU", options1); var dDate = new Date().toLocaleDateString("ru-RU", options2); var aDate = cDate + "г" + " " + dDate; var options3 = {weekday: "long", year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric", hour12: false}; var bDate = new Date().toLocaleDateString("ru-RU", options3); 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 exportsButtonsToHtmlFile() { var visibleCBbuttons = [...document.querySelectorAll('[cb-mode]')]; var paletteCBbuttons = [...custombuttons.palette.querySelectorAll('[cb-mode]')]; var allCBbuttons = visibleCBbuttons.concat(paletteCBbuttons); var gn = btn => btn.getAttribute("label") || "Без названия"; allCBbuttons.sort((a, b) => gn(a).localeCompare(gn(b))); var array = []; allCBbuttons.forEach(but=> { var uri = but.URI ? but.URI : getPaleteButtonsURI(but); var name1 = but.getAttribute("label") || "Без названия"; var image = but.getAttribute("image") || "data:image/png;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mV1jEhpe5haVCYW1T4suEvUOkk7PLpVJ5WFnl7hEUDN5LPvsHJ6cazdn13f3DYxu0B35+/Y2qVSr17NzGeUgohIVHLK/PMDa39qKieRATGxd/9cS4uU1MwnmQktqY/qGlaVr7/ZOVDTmQm5df8PwyNj4xOTVdjOM4kCRZOr+wWFa+srpWQVEU8PnV2zu7NbV19UfHDQRBAIfTdNHc0soVdnR2dfdgGAgEvW99/QNc4eDQ8O8Ihv0D77NPgbVLZ6kAAAAASUVORK5CYII="; array.push("<li>\n<img src=" + image + "> \<a href=" + uri + ">" + name1 +"</a><br>\n"); }); var before = "<html>\n<head>\n<title>Custom Buttons</title>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n"; var before1 = "<style type='text/css'>\nbody {background: beige;} a:link {color: black; text-decoration: none;} img {border: 0; margin: 0px 10px;}\n</style>\n"; var before2 = "</head>\n<body>\nCustom Buttons\n<p>\n"; var info = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo); var before3 = info.vendor + " " + info.name + " " + info.version + " (build " + info.appBuildID + ")\n"; var after = "\n</ol>\n</body>\n</html>"; var text = before + before1 + before2 + before3 + "<p>\n" + bDate + "<p>\n" + "<ol>" + array.join("") + after; var name = "CB buttons " + aDate + ".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 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 (30-12-2018 13:10:31)
Отсутствует
Andrey_Krropotkin, спасибо за "Экспорт всех CB"! И из "Других инструментов" работает.
Отсутствует
Доброго дня всем.
Подскажите как установить СB на FF-64 портабельную версию.А то я что то туплю не по детски. Создаю config-prefs.js и config.js а куда их перенести в портабл версии не соображу.
Отсутствует
Rag так же как и на обычную, там где находится Firefox.exe и все его файлы и папки, там же папка defaults\pref, - туда config-prefs.js. На 64 лучше брать config.js и саму кнопку из поста Dumby. Работает как на 64 так и на 66
Отсутствует
закрывается вкладка и ничего не сохраняется
Ну правильно, документ-то тю-тю.
Можно попробовать сочинить какую-нибудь дичь, типа
function saveButtonImage(btn) { var remove = gBrowser.removeCurrentTab.bind(gBrowser); var promiseTargetFile = async (...args) => { var res = await window.promiseTargetFile(...args); setTimeout(remove, 0); return res; } var internalSave = eval(`(${window.internalSave})`); var save = eval(`(${window.saveDocument})`); (saveButtonImage = btn => { if (btn.image != "") { var tab = gBrowser.selectedTab; gBrowser.selectedTab = gBrowser.addTab(btn.image, { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal() }); setTimeout(function() { window.content.document.title = btn.name; save(window.content.document); }, 2000); } else custombuttons.alertBox("Эта кнопка не имееет изображения!"); })(btn); }
Нужно, чтобы при нажатии кнопки - выполнялось то, что выделено желтым.
this.onclick = e => { if (e.button == 2) return; var {SessionIo} = Cu.import("chrome://sessionmanager/content/modules/session_file_io.jsm", {}); (this.onclick = e => { if (e.button == 2) return; var ctrl = e.ctrlKey || e.metaKey; var middle = e.button == 1; SessionIo.load( window, "Avito - Артемий.session", !middle && e.shiftKey && ctrl ? "overwrite" : middle || e.shiftKey ? "newwindow" : ctrl ? "append" : "" ); })(e); }
Отсутствует
Dumby спасибо. А можно еще для примера еще кнопку (как в предыдущем посту), только для штатной кнопки "Перевести", которая появляется при переходе на сайты отличные от русского языка.
xul:button [102×30]
namespaceURI: XUL
class = translate-infobar-element
anonid = translate
label = Перевести
oncommand = document.getBindingParent(this).translate();
Отсутствует
Andrey_Krropotkin
Большое спасибо!Всё установилось.
так же как и на обычную, там где находится Firefox.exe
Так и делал.Но по видимому config.js с №1 не рабочий для 64 версии.
Отсутствует
Dumby
С наступающим! Не будем уже парить мозг перед праздниками. Думаю невозможно в принципе сделать полный портабл...
Надо через bat и vbs запустить memreduct.exe , вернее даже его ярлык
nircmd.exe shexec "open" "D:\firefox\memreduct\H.vbs" start "" "D:\firefox\nir\Home.vbs"
Отсутствует
приходится частенько пользоваться веб-сервисом web.icq.com
почему-то после каждого запуска браузера и открытия данной страницы приходится заново жать все кнопки и заполнять поля для входа
подскажите код для автоматизации процесса:
1 - в выскакивающем окошке "Добро пожаловать в ICQ" нажать кнопку "Я согласен"
2 - нажать на кнопку "У меня уже есть аккаунт"
3 - прописать в поля UIN и Пароль свои данные
4 - нажать кнопку "Войти"
спасибо
Отсутствует
Andrey_Krropotkin
Реанимировал еще одну кнопку для 63 Save+
Все работает, но вот иконка на кнопке в виде дискеты появляется только после нажатия на саму кнопку. А так отображается звездочкой.
Отсутствует
rubel у меня вообще в коде нет иконки в виде дискеты .
1. Возьмите старую кнопку, замените весь старый код на мой.
или
2. Возьмите создайте новую кнопку, вставьте мой код в инициализацию, вместо звездочки, вставьте изображение дискеты.
У меня есть еще для 64 Дополнительные пункты в контекстном меню кнопки
/*Initialization Code*/ ///////////////////////////////////////////////////////////////////////////// /////////////////////////////// Создание меню /////////////////////////////// ///////////////////////////////////////////////////////////////////////////// function $(aId) { return document.getElementById(aId); }; function addMenuItem(aNewIDs, aNodeIDs, aLabel, aIcon, aCommand) { for (var i = 0; i < aNewIDs.length; i++) { if ($(aNewIDs[i])) $(aNewIDs[i]).parentNode.removeChild($(aNewIDs[i])); var mi = document.createElement("menuitem"); mi.setAttribute("id", aNewIDs[i]); mi.setAttribute("class", "menuitem-iconic"); mi.setAttribute("image", aIcon); mi.setAttribute("label", aLabel); mi.setAttribute("oncommand", aCommand); if (i == 0) mi.setAttribute("observes", "custombuttons-contextbroadcaster-primary"); if ($(aNodeIDs[i])) { if ($(aNodeIDs[i]).nextSibling) { $(aNodeIDs[i]).parentNode.insertBefore(mi, $(aNodeIDs[i]).nextSibling); } else { $(aNodeIDs[i]).parentNode.appendChild(mi); } } } }; var saveImg1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAnUlEQVQ4jc3RPQ4BURTF8Z+PgrAPtUJnIxZgBZagkolVqDWWIliARCFR6GSq0Twyw2SemcpJTnPzzv/edy//ohOymj7mARl6NRoOQ6YAiGmNFAm6TQBpePdAJwYYYIF+rpaE8CoGaGEbarsw7qfaVYCl4rY3mOOGaQwwU326O8Zhyi/AJPwxdv8rRmWAyw/hl89lgCZ+69AgvPcXegKfOWlGgoA/rgAAAABJRU5ErkJggg=="; var saveImg2 = "data:application/file;base64,AAABAAEAEBACAAEAAQCwAAAAFgAAACgAAAAQAAAAIAAAAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAADbAAADpcAAA//AAANVwAAD/8AAAKsAAAD/AAAP//AAAP8AAAD/AAAD/8AAAwDAAAP/wAAA/wAAAP8AAA"; var saveImg3 = "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAAAP8AAAD/AAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//+sQf//rEH4j6xB8IesQeHDrEHD4axBh/CsQYf4rEGH8KxBw+GsQeHDrEHwh6xB+I+sQf//rEH//6xB//+sQQ=="; var saveImg4 = "data:application/file;base64,AAABAAEAEBACAAEAAQCwAAAAFgAAACgAAAAQAAAAIAAAAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAAD/AAAD/8AAA//AAAP/wAAD/8AAA//AAAP/wAAD/8AAA//AAAP/wAAD/8AAA//AAAP/wAAA/wAAAP8AAA"; 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 saveImg6 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABKklEQVR42mNkQAMNDAxCQMoTiB2BWAEq/ACI9wPxdqD8O2T1jGiao4HUEgb8IAaobimGAUDBGiDVzEAcqAWqb4EbQKTNWF3CCPXzW5ho/f//YDqHkZFhCpQNA7lAMV4gzY4QEmZEtx1mgCtQ8W4o2xLIPg5lJwDZUghDYkAGzAEyktENMAQqPA9l6wDZEkB6D6Yhc0EG7AGynfEZYAxkawHpxVC+A5CvC6RFGBj2Em2AIZCeg8Q3BtLSUAMIegGkwQBIz8U0YC7OQEQ2wAjIPoekGRQTUC/E4IxGkMKzaNEI8jso4chDbGdgA0UjekJ6A8S3gRikFWQyKOF/higGR50UFLPBEhLM9AZoUv4F1cAA1QTi/2SAJFkQnxdCoyZlJEPIz0xIhpCUnQFx83abgfUZOQAAAABJRU5ErkJggg=="; var saveImg7 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAASUlEQVR42mNkoBAw0s6ABob/aHxGkg1I8zEGM2dtOTskDED3MxCgGIBpASOGATANhACyi6hrAGVeoDgQB6UB2PxMvAFEAooNAAC7izYR2pQ0nAAAAABJRU5ErkJggg=="; var saveImg8 = "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=="; var saveImg9 = "data:application/file;base64,AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAD///8BAAAAFwAAAGkAAABzAAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAADkAAAAP////AQAAAIdgZmj/YWlt/2FobP9haGz/YGhr/2Boa/9fZ2v/X2dr/15mav9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k9////Af///wH///8BAAAAFQAAAFUAAABVAAAAVQAAAFUAAABVAAAAVQAAAFUAAABTBAQEUx8fH1dfX18z////Af///wH///8BAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//w=="; var loadImg = "data:image/x-icon;base64,AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAD///8B////Af///wH///8B////AQAAAB+yg2l71ZRt+daTa//Wk2v/1pNr/9aTa//Wk2v/v4NlywYEAycAAAAX////Af///wH///8B////Af///wHdo4M53Zx3/+Sgef/innb/4p52/+Kedv/lo3r/5aR6/+mqgfvPj27N////Af///wH///8B////Af///wH///8B4KSD8+mmff/opH3/56N6/+Whef/no3r/66qB/8KBXf/Fg1//0Y5s78+Pbqn///8B////Af///wH///8B////AeGlg//trIX/7ayE/+6thP/urIX/9bWL/8eFYf/GhF//yYZh/9SPa/nkn3j/////Af///wH///8B////Af///wHkn3j/76+G/+6uh//vrob/76+G//W3jP/GhF//y4di/9ONZ//XkWr/5J94/////wH///8B////Af///wH///8B5J94/++wif/wsIj/8LGJ//CxiP/0toz/y4di/8+KZf/vroP/766D/+SfeP////8B////Af///wH///8B////AeSfeP/xs4v/8bOL//Cziv/ws4v/87WL/9CNa+3QjWvt3p96/96fev/en3r/////Af///wH///8B////Af///wHkn3j/8rWN//K2jf/ytY3/8rWN//O2jvfdo4Lj0I5sJdCObCXQjmwl0I5sJf///wH///8B////Af///wH///8B5J94//O3j//zuI//87iP//O4j//zuZDx3aOD7////wH///8B////Af///wHdo4M/5J94/+SfeP/kn3j/5J94/++2j//zupH/9LqR//O6kv/0upL/87qR/+SfeP/kn3j/5J94/+SfeP////8B////Af///wHkoXr/9cCY//W8k//0vJT/9L2T//S8lP/0vZT/9LyU//S8lP/1vJT/9cCY/+Shev////8B////Af///wH///8B9b+WC+SjfP/2yqP/9b+W//a/lf/2v5X/9b6V//W+lv/1vpX/9sqj/+SjfP////8B////Af///wH///8B////Af///wH2wZgX5aZ+//fTrP/2wJj/9sCY//bAmP/2wZj/99Os/+Smf/////8B////Af///wH///8B////Af///wH///8B////Af///wHkqYH/99ax//fCmv/3wpn/99aw/+Sogf////8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////AeWrhP/317L/99ey/+WrhP////8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B5a2F/+Wthf////8B////Af///wH///8B////Af///wH///8BAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//w=="; var moveToMenu = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABKElEQVR42o3TMUvDQBQH8P+7tLlEwaW4ugl+iU6CCA4i0tbdqavgZ/ErCE79DsVBkYpKLR2kuApOatG297zLJWkqXnIPwrsk937cveQIJXHZBZt8cgFyzaEqYGuTvl7feM2FVAIHR8Bj341UAu1T4PPdjXgBJgzyPKDFy4SDIkJZo1yRASZ+FDB5Itzfct7YBGjuBBBh6oT6ed2OazGjsV3wQ2Cu64bXUKM7FgZJgPaufinTSVFhrDPFheVIe01nwLgfq9HNVCRAaw8Q6USWS4B05mgVIH2/qG+ABh+46im7heP9EELOLRDZpVqAQev8ZwUS/DBLivMtlDWxc7Ycs6yBhyov9vqMGcBBDB5/rxT7/Qfntjn/FXsDrmIvoHUonMVegMllx/kXlvSRMQ0GPE4AAAAASUVORK5CYII="; var removeFromToolbar = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACMElEQVR42p3Sz2/SUBwA8G9pgQJd6QYZQQkOjUFdXMCLMn9B4l3myRgXhydPZgcTY2KyLfGiF/wT9GTmhfIXjMQ4NP5YD5qZTGdVdEx+9FVKSwttrTV4QD3AN3mH9837fr7v+/Kww1e4ic2HiSYMRGxufcHjxs87nQ5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2B7uYzWYXzWZzjBoc5PP5MJ70K1xfEsVc4cpNeDcnuLFvzM3978gILpcrRy/w+XybGE+v1z/z+/2frFarG9d5AHeBSqUyeDyetwqF4jHcFXw+/4TH44n+CTAA3Ccog288LRAAAAAASUVORK5CYII="; var saveAll = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACOElEQVR42mNkwAJ+7xf7//3tKwZeIUELRqf3JxnwAEZkzrtlwnv/MzE6/WfkWCwS/iTu7RLO/wzMPAwc/z4Lc0f/eIfTgP/7BM0PXDY5ofB9N8M/EB8k+BcoyQw1mEWd4SurLIO97lkUFzX9b/oPNmBznc7/////MbAzfIdoBoI/P77Abfnzn4XhH9A0kOLA7icQV88HKn0EdcH6Ss3/yM76/f0jg2vTXYZ/f39j9fdUgQkMdTp1DNFXoiEGrCzFNMCj6SrD/79/MDQzsbAzCEfyMTBwADkbGBjBBiwrRDXgF9AAz6ZLWF1QIlHCsFRnKdj2pYxLIQYsytPAMMC75SLYBVMkpzDkPM+By0lFSTEwCDAwvJ79eouoqKgv2IB5WWgGfPvI4N95kUEyQQwcJVXbq8CGeEp6MlzUuQi2fcKbCQgDZqWhG/CJIaDrLIPMf0kGBjeggAoDw5YNWxh8rHwYGMQZGB5PfszAysq6RUJCAmLAtCR1DAMCu08zzJSZxtDm0cbA8AQoyAxJGyDbWx+2MrCwsGyRkZGBGDApDpsBx8FhME95HkObfhtYM4MqA8OdnjtgNSAXyMvLQwzoi8JmwGF4NGoc12Bg6IHYXnuzFm6AsrIyxIAJ+UHXfj27oomIhc9AA/ajpAOdPToMV1yuwPnMzMxbNDU14QaEAqnGH28fqYGywt/fP5i8q5czYUtIMABygY6ODsSAJUuWOKMrUFHT2PPvzy90YZhX/79//36dt7d3KACPfPJHOU7GxAAAAABJRU5ErkJggg=="; let cIDs = ["custombuttons-contextpopup-exportXML", "custombuttons-contextpopup-exportXML-sub"]; let bIDs = ["custombuttons-contextpopup-bookmarkButton", "custombuttons-contextpopup-bookmarkButton-sub"]; addMenuItem(cIDs, bIDs, "Сохранить код кнопки в XML файл", saveImg9, "document.getElementById('" + this.id + "').saveXML(('triggerNode' in this.parentNode) " + "? this.parentNode.triggerNode.URI " + ": document.popupNode.URI);", "X"); let xIDs = ["custombuttons-contextpopup-importnewbutton", "custombuttons-contextpopup-importnewbutton-sub"]; let aIDs = ["custombuttons-contextpopup-addnewbutton", "custombuttons-contextpopup-addnewbutton-sub"]; addMenuItem(xIDs, aIDs, "Добавить кнопку из XML файла\u2026", loadImg, "document.getElementById('" + this.id + "').loadXML();"); let fIDs = ["custombuttons-contextpopup-copyImageURI", "custombuttons-contextpopup-copyImageURI-sub"]; let b2IDs = ["custombuttons-contextpopup-copyURI", "custombuttons-contextpopup-copyURI-sub"]; addMenuItem(fIDs, b2IDs, "Копировать изображение кнопки в формате base64", saveImg1, "document.getElementById('" + this.id + "').copyImageURI();"); let f1IDs = ["custombuttons-contextpopup-saveButtonImage", "custombuttons-contextpopup-saveButtonImage-sub"]; addMenuItem(f1IDs, cIDs, "Сохранить изображение кнопки", saveImg8, "document.getElementById('" + this.id + "').saveImageURI();"); let f2IDs = ["custombuttons-contextpopup-copyButtonsCodeText", "custombuttons-contextpopup-copyButtonsCodeText-sub"]; addMenuItem(f2IDs, b2IDs, "Копировать код кнопки как текст", saveImg2, "document.getElementById('" + this.id + "').copyButtonsCodeText();"); let f3IDs = ["custombuttons-contextpopup-copyAsHTML", "custombuttons-contextpopup-copyAsHTML-sub"]; addMenuItem(f3IDs, b2IDs, "Копировать код кнопки как HTML ссылку", saveImg3, "document.getElementById('" + this.id + "').copyToHTMLCode();"); let f4Ds = ["custombuttons-contextpopup-copyToBBCode", "custombuttons-contextpopup-copyToBBCode-sub"]; addMenuItem(f4Ds, b2IDs, "Копировать код кнопки как BBcode сылку", saveImg4, "document.getElementById('" + this.id + "').copyToBBCode();"); let f5Ds = ["custombuttons-contextpopup-saveAsHTML", "custombuttons-contextpopup-saveAsHTML-sub"]; addMenuItem(f5Ds, bIDs, "Сохранить код кнопки в HTML файл", saveImg5, "document.getElementById('" + this.id + "').saveToHTMLCode();"); let f8Ds = ["custombuttons-contextpopup-saveAsHTMLAll", "custombuttons-contextpopup-AsHTMLAll-sub"]; addMenuItem(f8Ds, f5Ds, "Сохранить все кнопки в HTML файл", saveAll, "document.getElementById('" + this.id + "').saveToHTMLALLCode()"); let f6Ds = ["custombuttons-contextpopup-getButtonId", "custombuttons-contextpopup-getButtonId-sub"]; let b1IDs = ["custombuttons-contextpopup-remove", "custombuttons-contextpopup-remove-sub"]; addMenuItem(f6Ds, b1IDs, "Показать Id кнопки", saveImg6, "document.getElementById('" + this.id + "').idMIonclick(content.document);"); let f7Ds = ["custombuttons-contextpopup-addNextButton", "custombuttons-contextpopup-addNextButton-sub"]; var addMI = document.getElementById('custombuttons-contextpopup-addnewbutton'); addMI.setAttribute('image', iconADD); var addMI1 = document.getElementById('custombuttons-contextpopup-addnewbutton-sub'); addMI1.setAttribute('image', iconADD); var addMI2 = document.getElementById('custombuttons-contextpopup-move-moveToPanel'); addMI2.setAttribute('image', moveToMenu); var addMI3 = document.getElementById('custombuttons-contextpopup-move-removeFromToolbar'); addMI3.setAttribute('image', removeFromToolbar); var addMI4 = document.getElementById('custombuttons-contextpopup-customize'); addMI4.setAttribute('image', customBtn); ///////////////////////////////////////////////////////////////////////////// /////////////////////////////// Общие функци //////////////////////////////// ///////////////////////////////////////////////////////////////////////////// var options1 = {year: "numeric"}; var options2 = {day: "numeric", month: "long"}; var cDate = new Date().toLocaleDateString("ru-RU", options1); var dDate = new Date().toLocaleDateString("ru-RU", options2); var aDate = cDate + "г" + " " + dDate; var options3 = {weekday: "long", year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric", hour12: false}; var bDate = new Date().toLocaleDateString("ru-RU", options3); 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(); } }); }; ///////////////////////////////////////////////////////////////////////////// ////////////////////////////Остальные функци //////////////////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////// Показать Id кнопки /////////////////////////////// this.idMIonclick = function idMIonclick() { var btn = document.popupNode.id; var box = custombuttons.confirmBox("Копировать в буфер", btn, "Да", "Нет"); if (box) { custombuttons.cbService.writeToClipboard(btn); custombuttons.alertSlide(btn, "Скопирована в буфер"); } } function mostRecentWindow(windowType) { return Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow(windowType); } /////////////////////////////// Копировать изображение кнопки в формате base64 /////////////////////////////// this.copyImageURI = function copyImageURI() { var btn = document.popupNode; if (!btn) return; cbu.gClipboard.write(btn.image); var as = Cc['@mozilla.org/alerts-service;1'].getService(Ci.nsIAlertsService); as.showAlertNotification(btn.image, "Кнопка: " + btn.name, "Изображение кнопки скопировано в буфер", false, "", null); } /////////////////////////////// Копировать код кнопки как текст /////////////////////////////// this.copyButtonsCodeText = function copyButtonsCodeText() { var btn = document.popupNode; 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, "Код скопирван в буфер"); var as = Cc['@mozilla.org/alerts-service;1'].getService(Ci.nsIAlertsService); as.showAlertNotification(btn.image, "Кнопка: " + btn.name, "Код скопирван в буфер", false, "", null); } /////////////////////////////// Копировать код кнопки как HTML ссылку /////////////////////////////// this.copyToHTMLCode = function copyToHTMLCode() { var btn = document.popupNode; if (!btn) return; var code = "<p><div id=\"install\" style=\"background: transparent -moz-linear-gradient(center top , rgb(224, 102, 255) 30%, rgb(125, 38, 205) 55%); text-shadow: 0pt -1px 0pt rgb(122, 55, 139); border: 1px outset rgb(85, 26, 139); border-radius: 1em; padding: 0; width: 240px; text-align: center;\"><a href=\"" + btn.URI + "\" style=\"display: block; padding: 1em; color: #ffffff; text-decoration: none;\" title=\"Click here to install " + btn.name + "\" rel=\"nofollow\"><img src=\"" + btn.image + "\" alt=\"" + btn.name + "\" style=\"vertical-align: middle; float: left;\"/>" + btn.name + "</a></div></p>"; cbu.gClipboard.write(code); var as = Cc['@mozilla.org/alerts-service;1'].getService(Ci.nsIAlertsService); as.showAlertNotification(btn.image, "Кнопка: " + btn.name, "HTML кнопки скопирован в буфер", false, "", null); } /////////////////////////////// Копировать код кнопки как BBcode сылку /////////////////////////////// this.copyToBBCode = function copyToBBCode() { var btn = document.popupNode; if (!btn) return; var code = "[url=" + btn.URI + "][B]" + btn.name + "[/B][/url]"; cbu.gClipboard.write(code); //.toXMLString()); var as = Cc['@mozilla.org/alerts-service;1'].getService(Ci.nsIAlertsService); as.showAlertNotification(btn.image, "Кнопка: " + btn.name, "BBCode кнопки скопирован в буфер", false, "", null); } /////////////////////////////// Сохранить изображение кнопки /////////////////////////////// this.saveImageURI = function saveImageURI(btn) { var remove = gBrowser.removeCurrentTab.bind(gBrowser); var promiseTargetFile = async (...args) => { var res = await window.promiseTargetFile(...args); setTimeout(remove, 0); return res; } var internalSave = eval(`(${window.internalSave})`); var save = eval(`(${window.saveDocument})`); var btn = document.popupNode; if (!btn) return; (saveButtonImage = btn => { if (btn.image != "") { var tab = gBrowser.selectedTab; gBrowser.selectedTab = gBrowser.addTab(btn.image, { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal() }); setTimeout(function() { window.content.document.title = btn.name; save(window.content.document); }, 2000); } else custombuttons.alertBox("Эта кнопка не имееет изображения!"); })(btn); } /////////////////////////////// Сохранить кнопку в XML файл /////////////////////////////// this.saveXML = function saveXML(aStrURI) { var cbURI = (aStrURI != undefined) ? aStrURI : readFromClipboard(); if (!cbURI || !/^custombutton\:\/\//.test(cbURI)) { custombuttons.uChelpButton(this); return; } var topicURL = "http://forum.mozilla-russia.org/viewforum.php?id=34" var cbXML = cbURI.replace(/^custombutton\:\/\//, ""); var decodeXML = unescape(cbXML); var btnName = decodeXML.match(/\<name\/?.+/).toString(); var name = "untitled"; if (!/\<name\/\>/.test(btnName)) { name = btnName.replace(/\<\/?\w+\>/g, "").toString(); } var image = decodeXML.match(/\<image\/?.+/).toString(); var icon = ""; if (!/\<\image.*\[\].*\>$/.test(image)) { icon = image.match(/[^\[\]]+/g)[2].toString() .replace(/custombuttons\-stdicon\-\d/, "").toString(); } function htmlEntities(str) { return str.replace(/&/g, "&").replace(/</g, "<") .replace(/>/g, ">").replace(/"/g, """); } var xmlTemplate = "custombuttons/\"\n\ xmlns:html=\"http://www.w3.org/1999/xhtml\">\n\ <html:head>\n\ <html:title><![CDATA[" + name + "]]></html:title>\n\ <html:link rel=\"shortcut icon\" href=\"" + icon + "\"/>\n\ <html:style type=\"text/css\"><![CDATA[\n\ body { font-size: medium; margin: 0; }\n\ body, code:before, help:before, initcode:before {\n\ font-family: \"Verdana\", sans-serif;\n\ }\n\ #wrapper { position: fixed; top: 1em; right: 1em; text-align: center; }\n\ p { font-size: small; text-align: center; }\n\ #button {\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\ background-image: -o-linear-gradient(top, rgb(147, 200, 94),\ rgb(85, 168, 2));\n\ background-image: -webkit-linear-gradient(top, rgb(147, 200, 94),\ rgb(85, 168, 2));\n\ border: 1px solid rgb(58, 116, 4);\n\ border-radius: .5em;\n\ -moz-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\ -moz-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\ }\n\ #button a {\n\ color: #000;\n\ text-shadow: -1pt -1px 0pt rgba(255, 255, 255, .5);\n\ padding: 1em;\n\ text-decoration: none;\n\ }\n\ :-moz-any-link:focus {\n\ color: white;\n\ outline-color: transparent;\n\ text-decoration: none;\n\ }\n\ #button a, code, code:before, initcode, initcode:before, help, help:before {\ \n display: block;\n\ }\n\ #credits { position: fixed; bottom: 1em; right: 1em; font-size: small; }\n\ custombutton { background-color: rgb(171, 171, 171); margin: 1em; }\n\ date, image, mode, accelkey { display: none; }\n\ name { font-weight: bold; font-size: x-large; }\n\ code:before, help:before, initcode:before {\n\ font-weight: bold;\n\ font-size: large;\n\ margin: 0 0 1em;\n\ padding: .5em;\n\ }\n\ code:before { content: \"Код\"; }\n\ help:before { content: \"Справка\"; }\n\ initcode:before { content: \"Инициализация\"; }\n\ code, initcode, help {\n\ background-color: rgb(255, 255, 255);\n\ border: 1px inset rgb(170, 170, 170);\n\ font: medium monospace;\n\ margin: 1em 1em 2em 0;\n\ padding: 1em;\n\ text-align: left;\n\ width: 840px;\n\ white-space: pre-wrap;\n\ word-wrap: break-word;\n\ }\n\ .clear { clear: both; }\n\ ]]></html:style>\n\ </html:head>\n\ <html:body>\n\ <html:div id=\"wrapper\">\n\ <html:div id=\"button\">\n\ <html:a href=\"" + cbURI + "\" rel=\"nofollow\" title=\"Установить " + htmlEntities(name, "ENT_COMPAT") +"\">\n\ <![CDATA[Установить кнопку]]>\n\ </html:a>\n\ </html:div>\n\ <html:div id=\"credits\">\n\ <html:a href=\"" + topicURL +"\">\n\ <![CDATA[Другие кнопки]]><html:br/>\ <![CDATA[на форуме Mozilla Россия]]>\n\ </html:a>\n\ </html:div>\n\ </html:div>\n\ </html:body>"; decodeXML = decodeXML.replace(/custombuttons\/\"\>/, xmlTemplate); name += ".xml"; saveToFile(decodeXML, name); var btn = document.popupNode; var as = Cc['@mozilla.org/alerts-service;1'].getService(Ci.nsIAlertsService); as.showAlertNotification(btn.image, "Кнопка: " + btn.name, "сохранена в XML файл", false, "", null); } var mrw = mostRecentWindow('navigator:browser'); var css = '@-moz-document url("chrome://browser/content/browser.xul"){' + this.Help + '}'; var uri = makeURI('data:text/css,' + encodeURIComponent(css)); var sss = Components.classes['@mozilla.org/content/style-sheet-service;1'].getService(Components.interfaces.nsIStyleSheetService); if (!sss.sheetRegistered(uri, sss.USER_SHEET)) sss.loadAndRegisterSheet(uri, sss.USER_SHEET); /////////////////////////////// Добавить кнопку из XML файл /////////////////////////////// this.loadXML = function loadXML() { var nsIFilePicker = Ci.nsIFilePicker; var fp = window.makeFilePicker(); fp.init(window, "Установить кнопку из XML файла", nsIFilePicker.modeOpen); fp.appendFilters(fp.filterXML); fp.appendFilter("Все файлы", "*.*"); fp.open(re=> { if ( re == fp.returnOK ) gBrowser.selectedTab = gBrowser.addTrustedTab(fp.file.path); }) } /////////////////////////////// Сохранить все кнопки в HTML файл /////////////////////////////// this.saveToHTMLALLCode = function saveToHTMLALLCode() { var visibleCBbuttons = [...document.querySelectorAll('[cb-mode]')]; var paletteCBbuttons = [...custombuttons.palette.querySelectorAll('[cb-mode]')]; var allCBbuttons = visibleCBbuttons.concat(paletteCBbuttons); var gn = btn => btn.getAttribute("label") || "Без названия"; allCBbuttons.sort((a, b) => gn(a).localeCompare(gn(b))); var array = []; allCBbuttons.forEach(but=> { var uri = but.URI ? but.URI : getPaleteButtonsURI(but); var name1 = 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("<li>\n<img src=" + image + "> \<a href=" + uri + ">" + name1 +"</a><br>\n"); }); var before = "<html>\n<head>\n<title>Custom Buttons</title>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n"; var before1 = "<style type='text/css'>\nbody {background: beige;} a:link {color: black; text-decoration: none;} img {border: 0; margin: 0px 10px;}\n</style>\n"; var before2 = "</head>\n<body>\nCustom Buttons\n<p>\n"; var info = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo); var before3 = info.vendor + " " + info.name + " " + info.version + " (build " + info.appBuildID + ")\n"; var after = "\n</ol>\n</body>\n</html>"; var text = before + before1 + before2 + before3 + "<p>\n" + bDate + "<p>\n" + "<ol>" + array.join("") + after; var name = "CB buttons " + aDate + ".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 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)); }; /////////////////////////////// Сохранить кнопку в HTML файл /////////////////////////////// this.saveToHTMLCode = function saveToHTMLCode() { var btn = document.popupNode; var xml = '<html xmlns="' + xhtmlns + '">\n'; xml += '<head>\n'; xml += '<meta http-equiv = "Content-Type" content = "text/html; charset=utf-8"/>\n'; xml += '<title> ' + btn.name + ' для Custom Buttons </title>\n'; xml += '<link rel="icon" type="image/vnd.microsoft.icon" href = "'+ btn.image +'" />\n'; xml += '<style type="text/css">\n'; xml += '.button a{ \n'; xml += 'background-color: rgb(85, 168, 2); \n'; xml += 'background-image: linear-gradient(to bottom, rgb(147, 200, 94), rgb(85, 168, 2)); \n'; xml += 'background-image: -moz-linear-gradient(top, rgb(147, 200, 94), rgb(85, 168, 2)); \n'; xml += 'border: 1px solid rgb(58, 116, 4); \n'; xml += 'border-radius: .5em; \n'; xml += ' -webkit-border-radius: .5em; \n'; xml += 'padding: 0; \n'; xml += 'margin-bottom: 1em; \n'; xml += 'box-shadow: 1px 2px 3px rgba(0, 0, 0, .25); \n'; xml += ' -o-box-shadow: 1px 2px 3px rgba(0, 0, 0, .25); \n'; xml += ' -webkit-box-shadow: 1px 2px 3px rgba(0, 0, 0, .25); \n'; xml += ' color: #000; \n'; xml += ' text-shadow: -1pt -1px 0pt rgba(255, 255, 255, .5); \n'; xml += ' padding: 0.5em; \n'; xml += ' text-decoration: none; \n'; xml += '} '; xml += 'pre { border: 1px inset rgb(170, 170, 170); \n'; xml += 'background-color: rgb(255, 255, 255);} \n'; xml += 'body { background-color: rgb(245, 245, 220);} \n'; xml += '</style> \n'; xml += '</head>\n'; xml += '<body>\n'; xml += '<section id="install"><h1> ' + btn.name + ' </h1> \n'; xml += '</section>\n'; xml += '<div class="button"><a href = "' + btn.URI + '">Установить кнопку</a></div> \n'; xml += '<section id="init"><h2>Инициализация</h2><pre>' + e4xConv_encodeHTML(btn.cbInitCode) + '</pre></section>\n'; xml += '<section id="code"><h2>Код</h2><pre>' + e4xConv_encodeHTML(btn.cbCommand) + '</pre></section> \n'; xml += '<section id="help"><h2>Справка</h2><pre>' + e4xConv_encodeHTML(btn.Help) + '</pre></section> \n'; xml += '</body> \n'; xml += '</html> '; var html = '<!DOCTYPE html>\n' + xml; var name = btn.name + ".HTML"; saveToFile(html, name); var as = Cc['@mozilla.org/alerts-service;1'].getService(Ci.nsIAlertsService); as.showAlertNotification(btn.image, "Кнопка: " + btn.name, "сохранена в HTML файл", false, "", null); } 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; }; /////////////////////////////// Переместить кнопку /////////////////////////////// ///Сначала нажимаем на любой кнопке - переместить, потом - Пкм на той кнопке, за которой эта должна встать//// this.MoveToolbarButtons = MTB = { // Start editable preferences MoveButtonMICBContext: true, // Add "Move button" menu item to Custom Buttons context menu? MoveButtonMITBarContext: false, // Add "Move button" menu item to toolbars context menu? ShowMoveAlert: false, // Show the alert with instructions when moving buttons? MoveBtnImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAYklEQVQ4" + "jWNgGJTgaAXHf2LEcGrGZQBBQ45WcPz/fZ0XpwG45FAUEDIAqzyyJLIiZIxNHqdmYvHRCo7/DLhsIEYziivQDcHn" + "BawxgqyQUCzgjQlC6YCotEB2QkJWTIzY4AAAezv/caeCLKcAAAAASUVORK5CYII=", // End editable preferences _UID: "__cb_move_toolbar_buttons_" + custombuttons.getNumber(self.id), WindowIDs: ["main-window", "messengerWindow", "msgcomposeWindow"], ToolbarContexIDs: ["toolbar-context-menu", "aios-toolbar-contextmenu", "aios-sbhtoolbar-contextmenu"], Pref: "extensions.custombuttons.MoveToolbarButtons.Id" + custombuttons.getNumber(self.id) + ".MoveButtonID", SP: Services.prefs, Init: function() { if (!(MTB._UID in window)) { window[MTB._UID] = { Initialized: false }; } if (!window[MTB._UID]["Initialized"]) { window[MTB._UID]["Initialized"] = true; custombuttons.isPref(MTB.Pref, ""); if ("CustomizableUI" in window) { var originalFunction = custombuttons.persistCurrentSets.toString(); eval("custombuttons.persistCurrentSets=" + originalFunction .replace(", newButtonId)", ", newButtonId, aToRight)") .replace("pos + 1", "aToRight ? pos : pos + 1")); } if (MTB.MoveButtonMICBContext) { var contextPops = document.getElementsByTagName("menupopup"); let p = 0, pLen = contextPops.length; for (; p < pLen; p++) { var cPopID = contextPops[p].id; if (cPopID.substr(0, 26) === "custombuttons-contextpopup") { var cPopEl = document.getElementById(cPopID); var moveMIID = "custombuttons-contextpopup-moveButton" + cPopID.slice(26); var moveMIEl = document.getElementById(moveMIID); if (!moveMIEl) MTB.CreateMoveMI(moveMIID, cPopEl); } } } if (MTB.MoveButtonMITBarContext) { Array.prototype.slice.call(MTB.ToolbarContexIDs).forEach(function(aTBCtxID, aIndex) { let Ctx = document.getElementById(aTBCtxID); let tBarCtxMIID = MTB._UID + "moveButton" + aIndex; if (!document.getElementById(tBarCtxMIID)) { if (Ctx) { MTB.CreateMoveMI(tBarCtxMIID, Ctx); Ctx.addEventListener("popupshowing", function(aE) { document.getElementById(tBarCtxMIID).hidden = (document.popupNode.tagName !== "toolbarbutton"); }, false); } } }); } addDestructor(function(aReason) { if (aReason === "delete") { SP.resetUserPrefs(MTB.Pref); delete window[_UID]; } if (aReason === "delete" || aReason === "update") { window[MTB._UID]["Initialized"] = false; } }); } }, getPopupNode: function(aEl) { if (custombuttons.popupNode) return custombuttons.popupNode; var popupNode = aEl; while (popupNode.tagName.toLowerCase() !== "toolbarbutton") { popupNode = popupNode.parentNode; } return popupNode; }, CreateMoveMI: function(aMItemID, aPopupEl) { let moveMIEl = aPopupEl.appendChild(document.createElementNS(xulns, "menuitem")); moveMIEl.setAttribute("id", aMItemID); moveMIEl.setAttribute("label", "Переместить кнопку..."); moveMIEl.setAttribute("image", MTB.MoveBtnImage); moveMIEl.setAttribute("tooltip", MTB._UID + "moveButtonMI_tooltip"); moveMIEl.setAttribute("onclick", "document.getElementById(\"" + self.id + "\").MoveToolbarButtons.MoveOnClick(event);"); }, MoveOnClick: function(aE) { var popupNode = MTB.getPopupNode(aE.target); if (!popupNode) return; aE.stopPropagation(); aE.preventDefault(); if (aE.button === 0 && !aE.shiftKey && !aE.ctrlKey && !aE.altKey) { MTB.SP.setCharPref(MTB.Pref, popupNode.id); window.addEventListener('click', MTB.MoveListener, true); window.addEventListener('mouseup', MTB.DefaultPrevention, true); window.addEventListener('mousedown', MTB.DefaultPrevention, true); window.addEventListener('contextmenu', MTB.DefaultPrevention, true); MTB.HidePopup(aE.target); MTB.ShowMoveAlert && Services.prompt.alert(null, self.name, "Now click ANY toolbarbutton element inside ANY toolbar.\n" + "Left click will position the button to the left of the target.\n" + "Right click will position the button to the right of the target.\n\n" + "To cancel the movement, just click ANY element inside the browser that IS NOT a toolbarbutton.\n"); } }, MoveListener: function(aE) { MTB.DefaultPrevention(aE); window.removeEventListener('click', MTB.MoveListener, true); window.removeEventListener('mouseup', MTB.DefaultPrevention, true); window.removeEventListener('mousedown', MTB.DefaultPrevention, true); window.removeEventListener('contextmenu', MTB.DefaultPrevention, true); var anchor = aE.target; if (anchor.tagName !== "toolbarbutton") return; var toolbar = anchor.parentNode; var BtnToMove = document.getElementById(MTB.SP.getCharPref(MTB.Pref)); if (aE.button === 0 && !aE.shiftKey && !aE.ctrlKey && !aE.altKey) toolbar.insertBefore(BtnToMove, anchor); else if (aE.button === 2 && !aE.shiftKey && !aE.ctrlKey && !aE.altKey) toolbar.insertBefore(BtnToMove, anchor.nextSibling); if ("CustomizableUI" in window) custombuttons.persistCurrentSets(toolbar.id, anchor.id, BtnToMove.id || BtnToMove.getAttribute("id"), !(aE.button === 2)); else { toolbar.setAttribute("currentset", toolbar.currentSet); document.persist(toolbar.id, "currentset"); } MTB.SP.setCharPref(MTB.Pref, ""); }, DefaultPrevention: function(aE) { aE.preventDefault(); aE.stopImmediatePropagation && aE.stopImmediatePropagation(); aE.stopPropagation(); }, Tooltips: function(aRem) { var popSetID = MTB._UID + "popupset"; var popSetEl = document.getElementById(popSetID); if (popSetEl) popSetEl.parentNode.removeChild(popSetEl); if (aRem) return; if (!popSetEl) { popSetEl = document.createElementNS(xulns, "popupset"); popSetEl.setAttribute("id", popSetID); } popSetEl.appendChild(MTB.parseXML("<tooltip xmlns=\"" + xulns + "\" xmlns:html=\"" + xhtmlns + "\" id=\"" + MTB._UID + "moveButtonMI_tooltip" + "\">" + "<description><html:b>Instructions</html:b> : After clicking this menu item, you can " + "click ANY toolbarbutton element inside the application to place the currently " + "selected button to the left (with Left click) or to the right (with Right click) " + "of the targeted toolbarbutton.</description>" + "<separator/>" + "<description><html:b>Note</html:b> : It can be ANY toolbarbutton, not just " + "other Custom Buttons.</description>" + "</tooltip>")); setTimeout(function() { Array.prototype.slice.call(MTB.WindowIDs).forEach(function(aWinID) { let win = document.getElementById(aWinID); if (win) !document.getElementById(popSetID) && win.appendChild(popSetEl); }); }, 100); }, parseXML: function(aXML) { // Return parsed XML aXML = aXML.replace(/>\s+</g, "><"); // Linearize XML return (new DOMParser).parseFromString(aXML, "application/xml").documentElement; }, HidePopup: function(aEl) { try { aEl.hidePopup(); } catch (aError) { try { aEl.parentNode.hidePopup(); } catch (aError) { try { aEl.parentNode.parentNode.hidePopup(); } catch (aError) { try { aEl.parentNode.parentNode.parentNode.hidePopup(); } catch (aError) {} } } } } }; this.MoveToolbarButtons.Init();
data:image/ico;base64,AAABAAIAEBAAAAEAIABoBAAAJgAAABAQAAABAAgAaAUAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAAP///////////////////////////////////////////////////////////////////wAAAP//AAAAAAAA/////wAA/wAA/////////wD//wD//////wD/////////AAD/////////AP////////8A/////////wD//wAAAAD/AP//////////AP////8A//8A/////////wD/////AP///wD///////8A/////wD/////AAAA/////wAAAP///////////////////////////////////////////////////////////////////////////////////////////wAA//8AAP//AADBAQAAgIAAABx8AAA+fAAAPwEAAD8gAAAfPAAAgYAAAMGBAAD//wAA//8AAP//AAD//wAA
Отредактировано Andrey_Krropotkin (02-01-2019 09:06:13)
Отсутствует
2. Возьмите создайте новую кнопку, вставьте мой код в инициализацию, вместо звездочки, вставьте изображение дискеты.
Так и сделал, теперь всё ОК.
А вообще очень не хватает кнопки для 63- Save snapshot to html, которая была от LEX"а
Отредактировано rubel (02-01-2019 10:39:43)
Отсутствует