wip
This commit is contained in:
parent
57c7ea88ba
commit
e116dae900
|
@ -5,17 +5,23 @@ if (document.readyState && document.readyState !== 'loading') {
|
|||
}
|
||||
|
||||
function configureSummarizeButtons() {
|
||||
console.log('registering kagi handler');
|
||||
document.getElementById('global').addEventListener('click', function(e) {
|
||||
console.log('kagi handler triggered');
|
||||
for (var target = e.target; target && target != this; target = target.parentNode) {
|
||||
if (target.matches('.kagi-summary a.btn')) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
console.log('kagi button clicked', target.dataset.url);
|
||||
if (target.dataset.url) {
|
||||
summarizeButtonClick(target.dataset.url, target.parentNode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
console.log('kagi handler ignoring click');
|
||||
}, false);
|
||||
}
|
||||
|
||||
function summarizeButtonClick(url, container) {
|
||||
container.innerHTML = url;
|
||||
container.classList.add('alert');
|
||||
container.classList.add('alert-success');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue