зеркало из https://github.com/mozilla/gecko-dev.git
Help viewer updates (67376). Checking in for ian. r=walk84 sr=blake
This commit is contained in:
Родитель
f17b1686fc
Коммит
7461a3fdc7
|
@ -47,8 +47,7 @@ var key = {
|
|||
"?advanced_pref_installation": "chrome://help/locale/cs_nav_prefs_advanced.html#Software_Installation",
|
||||
"?advanced_pref_mouse_wheel": "chrome://help/locale/cs_nav_prefs_advanced.html#Mouse_Wheel",
|
||||
"?advanced_pref_system": "chrome://help/locale/cs_nav_prefs_advanced.html#system",
|
||||
"?advanced_pref_proxies": "chrome://help/locale/cs_nav_prefs_advanced.html#nav_proxies",
|
||||
|
||||
"?advanced_pref_proxies": "chrome://help/locale/cs_nav_prefs_advanced.html#Proxies",
|
||||
"?nover_noencrypt": "chrome://help/locale/ssl_page_info_help.html#Not_Verified_Not Encrypted",
|
||||
"?ver_encrypt": "chrome://help/locale/ssl_page_info_help.html#Verified_Encrypted",
|
||||
"?conver_encrypt": "chrome://help/locale/ssl_page_info_help.html#Conditionally_Verified_Encrypted",
|
||||
|
@ -147,10 +146,15 @@ function init()
|
|||
if (key[window.location.search]) {
|
||||
dump("loading help content: " + key[window.location.search] + "\n");
|
||||
loadURI(key[window.location.search]);
|
||||
setContext();
|
||||
} else {
|
||||
goHome();
|
||||
}
|
||||
window.XULBrowserWindow = new nsHelpStatusHandler();
|
||||
// hook up UI through progress listener
|
||||
var browser = document.getElementById("help-content");
|
||||
var interfaceRequestor = browser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
|
||||
var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress);
|
||||
webProgress.addProgressListener(window.XULBrowserWindow);
|
||||
}
|
||||
|
||||
// select the item in the tree called "Dialog Help" if the window was loaded from a dialog
|
||||
|
@ -194,7 +198,6 @@ function loadURI(aURI)
|
|||
{
|
||||
const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
|
||||
getWebNavigation().loadURI(aURI, nsIWebNavigation.LOAD_FLAGS_NONE);
|
||||
dump("help document: " + uRI);
|
||||
}
|
||||
|
||||
function goBack()
|
||||
|
@ -224,3 +227,167 @@ function print()
|
|||
}
|
||||
}
|
||||
|
||||
function createBackMenu(event)
|
||||
{
|
||||
FillHistoryMenu(event.target, "back");
|
||||
}
|
||||
|
||||
function createForwardMenu(event)
|
||||
{
|
||||
FillHistoryMenu(event.target, "forward");
|
||||
}
|
||||
|
||||
function gotoHistoryIndex(aEvent)
|
||||
{
|
||||
var index = aEvent.target.getAttribute("index");
|
||||
if (!index)
|
||||
return false;
|
||||
try {
|
||||
getWebNavigation().gotoIndex(index);
|
||||
}
|
||||
catch(ex) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function BrowserBack()
|
||||
{
|
||||
try {
|
||||
getWebNavigation().goBack();
|
||||
}
|
||||
catch(ex) {
|
||||
}
|
||||
UpdateBackForwardButtons();
|
||||
}
|
||||
|
||||
function BrowserForward()
|
||||
{
|
||||
try {
|
||||
getWebNavigation().goForward();
|
||||
}
|
||||
catch(ex) {
|
||||
}
|
||||
UpdateBackForwardButtons();
|
||||
}
|
||||
|
||||
function nsHelpStatusHandler()
|
||||
{
|
||||
}
|
||||
|
||||
nsHelpStatusHandler.prototype =
|
||||
{
|
||||
onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) {},
|
||||
onProgressChange : function(aWebProgress, aRequest, aCurSelfProgress,
|
||||
aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {},
|
||||
onSecurityChange : function(aWebProgress, aRequest, state) {},
|
||||
onLocationChange : function(aWebProgress, aRequest, aLocation)
|
||||
{
|
||||
UpdateBackForwardButtons();
|
||||
},
|
||||
QueryInterface : function(aIID)
|
||||
{
|
||||
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
|
||||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
|
||||
aIID.equals(Components.interfaces.nsIXULBrowserWindow) ||
|
||||
aIID.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
},
|
||||
setJSStatus : function(status) {},
|
||||
setJSDefaultStatus : function(status) {},
|
||||
setOverLink : function(link) {}
|
||||
}
|
||||
|
||||
function UpdateBackForwardButtons()
|
||||
{
|
||||
var backBroadcaster = document.getElementById("canGoBack");
|
||||
var forwardBroadcaster = document.getElementById("canGoForward");
|
||||
var webNavigation = getWebNavigation();
|
||||
|
||||
// Avoid setting attributes on broadcasters if the value hasn't changed!
|
||||
// Remember, guys, setting attributes on elements is expensive! They
|
||||
// get inherited into anonymous content, broadcast to other widgets, etc.!
|
||||
// Don't do it if the value hasn't changed! - dwh
|
||||
|
||||
var backDisabled = (backBroadcaster.getAttribute("disabled") == "true");
|
||||
var forwardDisabled = (forwardBroadcaster.getAttribute("disabled") == "true");
|
||||
|
||||
if (backDisabled == webNavigation.canGoBack)
|
||||
backBroadcaster.setAttribute("disabled", !backDisabled);
|
||||
|
||||
if (forwardDisabled == webNavigation.canGoForward)
|
||||
forwardBroadcaster.setAttribute("disabled", !forwardDisabled);
|
||||
}
|
||||
|
||||
function find(again)
|
||||
{
|
||||
var focusedWindow = document.commandDispatcher.focusedWindow;
|
||||
var browser = document.getElementById("help-content");
|
||||
if (!focusedWindow || focusedWindow == window)
|
||||
focusedWindow = window._content;
|
||||
if (again)
|
||||
findAgainInPage(browser, window._content, focusedWindow);
|
||||
else
|
||||
findInPage(browser, window._content, focusedWindow)
|
||||
}
|
||||
|
||||
function getMarkupDocumentViewer()
|
||||
{
|
||||
return document.getElementById("help-content").markupDocumentViewer;
|
||||
}
|
||||
|
||||
function BrowserReload()
|
||||
{
|
||||
const reloadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE;
|
||||
return BrowserReloadWithFlags(reloadFlags);
|
||||
}
|
||||
|
||||
function BrowserReloadWithFlags(reloadFlags)
|
||||
{
|
||||
try {
|
||||
/* Need to get SessionHistory from docshell so that
|
||||
* reload on framed pages will work right. This
|
||||
* method should not be used for the context menu item "Reload frame".
|
||||
* "Reload frame" should directly call into docshell as it does right now
|
||||
*/
|
||||
var sh = getWebNavigation().sessionHistory;
|
||||
var webNav = sh.QueryInterface(Components.interfaces.nsIWebNavigation);
|
||||
webNav.reload(reloadFlags);
|
||||
}
|
||||
catch(ex) {
|
||||
}
|
||||
}
|
||||
|
||||
function BrowserPageInfo(doc)
|
||||
{
|
||||
window.openDialog("chrome://navigator/content/pageInfo.xul",
|
||||
"_blank",
|
||||
"chrome,dialog=no",
|
||||
doc);
|
||||
}
|
||||
|
||||
function BrowserViewSource()
|
||||
{
|
||||
var focusedWindow = document.commandDispatcher.focusedWindow;
|
||||
if (focusedWindow == window)
|
||||
focusedWindow = _content;
|
||||
|
||||
if (focusedWindow)
|
||||
var docCharset = "charset=" + focusedWindow.document.characterSet;
|
||||
|
||||
BrowserViewSourceOfURL(_content.location, docCharset);
|
||||
}
|
||||
|
||||
function BrowserViewSourceOfURL(url, charset)
|
||||
{
|
||||
// try to open a view-source window while inheriting the charset (if any)
|
||||
openDialog("chrome://navigator/content/viewSource.xul",
|
||||
"_blank",
|
||||
"scrollbars,resizable,chrome,dialog=no",
|
||||
url, charset);
|
||||
}
|
||||
|
||||
function getBrowser() {
|
||||
return document.getElementById("help-content");
|
||||
}
|
|
@ -3,12 +3,19 @@
|
|||
<?xml-stylesheet href="chrome://communicator/skin/help.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://navigator/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/contentAreaContextOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/viewZoomOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://navigator/content/platformNavigationBindings.xul"?>
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
|
||||
%brandDTD;
|
||||
<!ENTITY % helpDTD SYSTEM "chrome://help/locale/help.dtd" >
|
||||
%helpDTD;
|
||||
<!ENTITY % navigatorDTD SYSTEM "chrome://navigator/locale/navigator.dtd" >
|
||||
%navigatorDTD;
|
||||
]>
|
||||
|
||||
|
||||
|
@ -23,6 +30,55 @@
|
|||
onload="init();" >
|
||||
|
||||
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
|
||||
<script type="application/x-javascript" src="chrome://navigator/content/sessionHistoryUI.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaDD.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaClick.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarksOverlay.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/findUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/nsJSSupportsUtils.js"/>
|
||||
|
||||
<popupset id="aTooltipSet">
|
||||
<popup id="backMenu" oncreate="createBackMenu(event);" oncommand="gotoHistoryIndex(event);"/>
|
||||
<popup id="forwardMenu" oncreate="createForwardMenu(event);" oncommand="gotoHistoryIndex(event);"/>
|
||||
</popupset>
|
||||
<popupset id="contentAreaContextSet"/>
|
||||
<broadcasterset id="helpBroadcasters">
|
||||
<broadcaster id="canGoBack" disabled="true"/>
|
||||
<broadcaster id="canGoForward" disabled="true"/>
|
||||
</broadcasterset>
|
||||
<commandset id="globalEditMenuItems"/>
|
||||
<commandset id="selectEditMenuItems">
|
||||
<command id="cmd_undo"/>
|
||||
<command id="cmd_redo"/>
|
||||
<command id="cmd_cut"/>
|
||||
<command id="cmd_copy"/>
|
||||
<command id="cmd_paste"/>
|
||||
<command id="cmd_delete"/>
|
||||
<command id="cmd_selectAll"/>
|
||||
<command id="cmd_close" oncommand="close();"/>
|
||||
<command id="Browser:Home" oncommand="goHome();"/>
|
||||
<command id="Browser:Back" oncommand="goBack();" observes="canGoBack"/>
|
||||
<command id="Browser:Forward" oncommand="goForward();" observes="canGoForward"/>
|
||||
<command id="cmd_copyLink"/>
|
||||
<command id="cmd_copyImageLocation"/>
|
||||
<command id="cmd_copyImageContents"/>
|
||||
</commandset>
|
||||
<commandset id="clipboardEditMenuItems"/>
|
||||
<commandset id="viewZoomCommands"/>
|
||||
<keyset id="keys">
|
||||
<key id="key_close"/>
|
||||
<key id="printKb" key="&printCmd.commandkey;" oncommand="print();" modifiers="accel"/>
|
||||
<keyset id="viewZoomKeys"/>
|
||||
<keyset id="navigationKeys"/>
|
||||
<key id="key_find" key="&findOnCmd.commandkey;" oncommand="find(false);" modifiers="accel"/>
|
||||
<key id="key_findAgain" key="&findAgainCmd.commandkey;" oncommand="find(true);" modifiers="accel"/>
|
||||
<key id="key_viewSource" key="&pageSourceCmd.commandkey;" oncommand="BrowserViewSource();" modifiers="accel"/>
|
||||
<key id="key_viewInfo" key="&pageInfoCmd.commandkey;" oncommand="BrowserPageInfo();" modifiers="accel"/>
|
||||
</keyset>
|
||||
<stringbundle id="bundle_viewZoom"/>
|
||||
<stringbundle id="findBundle" src="chrome://global/locale/finddialog.properties"/>
|
||||
|
||||
<vbox flex="1">
|
||||
|
||||
|
@ -35,18 +91,16 @@
|
|||
tbalign="stretch"
|
||||
persist="collapsed">
|
||||
|
||||
<button id="helpBackButton"
|
||||
class="button-toolbar-1 top"
|
||||
label="&backBtn.label;"
|
||||
tooltiptext="&backBtn.tooltip;"
|
||||
tooltip="aTooltip"
|
||||
oncommand="goBack();"/>
|
||||
<button id="helpForwardButton"
|
||||
class="button-toolbar-1 top"
|
||||
label="&fwdBtn.label;"
|
||||
tooltiptext="&fwdBtn.tooltip;"
|
||||
tooltip="aTooltip"
|
||||
oncommand="goForward();"/>
|
||||
<menubutton id="helpBackButton" label="&backBtn.label;" tooltiptext="&backButton.tooltip;"
|
||||
oncommand="gotoHistoryIndex(event);" buttonaction="goBack();" context="backMenu"
|
||||
class="menubutton-dual top" crop="right" tooltip="aTooltip" observes="canGoBack">
|
||||
<menupopup context="" oncreate="createBackMenu(event);"/>
|
||||
</menubutton>
|
||||
<menubutton id="helpForwardButton" label="&fwdBtn.label;" tooltiptext="&forwardButton.tooltip;"
|
||||
oncommand="gotoHistoryIndex(event);" buttonaction="goForward();" context="forwardMenu"
|
||||
class="menubutton-dual top" crop="right" tooltip="aTooltip" observes="canGoForward">
|
||||
<menupopup context="" oncreate="createForwardMenu(event);"/>
|
||||
</menubutton>
|
||||
<button id="helpHomeButton"
|
||||
class="button-toolbar-1 top"
|
||||
label="&homeBtn.label;"
|
||||
|
@ -56,25 +110,18 @@
|
|||
|
||||
<spring flex="1"/>
|
||||
|
||||
<button class="button-toolbar-1" id="print" onclick="print()"/>
|
||||
|
||||
<button id="print" class="button-toolbar-1 top" label="&printButton.label;"
|
||||
tooltip="aTooltip" tooltiptext="&printButton.tooltip;" oncommand="print();"/>
|
||||
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<separator class="groovy-thin"/>
|
||||
|
||||
<!-- the two help panes (sidebar & content) -->
|
||||
<hbox flex="1">
|
||||
|
||||
<vbox id="helpsidebar-box">
|
||||
|
||||
<vbox id="help-subset">
|
||||
<!-- these we will want to clean up or style better -->
|
||||
<text value="&t1.label;"/>
|
||||
<text value="&t2.label;"/>
|
||||
<text value="&t3.label;"/>
|
||||
</vbox>
|
||||
|
||||
<separator class="thin"/>
|
||||
<tabbox orient="vertical" flex="1">
|
||||
<tabs orient="horizontal">
|
||||
<tab label="&tab1.label;"/>
|
||||
|
@ -84,7 +131,8 @@
|
|||
<hbox id="help-toc">
|
||||
<tree id="help-toc-tree" ref="urn:root" flex="1*"
|
||||
datasources="chrome://help/locale/help-toc.rdf"
|
||||
containment="http://home.netscape.com/NC-rdf#subheadings">
|
||||
containment="http://home.netscape.com/NC-rdf#subheadings"
|
||||
onselect="loadURI(this.selectedItems[0].firstChild.firstChild.getAttribute('helplink'));">>
|
||||
<template>
|
||||
<rule>
|
||||
<conditions>
|
||||
|
@ -110,8 +158,7 @@
|
|||
<treerow>
|
||||
<treecell class="treecell-indent"
|
||||
label="?name"
|
||||
helplink="?link"
|
||||
onclick="loadURI(this.getAttribute('helplink'));"/>
|
||||
helplink="?link"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
|
@ -154,8 +201,10 @@
|
|||
<hbox id="browser" flex="1">
|
||||
<!-- type attribute is used by frame construction to locate iframes
|
||||
intended to hold (html) content -->
|
||||
<browser context="context" type="content-primary" id="help-content"
|
||||
src="about:blank" flex="1"/>
|
||||
<browser context="contentAreaContextMenu" type="content-primary" id="help-content"
|
||||
src="about:blank" flex="1"
|
||||
ondraggesture="nsDragAndDrop.startDrag(event, contentAreaDNDObserver);"
|
||||
onclick="return contentAreaClick(event);"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
|
|
@ -31,8 +31,8 @@ en-US.jar:
|
|||
locale/en-US/help/using_priv_help.html (locale/en-US/using_priv_help.html)
|
||||
locale/en-US/help/using_certs_help.html (locale/en-US/using_certs_help.html)
|
||||
locale/en-US/help/validation_help.html (locale/en-US/validation_help.html)
|
||||
locale/en-US/help/content_style.css (locale/en-US/content_style.css)
|
||||
locale/en-US/help/context_help.html (locale/en-US/context_help.html)
|
||||
locale/en-US/help/content_style.css (locale/en-US/content_style.css)
|
||||
locale/en-US/help/help.dtd (locale/en-US/help.dtd)
|
||||
locale/en-US/help/helpMenuOverlay.dtd (locale/en-US/helpMenuOverlay.dtd)
|
||||
locale/en-US/help/images/anchor.gif (locale/en-US/images/anchor.gif)
|
||||
|
|
|
@ -24,6 +24,60 @@
|
|||
|
||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
||||
|
||||
#helpBackButton
|
||||
{
|
||||
list-style-image : url("chrome://navigator/skin/back.gif");
|
||||
}
|
||||
|
||||
#helpBackButton[disabled="true"],
|
||||
#helpBackButton[disabled="true"]:hover,
|
||||
#helpBackButton[disabled="true"]:hover:active,
|
||||
#helpBackButton[disabled="true"] > .menubutton-dual-ex-button:hover,
|
||||
#helpBackButton[disabled="true"] > .menubutton-dual-ex-button:hover:active
|
||||
{
|
||||
list-style-image : url("chrome://navigator/skin/back-disabled.gif");
|
||||
}
|
||||
|
||||
#helpBackButton:hover,
|
||||
#helpBackButton > .menubutton-dual-ex-button:hover,
|
||||
#helpBackButton[open="true"] > .menubutton-dual-ex-button
|
||||
{
|
||||
list-style-image : url("chrome://navigator/skin/back-hover.gif");
|
||||
}
|
||||
|
||||
#helpBackButton:hover:active,
|
||||
#helpBackButton > .menubutton-dual-ex-button:hover:active
|
||||
{
|
||||
list-style-image : url("chrome://navigator/skin/back-hover-active.gif");
|
||||
}
|
||||
|
||||
#helpForwardButton
|
||||
{
|
||||
list-style-image : url("chrome://navigator/skin/forward.gif");
|
||||
}
|
||||
|
||||
#helpForwardButton[disabled="true"],
|
||||
#helpForwardButton[disabled="true"]:hover,
|
||||
#helpForwardButton[disabled="true"]:hover:active,
|
||||
#helpForwardButton[disabled="true"] > .menubutton-dual-ex-button:hover,
|
||||
#helpForwardButton[disabled="true"] > .menubutton-dual-ex-button:hover:active
|
||||
{
|
||||
list-style-image : url("chrome://navigator/skin/forward-disabled.gif");
|
||||
}
|
||||
|
||||
#helpForwardButton:hover,
|
||||
#helpForwardButton > .menubutton-dual-ex-button:hover,
|
||||
#helpForwardButton[open="true"] > .menubutton-dual-ex-button
|
||||
{
|
||||
list-style-image : url("chrome://navigator/skin/forward-hover.gif");
|
||||
}
|
||||
|
||||
#helpForwardButton:hover:active,
|
||||
#helpForwardButton > .menubutton-dual-ex-button:hover:active
|
||||
{
|
||||
list-style-image : url("chrome://navigator/skin/forward-hover-active.gif");
|
||||
}
|
||||
|
||||
/* ::::: primary toolbar buttons ::::: */
|
||||
|
||||
#print {
|
||||
|
@ -44,3 +98,22 @@
|
|||
list-style-image: url("chrome://global/skin/print-hover-active.gif");
|
||||
}
|
||||
|
||||
#helpHomeButton
|
||||
{
|
||||
list-style-image : url("chrome://communicator/skin/bookmarks/home.gif");
|
||||
}
|
||||
|
||||
#helpHomeButton:hover
|
||||
{
|
||||
list-style-image : url("chrome://communicator/skin/bookmarks/home-hover.gif");
|
||||
}
|
||||
|
||||
#helpHomeButton:hover:active
|
||||
{
|
||||
list-style-image : url("chrome://communicator/skin/bookmarks/home-active.gif");
|
||||
}
|
||||
|
||||
#help-content
|
||||
{
|
||||
border: 1px inset ThreeDHighlight !important;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,9 @@
|
|||
margin: 0px;
|
||||
}
|
||||
|
||||
.menubutton-dual {
|
||||
-moz-binding: url("chrome://communicator/skin/widgetBindings.xml#menubutton-dual-1");
|
||||
}
|
||||
.toolbar-primary-mid-top {
|
||||
background-image: url("chrome://navigator/skin/toolbar/navbar-mid-top.gif");
|
||||
}
|
||||
|
@ -115,3 +118,7 @@
|
|||
list-style-image: url("chrome://communicator/skin/btn1/print-act.gif");
|
||||
}
|
||||
|
||||
#help-content
|
||||
{
|
||||
border: 1px inset ThreeDHighlight !important;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче