1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 16:02:26 +01:00

Back out part of my last commit.

This commit is contained in:
Kris Maglione
2008-10-04 06:15:39 +00:00
parent ce06d55415
commit 27328ca295
3 changed files with 25 additions and 30 deletions

View File

@@ -61,8 +61,7 @@ liberator.Buffer = function () //{{{
if (sheets.some(function (s) s[0] == filter && s[1] == css))
return null;
sheets.push([filter, css]);
let uri = cssUri(wrapCSS(filter, css));
this.registerSheet(uri, sss.USER_SHEET);
this.registerSheet(cssUri(wrapCSS(filter, css)));
return null;
}
@@ -71,8 +70,8 @@ liberator.Buffer = function () //{{{
if (number >= sheets.length)
return false;
let sheet = sheets.splice(number)[0];
let uri = cssUri(wrapCSS(sheet[0], sheet[1]));
this.unregisterSheet(uri, sss.USER_SHEET);
let uri =
this.unregisterSheet(cssUri(wrapCSS(sheet[0], sheet[1])));
return true;
}
@@ -152,18 +151,6 @@ liberator.Buffer = function () //{{{
let styles = liberator.storage.newObject(styles, Styles, false);
for (let sheet in arrayIter(liberator.config.userSheets || []))
styles.registerSheet(sheet);
/* FIXME: This doesn't belong here. */
let mainWindowID = liberator.config.mainWindowID || "main-window";
let fontSize = document.defaultView.getComputedStyle(document.getElementById(mainWindowID), null)
.getPropertyValue("font-size");
let name = liberator.config.name.toLowerCase();
let error = styles.addSheet("chrome://" + name + "/skin/blank-" + name + ".xhtml",
"body { font-size: " + fontSize + "}");
function setZoom(value, fullZoom)
{
if (value < 1 || value > 2000)
@@ -1398,14 +1385,10 @@ liberator.Buffer = function () //{{{
// add the frame indicator
var doc = frames[next].document;
/* Doesn't unapply...
var class = doc.body.class || "";
doc.body.setAttribute("class", class + " liberator-frame-indicator");
setTimeout(function () doc.body.setAttribute("class", class), 500);
*/
var indicator = <div id="liberator-frame-indicator"/>;
var indicator =
<div id="liberator-frame-indicator"
style="background-color: red; opacity: 0.5; z-index: 999
position: fixed; top: 0; bottom: 0; left: 0; right: 0"/>;
doc.body.appendChild(liberator.util.xmlToDom(indicator));
// remove the frame indicator

View File

@@ -121,7 +121,8 @@ liberator.CommandLine = function () //{{{
// the widget used for multiline output
var multilineOutputWidget = document.getElementById("liberator-multiline-output");
liberator.util.blankDocument(multilineOutputWidget, "liberator-multiline-output-content");
multilineOutputWidget.setAttribute("src",
liberator.util.blankDocument("liberator-multiline-output-content"));
var outputContainer = multilineOutputWidget.parentNode;
@@ -1196,7 +1197,7 @@ liberator.ItemList = function (id) //{{{
var doc;
var container = iframe.parentNode;
liberator.util.blankDocument(iframe, id + "-content");
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

View File

@@ -77,11 +77,22 @@ liberator.util = { //{{{
yield ary[i];
},
blankDocument: function (iframe, bodyId)
blankDocument: function (bodyId)
{
let name = liberator.config.name.toLowerCase();
iframe.addEventListener("load", function () iframe.contentDocument.body.setAttribute("id", bodyId), true);
iframe.setAttribute("src", "chrome://" + name + "/skin/blank-" + name + ".xhtml");
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('<?xml version="1.0" encoding="UTF-8"?>' +
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' +
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
<link rel="stylesheet" type="text/css"
href={"chrome://" + liberator.config.name.toLowerCase() + "/skin/vimperator.css"}/>
</head>
<body id={bodyId} style={"font-size: " + fontSize}/>
</html>)
},
clip: function (str, length)