add active and not active workspace Block to JavaScript Code