50 init:
function SBD_init() {
51 document.getElementById(
"bookmarks").place =
52 "place:queryType=1&folder=" +
PlacesUIUtils.allBookmarksFolderId;
55 this.selectionChanged();
62 selectionChanged:
function SBD_selectionChanged() {
63 var accept = document.documentElement.getButton(
"accept");
64 var bookmarks = document.getElementById(
"bookmarks");
65 var disableAcceptButton =
true;
66 if (bookmarks.hasSelection) {
67 if (!PlacesUtils.nodeIsSeparator(bookmarks.selectedNode))
68 disableAcceptButton =
false;
70 accept.disabled = disableAcceptButton;
73 onItemDblClick:
function SBD_onItemDblClick() {
74 var bookmarks = document.getElementById(
"bookmarks");
75 var selectedNode = bookmarks.selectedNode;
76 if (selectedNode && PlacesUtils.nodeIsURI(selectedNode)) {
81 document.documentElement.getButton(
"accept").click();
89 accept:
function SBD_accept() {
90 var bookmarks = document.getElementById(
"bookmarks");
92 "Should not be able to accept dialog if there is no selected URL!");
95 var selectedNode = bookmarks.selectedNode;
96 if (PlacesUtils.nodeIsFolder(selectedNode)) {
97 var contents = PlacesUtils.getFolderContents(selectedNode.itemId).root;
98 var cc = contents.childCount;
99 for (var
i = 0;
i < cc; ++
i) {
100 var
node = contents.getChild(
i);
101 if (PlacesUtils.nodeIsURI(node)) {
103 names.push(node.title);
108 urls.push(selectedNode.uri);
109 names.push(selectedNode.title);
111 window.arguments[0].urls = urls;
112 window.arguments[0].names = names;
function NS_ASSERT(cond, msg)
_getSelectedPageStyle s i