shadow_member
Platinum Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
Цитата: (({panel}, {prefs}, pref, listener = { handleEvent(e) { var style = ` #editBookmarkPanel .panel-arrowcontent { background-color: gray !important; border: 1px solid black !important; } #editBookmarkPanel .panel-arrow:-moz-any([side="top"], [side="bottom"]) { list-style-image: url('data:image/svg+xml,\\${["", '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="10">\\%0A\\', ' <path d="M 0,10 L 10,0 20,10 z" fill="black"/>\\%0A\\', ' <path d="M 1,10 L 10,1 19,10 z" fill="gray"/>\\%0A\\', '</svg>'].join("\n" + " ".repeat(8))}') !important; } #editBookmarkPanel :-moz-any(textbox, listbox) { -moz-appearance: none !important; border: 1px solid black !important; } #editBookmarkPanel :-moz-any(textbox, listbox, treechildren, menupopup) { background-color: lightgray !important; } #editBookmarkPanel listitem, #editBookmarkPanel treechildren::-moz-tree-row { height: 1.6em !important; border: none !important; border-radius: 0 !important; outline: none !important; background-image: none !important; background-color: transparent !important; box-shadow: none !important; } #editBookmarkPanel treechildren::-moz-tree-row(hover) { background-color: #b4b4b4 !important; } #editBookmarkPanel treechildren::-moz-tree-row(hover, focus) { background-color: #91c8ff !important; } #editBookmarkPanel listbox listitem[selected=true], #editBookmarkPanel treechildren::-moz-tree-row(selected) { background-color: gray !important; } #editBookmarkPanel listbox:focus listitem[selected=true], #editBookmarkPanel treechildren::-moz-tree-row(selected, focus) { background-color: Highlight !important; } `.trim(); var dwu = QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); var str = "data:text/css," + encodeURIComponent(style), type = dwu.AGENT_SHEET; dwu.loadSheetUsingURIString(str, type); addDestructor(() => dwu.removeSheetUsingURIString(str, type)); this.locationRow = panel.querySelector("#editBMPanel_locationRow"); var tree = this.folderTree = panel.querySelector("#editBMPanel_folderTree"); tree.style.resize = "both"; tree.style.overflow = "hidden"; var treerows = tree.inputField.previousSibling; addEventListener("overflow", e => e.stopPropagation(), true, treerows); cbu.isPref(pref, "200 300"); addEventListener("popuphidden", this, false, panel); this.handleEvent = e => e.target == panel && this[e.type](); setTimeout(() => { treerows.setAttribute("hidevscroll", true); this.popupshowing(); }, 0); }, popupshowing() { gEditItemOverlay.toggleFolderTreeVisibility(); setTimeout(() => this.locationRow.collapsed = false, 0); var [width, height] = prefs.getCharPref(pref).split(" "); this.folderTree.width = this.width = width; this.folderTree.height = this.height = height; }, popuphidden() { var {width, height} = this.folderTree; if (width != this.width || height != this.height) prefs.setCharPref( pref, width + " " + height ); } }) => { addEventListener("popupshowing", listener, false, panel); addDestructor(reason => { reason == "delete" && prefs.clearUserPref(pref); var tree = listener.folderTree; if (!tree) return; for(var prop of ["resize", "overflow"]) tree.style.removeProperty(prop); tree.getAttribute("style") || tree.removeAttribute("style"); listener.locationRow.collapsed = true; tree.inputField.previousSibling.removeAttribute("hidevscroll"); for(var attr of ["width", "height"]) tree.removeAttribute(attr); }); })(StarUI, Services, "CB.editBMPanel_folderTree_WidthHeight"); |
|