|
|
@@ -1093,6 +1093,36 @@ function init_stream(stream) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ el = ev.target.closest('.item.share a.dropdown-toggle');
|
|
|
+ if (el) {
|
|
|
+ const itemId = el.closest('.flux').id;
|
|
|
+ const templateId = 'share_article_template';
|
|
|
+ const id = itemId;
|
|
|
+ const flux_header_el = el.closest('.flux');
|
|
|
+ const title_el = flux_header_el.querySelector('.item.titleAuthorSummaryDate .item-element.title');
|
|
|
+ const websiteName = ' - ' + flux_header_el.querySelector('.flux_header').dataset.websiteName;
|
|
|
+ const articleAuthors = flux_header_el.querySelector('.flux_header').dataset.articleAuthors;
|
|
|
+ let articleAuthorsText = '';
|
|
|
+ if (articleAuthors.trim().length > 0) {
|
|
|
+ articleAuthorsText = ' (' + articleAuthors + ')';
|
|
|
+ }
|
|
|
+ const link = title_el.href;
|
|
|
+ const title = title_el.textContent;
|
|
|
+ const titleText = title;
|
|
|
+ const div = el.parentElement;
|
|
|
+ const dropdownMenu = div.querySelector('.dropdown-menu');
|
|
|
+ const template = document.getElementById(templateId).innerHTML
|
|
|
+ .replace(/--entryId--/g, id)
|
|
|
+ .replace(/--link--/g, link)
|
|
|
+ .replace(/--titleText--/g, titleText)
|
|
|
+ .replace(/--websiteName--/g, websiteName)
|
|
|
+ .replace(/--articleAuthors--/g, articleAuthorsText);
|
|
|
+ if (!dropdownMenu) {
|
|
|
+ div.insertAdjacentHTML('beforeend', template);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
el = ev.target.closest('.item.share > button[data-type="print"]');
|
|
|
if (el) { // Print
|
|
|
const tmp_window = window.open();
|