From b14265b5c3671c260c75b1fa7b39504ea2e058e3 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Sat, 8 Sep 2012 23:56:37 +0200
Subject: [PATCH] add js versions of basename and dirname

---
 core/js/js.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/core/js/js.js b/core/js/js.js
index 1bd650bb6b..21466a809b 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
-- 
GitLab