bug 359174 - Move a number of SeaMonkey URLs to branding - use urlformatted relnotes URL in menu and help, r+sr=Neil

This commit is contained in:
kairo%kairo.at 2006-11-06 16:19:12 +00:00
parent ec53054d6b
commit 3b5ea708f2
10 changed files with 184 additions and 14 deletions

View File

@ -199,9 +199,15 @@ function contentClick(event) {
if (target.href.lastIndexOf("chrome:", 0) == 0)
return true;
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var uri = target.href;
if (/^x-moz-url-link:/.test(uri))
uri = formatter.formatURLPref(RegExp.rightContext);
const loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_IS_LINK;
try {
helpExternal.webNavigation.loadURI(target.href, loadFlags, null, null, null);
helpExternal.webNavigation.loadURI(uri, loadFlags, null, null, null);
} catch (e) {}
return false;
}

103
suite/common/helpOverlay.js Normal file
View File

@ -0,0 +1,103 @@
/* ***** 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 SeaMonkey internet suite code.
*
* The Initial Developer of the Original Code is
* the SeaMonkey project at mozilla.org.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Neil Rashbrook
* Robert Kaiser <kairo@kairo.at>
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 ***** */
var helpExternal;
var helpContentListener = {
onStartURIOpen: function(aURI) {
return false;
},
doContent: function(aContentType, aIsContentPreferred, aRequest, aContentHandler) {
throw Components.results.NS_ERROR_UNEXPECTED;
},
isPreferred: function(aContentType, aDesiredContentType) {
return false;
},
canHandleContent: function(aContentType, aIsContentPreferred, aDesiredContentType) {
return false;
},
loadCookie: null,
parentContentListener: null,
QueryInterface: function (aIID) {
if (aIID.equals(Components.interfaces.nsIURIContentListener) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsISupports))
return this;
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
return null;
}
};
function initOverlay() {
helpExternal = document.getElementById("help-external");
helpExternal.docShell.useErrorPages = false;
helpExternal
.docShell
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIURIContentListener)
.parentContentListener = helpContentListener;
helpExternal.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
}
function contentClick(event) {
// is this a left click on a link?
if (event.shiftKey || event.ctrlKey || event.altKey || event.metaKey || event.button != 0)
return true;
// is this a link?
var target = event.target;
while (!(target instanceof HTMLAnchorElement))
if (!(target = target.parentNode))
return true;
// is this an internal link?
if (target.href.lastIndexOf("chrome:", 0) == 0)
return true;
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var uri = target.href;
if (/^x-moz-url-link:/.test(uri))
uri = formatter.formatURLPref(RegExp.rightContext);
const loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_IS_LINK;
try {
helpExternal.webNavigation.loadURI(uri, loadFlags, null, null, null);
} catch (e) {}
return false;
}

View File

@ -0,0 +1,55 @@
<?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 SeaMonkey internet suite code.
The Initial Developer of the Original Code is
the SeaMonkey project at mozilla.org.
Portions created by the Initial Developer are Copyright (C) 2006
the Initial Developer. All Rights Reserved.
Contributor(s):
Robert Kaiser <kairo@kairo.at>
Alternatively, the contents of this file may be used under the terms of
either of 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>
<overlay id="helpOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<window id="help" onload="init(); initOverlay();"/>
<script type="application/x-javascript" src="chrome://communicator/content/helpOverlay.js"/>
<browser id="help-content" onclick="return contentClick(event);" />
<vbox id="appcontent">
<browser type="content" id="help-external" collapsed="true"/>
</vbox>
</overlay>

View File

@ -6,6 +6,7 @@ comm.jar:
% overlay chrome://navigator/content/navigatorOverlay.xul chrome://communicator/content/permissions/permissionsNavigatorOverlay.xul
% overlay chrome://navigator/content/navigatorOverlay.xul chrome://communicator/content/permissions/cookieTasksOverlay.xul
% overlay chrome://global/content/console.xul chrome://communicator/content/consoleOverlay.xul
% overlay chrome://help/content/help.xul chrome://communicator/content/helpOverlay.xul
% overlay chrome://communicator/content/tasksOverlay.xul chrome://communicator/content/emOverlay.xul
% overlay chrome://communicator/content/pref/preftree.xul chrome://pippki/content/PrefOverlay.xul
% overlay chrome://pippki/content/certManager.xul chrome://communicator/content/helpSecurityOverlay.xul
@ -50,6 +51,8 @@ comm.jar:
content/communicator/emOverlay.xul
content/communicator/findUtils.js
content/communicator/helpSecurityOverlay.xul
content/communicator/helpOverlay.js
content/communicator/helpOverlay.xul
content/communicator/nsContextMenu.js
content/communicator/openLocation.js
content/communicator/openLocation.xul

