diff --git a/repository/Grafoscopio/GrafoscopioNotebook.class.st b/repository/Grafoscopio/GrafoscopioNotebook.class.st index 4cc92c7..a48f5c8 100644 --- a/repository/Grafoscopio/GrafoscopioNotebook.class.st +++ b/repository/Grafoscopio/GrafoscopioNotebook.class.st @@ -135,13 +135,15 @@ GrafoscopioNotebook >> header: anObject [ { #category : #initialization } GrafoscopioNotebook >> initializePresenter [ - tree whenHighlightedItemChanged: [ :item | tree highlightedItem ifNotNil: [self updateBodyFor: item]]. + tree whenHighlightedItemChanged: [ :item | + tree highlightedItem ifNotNil: [self updateBodyFor: item]]. tree whenTreeUpdated: [ :item | item ifNotNil: [self updateBodyFor: item]]. header whenTextChanged: [ :arg | (tree highlightedItem content header) = arg ifFalse: [ (tree highlightedItem) content header: arg. - tree roots: tree roots]]. + tree roots: tree roots. + self updateForSpecialHeader]]. ] { #category : #initialization } @@ -548,11 +550,27 @@ GrafoscopioNotebook >> updateBodyFor: aNodeContainer [ header text: aNode header. body := self instantiate: aNode specModelClass new. body content: aNode body. - self inform: aNode body. self autoSaveBodyOf: aNode. self buildWithSpecLayout: self class defaultSpec ] +{ #category : #operation } +GrafoscopioNotebook >> updateForSpecialHeader [ + "I see if a node header is an ulr located at 'http://ws.stfx.eu', wich means that is a shared + workspace, and convert the node body to an interactive playground" + + | currentNode nodeContent | + currentNode := tree highlightedItem. + currentNode ifNil: [ ^ self ]. + nodeContent := currentNode content. + nodeContent header asUrl host = 'ws.stfx.eu' + ifFalse: [ ^ self ]. + nodeContent + body: (ZnClient new get: nodeContent header); + tagAs: 'código'. + self updateBodyFor: currentNode +] + { #category : #accessing } GrafoscopioNotebook >> windowMainMenu [ ^ windowMainMenu