use hook system for jQuery adapter, fix whitespace