Debian Codegraph @

architecture/httpdlib/html/js/svg/api/source/customizing.rst

raw
1 Customizing the Web UI
2 ======================
3
4 The Web UI has a built-in customization system that allows users to specify
5 the look of certain objects in the interface. This spefication can take one
6 of three forms:
7
8 - The inclusion of external CSS files
9 - The inclusion of external JavaScript files
10 - The specification of parameters in the URL
11
12 External CSS files
13 ------------------
14
15 External CSS files can be used to style the Faust Web UI by setting the css
16 argument in the url. For example, to include the CSS file
17 ``http://www.ensemble101.fr/foo.css`` on the previously mentioned application,
18 one would use the link::
19
20 http://www.ensemble101.fr:8000/#css=http://www.ensemble101.fr/foo.css
21
22 The css argument can be specified multiple times for multiple CSS files.
23
24 Below is a list of all customizable CSS parameters for all objects. Information
25 on all of these parameters, as well as information on SVG CSS, can be found on
26 http://www.w3.org/TR/SVG/styling.html.
27
28 * Clipping, Masking and Compositing properties
29
30 * opacity
31
32 * Color and Painting properties
33
34 * color-profile
35 * color-rendering
36 * fill
37 * fill-opacity
38 * fill-rule
39 * stroke
40 * stroke-dasharray
41 * stroke-dashoffset
42 * stroke-linecap
43 * stroke-linejoin
44 * stroke-miterlimit
45 * stroke-opacity
46 * stroke-width
47
48 * Font properties
49
50 * font
51 * font-family
52 * font-size
53 * font-size-adjust
54 * font-stretch
55 * font-style
56 * font-variant
57 * font-weight
58
59 * Text properties
60
61 * text-rendering
62 * alignment-baseline
63 * baseline-shift
64 * dominant-baseline
65 * glyph-orientation-horizontal
66 * glyph-orientation-vertical
67 * kerning
68 * text-anchor
69 * writing-mode
70 * direction
71 * letter-spacing
72 * text-decoration
73 * unicode-bidi
74 * word-spacing
75
76 None of these parameters are set by default, as all of them are set dynamically
77 in the DOM via JavaScript as described below. However, customized CSS will
78 take precedence over JavaScript when set.
79
80 Below is a list of all faust objects with sublists indicating the CSS
81 classes that compose the objects as well as the meaning of the class.
82
83 Rotating Button
84 ^^^^^^^^^^^^^^^
85 ================================== ===================================================
86 Class name Description
87 ================================== ===================================================
88 faust-rbutton-joint The "joint" in which a rotating button rotates.
89 faust-rbutton-knob The "knob" that does the actual rotating.
90 ================================== ===================================================
91
92 Slider (both horizontal and vertical)
93 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94 ================================== ===================================================
95 Class name Description
96 ================================== ===================================================
97 faust-slider-joint The "joint" in which a slider slides.
98 faust-slider-knob The "knob" that does the actual sliding.
99 ================================== ===================================================
100
101 Bar Graph (both horizontal and vertical)
102 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103 ================================== ========================================================
104 Class name Description
105 ================================== ========================================================
106 faust-bargraph-joint The "joint" in which a bar graph moves.
107 faust-bargraph-knob The "meter" that does the actual showing of information.
108 ================================== ========================================================
109
110 Checkbox
111 ^^^^^^^^
112 ================================== ===================================================
113 Class name Description
114 ================================== ===================================================
115 faust-checkbox-box The box of a checkbox.
116 faust-checkbox-check The check of a checkbox.
117 ================================== ===================================================
118
119 Button
120 ^^^^^^
121 ================================== ===================================================
122 Class name Description
123 ================================== ===================================================
124 faust-button-box The box of a button.
125 faust-button-text Text of a button.
126 ================================== ===================================================
127
128 Numerical Entry
129 ^^^^^^^^^^^^^^^
130 ================================== ===================================================
131 Class name Description
132 ================================== ===================================================
133 faust-nentry-operation The operation sign (plus/minus) of a numerical entry.
134 faust-nentry-button The button on which the operation signs appear.
135 ================================== ===================================================
136
137 Value Box
138 ^^^^^^^^^
139 ================================== ===================================================
140 Class name Description
141 ================================== ===================================================
142 faust-button-box The box of a value box.
143 faust-button-text Number of a value box.
144 ================================== ===================================================
145
146 Layout Manager (both horizontal and vertical)
147 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148 ================================== ===================================================
149 Class name Description
150 ================================== ===================================================
151 faust-group-background The background of a layout manager.
152 faust-group-label The label of a layout manager.
153 ================================== ===================================================
154
155 Tab Group
156 ^^^^^^^^^
157 ================================== ===================================================
158 Class name Description
159 ================================== ===================================================
160 faust-tgroup-tab A tab of a tab group.
161 faust-tgroup-label A label of a tab in a tab group.
162 ================================== ===================================================
163
164 Below is a model CSS file setting several of the classes above ::
165
166 .faust-slider-joint {opacity:0.2;}
167 .faust-rbutton-knob {stroke-linecap:percentage;}
168 .faust-tgroup-label {font-weight:bold;}
169
170 External JS files
171 -----------------
172
173 As the CSS specification only allows the customization of parameters in the
174 specification and disallows customized parameters, faust-specific parameters
175 must be specified via JavaScript. There are numerous parameters one can
176 control: the width of sliders, the girth of a rotating button's knob, and
177 the height of a button, for example, can all be controlled via JavaScript.
178 This is also true of more "traditional" parameters such as fill color.
179 Where there is overlap in things that can be specified in both JS and CSS
180 (fill and stroke, for example), the CSS will, if specified, take priority.
181
182 Often times, a customizable parameter can be set that will interfere with the
183 normal display of faust information. For example, one can specify the text
184 of all checkbox labels, but this would interfere with the labels specified
185 by the server. Therefore, in the tables below, there is a "Touch?" parameter
186 that, when specified as "No", means that it should not be tinkered with.
187
188 External JS files can be used to style the Faust Web UI by setting the js
189 argument in the url. For example, to include the JS file
190 ``http://www.ensemble101.fr/foo.js`` on the previously mentioned application,
191 one would use the link::
192
193 http://www.ensemble101.fr:8000/#js=http://www.ensemble101.fr/foo.js
194
195 The js argument can be specified multiple times for multiple JS files.
196
197 Below is a list of all faust objects with sublists indicating the JS
198 variables that may be set as well as the meaning of these variables.
199
200 Rotating Button
201 ^^^^^^^^^^^^^^^
202 ================================== ============================================== ====== ==============================
203 Property name Description Touch? Default
204 ================================== ============================================== ====== ==============================
205 _f4u$t.rbutton_inits.mom Parent widget of the object No null
206 _f4u$t.rbutton_inits.label Label of the object No null
207 _f4u$t.rbutton_inits.ir The ideal radius of the button Yes 50
208 _f4u$t.rbutton_inits.a0 The angle from which the button starts Yes 180
209 _f4u$t.rbutton_inits.sweep The degrees that the button sweeps Yes 180
210 _f4u$t.rbutton_inits.sp The fraction of the sweep taken up by the knob Yes 0.1
211 _f4u$t.rbutton_inits.unit Units of the button No null
212 _f4u$t.rbutton_inits.min Min value of the button No 0
213 _f4u$t.rbutton_inits.max Max value of the button No 100
214 _f4u$t.rbutton_inits.init Initial value of the button No 50
215 _f4u$t.rbutton_inits.step Step over the range No 1
216 _f4u$t.rbutton_inits.integer True of the initial value is an integer No false
217 _f4u$t.rbutton_inits.ndec Number of decimal places to show No 0
218 _f4u$t.rbutton_inits.lpadding_y Padding between text box and label Yes _f4u$t.TEXT_HEIGHT
219 _f4u$t.rbutton_inits.box_padding Padding between object and text box Yes _f4u$t.TEXT_BOX_PADDING
220 _f4u$t.rbutton_inits.gravity X,Y placement in the parent widget Yes [_f4u$t.CENTER _f4u$t.CENTER]
221 _f4u$t.rbutton_inits.joint_fill Fill of the joint Yes _f4u$t.PALEGREEN
222 _f4u$t.rbutton_inits.knob_fill Fill of the knob Yes _f4u$t.GREY
223 _f4u$t.rbutton_inits.joint_stroke Stroke of the joint Yes _f4u$t.BLACK
224 _f4u$t.rbutton_inits.knob_stroke Stroke of the knob Yes _f4u$t.BLACK
225 _f4u$t.rbutton_inits.value_box_w Width of the value box Yes _f4u$t.VALUE_BOX_W
226 _f4u$t.rbutton_inits.value_box_h Height of the value box Yes _f4u$t.VALUE_BOX_H
227 _f4u$t.rbutton_inits.address Address on the server No null
228 ================================== ============================================== ====== ==============================
229
230 Slider
231 ^^^^^^
232 ================================== =============================================== ====== ==============================
233 Property name Description Touch? Default
234 ================================== =============================================== ====== ==============================
235 _f4u$t.slider_inits.mom Parent widget of the object No null
236 _f4u$t.slider_inits.label Label of the object No null
237 _f4u$t.slider_inits.axis Orientation of the object No _f4u$t.X_AXIS
238 _f4u$t.slider_inits.girth Width of the object Yes 40
239 _f4u$t.slider_inits.length Length of the object Yes 200
240 _f4u$t.slider_inits.sp The fraction of the slider taken up by the knob Yes 0.1
241 _f4u$t.slider_inits.unit Units of the slider No null
242 _f4u$t.slider_inits.min Min value of the button No 0
243 _f4u$t.slider_inits.max Max value of the button No 100
244 _f4u$t.slider_inits.init Initial value of the button No 50
245 _f4u$t.slider_inits.step Step over the range No 1
246 _f4u$t.slider_inits.integer True of the initial value is an integer No false
247 _f4u$t.slider_inits.ndec Number of decimal places to show No 0
248 _f4u$t.slider_inits.lpadding_y Padding between text box and label Yes _f4u$t.TEXT_HEIGHT
249 _f4u$t.slider_inits.box_padding Padding between object and text box Yes _f4u$t.TEXT_BOX_PADDING
250 _f4u$t.slider_inits.gravity X,Y placement in the parent widget Yes [_f4u$t.CENTER _f4u$t.CENTER]
251 _f4u$t.slider_inits.joint_fill Fill of the joint Yes _f4u$t.PALEGREEN
252 _f4u$t.slider_inits.knob_fill Fill of the knob Yes _f4u$t.GREY
253 _f4u$t.slider_inits.joint_stroke Stroke of the joint Yes _f4u$t.BLACK
254 _f4u$t.slider_inits.knob_stroke Stroke of the knob Yes _f4u$t.BLACK
255 _f4u$t.slider_inits.value_box_w Width of the value box Yes _f4u$t.VALUE_BOX_W
256 _f4u$t.slider_inits.value_box_h Height of the value box Yes _f4u$t.VALUE_BOX_H
257 _f4u$t.slider_inits.address Address on the server No null
258 ================================== =============================================== ====== ==============================
259
260 In order to customize horizontal and vertical sliders individually, the
261 properties above may be set by adding v or h before slider (i.e. _f4u$t.vslider_inits.joint_stroke).
262
263 Bar Graph
264 ^^^^^^^^^
265 ================================== =============================================== ====== ==============================
266 Property name Description Touch? Default
267 ================================== =============================================== ====== ==============================
268 _f4u$t.bargraph_inits.mom Parent widget of the object No null
269 _f4u$t.bargraph_inits.label Label of the object No null
270 _f4u$t.bargraph_inits.axis Orientation of the object No _f4u$t.X_AXIS
271 _f4u$t.bargraph_inits.girth Width of the object Yes 40
272 _f4u$t.bargraph_inits.length Length of the object Yes 200
273 _f4u$t.bargraph_inits.unit Units of the slider No null
274 _f4u$t.bargraph_inits.min Min value of the button No 0
275 _f4u$t.bargraph_inits.max Max value of the button No 100
276 _f4u$t.bargraph_inits.init Initial value of the button No 50
277 _f4u$t.bargraph_inits.step Step over the range No 1
278 _f4u$t.bargraph_inits.integer True of the initial value is an integer No false
279 _f4u$t.bargraph_inits.ndec Number of decimal places to show No 0
280 _f4u$t.bargraph_inits.lpadding_y Padding between text box and label Yes _f4u$t.TEXT_HEIGHT
281 _f4u$t.bargraph_inits.box_padding Padding between object and text box Yes _f4u$t.TEXT_BOX_PADDING
282 _f4u$t.bargraph_inits.gravity X,Y placement in the parent widget Yes [_f4u$t.CENTER _f4u$t.CENTER]
283 _f4u$t.bargraph_inits.joint_fill Fill of the joint Yes _f4u$t.PALEGREEN
284 _f4u$t.bargraph_inits.meter_fill Fill of the meter Yes _f4u$t.GREY
285 _f4u$t.bargraph_inits.joint_stroke Stroke of the joint Yes _f4u$t.BLACK
286 _f4u$t.bargraph_inits.meter_stroke Stroke of the meter Yes _f4u$t.BLACK
287 _f4u$t.bargraph_inits.value_box_w Width of the value box Yes _f4u$t.VALUE_BOX_W
288 _f4u$t.bargraph_inits.value_box_h Height of the value box Yes _f4u$t.VALUE_BOX_H
289 _f4u$t.bargraph_inits.address Address on the server No null
290 ================================== =============================================== ====== ==============================
291
292 In order to customize horizontal and vertical bar graphs individually, the
293 properties above may be set by adding v or h before bar graph (i.e. _f4u$t.vbargraph_inits.joint_stroke).
294
295 Numerical Entry
296 ^^^^^^^^^^^^^^^
297 ==================================== =============================================== ====== ==============================
298 Property name Description Touch? Default
299 ==================================== =============================================== ====== ==============================
300 _f4u$t.nentry_inits.mom Parent widget of the object No null
301 _f4u$t.nentry_inits.label Label of the object No null
302 _f4u$t.nentry_inits.length Length of the object Yes 200
303 _f4u$t.nentry_inits.unit Units of the slider No null
304 _f4u$t.nentry_inits.min Min value of the button No 0
305 _f4u$t.nentry_inits.max Max value of the button No 100
306 _f4u$t.nentry_inits.init Initial value of the button No 50
307 _f4u$t.nentry_inits.step Step over the range No 1
308 _f4u$t.nentry_inits.integer True of the initial value is an integer No false
309 _f4u$t.nentry_inits.ndec Number of decimal places to show No 0
310 _f4u$t.nentry_inits.lpadding_y Padding between text box and label Yes _f4u$t.TEXT_HEIGHT
311 _f4u$t.nentry_inits.box_padding Padding between object and text box Yes _f4u$t.TEXT_BOX_PADDING
312 _f4u$t.nentry_inits.padding Padding around an operation in a button Yes _f4u$t.TEXT_BOX_PADDING
313 _f4u$t.nentry_inits.gravity X,Y placement in the parent widget Yes [_f4u$t.CENTER _f4u$t.CENTER]
314 _f4u$t.nentry_inits.operation_fill Fill of the operation symbol Yes _f4u$t.PALEGREEN
315 _f4u$t.nentry_inits.button_fill Fill of the operation button Yes _f4u$t.GREY
316 _f4u$t.nentry_inits.operation_stroke Stroke of the operation symbol Yes _f4u$t.BLACK
317 _f4u$t.nentry_inits.button_stroke Stroke of the operation button Yes _f4u$t.BLACK
318 _f4u$t.nentry_inits.value_box_w Width of the value box Yes _f4u$t.VALUE_BOX_W
319 _f4u$t.nentry_inits.value_box_h Height of the value box Yes _f4u$t.VALUE_BOX_H
320 _f4u$t.nentry_inits.address Address on the server No null
321 ==================================== =============================================== ====== ==============================
322
323 Checkbox
324 ^^^^^^^^
325 ================================== =================================== ====== ==============================
326 Property name Description Touch? Default
327 ================================== =================================== ====== ==============================
328 _f4u$t.checkbox_inits.mom Parent widget of the object No null
329 _f4u$t.checkbox_inits.label Label of the object No null
330 _f4u$t.checkbox_inits.d Dimension Yes 19
331 _f4u$t.checkbox_inits.gravity X,Y placement in the parent widget Yes [_f4u$t.CENTER, _f4u$t.CENTER]
332 _f4u$t.checkbox_inits.check_fill Fill of the check Yes _f4u$t.BLACK
333 _f4u$t.checkbox_inits.check_stroke Stroke of the check Yes _f4u$t.BLACK
334 _f4u$t.checkbox_inits.box_fill Fill of the box Yes _f4u$t.WHITE
335 _f4u$t.checkbox_inits.box_stroke Stroke of the box Yes _f4u$t.BLACK
336 _f4u$t.checkbox_inits.init Initial value of the checkbox No false
337 _f4u$t.checkbox_inits.lpadding_y Padding between object and label Yes _f4u$t.TEXT_HEIGHT
338 _f4u$t.checkbox_inits.address Address on the server No null
339 ================================== =================================== ====== ==============================
340
341 Button
342 ^^^^^^
343 =================================== ====================================== ====== ==============================
344 Property name Description Touch? Default
345 =================================== ====================================== ====== ==============================
346 _f4u$t.button_inits.mom Parent widget of the object No null
347 _f4u$t.button_inits.label Label of the object No null
348 _f4u$t.button_inits.ideal_width Ideal width [#f1]_ Yes 80
349 _f4u$t.button_inits.ideal_height Ideal height [#f1]_ Yes 40
350 _f4u$t.button_inits.gravity X,Y placement in the parent widget Yes [_f4u$t.CENTER _f4u$t.CENTER]
351 _f4u$t.button_inits.fill_on Fill when the button is on Yes _f4u$t.PINK
352 _f4u$t.button_inits.fill_off Fill when the button is off Yes _f4u$t.GREEN
353 _f4u$t.button_inits.stroke Stroke of the button box Yes _f4u$t.BLACK
354 _f4u$t.button_inits.baseline_skip Gap between bottom of button and label Yes 5
355 _f4u$t.button_inits.address Address on the server No null
356 =================================== ====================================== ====== ==============================
357
358 Below is a model JS file setting several of the variables above ::
359
360 _f4u$t.button_inits.stroke = _f4u$t.BLACK;
361 _f4u$t.checkbox_inits.d = 40;
362 _f4u$t.hslider_inits.sp = 0.3;
363
364 URL Parameter Specification
365 ---------------------------
366
367 JS parameters can also be specified in the URL. For example, the model
368 JS file above can be embeded in the URL as follows ::
369
370 http://www.ensemble101.fr:8000/#button_inits.stroke=_f4u$t.BLACK&checkbox_inits.d=40&hslider_inits.sp=0.3
371
372 .. rubric:: Footnotes
373 .. [#f1] Ideal because it will adapt to the size of the bounded text if necessary.