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:
@@ -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]);
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user