|
@@ -0,0 +1,468 @@
|
|
|
+# HG changeset patch
|
|
|
+# User Ian Neal <iann_cvs@blueyonder.co.uk>
|
|
|
+# Date 1728341054 -3600
|
|
|
+# Parent 9c3a35181b22810c3701964daa83079fc6dd39f2
|
|
|
+Bug 1923225 - Switch from using arrayIndexOf helper to using JS Array includes and indexOf methods. r=frg a=frg
|
|
|
+
|
|
|
+diff --git a/suite/extensions/irc/js/lib/dcc.js b/suite/extensions/irc/js/lib/dcc.js
|
|
|
+--- a/suite/extensions/irc/js/lib/dcc.js
|
|
|
++++ b/suite/extensions/irc/js/lib/dcc.js
|
|
|
+@@ -127,36 +127,36 @@ function dcc_getmatches(nickname, filena
|
|
|
+ var k;
|
|
|
+ var list = new Array();
|
|
|
+ if (!types)
|
|
|
+ types = ["chat", "file"];
|
|
|
+
|
|
|
+ var n = nickname;
|
|
|
+ var f = filename;
|
|
|
+
|
|
|
+- if (arrayIndexOf(types, "chat") >= 0)
|
|
|
++ if (types.includes("chat"))
|
|
|
+ {
|
|
|
+ for (k = 0; k < this.chats.length; k++)
|
|
|
+ {
|
|
|
+ if ((!nickname || matchNames(this.chats[k].user.unicodeName, n)) &&
|
|
|
+- (!dirs || arrayIndexOf(dirs, this.chats[k].state.dir) >= 0) &&
|
|
|
+- (!states || arrayIndexOf(states, this.chats[k].state.state) >= 0))
|
|
|
++ (!dirs || dirs.includes(this.chats[k].state.dir)) &&
|
|
|
++ (!states || states.includes(this.chats[k].state.state)))
|
|
|
+ {
|
|
|
+ list.push(this.chats[k]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+- if (arrayIndexOf(types, "file") >= 0)
|
|
|
++ if (types.includes("file"))
|
|
|
+ {
|
|
|
+ for (k = 0; k < this.files.length; k++)
|
|
|
+ {
|
|
|
+ if ((!nickname || matchNames(this.files[k].user.unicodeName, n)) &&
|
|
|
+ (!filename || matchNames(this.files[k].filename, f)) &&
|
|
|
+- (!dirs || arrayIndexOf(dirs, this.files[k].state.dir) >= 0) &&
|
|
|
+- (!states || arrayIndexOf(states, this.files[k].state.state) >= 0))
|
|
|
++ (!dirs || dirs.includes(this.files[k].state.dir)) &&
|
|
|
++ (!states || states.includes(this.files[k].state.state)))
|
|
|
+ {
|
|
|
+ list.push(this.files[k]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+diff --git a/suite/extensions/irc/js/lib/irc.js b/suite/extensions/irc/js/lib/irc.js
|
|
|
+--- a/suite/extensions/irc/js/lib/irc.js
|
|
|
++++ b/suite/extensions/irc/js/lib/irc.js
|
|
|
+@@ -405,17 +405,17 @@ function net_doconnect(e)
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var hostname = this.serverList[host].hostname;
|
|
|
+ var matches = this.serverList.filter(function(s) {
|
|
|
+ return s.hostname == hostname && s.port == newPort;
|
|
|
+ });
|
|
|
+ if (matches.length > 0)
|
|
|
+ {
|
|
|
+- host = arrayIndexOf(this.serverList, matches[0]);
|
|
|
++ host = this.serverList.indexOf(matches[0]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ this.addServer(hostname, newPort, true,
|
|
|
+ this.serverList[host].password);
|
|
|
+ host = this.serverList.length - 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+@@ -1040,17 +1040,17 @@ function serv_monitorlist(nicks, isAdd)
|
|
|
+ this.sendData(prefix + nicks_part + "\n");
|
|
|
+ }
|
|
|
+ this.sendData(prefix + nicks_string + "\n");
|
|
|
+ }
|
|
|
+
|
|
|
+ CIRCServer.prototype.addTarget =
|
|
|
+ function serv_addtarget(name)
|
|
|
+ {
|
|
|
+- if (arrayIndexOf(this.channelTypes, name[0]) != -1) {
|
|
|
++ if (this.channelTypes.includes(name[0])) {
|
|
|
+ return this.addChannel(name);
|
|
|
+ } else {
|
|
|
+ return this.addUser(name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ CIRCServer.prototype.addChannel =
|
|
|
+ function serv_addchan(unicodeName, charset)
|
|
|
+@@ -2687,17 +2687,17 @@ function serv_chghost(e)
|
|
|
+ }
|
|
|
+
|
|
|
+ /* user changed the mode */
|
|
|
+ CIRCServer.prototype.onMode =
|
|
|
+ function serv_mode (e)
|
|
|
+ {
|
|
|
+ e.destObject = this;
|
|
|
+ /* modes are not allowed in +channels -> no need to test that here.. */
|
|
|
+- if (arrayIndexOf(this.channelTypes, e.params[1][0]) != -1)
|
|
|
++ if (this.channelTypes.includes(e.params[1][0]))
|
|
|
+ {
|
|
|
+ e.channel = new CIRCChannel(this, null, e.params[1]);
|
|
|
+ if ("user" in e && e.user)
|
|
|
+ e.user = new CIRCChanUser(e.channel, e.user.unicodeName);
|
|
|
+ e.type = "chanmode";
|
|
|
+ e.destMethod = "onChanMode";
|
|
|
+ }
|
|
|
+ else
|
|
|
+@@ -3116,17 +3116,17 @@ function serv_notice_privmsg (e)
|
|
|
+ targetName = targetName.substr(1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* setting replyTo provides a standard place to find the target for */
|
|
|
+ /* replies associated with this event. */
|
|
|
+- if (arrayIndexOf(this.channelTypes, targetName[0]) != -1)
|
|
|
++ if (this.channelTypes && this.channelTypes.includes(targetName[0]))
|
|
|
+ {
|
|
|
+ e.channel = new CIRCChannel(this, null, targetName);
|
|
|
+ if ("user" in e)
|
|
|
+ e.user = new CIRCChanUser(e.channel, e.user.unicodeName);
|
|
|
+ e.replyTo = e.channel;
|
|
|
+ e.set = "channel";
|
|
|
+ }
|
|
|
+ else if (!("user" in e))
|
|
|
+@@ -3553,17 +3553,17 @@ CIRCChannel.prototype.topic = "";
|
|
|
+ // Returns the IRC URL representation of this channel.
|
|
|
+ CIRCChannel.prototype.getURL =
|
|
|
+ function chan_geturl()
|
|
|
+ {
|
|
|
+ var target = this.encodedName;
|
|
|
+ var flags = this.mode.key ? ["needkey"] : [];
|
|
|
+
|
|
|
+ if ((target[0] == "#") && (target.length > 1) &&
|
|
|
+- arrayIndexOf(this.parent.channelTypes, target[1]) == -1)
|
|
|
++ !this.parent.channelTypes.includes(target[1]))
|
|
|
+ {
|
|
|
+ /* First character is "#" (which we're allowed to omit), and the
|
|
|
+ * following character is NOT a valid prefix, so it's safe to remove.
|
|
|
+ */
|
|
|
+ target = target.substr(1);
|
|
|
+ }
|
|
|
+ return this.parent.parent.getURL(target, flags);
|
|
|
+ }
|
|
|
+@@ -4087,17 +4087,17 @@ function CIRCChanUser(parent, unicodeNam
|
|
|
+ {
|
|
|
+ // This will remove '-' modes, and all other modes will be
|
|
|
+ // added.
|
|
|
+ var mode = modes[m][1];
|
|
|
+ if (modes[m][0] == "-")
|
|
|
+ {
|
|
|
+ if (existingUser.modes.includes(mode))
|
|
|
+ {
|
|
|
+- var i = arrayIndexOf(existingUser.modes, mode);
|
|
|
++ var i = existingUser.modes.indexOf(mode);
|
|
|
+ arrayRemoveAt(existingUser.modes, i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (!existingUser.modes.includes(mode))
|
|
|
+ existingUser.modes.push(mode);
|
|
|
+ }
|
|
|
+diff --git a/suite/extensions/irc/js/lib/message-manager.js b/suite/extensions/irc/js/lib/message-manager.js
|
|
|
+--- a/suite/extensions/irc/js/lib/message-manager.js
|
|
|
++++ b/suite/extensions/irc/js/lib/message-manager.js
|
|
|
+@@ -101,17 +101,17 @@ function mm_importbundle(bundle, targetW
|
|
|
+ return matched;
|
|
|
+ };
|
|
|
+ const nsIPropertyElement = Components.interfaces.nsIPropertyElement;
|
|
|
+
|
|
|
+ if (!targetWindow)
|
|
|
+ targetWindow = window;
|
|
|
+
|
|
|
+ if (typeof index == "undefined")
|
|
|
+- index = arrayIndexOf(this.bundleList, bundle);
|
|
|
++ index = this.bundleList.indexOf(bundle);
|
|
|
+
|
|
|
+ var pfx;
|
|
|
+ if (index == 0)
|
|
|
+ pfx = "";
|
|
|
+ else
|
|
|
+ pfx = index + ":";
|
|
|
+
|
|
|
+ var enumer = bundle.getSimpleEnumeration();
|
|
|
+diff --git a/suite/extensions/irc/js/lib/utils.js b/suite/extensions/irc/js/lib/utils.js
|
|
|
+--- a/suite/extensions/irc/js/lib/utils.js
|
|
|
++++ b/suite/extensions/irc/js/lib/utils.js
|
|
|
+@@ -691,25 +691,16 @@ function formatDateOffset (offset, forma
|
|
|
+ return format;
|
|
|
+ }
|
|
|
+
|
|
|
+ function arrayHasElementAt(ary, i)
|
|
|
+ {
|
|
|
+ return typeof ary[i] != "undefined";
|
|
|
+ }
|
|
|
+
|
|
|
+-function arrayIndexOf (ary, elem)
|
|
|
+-{
|
|
|
+- for (var i in ary)
|
|
|
+- if (ary[i] == elem)
|
|
|
+- return i;
|
|
|
+-
|
|
|
+- return -1;
|
|
|
+-}
|
|
|
+-
|
|
|
+ function arrayInsertAt (ary, i, o)
|
|
|
+ {
|
|
|
+ ary.splice (i, 0, o);
|
|
|
+ }
|
|
|
+
|
|
|
+ function arrayRemoveAt (ary, i)
|
|
|
+ {
|
|
|
+ ary.splice (i, 1);
|
|
|
+diff --git a/suite/extensions/irc/xul/content/channels.js b/suite/extensions/irc/xul/content/channels.js
|
|
|
+--- a/suite/extensions/irc/xul/content/channels.js
|
|
|
++++ b/suite/extensions/irc/xul/content/channels.js
|
|
|
+@@ -663,17 +663,17 @@ function processOpFilterStart(opData)
|
|
|
+ if (opData.searchTopics)
|
|
|
+ filters.push("topics");
|
|
|
+ if (opData.minUsers)
|
|
|
+ filters.push("min-users");
|
|
|
+ if (opData.maxUsers)
|
|
|
+ filters.push("max-users");
|
|
|
+
|
|
|
+ if (opData.channelText &&
|
|
|
+- (arrayIndexOf(["#", "&", "+", "!"], opData.channelText[0]) == -1))
|
|
|
++ !["#", "&", "+", "!"].includes(opData.channelText[0]))
|
|
|
+ {
|
|
|
+ opData.channelText = "#" + opData.channelText;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // Log that user has specified an explicit prefix.
|
|
|
+ filters.push("prefix");
|
|
|
+ }
|
|
|
+diff --git a/suite/extensions/irc/xul/content/commands.js b/suite/extensions/irc/xul/content/commands.js
|
|
|
+--- a/suite/extensions/irc/xul/content/commands.js
|
|
|
++++ b/suite/extensions/irc/xul/content/commands.js
|
|
|
+@@ -2431,18 +2431,18 @@ function cmdJoin(e)
|
|
|
+ server: e.server,
|
|
|
+ charset: e.charset,
|
|
|
+ channelName: chans[c],
|
|
|
+ key: keys.shift() });
|
|
|
+ }
|
|
|
+ return chan;
|
|
|
+ }
|
|
|
+
|
|
|
+- if ((arrayIndexOf(["#", "&", "+", "!"], e.channelName[0]) == -1) &&
|
|
|
+- (arrayIndexOf(e.server.channelTypes, e.channelName[0]) == -1))
|
|
|
++ if (!["#", "&", "+", "!"].includes(e.channelName[0]) &&
|
|
|
++ !e.server.channelTypes.includes(e.channelName[0]))
|
|
|
+ {
|
|
|
+ e.channelName = e.server.channelTypes[0] + e.channelName;
|
|
|
+ }
|
|
|
+
|
|
|
+ var charset = e.charset ? e.charset : e.network.prefs["charset"];
|
|
|
+ chan = e.server.addChannel(e.channelName, charset);
|
|
|
+ if (e.charset)
|
|
|
+ chan.prefs["charset"] = e.charset;
|
|
|
+@@ -2476,17 +2476,17 @@ function cmdLeave(e)
|
|
|
+ // channel names. If we discover that we were passed an invalid channel
|
|
|
+ // name, but have a channel on the event, we'll just leave that channel
|
|
|
+ // with the full message (including what we thought was a channel name)
|
|
|
+ // and return false in order to not process the rest of what we thought
|
|
|
+ // was a channel name. If there's a genuine error, e.g. because the user
|
|
|
+ // specified a non-existing channel and isn't in a channel either, we
|
|
|
+ // will also return a falsy value
|
|
|
+ var shouldContinue = true;
|
|
|
+- if (arrayIndexOf(e.server.channelTypes, channelName[0]) == -1)
|
|
|
++ if (!e.server.channelTypes.includes(channelName[0]))
|
|
|
+ {
|
|
|
+ // No valid prefix character. Check they really meant a channel...
|
|
|
+ var valid = false;
|
|
|
+ for (var i = 0; i < e.server.channelTypes.length; i++)
|
|
|
+ {
|
|
|
+ // Hmm, not ideal...
|
|
|
+ var chan = e.server.getChannel(e.server.channelTypes[i] +
|
|
|
+ channelName);
|
|
|
+@@ -3017,17 +3017,17 @@ function cmdAway(e)
|
|
|
+ }
|
|
|
+
|
|
|
+ function cmdOpenAtStartup(e)
|
|
|
+ {
|
|
|
+ var origURL = e.sourceObject.getURL();
|
|
|
+ var url = makeCanonicalIRCURL(origURL);
|
|
|
+ var list = client.prefs["initialURLs"];
|
|
|
+ ensureCachedCanonicalURLs(list);
|
|
|
+- var index = arrayIndexOf(list.canonicalURLs, url);
|
|
|
++ var index = list.canonicalURLs.indexOf(url);
|
|
|
+
|
|
|
+ if (e.toggle == null)
|
|
|
+ {
|
|
|
+ if (index == -1)
|
|
|
+ display(getMsg(MSG_STARTUP_NOTFOUND, url));
|
|
|
+ else
|
|
|
+ display(getMsg(MSG_STARTUP_EXISTS, url));
|
|
|
+ return;
|
|
|
+@@ -3360,17 +3360,17 @@ function cmdNotify(e)
|
|
|
+ var adds = new Array();
|
|
|
+ var subs = new Array();
|
|
|
+
|
|
|
+ for (var i in e.nicknameList)
|
|
|
+ {
|
|
|
+ var nickname = e.server.toLowerCase(e.nicknameList[i]);
|
|
|
+ var list = net.prefs["notifyList"];
|
|
|
+ list = e.server.toLowerCase(list.join(";")).split(";");
|
|
|
+- var idx = arrayIndexOf (list, nickname);
|
|
|
++ var idx = list.indexOf(nickname);
|
|
|
+ if (idx == -1)
|
|
|
+ {
|
|
|
+ net.prefs["notifyList"].push (nickname);
|
|
|
+ adds.push(nickname);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ arrayRemoveAt (net.prefs["notifyList"], idx);
|
|
|
+@@ -4356,18 +4356,17 @@ function cmdDCCAutoAcceptAdd(e)
|
|
|
+ return display(MSG_DCC_NOT_ENABLED);
|
|
|
+
|
|
|
+ var list = e.network.prefs["dcc.autoAccept.list"];
|
|
|
+
|
|
|
+ if (!e.user && e.server)
|
|
|
+ e.user = e.server.getUser(e.nickname);
|
|
|
+
|
|
|
+ var mask = e.user ? "*!" + e.user.name + "@" + e.user.host : e.nickname;
|
|
|
+- var index = arrayIndexOf(list, mask);
|
|
|
+- if (index == -1)
|
|
|
++ if (!list.includes(mask))
|
|
|
+ {
|
|
|
+ list.push(mask);
|
|
|
+ list.update();
|
|
|
+ display(getMsg(MSG_DCCACCEPT_ADD, mask));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ display(getMsg(MSG_DCCACCEPT_ADDERR,
|
|
|
+diff --git a/suite/extensions/irc/xul/content/handlers.js b/suite/extensions/irc/xul/content/handlers.js
|
|
|
+--- a/suite/extensions/irc/xul/content/handlers.js
|
|
|
++++ b/suite/extensions/irc/xul/content/handlers.js
|
|
|
+@@ -1007,17 +1007,17 @@ function my_unknown (e)
|
|
|
+
|
|
|
+ e.params.shift(); /* remove the code */
|
|
|
+ e.params.shift(); /* and the dest. nick (always me) */
|
|
|
+
|
|
|
+ // Handle random IRC numerics automatically.
|
|
|
+ var msg = getMsg("msg.irc." + e.code, null, "");
|
|
|
+ if (msg)
|
|
|
+ {
|
|
|
+- if (arrayIndexOf(e.server.channelTypes, e.params[0][0]) != -1)
|
|
|
++ if (e.server.channelTypes.includes(e.params[0][0]))
|
|
|
+ {
|
|
|
+ // Message about a channel (e.g. join failed).
|
|
|
+ e.channel = new CIRCChannel(e.server, null, e.params[0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ var targetDisplayObj = this;
|
|
|
+ if (e.channel && ("messages" in e.channel))
|
|
|
+ targetDisplayObj = e.channel;
|
|
|
+@@ -1722,17 +1722,17 @@ function my_401(e)
|
|
|
+ {
|
|
|
+ var server, channel, user;
|
|
|
+
|
|
|
+ /* Note that servers generally only send 401 and 402, sharing the former
|
|
|
+ * between nicknames and channels, but we're ready for anything.
|
|
|
+ */
|
|
|
+ if (e.code == 402)
|
|
|
+ server = e.decodeParam(2);
|
|
|
+- else if (arrayIndexOf(e.server.channelTypes, e.params[2][0]) != -1)
|
|
|
++ else if (e.server.channelTypes.includes(e.params[2][0]))
|
|
|
+ channel = new CIRCChannel(e.server, null, e.params[2]);
|
|
|
+ else
|
|
|
+ user = new CIRCUser(e.server, null, e.params[2]);
|
|
|
+
|
|
|
+ if (user && this.whoisList && (user.collectionKey in this.whoisList))
|
|
|
+ {
|
|
|
+ // If this is from a /whois, send a /whowas and don't display anything.
|
|
|
+ this.primServ.whowas(user.unicodeName, 1);
|
|
|
+@@ -2029,18 +2029,17 @@ function my_433 (e)
|
|
|
+ if ("pendingReclaimCheck" in this)
|
|
|
+ {
|
|
|
+ delete this.pendingReclaimCheck;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.state == NET_CONNECTING)
|
|
|
+ {
|
|
|
+- // Force a number, thanks.
|
|
|
+- var nickIndex = 1 * arrayIndexOf(this.prefs["nicknameList"], nick);
|
|
|
++ var nickIndex = this.prefs["nicknameList"].indexOf(nick);
|
|
|
+ var newnick = null;
|
|
|
+
|
|
|
+ dd("433: failed with " + nick + " (" + nickIndex + ")");
|
|
|
+
|
|
|
+ var tryList = true;
|
|
|
+
|
|
|
+ if ((("_firstNick" in this) && (this._firstNick == -1)) ||
|
|
|
+ (this.prefs["nicknameList"].length == 0) ||
|
|
|
+diff --git a/suite/extensions/irc/xul/content/static.js b/suite/extensions/irc/xul/content/static.js
|
|
|
+--- a/suite/extensions/irc/xul/content/static.js
|
|
|
++++ b/suite/extensions/irc/xul/content/static.js
|
|
|
+@@ -1079,18 +1079,18 @@ function getViewsContext(cx)
|
|
|
+
|
|
|
+ var label = view.viewName;
|
|
|
+ if (!getTabForObject(view))
|
|
|
+ label = getMsg(MSG_VIEW_HIDDEN, [label]);
|
|
|
+
|
|
|
+ var types = ["IRCClient", "IRCNetwork", "IRCDCCChat",
|
|
|
+ "IRCDCCFileTransfer"];
|
|
|
+ var typesNetwork = ["IRCNetwork", "IRCChannel", "IRCUser"];
|
|
|
+- var group = String(arrayIndexOf(types, view.TYPE));
|
|
|
+- if (arrayIndexOf(typesNetwork, view.TYPE) != -1)
|
|
|
++ var group = String(types.indexOf(view.TYPE));
|
|
|
++ if (typesNetwork.includes(view.TYPE))
|
|
|
+ group = "1-" + getObjectDetails(view).network.viewName;
|
|
|
+
|
|
|
+ var sort = group + "-" + view.viewName;
|
|
|
+ if (view.TYPE == "IRCNetwork")
|
|
|
+ sort = group;
|
|
|
+
|
|
|
+ cx.views.push({url: url, label: label, group: group, sort: sort});
|
|
|
+ urls[url] = true
|
|
|
+@@ -1903,18 +1903,18 @@ function gotoIRCURL(url, e)
|
|
|
+ // Must do this the hard way... we have the server's format
|
|
|
+ // for the channel name here, and all our commands only work
|
|
|
+ // with the Unicode forms.
|
|
|
+
|
|
|
+ /* If we don't have a valid prefix, stick a "#" on it.
|
|
|
+ * NOTE: This is always a "#" so that URLs may be compared
|
|
|
+ * properly without involving the server (e.g. off-line).
|
|
|
+ */
|
|
|
+- if ((arrayIndexOf(["#", "&", "+", "!"], target[0]) == -1) &&
|
|
|
+- (arrayIndexOf(serv.channelTypes, target[0]) == -1))
|
|
|
++ if (!["#", "&", "+", "!"].includes(target[0]) &&
|
|
|
++ !serv.channelTypes.includes(target[0]))
|
|
|
+ {
|
|
|
+ target = "#" + target;
|
|
|
+ }
|
|
|
+
|
|
|
+ var chan = new CIRCChannel(serv, null, target);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (url.needkey && !chan.joined)
|
|
|
+@@ -2628,17 +2628,17 @@ function advanceKeyboardFocus(amount)
|
|
|
+
|
|
|
+ var elem = document.commandDispatcher.focusedElement;
|
|
|
+ // Finding focus in the content window is "hard". It's going to be null
|
|
|
+ // if the window itself is focused, and "some element" inside of it if the
|
|
|
+ // user starts tabbing through.
|
|
|
+ if (!elem || (elem.ownerDocument == contentDoc))
|
|
|
+ elem = contentWin;
|
|
|
+
|
|
|
+- var newIndex = (arrayIndexOf(focusableElems, elem) * 1 + 3 + amount) % 3;
|
|
|
++ var newIndex = (focusableElems.indexOf(elem) + 3 + amount) % 3;
|
|
|
+ focusableElems[newIndex].focus();
|
|
|
+
|
|
|
+ // Make it obvious this element now has focus.
|
|
|
+ var outlinedElem;
|
|
|
+ if (focusableElems[newIndex] == client.input.inputField)
|
|
|
+ outlinedElem = client.input.parentNode.id;
|
|
|
+ else if (focusableElems[newIndex] == userList)
|
|
|
+ outlinedElem = "user-list-box"
|