From 8cc949316e7c41985982302c395d62e39a1b5a33 Mon Sep 17 00:00:00 2001 From: heulitig Date: Mon, 27 Feb 2023 14:00:27 +0530 Subject: [PATCH] tests fixed --- fastn-core/tests/02-hello/output/index.html | 7 +++++++ fastn-core/tests/03-nested-document/output/index.html | 7 +++++++ .../03-nested-document/output/nested/document/index.html | 7 +++++++ .../tests/03-nested-document/output/nested/index.html | 7 +++++++ fastn-core/tests/04-import-code-block/output/index.html | 7 +++++++ .../tests/04-import-code-block/output/lib/index.html | 7 +++++++ fastn-core/tests/05-hello-font/output/index.html | 7 +++++++ fastn-core/tests/08-static-assets/output/index.html | 7 +++++++ fastn-core/tests/09-markdown-pages/output/index.html | 7 +++++++ fastn-core/tests/11-readme-with-index/output/index.html | 7 +++++++ .../tests/15-fpm-dependency-alias/output/index.html | 7 +++++++ fastn-core/tests/16-include-processor/output/index.html | 7 +++++++ ftd/build.js | 7 +++++++ ftd/t/html/1-component.html | 7 +++++++ ftd/t/html/10-conditional-properties.html | 7 +++++++ ftd/t/html/11-external-children.html | 7 +++++++ ftd/t/html/12-conditional-component.html | 7 +++++++ ftd/t/html/13-image.html | 7 +++++++ ftd/t/html/14-processor.html | 7 +++++++ ftd/t/html/15-foreign-variable.html | 7 +++++++ ftd/t/html/16-or-type.html | 7 +++++++ ftd/t/html/17-record.html | 7 +++++++ ftd/t/html/18-styles.html | 7 +++++++ ftd/t/html/19-complex-styles.html | 7 +++++++ ftd/t/html/2-component.html | 7 +++++++ ftd/t/html/20-link.html | 7 +++++++ ftd/t/html/21-color.html | 7 +++++++ ftd/t/html/22-test.html | 7 +++++++ ftd/t/html/23-alignment.html | 7 +++++++ ftd/t/html/23-doc-site.html | 7 +++++++ ftd/t/html/24-margin.html | 7 +++++++ ftd/t/html/25-expander.html | 7 +++++++ ftd/t/html/25-overflow.html | 7 +++++++ ftd/t/html/26-border.html | 7 +++++++ ftd/t/html/27-optional.html | 7 +++++++ ftd/t/html/28-complex.html | 7 +++++++ ftd/t/html/29-slides.html | 7 +++++++ ftd/t/html/3-component.html | 7 +++++++ ftd/t/html/30-slides.html | 7 +++++++ ftd/t/html/31-message.html | 7 +++++++ ftd/t/html/32-test.html | 7 +++++++ ftd/t/html/33-component-using-css.html | 7 +++++++ ftd/t/html/33-using-css.html | 7 +++++++ ftd/t/html/34-device.html | 7 +++++++ ftd/t/html/35-condition-on-color.html | 7 +++++++ ftd/t/html/36-test.html | 7 +++++++ ftd/t/html/37-cursor.html | 7 +++++++ ftd/t/html/38-role.html | 7 +++++++ ftd/t/html/39-events.html | 7 +++++++ ftd/t/html/4-component.html | 7 +++++++ ftd/t/html/40-anchor.html | 7 +++++++ ftd/t/html/41-responsive-type.html | 7 +++++++ ftd/t/html/42-default-function.html | 7 +++++++ ftd/t/html/43-default-colors-types.html | 7 +++++++ ftd/t/html/44-region.html | 7 +++++++ ftd/t/html/45-using-hyphen.html | 7 +++++++ ftd/t/html/46-record-in-pscript.html | 7 +++++++ ftd/t/html/47-white-space.html | 7 +++++++ ftd/t/html/48-basic-functions.html | 7 +++++++ ftd/t/html/49-import.html | 7 +++++++ ftd/t/html/5-component-recursion.html | 7 +++++++ ftd/t/html/50-using-import.html | 7 +++++++ ftd/t/html/51-text-transform.html | 7 +++++++ ftd/t/html/52-code-and-iframe.html | 7 +++++++ ftd/t/html/53-decimal.html | 7 +++++++ ftd/t/html/53-font-family.html | 7 +++++++ ftd/t/html/54-input.html | 7 +++++++ ftd/t/html/55-inherited.html | 7 +++++++ ftd/t/html/55-line-clamp.html | 7 +++++++ ftd/t/html/56-passing-events.html | 7 +++++++ ftd/t/html/57-border-style.html | 7 +++++++ ftd/t/html/58-id.html | 7 +++++++ ftd/t/html/59-sticky.html | 7 +++++++ ftd/t/html/6-function.html | 7 +++++++ ftd/t/html/60-region-id-slug.html | 7 +++++++ ftd/t/html/61-loop-variable.html | 7 +++++++ ftd/t/html/62-spacing.html | 7 +++++++ ftd/t/html/63-checkbox.html | 7 +++++++ ftd/t/html/64-muliple-node-dep.html | 7 +++++++ ftd/t/html/64-multiple-node-dep-1.html | 7 +++++++ ftd/t/html/65-mut-loop.html | 7 +++++++ ftd/t/html/66-inheritance.html | 7 +++++++ ftd/t/html/67-enabled.html | 7 +++++++ ftd/t/html/68-anchor-id.html | 7 +++++++ ftd/t/html/69-inside-loop.html | 7 +++++++ ftd/t/html/7-events.html | 7 +++++++ ftd/t/html/70-figma-json-to-ftd.html | 7 +++++++ ftd/t/html/70-length-check.html | 7 +++++++ ftd/t/html/71-web-component.html | 7 +++++++ ftd/t/html/72-external-js.html | 7 +++++++ ftd/t/html/73-complex-ftd-ui.html | 7 +++++++ ftd/t/html/74-import-complex-ftd-ui.html | 7 +++++++ ftd/t/html/8-counter.html | 7 +++++++ ftd/t/html/9-conditional-properties.html | 7 +++++++ ftd/t/html/check.html | 7 +++++++ ftd/t/html/function.html | 7 +++++++ ftd/t/html/get.html | 7 +++++++ ftd/t/html/h-100.html | 7 +++++++ ftd/t/html/resume.html | 7 +++++++ ftd/t/html/sd.html | 7 +++++++ ftd/ts/utils.ts | 8 ++++++++ 101 files changed, 708 insertions(+) diff --git a/fastn-core/tests/02-hello/output/index.html b/fastn-core/tests/02-hello/output/index.html index d82e15719b..53d1cf2f09 100644 --- a/fastn-core/tests/02-hello/output/index.html +++ b/fastn-core/tests/02-hello/output/index.html @@ -1504,6 +1504,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/03-nested-document/output/index.html b/fastn-core/tests/03-nested-document/output/index.html index 26035c164c..c5fae237a5 100644 --- a/fastn-core/tests/03-nested-document/output/index.html +++ b/fastn-core/tests/03-nested-document/output/index.html @@ -1473,6 +1473,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/03-nested-document/output/nested/document/index.html b/fastn-core/tests/03-nested-document/output/nested/document/index.html index 750d057bfb..4982995761 100644 --- a/fastn-core/tests/03-nested-document/output/nested/document/index.html +++ b/fastn-core/tests/03-nested-document/output/nested/document/index.html @@ -1473,6 +1473,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/03-nested-document/output/nested/index.html b/fastn-core/tests/03-nested-document/output/nested/index.html index 708d532b1a..c348b13b4b 100644 --- a/fastn-core/tests/03-nested-document/output/nested/index.html +++ b/fastn-core/tests/03-nested-document/output/nested/index.html @@ -1473,6 +1473,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/04-import-code-block/output/index.html b/fastn-core/tests/04-import-code-block/output/index.html index ff99290fc4..e9b9ac70cf 100644 --- a/fastn-core/tests/04-import-code-block/output/index.html +++ b/fastn-core/tests/04-import-code-block/output/index.html @@ -1480,6 +1480,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/04-import-code-block/output/lib/index.html b/fastn-core/tests/04-import-code-block/output/lib/index.html index d29b4c4653..c99ed7a975 100644 --- a/fastn-core/tests/04-import-code-block/output/lib/index.html +++ b/fastn-core/tests/04-import-code-block/output/lib/index.html @@ -1473,6 +1473,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/05-hello-font/output/index.html b/fastn-core/tests/05-hello-font/output/index.html index 37c36aac37..3c74f03147 100644 --- a/fastn-core/tests/05-hello-font/output/index.html +++ b/fastn-core/tests/05-hello-font/output/index.html @@ -1523,6 +1523,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/08-static-assets/output/index.html b/fastn-core/tests/08-static-assets/output/index.html index 26035c164c..c5fae237a5 100644 --- a/fastn-core/tests/08-static-assets/output/index.html +++ b/fastn-core/tests/08-static-assets/output/index.html @@ -1473,6 +1473,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/09-markdown-pages/output/index.html b/fastn-core/tests/09-markdown-pages/output/index.html index 26035c164c..c5fae237a5 100644 --- a/fastn-core/tests/09-markdown-pages/output/index.html +++ b/fastn-core/tests/09-markdown-pages/output/index.html @@ -1473,6 +1473,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/11-readme-with-index/output/index.html b/fastn-core/tests/11-readme-with-index/output/index.html index 14dcb1e021..72b831e8de 100644 --- a/fastn-core/tests/11-readme-with-index/output/index.html +++ b/fastn-core/tests/11-readme-with-index/output/index.html @@ -1473,6 +1473,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/15-fpm-dependency-alias/output/index.html b/fastn-core/tests/15-fpm-dependency-alias/output/index.html index f7dc4458ba..2f2b2c0dba 100644 --- a/fastn-core/tests/15-fpm-dependency-alias/output/index.html +++ b/fastn-core/tests/15-fpm-dependency-alias/output/index.html @@ -1479,6 +1479,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/fastn-core/tests/16-include-processor/output/index.html b/fastn-core/tests/16-include-processor/output/index.html index c88e1141b1..bee83ebc9c 100644 --- a/fastn-core/tests/16-include-processor/output/index.html +++ b/fastn-core/tests/16-include-processor/output/index.html @@ -1474,6 +1474,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/build.js b/ftd/build.js index b3ce3a2877..18a2f0c333 100644 --- a/ftd/build.js +++ b/ftd/build.js @@ -769,6 +769,13 @@ function JSONstringify(f) { return f; } } +function download_text(filename, text) { + const blob = new Blob([text], { type: 'text/plain' }); + const link = document.createElement('a'); + link.href = window.URL.createObjectURL(blob); + link.download = filename; + link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/1-component.html b/ftd/t/html/1-component.html index 4b5a7cdd47..7ade20a9c5 100644 --- a/ftd/t/html/1-component.html +++ b/ftd/t/html/1-component.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/10-conditional-properties.html b/ftd/t/html/10-conditional-properties.html index cc6a8f0a14..654ab134fb 100644 --- a/ftd/t/html/10-conditional-properties.html +++ b/ftd/t/html/10-conditional-properties.html @@ -1325,6 +1325,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/11-external-children.html b/ftd/t/html/11-external-children.html index 0c620c00d8..066a65dee3 100644 --- a/ftd/t/html/11-external-children.html +++ b/ftd/t/html/11-external-children.html @@ -1327,6 +1327,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/12-conditional-component.html b/ftd/t/html/12-conditional-component.html index 66a4a4d2b2..68951d06a4 100644 --- a/ftd/t/html/12-conditional-component.html +++ b/ftd/t/html/12-conditional-component.html @@ -1324,6 +1324,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/13-image.html b/ftd/t/html/13-image.html index 2135e9101b..cb14852603 100644 --- a/ftd/t/html/13-image.html +++ b/ftd/t/html/13-image.html @@ -1332,6 +1332,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/14-processor.html b/ftd/t/html/14-processor.html index f12f58945a..073d1a8804 100644 --- a/ftd/t/html/14-processor.html +++ b/ftd/t/html/14-processor.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/15-foreign-variable.html b/ftd/t/html/15-foreign-variable.html index c2311a8c39..689762ff39 100644 --- a/ftd/t/html/15-foreign-variable.html +++ b/ftd/t/html/15-foreign-variable.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/16-or-type.html b/ftd/t/html/16-or-type.html index 4c28a01161..8ff4ff399a 100644 --- a/ftd/t/html/16-or-type.html +++ b/ftd/t/html/16-or-type.html @@ -1325,6 +1325,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/17-record.html b/ftd/t/html/17-record.html index eadfc84911..2e803d9566 100644 --- a/ftd/t/html/17-record.html +++ b/ftd/t/html/17-record.html @@ -1331,6 +1331,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/18-styles.html b/ftd/t/html/18-styles.html index c90508bbcc..222a39a570 100644 --- a/ftd/t/html/18-styles.html +++ b/ftd/t/html/18-styles.html @@ -1324,6 +1324,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/19-complex-styles.html b/ftd/t/html/19-complex-styles.html index 378487b309..502767a29a 100644 --- a/ftd/t/html/19-complex-styles.html +++ b/ftd/t/html/19-complex-styles.html @@ -1326,6 +1326,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/2-component.html b/ftd/t/html/2-component.html index 4194d87561..af0620aaba 100644 --- a/ftd/t/html/2-component.html +++ b/ftd/t/html/2-component.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/20-link.html b/ftd/t/html/20-link.html index 45f3b36d66..df68128e7f 100644 --- a/ftd/t/html/20-link.html +++ b/ftd/t/html/20-link.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/21-color.html b/ftd/t/html/21-color.html index 17ae245941..9ee8dc1623 100644 --- a/ftd/t/html/21-color.html +++ b/ftd/t/html/21-color.html @@ -1330,6 +1330,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/22-test.html b/ftd/t/html/22-test.html index 9ca63a4d78..570f61ec64 100644 --- a/ftd/t/html/22-test.html +++ b/ftd/t/html/22-test.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/23-alignment.html b/ftd/t/html/23-alignment.html index 1fe0b52f10..66a5f3541e 100644 --- a/ftd/t/html/23-alignment.html +++ b/ftd/t/html/23-alignment.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/23-doc-site.html b/ftd/t/html/23-doc-site.html index b029ef92b0..8edd14cbd6 100644 --- a/ftd/t/html/23-doc-site.html +++ b/ftd/t/html/23-doc-site.html @@ -1444,6 +1444,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/24-margin.html b/ftd/t/html/24-margin.html index 5d260a3779..398f0b26e8 100644 --- a/ftd/t/html/24-margin.html +++ b/ftd/t/html/24-margin.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/25-expander.html b/ftd/t/html/25-expander.html index d4dc159cf1..2b0d1a1332 100644 --- a/ftd/t/html/25-expander.html +++ b/ftd/t/html/25-expander.html @@ -1331,6 +1331,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/25-overflow.html b/ftd/t/html/25-overflow.html index a20e8ba97f..21683210f3 100644 --- a/ftd/t/html/25-overflow.html +++ b/ftd/t/html/25-overflow.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/26-border.html b/ftd/t/html/26-border.html index 2df9359adf..a9704074b0 100644 --- a/ftd/t/html/26-border.html +++ b/ftd/t/html/26-border.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/27-optional.html b/ftd/t/html/27-optional.html index 9a362e772f..89d78a3f1e 100644 --- a/ftd/t/html/27-optional.html +++ b/ftd/t/html/27-optional.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/28-complex.html b/ftd/t/html/28-complex.html index 0732800f57..178f36e780 100644 --- a/ftd/t/html/28-complex.html +++ b/ftd/t/html/28-complex.html @@ -1362,6 +1362,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/29-slides.html b/ftd/t/html/29-slides.html index 9175292a51..694e41d5c9 100644 --- a/ftd/t/html/29-slides.html +++ b/ftd/t/html/29-slides.html @@ -1332,6 +1332,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/3-component.html b/ftd/t/html/3-component.html index e3dec1eb87..f978c04c2e 100644 --- a/ftd/t/html/3-component.html +++ b/ftd/t/html/3-component.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/30-slides.html b/ftd/t/html/30-slides.html index 5508f724f5..7aaba88075 100644 --- a/ftd/t/html/30-slides.html +++ b/ftd/t/html/30-slides.html @@ -1350,6 +1350,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/31-message.html b/ftd/t/html/31-message.html index c85ae5f74a..e97102c47b 100644 --- a/ftd/t/html/31-message.html +++ b/ftd/t/html/31-message.html @@ -1352,6 +1352,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/32-test.html b/ftd/t/html/32-test.html index 3a300886b9..f0d8ac00f1 100644 --- a/ftd/t/html/32-test.html +++ b/ftd/t/html/32-test.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/33-component-using-css.html b/ftd/t/html/33-component-using-css.html index 18df3cd30d..2a3e6f77c4 100644 --- a/ftd/t/html/33-component-using-css.html +++ b/ftd/t/html/33-component-using-css.html @@ -1324,6 +1324,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/33-using-css.html b/ftd/t/html/33-using-css.html index 4abafeb554..5d8652f224 100644 --- a/ftd/t/html/33-using-css.html +++ b/ftd/t/html/33-using-css.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/34-device.html b/ftd/t/html/34-device.html index a2b130c74b..740bfb7624 100644 --- a/ftd/t/html/34-device.html +++ b/ftd/t/html/34-device.html @@ -1330,6 +1330,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/35-condition-on-color.html b/ftd/t/html/35-condition-on-color.html index 0242a7b5ca..feeed016b3 100644 --- a/ftd/t/html/35-condition-on-color.html +++ b/ftd/t/html/35-condition-on-color.html @@ -1332,6 +1332,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/36-test.html b/ftd/t/html/36-test.html index b6e93d763a..a281684886 100644 --- a/ftd/t/html/36-test.html +++ b/ftd/t/html/36-test.html @@ -1377,6 +1377,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/37-cursor.html b/ftd/t/html/37-cursor.html index fbaf6ac11e..d5d4a8a9d6 100644 --- a/ftd/t/html/37-cursor.html +++ b/ftd/t/html/37-cursor.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/38-role.html b/ftd/t/html/38-role.html index 3f5535ca1e..ae4e41998f 100644 --- a/ftd/t/html/38-role.html +++ b/ftd/t/html/38-role.html @@ -1369,6 +1369,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/39-events.html b/ftd/t/html/39-events.html index e466285618..9f2462532a 100644 --- a/ftd/t/html/39-events.html +++ b/ftd/t/html/39-events.html @@ -1368,6 +1368,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/4-component.html b/ftd/t/html/4-component.html index af5e1e9468..f55966a1df 100644 --- a/ftd/t/html/4-component.html +++ b/ftd/t/html/4-component.html @@ -1324,6 +1324,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/40-anchor.html b/ftd/t/html/40-anchor.html index 7d63670a4d..23e49c0b69 100644 --- a/ftd/t/html/40-anchor.html +++ b/ftd/t/html/40-anchor.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/41-responsive-type.html b/ftd/t/html/41-responsive-type.html index bee883254d..6679f3ac07 100644 --- a/ftd/t/html/41-responsive-type.html +++ b/ftd/t/html/41-responsive-type.html @@ -1331,6 +1331,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/42-default-function.html b/ftd/t/html/42-default-function.html index 2e41669311..763044d7b1 100644 --- a/ftd/t/html/42-default-function.html +++ b/ftd/t/html/42-default-function.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/43-default-colors-types.html b/ftd/t/html/43-default-colors-types.html index fd0da86190..c5f41c87ce 100644 --- a/ftd/t/html/43-default-colors-types.html +++ b/ftd/t/html/43-default-colors-types.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/44-region.html b/ftd/t/html/44-region.html index 89d0e68900..3fc48a815f 100644 --- a/ftd/t/html/44-region.html +++ b/ftd/t/html/44-region.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/45-using-hyphen.html b/ftd/t/html/45-using-hyphen.html index 36a8f516d9..883e0ceea1 100644 --- a/ftd/t/html/45-using-hyphen.html +++ b/ftd/t/html/45-using-hyphen.html @@ -1324,6 +1324,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/46-record-in-pscript.html b/ftd/t/html/46-record-in-pscript.html index d18ae48d30..122f36b8bd 100644 --- a/ftd/t/html/46-record-in-pscript.html +++ b/ftd/t/html/46-record-in-pscript.html @@ -1327,6 +1327,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/47-white-space.html b/ftd/t/html/47-white-space.html index 637e53423b..c7b9e60b6d 100644 --- a/ftd/t/html/47-white-space.html +++ b/ftd/t/html/47-white-space.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/48-basic-functions.html b/ftd/t/html/48-basic-functions.html index b6848ae8b1..abdd0b4c86 100644 --- a/ftd/t/html/48-basic-functions.html +++ b/ftd/t/html/48-basic-functions.html @@ -1325,6 +1325,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/49-import.html b/ftd/t/html/49-import.html index b3d9a61504..5e2552d35e 100644 --- a/ftd/t/html/49-import.html +++ b/ftd/t/html/49-import.html @@ -1356,6 +1356,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/5-component-recursion.html b/ftd/t/html/5-component-recursion.html index c9bd4bab1b..44e37555f8 100644 --- a/ftd/t/html/5-component-recursion.html +++ b/ftd/t/html/5-component-recursion.html @@ -1340,6 +1340,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/50-using-import.html b/ftd/t/html/50-using-import.html index 266097b30d..0353e444fd 100644 --- a/ftd/t/html/50-using-import.html +++ b/ftd/t/html/50-using-import.html @@ -1356,6 +1356,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/51-text-transform.html b/ftd/t/html/51-text-transform.html index f8fd2405b7..452888b433 100644 --- a/ftd/t/html/51-text-transform.html +++ b/ftd/t/html/51-text-transform.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/52-code-and-iframe.html b/ftd/t/html/52-code-and-iframe.html index 05ff0fcd5e..82ded641bf 100644 --- a/ftd/t/html/52-code-and-iframe.html +++ b/ftd/t/html/52-code-and-iframe.html @@ -1330,6 +1330,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/53-decimal.html b/ftd/t/html/53-decimal.html index 5e5f9c8320..0e50ae181f 100644 --- a/ftd/t/html/53-decimal.html +++ b/ftd/t/html/53-decimal.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/53-font-family.html b/ftd/t/html/53-font-family.html index d041304261..4020df36c8 100644 --- a/ftd/t/html/53-font-family.html +++ b/ftd/t/html/53-font-family.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/54-input.html b/ftd/t/html/54-input.html index acc9ccb1b2..8646dc8041 100644 --- a/ftd/t/html/54-input.html +++ b/ftd/t/html/54-input.html @@ -1326,6 +1326,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/55-inherited.html b/ftd/t/html/55-inherited.html index 52516e1457..f3e27ba457 100644 --- a/ftd/t/html/55-inherited.html +++ b/ftd/t/html/55-inherited.html @@ -1341,6 +1341,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/55-line-clamp.html b/ftd/t/html/55-line-clamp.html index 047e7a3cda..b2d26bd5df 100644 --- a/ftd/t/html/55-line-clamp.html +++ b/ftd/t/html/55-line-clamp.html @@ -1328,6 +1328,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/56-passing-events.html b/ftd/t/html/56-passing-events.html index 00f3759e9d..fe21732225 100644 --- a/ftd/t/html/56-passing-events.html +++ b/ftd/t/html/56-passing-events.html @@ -1349,6 +1349,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/57-border-style.html b/ftd/t/html/57-border-style.html index 7002f583a9..9058c823be 100644 --- a/ftd/t/html/57-border-style.html +++ b/ftd/t/html/57-border-style.html @@ -1324,6 +1324,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/58-id.html b/ftd/t/html/58-id.html index e49037c474..5f90e4b025 100644 --- a/ftd/t/html/58-id.html +++ b/ftd/t/html/58-id.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/59-sticky.html b/ftd/t/html/59-sticky.html index c96d158e36..30549de202 100644 --- a/ftd/t/html/59-sticky.html +++ b/ftd/t/html/59-sticky.html @@ -1327,6 +1327,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/6-function.html b/ftd/t/html/6-function.html index 0f35f21221..f6e7d6b97e 100644 --- a/ftd/t/html/6-function.html +++ b/ftd/t/html/6-function.html @@ -1325,6 +1325,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/60-region-id-slug.html b/ftd/t/html/60-region-id-slug.html index fbc744a5ac..22625e7e47 100644 --- a/ftd/t/html/60-region-id-slug.html +++ b/ftd/t/html/60-region-id-slug.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/61-loop-variable.html b/ftd/t/html/61-loop-variable.html index 19813aa67c..d34d5b4853 100644 --- a/ftd/t/html/61-loop-variable.html +++ b/ftd/t/html/61-loop-variable.html @@ -1337,6 +1337,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/62-spacing.html b/ftd/t/html/62-spacing.html index 4aa826a092..0dbf232761 100644 --- a/ftd/t/html/62-spacing.html +++ b/ftd/t/html/62-spacing.html @@ -1327,6 +1327,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/63-checkbox.html b/ftd/t/html/63-checkbox.html index 461a396634..d247808250 100644 --- a/ftd/t/html/63-checkbox.html +++ b/ftd/t/html/63-checkbox.html @@ -1324,6 +1324,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/64-muliple-node-dep.html b/ftd/t/html/64-muliple-node-dep.html index 300cc6451d..19b6058d31 100644 --- a/ftd/t/html/64-muliple-node-dep.html +++ b/ftd/t/html/64-muliple-node-dep.html @@ -1326,6 +1326,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/64-multiple-node-dep-1.html b/ftd/t/html/64-multiple-node-dep-1.html index 3dca0238b1..64b7dc1460 100644 --- a/ftd/t/html/64-multiple-node-dep-1.html +++ b/ftd/t/html/64-multiple-node-dep-1.html @@ -1332,6 +1332,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/65-mut-loop.html b/ftd/t/html/65-mut-loop.html index a8f35f80a1..188520ca32 100644 --- a/ftd/t/html/65-mut-loop.html +++ b/ftd/t/html/65-mut-loop.html @@ -1328,6 +1328,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/66-inheritance.html b/ftd/t/html/66-inheritance.html index 8586efc0c1..5777ea9978 100644 --- a/ftd/t/html/66-inheritance.html +++ b/ftd/t/html/66-inheritance.html @@ -2756,6 +2756,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/67-enabled.html b/ftd/t/html/67-enabled.html index 7e5c084903..93a9009749 100644 --- a/ftd/t/html/67-enabled.html +++ b/ftd/t/html/67-enabled.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/68-anchor-id.html b/ftd/t/html/68-anchor-id.html index df76c6c69a..633e31e158 100644 --- a/ftd/t/html/68-anchor-id.html +++ b/ftd/t/html/68-anchor-id.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/69-inside-loop.html b/ftd/t/html/69-inside-loop.html index 8f5c4b5d59..63925ba7b2 100644 --- a/ftd/t/html/69-inside-loop.html +++ b/ftd/t/html/69-inside-loop.html @@ -1342,6 +1342,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/7-events.html b/ftd/t/html/7-events.html index 6213fd6715..e19261fed7 100644 --- a/ftd/t/html/7-events.html +++ b/ftd/t/html/7-events.html @@ -1325,6 +1325,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/70-figma-json-to-ftd.html b/ftd/t/html/70-figma-json-to-ftd.html index 2f84029770..1f9255d801 100644 --- a/ftd/t/html/70-figma-json-to-ftd.html +++ b/ftd/t/html/70-figma-json-to-ftd.html @@ -1341,6 +1341,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/70-length-check.html b/ftd/t/html/70-length-check.html index fa63043cb0..4f56977318 100644 --- a/ftd/t/html/70-length-check.html +++ b/ftd/t/html/70-length-check.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/71-web-component.html b/ftd/t/html/71-web-component.html index 930612d516..3462f582e8 100644 --- a/ftd/t/html/71-web-component.html +++ b/ftd/t/html/71-web-component.html @@ -1325,6 +1325,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/72-external-js.html b/ftd/t/html/72-external-js.html index 1f4a54e406..e36a3d1f0e 100644 --- a/ftd/t/html/72-external-js.html +++ b/ftd/t/html/72-external-js.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/73-complex-ftd-ui.html b/ftd/t/html/73-complex-ftd-ui.html index afcb90b192..db44ce9d15 100644 --- a/ftd/t/html/73-complex-ftd-ui.html +++ b/ftd/t/html/73-complex-ftd-ui.html @@ -1333,6 +1333,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/74-import-complex-ftd-ui.html b/ftd/t/html/74-import-complex-ftd-ui.html index b8d8962725..e17d4a876f 100644 --- a/ftd/t/html/74-import-complex-ftd-ui.html +++ b/ftd/t/html/74-import-complex-ftd-ui.html @@ -1333,6 +1333,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/8-counter.html b/ftd/t/html/8-counter.html index 39c07775d4..a72f130f1f 100644 --- a/ftd/t/html/8-counter.html +++ b/ftd/t/html/8-counter.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/9-conditional-properties.html b/ftd/t/html/9-conditional-properties.html index 8aa3fb6490..b48b49a799 100644 --- a/ftd/t/html/9-conditional-properties.html +++ b/ftd/t/html/9-conditional-properties.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/check.html b/ftd/t/html/check.html index dd2112b9e3..f3b87390d1 100644 --- a/ftd/t/html/check.html +++ b/ftd/t/html/check.html @@ -1323,6 +1323,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/function.html b/ftd/t/html/function.html index 9a111bda33..785dfb5210 100644 --- a/ftd/t/html/function.html +++ b/ftd/t/html/function.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/get.html b/ftd/t/html/get.html index 7f58aab85b..4f81f0ad82 100644 --- a/ftd/t/html/get.html +++ b/ftd/t/html/get.html @@ -1327,6 +1327,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/h-100.html b/ftd/t/html/h-100.html index b1bb211c5e..2236a13b33 100644 --- a/ftd/t/html/h-100.html +++ b/ftd/t/html/h-100.html @@ -1322,6 +1322,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/resume.html b/ftd/t/html/resume.html index 1bbe13c066..81803bbbda 100644 --- a/ftd/t/html/resume.html +++ b/ftd/t/html/resume.html @@ -1349,6 +1349,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/t/html/sd.html b/ftd/t/html/sd.html index be2aff4b45..d763feb1af 100644 --- a/ftd/t/html/sd.html +++ b/ftd/t/html/sd.html @@ -1340,6 +1340,13 @@ return f; } } +function download_text(filename, text) { +const blob = new Blob([text], { type: 'text/plain' }); +const link = document.createElement('a'); +link.href = window.URL.createObjectURL(blob); +link.download = filename; +link.click(); +} function get_color_value(cs, category, color_name) { let category_data = cs[category]; let color_data = category_data[color_name]; diff --git a/ftd/ts/utils.ts b/ftd/ts/utils.ts index d1d01d8ca2..8ca538313c 100644 --- a/ftd/ts/utils.ts +++ b/ftd/ts/utils.ts @@ -158,6 +158,14 @@ function JSONstringify(f: any) { } } +function download_text(filename: string, text: string){ + const blob = new Blob([text], { type: 'text/plain' }); + const link = document.createElement('a'); + link.href = window.URL.createObjectURL(blob); + link.download = filename; + link.click(); +} + function get_color_value(cs: Object, category: string, color_name: string): any { let category_data: Object = cs[category as keyof typeof cs];