Add view source to editor
Move common code to element