View File

@ -371,6 +371,17 @@ function goAboutDialog()
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", 'about:' );
}
function goReleaseNotes()
{
// get release notes URL from prefs
try {
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
openTopWin(formatter.formatURLPref("app.releaseNotesURL"));
}
catch (ex) { dump(ex); }
}
// update menu items that rely on focus
function goUpdateGlobalEditMenuItems()
{

View File

@ -6,8 +6,6 @@
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!ENTITY % globalRegionDTD SYSTEM "chrome://global-region/locale/region.dtd">
%globalRegionDTD;
<!ENTITY % platformCommunicatorDTD SYSTEM "chrome://communicator-platform/locale/platformCommunicatorOverlay.dtd">
%platformCommunicatorDTD;
<!ENTITY % utilityDTD SYSTEM "chrome://communicator/locale/utilityOverlay.dtd">
@ -322,7 +320,7 @@
<menuitem accesskey="&releaseCmd.accesskey;"
label="&releaseCmd.label;"
id="releaseUrl"
oncommand="openTopWin('&releaseURL;');"/>
oncommand="goReleaseNotes();"/>
<menuseparator id="menu_HelpAboutSeparator"/>

View File

@ -3,7 +3,3 @@
<!ENTITY brandShortName "SeaMonkey">
<!ENTITY vendorShortName "SeaMonkey">
<!ENTITY sidebarName "Sidebar">
# XXX When Suite is a fully fledged xul app, this ifdef can be removed.
#ifdef MOZ_XUL_APP
#expand <!ENTITY releaseURL "http://www.mozilla.org/projects/seamonkey/releases/seamonkey__MOZ_APP_VERSION__/">
#endif

View File

@ -3,7 +3,7 @@ brandShortName=SeaMonkey
vendorShortName=SeaMonkey
sidebarName=Sidebar
extensions.getMoreLocalesURL=http://www.mozilla.org/projects/seamonkey/releases/#l10n
extensions.getMoreExtensionsURL=http://%LOCALE%.add-ons.mozilla.org/%LOCALE%/%APP%/%VERSION%/extensions/
extensions.getMoreThemesURL=http://%LOCALE%.add-ons.mozilla.org/%LOCALE%/%APP%/%VERSION%/themes/
extensions.getMoreExtensionsURL=https://%LOCALE%.add-ons.mozilla.org/%LOCALE%/%APP%/%VERSION%/extensions/
extensions.getMoreThemesURL=https://%LOCALE%.add-ons.mozilla.org/%LOCALE%/%APP%/%VERSION%/themes/
spellchecker.dictionaries.download.url=https://%LOCALE%.add-ons.mozilla.org/%LOCALE%/%APP%/%VERSION%/dictionaries/
app.releaseNotesURL=http://www.mozilla.org/projects/seamonkey/releases/seamonkey%VERSION%/

View File

@ -88,6 +88,6 @@ p:first-child { padding-top: 0; margin-top: 0; }
list-style-type: none;
}
a[href^="http://"]:after, a[href^="https://"]:after {
a[href^="http://"]:after, a[href^="https://"]:after, a[href^="x-moz-url-link:"]:after {
content: url("images/web-links.png");
}

View File

@ -3,9 +3,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
<!ENTITY % regionDTD SYSTEM "chrome://global-region/locale/region.dtd" >
%brandDTD;
%regionDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
@ -39,7 +37,7 @@
</tr>
<tr valign="top">
<td>
<p><strong><a href="&releaseURL;">Release Notes</a></strong></p>
<p><strong><a href="x-moz-url-link:app.releaseNotesURL">Release Notes</a></strong></p>
<p>Latest information about known problems or issues with
&brandShortName;.</p>