Migrate source viewer to js