View raw

1 Class { 2 #name : 'MFTRootComponent', 3 #superclass : 'WAComponent', 4 #instVars : [ 5 'main' 6 ], 7 #category : 'MyFitnessTracker-Web-Components', 8 #package : 'MyFitnessTracker-Web', 9 #tag : 'Components' 10 } 11 12 { #category : 'testing' } 13 MFTRootComponent class >> canBeRoot [ 14 15 ^ true 16 ] 17 18 { #category : 'class initialization' } 19 MFTRootComponent class >> initialize [ 20 21 | application | 22 application := WAAdmin register: self asApplicationAt: 'mft'. 23 application preferenceAt: #sessionClass put: MFTSession. 24 ^ application 25 ] 26 27 { #category : 'hooks' } 28 MFTRootComponent >> children [ 29 30 ^ { main } 31 ] 32 33 { #category : 'initialization' } 34 MFTRootComponent >> initialize [ 35 36 super initialize. 37 main := MFTScreenComponent new 38 ] 39 40 { #category : 'rendering' } 41 MFTRootComponent >> renderContentOn: html [ 42 43 html render: main 44 ] 45 46 { #category : 'updating' } 47 MFTRootComponent >> updateRoot: aRoot [ 48 49 super updateRoot: aRoot. 50 aRoot beHtml5. 51 aRoot meta 52 name: 'viewport'; 53 content: 'width=device-width, initial-scale=1'. 54 aRoot title: 'MFT ' , main activePage title. 55 aRoot link 56 beShortcutIcon; 57 url: MFTFileLibrary / #faviconPng. 58 aRoot stylesheet url: 59 'https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css'. 60 aRoot stylesheet url: MFTFileLibrary / #defaultCss. 61 aRoot stylesheet url: 'https://rsms.me/inter/inter.css' 62 ] 63