From 986da803e25d38606249245af9a24609d43a4cae Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Mon, 25 Sep 2023 14:03:51 -0500 Subject: [PATCH] wip --- extension.php | 2 +- static/script.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/extension.php b/extension.php index 62b9bd0..cd05a8d 100644 --- a/extension.php +++ b/extension.php @@ -25,7 +25,7 @@ class KagiSummarizerExtension extends Minz_Extension { public function addSummarizeButton(FreshRSS_Entry $entry): FreshRSS_Entry { $this->registerTranslates(); - $entry->_content('

' . $entry->content()); + $entry->_content('

' . _t('ext.kagiSummarizer.ui.summarize_button') . '

' . $entry->content()); return $entry; } } diff --git a/static/script.js b/static/script.js index 523961c..bb7b350 100644 --- a/static/script.js +++ b/static/script.js @@ -1,3 +1,9 @@ -function kagiSummarize(url) { - console.log('got url', url); +if (document.readyState && document.readyState !== 'loading') { + configureKagiButtons(); +} else { + document.addEventListener('DOMNodeInserted', configureKagiButtons, false); +} + +function configureKagiButtons() { + console.log('configuring kagi buttons'); }