wip
This commit is contained in:
parent
e116dae900
commit
720ec20d05
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
class FreshExtension_kagiSummarizer_Controller extends Minz_ActionController {
|
||||
public function summarizeAction() {
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ class KagiSummarizerExtension extends Minz_Extension {
|
|||
$this->registerTranslates();
|
||||
$this->registerHook('entry_before_display', [$this, 'addSummarizeButton']);
|
||||
Minz_View::appendScript($this->getFileUrl('script.js', 'js'), false, false, false);
|
||||
//Minz_View::appendStyle($this->getFileUrl('style.css', 'css'));
|
||||
$this->registerController('kagiSummarizer');
|
||||
}
|
||||
|
||||
public function handleConfigureAction() {
|
||||
|
@ -24,8 +24,13 @@ class KagiSummarizerExtension extends Minz_Extension {
|
|||
|
||||
public function addSummarizeButton(FreshRSS_Entry $entry): FreshRSS_Entry {
|
||||
$this->registerTranslates();
|
||||
|
||||
$entry->_content('<p class="kagi-summary"><a class="btn" data-url="' . urlencode($entry->link()) .'" href="#">' . _t('ext.kagiSummarizer.ui.summarize_button') . '</a></p>' . $entry->content());
|
||||
$url = Minz_Url::display(array(
|
||||
'c' => 'kagiSummarizer',
|
||||
'a' => 'summarize',
|
||||
'params' => array(
|
||||
'id' => $entry->id()
|
||||
)));
|
||||
$entry->_content('<p class="kagi-summary"><a class="btn" href="' . urlencode($entry->link()) .'">' . _t('ext.kagiSummarizer.ui.summarize_button') . '</a></p>' . $entry->content());
|
||||
return $entry;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ function configureSummarizeButtons() {
|
|||
if (target.matches('.kagi-summary a.btn')) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (target.dataset.url) {
|
||||
summarizeButtonClick(target.dataset.url, target.parentNode);
|
||||
if (target.href) {
|
||||
summarizeButtonClick(target.href, target.parentNode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue