aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/assets
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/assets')
-rw-r--r--juick-server/src/main/assets/embed.js8
-rw-r--r--juick-server/src/main/assets/scripts.js8
2 files changed, 7 insertions, 9 deletions
diff --git a/juick-server/src/main/assets/embed.js b/juick-server/src/main/assets/embed.js
index 25c37142..d4cbab8e 100644
--- a/juick-server/src/main/assets/embed.js
+++ b/juick-server/src/main/assets/embed.js
@@ -285,7 +285,7 @@ function embedLinks(aNodes, container) {
* @param {string} beforeNodeSelector
* @param {string} allLinksSelector
*/
-function embedLinksToX(x, beforeNodeSelector, allLinksSelector) {
+export function embedLinksToX(x, beforeNodeSelector, allLinksSelector) {
let isCtsPost = false;
let allLinks = x.querySelectorAll(allLinksSelector);
@@ -323,7 +323,7 @@ function embedLinksToPost() {
/**
* Embed all the links in all messages/replies on the page.
*/
-function embedAll() {
+export function embedAll() {
if (document.querySelector('#content article[data-mid]')) {
embedLinksToArticles();
} else {
@@ -331,6 +331,4 @@ function embedAll() {
}
}
-exports.embedAll = embedAll;
-exports.embedLinksToX = embedLinksToX;
-exports.format = juickFormat;
+export const format = juickFormat;
diff --git a/juick-server/src/main/assets/scripts.js b/juick-server/src/main/assets/scripts.js
index 697919bd..e757261f 100644
--- a/juick-server/src/main/assets/scripts.js
+++ b/juick-server/src/main/assets/scripts.js
@@ -3,7 +3,7 @@ require('element-closest');
require('classlist.js');
require('url-search-params-polyfill');
require('formdata-polyfill');
-import * as killy from './embed';
+import { embedLinksToX, embedAll, format } from './embed';
if (!('remove' in Element.prototype)) { // Firefox <23
Element.prototype.remove = function() {
@@ -181,7 +181,7 @@ function wsIncomingReply(msg) {
<a href="/m/${msg.mid}#${msg.rid}" title="${msg.timestamp}GMT">${msg.timestamp}</a>
</div>
</div>
- <div class="msg-txt">${killy.format(msg.body, msg.mid, false)}</div>${photoDiv}
+ <div class="msg-txt">${format(msg.body, msg.mid, false)}</div>${photoDiv}
<div class="msg-links">${msgNum} &middot; <a class="msg-reply-link" href="#">${i18n('message.reply')}</a></div>
<div class="msg-comment-target msg-comment-hidden"></div>
</div>`;
@@ -197,7 +197,7 @@ function wsIncomingReply(msg) {
e.preventDefault();
});
- killy.embedLinksToX(li.querySelector('.msg-cont'), '.msg-links', '.msg-txt a');
+ embedLinksToX(li.querySelector('.msg-cont'), '.msg-links', '.msg-txt a');
document.getElementById('replies').appendChild(li);
@@ -867,7 +867,7 @@ ready(function() {
});
initES();
- killy.embedAll();
+ embedAll();
var elSelector = 'header',
elClassHidden = 'header--hidden',
elClassBackground = 'header--background',