Fixing 70746: major xul syntax changes. If you use xul, this WILL affect you! Read n.p.m.xpfe for details on the changes and how you can fix your code. r=hewitt sr=hyatt, ben

This commit is contained in:
blakeross%telocity.com 2006-07-29 05:36:28 +00:00
parent 066e77a947
commit f17b66929d
9 changed files with 209 additions and 209 deletions

View File

@ -46,122 +46,122 @@
ondestroy="contextMenu.onDestroy(); contextMenu = null;">
<!-- Open ==================================== -->
<menuitem id="context-openlink"
value="&openLinkCmd.label;"
label="&openLinkCmd.label;"
accesskey=""
oncommand="contextMenu.openLink();"/>
<!-- XXX - DEPENDENT ON PRESENCE OF EDITOR!! - XXX -->
<menuitem id="context-editlink"
value="&editLinkCmd.label;"
label="&editLinkCmd.label;"
accesskey=""
oncommand="contextMenu.editLink();"/>
<menuitem id="context-openframe"
value="&openFrameCmd.label;"
label="&openFrameCmd.label;"
accesskey=""
oncommand="contextMenu.openFrame();"/>
<menuitem id="context-showonlythisframe"
value="&showOnlyThisFrameCmd.label;"
label="&showOnlyThisFrameCmd.label;"
accesskey="&showOnlyThisFrameCmd.accesskey;"
oncommand="contextMenu.showOnlyThisFrame();"/>
<menuseparator id="context-sep-open"/>
<!-- Navigation ============================== -->
<menuitem id="context-back"
value="&goBackCmd.label;"
label="&goBackCmd.label;"
accesskey="&goBackCmd.accesskey;"
oncommand="BrowserBack()"/>
<menuitem id="context-forward"
value="&goForwardCmd.label;"
label="&goForwardCmd.label;"
accesskey="&goForwardCmd.accesskey;"
oncommand="BrowserForward()"/>
<menuitem id="context-reload"
value="&reloadCmd.label;"
label="&reloadCmd.label;"
accesskey="&reloadCmd.accesskey;"
oncommand="BrowserReload();"/>
<menuitem id="context-reload-frame"
value="&reloadFrameCmd.label;"
label="&reloadFrameCmd.label;"
accesskey="&reloadFrameCmd.accesskey;"
oncommand="contextMenu.reloadFrame();"/>
<menuitem id="context-stop"
value="&stopCmd.label;"
label="&stopCmd.label;"
accesskey=""
oncommand="BrowserStop();"/>
<menuseparator id="context-sep-navigation"/>
<!-- View ==================================== -->
<menuitem id="context-viewsource"
value="&viewPageSourceCmd.label;"
label="&viewPageSourceCmd.label;"
accesskey=""
oncommand="BrowserViewSource();"/>
<menuitem id="context-viewframesource"
value="&viewFrameSourceCmd.label;"
label="&viewFrameSourceCmd.label;"
accesskey=""
oncommand="contextMenu.viewFrameSource();"/>
<menuitem id="context-viewinfo"
value="&viewPageInfoCmd.label;"
label="&viewPageInfoCmd.label;"
accesskey=""
oncommand="contextMenu.viewInfo();"/>
<menuitem id="context-viewframeinfo"
value="&viewFrameInfoCmd.label;"
label="&viewFrameInfoCmd.label;"
accesskey=""
oncommand="contextMenu.viewFrameInfo();"/>
<menuitem id="context-viewimage"
value="&viewImageCmd.label;"
label="&viewImageCmd.label;"
accesskey=""
oncommand="contextMenu.viewImage();"/>
<menuseparator id="context-sep-view"/>
<!-- Misc ==================================== -->
<menuitem id="context-bookmarkpage"
value="&bookmarkPageCmd.label;"
label="&bookmarkPageCmd.label;"
accesskey="&bookmarkPageCmd.accesskey;"
oncommand="BookmarksUtils.addBookmarkForBrowser(document.getElementById('content').webNavigation);"/>
<menuitem id="context-bookmarklink"
value="&bookmarkLinkCmd.label;"
label="&bookmarkLinkCmd.label;"
accesskey="&bookmarkLinkCmd.accesskey;"
oncommand="BookmarksUtils.addBookmark(contextMenu.linkURL(),
contextMenu.linkText());"/>
<menuseparator id="context-sep-bookmark"/>
<!-- Save ==================================== -->
<menuitem id="context-savepage"
value="&savePageCmd.label;"
label="&savePageCmd.label;"
accesskey="&savePageCmd.accesskey;"
oncommand="contextMenu.savePage();"/>
<menuitem id="context-saveframe"
value="&saveFrameCmd.label;"
label="&saveFrameCmd.label;"
accesskey="&saveFrameCmd.accesskey;"
oncommand="contextMenu.saveFrame();"/>
<menuitem id="context-savelink"
value="&saveLinkCmd.label;"
label="&saveLinkCmd.label;"
accesskey="&saveLinkCmd.accesskey;"
oncommand="contextMenu.saveLink();"/>
<menuitem id="context-saveimage"
accesskey="&saveImageCmd.accesskey;"
oncommand="contextMenu.saveImage();"/>
<menuitem id="context-savebgimage"
value="&saveBGImageCmd.label;"
label="&saveBGImageCmd.label;"
accesskey="&saveBGImageCmd.accesskey;"
oncommand="contextMenu.saveBGImage();"/>
<menuseparator id="context-sep-save"/>
<!-- Clipboard =============================== -->
<menuitem id="context-selectall"
value="&selectAllCmd.label;"
label="&selectAllCmd.label;"
accesskey="&selectAllCmd.accesskey;"
observes="cmd_selectAll"/>
<menuitem id="context-cut"
value="&cutCmd.label;"
label="&cutCmd.label;"
accesskey="&cutCmd.accesskey;"
observes="cmd_cut"/>
<menuitem id="context-copy"
value="&copyCmd.label;"
label="&copyCmd.label;"
accesskey="&copyCmd.accesskey;"
observes="cmd_copy"/>
<menuitem id="context-paste"
value="&pasteCmd.label;"
label="&pasteCmd.label;"
accesskey="&pasteCmd.accesskey;"
observes="cmd_paste"/>
<menuitem id="context-copylink"
value="&copyLinkCmd.label;"
label="&copyLinkCmd.label;"
accesskey="&copyLinkCmd.accesskey;"
oncommand="contextMenu.copyLink();"/>
<menuitem id="context-copyimage"
value="&copyImageCmd.label;"
label="&copyImageCmd.label;"
accesskey="&copyImageCmd.accesskey;"
oncommand="contextMenu.copyImage();"/>
</popup>

