diff --git a/src/Telescope-Cytoscape/TLCytoscapeWebSocketDelegate.class.st b/src/Telescope-Cytoscape/TLCytoscapeWebSocketDelegate.class.st index 648eed69..becdec06 100644 --- a/src/Telescope-Cytoscape/TLCytoscapeWebSocketDelegate.class.st +++ b/src/Telescope-Cytoscape/TLCytoscapeWebSocketDelegate.class.st @@ -89,7 +89,28 @@ TLCytoscapeWebSocketDelegate class >> menuCommandOn: aBuilder [ iconName: #smallOk; parent: #Telescope; help: 'This action will enable the deployment mode of Telescope'; - action: [ self beDeployment ] + action: [ self beDeployment ]. + (aBuilder item: #'Open web demo') + order: 1; + iconName: #glamorousOver; + parent: #Telescope; + help: 'Open the web demo of Telescope'; + action: [ self openWebDemo ] +] + +{ #category : #'accessing-convenience' } +TLCytoscapeWebSocketDelegate class >> openWebDemo [ + | port url | + WAServerManager default adaptors + ifEmpty: [ (ZnZincServerAdaptor port: (port := 8087)) start ] + ifNotEmpty: [ :adaptors | adaptors detect: #isRunning ifFound: [ :anAdaptor | port := anAdaptor server port ] ifNone: [ (ZnZincServerAdaptor port: (port := 8087)) start ] ]. + url := 'http://localhost:' , port asString , '/TelescopeDemo'. + self flag: #pharo6. + self flag: #pharo7. + self class environment + at: #WebBrowser + ifPresent: [ :class | class openOn: url ] + ifAbsent: [ self class environment at: #OSProcess ifPresent: [ :class | class command: 'open ' , url ] ifAbsent: [ self inform: 'Open ' , url , ' or install WebBrowser/OSProcess.' ] ] ] { #category : #accessing } diff --git a/src/Telescope-Cytoscape/TLVisualization.extension.st b/src/Telescope-Cytoscape/TLVisualization.extension.st index c490293a..cc42c332 100644 --- a/src/Telescope-Cytoscape/TLVisualization.extension.st +++ b/src/Telescope-Cytoscape/TLVisualization.extension.st @@ -13,14 +13,13 @@ TLVisualization >> openOnWeb [ webAppVisualization := TLWebAppVisualization singleton. webAppVisualization visualization: self. WAServerManager default adaptors - ifEmpty: [ (ZnZincServerAdaptor port: (port := 8085)) start ] - ifNotEmpty: [ :adaptors | adaptors detect: #isRunning ifFound: [ :anAdaptor | port := anAdaptor server port ] ifNone: [ (ZnZincServerAdaptor port: (port := 8085)) start ] ]. + ifEmpty: [ (ZnZincServerAdaptor port: (port := 8087)) start ] + ifNotEmpty: [ :adaptors | adaptors detect: #isRunning ifFound: [ :anAdaptor | port := anAdaptor server port ] ifNone: [ (ZnZincServerAdaptor port: (port := 8087)) start ] ]. url := 'http://localhost:' , port asString , '/UserVisualization'. self flag: #pharo6. - SystemVersion current major < 7 - ifTrue: [ self class environment - at: #OSProcess - ifPresent: [ :class | class command: 'open http://localhost:' , port asString , '/UserVisualization' ] - ifAbsent: [ self inform: 'Open ' , url , ' or install OSProcess.' ] ] - ifFalse: [ WebBrowser openOn: url ] + self flag: #pharo7. + self class environment + at: #WebBrowser + ifPresent: [ :class | class openOn: url ] + ifAbsent: [ self class environment at: #OSProcess ifPresent: [ :class | class command: 'open ' , url ] ifAbsent: [ self inform: 'Open ' , url , ' or install WebBrowser/OSProcess.' ] ] ]