mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-10 21:45:47 +01:00
add onMultilineOutputEvent for handling more-prompt keypress events
This commit is contained in:
@@ -146,6 +146,9 @@ function CommandLine() //{{{
|
|||||||
|
|
||||||
multiline_output_widget.style.height = height + "px";
|
multiline_output_widget.style.height = height + "px";
|
||||||
multiline_output_widget.collapsed = false;
|
multiline_output_widget.collapsed = false;
|
||||||
|
setTimeout(function() {
|
||||||
|
multiline_output_widget.focus();
|
||||||
|
}, 10);
|
||||||
multiline_output_widget.contentWindow.scrollTo(0, content_height); // scroll to the end when 'nomore' is set
|
multiline_output_widget.contentWindow.scrollTo(0, content_height); // scroll to the end when 'nomore' is set
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -530,7 +533,7 @@ function CommandLine() //{{{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.onMultilineEvent = function(event)
|
this.onMultilineInputEvent = function(event)
|
||||||
{
|
{
|
||||||
// for now we just receive keypress events
|
// for now we just receive keypress events
|
||||||
|
|
||||||
@@ -548,6 +551,16 @@ function CommandLine() //{{{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.onMultilineOutputEvent = function(event)
|
||||||
|
{
|
||||||
|
var key = event.toString();
|
||||||
|
if (key == "<Return>" || key == "<C-j>" || key == "<C-m>")
|
||||||
|
{
|
||||||
|
multiline_output_widget.collapsed = true;
|
||||||
|
vimperator.focusContent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// it would be better if we had a destructor in javascript ...
|
// it would be better if we had a destructor in javascript ...
|
||||||
this.destroy = function()
|
this.destroy = function()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -100,10 +100,11 @@ the terms of any one of the MPL, the GPL or the LGPL.
|
|||||||
onblur="vimperator.commandline.onEvent(event);"/>
|
onblur="vimperator.commandline.onEvent(event);"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
|
|
||||||
<iframe id="vimperator-multiline-output" src="about:blank" flex="1" hidden="false" collapsed="true"/>
|
<iframe id="vimperator-multiline-output" src="about:blank" flex="1" hidden="false" collapsed="true"
|
||||||
|
onkeypress="vimperator.commandline.onMultilineOutputEvent(event)"/>
|
||||||
|
|
||||||
<textbox id="vimperator-multiline-input" class="plain" flex="1" rows="10" hidden="false" collapsed="true" multiline="true"
|
<textbox id="vimperator-multiline-input" class="plain" flex="1" rows="10" hidden="false" collapsed="true" multiline="true"
|
||||||
onkeypress="vimperator.commandline.onMultilineEvent(event);"/>
|
onkeypress="vimperator.commandline.onMultilineInputEvent(event);"/>
|
||||||
</vbox>
|
</vbox>
|
||||||
</toolbar>
|
</toolbar>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user