diff --git a/src/Grafoscopio/GrafoscopioNode.class.st b/src/Grafoscopio/GrafoscopioNode.class.st index 9f14ea8..51e80f8 100644 --- a/src/Grafoscopio/GrafoscopioNode.class.st +++ b/src/Grafoscopio/GrafoscopioNode.class.st @@ -493,7 +493,7 @@ GrafoscopioNode >> level: anInteger [ { #category : #accessing } GrafoscopioNode >> links [ "I model local or remote links that are associated to a particular node." - ^ links ifNil: [ ^ links := OrderedCollection new ] + ^ links ifNil: [ ^ links = OrderedCollection new ] ] { #category : #accessing } @@ -528,7 +528,8 @@ GrafoscopioNode >> markdownContent [ If special nodes types are present, converts them into proper markup to be embedded inside markdown" | markdown embedNodes temporalBody invisibleChildren | markdown := '' writeStream. - (self class specialWords includes: self header) not & (self class specialWords includes: ((self header findTokens: $ ) at: 1)) not & (self tags = 'código') not + (self class specialWords includes: self header) not & + (self class specialWords includes: ((self header findTokens: $ ) at: 1)) not & (self tags = 'código') not ifTrue: [ self level timesRepeat: [ markdown nextPutAll: '#' ]. markdown nextPutAll: ' '. diff --git a/src/Grafoscopio/GrafoscopioNotebook.class.st b/src/Grafoscopio/GrafoscopioNotebook.class.st index 69b8215..32c712a 100644 --- a/src/Grafoscopio/GrafoscopioNotebook.class.st +++ b/src/Grafoscopio/GrafoscopioNotebook.class.st @@ -176,11 +176,12 @@ GrafoscopioNotebook >> initializePresenter [ (tree highlightedItem content header) = arg ifFalse: [ (tree highlightedItem) content header: arg. - tree roots: tree roots. - self updateForSpecialHeader]]. + tree roots: tree roots]]. links whenTextChanged: [ :arg | - (tree highlightedItem content links) = arg - ifFalse: [ (tree highlightedItem) content links: arg]] + ((tree highlightedItem content links) includes: arg) + ifFalse: [ + (tree highlightedItem) content links add: arg. + self updateForSpecialLinks]] ] { #category : #initialization } @@ -325,7 +326,13 @@ GrafoscopioNotebook >> newWindowMainMenu [ name: nil; description: 'Visit link'; icon: Smalltalk ui icons glamorousRight; - action: [ self visitNodeLink ] ]. + action: [ self visitNodeLink ] ]. + group addItem: [ :item | + item + name: nil; + description: 'Load link'; + icon: Smalltalk ui icons glamorousRefresh; + action: [ self updateForSpecialLinks ] ]. group addItem: [ :item | item name: nil; @@ -663,17 +670,17 @@ GrafoscopioNotebook >> updateBodyFor: aNodeContainer [ ] { #category : #operation } -GrafoscopioNotebook >> updateForSpecialHeader [ +GrafoscopioNotebook >> updateForSpecialLinks [ "I see if a node header is an url 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 isAsciiString ifFalse: [ ^ self ]. - nodeContent header asUrl host = 'ws.stfx.eu' ifFalse: [ ^ self ]. + nodeContent links last isAsciiString ifFalse: [ ^ self ]. + nodeContent links last asUrl host = 'ws.stfx.eu' ifFalse: [ ^ self ]. nodeContent - body: (ZnClient new get: nodeContent header); + body: (ZnClient new get: nodeContent links last); tagAs: 'código'. self updateBodyFor: currentNode ]