From ca6dc231455b6d16919297de129af4a17df131af Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Mon, 25 Sep 2023 13:30:27 -0500 Subject: [PATCH] added script test --- extension.php | 2 +- static/script.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 static/script.js diff --git a/extension.php b/extension.php index ca2fd34..cd05a8d 100644 --- a/extension.php +++ b/extension.php @@ -4,7 +4,7 @@ class KagiSummarizerExtension extends Minz_Extension { public function init() { $this->registerTranslates(); $this->registerHook('entry_before_display', [$this, 'addSummarizeButton']); - //Minz_View::appendScript($this->getFileUrl('script.js', 'js'), false, false, false); + Minz_View::appendScript($this->getFileUrl('script.js', 'js'), false, false, false); //Minz_View::appendStyle($this->getFileUrl('style.css', 'css')); } diff --git a/static/script.js b/static/script.js new file mode 100644 index 0000000..a8ca8a0 --- /dev/null +++ b/static/script.js @@ -0,0 +1,9 @@ +if (document.readyState && document.readyState !== 'loading') { + documentReady(); +} else { + document.addEventListener('DOMContentLoaded', documentReady, false); +} + +function documentReady() { + console.log('executed documentReady'); +}