Skip to content

Instantly share code, notes, and snippets.

@jarek-foksa
Created February 15, 2012 00:11
Show Gist options
  • Save jarek-foksa/1831935 to your computer and use it in GitHub Desktop.
Save jarek-foksa/1831935 to your computer and use it in GitHub Desktop.
# prototypes
dialog = __super__ = imports('/widgets/dialog.coffee').dialog
resetButton = imports('/toolbar/reset-button.coffee').resetButton
pauseButton = imports('/toolbar/pause-button.coffee').pauseButton
skipButton = imports('/toolbar/skip-button.coffee').skipButton
infobox = imports('/toolbar/infobox.coffee').infobox
speedChartButton = imports('/toolbar/speed-chart-button.coffee').speedChartButton
accuracyChartButton = imports('/toolbar/accuracy-chart-button.coffee').accuracyChartButton
mostTypedButton = imports('/toolbar/most-typed-button.coffee').mostTypedButton
mostMistypedButton = imports('/toolbar/most-mistyped-button.coffee').mostMistypedButton
levelDropdown = imports('/toolbar/level-dropdown.coffee').levelDropdown
# prototype
toolbarDialog = exports.toolbarDialog = Object.define
__prototype__: dialog
DIALOG_ID: 'toolbar' # override
# extend
createElements: ->
__super__.createElements.call @
# Columns
@$columnLeft = createElement 'div', {'class': 'column left'}
@$dialogContent.appendChild @$columnLeft
@$columnCenter = createElement 'div', {'class': 'column center'}
@$dialogContent.appendChild @$columnCenter
@$columnRight = createElement 'div', {'class': 'column right'}
@$dialogContent.appendChild @$columnRight
# Buttons
@resetButton = Object.create(resetButton).init()
@$columnLeft.appendChild @resetButton.$element
@pauseButton = Object.create(pauseButton).init()
@$columnLeft.appendChild @pauseButton.$element
@skipButton = Object.create(skipButton).init()
@$columnLeft.appendChild @skipButton.$element
@levelDropdown = Object.create(levelDropdown).init()
@$columnLeft.appendChild @levelDropdown.$element
@infobox = Object.create(infobox).init()
@$columnCenter.appendChild @infobox.$element
@speedChartButton = Object.create(speedChartButton).init()
@$columnRight.appendChild @speedChartButton.$element
@accuracyChartButton = Object.create(accuracyChartButton).init()
@$columnRight.appendChild @accuracyChartButton.$element
@mostTypedButton = Object.create(mostTypedButton).init()
@$columnRight.appendChild @mostTypedButton.$element
@mostMistypedButton = Object.create(mostMistypedButton).init()
@$columnRight.appendChild @mostMistypedButton.$element
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment