#NEWLINE# def onBrowserEvent( self , event ) : #NEWLINE# #INDENT# DOM . eventPreventDefault ( event ) #NEWLINE# if ( not self . game . started ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# td = self . getEventTargetCell ( event ) #NEWLINE# if ( not td ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# tr = DOM . getParent ( column ) #NEWLINE# table = DOM . getParent ( tr ) #NEWLINE# row = DOM . getChildIndex ( table , tr ) #NEWLINE# column = DOM . getChildIndex ( tr , td ) #NEWLINE# target_cell = self . getCell ( row , column ) #NEWLINE# type = DOM . eventGetType ( event ) #NEWLINE# event_mapper = { #NEWLINE# #INDENT# 'click' : 'onClick' , #NEWLINE# 'contextmenu' : 'onRightClick' , #NEWLINE# 'mousedown' : 'onMouseDown' , #NEWLINE# 'mouseup' : 'onMouseUp' , #NEWLINE# 'mouseout' : 'onMouseLeave' , #NEWLINE# #UNINDENT# } #NEWLINE# event_handler = event_mapper . get ( type ) #NEWLINE# if event_handler : #NEWLINE# #INDENT# getattr ( self , event_handler ) ( target_cell )