Skip to content

Commit

Permalink
removed settimeout redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
Niki Ulmanen committed Mar 20, 2019
1 parent dedc4b7 commit 94cfcbf
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
13 changes: 8 additions & 5 deletions OodiUI/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ def start_screen():

@app.route('/main', methods=['POST', 'GET'])
def search_screen():
config = Path("/Users/nulm/Desktop/OodiMir/OodiUI/static/direction.txt")
if config.is_file():
os.remove("/Users/nulm/Desktop/OodiMir/OodiUI/static/direction.txt")
#config = Path("/Users/nulm/Desktop/OodiMir/OodiUI/static/direction.txt")
#if config.is_file():
# os.remove("/Users/nulm/Desktop/OodiMir/OodiUI/static/direction.txt")
#config2 = Path("/Users/nulm/Desktop/OodiMir/OodiUI/static/home.txt")
#if config2.is_file():
# os.remove("/Users/nulm/Desktop/OodiMir/OodiUI/static/home.txt")
#if request.method == 'POST':
#searchterm = request.form['searchfield']
#error = None
Expand Down Expand Up @@ -121,10 +124,10 @@ def mission_finished():
def go_home():
msg = "-"
#look for a file and if the file contains "home" then redirect to the start page
config = Path("/Users/nulm/Desktop/OodiMir/OodiUI/static/home.txt")
config = Path("/Users/nulm/Desktop/OodiMir/OodiUI/static/direction.txt")
if config.is_file():
print("file exists")
f = open("/Users/nulm/Desktop/OodiMir/OodiUI/static/home.txt", "r")
f = open("/Users/nulm/Desktop/OodiMir/OodiUI/static/direction.txt", "r")
msg = f.read()
msg = msg.rstrip('\n')
return msg
Expand Down
9 changes: 6 additions & 3 deletions OodiUI/static/arrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,23 @@ $(document).ready(function(){
$("#leftarrow").show();
$("#lookleft").show();
console.log("look to your left");
setTimeout(redirect, 5000);
//setTimeout(redirect, 5000);
}
else if (data == "r") {
$("#rightarrow").show();
$("#lookright").show();
setTimeout(redirect, 5000);
//setTimeout(redirect, 5000);
console.log("you will be directed to right");
}
else if (data == "lr") {
$("#leftrightarrow").show();
$("#lookboth").show();
setTimeout(redirect, 5000);
//setTimeout(redirect, 5000);
console.log("look at both sides");
}
else if (data == "home") {
window.location.replace("/going_home");
}
}

});
Expand Down
2 changes: 1 addition & 1 deletion OodiUI/static/direction.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
l
home2
6 changes: 4 additions & 2 deletions OodiUI/static/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ $(document).ready(function(){
if (data == "-") {
console.log("Home far away");
}
else if (data == "home") {
else if (data == "home2") {
console.log("Back home yay");
setTimeout(redirect_home, 5000);
window.location.replace("/");
//setTimeout(redirect_home, 5000);

}
}

Expand Down

0 comments on commit 94cfcbf

Please sign in to comment.