1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 22:07:59 +01:00

initial commit of multiline echo()

This commit is contained in:
Martin Stubenschrott
2007-06-27 13:10:44 +00:00
parent f43ad36110
commit 10aba69c3d
3 changed files with 20 additions and 3 deletions

View File

@@ -74,6 +74,9 @@ function CommandLine() //{{{
var prompt_widget = document.getElementById('vimperator-commandline-prompt');
// The command bar which contains the current command
var command_widget = document.getElementById('vimperator-commandline-command');
// The widget used for multiline in-/output
var multiline_widget = document.getElementById("vimperator-multiline");
multiline_widget.contentDocument.body.setAttribute("style", "margin: 0px; font-family: -moz-fixed;"); // get rid of the default border
// we need to save the mode which were in before opening the command line
// this is then used if we focus the command line again without the "official"
@@ -130,7 +133,20 @@ function CommandLine() //{{{
// Sets the command - e.g. 'tabopen', 'open http://example.com/'
function setCommand(cmd)
{
command_widget.value = cmd;
// FIXME: very simple, buggy version as of yet, just a tech-demo --mst
//multiline_widget.contentDocument.designMode ="on";
// multiline
if (cmd.indexOf("\n") > -1 || cmd.indexOf("\\n") > -1 || cmd.indexOf("<br>") > -1 || cmd.indexOf("<br/>") > -1)
{
multiline_widget.collapsed = false;
cmd = cmd.replace(/\n|\\n/g, "<br/>") + "<br/><span style=\"color: green;\">Press ENTER or type command to continue</span>";
multiline_widget.contentDocument.body.innerHTML = cmd;
}
else
{
multiline_widget.collapsed = true;
command_widget.value = cmd;
}
}
function addToHistory(str)