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
Родитель 066e77a947
Коммит f17b66929d
9 изменённых файлов: 209 добавлений и 209 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -28,18 +28,18 @@
</keyset> </keyset>
<broadcasterset id="broadcasterset"> <broadcasterset id="broadcasterset">
<broadcaster id="Tasks:Navigator" value="&navigatorCmd.label;" oncommand="toNavigator();"/> <broadcaster id="Tasks:Navigator" label="&navigatorCmd.label;" oncommand="toNavigator();"/>
<broadcaster id="Tasks:Editor" value="&editorCmd.label;" oncommand="toEditor();"/> <broadcaster id="Tasks:Editor" label="&editorCmd.label;" oncommand="toEditor();"/>
<broadcaster id="Tasks:AddressBook" value="&addressBookCmd.label;" oncommand="toAddressBook();"/> <broadcaster id="Tasks:AddressBook" label="&addressBookCmd.label;" oncommand="toAddressBook();"/>
</broadcasterset> </broadcasterset>
<!-- Tasks Menu --> <!-- 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> <template>
<rule> <rule>
<menupopup> <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> </menupopup>
</rule> </rule>
</template> </template>
@ -53,19 +53,19 @@
<menuseparator/> <menuseparator/>
<menu value="&privacyMenu.label;" accesskey="&privacyMenu.accesskey;"> <menu label="&privacyMenu.label;" accesskey="&privacyMenu.accesskey;">
<menupopup id="personalManagers"> <menupopup id="personalManagers">
<menuitem id="lastInPersonalManagers" style="display:none;"/> <menuitem id="lastInPersonalManagers" style="display:none;"/>
</menupopup> </menupopup>
</menu> </menu>
<menuseparator/> <menuseparator/>
<menu value="&toolsMenu.label;" accesskey="&toolsMenu.accesskey;"> <menu label="&toolsMenu.label;" accesskey="&toolsMenu.accesskey;">
<menupopup id="toolsPopup" oncreate="javaItemEnabling();"> <menupopup id="toolsPopup" oncreate="javaItemEnabling();">
<menuitem value="&historyCmd.label;" accesskey="&historyCmd.accesskey;" oncommand="toHistory()" key="key_gotoHistory"/> <menuitem label="&historyCmd.label;" accesskey="&historyCmd.accesskey;" oncommand="toHistory()" key="key_gotoHistory"/>
<menuitem value="&importUtilCmd.label;" accesskey="&importUtilCmd.accesskey;" oncommand="toImport()"/> <menuitem label="&importUtilCmd.label;" accesskey="&importUtilCmd.accesskey;" oncommand="toImport()"/>
<menuitem id="java" value="&javaConsoleCmd.label;" accesskey="&javaConsoleCmd.accesskey;" oncommand="toJavaConsole()"/> <menuitem id="java" label="&javaConsoleCmd.label;" accesskey="&javaConsoleCmd.accesskey;" oncommand="toJavaConsole()"/>
<menuitem value="&javaScriptConsoleCmd.label;" accesskey="&javaScriptConsoleCmd.accesskey;" oncommand="toJavaScriptConsole();"/> <menuitem label="&javaScriptConsoleCmd.label;" accesskey="&javaScriptConsoleCmd.accesskey;" oncommand="toJavaScriptConsole();"/>
</menupopup> </menupopup>
</menu> </menu>
<menuseparator/> <menuseparator/>

Просмотреть файл

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

Просмотреть файл

