1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 03:27:59 +01:00

move global isDirectory() to Commands()

This commit is contained in:
Doug Kearns
2007-08-08 10:19:41 +00:00
parent 00b76309a3
commit 556bdbf05d
2 changed files with 20 additions and 24 deletions

View File

@@ -1258,30 +1258,6 @@ String.prototype.toURLArray = function()
return urls;
}
/* returns true if the currently loaded URI is
* a directory or false if it is a file
*/
function isDirectory(url)
{
if (url.match(/^file:\/\//) || url.match(/^\//))
{
var stripedFilename = url.replace(/^(file:\/\/)?(.*)/, "$2");
var file = vimperator.fopen(stripedFilename, '<');
if (!file)
return false;
if (file.localFile.isDirectory())
return true;
else
return false;
}
// for all other locations just check if the URL ends with /
if (url.match(/\/$/))
return true;
else
return false;
}
/////////////////////////////////////////////////////////////////////}}}
// misc helper functions ///////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////{{{