Skip to content

Instantly share code, notes, and snippets.

@IliaIdakiev
Created October 18, 2013 08:06
Show Gist options
  • Save IliaIdakiev/7038082 to your computer and use it in GitHub Desktop.
Save IliaIdakiev/7038082 to your computer and use it in GitHub Desktop.
Javascript
$(document).bind("keydown", disableF5);
function disableF5(e) {
if ((e.which || e.keyCode) == 116) {
if(confirm("Are you sure you want to continue? You will loose some of the filled information!")){
return true;
}
else{
e.preventDefault();
}
}
}
function changeUrl(newId){
var newLocation = window.location.pathname.replace('Details/0', 'Details/' + newId);
history.pushState('', 'New Page Title', newLocation);
}
function selectAll(sender) {
if ($(sender).is(':checked')) {
$("#routes").find('input[type=checkbox]').prop('checked', true);
}
else {
$("#routes").find('input[type=checkbox]').prop('checked', false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment