mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
@SpaiR's recommendation for log saving
This commit is contained in:
@@ -803,31 +803,25 @@ $(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#saveLog').click(function(e) {
|
$('#saveLog').click(function(e) {
|
||||||
var saved = '';
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
if (window.XMLHttpRequest) {
|
url: 'browserOutput.css',
|
||||||
xmlHttp = new XMLHttpRequest();
|
success: function(styleData) {
|
||||||
} else {
|
|
||||||
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
|
|
||||||
}
|
|
||||||
xmlHttp.open('GET', 'browserOutput.css', false);
|
|
||||||
xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
||||||
xmlHttp.send();
|
|
||||||
saved += '<style>'+xmlHttp.responseText+'</style>';
|
|
||||||
|
|
||||||
saved += $messages.html();
|
|
||||||
saved = saved.replace(/&/g, '&');
|
|
||||||
saved = saved.replace(/</g, '<');
|
|
||||||
|
|
||||||
var win;
|
var win;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
win = window.open('', 'Chat Log', 'toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, width=780, height=200, top='+(screen.height-400)+', left='+(screen.width-840));
|
win = window.open('', 'Chat Log', 'toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, width=780, height=600, top=' + (screen.height/2 - 635/2) + ', left=' + (screen.width/2 - 780/2));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (win && win.document && window.document.body) {
|
|
||||||
win.document.body.innerHTML = saved;
|
if (win) {
|
||||||
|
win.document.head.innerHTML = '<title>Chat Log</title>';
|
||||||
|
win.document.head.innerHTML += '<style>' + styleData + '</style>';
|
||||||
|
win.document.body.innerHTML = $messages.html();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#highlightTerm').click(function(e) {
|
$('#highlightTerm').click(function(e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user