View File

@ -10,15 +10,15 @@
* 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 Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Contributor(s):
* William A. ("PowerGUI") Law <law@netscape.com>
* Blake Ross <blakeross@telocity.com>
*/
@ -61,7 +61,7 @@ nsContextMenu.prototype = {
// Get contextual info.
this.setTarget( document.popupNode );
// Initialize (disable/remove) menu items.
this.initItems();
},
@ -77,50 +77,50 @@ nsContextMenu.prototype = {
// Remove open/edit link if not applicable.
this.showItem( "context-openlink", this.onSaveableLink || ( this.inDirList && this.onLink ) );
this.showItem( "context-editlink", this.onSaveableLink && !this.inDirList );
// Remove open frame if not applicable.
this.showItem( "context-openframe", this.inFrame );
this.showItem( "context-showonlythisframe", this.inFrame );
// Remove separator after open items if neither link nor frame.
this.showItem( "context-sep-open", this.onSaveableLink || ( this.inDirList && this.onLink ) || this.inFrame );
},
initNavigationItems : function () {
// Back determined by canGoBack broadcaster.
this.setItemAttrFromNode( "context-back", "disabled", "canGoBack" );
// Forward determined by canGoForward broadcaster.
this.setItemAttrFromNode( "context-forward", "disabled", "canGoForward" );
// Reload is OK if not on a frame; vice-versa for reload-frame.
this.showItem( "context-reload", !this.inFrame );
this.showItem( "context-reload-frame", this.inFrame );
// XXX: Stop is determined in navigator.js; the canStop broadcaster is broken
//this.setItemAttrFromNode( "context-stop", "disabled", "canStop" );
},
initSaveItems : function () {
// Save page is always OK, unless in directory listing.
this.showItem( "context-savepage", !this.inDirList );
// Save frame as depends on whether we're in a frame.
this.showItem( "context-saveframe", this.inFrame );
// Save link depends on whether we're in a link.
this.showItem( "context-savelink", this.onSaveableLink );
// Save background image depends on whether there is one.
this.showItem( "context-savebgimage", this.hasBGImage );
// Save image depends on whether there is one.
this.showItem( "context-saveimage", this.onImage );
if (this.onImage){ //if onImage, let's get the imagename into the context menu
if (this.onImage){ //if onImage, let's get the imagename into the context menu
var saveImageMenuItem = document.getElementById( 'context-saveimage' );
var imageName = extractFileNameFromUrl(this.imageURL);
var bundle = srGetStrBundle("chrome://communicator/locale/contentAreaCommands.properties");
var caption = bundle.formatStringFromName("saveImageAs",[imageName],1);
saveImageMenuItem.setAttribute( "value", caption );
saveImageMenuItem.setAttribute( "label", caption );
}
// Remove separator if none of these were shown.
@ -130,16 +130,16 @@ nsContextMenu.prototype = {
initViewItems : function () {
// View source is always OK, unless in directory listing.
this.showItem( "context-viewsource", !this.inDirList );
// View frame source depends on whether we're in a frame.
this.showItem( "context-viewframesource", this.inFrame );
// View Info is available, unless in directory listing
this.showItem( "context-viewinfo", !this.inDirList );
// View Frame Info depends on whether we're in a frame
this.showItem( "context-viewframeinfo", this.inFrame );
// View Image depends on whether an image was clicked on.
this.showItem( "context-viewimage", this.onImage );
@ -150,14 +150,14 @@ nsContextMenu.prototype = {
// Use "Bookmark This Link" if on a link.
this.showItem( "context-bookmarkpage", !this.onLink );
this.showItem( "context-bookmarklink", this.onLink );
// Send Page not working yet.
this.showItem( "context-sendpage", false );
},
initClipboardItems : function () {
// Select All is always OK, unless in directory listing.
this.showItem( "context-selectall", !this.inDirList );
// Copy depends on whether there is selected text.
// Enabling this context menu item is now done through the global
// command updating system
@ -168,10 +168,10 @@ nsContextMenu.prototype = {
// Items for text areas
this.showItem( "context-cut", this.onTextInput );
this.showItem( "context-paste", this.onTextInput );
// Copy link location depends on whether we're on a link.
this.showItem( "context-copylink", this.onLink );
// Copy image location depends on whether we're on an image.
this.showItem( "context-copyimage", this.onImage );
},
@ -187,7 +187,7 @@ nsContextMenu.prototype = {
// Remember the node that was clicked.
this.target = node;
// See if the user clicked on an image.
if ( this.target.nodeType == 1 ) {
if ( this.target.tagName.toUpperCase() == "IMG" ) {
@ -231,7 +231,7 @@ nsContextMenu.prototype = {
}
}
}
}
}
} else if ( this.target.tagName.toUpperCase() == "OBJECT"
&&
// See if object tag is for an image.
@ -271,28 +271,28 @@ nsContextMenu.prototype = {
}
// Build pseudo link object so link-related functions work.
this.onLink = true;
this.link = { href : root.getAttribute("URL") };
this.link = { href : root.getAttribute("URL") };
// If element is a directory, then you can't save it.
if ( root.getAttribute( "container" ) == "true" ) {
this.onSaveableLink = false;
} else {
this.onSaveableLink = true;
this.onSaveableLink = true;
}
} else {
root = root.parentNode;
}
}
} else if ( this.target.parentNode.tagName == "scrollbar"
} else if ( this.target.parentNode.tagName == "scrollbar"
||
this.target.parentNode.tagName == "thumb"
||
this.target.parentNode.tagName == "thumb"
||
this.target.parentNode.tagName == "xul:slider") {
this.shouldDisplay = false;
} else {
try {
var cssAttr = this.target.style.getPropertyValue( "list-style-image" ) ||
this.target.style.getPropertyValue( "list-style" ) ||
this.target.style.getPropertyValue( "background-image" ) ||
this.target.style.getPropertyValue( "list-style" ) ||
this.target.style.getPropertyValue( "background-image" ) ||
this.target.style.getPropertyValue( "background" );
if ( cssAttr ) {
this.onImage = true;
@ -304,7 +304,7 @@ nsContextMenu.prototype = {
}
}
}
// See if the user clicked in a frame.
if ( this.target.ownerDocument != window._content.document ) {
this.inFrame = true;
@ -320,12 +320,12 @@ nsContextMenu.prototype = {
}
elem = elem.parentNode;
}
// Bubble out, looking for link.
elem = this.target;
while ( elem && !this.onLink ) {
// Test for element types of interest.
if ( elem.nodeType == 1 &&
if ( elem.nodeType == 1 &&
( elem.tagName.toUpperCase() == "A"
||
elem.tagName.toUpperCase() == "AREA"
@ -354,7 +354,7 @@ nsContextMenu.prototype = {
if (protocol) {
protocol = protocol.substr( 0, 11 );
}
}
}
return protocol.toLowerCase() != "javascript:";
} else {
// Presume all but javascript: urls are saveable.
@ -497,14 +497,14 @@ nsContextMenu.prototype = {
cloneNode : function ( item ) {
// Create another element like the one we're cloning.
var node = document.createElement( item.tagName );
// Copy attributes from argument item to the new one.
var attrs = item.attributes;
for ( var i = 0; i < attrs.length; i++ ) {
var attr = attrs.item( i );
node.setAttribute( attr.nodeName, attr.nodeValue );
}
// Voila!
return node;
},
@ -600,7 +600,7 @@ nsContextMenu.prototype = {
// other OS's will probably map to a no-op.
var transferableForSelection = this.createInstance( "@mozilla.org/widget/transferable;1",
"nsITransferable" );
if ( clipboard && transferableForSelection ) {
transferableForSelection.addDataFlavor( "text/unicode" );
// Create wrapper for text.
@ -610,7 +610,7 @@ nsContextMenu.prototype = {
selectionData.data = text;
transferableForSelection.setTransferData( "text/unicode", selectionData, text.length * 2 );
// Put on clipboard.
clipboard.setData( transferableForSelection, null,
clipboard.setData( transferableForSelection, null,
Components.interfaces.nsIClipboard.kSelectionClipboard );
}
}

View File

@ -33,10 +33,10 @@ try {
// not critical, remain silent
}
function onLoad()
function onLoad()
{
bundle = srGetStrBundle("chrome://communicator/locale/openLocation.properties");
dialog = new Object;
dialog.input = document.getElementById("dialog.input");
dialog.help = document.getElementById("dialog.help");
@ -44,54 +44,54 @@ function onLoad()
dialog.openAppList = document.getElementById("openAppList");
dialog.openTopWindow = document.getElementById("currentWindow");
dialog.openEditWindow = document.getElementById("editWindow");
browser = window.arguments[0];
if (!browser) {
// No browser supplied - we are calling from Composer
dialog.openAppList.selectedItem = dialog.openEditWindow;
dialog.openTopWindow.setAttribute("disabled", "true");
}
}
else {
dialog.openAppList.selectedItem = dialog.openTopWindow;
}
// change OK button text to 'open'
dialog.open.setAttribute("value", bundle.GetStringFromName("openButtonLabel"));
dialog.open.label = bundle.GetStringFromName("openButtonLabel");
doSetOKCancel(open, 0, 0, 0);
dialog.input.focus();
if (pref) {
try {
var data = pref.GetIntPref("general.open_location.last_window_choice");
var element = dialog.openAppList.getElementsByAttribute("data", data)[0];
var value = pref.GetIntPref("general.open_location.last_window_choice");
var element = dialog.openAppList.getElementsByAttribute("value", value)[0];
if (element)
dialog.openAppList.selectedItem = element;
dialog.input.value = pref.CopyUnicharPref("general.open_location.last_url");
dialog.input.value = pref.CopyUnicharPref("general.open_location.last_url");
}
catch(ex) {
}
if (dialog.input.value)
dialog.input.select(); // XXX should probably be done automatically
}
doEnabling();
}
function doEnabling()
function doEnabling()
{
dialog.open.disabled = !dialog.input.value;
}
function open()
function open()
{
var url = browser.getShortcutOrURI(dialog.input.value);
try {
switch (dialog.openAppList.data) {
switch (dialog.openAppList.value) {
case "0":
browser.loadURI(url);
break;
case "1":
case "1":
window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no", url);
break;
case "2":
@ -103,10 +103,10 @@ function open()
}
catch(exception) {
}
if (pref) {
pref.SetUnicharPref("general.open_location.last_url", dialog.input.value);
pref.SetIntPref("general.open_location.last_window_choice", dialog.openAppList.data);
pref.SetIntPref("general.open_location.last_window_choice", dialog.openAppList.value);
}
// Delay closing slightly to avoid timing bug on Linux.
@ -114,20 +114,20 @@ function open()
return false;
}
function createInstance(contractid, iidName)
function createInstance(contractid, iidName)
{
var iid = Components.interfaces[iidName];
return Components.classes[contractid].createInstance(iid);
}
const nsIFilePicker = Components.interfaces.nsIFilePicker;
function onChooseFile()
function onChooseFile()
{
try {
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
fp.init(window, bundle.GetStringFromName("chooseFileDialogTitle"), nsIFilePicker.modeOpen);
if (dialog.openAppList.data == "2") {
if (dialog.openAppList.value == "2") {
// When loading into Composer, direct user to prefer HTML files and text files,
// so we call separately to control the order of the filter list
fp.appendFilters(nsIFilePicker.filterHTML | nsIFilePicker.filterText);
@ -135,7 +135,7 @@ function onChooseFile()
fp.appendFilters(nsIFilePicker.filterAll);
}
else {
fp.appendFilters(nsIFilePicker.filterHTML | nsIFilePicker.filterText |
fp.appendFilters(nsIFilePicker.filterHTML | nsIFilePicker.filterText |
nsIFilePicker.filterAll | nsIFilePicker.filterImages | nsIFilePicker.filterXML);
}
@ -143,6 +143,6 @@ function onChooseFile()
dialog.input.value = fp.fileURL.spec;
}
catch(ex) {
}
doEnabling();
}
doEnabling();
}

View File

@ -65,16 +65,16 @@
<box autostretch="never">
<textbox id="dialog.input" flex="1" oninput="doEnabling();"/>
<button value="&chooseFile.label;" onclick="onChooseFile();"/>
<button label="&chooseFile.label;" onclick="onChooseFile();"/>
</box>
<box autostretch="never" valign="center">
<text class="label" value="&openWhere.label;"/>
<menulist id="openAppList">
<menupopup>
<menuitem data="0" id="currentWindow" value="&topWindow.label;"/>
<menuitem data="1" value="&newWindow.label;"/>
<menuitem value="0" id="currentWindow" label="&topWindow.label;"/>
<menuitem value="1" label="&newWindow.label;"/>
<menuseparator/>
<menuitem data="2" id="editWindow" value="&editNewWindow.label;"/>
<menuitem value="2" id="editWindow" label="&editNewWindow.label;"/>
</menupopup>
</menulist>
<spring flex="1"/>

View File

@ -28,18 +28,18 @@
</keyset>
<broadcasterset id="broadcasterset">
<broadcaster id="Tasks:Navigator" value="&navigatorCmd.label;" oncommand="toNavigator();"/>
<broadcaster id="Tasks:Editor" value="&editorCmd.label;" oncommand="toEditor();"/>
<broadcaster id="Tasks:AddressBook" value="&addressBookCmd.label;" oncommand="toAddressBook();"/>
<broadcaster id="Tasks:Navigator" label="&navigatorCmd.label;" oncommand="toNavigator();"/>
<broadcaster id="Tasks:Editor" label="&editorCmd.label;" oncommand="toEditor();"/>
<broadcaster id="Tasks:AddressBook" label="&addressBookCmd.label;" oncommand="toAddressBook();"/>
</broadcasterset>
<!-- Tasks Menu -->
<menu id="tasksMenu" value="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;" datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot">
<menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;" datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot">
<template>
<rule>
<menupopup>
<menuitem uri="rdf:*" value="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="ShowWindowFromResource(event.target)"/>
<menuitem uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="ShowWindowFromResource(event.target)"/>
</menupopup>
</rule>
</template>
@ -53,19 +53,19 @@
<menuseparator/>
<menu value="&privacyMenu.label;" accesskey="&privacyMenu.accesskey;">
<menu label="&privacyMenu.label;" accesskey="&privacyMenu.accesskey;">
<menupopup id="personalManagers">
<menuitem id="lastInPersonalManagers" style="display:none;"/>
</menupopup>
</menu>
<menuseparator/>
<menu value="&toolsMenu.label;" accesskey="&toolsMenu.accesskey;">
<menu label="&toolsMenu.label;" accesskey="&toolsMenu.accesskey;">
<menupopup id="toolsPopup" oncreate="javaItemEnabling();">
<menuitem value="&historyCmd.label;" accesskey="&historyCmd.accesskey;" oncommand="toHistory()" key="key_gotoHistory"/>
<menuitem value="&importUtilCmd.label;" accesskey="&importUtilCmd.accesskey;" oncommand="toImport()"/>
<menuitem id="java" value="&javaConsoleCmd.label;" accesskey="&javaConsoleCmd.accesskey;" oncommand="toJavaConsole()"/>
<menuitem value="&javaScriptConsoleCmd.label;" accesskey="&javaScriptConsoleCmd.accesskey;" oncommand="toJavaScriptConsole();"/>
<menuitem label="&historyCmd.label;" accesskey="&historyCmd.accesskey;" oncommand="toHistory()" key="key_gotoHistory"/>
<menuitem label="&importUtilCmd.label;" accesskey="&importUtilCmd.accesskey;" oncommand="toImport()"/>
<menuitem id="java" label="&javaConsoleCmd.label;" accesskey="&javaConsoleCmd.accesskey;" oncommand="toJavaConsole()"/>
<menuitem label="&javaScriptConsoleCmd.label;" accesskey="&javaScriptConsoleCmd.accesskey;" oncommand="toJavaScriptConsole();"/>
</menupopup>
</menu>
<menuseparator/>

View File

@ -31,25 +31,25 @@
**/
function setOfflineStatus(aToggleFlag)
{
var ioService = nsJSComponentManager.getServiceByID("{9ac9e770-18bc-11d3-9337-00104ba0fd40}",
var ioService = nsJSComponentManager.getServiceByID("{9ac9e770-18bc-11d3-9337-00104ba0fd40}",
"nsIIOService");
var broadcaster = document.getElementById("Communicator:WorkMode");
if (aToggleFlag)
ioService.offline = !ioService.offline;
var bundle = srGetStrBundle("chrome://communicator/locale/utilityOverlay.properties");
var bundle = srGetStrBundle("chrome://communicator/locale/utilityOverlay.properties");
if (ioService.offline && broadcaster)
{
broadcaster.setAttribute("offline", "true");
broadcaster.setAttribute("tooltiptext", bundle.GetStringFromName("offlineTooltip"));
broadcaster.setAttribute("value", bundle.GetStringFromName("goonline"));
broadcaster.setAttribute("label", bundle.GetStringFromName("goonline"));
FillInTooltip(broadcaster);
}
else if (broadcaster)
{
broadcaster.removeAttribute("offline");
broadcaster.setAttribute("tooltiptext", bundle.GetStringFromName("onlineTooltip"));
broadcaster.setAttribute("value", bundle.GetStringFromName("gooffline"));
broadcaster.setAttribute("label", bundle.GetStringFromName("gooffline"));
FillInTooltip(broadcaster);
}
}
@ -82,10 +82,10 @@ function goPageSetup()
function goEditCardDialog(abURI, card, okCallback)
{
window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul",
"",
"chrome,resizeable=no,modal,titlebar",
{abURI:abURI, card:card, okCallback:okCallback});
window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul",
"",
"chrome,resizeable=no,modal,titlebar",
{abURI:abURI, card:card, okCallback:okCallback});
}
function goPreferences(containerID, paneURL, itemID)
@ -99,52 +99,52 @@ function goPreferences(containerID, paneURL, itemID)
prefWindowModalityPref = true;
}
var modality = prefWindowModalityPref ? "yes" : "no";
var prefWindow = openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, containerID, itemID);
}
function goToggleToolbar( id, elementID )
{
var toolbar = document.getElementById( id );
var element = document.getElementById( elementID );
if ( toolbar )
{
var attribValue = toolbar.getAttribute("hidden") ;
if ( attribValue == "true" )
{
toolbar.setAttribute("hidden", "false" );
if ( element )
element.setAttribute("checked","true")
}
else
{
toolbar.setAttribute("hidden", true );
if ( element )
element.setAttribute("checked","false")
}
document.persist(id, 'hidden');
document.persist(elementID, 'checked');
}
var toolbar = document.getElementById( id );
var element = document.getElementById( elementID );
if ( toolbar )
{
var attribValue = toolbar.getAttribute("hidden") ;
if ( attribValue == "true" )
{
toolbar.setAttribute("hidden", "false" );
if ( element )
element.setAttribute("checked","true")
}
else
{
toolbar.setAttribute("hidden", true );
if ( element )
element.setAttribute("checked","false")
}
document.persist(id, 'hidden');
document.persist(elementID, 'checked');
}
}
function goClickThrobber( urlPref )
{
var url;
try {
var pref = Components.classes["@mozilla.org/preferences;1"].getService();
if( pref )
pref = pref.QueryInterface( Components.interfaces.nsIPref );
url = pref.getLocalizedUnicharPref(urlPref);
}
var url;
try {
var pref = Components.classes["@mozilla.org/preferences;1"].getService();
if( pref )
pref = pref.QueryInterface( Components.interfaces.nsIPref );
url = pref.getLocalizedUnicharPref(urlPref);
}
catch(e) {
url = null;
}
catch(e) {
url = null;
}
if ( url )
openTopWin(url);
if ( url )
openTopWin(url);
}
@ -164,26 +164,26 @@ function openTopWin( url )
needs to use this function with chrome controls */
/* also, do we want to limit the number of help windows that can be spawned? */
if ((url == null) || (url == "")) return;
// xlate the URL if necessary
if (url.indexOf("urn:") == 0)
{
url = xlateURL(url); // does RDF urn expansion
}
// avoid loading "", since this loads a directory listing
if (url == "") {
url = "about:blank";
}
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
var topWindowOfType = windowManagerInterface.getMostRecentWindow( "navigator:browser" );
if ( topWindowOfType )
{
topWindowOfType.focus();
topWindowOfType._content.location.href = url;
topWindowOfType._content.location.href = url;
}
else
{
@ -204,42 +204,42 @@ function goAboutDialog()
defaultAboutState = false;
}
if( defaultAboutState )
window.openDialog("chrome:global/content/about.xul", "About", "modal,chrome,resizable=yes,height=450,width=550");
else
window.openDialog("chrome:global/content/about.xul", "About", "modal,chrome,resizable=yes,height=450,width=550");
else
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", 'chrome://global/locale/about.html' );
}
function goUpdateGlobalEditMenuItems()
{
goUpdateCommand('cmd_undo');
goUpdateCommand('cmd_redo');
goUpdateCommand('cmd_cut');
goUpdateCommand('cmd_copy');
goUpdateCommand('cmd_paste');
goUpdateCommand('cmd_selectAll');
goUpdateCommand('cmd_delete');
goUpdateCommand('cmd_undo');
goUpdateCommand('cmd_redo');
goUpdateCommand('cmd_cut');
goUpdateCommand('cmd_copy');
goUpdateCommand('cmd_paste');
goUpdateCommand('cmd_selectAll');
goUpdateCommand('cmd_delete');
}
// update menu items that rely on the current selection
function goUpdateSelectEditMenuItems()
{
goUpdateCommand('cmd_cut');
goUpdateCommand('cmd_copy');
goUpdateCommand('cmd_delete');
goUpdateCommand('cmd_cut');
goUpdateCommand('cmd_copy');
goUpdateCommand('cmd_delete');
}
// update menu items that relate to undo/redo
function goUpdateUndoEditMenuItems()
{
goUpdateCommand('cmd_undo');
goUpdateCommand('cmd_redo');
goUpdateCommand('cmd_undo');
goUpdateCommand('cmd_redo');
}
// update menu items that depend on clipboard contents
function goUpdatePasteMenuItems()
{
goUpdateCommand('cmd_paste');
goUpdateCommand('cmd_paste');
}
// This used to be BrowserNewEditorWindow in navigator.js
@ -301,7 +301,7 @@ function editPage(url, launchWindow, delay)
}
}
}
// Create new Composer window
if (delay)
launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url);

View File

@ -19,8 +19,8 @@
<script type="application/x-javascript" src="chrome://communicator/content/builtinURLs.js"/>
<!-- online/offline status indicators -->
<broadcasterset id="broadcasterset">
<broadcaster id="Communicator:WorkMode" value="&offlineGoOfflineCmd.label;" oncommand="setOfflineStatus(true);"/>
<broadcasterset id="broadcasterset">
<broadcaster id="Communicator:WorkMode" label="&offlineGoOfflineCmd.label;" oncommand="setOfflineStatus(true);"/>
</broadcasterset>
<statusbarpanel id="offline-status" tooltip="aTooltip" observes="Communicator:WorkMode"/>
<menuitem id="offlineGoOfflineCmd" accesskey="&offlineGoOfflineCmd.accesskey;" observes="Communicator:WorkMode"/>
@ -34,27 +34,27 @@
<!-- NOT IMPLEMENTED, so temporarily disabled -->
<broadcaster id="cmd_newEditorTemplate" disabled="true" oncommand="NewEditorFromTemplate();"/>
<broadcaster id="cmd_newEditorDraft" disabled="true" oncommand="NewEditorFromDraft();"/>
<broadcaster id="cmd_pageSetup" value="&pageSetupCmd.label;" disabled="true" oncommand="goPageSetup();"/>
<broadcaster id="cmd_pageSetup" label="&pageSetupCmd.label;" disabled="true" oncommand="goPageSetup();"/>
<menuitem id="menu_newEditor" value="&newBlankPageCmd.label;" accesskey="&newBlankPageCmd.accesskey;" key="key_newBlankPage" observes="cmd_newEditor"/>
<menuitem id="menu_newEditorTemplate" value="&newPageFromTemplateCmd.label;" accesskey="&newPageFromTemplateCmd.accesskey;" observes="cmd_newEditorTemplate"/>
<menuitem id="menu_newEditorDraft" value="&newPageFromDraftCmd.label;" accesskey="&newPageFromDraftCmd.accesskey;" observes="cmd_newEditorDraft"/>
<menuitem id="menu_newEditor" label="&newBlankPageCmd.label;" accesskey="&newBlankPageCmd.accesskey;" key="key_newBlankPage" observes="cmd_newEditor"/>
<menuitem id="menu_newEditorTemplate" label="&newPageFromTemplateCmd.label;" accesskey="&newPageFromTemplateCmd.accesskey;" observes="cmd_newEditorTemplate"/>
<menuitem id="menu_newEditorDraft" label="&newPageFromDraftCmd.label;" accesskey="&newPageFromDraftCmd.accesskey;" observes="cmd_newEditorDraft"/>
<menu id="menu_New" value="&newMenu.label;" accesskey="&newMenu.accesskey;"/>
<menuitem id="menu_newNavigator" value="&newNavigatorCmd.label;" accesskey="&newNavigatorCmd.accesskey;" key="key_newNavigator" observes="cmd_newNavigator"/>
<menu id="menu_New" label="&newMenu.label;" accesskey="&newMenu.accesskey;"/>
<menuitem id="menu_newNavigator" label="&newNavigatorCmd.label;" accesskey="&newNavigatorCmd.accesskey;" key="key_newNavigator" observes="cmd_newNavigator"/>
<key id="key_newBlankPage" key="&newBlankPageCmd.key;" observes="cmd_newEditor" modifiers="accel, shift"/>
<key id="key_newNavigator" key="&newNavigatorCmd.key;" observes="cmd_newNavigator" modifiers="accel"/>
<key id="key_newBlankPage" key="&newBlankPageCmd.key;" observes="cmd_newEditor" modifiers="accel, shift"/>
<key id="key_newNavigator" key="&newNavigatorCmd.key;" observes="cmd_newNavigator" modifiers="accel"/>
<!-- Edit Menu -->
<menu id="menu_Edit" value="&editMenu.label;" accesskey="&editMenu.accesskey;"/>
<menuitem id="menu_undo" value="&undoCmd.label;" key="key_undo" accesskey="&undoCmd.accesskey;" observes="cmd_undo"/>
<menuitem id="menu_redo" value="&redoCmd.label;" key="key_redo" accesskey="&redoCmd.accesskey;" observes="cmd_redo"/>
<menuitem id="menu_cut" value="&cutCmd.label;" key="key_cut" accesskey="&cutCmd.accesskey;" observes="cmd_cut"/>
<menuitem id="menu_copy" value="&copyCmd.label;" key="key_copy" accesskey="&copyCmd.accesskey;" observes="cmd_copy"/>
<menuitem id="menu_paste" value="&pasteCmd.label;" key="key_paste" accesskey="&pasteCmd.accesskey;" observes="cmd_paste"/>
<menuitem id="menu_delete" value="&deleteCmd.label;" key="key_delete" accesskey="&deleteCmd.accesskey;" observes="cmd_delete"/>
<menuitem id="menu_selectAll" value="&selectAllCmd.label;" key="key_selectAll" accesskey="&selectAllCmd.accesskey;" observes="cmd_selectAll"/>
<menuitem id="menu_undo" label="&undoCmd.label;" key="key_undo" accesskey="&undoCmd.accesskey;" observes="cmd_undo"/>
<menuitem id="menu_redo" label="&redoCmd.label;" key="key_redo" accesskey="&redoCmd.accesskey;" observes="cmd_redo"/>
<menuitem id="menu_cut" label="&cutCmd.label;" key="key_cut" accesskey="&cutCmd.accesskey;" observes="cmd_cut"/>
<menuitem id="menu_copy" label="&copyCmd.label;" key="key_copy" accesskey="&copyCmd.accesskey;" observes="cmd_copy"/>
<menuitem id="menu_paste" label="&pasteCmd.label;" key="key_paste" accesskey="&pasteCmd.accesskey;" observes="cmd_paste"/>
<menuitem id="menu_delete" label="&deleteCmd.label;" key="key_delete" accesskey="&deleteCmd.accesskey;" observes="cmd_delete"/>
<menuitem id="menu_selectAll" label="&selectAllCmd.label;" key="key_selectAll" accesskey="&selectAllCmd.accesskey;" observes="cmd_selectAll"/>
<!-- These key nodes are here only for show. -->
<!-- The real bindings come from XBL, in platformHTMLBindings.xml. -->
@ -112,7 +112,7 @@
<!-- Not needed yet, window just needs a broadcaster with this id and oncommand= broadcaster id="cmd_preferences"/-->
<menuitem id="menu_preferences"
value="&preferencesCmd.label;"
label="&preferencesCmd.label;"
key="key_preferences"
accesskey="&preferencesCmd.accesskey;"
observes="cmd_preferences"/>
@ -121,23 +121,23 @@
<!-- View Menu -->
<menu id="menu_View" value="&viewMenu.label;" accesskey="&viewMenu.accesskey;"/>
<menu id="menu_Toolbars" value="&viewToolbarsMenu.label;" accesskey="&viewToolbarsMenu.accesskey;"/>
<menu id="menu_View" label="&viewMenu.label;" accesskey="&viewMenu.accesskey;"/>
<menu id="menu_Toolbars" label="&viewToolbarsMenu.label;" accesskey="&viewToolbarsMenu.accesskey;"/>
<menuitem id="menu_showTaskbar"
value="&showTaskbarCmd.label;"
label="&showTaskbarCmd.label;"
accesskey="&showTaskbarCmd.accesskey;"
oncommand="goToggleToolbar('taskbar', 'menu_showTaskbar')"
checked="true"/>
<!-- Help Menu -->
<menu id="menu_Help" value="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
<menu id="menu_Help" label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
<menupopup id="helpPopup">
<menuitem accesskey="&releaseCmd.accesskey;" value="&releaseCmd.label;"
<menuitem accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;"
id="releaseUrl" oncommand="openTopWin('&releaseURL;');"/>
<menuseparator/>
<menuitem class="about" accesskey="&aboutCommPluginsCmd.accesskey;" value="&aboutCommPluginsCmd.label;"
<menuitem class="about" accesskey="&aboutCommPluginsCmd.accesskey;" label="&aboutCommPluginsCmd.label;"
id="pluginInfo" oncommand="openTopWin('about:plugins')"/>
<menuitem accesskey="&aboutCmd.accesskey;" value="&aboutCmd.label;"
<menuitem accesskey="&aboutCmd.accesskey;" label="&aboutCmd.label;"
id="aboutName" oncommand="goAboutDialog();"/>
</menupopup>
</menu>

View File

@ -4,27 +4,27 @@
* 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 this file as it was released upon
* January 6, 2001.
*
*
* The Initial Developer of the Original Code is Peter Annema.
* Portions created by Peter Annema are Copyright (C) 2000
* Peter Annema. All Rights Reserved.
*
*
* Contributor(s):
* Peter Annema <disttsc@bart.nl> (Original Author)
* Jonas Sicking <sicking@bigfoot.com>
*
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
@ -246,10 +246,10 @@ function registerZoomManager()
else
label = zoom.bundle.getString("label");
menuItem.setAttribute("value", label.replace(/%zoom%/, zoomFactors[i]));
menuItem.setAttribute("label", label.replace(/%zoom%/, zoomFactors[i]));
menuItem.setAttribute("accesskey", accessKeys[i]);
menuItem.setAttribute("oncommand", "ZoomManager.prototype.getInstance().textZoom = this.data;");
menuItem.setAttribute("data", zoomFactors[i]);
menuItem.setAttribute("oncommand", "ZoomManager.prototype.getInstance().textZoom = this.value;");
menuItem.setAttribute("value", zoomFactors[i]);
popup.insertBefore(menuItem, insertBefore);
}
}
@ -261,7 +261,7 @@ function updateViewMenu()
var textZoomMenu = document.getElementById("menu_textZoom");
var menuLabel = zoom.bundle.getString("menuLabel").replace(/%zoom%/, zoom.textZoom);
textZoomMenu.setAttribute("value", menuLabel);
textZoomMenu.setAttribute("label", menuLabel);
}
function updateTextZoomMenu()
@ -272,14 +272,14 @@ function updateTextZoomMenu()
var textZoomOther = document.getElementById("menu_textZoomOther");
var label = zoom.bundle.getString("labelOther");
textZoomOther.setAttribute("value", label.replace(/%zoom%/, zoom.factorOther));
textZoomOther.setAttribute("data", zoom.factorOther);
textZoomOther.setAttribute("label", label.replace(/%zoom%/, zoom.factorOther));
textZoomOther.setAttribute("value", zoom.factorOther);
var popup = document.getElementById("menu_textZoomPopup");
var item = popup.firstChild;
while (item) {
if (item.getAttribute("name") == "textZoom") {
if (item.getAttribute("data") == currentZoom)
if (item.getAttribute("value") == currentZoom)
item.setAttribute("checked","true");
else
item.removeAttribute("checked");

View File

@ -63,8 +63,8 @@
<menu id="menu_textZoom" accesskey="&textZoomMenu.accesskey;" hidden="true">
<menupopup id="menu_textZoomPopup" oncreate="updateTextZoomMenu();">
<menuitem key="key_textZoomReduce" value="&textZoomReduceCmd.label;" accesskey="&textZoomReduceCmd.accesskey;" observes="cmd_textZoomReduce"/>
<menuitem key="key_textZoomEnlarge" value="&textZoomEnlargeCmd.label;" accesskey="&textZoomEnlargeCmd.accesskey;" observes="cmd_textZoomEnlarge"/>
<menuitem key="key_textZoomReduce" label="&textZoomReduceCmd.label;" accesskey="&textZoomReduceCmd.accesskey;" observes="cmd_textZoomReduce"/>
<menuitem key="key_textZoomEnlarge" label="&textZoomEnlargeCmd.label;" accesskey="&textZoomEnlargeCmd.accesskey;" observes="cmd_textZoomEnlarge"/>
<menuseparator/>
<menuseparator id="menu_textZoomInsertBefore"/>
<menuitem id="menu_textZoomOther" type="radio" name="textZoom" accesskey="&textZoomOtherCmd.accesskey;" oncommand="setTextZoomOther();"/>