@ -19,8 +19,8 @@
<script type="application/x-javascript" src="chrome://communicator/content/builtinURLs.js"/> <script type="application/x-javascript" src="chrome://communicator/content/builtinURLs.js"/>
<!-- online/offline status indicators --> <!-- online/offline status indicators -->
<broadcasterset id="broadcasterset"> <broadcasterset id="broadcasterset">
<broadcaster id="Communicator:WorkMode" value="&offlineGoOfflineCmd.label;" oncommand="setOfflineStatus(true);"/> <broadcaster id="Communicator:WorkMode" label="&offlineGoOfflineCmd.label;" oncommand="setOfflineStatus(true);"/>
</broadcasterset> </broadcasterset>
<statusbarpanel id="offline-status" tooltip="aTooltip" observes="Communicator:WorkMode"/> <statusbarpanel id="offline-status" tooltip="aTooltip" observes="Communicator:WorkMode"/>
<menuitem id="offlineGoOfflineCmd" accesskey="&offlineGoOfflineCmd.accesskey;" observes="Communicator:WorkMode"/> <menuitem id="offlineGoOfflineCmd" accesskey="&offlineGoOfflineCmd.accesskey;" observes="Communicator:WorkMode"/>
@ -34,27 +34,27 @@
<!-- NOT IMPLEMENTED, so temporarily disabled --> <!-- NOT IMPLEMENTED, so temporarily disabled -->
<broadcaster id="cmd_newEditorTemplate" disabled="true" oncommand="NewEditorFromTemplate();"/> <broadcaster id="cmd_newEditorTemplate" disabled="true" oncommand="NewEditorFromTemplate();"/>
<broadcaster id="cmd_newEditorDraft" disabled="true" oncommand="NewEditorFromDraft();"/> <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_newEditor" label="&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_newEditorTemplate" label="&newPageFromTemplateCmd.label;" accesskey="&newPageFromTemplateCmd.accesskey;" observes="cmd_newEditorTemplate"/>
<menuitem id="menu_newEditorDraft" value="&newPageFromDraftCmd.label;" accesskey="&newPageFromDraftCmd.accesskey;" observes="cmd_newEditorDraft"/> <menuitem id="menu_newEditorDraft" label="&newPageFromDraftCmd.label;" accesskey="&newPageFromDraftCmd.accesskey;" observes="cmd_newEditorDraft"/>
<menu id="menu_New" value="&newMenu.label;" accesskey="&newMenu.accesskey;"/> <menu id="menu_New" label="&newMenu.label;" accesskey="&newMenu.accesskey;"/>
<menuitem id="menu_newNavigator" value="&newNavigatorCmd.label;" accesskey="&newNavigatorCmd.accesskey;" key="key_newNavigator" observes="cmd_newNavigator"/> <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_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_newNavigator" key="&newNavigatorCmd.key;" observes="cmd_newNavigator" modifiers="accel"/>
<!-- Edit Menu --> <!-- Edit Menu -->
<menu id="menu_Edit" value="&editMenu.label;" accesskey="&editMenu.accesskey;"/> <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_undo" label="&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_redo" label="&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_cut" label="&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_copy" label="&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_paste" label="&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_delete" label="&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_selectAll" label="&selectAllCmd.label;" key="key_selectAll" accesskey="&selectAllCmd.accesskey;" observes="cmd_selectAll"/>
<!-- These key nodes are here only for show. --> <!-- These key nodes are here only for show. -->
<!-- The real bindings come from XBL, in platformHTMLBindings.xml. --> <!-- 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"/--> <!-- Not needed yet, window just needs a broadcaster with this id and oncommand= broadcaster id="cmd_preferences"/-->
<menuitem id="menu_preferences" <menuitem id="menu_preferences"
value="&preferencesCmd.label;" label="&preferencesCmd.label;"
key="key_preferences" key="key_preferences"
accesskey="&preferencesCmd.accesskey;" accesskey="&preferencesCmd.accesskey;"
observes="cmd_preferences"/> observes="cmd_preferences"/>
@ -121,23 +121,23 @@
<!-- View Menu --> <!-- View Menu -->
<menu id="menu_View" value="&viewMenu.label;" accesskey="&viewMenu.accesskey;"/> <menu id="menu_View" label="&viewMenu.label;" accesskey="&viewMenu.accesskey;"/>
<menu id="menu_Toolbars" value="&viewToolbarsMenu.label;" accesskey="&viewToolbarsMenu.accesskey;"/> <menu id="menu_Toolbars" label="&viewToolbarsMenu.label;" accesskey="&viewToolbarsMenu.accesskey;"/>
<menuitem id="menu_showTaskbar" <menuitem id="menu_showTaskbar"
value="&showTaskbarCmd.label;" label="&showTaskbarCmd.label;"
accesskey="&showTaskbarCmd.accesskey;" accesskey="&showTaskbarCmd.accesskey;"
oncommand="goToggleToolbar('taskbar', 'menu_showTaskbar')" oncommand="goToggleToolbar('taskbar', 'menu_showTaskbar')"
checked="true"/> checked="true"/>
<!-- Help Menu --> <!-- 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"> <menupopup id="helpPopup">
<menuitem accesskey="&releaseCmd.accesskey;" value="&releaseCmd.label;" <menuitem accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;"
id="releaseUrl" oncommand="openTopWin('&releaseURL;');"/> id="releaseUrl" oncommand="openTopWin('&releaseURL;');"/>
<menuseparator/> <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')"/> id="pluginInfo" oncommand="openTopWin('about:plugins')"/>
<menuitem accesskey="&aboutCmd.accesskey;" value="&aboutCmd.label;" <menuitem accesskey="&aboutCmd.accesskey;" label="&aboutCmd.label;"
id="aboutName" oncommand="goAboutDialog();"/> id="aboutName" oncommand="goAboutDialog();"/>
</menupopup> </menupopup>
</menu> </menu>

Просмотреть файл

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

Просмотреть файл

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