From 0b9e5847d6587092459b18c17a3e78bfa86ffe49 Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Mon, 9 Sep 2024 22:28:22 +0100 Subject: [PATCH 1/2] Use noscript rather than remove --- src/itables/javascript.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/itables/javascript.py b/src/itables/javascript.py index 7b1d1bb4..25b51b3b 100644 --- a/src/itables/javascript.py +++ b/src/itables/javascript.py @@ -132,19 +132,17 @@ def generate_init_offline_itables_html(dt_bundle: Path): dt_css = dt_bundle.with_suffix(".css").read_text(encoding="utf-8") dt64 = b64encode(dt_src.encode("utf-8")).decode("ascii") - id = "itables_init_notebook_mode_" + str(uuid.uuid4()).replace("-", "_") - return f""" -
-{get_animated_logo(opt.display_logo_when_loading)}
-This is the init_notebook_mode cell from ITables v{itables_version}
-(you should not see this message - is your notebook trusted?) -
-
+
+ +
""" From b1554f1e71eb4efcfbb523c7baf2f95f5bbaa1c2 Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Mon, 9 Sep 2024 22:28:59 +0100 Subject: [PATCH 2/2] Call new DataTable only on table objects --- docs/changelog.md | 8 ++++++++ src/itables/html/datatables_template.html | 3 +++ src/itables/version.py | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index c843540f..4de95364 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,6 +1,14 @@ ITables ChangeLog ================= +2.2.2-dev (2024-09-??) +------------------ + +**Fixed** +- We have fixed a HTML pop up warning when displaying Pandas Style objects in Quarto ([#317](https://github.com/mwouts/itables/issues/317)) +- The dependencies of the Streamlit component have been updated ([#323](https://github.com/mwouts/itables/pull/323)) + + 2.2.1 (2024-09-22) ------------------ diff --git a/src/itables/html/datatables_template.html b/src/itables/html/datatables_template.html index da686119..81abd415 100644 --- a/src/itables/html/datatables_template.html +++ b/src/itables/html/datatables_template.html @@ -4,6 +4,9 @@ import {DataTable, jQuery as $} from 'https://www.unpkg.com/dt_for_itables/dt_bundle.js'; document.querySelectorAll("#table_id:not(.dataTable)").forEach(table => { + if (!(table instanceof HTMLTableElement)) + return; + // Define the table data const data = []; diff --git a/src/itables/version.py b/src/itables/version.py index 1a7743d7..70358218 100644 --- a/src/itables/version.py +++ b/src/itables/version.py @@ -1,3 +1,3 @@ """ITables' version number""" -__version__ = "2.2.1" +__version__ = "2.2.2-dev"