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:
@@ -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 "<unknown>";
|
||||
}
|
||||
|
||||
return arg;
|
||||
return "<unknown type>";
|
||||
},
|
||||
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user