зеркало из https://github.com/mozilla/pjs.git
Bug 240947 use content instead of _content
r=neil sr=dveditz
This commit is contained in:
Родитель
0ac9c670a1
Коммит
68fdfc1c8a
|
@ -96,7 +96,7 @@ function BrowserPrintPreview()
|
|||
var ifreq;
|
||||
var webBrowserPrint;
|
||||
try {
|
||||
ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
|
||||
ifreq = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
|
||||
webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
|
||||
gPrintSettings = GetPrintSettings();
|
||||
|
||||
|
@ -120,7 +120,7 @@ function BrowserPrintPreview()
|
|||
function FinishPrintPreview()
|
||||
{
|
||||
try {
|
||||
var ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
|
||||
var ifreq = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
|
||||
var webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
|
||||
if (webBrowserPrint) {
|
||||
gPrintSettings = GetPrintSettings();
|
||||
|
@ -128,7 +128,7 @@ function FinishPrintPreview()
|
|||
}
|
||||
showPrintPreviewToolbar();
|
||||
|
||||
_content.focus();
|
||||
content.focus();
|
||||
} catch (e) {
|
||||
// Pressing cancel is expressed as an NS_ERROR_ABORT return value,
|
||||
// causing an exception to be thrown which we catch here.
|
||||
|
@ -156,7 +156,7 @@ function OnLoadPrintEngine(){
|
|||
prevWeeksInView=gArgs.prevWeeksInView;
|
||||
startOfWeek=gArgs.startOfWeek;
|
||||
|
||||
gHtmlDocument = window._content.document ;
|
||||
gHtmlDocument = window.content.document ;
|
||||
initHTMLView();
|
||||
eval(HTMLViewFunction)(HTMLFunctionArgs);
|
||||
finishHTMLView() ;
|
||||
|
|
|
@ -1,286 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Netscape Communications Corporation.
|
||||
Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
of those above. If you wish to allow use of your version of this file only
|
||||
under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
use your version of this file under the terms of the MPL, indicate your
|
||||
decision by deleting the provisions above and replace them with the notice
|
||||
and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the MPL, the GPL or the LGPL.
|
||||
|
||||
***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://cookie/locale/cookieNavigatorOverlay.dtd">
|
||||
|
||||
<overlay id="cookieNavigatorOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://cookie/content/cookieOverlay.js"/>
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
/******* THE FOLLOWING IS FOR THE TASKMENU OVERLAY *******/
|
||||
|
||||
// both are necessary. popupmanager is just a special case
|
||||
// of permissionmanager but does extra work on add/remove
|
||||
const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
|
||||
const nsICookiePermission = Components.interfaces.nsICookiePermission;
|
||||
var permissionmanager;
|
||||
var popupmanager;
|
||||
|
||||
// determine which items we need to hide or disable from the task menu
|
||||
function CheckForVisibility()
|
||||
{
|
||||
// obtain access to permissionmanager and popupmanager
|
||||
// (popup manager is a wrapper around permission that does extra work)
|
||||
permissionmanager =
|
||||
Components.classes["@mozilla.org/permissionmanager;1"]
|
||||
.getService(Components.interfaces.nsIPermissionManager);
|
||||
popupmanager =
|
||||
Components.classes["@mozilla.org/PopupWindowManager;1"]
|
||||
.getService(Components.interfaces.nsIPopupWindowManager);
|
||||
if (!("_content" in window) || !window._content) {
|
||||
// this occurs if doing tasks->privacy->cookie->block from java console
|
||||
return;
|
||||
}
|
||||
|
||||
// determine current state (blocked or unblocked) and hide appropriate menu item
|
||||
var uri = getBrowser().currentURI;
|
||||
setRadioButton("UseCookiesDefault", uri, nsIPermissionManager.UNKNOWN_ACTION, "cookie");
|
||||
setRadioButton("AllowCookies", uri, nsIPermissionManager.ALLOW_ACTION, "cookie");
|
||||
setRadioButton("AllowSessionCookies", uri, nsICookiePermission.ACCESS_SESSION, "cookie");
|
||||
setRadioButton("BlockCookies", uri, nsIPermissionManager.DENY_ACTION, "cookie");
|
||||
setRadioButton("UseImagesDefault", uri, nsIPermissionManager.UNKNOWN_ACTION, "image");
|
||||
setRadioButton("AllowImages", uri, nsIPermissionManager.ALLOW_ACTION, "image");
|
||||
setRadioButton("BlockImages", uri, nsIPermissionManager.DENY_ACTION, "image");
|
||||
|
||||
SetPopupMenuEnabledState();
|
||||
|
||||
var pref;
|
||||
pref = Components.classes['@mozilla.org/preferences-service;1'];
|
||||
pref = pref.getService();
|
||||
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
|
||||
}
|
||||
|
||||
function SetPopupMenuEnabledState() {
|
||||
var blocked = nsIPermissionManager.UNKNOWN_ACTION;
|
||||
var policy = pref.getBoolPref("dom.disable_open_during_load");
|
||||
|
||||
blocked = permissionmanager.testPermission(getBrowser().currentURI, "popup");
|
||||
|
||||
document.getElementById("AboutPopups").hidden = policy;
|
||||
document.getElementById("ManagePopups").hidden = !policy;
|
||||
|
||||
if (policy) {
|
||||
enableElement("AllowPopups", blocked != nsIPermissionManager.ALLOW_ACTION);
|
||||
return;
|
||||
}
|
||||
|
||||
enableElement("AllowPopups", false);
|
||||
}
|
||||
|
||||
function setRadioButton(elementID, uri, perm, type) {
|
||||
var enable = (perm == permissionmanager.testPermission(uri, type));
|
||||
document.getElementById(elementID).setAttribute("checked", enable);
|
||||
}
|
||||
|
||||
function enableElement(elementID, enable) {
|
||||
var element = document.getElementById(elementID);
|
||||
if (enable)
|
||||
element.removeAttribute("disabled");
|
||||
else
|
||||
element.setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
// perform a Cookie or Image action
|
||||
function CookieImageAction(action) {
|
||||
|
||||
if (!("_content" in window) || !window._content) {
|
||||
// this occurs if doing tasks->privacy->cookie->block from java console
|
||||
return;
|
||||
}
|
||||
var element;
|
||||
var uri = getBrowser().currentURI;
|
||||
|
||||
switch (action) {
|
||||
case "cookieAllow":
|
||||
if (permissionmanager.testPermission(uri, "cookie") == nsIPermissionManager.ALLOW_ACTION)
|
||||
return;
|
||||
permissionmanager.add(uri, "cookie", nsIPermissionManager.ALLOW_ACTION);
|
||||
element = document.getElementById("AllowCookies");
|
||||
break;
|
||||
case "cookieSession":
|
||||
if (permissionmanager.testPermission(uri, "cookie") == nsICookiePermission.ACCESS_SESSION)
|
||||
return;
|
||||
permissionmanager.add(uri, "cookie", nsICookiePermission.ACCESS_SESSION);
|
||||
element = document.getElementById("AllowSessionCookies");
|
||||
break;
|
||||
case "cookieDefault":
|
||||
if (permissionmanager.testPermission(uri, "cookie") == nsIPermissionManager.UNKNOWN_ACTION)
|
||||
return;
|
||||
permissionmanager.remove(uri.host, "cookie");
|
||||
element = document.getElementById("UseCookiesDefault");
|
||||
break;
|
||||
case "cookieBlock":
|
||||
if (permissionmanager.testPermission(uri, "cookie") == nsIPermissionManager.DENY_ACTION)
|
||||
return;
|
||||
permissionmanager.add(uri, "cookie", nsIPermissionManager.DENY_ACTION);
|
||||
element = document.getElementById("BlockCookies");
|
||||
break;
|
||||
case "imageAllow":
|
||||
if (permissionmanager.testPermission(uri, "image") == nsIPermissionManager.ALLOW_ACTION)
|
||||
return;
|
||||
permissionmanager.add(uri, "image", nsIPermissionManager.ALLOW_ACTION);
|
||||
element = document.getElementById("AllowImages");
|
||||
break;
|
||||
case "imageDefault":
|
||||
if (permissionmanager.testPermission(uri, "image") == nsIPermissionManager.UNKNOWN_ACTION)
|
||||
return;
|
||||
permissionmanager.remove(uri.host, "image");
|
||||
element = document.getElementById("UseImagesDefault");
|
||||
break;
|
||||
case "imageBlock":
|
||||
if (permissionmanager.testPermission(uri, "image") == nsIPermissionManager.DENY_ACTION)
|
||||
return;
|
||||
permissionmanager.add(uri, "image", nsIPermissionManager.DENY_ACTION);
|
||||
element = document.getElementById("BlockImages");
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
promptService.alert(window,element.getAttribute("title"), element.getAttribute("msg"));
|
||||
}
|
||||
|
||||
function OpenAboutPopups() {
|
||||
window.openDialog("chrome://communicator/content/aboutPopups.xul", "",
|
||||
"chrome,centerscreen,dependent",
|
||||
false);
|
||||
}
|
||||
|
||||
function OpenManagePopups(host) {
|
||||
window.openDialog("chrome://communicator/content/popupManager.xul", "",
|
||||
"chrome,resizable=yes",
|
||||
host);
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- tasksOverlay menu items -->
|
||||
<menupopup id="taskPopup" onpopupshowing="CheckForVisibility()">
|
||||
<menu insertbefore="navBeginGlobalItems"
|
||||
label="&cookieCookieManager.label;"
|
||||
accesskey="&cookieCookieManager.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem id="BlockCookies" label="&cookieBlockCookiesCmd.label;"
|
||||
accesskey="&cookieBlockCookiesCmd.accesskey;"
|
||||
title="&cookieMessageTitle.label;"
|
||||
msg="&cookieBlockCookiesMsg.label;"
|
||||
type="radio" name="cookies"
|
||||
oncommand="CookieImageAction('cookieBlock');"/>
|
||||
<menuitem id="UseCookiesDefault" label="&cookieCookiesDefaultCmd.label;"
|
||||
accesskey="&cookieCookiesDefaultCmd.accesskey;"
|
||||
title="&cookieMessageTitle.label;"
|
||||
msg="&cookieCookiesDefaultMsg.label;"
|
||||
type="radio" name="cookies" checked="true"
|
||||
oncommand="CookieImageAction('cookieDefault');"/>
|
||||
<menuitem id="AllowSessionCookies" label="&cookieAllowSessionCookiesCmd.label;"
|
||||
title="&cookieMessageTitle.label;"
|
||||
accesskey="&cookieAllowSessionCookiesCmd.accesskey;"
|
||||
msg="&cookieAllowSessionCookiesMsg.label;"
|
||||
type="radio" name="cookies"
|
||||
oncommand="CookieImageAction('cookieSession');"/>
|
||||
<menuitem id="AllowCookies" label="&cookieAllowCookiesCmd.label;"
|
||||
title="&cookieMessageTitle.label;"
|
||||
accesskey="&cookieAllowCookiesCmd.accesskey;"
|
||||
msg="&cookieAllowCookiesMsg.label;"
|
||||
type="radio" name="cookies"
|
||||
oncommand="CookieImageAction('cookieAllow');"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&cookieDisplayCookiesCmd.label;"
|
||||
accesskey="&cookieDisplayCookiesCmd.accesskey;"
|
||||
oncommand="viewCookies();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu label="&cookieImageManager.label;"
|
||||
accesskey="&cookieImageManager.accesskey;"
|
||||
id="image"
|
||||
insertbefore="navBeginGlobalItems">
|
||||
<menupopup>
|
||||
<menuitem id="BlockImages" label="&cookieBlockImagesCmd.label;"
|
||||
accesskey="&cookieBlockImagesCmd.accesskey;"
|
||||
title="&cookieImageMessageTitle.label;"
|
||||
msg="&cookieBlockImagesMsg.label;"
|
||||
type="radio" name="images"
|
||||
oncommand="CookieImageAction('imageBlock');"/>
|
||||
<menuitem id="UseImagesDefault" label="&cookieImagesDefaultCmd.label;"
|
||||
accesskey="&cookieImagesDefaultCmd.accesskey;"
|
||||
title="&cookieImageMessageTitle.label;"
|
||||
msg="&cookieImagesDefaultMsg.label;"
|
||||
type="radio" name="images"
|
||||
oncommand="CookieImageAction('imageDefault');"/>
|
||||
<menuitem id="AllowImages" label="&cookieAllowImagesCmd.label;"
|
||||
accesskey="&cookieAllowImagesCmd.accesskey;"
|
||||
title="&cookieImageMessageTitle.label;"
|
||||
msg="&cookieAllowImagesMsg.label;"
|
||||
type="radio" name="images"
|
||||
oncommand="CookieImageAction('imageAllow');"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&cookieDisplayImagesCmd.label;"
|
||||
accesskey="&cookieDisplayImagesCmd.accesskey;"
|
||||
oncommand="viewImages();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu label="&cookiePopupManager.label;"
|
||||
accesskey="&cookiePopupManager.accesskey;"
|
||||
id="popup"
|
||||
insertbefore="navBeginGlobalItems"
|
||||
oncommand="popupBlockerMenuCommand(event.target);"
|
||||
onpopupshowing="return popupBlockerMenuShowing(event)" >
|
||||
<menupopup>
|
||||
<menuitem id="AllowPopups" label="&cookieAllowPopupsCmd.label;"
|
||||
accesskey="&cookieAllowPopupsCmd.accesskey;"
|
||||
oncommand="OpenManagePopups(getBrowser().currentURI.host);"/>
|
||||
<menuitem id="AboutPopups" label="&cookieAboutPopupBlocking.label;"
|
||||
accesskey="&cookieAboutPopupBlocking.accesskey;"
|
||||
oncommand="OpenAboutPopups();"
|
||||
hidden="true"/>
|
||||
<menuitem id="ManagePopups" label="&cookieManagePopups.label;"
|
||||
accesskey="&cookieManagePopups.accesskey;"
|
||||
oncommand="OpenManagePopups('');"
|
||||
hidden="true"/>
|
||||
<menuseparator id="popupMenuSeparator" hidden="true"/>
|
||||
<!-- Additional items are generated, see popupBlockerMenuShowing()
|
||||
in navigator.js -->
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</overlay>
|
|
@ -38,6 +38,6 @@
|
|||
function openCascadesDialog()
|
||||
{
|
||||
window.openDialog("chrome://cascades/content/EdCssProps.xul","_blank", "chrome,close,modal,titlebar");
|
||||
window._content.focus();
|
||||
window.content.focus();
|
||||
}
|
||||
|
||||
|
|
|
@ -300,7 +300,7 @@ function goHome() {
|
|||
function print()
|
||||
{
|
||||
try {
|
||||
_content.print();
|
||||
content.print();
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
}
|
||||
|
||||
function addEndDocumentLoadListener() {
|
||||
if (window._content) {
|
||||
if (window.content) {
|
||||
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService();
|
||||
observerService = observerService.QueryInterface(Components.interfaces.nsIObserverService);
|
||||
var observer = new navObserver();
|
||||
|
|
|
@ -149,14 +149,14 @@
|
|||
// Capture the values that are filled in on the form being displayed.
|
||||
function formCapture() {
|
||||
var walletService = Components.classes["@mozilla.org/wallet/wallet-service;1"].getService(Components.interfaces.nsIWalletService);
|
||||
walletService.WALLET_RequestToCapture(window._content);
|
||||
walletService.WALLET_RequestToCapture(window.content);
|
||||
}
|
||||
|
||||
// Prefill the form being displayed.
|
||||
function formPrefill() {
|
||||
var walletService = Components.classes["@mozilla.org/wallet/wallet-service;1"].getService(Components.interfaces.nsIWalletService);
|
||||
try {
|
||||
walletService.WALLET_Prefill(false, window._content);
|
||||
walletService.WALLET_Prefill(false, window.content);
|
||||
window.openDialog("chrome://communicator/content/wallet/WalletPreview.xul",
|
||||
"_blank", "chrome,modal=yes,dialog=yes,all, width=504, height=436");
|
||||
} catch(e) {
|
||||
|
@ -166,7 +166,7 @@
|
|||
/*
|
||||
// Prefill the form being displayed without bringing up the preview window.
|
||||
function formQuickPrefill() {
|
||||
gWalletService.WALLET_Prefill(true, window._content);
|
||||
gWalletService.WALLET_Prefill(true, window.content);
|
||||
}
|
||||
*/
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
popupmanager =
|
||||
Components.classes["@mozilla.org/PopupWindowManager;1"]
|
||||
.getService(Components.interfaces.nsIPopupWindowManager);
|
||||
if (!("_content" in window) || !window._content) {
|
||||
if (!("content" in window) || !window.content) {
|
||||
// this occurs if doing tasks->privacy->cookie->block from java console
|
||||
return;
|
||||
}
|
||||
|
@ -121,7 +121,7 @@
|
|||
// perform a Cookie or Image action
|
||||
function CookieImageAction(action) {
|
||||
|
||||
if (!("_content" in window) || !window._content) {
|
||||
if (!("content" in window) || !window.content) {
|
||||
// this occurs if doing tasks->privacy->cookie->block from java console
|
||||
return;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче