Class { #name : #LeMiniDocsImport, #superclass : #BrButton, #instVars : [ 'contentExtent', 'database' ], #category : #'MiniDocs-UI' } { #category : #accessing } LeMiniDocsImport >> contentExtent [ ^ contentExtent ] { #category : #accessing } LeMiniDocsImport >> contentExtent: aPoint [ self assert: [ aPoint isNotNil ] description: [ 'Extent must be non-nil' ]. contentExtent := aPoint ] { #category : #accessing } LeMiniDocsImport >> createDropdownExpandedHandleButton [ ^ BrButton new icon: BrGlamorousVectorIcons downwards; label: self tooltip; aptitude: BrGlamorousButtonWithIconAndLabelAptitude ] { #category : #accessing } LeMiniDocsImport >> createURLeditable [ | base editable | base := BlElement new background: (Color white); size: 200 @ 30; margin: (BlInsets all: 10); yourself. editable := BrEditableLabel new aptitude: BrGlamorousEditableLabelAptitude new glamorousRegularFontAndSize; text: 'Hedgedoc url'; switchToEditor. editable when: BrEditorAcceptWish do: [ :aWish | self importHedgedoc: aWish text asString. ]. base addChild: editable. ^ base ] { #category : #accessing } LeMiniDocsImport >> database: aLeDatabase [ database := aLeDatabase ] { #category : #accessing } LeMiniDocsImport >> importHedgedoc: aURL [ | doc text page | doc := HedgeDoc new url: aURL asString. text := doc retrieveContents; contents. page := LePage named: (doc metadata at: 'title'). page addSnippet: (LeTextSnippet string: text). ^ database addPage: page ] { #category : #accessing } LeMiniDocsImport >> initialize [ super initialize. self icon: BrGlamorousVectorIcons downwards; label: 'Add MiniDocs'; aptitude: BrGlamorousButtonWithIconAndLabelAptitude. self addAptitude: (BrGlamorousWithDropdownAptitude handle: [ self createDropdownExpandedHandleButton ] content: [ self createURLeditable ]). self aptitude - BrGlamorousButtonExteriorAptitude. ] { #category : #accessing } LeMiniDocsImport >> tooltip [ ^ self label ] { #category : #accessing } LeMiniDocsImport >> tooltip: aString [ self label: aString ]