1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-04 10:25:48 +01:00

move the global evaluateXPath() function to vimperator.buffer

This commit is contained in:
Doug Kearns
2007-08-16 11:14:50 +00:00
parent 1ec6743b5d
commit 7352f0a680
4 changed files with 33 additions and 36 deletions

View File

@@ -138,6 +138,28 @@ function Buffer() //{{{
return window.content.document.title;
});
// returns an XPathResult object
this.evaluateXPath = function(expression, doc, ordered)
{
if (!doc)
doc = window.content.document;
var result = doc.evaluate(expression, doc,
function lookupNamespaceURI(prefix) {
switch (prefix) {
case 'xhtml':
return 'http://www.w3.org/1999/xhtml';
default:
return null;
}
},
ordered ? XPathResult.ORDERED_NODE_SNAPSHOT_TYPE : XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null
);
return result;
}
// TODO: move to v.buffers.list()
this.list = function(fullmode)
{