VIewport Timeline

I was trying to make viewport Timeline, its really usefull if it has few useful features like keyframe grabbing

but right now its too much messed up here is a result
http://pasteall.org/pic/show.php?id=107894

can anyone help me with this , ?

it shows wrong numbers on viewport , it should actually sync with dopesheet ,

there are lots of possiblities with this one ,

I hope someone will find it useful ,

here is a script , let me know if anyone can help me solving the issue ,
http://pasteall.org/86543/python

run it in text editor Press ALT + LEFTMOUSE on view port to activate it

another thing , i am not a coder , this one is just an effort to making workflow a bit easier ,

this script is mix of few bgl scripts and animscrubber script by frankie

Please have a look and let me know whats wrong with it

Thanks

Further to chat on IRC http://pasteall.org/88608/python making the region width match the scene frame range.