diff --git a/content/buffer.js b/content/buffer.js index fb21e740..5fb98b7e 100644 --- a/content/buffer.js +++ b/content/buffer.js @@ -1829,7 +1829,13 @@ liberator.Marks = function () //{{{ } } - var list = liberator.template.marks(marks); + let list = liberator.template.tabular(["mark", "line", "col", "file"], + ["", "text-align: right", "text-align: right", "color: green"], + ([mark[0], + Math.round(mark[1].position.x & 100) + "%", + Math.round(mark[1].position.y & 100) + "%", + mark[1].location] + for each (mark in marks))); liberator.commandline.echo(list, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE); } @@ -1871,7 +1877,7 @@ liberator.template = { return new XML(xml) } catch (e) {} - return xml; + return <>{xml}; }, generic: function (xml) @@ -1928,28 +1934,6 @@ liberator.template = { ); }, - marks: function (marks) - { - return this.generic( - - - - - - - - { - this.map(marks, function (mark) - - - - - - ) - } -
marklinecolfile
{mark[0]}{Math.round(mark[1].position.y * 100)}%{Math.round(mark[1].position.x * 100)}%{mark[1].location}
); - }, - options: function (title, opts) { return this.generic( @@ -1973,15 +1957,13 @@ liberator.template = { { let table = - - - + + { this.map(data, function (datum) - + ) } diff --git a/content/ui.js b/content/ui.js index 6a49c5e8..3dac34fc 100644 --- a/content/ui.js +++ b/content/ui.js @@ -206,20 +206,19 @@ liberator.CommandLine = function () //{{{ function setMultiline(str, highlightGroup) { //outputContainer.collapsed = true; + let doc = multilineOutputWidget.contentDocument; + let win = multilineOutputWidget.contentWindow; - var output = "
" + str + "
"; + var output =
{liberator.template.maybeXML(str)}
; lastMowOutput = output; - if (!outputContainer.collapsed) - { - // FIXME: need to make sure an open MOW is closed when commands - // that don't generate output are executed - output = multilineOutputWidget.contentDocument.body.innerHTML + output; - //outputContainer.collapsed = true; - } + // FIXME: need to make sure an open MOW is closed when commands + // that don't generate output are executed + if (outputContainer.collapsed) + doc.body.innerHTML = ""; - multilineOutputWidget.contentDocument.body.innerHTML = output; + doc.body.appendChild(liberator.util.xmlToDom(output, doc)); var availableHeight = 250; try @@ -228,30 +227,30 @@ liberator.CommandLine = function () //{{{ getBrowser().mPanelContainer.boxObject.height : getBrowser().boxObject.height; } catch (e) {} - var contentHeight = multilineOutputWidget.contentDocument.height; + var contentHeight = doc.height; var height = contentHeight < availableHeight ? contentHeight : availableHeight; outputContainer.height = height + "px"; outputContainer.collapsed = false; - if (liberator.options["more"] && multilineOutputWidget.contentWindow.scrollMaxY > 0) + if (liberator.options["more"] && win.scrollMaxY > 0) { // start the last executed command's output at the top of the screen - var elements = multilineOutputWidget.contentDocument.getElementsByClassName("ex-command-output"); + var elements = doc.getElementsByClassName("ex-command-output"); elements[elements.length - 1].scrollIntoView(true); - if (multilineOutputWidget.contentWindow.scrollY >= multilineOutputWidget.contentWindow.scrollMaxY) + if (win.scrollY >= win.scrollMaxY) setLine("Press ENTER or type command to continue", liberator.commandline.HL_QUESTION); else setLine("-- More --", liberator.commandline.HL_QUESTION); } else { - multilineOutputWidget.contentWindow.scrollTo(0, contentHeight); + win.scrollTo(0, contentHeight); setLine("Press ENTER or type command to continue", liberator.commandline.HL_QUESTION); } - multilineOutputWidget.contentWindow.focus(); + win.focus(); startHints = false; liberator.modes.push(liberator.modes.COMMAND_LINE, liberator.modes.OUTPUT_MULTILINE);
{title}
{title}
- {datum[0]}{datum[0]} {liberator.template.maybeXML(datum[1])}