)
diff --git a/content/completion.js b/content/completion.js
index d65cb40a..31097bd4 100644
--- a/content/completion.js
+++ b/content/completion.js
@@ -475,7 +475,7 @@ liberator.Completion = function () //{{{
historyResult = result;
historyTimer.tell();
if (result.searchResult <= result.RESULT_SUCCESS)
- historyTimer.force();
+ historyTimer.flush();
}
});
}
diff --git a/content/io.js b/content/io.js
index 5c072e31..6d6d4e1d 100644
--- a/content/io.js
+++ b/content/io.js
@@ -323,12 +323,12 @@ liberator.IO = function () //{{{
XML.prettyPrinting = false;
var list =
- {[
+ {
+ liberator.template.map2(scriptNames, function (i, name)
{i+1}
{name}
-
- for ([i, name] in Iterator(striptNames))].reduce(liberator.buffer.template.add, <>>)
+ )
}
.toXMLString();
liberator.commandline.echo(list, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE);
diff --git a/content/ui.js b/content/ui.js
index 7b6ef29f..a1f6b749 100644
--- a/content/ui.js
+++ b/content/ui.js
@@ -121,23 +121,8 @@ liberator.CommandLine = function () //{{{
// the widget used for multiline output
var multilineOutputWidget = document.getElementById("liberator-multiline-output");
-
- var stylesheet =
- ;
-
- stylesheet = liberator.util.xmlToDom(stylesheet, multilineOutputWidget.contentDocument);
- multilineOutputWidget.contentDocument.getElementsByTagName("head")[0]
- .appendChild(stylesheet);
-
- multilineOutputWidget.contentDocument.body.id = "liberator-multiline-output-content";
-
- // TODO: is there a better way to determine and set the UI font, 'guifont' perhaps?
- var mainWindowID = liberator.config.mainWindowID || "main-window";
- var fontSize = document.defaultView.getComputedStyle(document.getElementById(mainWindowID), null).getPropertyValue("font-size");
- multilineOutputWidget.contentDocument.body.setAttribute("style", "font-size: " + fontSize);
-
- multilineOutputWidget.contentDocument.body.innerHTML = "";
+ multilineOutputWidget.setAttribute("src",
+ liberator.util.blankDocument("liberator-multiline-output-content"));
var outputContainer = multilineOutputWidget.parentNode;
@@ -1203,19 +1188,10 @@ liberator.ItemList = function (id) //{{{
return;
}
- var doc = iframe.contentDocument;
+ var doc;
var container = iframe.parentNode;
- var stylesheet = liberator.util.xmlToDom(
- , doc);
- doc.getElementsByTagName("head")[0].appendChild(stylesheet);
-
- doc.body.id = id + "-content";
-
- var mainWindowID = liberator.config.mainWindowID || "main-window";
- var fontSize = document.defaultView.getComputedStyle(document.getElementById(mainWindowID), null).getPropertyValue("font-size");
- doc.body.setAttribute("style", "font-size: " + fontSize);
+ iframe.setAttribute("src", liberator.util.blankDocument(id + "-content"));
var completions = []; // a reference to the Array of completions
var listOffset = -1; // how many items is the displayed list shifted from the internal tab index
@@ -1349,6 +1325,7 @@ liberator.ItemList = function (id) //{{{
// if @param selectedItem is given, show the list and select that item
setItems: function (items, selectedItem)
{
+ doc = iframe.contentDocument;
listOffset = listIndex = -1;
completions = items || [];
if (typeof(selectedItem) == "number")
diff --git a/content/util.js b/content/util.js
index dd8404d5..fd2de41f 100644
--- a/content/util.js
+++ b/content/util.js
@@ -77,6 +77,24 @@ liberator.util = { //{{{
yield ary[i];
},
+ blankDocument: function (bodyId)
+ {
+ let mainWindowID = liberator.config.mainWindowID || "main-window";
+ let fontSize = document.defaultView.getComputedStyle(document.getElementById(mainWindowID), null)
+ .getPropertyValue("font-size");
+
+ return 'data:application/xhtml+xml,' + encodeURI('' +
+ '' +
+
+
+
+
+
+
+ )
+ },
+
clip: function (str, length)
{
return str.length <= length ? str : str.substr(0, length - 3) + "...";
@@ -404,7 +422,8 @@ liberator.util = { //{{{
case "text":
return doc.createTextNode(node);
case "element":
- let domnode = doc.createElement(node.name());
+ // Should use the node's namespace, in the future.
+ let domnode = doc.createElementNS("http://www.w3.org/1999/xhtml", node.localName());
for each (let attr in node.@*)
domnode.setAttribute(attr.name(), String(attr));
for each (let child in node.*)