@@ -60,63 +60,67 @@ package body Frontend is
60
60
" xhr.send(); return false; }" &
61
61
" </script>" &
62
62
" </form></body></html>" ;
63
- Main_Page_HTML : Unbounded_String := Null_Unbounded_String;
63
+ Main_HTML : Unbounded_String := Null_Unbounded_String;
64
64
begin
65
- Append (Main_Page_HTML , Header_HTML);
65
+ Append (Main_HTML , Header_HTML);
66
66
67
67
-- first the tab headers or selector
68
68
if Conf.Keypadder_Conf.Tabswitch = Tabs then
69
- Append (Main_Page_HTML , " <div class="" kp-bar"" >" );
69
+ Append (Main_HTML , " <div class="" kp-bar"" >" );
70
70
for Tab of Conf.Tabs loop
71
- Append (Main_Page_HTML , " <button class="" kp-bar-item"" onclick="" openTab('" &
71
+ Append (Main_HTML , " <button class="" kp-bar-item"" onclick="" openTab('" &
72
72
Tab.Label & " ')"" >" &
73
73
Tab.Label & " </button>" );
74
74
end loop ;
75
75
else -- selector
76
- Append (Main_Page_HTML , " <div><select class='kp-selector' id='kpselect' onChange='selectChange()'>" );
76
+ Append (Main_HTML , " <div><select class='kp-selector' id='kpselect' onChange='selectChange()'>" );
77
77
for Tab of Conf.Tabs loop
78
- Append (Main_Page_HTML , " <option value='" & Tab.Label & " '>" );
79
- Append (Main_Page_HTML , Tab.Label & " </option>" );
78
+ Append (Main_HTML , " <option value='" & Tab.Label & " '>" );
79
+ Append (Main_HTML , Tab.Label & " </option>" );
80
80
end loop ;
81
- Append (Main_Page_HTML , " </select>" );
81
+ Append (Main_HTML , " </select>" );
82
82
end if ;
83
- Append (Main_Page_HTML , " </div>" & ASCII.LF);
83
+ Append (Main_HTML , " </div>" & ASCII.LF);
84
84
85
- Append (Main_Page_HTML , " <form id="" kpForm"" onsubmit="" return ajaxget()"" >" & ASCII.LF);
85
+ Append (Main_HTML , " <form id="" kpForm"" onsubmit="" return ajaxget()"" >" & ASCII.LF);
86
86
-- now each tab
87
87
for T in Conf.Tabs.First_Index .. Conf.Tabs.Last_Index loop
88
- Append (Main_Page_HTML , " <div id="" " & Conf.Tabs (T).Label & " "" class="" kp-pad"" " );
88
+ Append (Main_HTML , " <div id="" " & Conf.Tabs (T).Label & " "" class="" kp-pad"" " );
89
89
if T /= Active_Tab then -- hide inactive Tabs
90
- Append (Main_Page_HTML , " style="" display:none"" " );
90
+ Append (Main_HTML , " style="" display:none"" " );
91
91
end if ;
92
- Append (Main_Page_HTML , " >" & ASCII.LF);
92
+ Append (Main_HTML , " >" & ASCII.LF);
93
93
94
94
-- the main content of each tab - i.e. the keys
95
- Append (Main_Page_HTML , " <div style="" margin: 0 auto; display: grid; gap: 1rem; align-content: stretch; " &
95
+ Append (Main_HTML , " <div style="" margin: 0 auto; display: grid; gap: 1rem; align-content: stretch; " &
96
96
" position: fixed; top: 17mm; left: 0; right: 0; bottom: 2px; " &
97
97
" overflow: scroll; " &
98
98
" grid-template-columns: repeat(" & Conf.Tabs (T).Columns'Image & " , 1fr);"" >" );
99
99
for K in Conf.Tabs (T).Keys.First_Index .. Conf.Tabs (T).Keys.Last_Index loop
100
- Append (Main_Page_HTML, " <input type="" button"" onClick="" return ajaxget(" & T'Image & " ," & K'Image & " )"" class="" kp-btn"" " );
100
+ Append (Main_HTML, " <input type="" button"" onClick="" return ajaxget(" & T'Image & " ," &
101
+ K'Image & " )"" class="" kp-btn"" style="" " );
101
102
if Conf.Tabs (T).Keys (K).Colspan > 1 then
102
- Append (Main_Page_HTML , " style= "" grid-column: span" & Conf.Tabs (T).Keys (K).Colspan'Image & " ;"" " );
103
+ Append (Main_HTML , " grid-column: span" & Conf.Tabs (T).Keys (K).Colspan'Image & " ; " );
103
104
end if ;
104
105
if Conf.Tabs (T).Keys (K).Rowspan > 1 then
105
- Append (Main_Page_HTML , " style= "" grid -row: span" & Conf.Tabs (T).Keys (K).Rowspan'Image & " ;"" " );
106
+ Append (Main_HTML , " rid -row: span" & Conf.Tabs (T).Keys (K).Rowspan'Image & " ; " );
106
107
end if ;
107
108
if Conf.Tabs (T).Keys (K).Bg_Colour /= Null_Unbounded_String then
108
- Append (Main_Page_HTML, " style="" background-color: " & Conf.Tabs (T).Keys (K).Bg_Colour & " ;"" " );
109
+ Append (Main_HTML, " background-color: " & Conf.Tabs (T).Keys (K).Bg_Colour & " ; " );
110
+ end if ;
111
+ if Conf.Tabs (T).Fontsize /= Null_Unbounded_String then
112
+ Append (Main_HTML, " font-size: " & Conf.Tabs (T).Fontsize & " ; " );
109
113
end if ;
110
114
-- the key label
111
- Append (Main_Page_HTML, " value="" " & Conf.Tabs (T).Keys (K).Label & " "" >" & ASCII.LF);
115
+ Append (Main_HTML, " " " value="" " & Conf.Tabs (T).Keys (K).Label & " "" >" & ASCII.LF);
112
116
end loop ;
113
- Append (Main_Page_HTML , " </div></div>" );
117
+ Append (Main_HTML , " </div></div>" );
114
118
end loop ;
115
119
116
120
-- javascript to change displayed tab etc.
117
- Append (Main_Page_HTML , Trailer_HTML);
121
+ Append (Main_HTML , Trailer_HTML);
118
122
119
- return To_String (Main_Page_HTML );
123
+ return To_String (Main_HTML );
120
124
end Build_Main_Page ;
121
125
122
126
procedure Decode_And_Send_Key (T, I : String; Tab : out Positive) is
0 commit comments