From 0b916786c243fdf64b3e52fb9e9376eb779747c8 Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Mon, 25 Sep 2023 11:49:34 -0500 Subject: [PATCH] initial commit --- configure.phtml | 18 ++++++++++++++++++ extension.php | 23 +++++++++++++++++++++++ i18n/en/ext.php | 9 +++++++++ metadata.json | 8 ++++++++ 4 files changed, 58 insertions(+) create mode 100644 configure.phtml create mode 100644 extension.php create mode 100644 i18n/en/ext.php create mode 100644 metadata.json diff --git a/configure.phtml b/configure.phtml new file mode 100644 index 0000000..6075d69 --- /dev/null +++ b/configure.phtml @@ -0,0 +1,18 @@ +kagi_api_key; +?> + +
+ +
+ +
+ +
+
+
+
+ +
+
+
diff --git a/extension.php b/extension.php new file mode 100644 index 0000000..5f9ce64 --- /dev/null +++ b/extension.php @@ -0,0 +1,23 @@ +registerTranslates(); + + Minz_View::appendScript($this->getFileUrl('script.js', 'js'), false, false, false); + Minz_View::appendStyle($this->getFileUrl('style.css', 'css')); + Minz_View::appendScript(_url('kagiSummarizer', 'jsVars', false, true, false); + + $this->registerController('kagiSummarizer'); + $this->registerViews(); + } + + public function handleConfigureAction() { + $this->registerTranslates(); + + if (Minz_Request::isPost()) { + $api_key = Minz_Request::param('api_key', ''); + FreshRSS_Context::$user_conf->kagi_api_key = $api_key; + FreshRSS_Context::$user_conf->save(); + } +} diff --git a/i18n/en/ext.php b/i18n/en/ext.php new file mode 100644 index 0000000..7b0fea6 --- /dev/null +++ b/i18n/en/ext.php @@ -0,0 +1,9 @@ + array( + 'configure' => array( + 'api_key' => 'Kagi API Key' + ) + ) +); diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..4fc8603 --- /dev/null +++ b/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "Kagi Summarizer", + "author": "Rudis Muiznieks", + "description": "Add a button to summarize articles with the Kagi Universal Summarizer.", + "version": 0.1, + "entrypoint": "KagiSummarizer", + "type": "user" +}