return sheet;
}}}
+function attachEvents() {
+ const new_entry_button = document.getElementById('new_entry_window_id');
+ if (new_entry_button !== null) {
+ new_entry_button.addEventListener("click", openSqlEdit);
+ }
+}
+
function initializeStyling() {
// Apply a checkbox when it exists
function applyCheckbox(id, initFunc) {
/* Initialization */
globalThis.tdSqltextSheet = getSheet(pgwuiSqlShowWhitespaceURL());
globalThis.horizontalRuleSheet = getSheet(pgwuiSqlBackgroundRulesURL());
+attachEvents();
initializeStyling();
Karl O. Pinc <kop@karlpinc.com>
*/
-function show_search_path() {
+function showSearchPath() {
fetch('${request.route_path("pgwui_sql_db_search_path")|n}')
.then((response) => {
if (!response.ok) {
expanded.setAttribute('hidden', 'hidden');
}
}
+
+
+/* Initialization */
+
+function attachEvents() {
+ document.getElementById('show_search_path_btn_id')
+ .addEventListener("click", showSearchPath);
+
+ const expand_eol_info = document.getElementById('expand_eol_info_id');
+ const collapse_eol_info = document.getElementById('collapse_eol_info_id');
+ expand_eol_info.addEventListener("click", toggleEOLInfoRow);
+ collapse_eol_info.addEventListener("click", toggleEOLInfoRow);
+ expand_eol_info.addEventListener("keydown", toggleEOLInfoRow);
+ collapse_eol_info.addEventListener("keydown", toggleEOLInfoRow);
+
+ document.getElementById('tab_delimited_help_id')
+ .addEventListener("click", () =>
+ window.alert(
+ 'Caution: Tabs are not removed from SQL results.'
+ + ' Data containing tab characters will introduce'
+ + ' spurious/extra columns.'
+ ));
+}
+
+attachEvents();
<input value="Login" tabindex="${tab_index.val}" type="submit" />
% else:
<button type="button" tabindex="${tab_index.val}"
- onclick="openSqlEdit();"
+ id="new_entry_window_id"
>New SQL Entry Window</button>
% endif
<% tab_index.inc() %>
</%self.lib:td_input>
<td>
<button type="button" tabindex="${tab_index.val}"
- onclick="show_search_path();"
+ id="show_search_path_btn_id"
>Reset</button>
<% tab_index.inc() %>
</td>
<%def name="eol_info_row(tab_index)">
<tr class="eol_info">
<td colspan="4"><span id="collapsed_eol_info_id"
- ><p onclick="toggleEOLInfoRow()" onkeydown="toggleEOLInfoRow()"
+ ><p id="expand_eol_info_id"
tabindex="${tab_index.val}"
>▲ Important information about the end-of-line marker characters
within text</p></span><span
id="expanded_eol_info_id" hidden><p
- onclick="toggleEOLInfoRow()" onkeydown="toggleEOLInfoRow()"
+ id="collapse_eol_info_id"
tabindex="${tab_index.val}"
>▼ Important information about the end-of-line marker characters
within text</p>
${tab_checked | n}
/>
<label class="label" for="download_fmt_tab_id">Tab delimited</label><span
- onclick="window.alert(
- 'Caution: Tabs are not removed from SQL results.'
- + ' Data containing tab characters will introduce'
- + ' spurious/extra columns.'
- )"
+ id="tab_delimited_help_id"
class="help">⁈</span>
</%self.lib:td_input>
</tr>