Bug 216426: always on top behaviour of help window; p=R.J. Keller <rjkeller@kellertechnologies.com>/<stefanh@bluebottle.com>, r=IanN, sr=neil, a=IanN
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@193156 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -174,6 +174,14 @@ function init() {
|
||||
|
||||
//Always show the Table of Contents sidebar at startup.
|
||||
showPanel('help-toc');
|
||||
|
||||
// alwaysRaised only works on Mac & Win.
|
||||
if (!/Win|Mac/.test(navigator.platform)) {
|
||||
var toggleSeparator = document.getElementById("context-sep-selectall");
|
||||
var toggleOnTop = document.getElementById("context-zlevel");
|
||||
toggleOnTop.hidden = true;
|
||||
toggleSeparator.hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
function contentClick(event) {
|
||||
@@ -709,3 +717,29 @@ function showRelativePanel(goForward) {
|
||||
selectedIndex = sidebarButtons.length - 1;
|
||||
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.
|
||||
// element is the DOM node that persists the checked state
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
width="480"
|
||||
height="360"
|
||||
persist="width height screenX screenY"
|
||||
persist="width height screenX screenY zlevel"
|
||||
onload="init();"
|
||||
onunload="window.XULBrowserWindow.destroy();">
|
||||
|
||||
|
||||
@@ -35,7 +35,12 @@
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://communicator/locale/contentAreaCommands.dtd" >
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % helpDTD SYSTEM "chrome://help/locale/help.dtd" >
|
||||
%helpDTD;
|
||||
<!ENTITY % communicatorDTD SYSTEM "chrome://communicator/locale/contentAreaCommands.dtd" >
|
||||
%communicatorDTD;
|
||||
]>
|
||||
<overlay id="helpContextOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
@@ -70,6 +75,14 @@
|
||||
label="&selectAllCmd.label;"
|
||||
accesskey="&selectAllCmd.accesskey;"
|
||||
command="cmd_selectAll"/>
|
||||
<menuseparator id="context-sep-selectall"/>
|
||||
<menuitem id="context-zlevel"
|
||||
type="checkbox"
|
||||
checked="true"
|
||||
persist="checked"
|
||||
label="&zLevel.label;"
|
||||
accesskey="&zLevel.accesskey;"
|
||||
oncommand="toggleZLevel(this);"/>
|
||||
</popup>
|
||||
</popupset>
|
||||
</overlay>
|
||||
|
||||
@@ -27,3 +27,7 @@
|
||||
<!ENTITY findPrevCmd.commandkey2 "VK_F3">
|
||||
<!ENTITY findOnCmd.commandkey "f">
|
||||
<!ENTITY printCmd.commandkey "p">
|
||||
|
||||
<!-- Context menu -->
|
||||
<!ENTITY zLevel.label "Always on Top">
|
||||
<!ENTITY zLevel.accesskey "w">
|
||||
|
||||
Reference in New Issue
Block a user