Refresh web preview button initial version working.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-01-03 20:02:05 -05:00
parent ac0912cb75
commit a587817790
5 changed files with 28 additions and 2 deletions

View File

@ -126,6 +126,14 @@ LePage >> latestEditTime: aLeTime [
latestEditTime := aLeTime
]
{ #category : #'*MiniDocs' }
LePage >> localHostAddress [
| localUrl route |
route := MiniDocsServer teapot staticRouter prefix joinUsing: '/'.
localUrl := MiniDocsServer teapot server localUrl asString.
^ localUrl, route, '/', self markdeepFileName
]
{ #category : #'*MiniDocs' }
LePage >> markdeepFileName [

View File

@ -23,8 +23,8 @@ LePageHeaderBuilder >> addRefreshWebViewButton [
aptitude: BrGlamorousButtonWithIconAptitude;
label: 'Refresh web view';
icon: BrGlamorousVectorIcons refresh;
action: [ :aButton |
action: [
self page asMarkdeep exportAsFileOn: (self page storage / self page markdeepFileName).
aButton phlow spawnObject: self page localHostAddress ].
WebBrowser openOn: self page localHostAddress ].
self toolbarElement addItem: newButton.
]

View File

@ -0,0 +1,6 @@
Extension { #name : #TeaCompositeRouter }
{ #category : #'*MiniDocs' }
TeaCompositeRouter >> staticRouters [
^ routers
]

View File

@ -0,0 +1,6 @@
Extension { #name : #TeaStaticRouter }
{ #category : #'*MiniDocs' }
TeaStaticRouter >> delegate [
^ delegate
]

View File

@ -0,0 +1,6 @@
Extension { #name : #Teapot }
{ #category : #'*MiniDocs' }
Teapot >> staticRouter [
^ staticRouter delegate
]