Upgrade JSdraw input.

rebased version of #3133