Skip to content

Commit

Permalink
Link documentation to H2O repo build hash
Browse files Browse the repository at this point in the history
  • Loading branch information
lo5 committed Jan 16, 2015
1 parent 7edaea6 commit 59455c4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
24 changes: 15 additions & 9 deletions src/core/components/about.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ Flow.About = (_) ->
_properties = signals []

link _.ready, ->
_.requestAbout (error, response) ->
if Flow.Version
_properties Flow.Version
else
_.requestAbout (error, response) ->
properties = []

unless error
for { name, value } in response.entries
_properties.push
caption: 'H2O ' + name
value: value
unless error
for { name, value } in response.entries
properties.push
caption: 'H2O ' + name
value: value

_properties.push
caption: 'Flow version'
value: FLOW_VERSION
properties.push
caption: 'Flow version'
value: FLOW_VERSION

_properties Flow.Version = properties

properties: _properties

11 changes: 10 additions & 1 deletion src/core/components/notebook.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ Flow.Notebook = (_, _renderers) ->
displayKeyboardShortcuts = ->
$('#keyboardShortcutsDialog').modal()

displayDocumentation = ->
hash = if Flow.Version
hashEntry = find Flow.Version, (entry) -> entry.caption is 'H2O Build git hash'
if hashEntry then hashEntry.value else 'master'
else
'master'

window.open "https://github.com/h2oai/h2o-dev/blob/#{hash}/h2o-docs/src/product/flow/README.md", '_blank'

executeCommand = (command) -> ->
_.insertAndExecuteCell 'cs', command

Expand Down Expand Up @@ -432,7 +441,7 @@ Flow.Notebook = (_, _renderers) ->
createMenuItem 'Contents', showHelp
createMenuItem 'Keyboard Shortcuts', displayKeyboardShortcuts
menuDivider
createMenuItem 'H2O Documentation', goToUrl 'http://docs.h2o.ai/'
createMenuItem 'H2O Documentation', displayDocumentation
createMenuItem 'h2o.ai', goToUrl 'http://h2o.ai/'
menuDivider
createMenuItem 'About', displayAbout
Expand Down

0 comments on commit 59455c4

Please sign in to comment.