Skip to content

Commit

Permalink
Bug 332753 - javascript:addSidebar()/sidebar.addPanel() doesn't work …
Browse files Browse the repository at this point in the history
…in places-bookmarks builds. r=gavin.
  • Loading branch information
mozilla.mano%sent.com committed Mar 8, 2007
1 parent 315c435 commit e74f845
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion browser/components/sidebar/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ VPATH = @srcdir@

include $(DEPTH)/config/autoconf.mk

EXTRA_COMPONENTS = nsSidebar.js
EXTRA_PP_COMPONENTS = nsSidebar.js

include $(topsrcdir)/config/rules.mk

22 changes: 17 additions & 5 deletions browser/components/sidebar/src/nsSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,30 @@ function (aTitle, aContentURL, aCustomizeURL, aPersist)
if (!sidebarURLSecurityCheck(aContentURL))
return;

#ifdef MOZ_PLACES_BOOKMARKS
var uri = null;
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
try {
uri = ioService.newURI(aContentURL, null, null);
}
catch(ex) { return; }

win.PlacesUtils.showAddBookmarkUI(uri, aTitle, null, true, true);
#else
var dialogArgs = {
name: aTitle,
url: aContentURL,
bWebPanel: true
}
var features;
if (!/Mac/.test(win.navigator.platform))
features = "centerscreen,chrome,dialog,resizable,dependent";
else
features = "chrome,dialog,resizable,modal";
#ifdef XP_MACOSX
var features = "chrome,dialog,resizable,modal";
#else
var features = "centerscreen,chrome,dialog,resizable,dependent";
#endif
win.openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "",
features, dialogArgs);
#endif
}

nsSidebar.prototype.validateSearchEngine =
Expand Down

0 comments on commit e74f845

Please sign in to comment.