summaryrefslogtreecommitdiffstats
path: root/theme/javascript/utils/url.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 09:47:36 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-19 09:47:36 +0100
commitec586dd3cdf06e9567f5d3e4961022ddc3c94778 (patch)
treecc7825ab73110b4e6fbedee404427b052edffa17 /theme/javascript/utils/url.js
parent80432161708357bdcf0e00533d9e6d327636dab6 (diff)
downloadgitbook-ec586dd3cdf06e9567f5d3e4961022ddc3c94778.zip
gitbook-ec586dd3cdf06e9567f5d3e4961022ddc3c94778.tar.gz
gitbook-ec586dd3cdf06e9567f5d3e4961022ddc3c94778.tar.bz2
Clear folder
Diffstat (limited to 'theme/javascript/utils/url.js')
-rw-r--r--theme/javascript/utils/url.js33
1 files changed, 0 insertions, 33 deletions
diff --git a/theme/javascript/utils/url.js b/theme/javascript/utils/url.js
deleted file mode 100644
index 0254299..0000000
--- a/theme/javascript/utils/url.js
+++ /dev/null
@@ -1,33 +0,0 @@
-define([
- "URIjs/URI"
-], function(URI) {
- // Joins path segments. Preserves initial "/" and resolves ".." and "."
- // Does not support using ".." to go above/outside the root.
- // This means that join("foo", "../../bar") will not resolve to "../bar"
- function join(baseUrl, url) {
- var theUrl = new URI(url);
- if (theUrl.is("relative")) {
- theUrl = theUrl.absoluteTo(baseUrl);
- }
- return theUrl.toString();
- }
-
- // A simple function to get the dirname of a path
- // Trailing slashes are ignored. Leading slash is preserved.
- function dirname(path) {
- return join(path, "..");
- }
-
- // test if a path or url is absolute
- function isAbsolute(path) {
- if (!path) return false;
-
- return (path[0] == "/" || path.indexOf("http://") == 0 || path.indexOf("https://") == 0);
- }
-
- return {
- dirname: dirname,
- join: join,
- isAbsolute: isAbsolute
- };
-}) \ No newline at end of file