aboutsummaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-09-08 23:56:37 +0200
committerRobin Appelman <icewind@owncloud.com>2012-09-08 23:59:02 +0200
commitb14265b5c3671c260c75b1fa7b39504ea2e058e3 (patch)
tree4b1e2f52bb1300b820baa957cc4600d4036e7b09 /core/js
parent46422e6dbeac4993a4750f1dfec16f8e22a1d876 (diff)
downloadnextcloud-server-b14265b5c3671c260c75b1fa7b39504ea2e058e3.tar.gz
nextcloud-server-b14265b5c3671c260c75b1fa7b39504ea2e058e3.zip
add js versions of basename and dirname
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 1bd650bb6b8..21466a809b2 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -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