add js versions of basename and dirname

This commit is contained in:
Robin Appelman 2012-09-08 23:56:37 +02:00
parent 46422e6dbe
commit b14265b5c3
1 changed files with 6 additions and 0 deletions

View File

@ -154,6 +154,12 @@ OC={
$('head').append(style);
}
},
basename: function(path) {
return path.replace(/\\/g,'/').replace( /.*\//, '' );
},
dirname: function(path) {
return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, '');;
}
/**
* do a search query and display the results
* @param query the search query