mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-29 06:52:25 +01:00
objectToString stuff.
This commit is contained in:
@@ -1013,13 +1013,18 @@ var ConfigBase = Class("ConfigBase", {
|
||||
HelpWarning /* The indicator for a warning */ \
|
||||
color: red; font-weight: bold;
|
||||
|
||||
HelpXML;;;FontCode /* Highlighted XML */ \
|
||||
color: #C5F779; background-color: #444444; font-family: Terminus, Fixed, monospace;
|
||||
HelpXMLBlock { white-space: pre; color: #C5F779; background-color: #444444;
|
||||
HelpXML;;;FontCode {
|
||||
/* Highlighted XML */
|
||||
white-space: pre;
|
||||
display: inline-block;
|
||||
color: #C5F779;
|
||||
background-color: #444444;
|
||||
border: 1px dashed #aaaaaa;
|
||||
font-family: Terminus, Fixed, monospace;
|
||||
}
|
||||
HelpXMLBlock;;;HelpXML {
|
||||
display: block;
|
||||
margin-left: 2em;
|
||||
font-family: Terminus, Fixed, monospace;
|
||||
}
|
||||
HelpXMLAttribute color: #C5F779;
|
||||
HelpXMLAttribute::after color: #E5E5E5; content: "=";
|
||||
|
||||
@@ -464,7 +464,7 @@ var DOM = Class("DOM", {
|
||||
try {
|
||||
let hasChildren = elem.firstChild && (!/^\s*$/.test(elem.firstChild) || elem.firstChild.nextSibling)
|
||||
if (color)
|
||||
res.push(<span highlight="HelpXMLBlock"><span highlight="HelpXMLTagStart"><{
|
||||
res.push(<span highlight="HelpXML"><span highlight="HelpXMLTagStart"><{
|
||||
namespaced(elem)} {
|
||||
template.map(array.iterValues(elem.attributes),
|
||||
function (attr)
|
||||
@@ -724,7 +724,15 @@ var DOM = Class("DOM", {
|
||||
let force = false;
|
||||
if (rect)
|
||||
for (let parent in this.ancestors.items) {
|
||||
if (!parent[0].clientWidth || !parent[0].clientHeight)
|
||||
continue;
|
||||
|
||||
let isect = util.intersection(rect, parent.viewport);
|
||||
|
||||
if (parent[0].clientWidth < rect.width && isect.width ||
|
||||
parent[0].clientHeight < rect.height && isect.height)
|
||||
continue;
|
||||
|
||||
force = Math.round(isect.width - rect.width) || Math.round(isect.height - rect.height);
|
||||
if (force)
|
||||
break;
|
||||
|
||||
@@ -302,7 +302,7 @@ var Template = Module("Template", {
|
||||
return <span highlight="Null">{arg}</span>;
|
||||
case "object":
|
||||
if (arg instanceof Ci.nsIDOMElement)
|
||||
return util.objectToString(arg, false);
|
||||
return util.objectToString(arg, true);
|
||||
// for java packages value.toString() would crash so badly
|
||||
// that we cannot even try/catch it
|
||||
if (/^\[JavaPackage.*\]$/.test(arg))
|
||||
|
||||
@@ -885,8 +885,10 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
if (!hasValue) {
|
||||
if (isArray(i) && i.length == 2)
|
||||
[i, value] = i;
|
||||
else
|
||||
else {
|
||||
var noVal = true;
|
||||
value = i;
|
||||
}
|
||||
}
|
||||
|
||||
value = template.highlight(value, true, 150);
|
||||
@@ -895,7 +897,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
i = parseInt(i);
|
||||
else if (/^[A-Z_]+$/.test(i))
|
||||
i = "";
|
||||
keys.push([i, <>{key}{noVal ? "" : <>: {value}</>}
</>]);
|
||||
keys.push([i, noVal ? value : <>{key}: {value}
</>]);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user