From fe9086b38eb3dd39812ddf8cd0fac23ccb0be41e Mon Sep 17 00:00:00 2001 From: Felix Hayashi Date: Thu, 2 Jul 2015 23:14:55 +0200 Subject: [PATCH] added breadcrumbs to all pages --- docs/css/style.css | 15 +++++++++++ docs/data/dataset.html | 4 ++- docs/data/dataview.html | 4 ++- docs/data/index.html | 4 ++- docs/graph2d/index.html | 6 ++++- docs/graph3d/index.html | 4 ++- docs/index.html | 11 ++++++++ docs/js/main.js | 46 ++++++++++++++++++++++++++++++++++ docs/network/configure.html | 4 ++- docs/network/edges.html | 2 ++ docs/network/groups.html | 4 ++- docs/network/index.html | 4 ++- docs/network/interaction.html | 4 ++- docs/network/layout.html | 4 ++- docs/network/manipulation.html | 4 ++- docs/network/nodes.html | 2 ++ docs/network/physics.html | 4 ++- docs/timeline/index.html | 4 ++- 18 files changed, 117 insertions(+), 13 deletions(-) create mode 100644 docs/index.html create mode 100644 docs/js/main.js diff --git a/docs/css/style.css b/docs/css/style.css index 0ace0e09..721d6b8c 100644 --- a/docs/css/style.css +++ b/docs/css/style.css @@ -188,4 +188,19 @@ pre.options { pre.hidden { display:none; +} + +#breadcrumbs { + font-size: 0.85em; +} + +#breadcrumbs::before { + content: "You are here:"; + padding-right: 5px; +} + +#breadcrumbs > *:not(:first-child)::before{ + content: "▸"; + padding: 0 2px 0 5px; + display:inline-block; } \ No newline at end of file diff --git a/docs/data/dataset.html b/docs/data/dataset.html index deb03cd8..28e9ec23 100644 --- a/docs/data/dataset.html +++ b/docs/data/dataset.html @@ -996,4 +996,6 @@ var positiveBalance = dataset.get({ - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/data/dataview.html b/docs/data/dataview.html index 61589c9a..e74e3971 100644 --- a/docs/data/dataview.html +++ b/docs/data/dataview.html @@ -386,4 +386,6 @@ view.on('*', function (event, properties, senderId) { - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/data/index.html b/docs/data/index.html index d5738c31..19078230 100644 --- a/docs/data/index.html +++ b/docs/data/index.html @@ -111,4 +111,6 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/graph2d/index.html b/docs/graph2d/index.html index 10c4606e..28025771 100644 --- a/docs/graph2d/index.html +++ b/docs/graph2d/index.html @@ -1411,4 +1411,8 @@ Graph2d.off('rangechanged', onChange); - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/docs/graph3d/index.html b/docs/graph3d/index.html index 0f7faa0a..979e8f64 100644 --- a/docs/graph3d/index.html +++ b/docs/graph3d/index.html @@ -765,4 +765,6 @@ graph3d.on('cameraPositionChange', onCameraPositionChange); - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..c43b3221 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,11 @@ + + + + + + Page Redirection + + + If you are not redirected automatically, follow this link. + + \ No newline at end of file diff --git a/docs/js/main.js b/docs/js/main.js new file mode 100644 index 00000000..ac5a3275 --- /dev/null +++ b/docs/js/main.js @@ -0,0 +1,46 @@ +$(document).ready(function() { + + vis.createBreadcrumbs($(".container.full").first()); + +}); + +// namespace +var vis = {}; + +/** + * Adds a breadcrumb as first child to the specified container. + * + * @author felixhayashi + */ +vis.createBreadcrumbs = function(container) { + + // use the url to infer the path + var crumbs = location.pathname.split('/'); + + // number of ancestor directories + var stepbackIndex = crumbs.length-1; + var breadcrumbs = $.map(crumbs, function(crumb, i) { + + // first and last element of the split + if(!crumb) return; + + stepbackIndex--; + + if(/\.html$/.test(crumb)) { + + // strip the .html to make it look prettier + return "" + crumb.replace(/\.html$/, "") + ""; + + } else { + + // calculate the relative url + for(var ref=crumb+"/", j=0; j" + crumb + ""; + } + }).join("") || "Home"; + + // insert into the container at the beginning. + $(container).prepend("
" + breadcrumbs + "
"); + +}; \ No newline at end of file diff --git a/docs/network/configure.html b/docs/network/configure.html index 1dda331b..91409abf 100644 --- a/docs/network/configure.html +++ b/docs/network/configure.html @@ -168,4 +168,6 @@ function (option, path) { - \ No newline at end of file + + + diff --git a/docs/network/edges.html b/docs/network/edges.html index 176aba61..d8dcc469 100644 --- a/docs/network/edges.html +++ b/docs/network/edges.html @@ -660,3 +660,5 @@ var options: { + + \ No newline at end of file diff --git a/docs/network/groups.html b/docs/network/groups.html index a6998600..b78b28c7 100644 --- a/docs/network/groups.html +++ b/docs/network/groups.html @@ -152,4 +152,6 @@ var options = { - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/network/index.html b/docs/network/index.html index ca7ade2e..c994f583 100644 --- a/docs/network/index.html +++ b/docs/network/index.html @@ -1565,4 +1565,6 @@ var network = new vis.Network(container, data, options); - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/network/interaction.html b/docs/network/interaction.html index 6b93e907..2d20f0aa 100644 --- a/docs/network/interaction.html +++ b/docs/network/interaction.html @@ -146,4 +146,6 @@ network.setOptions(options); - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/network/layout.html b/docs/network/layout.html index 9922f836..b9b04335 100644 --- a/docs/network/layout.html +++ b/docs/network/layout.html @@ -126,4 +126,6 @@ network.setOptions(options); - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/network/manipulation.html b/docs/network/manipulation.html index 067ad3d8..33cb2d1d 100644 --- a/docs/network/manipulation.html +++ b/docs/network/manipulation.html @@ -178,4 +178,6 @@ var options = { - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/network/nodes.html b/docs/network/nodes.html index 413ce6b6..a378b866 100644 --- a/docs/network/nodes.html +++ b/docs/network/nodes.html @@ -647,3 +647,5 @@ mySize = minSize + diff * scale; + + \ No newline at end of file diff --git a/docs/network/physics.html b/docs/network/physics.html index 9edb3efe..a4ac3e51 100644 --- a/docs/network/physics.html +++ b/docs/network/physics.html @@ -196,4 +196,6 @@ network.setOptions(options); - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/timeline/index.html b/docs/timeline/index.html index 4e1ec429..0359e32c 100644 --- a/docs/timeline/index.html +++ b/docs/timeline/index.html @@ -1606,4 +1606,6 @@ var options = { - \ No newline at end of file + + + \ No newline at end of file