Created
November 29, 2012 16:17
-
-
Save stefanw/4170091 to your computer and use it in GitHub Desktop.
Bookmarklet to generate VBB permalinks of routings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var from = document.getElementById('HFS_from').value; | |
var to = document.getElementById('HFS_to').value; | |
var time = document.getElementById('HFS_time_REQ0').value; | |
var date = document.getElementById('HFS_date_REQ0').value; | |
var timesel = !!document.getElementById('HFS_timesel_REQ0_1').checked ? 'depart' : 'arrive'; | |
var details = document.getElementsByClassName('details'); | |
for(var i = 0; i < details.length; i += 1) { | |
if (details[i].className.indexOf('menuLinks') !== -1 || details[i].className.indexOf('hide') !== -1) { | |
continue; | |
} | |
var hwai = details[i].id.substring(2); | |
break; | |
} | |
history.pushState({}, "", 'dn?From=' + from + '%21&To=' + to + '%21&time=' + time + '&date=' + date + '&start=1×el=' + timesel + '&HWAI=CONNECTION$' + hwai + '!id=' + hwai + '!HwaiConId=' + hwai + '!HwaiDetailStatus=details'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/westberliner/vbb_permalink