зеркало из https://github.com/mozilla/gecko-dev.git
Implement Seamonkey's addPanel API
This commit is contained in:
Родитель
dcc562b916
Коммит
84fd8665eb
|
@ -42,6 +42,6 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = bookmarks downloads history prefwindow security build
|
||||
DIRS = bookmarks downloads history prefwindow security sidebar build
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*
|
||||
* Contributor(s): Stephen Lamm <slamm@netscape.com>
|
||||
* Robert John Churchill <rjc@netscape.com>
|
||||
* David Hyatt <hyatt@mozilla.org>
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -109,7 +110,21 @@ function (aTitle, aContentURL, aCustomizeURL, aPersist)
|
|||
|
||||
sidebarURLSecurityCheck(aContentURL);
|
||||
|
||||
alert("Add Panel via SeaMonkey API attempted!");
|
||||
// Avert your eyes children. It may assume other forms.
|
||||
var ir = this.window.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
|
||||
var webNav = ir.getInterface(Components.interfaces.nsIWebNavigation);
|
||||
var docTreeItem = webNav.QueryInterface(Components.interfaces.nsIDocShellTreeItem);
|
||||
var chromeDocTreeItem = docTreeItem.parent;
|
||||
|
||||
// You're still here? I thought the previous four lines would have driven you away.
|
||||
// Now for my next trick...
|
||||
var chromeIR = chromeDocTreeItem.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
|
||||
var chromeWindow = chromeIR.getInterface(Components.interfaces.nsIDOMWindowInternal);
|
||||
|
||||
// The name.... is NEO.
|
||||
chromeWindow.openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "",
|
||||
"centerscreen,chrome,dialog=yes,resizable=no,dependent",
|
||||
aTitle, aContentURL, null, null, null, null, true);
|
||||
}
|
||||
|
||||
/* decorate prototype to provide ``class'' methods and property accessors */
|
||||
|
|
Загрузка…
Ссылка в новой задаче