Bug 251751 - Firefox Help window should not be alwaysRaised r=mconnor@myrealbox.com

This commit is contained in:
rj.keller%beonex.com 2005-03-08 23:04:47 +00:00
Родитель 75c3964217
Коммит 53497c4ebc
4 изменённых файлов: 49 добавлений и 0 удалений

Просмотреть файл

@ -867,3 +867,35 @@ function showRelativePanel(goForward) {
sidebarButtons[selectedIndex].doCommand(); sidebarButtons[selectedIndex].doCommand();
} }
# getXulWin - Returns the current Help window as a nsIXULWindow.
function getXulWin()
{
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
var webnav = window.getInterface(Components.interfaces.nsIWebNavigation);
var dsti = webnav.QueryInterface(Components.interfaces.nsIDocShellTreeItem);
var treeowner = dsti.treeOwner;
var ifreq = treeowner.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
return ifreq.getInterface(Components.interfaces.nsIXULWindow);
}
# toggleZLevel - Toggles whether or not the window will always appear on top. Because
# alwaysRaised is not supported on an OS other than windows, this code will not
# appear in those builds.
#
# element - The DOM node that persists the checked state.
#ifdef XP_WIN
function toggleZLevel(element)
{
var xulwin = getXulWin();
// Now we can flip the zLevel, and set the attribute so that it persists correctly
if (xulwin.zLevel > xulwin.normalZ) {
xulwin.zLevel = xulwin.normalZ;
element.setAttribute("checked", "false");
} else {
xulwin.zLevel = xulwin.raisedZ;
element.setAttribute("checked", "true");
}
}
#endif

Просмотреть файл

@ -60,7 +60,11 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
width="700" width="700"
height="550" height="550"
#ifdef XP_WIN
persist="width height screenX screenY zlevel"
#else
persist="width height screenX screenY" persist="width height screenX screenY"
#endif
onload="init();" onload="init();"
onunload="uninitFindBar(); window.XULBrowserWindow.destroy();"> onunload="uninitFindBar(); window.XULBrowserWindow.destroy();">

Просмотреть файл

@ -68,6 +68,16 @@
label="&textZoomReduceBtn.label;" label="&textZoomReduceBtn.label;"
accesskey="&textZoomReduceBtn.accesskey;" accesskey="&textZoomReduceBtn.accesskey;"
oncommand="ZoomManager.prototype.getInstance().reduce();"/> oncommand="ZoomManager.prototype.getInstance().reduce();"/>
#ifdef XP_WIN
<menuseparator/>
<menuitem id="context-zlevel"
type="checkbox"
checked="true"
persist="checked"
label="&zLevel.label;"
accesskey="&zLevel.accesskey;"
oncommand="toggleZLevel(this);"/>
#endif
</popup> </popup>
</popupset> </popupset>
</overlay> </overlay>

Просмотреть файл

@ -54,3 +54,6 @@
<!ENTITY textZoomEnlargeCmd.commandkey "+"> <!ENTITY textZoomEnlargeCmd.commandkey "+">
<!ENTITY textZoomEnlargeCmd.commandkey2 "="> <!-- + is above this key on many keyboards --> <!ENTITY textZoomEnlargeCmd.commandkey2 "="> <!-- + is above this key on many keyboards -->
<!ENTITY textZoomResetCmd.commandkey "0"> <!ENTITY textZoomResetCmd.commandkey "0">
<!ENTITY zLevel.label "Always on Top">
<!ENTITY zLevel.accesskey "T">