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

merge improvements in :echo object

This commit is contained in:
Doug Kearns
2007-11-13 06:00:32 +00:00
parent 0f9951e048
commit 2985555caa

View File

@@ -45,6 +45,9 @@ vimperator.util = {
{
var type = typeof(arg);
// some objects like window.JSON or getBrowsers()._browsers need the try/catch
try
{
if (type == "number")
{
return "<span style=\"color: red;\">" + arg + "</span>";
@@ -77,8 +80,13 @@ vimperator.util = {
else
return "undefined";
}
}
catch (e)
{
return "&lt;unknown&gt;";
}
return arg;
return "&lt;unknown type&gt;";
},
// takes a string like 'google bla, www.osnews.com'
@@ -160,7 +168,7 @@ vimperator.util = {
highlightURL: function (str, force)
{
if (force || /^[a-zA-Z]+:\/\/.*\//.test(str))
if (force || /^[a-zA-Z]+:\/\//.test(str))
return "<a class='hl-URL' href='" + str + "'>" + vimperator.util.escapeHTML(str) + "</a>";
else
return str;