1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-03 06:54:12 +01:00

make sure frame, iframe and area elements are properly hinted on XHTML pages

This commit is contained in:
Doug Kearns
2007-10-30 09:54:48 +00:00
parent 8c5aaa384f
commit 4a5f71e72d
3 changed files with 10 additions and 9 deletions

View File

@@ -49,13 +49,13 @@ vimperator.Hints = function() //{{{
var x = 0, y = 0;
var elem = valid_hints[0];
var elemTagName = elem.tagName;
var elemTagName = elem.localName.toLowerCase();
elem.focus();
if (elemTagName == 'FRAME' || elemTagName == 'IFRAME')
if (elemTagName == 'frame' || elemTagName == 'iframe')
return 0;
// for imagemap
if (elemTagName == 'AREA')
if (elemTagName == 'area')
{
var coords = elem.getAttribute("coords").split(",");
x = Number(coords[0]);
@@ -82,7 +82,8 @@ vimperator.Hints = function() //{{{
var elem = valid_hints[0];
var doc = window.content.document;
if (elem.tagName == 'FRAME' || elem.tagName == 'IFRAME')
var elemTagName = elem.localName.toLowerCase();
if (elemtagName == 'frame' || elemtagName == 'iframe')
{
elem.contentWindow.focus();
return;
@@ -96,7 +97,7 @@ vimperator.Hints = function() //{{{
var x = 0;
var y = 0;
// for imagemap
if (elem.tagName == 'AREA')
if (elemtagName == 'area')
{
var coords = elem.getAttribute("coords").split(",");
x = Number(coords[0]);

View File

@@ -503,7 +503,7 @@ const vimperator = (function() //{{{
var str = vimperator.io.readFile(filename);
// handle pure javascript files specially
if (filename.search("\.js$") != -1)
if (/\.js$/.test(filename))
{
eval(str);
}
@@ -654,7 +654,7 @@ const vimperator = (function() //{{{
var files = vimperator.io.readDirectory(plugin_dir.path);
vimperator.log("Sourcing plugin directory...", 3);
files.forEach(function(file) {
if (!file.isDirectory() && /\.js$/.test(file.path))
if (!file.isDirectory() && /\.(js|vimp)$/i.test(file.path))
vimperator.source(file.path, false);
});
}