hardlounge/client/js/socket-events/msg_preview.js

14 lines
359 B
JavaScript
Raw Normal View History

2017-06-26 09:01:55 +00:00
"use strict";
const $ = require("jquery");
const Handlebars = require("handlebars/runtime");
const renderPreview = require("../renderPreview");
2017-06-26 09:01:55 +00:00
const socket = require("../socket");
socket.on("msg:preview", function(data) {
const msg = $("#msg-" + data.id);
data.link = Handlebars.Utils.escapeExpression(data.link);
renderPreview(data.preview, msg);
2017-06-26 09:01:55 +00:00
});