From: Karl O. Pinc Date: Thu, 26 Sep 2024 20:35:01 +0000 (-0500) Subject: Present user with information about EOL normalization X-Git-Url: https://papio.biology.duke.edu/gitweb/?a=commitdiff_plain;h=9addcd0f764c76eff84273655481f6c55965a3ee;p=pgwui_sql Present user with information about EOL normalization --- diff --git a/src/pgwui_sql/static/pgwui_sql.css b/src/pgwui_sql/static/pgwui_sql.css index 3594c6d..1524caf 100644 --- a/src/pgwui_sql/static/pgwui_sql.css +++ b/src/pgwui_sql/static/pgwui_sql.css @@ -65,3 +65,8 @@ textarea.sqltext { height: 40em; bottom: 0; background-color: white; /* kludge, see above */ text-align: right; } + +/* The information on EOL normalization */ +tr.eol_info > td > span > p { cursor: pointer; } +tr.eol_info > td > span > p + p { margin-left: 10%; + margin-right: 10%; } diff --git a/src/pgwui_sql/static/sql_edit.js b/src/pgwui_sql/static/sql_edit.js index 7bb0eab..0f2a353 100644 --- a/src/pgwui_sql/static/sql_edit.js +++ b/src/pgwui_sql/static/sql_edit.js @@ -45,3 +45,16 @@ function toggle_sql_used(elem) { sql_text.style.backgroundColor = ''; } }; + +function toggleEOLInfoRow() { + const collapsed = document.getElementById('collapsed_eol_info_id'); + const expanded = document.getElementById('expanded_eol_info_id'); + const collapsed_state = collapsed.getAttribute('hidden'); + if (collapsed_state === null || collapsed_state === 'until-found') { + collapsed.setAttribute('hidden', 'hidden'); + expanded.removeAttribute('hidden'); + } else { + collapsed.removeAttribute('hidden'); + expanded.setAttribute('hidden', 'hidden'); + } +} diff --git a/src/pgwui_sql/templates/sql_edit.mak b/src/pgwui_sql/templates/sql_edit.mak index 213e473..c3acad3 100644 --- a/src/pgwui_sql/templates/sql_edit.mak +++ b/src/pgwui_sql/templates/sql_edit.mak @@ -141,6 +141,50 @@ +<%def name="eol_info_row(tab_index)"> + +

▲ Important information about end-of-line characters

+ + + <% tab_index.inc() %> + + <%def name="download_row(tab_index)"> ## Download @@ -243,6 +287,7 @@ <%def name="controls(tab_index)"> ${self.file_input_row(tab_index)} + ${self.eol_info_row(tab_index)} ${self.null_rep_row(tab_index)} ${self.download_row(tab_index)} ${self.download_as_row(tab_index)}