Add js for /getpatterns