• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mattonem / PharoJS / 14380852851

10 Apr 2025 12:48PM UTC coverage: 27.097% (+1.1%) from 26.047%
14380852851

push

github

web-flow
Update stable.yml

5702 of 21043 relevant lines covered (27.1%)

0.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.22
/Pharo/PharoJs-Base-Bridge/PjClientCodeGenerator.class.st
1
"
2
A PjClientCodeGenerator generates the HTML that includes javascript code made available through the server to the client (typically on the browser).
3

4
Instance Variables
5
        converter:                <PjSmalltalkToJavaScriptBasicConverer>
6

7
converter
8
        - translates Smalltalk code into JavaScript
9

10
"
11
Class {
12
        #name : 'PjClientCodeGenerator',
13
        #superclass : 'Object',
14
        #instVars : [
15
                'titleString',
16
                'appClass',
17
                'htmlGenerator',
18
                'appClassDecorator'
19
        ],
20
        #category : 'PharoJs-Base-Bridge-Client-CodeGenerator',
21
        #package : 'PharoJs-Base-Bridge',
22
        #tag : 'Client-CodeGenerator'
23
}
24

25
{ #category : 'accessing' }
26
PjClientCodeGenerator class >> bridgeAppClassDecoratorClass [
1✔
27

1✔
28
        ^ PjBridgeAppClassDecorator
1✔
29
]
1✔
30

31
{ #category : 'public' }
32
PjClientCodeGenerator class >> html [
×
33
        ^self new html
×
34
]
×
35

36
{ #category : 'generating' }
37
PjClientCodeGenerator class >> websocketDelegateClass [
×
38
        ^self bridgeAppClassDecoratorClass websocketDelegateClass
×
39
]
×
40

41
{ #category : 'accessing' }
42
PjClientCodeGenerator >> appClass [
×
43

×
44
        ^ appClass
×
45
]
×
46

47
{ #category : 'accessing' }
48
PjClientCodeGenerator >> appClassDecorator [
×
49

×
50
        ^ appClassDecorator
×
51
]
×
52

53
{ #category : 'accessing' }
54
PjClientCodeGenerator >> bridge: aBridge [
1✔
55

1✔
56
        appClassDecorator bridge: aBridge
1✔
57
]
1✔
58

59
{ #category : 'accessing' }
60
PjClientCodeGenerator >> bridgeAppClassDecoratorClass [
1✔
61

1✔
62
        ^ self class bridgeAppClassDecoratorClass
1✔
63
]
1✔
64

65
{ #category : 'public' }
66
PjClientCodeGenerator >> css [
×
67

×
68
        ^ self cssUsing: self htmlGenerator
×
69
]
×
70

71
{ #category : 'generating' }
72
PjClientCodeGenerator >> cssUsing: aHtmlGenerator [
×
73

×
74
        ^ self appClass css ifNotNil: [ :css | 
×
75
                  aHtmlGenerator addCssLink: 'index.css'.
×
76
                  css ]
×
77
]
×
78

79
{ #category : 'generating' }
80
PjClientCodeGenerator >> decorateAppClass: anAppClass [
1✔
81

1✔
82
        appClass := anAppClass.
1✔
83
        appClassDecorator := self bridgeAppClassDecoratorClass rawAppClass: anAppClass.
1✔
84
        ^ appClassDecorator
1✔
85
]
1✔
86

87
{ #category : 'generating' }
88
PjClientCodeGenerator >> favicon [
×
89

×
90
        ^ self appClass favicon
×
91
]
×
92

93
{ #category : 'generating' }
94
PjClientCodeGenerator >> generateHtmlUsing: aHtmlGenerator [
×
95

×
96
        aHtmlGenerator title: 'PharoJS:' , self titleString.
×
97
        aHtmlGenerator
×
98
                add: 'h1'
×
99
                contents: 'PharoJS: Develop in Pharo, run in JavaScript'.
×
100
        aHtmlGenerator add: 'h2' contents: self titleString.
×
101
        aHtmlGenerator addScriptUrl: 'index.js'
×
102
]
×
103

104
{ #category : 'public' }
105
PjClientCodeGenerator >> html [
×
106

×
107
        self appClass isHtmlGenerator ifTrue: [ ^self appClass html ].
×
108
        self generateHtmlUsing: self htmlGenerator.
×
109
        ^ self htmlGenerator html
×
110
]
×
111

112
{ #category : 'generating' }
113
PjClientCodeGenerator >> htmlGenerator [
×
114

×
115
        ^ htmlGenerator ifNil: [ htmlGenerator := PjHtmlGenerator new ]
×
116
]
×
117

118
{ #category : 'generating' }
119
PjClientCodeGenerator >> resetHtmlGenerator [
×
120

×
121
        htmlGenerator := nil
×
122
]
×
123

124
{ #category : 'accessing' }
125
PjClientCodeGenerator >> titleString [
×
126

×
127
        ^ titleString ifNil: [ '' ]
×
128
]
×
129

130
{ #category : 'accessing' }
131
PjClientCodeGenerator >> titleString: aString [
×
132

×
133
        titleString := aString
×
134
]
×
135

136
{ #category : 'accessing' }
137
PjClientCodeGenerator >> websocketDelegateClass [
×
138

×
139
        ^ self class websocketDelegateClass
×
140
]
×
141

142
{ #category : 'accessing' }
143
PjClientCodeGenerator >> websocketDelegateClassName [
×
144

×
145
        ^ self websocketDelegateClass name
×
146
]
×
147

148
{ #category : 'public' }
149
PjClientCodeGenerator >> withClientLogging [
×
150

×
151
        ^ PjLoggingClientCodeGenerator new
×
152
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc