diff --git a/mozilla/extensions/irc/js/lib/irc.js b/mozilla/extensions/irc/js/lib/irc.js index f8b1c417586..a877d082a08 100644 --- a/mozilla/extensions/irc/js/lib/irc.js +++ b/mozilla/extensions/irc/js/lib/irc.js @@ -2794,19 +2794,19 @@ function chan_userslen (mode) CIRCChannel.prototype.iAmOp = function chan_amop() { - return this.users[this.parent.me.canonicalName].isOp; + return this.active && this.users[this.parent.me.canonicalName].isOp; } CIRCChannel.prototype.iAmHalfOp = function chan_amhalfop() { - return this.users[this.parent.me.canonicalName].isHalfOp; + return this.active && this.users[this.parent.me.canonicalName].isHalfOp; } CIRCChannel.prototype.iAmVoice = function chan_amvoice() { - return this.parent.users[this.parent.parent.me.canonicalName].isVoice; + return this.active && this.users[this.parent.me.canonicalName].isVoice; } CIRCChannel.prototype.setTopic = diff --git a/mozilla/extensions/irc/xul/content/commands.js b/mozilla/extensions/irc/xul/content/commands.js index cfc69df3735..59465e51366 100644 --- a/mozilla/extensions/irc/xul/content/commands.js +++ b/mozilla/extensions/irc/xul/content/commands.js @@ -2748,7 +2748,7 @@ function cmdPass(e) function cmdPing (e) { - e.network.dispatch("ctcp", { target: e.target, code: "PING" }); + e.network.dispatch("ctcp", { target: e.nickname, code: "PING" }); } function cmdPref (e) diff --git a/mozilla/extensions/irc/xul/content/menus.js b/mozilla/extensions/irc/xul/content/menus.js index 2ce32b82f8e..21b3adf65b5 100644 --- a/mozilla/extensions/irc/xul/content/menus.js +++ b/mozilla/extensions/irc/xul/content/menus.js @@ -118,6 +118,7 @@ function initMenus() var Mozilla = "(client.host == 'Mozilla')"; var NotMozilla = "(client.host != 'Mozilla')"; var Toolkit = NotMozilla; + var XULRunner = "(client.host == 'XULrunner')"; // Useful combinations var ToolkitOnLinux = "(" + Toolkit + " and " + Linux + ")"; @@ -137,8 +138,22 @@ function initMenus() var NetConnected = "(cx.network and cx.network.isConnected())"; var NetDisconnected = "(cx.network and !cx.network.isConnected())"; - client.menuSpecs["mainmenu:file"] = { - label: MSG_MNU_FILE, + client.menuSpecs["mainmenu:chatzilla"] = { + label: MSG_MNU_CHATZILLA, + getContext: getDefaultContext, + items: + [ + ["cmd-prefs", {id: "menu_preferences"}], + ["print"], + ["save"], + ["-", {visibleif: NotMac}], + ["exit", {visibleif: Win}], + ["quit", {visibleif: NotMac + " and " + NotWin}] + ] + }; + + client.menuSpecs["mainmenu:irc"] = { + label: MSG_MNU_IRC, getContext: getDefaultContext, items: [ @@ -149,18 +164,21 @@ function initMenus() //["manage-networks"], //["manage-plugins"], ["-"], + // Planned future menu items, not implemented yet. + //["-"] + //[">popup:current_networks"] ["leave", {visibleif: ChannelActive}], ["rejoin", {visibleif: ChannelInactive}], - ["delete-view", {visibleif: "!" + ChannelActive}], ["disconnect", {visibleif: NetConnected}], ["reconnect", {visibleif: NetDisconnected}], + ["-", {visibleif: "cx.network"}], + ["clear-view"], + ["hide-view", {enabledif: "client.viewsArray.length > 1"}], + ["delete-view", {enabledif: "client.viewsArray.length > 1"}], ["-"], - ["print"], - ["-"], - ["save"], - ["-", {visibleif: NotMac}], - ["exit", {visibleif: Win}], - ["quit", {visibleif: NotMac + " and " + NotWin}] + ["toggle-oas", + {type: "checkbox", + checkedif: "isStartupURL(cx.sourceObject.getURL())"}] ] }; @@ -185,22 +203,7 @@ function initMenus() // Toolkit Linux apps get: separator, ChatZilla prefs. // Toolkit Mac apps get : ChatZilla prefs (special Mac ID). ["-", {visibleif: Mozilla}], - ["cmd-mozilla-prefs", {visibleif: Mozilla}], - ["cmd-chatzilla-prefs", {visibleif: Mozilla}], - ["-", {visibleif: ToolkitOnLinux}], - ["cmd-prefs", {visibleif: ToolkitOnLinux}], - ["cmd-chatzilla-opts", {visibleif: ToolkitOnMac, - id: "menu_preferences"}] - ] - }; - - client.menuSpecs["mainmenu:tools"] = { - label: MSG_MNU_TOOLS, - getContext: getDefaultContext, - items: - [ - ["cmd-chatzilla-opts", - {visibleif: ToolkitNotOnLinux + " and " + ToolkitNotOnMac}] + ["cmd-mozilla-prefs", {visibleif: Mozilla}] ] }; @@ -225,13 +228,18 @@ function initMenus() getContext: getDefaultContext, items: [ - [">popup:showhide"], - ["-"], - ["clear-view"], - ["hide-view", {enabledif: "client.viewsArray.length > 1"}], - ["toggle-oas", + ["tabstrip", {type: "checkbox", - checkedif: "isStartupURL(cx.sourceObject.getURL())"}], + checkedif: "isVisible('view-tabs')"}], + ["header", + {type: "checkbox", + checkedif: "cx.sourceObject.prefs['displayHeader']"}], + ["userlist", + {type: "checkbox", + checkedif: "isVisible('user-list-box')"}], + ["statusbar", + {type: "checkbox", + checkedif: "isVisible('status-bar')"}], ["-"], [">popup:motifs"], [">popup:fonts"], @@ -259,26 +267,6 @@ function initMenus() ] }; - client.menuSpecs["popup:showhide"] = { - label: MSG_MNU_SHOWHIDE, - items: - [ - ["tabstrip", - {type: "checkbox", - checkedif: "isVisible('view-tabs')"}], - ["header", - {type: "checkbox", - checkedif: "cx.sourceObject.prefs['displayHeader']"}], - ["userlist", - {type: "checkbox", - checkedif: "isVisible('user-list-box')"}], - ["statusbar", - {type: "checkbox", - checkedif: "isVisible('status-bar')"}], - - ] - }; - client.menuSpecs["popup:fonts"] = { label: MSG_MNU_FONTS, getContext: getFontContext, @@ -337,6 +325,23 @@ function initMenus() }; + client.menuSpecs["popup:usercommands"] = { + label: MSG_MNU_USERCOMMANDS, + items: + [ + ["query", {visibleif: "cx.user"}], + ["whois", {visibleif: "cx.user"}], + ["whowas", {visibleif: "cx.nickname && !cx.user"}], + ["ping", {visibleif: "cx.user"}], + ["time", {visibleif: "cx.user"}], + ["version", {visibleif: "cx.user"}], + ["-", {visibleif: "cx.user"}], + ["dcc-chat", {visibleif: "cx.user"}], + ["dcc-send", {visibleif: "cx.user"}], + ] + }; + + client.menuSpecs["context:userlist"] = { getContext: getUserlistContext, items: @@ -347,15 +352,14 @@ function initMenus() checkedif: "client.prefs['showModeSymbols']"}], ["-", {visibleif: "cx.nickname"}], ["label-user", {visibleif: "cx.nickname", header: true}], - [">popup:opcommands", {visibleif: "cx.channel && " + isopish + "cx.user"}], - ["whois", {visibleif: "cx.nickname"}], - ["query", {visibleif: "cx.nickname"}], - ["version", {visibleif: "cx.nickname"}], + [">popup:opcommands", {visibleif: "cx.nickname", + enabledif: isopish + "true"}], + [">popup:usercommands", {visibleif: "cx.nickname"}], ] }; var urlenabled = "has('url')"; - var urlexternal = "has('url') && cx.url.search(/^irc:/i) == -1"; + var urlexternal = "has('url') && cx.url.search(/^ircs?:/i) == -1"; var textselected = "getCommandEnabled('cmd_copy')"; client.menuSpecs["context:messages"] = { @@ -363,24 +367,22 @@ function initMenus() items: [ ["goto-url", {visibleif: urlenabled}], - ["goto-url-newwin", {visibleif: urlexternal}], - ["goto-url-newtab", {visibleif: urlexternal}], + ["goto-url-newwin", {visibleif: urlexternal + " && !" + XULRunner}], + ["goto-url-newtab", {visibleif: urlexternal + " && !" + XULRunner}], ["cmd-copy-link-url", {visibleif: urlenabled}], ["cmd-copy", {visibleif: "!" + urlenabled, enabledif: textselected }], ["cmd-selectall", {visibleif: "!" + urlenabled }], + ["-", {visibleif: "cx.channel && cx.nickname"}], + ["label-user", {visibleif: "cx.channel && cx.nickname", header: true}], + [">popup:opcommands", {visibleif: "cx.channel && cx.nickname", + enabledif: isopish + "cx.user"}], + [">popup:usercommands", {visibleif: "cx.channel && cx.nickname"}], ["-"], ["clear-view"], ["hide-view", {enabledif: "client.viewsArray.length > 1"}], ["toggle-oas", {type: "checkbox", checkedif: "isStartupURL(cx.sourceObject.getURL())"}], - ["-", {visibleif: "cx.channel && cx.nickname"}], - ["label-user", {visibleif: "cx.channel && cx.nickname", header: true}], - [">popup:opcommands", {visibleif: "cx.channel && " + isopish + "cx.user"}], - ["whois", {visibleif: "cx.user"}], - ["whowas", {visibleif: "cx.nickname && !cx.user"}], - ["query", {visibleif: "cx.nickname"}], - ["version", {visibleif: "cx.nickname"}], ["-"], ["leave", {visibleif: ChannelActive}], ["rejoin", {visibleif: ChannelInactive}], @@ -444,7 +446,6 @@ function createMenus() // The menus and the component bar need to be hidden on some hosts. var winMenu = document.getElementById("windowMenu"); var tasksMenu = document.getElementById("tasksMenu"); - var toolsMenu = document.getElementById("mainmenu:tools"); var comBar = document.getElementById("component-bar"); if (client.host != "Mozilla") { @@ -453,12 +454,6 @@ function createMenus() } else { comBar.collapsed = false; } - - if ((client.host == "Mozilla") || (client.platform == "Linux") || - (client.platform == "Mac")) - { - toolsMenu.parentNode.removeChild(toolsMenu); - } } function getCommandContext (id, event) diff --git a/mozilla/extensions/irc/xul/content/menus.xul b/mozilla/extensions/irc/xul/content/menus.xul index de1fcf3c14d..64679c4e1f1 100644 --- a/mozilla/extensions/irc/xul/content/menus.xul +++ b/mozilla/extensions/irc/xul/content/menus.xul @@ -98,12 +98,15 @@ - - - + + + + + + - + @@ -113,9 +116,6 @@ - - - diff --git a/mozilla/extensions/irc/xul/locale/en-US/chatzilla.properties b/mozilla/extensions/irc/xul/locale/en-US/chatzilla.properties index e492938f5d6..770487b813f 100644 --- a/mozilla/extensions/irc/xul/locale/en-US/chatzilla.properties +++ b/mozilla/extensions/irc/xul/locale/en-US/chatzilla.properties @@ -230,6 +230,7 @@ cmd.dcc-accept.help = Accepts an incoming DCC Chat or Send offer. If a |nickna cmd.dcc-chat.params = [] cmd.dcc-chat.help = Sends a DCC Chat offer to |nickname| on the current server. On a query view, |nickname| may be omitted to send the offer to the query view's user. +cmd.dcc-chat.label = Direct Chat cmd.dcc-close.params = [ [ []]] cmd.dcc-close.help = Closes an existing DCC connection. |nickname| may be omitted if run from a DCC view, in which case the DCC connection for that view will be closed. |type| and |file| may be needed to identify the connection. You can also use a regular expression for either or . @@ -242,6 +243,7 @@ cmd.dcc-list.help = Lists the currently known about DCC offers and connections cmd.dcc-send.params = [ []] cmd.dcc-send.help = Offers a file to |nickname|. On a query view, |nickname| may be omitted to send the offer to the query view's user. A file may be specified directly by passing |file| or, if omitted, selected from a browse dialog. +cmd.dcc-send.label = Send File... cmd.delete-view.key = accel W cmd.delete-view.label = &Close Tab @@ -558,6 +560,7 @@ cmd.stats.help = Request server statistics. Use this command with no parameters cmd.time.params = [] cmd.time.help = Asks what time it is on their machine. Their IRC client may or may not show them that you've asked for this information. ChatZilla currently does not. If you do not specify , ChatZilla will ask the server for the time it is on the server. +cmd.time.label = Get Local Time cmd.timestamps.params = [] cmd.timestamps.help = Sets the visibility of timestamps in the current view. If is provided and is |true|, |on|, |yes|, or |1|, timestamps will be turned on. Values |false|, |off|, |no| and |0| will turn timestamps off, and |toggle| will toggle the state. Omit to see the current state. @@ -571,8 +574,9 @@ cmd.toggle-oas.label = Open at &Startup cmd.pass.params = cmd.pass.help = Sends a password to the server for use when connecting to password-protected servers. -cmd.ping.params = +cmd.ping.params = cmd.ping.help = Ping takes its name from the technique of measuring distance with sonar. In IRC, it is used to measure the time it takes to send a message to someone, and receive a response. Specify a channel to ping everyone in that channel. Some IRC clients will display ping requests to the user. ChatZilla does not. +cmd.ping.label = Ping User cmd.plugin-pref.params = [ [ []]] cmd.plugin-pref.help = Sets the value of the plugin's preference named to the value of . If is not provided, the current value of will be displayed. If both and are omitted, all preferences for will be displayed. If is provided and is |true|, |on|, |yes|, or |1|, or if starts with a minus ('-') character, then the preference will revert back to its default value. @@ -823,14 +827,14 @@ msg.rsp.evin = [EVAL-IN] msg.rsp.evout = [EVAL-OUT] msg.rsp.disconnect = [QUIT] -msg.mnu.showhide = Sho&w/Hide -msg.mnu.file = &File +msg.mnu.chatzilla = &ChatZilla +msg.mnu.irc = &IRC msg.mnu.edit = &Edit msg.mnu.help = &Help msg.mnu.view = &View -msg.mnu.tools = &Tools msg.mnu.motifs = Co&lor Scheme msg.mnu.opcommands = &Operator Commands +msg.mnu.usercommands = &User Commands msg.mnu.fonts = &Font Family and Size msg.client.name = *client*