You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
828 B
33 lines
828 B
$(document).ready(()=>{
|
|
|
|
var socket = io();
|
|
var baseUrl = 'http://' + window.location.hostname;
|
|
var urlString = window.location.href;
|
|
var mid = getParameterByName("mid", urlString);
|
|
|
|
var form = $('.send_message_form');
|
|
|
|
form.on('submit', function(e){
|
|
e.preventDefault();
|
|
|
|
var title = form.find('.title').val();
|
|
//var mid = form.find('.mid').val();
|
|
|
|
socket.emit('pushMessage', mid);
|
|
parent.postMessage("cbClose", baseUrl);
|
|
|
|
});
|
|
|
|
|
|
function getParameterByName(name, url) {
|
|
if (!url) url = window.location.href;
|
|
name = name.replace(/[\[\]]/g, "\\$&");
|
|
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
|
results = regex.exec(url);
|
|
if (!results) return null;
|
|
if (!results[2]) return '';
|
|
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
|
}
|
|
|
|
});
|
|
|