mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 16:22:27 +01:00
pass the UI font size to the completion widget's content document
This commit is contained in:
@@ -87,15 +87,24 @@ liberator.CommandLine = function () //{{{
|
|||||||
|
|
||||||
// the widget used for multiline output
|
// the widget used for multiline output
|
||||||
var multilineOutputWidget = document.getElementById("liberator-multiline-output");
|
var multilineOutputWidget = document.getElementById("liberator-multiline-output");
|
||||||
var outputContainer = multilineOutputWidget.parentNode;
|
|
||||||
multilineOutputWidget.contentDocument.body.setAttribute("style", "margin: 0px; font-family: -moz-fixed;"); // get rid of the default border
|
|
||||||
multilineOutputWidget.contentDocument.body.innerHTML = "";
|
|
||||||
var stylesheet = multilineOutputWidget.contentDocument.createElement("link");
|
var stylesheet = multilineOutputWidget.contentDocument.createElement("link");
|
||||||
stylesheet.setAttribute("rel", "stylesheet");
|
stylesheet.setAttribute("rel", "stylesheet");
|
||||||
stylesheet.setAttribute("type", "text/css");
|
stylesheet.setAttribute("type", "text/css");
|
||||||
stylesheet.setAttribute("href", "chrome://" + liberator.config.name.toLowerCase() + "/skin/vimperator.css");
|
stylesheet.setAttribute("href", "chrome://" + liberator.config.name.toLowerCase() + "/skin/vimperator.css");
|
||||||
multilineOutputWidget.contentDocument.getElementsByTagName("head")[0].appendChild(stylesheet);
|
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 id = liberator.config.mainWindowID || "main-window";
|
||||||
|
var fontSize = document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue("font-size");
|
||||||
|
multilineOutputWidget.contentDocument.body.setAttribute("style", "font-size: " + fontSize);
|
||||||
|
|
||||||
|
multilineOutputWidget.contentDocument.body.innerHTML = "";
|
||||||
|
|
||||||
|
var outputContainer = multilineOutputWidget.parentNode;
|
||||||
|
|
||||||
// the widget used for multiline intput
|
// the widget used for multiline intput
|
||||||
var multilineInputWidget = document.getElementById("liberator-multiline-input");
|
var multilineInputWidget = document.getElementById("liberator-multiline-input");
|
||||||
|
|
||||||
@@ -187,10 +196,6 @@ liberator.CommandLine = function () //{{{
|
|||||||
//outputContainer.collapsed = true;
|
//outputContainer.collapsed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var id = liberator.config.mainWindowID || "main-window";
|
|
||||||
var fontSize = document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue("font-size");
|
|
||||||
multilineOutputWidget.contentDocument.body.setAttribute("style", "font-size: " + fontSize);
|
|
||||||
multilineOutputWidget.contentDocument.body.id = "liberator-multiline-output-content";
|
|
||||||
multilineOutputWidget.contentDocument.body.innerHTML = output;
|
multilineOutputWidget.contentDocument.body.innerHTML = output;
|
||||||
|
|
||||||
var availableHeight = 250;
|
var availableHeight = 250;
|
||||||
@@ -1114,7 +1119,7 @@ liberator.ItemList = function (id) //{{{
|
|||||||
var iframe = document.getElementById(id);
|
var iframe = document.getElementById(id);
|
||||||
if (!iframe)
|
if (!iframe)
|
||||||
{
|
{
|
||||||
liberator.log("No iframe with id: " + id + " found, strange things may happen!")
|
liberator.log("No iframe with id: " + id + " found, strange things may happen!") // "The truth is out there..." -- djk
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1122,11 +1127,17 @@ liberator.ItemList = function (id) //{{{
|
|||||||
var container = iframe.parentNode;
|
var container = iframe.parentNode;
|
||||||
|
|
||||||
var stylesheet = doc.createElement("link");
|
var stylesheet = doc.createElement("link");
|
||||||
stylesheet.setAttribute("rel", "Stylesheet");
|
stylesheet.setAttribute("rel", "stylesheet");
|
||||||
|
stylesheet.setAttribute("type", "text/css");
|
||||||
stylesheet.setAttribute("href", "chrome://" + liberator.config.name.toLowerCase() + "/skin/vimperator.css");
|
stylesheet.setAttribute("href", "chrome://" + liberator.config.name.toLowerCase() + "/skin/vimperator.css");
|
||||||
doc.body.id = id + "-content";
|
|
||||||
doc.getElementsByTagName("head")[0].appendChild(stylesheet);
|
doc.getElementsByTagName("head")[0].appendChild(stylesheet);
|
||||||
|
|
||||||
|
doc.body.id = id + "-content";
|
||||||
|
|
||||||
|
var id = liberator.config.mainWindowID || "main-window";
|
||||||
|
var fontSize = document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue("font-size");
|
||||||
|
doc.body.setAttribute("style", "font-size: " + fontSize);
|
||||||
|
|
||||||
var completions = []; // a reference to the Array of completions
|
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
|
var listOffset = -1; // how many items is the displayed list shifted from the internal tab index
|
||||||
var listIndex = -1; // listOffset + listIndex = completions[item]
|
var listIndex = -1; // listOffset + listIndex = completions[item]
|
||||||
|
|||||||
Reference in New Issue
Block a user