2014-06-25 09:12:07 +04:00
|
|
|
// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
|
2012-06-26 03:11:16 +04:00
|
|
|
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2005-03-24 19:00:01 +03:00
|
|
|
|
2016-12-31 05:47:25 +03:00
|
|
|
function macWindowMenuDidShow() {
|
2006-04-14 03:07:06 +04:00
|
|
|
var windowManagerDS =
|
2017-01-17 18:48:17 +03:00
|
|
|
Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"]
|
2006-04-14 03:07:06 +04:00
|
|
|
.getService(Components.interfaces.nsIWindowDataSource);
|
2005-03-24 19:00:01 +03:00
|
|
|
var sep = document.getElementById("sep-window-list");
|
|
|
|
// Using double parens to avoid warning
|
|
|
|
while ((sep = sep.nextSibling)) {
|
2017-01-17 18:48:17 +03:00
|
|
|
var url = sep.getAttribute("id");
|
2005-03-24 19:00:01 +03:00
|
|
|
var win = windowManagerDS.getWindowForResource(url);
|
2010-01-06 02:35:58 +03:00
|
|
|
if (win.document.documentElement.getAttribute("inwindowmenu") == "false")
|
|
|
|
sep.hidden = true;
|
|
|
|
else if (win == window)
|
2005-03-24 19:00:01 +03:00
|
|
|
sep.setAttribute("checked", "true");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-31 05:47:25 +03:00
|
|
|
function toOpenWindow( aWindow ) {
|
2009-09-22 01:39:09 +04:00
|
|
|
// deminiaturize the window, if it's in the Dock
|
2017-02-20 14:45:58 +03:00
|
|
|
if (aWindow.windowState == window.STATE_MINIMIZED)
|
2009-09-22 01:39:09 +04:00
|
|
|
aWindow.restore();
|
2005-03-24 19:00:01 +03:00
|
|
|
aWindow.document.commandDispatcher.focusedWindow.focus();
|
|
|
|
}
|
|
|
|
|
2016-12-31 05:47:25 +03:00
|
|
|
function ShowWindowFromResource( node ) {
|
2006-04-14 03:07:06 +04:00
|
|
|
var windowManagerDS =
|
2017-01-17 18:48:17 +03:00
|
|
|
Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"]
|
2006-04-14 03:07:06 +04:00
|
|
|
.getService(Components.interfaces.nsIWindowDataSource);
|
2005-03-24 19:00:01 +03:00
|
|
|
|
|
|
|
var desiredWindow = null;
|
2017-01-17 18:48:17 +03:00
|
|
|
var url = node.getAttribute("id");
|
2005-03-24 19:00:01 +03:00
|
|
|
desiredWindow = windowManagerDS.getWindowForResource( url );
|
|
|
|
if (desiredWindow)
|
|
|
|
toOpenWindow(desiredWindow);
|
|
|
|
}
|
|
|
|
|
2016-12-31 05:47:25 +03:00
|
|
|
function zoomWindow() {
|
2017-02-20 14:45:58 +03:00
|
|
|
if (window.windowState == window.STATE_NORMAL)
|
2005-03-24 19:00:01 +03:00
|
|
|
window.maximize();
|
|
|
|
else
|
|
|
|
window.restore();
|
|
|
|
}
|