mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 17:42:27 +01:00
whitespace fixes
This commit is contained in:
@@ -1110,6 +1110,7 @@ liberator.ItemList = function (id) //{{{
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
const CONTEXT_LINES = 3;
|
const CONTEXT_LINES = 3;
|
||||||
var maxItems = 20;
|
var maxItems = 20;
|
||||||
var minItems = 2;
|
var minItems = 2;
|
||||||
@@ -1144,11 +1145,13 @@ liberator.ItemList = function (id) //{{{
|
|||||||
var selectedElement = null;
|
var selectedElement = null;
|
||||||
|
|
||||||
// FIXME: ItemList shouldn't know of favicons of course, so also temporary
|
// FIXME: ItemList shouldn't know of favicons of course, so also temporary
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
var faviconService = Components.classes["@mozilla.org/browser/favicon-service;1"].getService(Components.interfaces.nsIFaviconService);
|
var faviconService = Components.classes["@mozilla.org/browser/favicon-service;1"].getService(Components.interfaces.nsIFaviconService);
|
||||||
const ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
const ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||||
.getService(Components.interfaces.nsIIOService);
|
.getService(Components.interfaces.nsIIOService);
|
||||||
} catch (e) { } // for muttator!
|
}
|
||||||
|
catch (e) { } // for muttator!
|
||||||
|
|
||||||
|
|
||||||
// TODO: temporary, to be changed/removed
|
// TODO: temporary, to be changed/removed
|
||||||
@@ -1219,17 +1222,19 @@ liberator.ItemList = function (id) //{{{
|
|||||||
{
|
{
|
||||||
if (listOffset == offset || offset < 0 || offset >= completions.length)
|
if (listOffset == offset || offset < 0 || offset >= completions.length)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (listIndex > -1 && offset == listOffset + 1)
|
if (listIndex > -1 && offset == listOffset + 1)
|
||||||
{
|
{
|
||||||
listOffset = offset;
|
listOffset = offset;
|
||||||
var icon = "";
|
var icon = "";
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
var uri = ioService.newURI(completions[offset][0], null, null);
|
var uri = ioService.newURI(completions[offset][0], null, null);
|
||||||
icon = faviconService.getFaviconImageForPage(uri).spec;
|
icon = faviconService.getFaviconImageForPage(uri).spec;
|
||||||
} catch (e) { }
|
}
|
||||||
|
catch (e) { }
|
||||||
|
|
||||||
var row = createRow(icon, completions[offset + maxItems - 1][0], completions[offset + maxItems - 1][1]);
|
var row = createRow(icon, completions[offset + maxItems - 1][0], completions[offset + maxItems - 1][1]);
|
||||||
var e = doc.getElementsByTagName("tbody");
|
var e = doc.getElementsByTagName("tbody");
|
||||||
e[e.length - 1].removeChild(e[e.length - 1].firstElementChild);
|
e[e.length - 1].removeChild(e[e.length - 1].firstElementChild);
|
||||||
e[e.length - 1].appendChild(row);
|
e[e.length - 1].appendChild(row);
|
||||||
@@ -1240,11 +1245,13 @@ liberator.ItemList = function (id) //{{{
|
|||||||
{
|
{
|
||||||
listOffset = offset;
|
listOffset = offset;
|
||||||
var icon = "";
|
var icon = "";
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
var uri = ioService.newURI(completions[offset][0], null, null);
|
var uri = ioService.newURI(completions[offset][0], null, null);
|
||||||
icon = faviconService.getFaviconImageForPage(uri).spec;
|
icon = faviconService.getFaviconImageForPage(uri).spec;
|
||||||
} catch (e) { }
|
}
|
||||||
var row = createRow(icon, completions[offset][0], completions[offset][1]);
|
catch (e) { }
|
||||||
|
var row = createRow(icon, completions[offset][0], completions[offset][1]);
|
||||||
var e = doc.getElementsByTagName("tbody");
|
var e = doc.getElementsByTagName("tbody");
|
||||||
e[e.length - 1].removeChild(e[e.length - 1].lastElementChild);
|
e[e.length - 1].removeChild(e[e.length - 1].lastElementChild);
|
||||||
e[e.length - 1].insertBefore(row, e[e.length - 1].firstElementChild);
|
e[e.length - 1].insertBefore(row, e[e.length - 1].firstElementChild);
|
||||||
@@ -1258,7 +1265,7 @@ liberator.ItemList = function (id) //{{{
|
|||||||
|
|
||||||
var div = doc.createElement("div");
|
var div = doc.createElement("div");
|
||||||
div.setAttribute("class", "ex-command-output hl-Normal");
|
div.setAttribute("class", "ex-command-output hl-Normal");
|
||||||
div.innerHTML = "<span class=\"hl-Title\">Completions:</span>";
|
div.innerHTML = "<span class=\"hl-Title\" style=\"font-weight: bold\">Completions:</span>";
|
||||||
var table = doc.createElement("table");
|
var table = doc.createElement("table");
|
||||||
table.setAttribute("width", "100%");
|
table.setAttribute("width", "100%");
|
||||||
table.setAttribute("style", "table-layout: fixed; width: 100%");
|
table.setAttribute("style", "table-layout: fixed; width: 100%");
|
||||||
@@ -1272,11 +1279,13 @@ liberator.ItemList = function (id) //{{{
|
|||||||
if (i >= listOffset && i - listOffset < maxItems)
|
if (i >= listOffset && i - listOffset < maxItems)
|
||||||
{
|
{
|
||||||
var icon = "";
|
var icon = "";
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
var uri = ioService.newURI(elem[0], null, null);
|
var uri = ioService.newURI(elem[0], null, null);
|
||||||
icon = faviconService.getFaviconImageForPage(uri).spec;
|
icon = faviconService.getFaviconImageForPage(uri).spec;
|
||||||
//dump(icon + "\n");
|
//dump(icon + "\n");
|
||||||
} catch (e) { }
|
}
|
||||||
|
catch (e) { }
|
||||||
|
|
||||||
if (i == -132434)
|
if (i == -132434)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user