From 53c6442f752b2ed51e3c9b8b9eed235ffba8d75e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 7 Nov 2018 00:28:35 +0300 Subject: www: babel-polyfill --- juick-server/src/main/assets/embed.js | 8 +++----- juick-server/src/main/assets/scripts.js | 8 ++++---- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'juick-server/src/main') 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) { ${msg.timestamp} -
${killy.format(msg.body, msg.mid, false)}
${photoDiv} +
${format(msg.body, msg.mid, false)}
${photoDiv}
`; @@ -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', -- cgit v1.2.3