Bug 291105 - ChatZilla's menu structure needs improving

ChatZilla only.
r=silver
This commit is contained in:
gijskruitbosch%gmail.com 2006-02-11 08:49:56 +00:00
Родитель 8d3095b8e6
Коммит 7fe29e1847
5 изменённых файлов: 86 добавлений и 87 удалений

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

@ -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 =

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

@ -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)

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

@ -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)

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

@ -98,12 +98,15 @@
<menubar id="mainmenu" persist="collapsed"
grippytooltiptext="&Menubar.tooltip;">
<!-- File menu placeholder, see menus.js -->
<menu id="mainmenu:file"><menupopup/></menu>
<!-- ChatZilla menu placeholder, see menus.js -->
<menu id="mainmenu:chatzilla"><menupopup/></menu>
<!-- IRC menu placeholder, see menus.js -->
<menu id="mainmenu:irc"><menupopup/></menu>
<!-- Edit menu placeholder, see menus.js -->
<menu id="mainmenu:edit"><menupopup/></menu>
<!-- View menu placeholder, see menus.js -->
<menu id="mainmenu:view"><menupopup/></menu>
@ -113,9 +116,6 @@
<!-- Window menu -->
<menu id="windowMenu"/>
<!-- Tools menu placeholder, see menus.js -->
<menu id="mainmenu:tools"><menupopup/></menu>
<!-- Help menu -->
<!-- Mac expects a help menu with this ID, and there is nothing we can
do about it. -->

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

@ -230,6 +230,7 @@ cmd.dcc-accept.help = Accepts an incoming DCC Chat or Send offer. If a |nickna
cmd.dcc-chat.params = [<nickname>]
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 = [<nickname> [<type> [<file>]]]
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 <nickname> or <file>.
@ -242,6 +243,7 @@ cmd.dcc-list.help = Lists the currently known about DCC offers and connections
cmd.dcc-send.params = [<nickname> [<file>]]
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 = [<nickname>]
cmd.time.help = Asks <nickname> 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 <nickname>, ChatZilla will ask the server for the time it is on the server.
cmd.time.label = Get Local Time
cmd.timestamps.params = [<toggle>]
cmd.timestamps.help = Sets the visibility of timestamps in the current view. If <toggle> 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 <toggle> to see the current state.
@ -571,8 +574,9 @@ cmd.toggle-oas.label = Open at &Startup
cmd.pass.params = <password>
cmd.pass.help = Sends a password to the server for use when connecting to password-protected servers.
cmd.ping.params = <target>
cmd.ping.params = <nickname>
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 = <plugin> [<pref-name> [<pref-value> [<delete-pref>]]]
cmd.plugin-pref.help = Sets the value of the plugin's preference named <pref-name> to the value of <pref-value>. If <pref-value> is not provided, the current value of <pref-name> will be displayed. If both <pref-name> and <pref-value> are omitted, all preferences for <plugin> will be displayed. If <delete-pref> is provided and is |true|, |on|, |yes|, or |1|, or if <pref-value> 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*