зеркало из https://github.com/mozilla/pjs.git
Bug 397263 - No way to set an icon for javascript bookmarklets on toolbar and menupopups, r=mak77
This commit is contained in:
Родитель
bd2a2581d4
Коммит
0ce5b24216
|
@ -820,6 +820,12 @@
|
|||
// to be added or removed.
|
||||
PlacesUIUtils.ensureLivemarkStatusMenuItem(menuitem.firstChild);
|
||||
}
|
||||
else if (PlacesUtils.nodeIsURI(aNode)) {
|
||||
if (aNode.uri.lastIndexOf("javascript:", 0) == 0)
|
||||
menuitem.setAttribute("bookmarklet", "true");
|
||||
else
|
||||
menuitem.removeAttribute("bookmarklet");
|
||||
}
|
||||
},
|
||||
|
||||
itemReplaced:
|
||||
|
|
|
@ -219,6 +219,12 @@
|
|||
this._containerNodesMap.push({ resultNode: aChild,
|
||||
domNode: popup });
|
||||
}
|
||||
else if (PlacesUtils.nodeIsURI(aChild)) {
|
||||
if (aChild.uri.lastIndexOf("javascript:", 0) == 0)
|
||||
button.setAttribute("bookmarklet", "true");
|
||||
else
|
||||
button.removeAttribute("bookmarklet");
|
||||
}
|
||||
}
|
||||
|
||||
button.node = aChild;
|
||||
|
@ -638,6 +644,12 @@
|
|||
// to be added or removed.
|
||||
PlacesUIUtils.ensureLivemarkStatusMenuItem(element.firstChild);
|
||||
}
|
||||
else if (PlacesUtils.nodeIsURI(aNode)) {
|
||||
if (aNode.uri.lastIndexOf("javascript:", 0) == 0)
|
||||
element.setAttribute("bookmarklet", "true");
|
||||
else
|
||||
element.removeAttribute("bookmarklet");
|
||||
}
|
||||
},
|
||||
|
||||
itemReplaced:
|
||||
|
|
|
@ -928,6 +928,10 @@ PlacesTreeView.prototype = {
|
|||
else if (itemId != -1) { // bookmark nodes
|
||||
if (PlacesUtils.nodeIsLivemarkContainer(node.parent))
|
||||
properties.push(this._getAtomFor("livemarkItem"));
|
||||
else if (PlacesUtils.nodeIsURI(node)) {
|
||||
if (node.uri.lastIndexOf("javascript:", 0) == 0)
|
||||
properties.push(this._getAtomFor("bookmarklet"));
|
||||
}
|
||||
}
|
||||
|
||||
this._visibleElements[aRow].properties = properties;
|
||||
|
|
|
@ -999,6 +999,9 @@ var PlacesUIUtils = {
|
|||
if (PlacesUtils.uriTypes.indexOf(type) != -1) {
|
||||
element = document.createElement("menuitem");
|
||||
element.className = "menuitem-iconic bookmark-item";
|
||||
|
||||
if (aNode.uri.lastIndexOf("javascript:", 0) == 0)
|
||||
element.setAttribute("bookmarklet", "true");
|
||||
}
|
||||
else if (PlacesUtils.containerTypes.indexOf(type) != -1) {
|
||||
element = document.createElement("menu");
|
||||
|
|
Загрузка…
Ссылка в новой задаче