Commit de15a286 authored by Patrick's avatar Patrick
Browse files

update history

with wrong url for history (to check) 
needs to be updated before deployment
parent 74e0d12a
......@@ -217,7 +217,7 @@
<!-- <a href="#" onclick="">Luftbilder</a> -->
<div class='box-4'>
<p id="selectedBuilding" style="text-align: center; margin-top:0px;color:#000000;">Einfärben</p><div class='switch2'>
<input type='checkbox' name='toggle' id='BLayerChange' onclick='changeColor(true);'>
<input type='checkbox' name='toggle' id='BLayerChange' onclick='activateStoryFrame();'> <!--onclick='changeColor(true);-->
<label for='toggle'><i></i></label>
<span></span>
......@@ -287,7 +287,7 @@
</p>
<img style='padding-top:0px;width:12rem;' id="signature" src='images/Intro/signature.png' alt='Simply Easy Learning'><br>
<button id="tourstart-btn2" onclick="showEinleitung();" class="buttonset two"><span class="i18n_balloon_startscreen_btn">Weiter</span>
<button id="tourstart-btn2" onclick="showEinleitung();historyP2();" class="buttonset two"><span class="i18n_balloon_startscreen_btn">Weiter</span>
</div>
<details id="detAnleitung" style="display:none;">
<summary class="contentOne">Anleitung zur Benutzung der Plattform</summary>
......@@ -323,7 +323,7 @@
<br>
<button id="back-btn" onclick="showTexte();" style="display:none;float:left;" class="buttonset back"><span class="i18n_balloon_startscreen_btn">Zurück</span>
</button>
<button id="tourstart-btn" onclick="stopStory();" style="display:none;float:right;margin-right:2em;" class="buttonset two"><span class="i18n_balloon_startscreen_btn">Start</span>
<button id="tourstart-btn" onclick="stopStory();historyMap();" style="display:none;float:right;margin-right:2em;" class="buttonset two"><span class="i18n_balloon_startscreen_btn">Start</span>
</button> <br>
<div id="iconlist" style="display:none;margin-top:5rem;">
<img id="balloon_logo01" src="./icons/STUTTGARTmitPferd.png" alt="Stadt_Logo">
......@@ -339,7 +339,7 @@
<!-- End of: Content Start Screen -->
<!-- Content Tour -->
<div id="tour-frame" style="display: none; overflow-y: scroll; ">
<div class="tour-top-navi" style="z-index:99">
<div class="tour-top-navi" id="navi" style="z-index:99">
<a href="#" onclick="handleClose()" id = "testing" class="top-nav buttonset one"><i style="zoom: 1.4;" class="fa fa-close"></i></a>
<!-- <a href="#energiefahrrad" class="top-nav buttonset one"><i class="fa fa-bicycle"></i> Projekt 2</a>
<a href="#wea" class="top-nav buttonset one"><i class="fa fa-bolt"></i> Projekt 3</a>
......@@ -802,6 +802,7 @@ Die weitere Entwicklung des Areals in kurz- und längerfristigen Entwicklungssch
<script src="templates/cus_Menu.js"></script>
<script src="templates/story/virtualcitystory.js"></script>
<script src="templates/ipadspecific.js"></script>
<script src="templates/history.js"></script>
</body>
</html>
......@@ -38,6 +38,7 @@ var showEinleitung = function(){
document.getElementById("detAnleitung").style.display = "block";
document.getElementById("einlP02").scrollIntoView();
document.getElementById("back-btn").style.display = "block";
// SaveHistory();
// startVCM();
}
......@@ -49,6 +50,7 @@ var showTexte = function() {
document.getElementById("detAnleitung").style.display = "none";
document.getElementById("einlP01").scrollIntoView();
document.getElementById("back-btn").style.display = "none";
// SaveHistory()
}
// $(function () {
......
/***************************************************************
* Copyright (C) 2016 punkt.de GmbH
* Authors: Christoph Heidenreich
*
* This script is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
window.addEventListener("load", function(event) {
var stateObj = {info: "start01"};
history.pushState(stateObj, "neuerChronikEintrag", "http://localhost:8083/");
// document.body.style.backgroundColor = "yellow";
});
function historyP2(){
var stateObj = {info: "start02"};
history.pushState(stateObj, "neuerChronikEintrag", "http://localhost:8083/");
}
function historyMap(){
var stateObj = {info: "map01"};
history.pushState(stateObj, "neuerChronikEintrag", "http://localhost:8083/");
}
// function menu3(){
// var stateObj = {info: "menu03"};
// history.pushState(stateObj, "neuerChronikEintrag", "http://localhost:8089/");
// }
// function SaveHistory(){
// var page = 0;
// if (!$('#einlP01').is(':visible') && !$("#einlPO2").is(':hidden')){
// var dataObject = {
// pageOne: "1",
// one: "one"
// };
// history.pushState(dataObject, null, window.location);
// } else if ($("#einlPO2").css('display') == 'block' && $("#einlPO1").css('display') == 'none') {
// var dataObject = {
// pageTwo: "2",
// two: "two"
// };
// history.pushState(dataObject, null, window.location);
// }else if($("#balloon-startscreen").css('display') == 'none') {
// var dataObject = {
// pageThree: "3",
// three: "three"
// };
// history.pushState(dataObject, null, window.location);
// }
// }
jQuery(document).ready(function() {
var $ = jQuery;
// function replaceContentWith(html) {
// $('#replace-container').replaceWith(html);
// }
// function setMenuActiveStateForId(id) {
// $('#menu li').removeClass('active');
// $('#' + id).parent().addClass('active');
// }
// function setCurrentPage(replacementHtml, activeLinkId) {
// replaceContentWith(replacementHtml);
// setMenuActiveStateForId(activeLinkId);
// }
//--------------------------------------------------------------------------
// handle history.back functionality in event
// replace html and set active menu to restore dynamic made changes on page
//--------------------------------------------------------------------------
window.addEventListener('popstate', function(event) {
if (event.state !== null && event.state !== undefined) {
// alert(event.state.info)
if (event.state.info == "start01"){
activateStoryFrame("1")
} else if (event.state.info == "start02"){
activateStoryFrame("2")
} else if (event.state.info == "map01"){
activateStoryFrame("3")
}
}
});
//--------------------------------------------------------------------------
// replace content on click and remember the changes in browser history
//--------------------------------------------------------------------------
// $('#menu a').each(function() {
// $(this).click(function() {
// var activeLinkId = $(this).attr('id');
// var dataObject = {
// };
// $.ajax({
// method: "GET",
// url: $(this).data('url'),
// dataType: "HTML"
// })
// .done(function(html) {
// if (!$('#einlP01').is(':visible') && !$("#einlPO2").is(':hidden')){
// dataObject = {
// pageOne: "1",
// one: "one"
// };
// history.pushState(dataObject, null, window.location);
// } else if ($("#einlPO2").css('display') == 'block' && $("#einlPO1").css('display') == 'none') {
// dataObject = {
// pageTwo: "2",
// two: "two"
// };
// history.pushState(dataObject, null, window.location);
// }else if($("#balloon-startscreen").css('display') == 'none') {
// dataObject = {
// pageThree: "3",
// three: "three"
// };
// history.pushState(dataObject, null, window.location);
// }
// // this will add a new entry for the browser history like it would happen if you
// // click on a hyperlink on the page with additional information we can use for our likes
// history.pushState(dataObject, null, window.location);
// // setCurrentPage(html, activeLinkId);
// });
// });
// });
//--------------------------------------------------------------------------
// handling of first load of the page and
// jumping back from some other url for example with the impress link
//--------------------------------------------------------------------------
// if (history.state === null || history.state === undefined) {
// // store current page state in the current history
// var dataObject = {
// html: jQuery('#replace-container').wrap('<pseudo/>').parent().html(),
// activeLinkId: ''
// };
// // this replaces the current browser history entry with information (html and current active menu id)
// // we use in your popstate event to handle the state of the page on history navigation
// history.replaceState(dataObject, null, window.location);
// } else {
// // set the page state by given information from the history state
// activateStoryFrame("pageN")
// // setCurrentPage(history.state.html, history.state.activeLinkId);
// }
});
function activateStoryFrame(pageN){
if (pageN == "1"){
stopStory();
$("#story-frame").removeClass("tour-inactive");
$("#story-frame").removeClass("tour");
$("#story-frame").addClass("startscreen");
$("#balloon-startscreen").attr('style',"display:'block'!important");
$("#navi").attr('style',"display:'none'!important");
// $("#einlPO1").css('display') = 'block'
document.getElementById("einlP01").style.display = "block";
document.getElementById("einlP02").style.display = "none";
document.getElementById("tourstart-btn").style.display = "none";
document.getElementById("iconlist").style.display = "none";
document.getElementById("detAnleitung").style.display = "none";
document.getElementById("einlP01").scrollIntoView();
document.getElementById("back-btn").style.display = "none";
} else if(pageN == "2"){
stopStory();
$("#story-frame").removeClass("tour-inactive");
$("#story-frame").removeClass("tour");
$("#story-frame").addClass("startscreen");
$("#balloon-startscreen").attr('style',"display:'block'!important");
$("#navi").attr('style',"display:'none'!important");
document.getElementById("einlP01").style.display = "none";
document.getElementById("einlP02").style.display = "block";
} else if(pageN == "3"){
showMap();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment