зеркало из https://github.com/mozilla/pjs.git
Bug 374679 - Input box shouldn't be in the tab order
r=silver@warwickcompsoc.co.uk (James Ross) ChatZilla Only.
This commit is contained in:
Родитель
df679543cf
Коммит
8f59250912
|
@ -140,10 +140,11 @@
|
|||
collapsed="true"/>
|
||||
|
||||
<hbox id="input-widgets" align="center">
|
||||
<button id="server-nick" type="menu" label=""/>
|
||||
<button id="server-nick" type="menu" label="" tooltiptext="&server-nick.tooltip;"/>
|
||||
<hbox id="multiline-box" flex="1" collapsed="true">
|
||||
<textbox id="multiline-input" multiline="true" flex="1" height="100px"
|
||||
class="multiline-input-widget" onfocus="onInputFocus();"/>
|
||||
class="multiline-input-widget" onfocus="onInputFocus();"
|
||||
tabindex="-1"/>
|
||||
<vbox>
|
||||
<toolbarbutton id="button-input" flex="1"
|
||||
oncommand="onMultilineSend(event);"
|
||||
|
@ -155,7 +156,7 @@
|
|||
</hbox>
|
||||
<hbox id="singleline-box" flex="1" collapsed="true">
|
||||
<textbox id="input" class="input-widget" flex="1"
|
||||
onfocus="onInputFocus();"/>
|
||||
onfocus="onInputFocus();" tabindex="-1"/>
|
||||
<toolbarbutton id="button-multiline-expand"
|
||||
oncommand="dispatch('pref multiline true');"
|
||||
tooltiptext="&multiline-expand.tooltip;"/>
|
||||
|
|
|
@ -459,6 +459,13 @@ function onTabCompleteRequest (e)
|
|||
else
|
||||
wordEnd += selStart;
|
||||
|
||||
// Double tab on nothing, inform user how to get out of the input box
|
||||
if (wordEnd == wordStart)
|
||||
{
|
||||
display(MSG_LEAVE_INPUTBOX, MT_INFO);
|
||||
return;
|
||||
}
|
||||
|
||||
if ("performTabMatch" in client.currentObject)
|
||||
{
|
||||
var word = line.substring(wordStart, wordEnd);
|
||||
|
@ -586,6 +593,11 @@ function onWindowKeyPress (e)
|
|||
w.scrollTo (w.pageXOffset, (w.innerHeight + w.pageYOffset));
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
||||
case 117: /* F6 */
|
||||
advanceKeyboardFocus(e.shiftKey ? -1 : 1);
|
||||
e.preventDefault();
|
||||
break;
|
||||
}
|
||||
|
||||
// Code is zero if we have an alphanumeric being given to us in the event.
|
||||
|
|
|
@ -216,6 +216,7 @@ function init()
|
|||
dispatch("networks");
|
||||
|
||||
initInstrumentation();
|
||||
setTimeout("dispatch('focus-input')", 0);
|
||||
setTimeout(processStartupURLs, 0);
|
||||
}
|
||||
|
||||
|
@ -2641,6 +2642,26 @@ function scrollDown(frame, force)
|
|||
window.scrollTo(0, window.document.height);
|
||||
}
|
||||
|
||||
function advanceKeyboardFocus(amount)
|
||||
{
|
||||
var contentWin = getContentWindow(client.currentObject.frame);
|
||||
var contentDoc = getContentDocument(client.currentObject.frame);
|
||||
var userList = document.getElementById("user-list");
|
||||
|
||||
// Focus userlist, inputbox and outputwindow in turn:
|
||||
var focusableElems = [userList, client.input.inputField, contentWin];
|
||||
|
||||
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;
|
||||
focusableElems[newIndex].focus();
|
||||
}
|
||||
|
||||
/* valid values for |what| are "superfluous", "activity", and "attention".
|
||||
* final value for state is dependant on priority of the current state, and the
|
||||
* new state. the priority is: normal < superfluous < activity < attention.
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<!ENTITY Menubar.tooltip "Main Menu">
|
||||
<!ENTITY Toolbar.tooltip "Main Toolbar">
|
||||
|
||||
|
||||
<!ENTITY multiline-expand.tooltip "Switch to multi-line input (Ctrl+Up)">
|
||||
<!ENTITY multiline-contract.tooltip "Switch to single-line input (Ctrl+Down)">
|
||||
<!ENTITY multiline-send.tooltip "Send this text (Ctrl+Enter)">
|
||||
|
||||
<!ENTITY Underline.label "Underline">
|
||||
<!ENTITY Bold.label "Bold">
|
||||
<!ENTITY Reverse.label "Reverse video">
|
||||
<!ENTITY Normal.label "Normal">
|
||||
<!ENTITY Color.label "Colour">
|
||||
<!ENTITY ForeBack.label "xx=Fore yy=Back">
|
|
@ -782,6 +782,8 @@ msg.val.off = off
|
|||
msg.plugin.enabled = Plugin ``%S'' is now enabled.
|
||||
msg.plugin.disabled = Plugin ``%S'' is now disabled.
|
||||
|
||||
msg.leave.inputbox = There is nothing to tab-complete. Use F6 to cycle through the user list, input box and the chat output.
|
||||
|
||||
## formatting ##
|
||||
msg.fmt.usage = "%1$S %2$S"
|
||||
msg.fmt.jsexception = "%1$S: %2$S @ <%3$S> %4$S"
|
||||
|
|
Загрузка…
Ссылка в новой задаче