From 91622c1edf28350bb8288c8b9ed0b25f4792deab Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 23 Mar 2018 12:12:25 +0100 Subject: [PATCH] beginning to implement clean url --- index.html | 12 ++++----- index.php | 62 ++++++++++++++++++++++++++++++++++++++++++++++ js/main.js | 13 ++++++---- main.html | 4 +-- overview.html | 20 +++++++-------- video/video1.html | 4 +-- video/video10.html | 4 +-- video/video2.html | 4 +-- video/video3.html | 4 +-- video/video4.html | 4 +-- video/video5.html | 4 +-- video/video6.html | 4 +-- video/video7.html | 4 +-- video/video8.html | 4 +-- video/video9.html | 4 +-- 15 files changed, 108 insertions(+), 43 deletions(-) create mode 100644 index.php diff --git a/index.html b/index.html index a14084b..48bfd64 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - Ausstellung-Virtuell | Folge und Varianz + Folge & Varianz | Ausstellung-Virtuell @@ -20,7 +20,7 @@
- +

Ausstellung-Virtuell

Folge & Varianz

@@ -29,8 +29,8 @@ @@ -49,8 +49,8 @@
- Zur Werkübersicht - Zur ersten Episode + Zur Werkübersicht + Zur ersten Episode
diff --git a/index.php b/index.php new file mode 100644 index 0000000..b737c5e --- /dev/null +++ b/index.php @@ -0,0 +1,62 @@ + + + + + + + Folge & Varianz | Ausstellung-Virtuell + + + + + + + + + + + + +
+ + + +

Ausstellung-Virtuell

+

Folge & Varianz

+
+ +
+ + + + + + + + +
+ + + + + + + +"; + echo " load_page('main.html', 'Folge & Varianz | Ausstellung-Virtuell');"; + echo ""; + } +?> + + + + diff --git a/js/main.js b/js/main.js index e2a14d3..1e2bdf5 100644 --- a/js/main.js +++ b/js/main.js @@ -12,25 +12,28 @@ $('body').on('click','.btn, .nav-item, logo, .video-item', function(e) { if ($(this).prop('tagName') == "A") { var $this = $(this), + title = $this.attr("title"), url = $this.attr("href"); } else { var $this = $(this).find('a'), + title = $this.attr("title"), url = $this.attr("href"); } - load_page(url); + load_page(url, title); return false; }); -function load_page(url) { +function load_page(url, title) { $("content").empty(); $("content").hide().load(url).fadeIn('fast'); - window.history.pushState('', '', url); + document.title = title; + window.history.pushState({url: "" + url + "", title: "" + title + ""}, title, url); } -window.onpopstate = function(event) { - load_page(location.pathname); +window.onpopstate = function(e) { + load_page(e.state ? e.state.url : null, e.state ? e.state.title : null); }; diff --git a/main.html b/main.html index aa2622d..e973809 100644 --- a/main.html +++ b/main.html @@ -9,8 +9,8 @@
- Zur Werkübersicht - Zur ersten Episode + Zur Werkübersicht + Zur ersten Episode
diff --git a/overview.html b/overview.html index 4256119..9158ed2 100644 --- a/overview.html +++ b/overview.html @@ -12,70 +12,70 @@
- + Bubbles Die digital projizierten Seifenblasen reagieren auf die Interaktion des Besuchers. In der Installation von Wolfgang Muench und Kiyoshi Furukawa treffen digitale und reale Welt aufeinander. diff --git a/video/video1.html b/video/video1.html index 11899b7..1b8a4b8 100644 --- a/video/video1.html +++ b/video/video1.html @@ -69,8 +69,8 @@
diff --git a/video/video10.html b/video/video10.html index 99618ac..d14e428 100644 --- a/video/video10.html +++ b/video/video10.html @@ -68,8 +68,8 @@ diff --git a/video/video2.html b/video/video2.html index e6efa50..fede709 100644 --- a/video/video2.html +++ b/video/video2.html @@ -69,8 +69,8 @@ diff --git a/video/video3.html b/video/video3.html index 499a2f6..184b6f9 100644 --- a/video/video3.html +++ b/video/video3.html @@ -68,8 +68,8 @@ diff --git a/video/video4.html b/video/video4.html index 3956105..e92a17e 100644 --- a/video/video4.html +++ b/video/video4.html @@ -68,8 +68,8 @@ diff --git a/video/video5.html b/video/video5.html index 1d456a4..433d5be 100644 --- a/video/video5.html +++ b/video/video5.html @@ -68,8 +68,8 @@ diff --git a/video/video6.html b/video/video6.html index 5e755bf..689dc81 100644 --- a/video/video6.html +++ b/video/video6.html @@ -68,8 +68,8 @@ diff --git a/video/video7.html b/video/video7.html index 006ea73..f97760a 100644 --- a/video/video7.html +++ b/video/video7.html @@ -68,8 +68,8 @@ diff --git a/video/video8.html b/video/video8.html index 11649ba..15a74da 100644 --- a/video/video8.html +++ b/video/video8.html @@ -68,8 +68,8 @@ diff --git a/video/video9.html b/video/video9.html index 44be2f1..06e670c 100644 --- a/video/video9.html +++ b/video/video9.html @@ -76,8 +76,8 @@ -- GitLab