mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 11:27:58 +01:00
More, more, more of the same.
This commit is contained in:
@@ -289,16 +289,13 @@ liberator.Options = function () //{{{
|
||||
{
|
||||
if (!args)
|
||||
{
|
||||
XML.prettyPrinting = false;
|
||||
var str = <></>;
|
||||
for (let [i, value] in Iterator(liberator.globalVariables))
|
||||
{
|
||||
if (typeof value == "number")
|
||||
var prefix = "#";
|
||||
else if (typeof value == "function")
|
||||
var prefix = "*";
|
||||
else
|
||||
var prefix = "";
|
||||
|
||||
let prefix = typeof value == "number" ? "#" :
|
||||
typeof value == "function" ? "*" :
|
||||
" ";
|
||||
str += <tr><td style="width: 200px;">{i}</td><td>{prefix}{value}</td></tr>;
|
||||
}
|
||||
if (str.length())
|
||||
@@ -362,12 +359,9 @@ liberator.Options = function () //{{{
|
||||
}
|
||||
|
||||
var value = reference[0][reference[1]];
|
||||
if (typeof value == "number")
|
||||
var prefix = "#";
|
||||
else if (typeof value == "function")
|
||||
var prefix = "*";
|
||||
else
|
||||
var prefix = "";
|
||||
let prefix = typeof value == "number" ? "#" :
|
||||
typeof value == "function" ? "*" :
|
||||
" ";
|
||||
liberator.echo(reference[1] + "\t\t" + prefix + value);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -710,11 +710,10 @@ liberator.Tabs = function () //{{{
|
||||
list: function ()
|
||||
{
|
||||
// TODO: move this to liberator.tabs.get()
|
||||
var items = liberator.completion.buffer("")[1];
|
||||
var number, indicator, title, url;
|
||||
|
||||
var list = ":" + (liberator.util.escapeHTML(liberator.commandline.getCommand()) || "buffers") + "<br/>" + "<table>";
|
||||
for (let i = 0; i < items.length; i++)
|
||||
XML.prettyPrinting = false;
|
||||
let items = <></>;
|
||||
for (let [i, item] in Iterator(liberator.completion.buffer("")[1]))
|
||||
{
|
||||
if (i == liberator.tabs.index())
|
||||
indicator = " <span style=\"color: blue\">%</span> ";
|
||||
@@ -723,17 +722,17 @@ liberator.Tabs = function () //{{{
|
||||
else
|
||||
indicator = " ";
|
||||
|
||||
[number, title] = items[i][0].split(/:\s+/, 2);
|
||||
url = items[i][1];
|
||||
url = liberator.util.escapeHTML(url);
|
||||
title = liberator.util.escapeHTML(title);
|
||||
|
||||
list += "<tr><td align=\"right\"> " + number + "</td><td>" + indicator +
|
||||
"</td><td style=\"width: 250px; max-width: 500px; overflow: hidden;\">" + title +
|
||||
"</td><td><a href=\"#\" class=\"hl-URL buffer-list\">" + url + "</a></td></tr>";
|
||||
let [number, title] = items[i][0].split(/:\s+/, 2);
|
||||
items +=
|
||||
<tr>
|
||||
<td align="right"> {number}</td>
|
||||
<td><span style="color: blue"> {indicator} </span></td>
|
||||
<td style="width:250px; max-width: 500px; overflow: hidden">{title}</td>
|
||||
<td><a href="#" class="hl-URL buffer-list">{item[1]}</a></td>
|
||||
</tr>;
|
||||
}
|
||||
list += "</table>";
|
||||
|
||||
let list = liberator.buffer.template.generic(<table>{items}</table>);
|
||||
liberator.commandline.echo(list, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE);
|
||||
},
|
||||
|
||||
|
||||
@@ -1256,7 +1256,11 @@ liberator.ItemList = function (id) //{{{
|
||||
var row = doc.createElement("tr");
|
||||
row.setAttribute("class", "liberator-compitem");
|
||||
var icon = doc.createElement("td");
|
||||
icon.innerHTML = '<td style="vertical-align: middle"><img src="' + a + '" width="16px" height="16px"/></td><td style="vertical-align:middle">' + b + ' <br/><span style="color: green">' + c + '</span></td>';
|
||||
XML.prettyPrinting = false;
|
||||
icon.innerHTML = <>
|
||||
<td style="vertical-align: middle"><img src={a} width="16px" height="16px"/></td>
|
||||
<td style="vertical-align:middle">{b}<br/><span style="color: green">{c}</span></td>;
|
||||
</>;
|
||||
row.appendChild(icon);
|
||||
|
||||
return row;
|
||||
|
||||
@@ -67,13 +67,13 @@ liberator.util = { //{{{
|
||||
// for java packages value.toString() would crash so badly
|
||||
// that we cannot even try/catch it
|
||||
if (/^\[JavaPackage.*\]$/.test(arg))
|
||||
return "[JavaPackage]";
|
||||
return <>[JavaPackage]</>;
|
||||
|
||||
var str = arg.toString();
|
||||
if (typeof str == "string") // can be "undefined"
|
||||
return <>{str}</>;
|
||||
else
|
||||
return "undefined";
|
||||
return <>undefined</>;
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
@@ -201,6 +201,13 @@ liberator.util = { //{{{
|
||||
// if color = true it uses HTML markup to color certain items
|
||||
objectToString: function (object, color)
|
||||
{
|
||||
/* Use E4X literals so html is automatically quoted
|
||||
* only when it's asked for. Noone wants to see <
|
||||
* on their console or :map :foo in their buffer
|
||||
* when they expect :map <C-f> :foo.
|
||||
*/
|
||||
XML.prettyPrinting = false;
|
||||
|
||||
if (object === null)
|
||||
return "null";
|
||||
|
||||
@@ -215,12 +222,11 @@ liberator.util = { //{{{
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
obj = "<Object>";
|
||||
obj = "<Object>";
|
||||
}
|
||||
|
||||
if (color)
|
||||
string += "<span class=\"hl-Title\">" + obj + "</span>::\n";
|
||||
else
|
||||
obj = <span class="hl-Title">{obj}</span>.toXMLString();
|
||||
string += obj + "::\n";
|
||||
|
||||
try // window.content often does not want to be queried with "var i in object"
|
||||
@@ -234,15 +240,13 @@ liberator.util = { //{{{
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
value = "<no value>";
|
||||
value = "<no value>";
|
||||
}
|
||||
|
||||
if (color)
|
||||
{
|
||||
value = this.colorize(value, true);
|
||||
string += "<span style=\"font-weight: bold;\">" + i + "</span>: " + value + "\n";
|
||||
if (color) {
|
||||
value = this.colorize(value, true).toXMLString();
|
||||
i = <span style="font-weight: bold;">{i}</span>.toXMLString();
|
||||
}
|
||||
else
|
||||
string += i + ": " + value + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user