mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 21:48:21 +01:00
Fixes #8540
Also adds a seperate iframe explaining how to save the output since IE8 lacks support for doing things nicely.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Save Instructions</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Save Instructions</h2>
|
||||
Due to the primitive nature of IE8, this file must be saved manually. To do so, simply follow these steps. (() indicates windows specific instuctions)
|
||||
<ol>
|
||||
<li>Click anywhere below the line</li>
|
||||
<li>Use the Select All shortcut (ctrl+A)</li>
|
||||
<li>Use the Copy shortcut (ctrl+C)</li>
|
||||
<li>Create a new text document (right click desktop or explorer -> new text document)</li>
|
||||
<li>Click the document and paste to it (ctrl+v)</li>
|
||||
<li>Save the document with the extension .html instead of .txt</li>
|
||||
</ol>
|
||||
<hr>
|
||||
</body>
|
||||
</html>
|
||||
@@ -872,31 +872,57 @@ $(function() {
|
||||
});
|
||||
|
||||
$('#saveLog').click(function(e) {
|
||||
var saved = '';
|
||||
var openWindow = function (content) { //opens a window
|
||||
var win;
|
||||
try {
|
||||
win = window.open('', 'RAW Chat Log', 'toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, width=1200, height=800, top='+(screen.height-400)+', left='+(screen.width-840));
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
if (win && win.document && window.document.body) {
|
||||
win.document.body.innerHTML = content;
|
||||
return win;
|
||||
}
|
||||
};
|
||||
|
||||
if (window.XMLHtpRequest) {
|
||||
if (window.XMLHttpRequest) {
|
||||
xmlHttp = new XMLHttpRequest();
|
||||
} else {
|
||||
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
xmlHttp.open('GET', 'browserOutput.css', false);
|
||||
|
||||
// synchronous requests are depricated in modern browsers
|
||||
xmlHttp.open('GET', 'browserOutput.css', true);
|
||||
xmlHttp.onload = function (e) {
|
||||
if (xmlHttp.status === 200) { // request successful
|
||||
|
||||
// Generate Log
|
||||
var saved = '<style>'+xmlHttp.responseText+'</style>';
|
||||
saved += $messages.html();
|
||||
saved = saved.replace(/&/g, '&');
|
||||
saved = saved.replace(/</g, '<');
|
||||
|
||||
// Generate final output and open the window
|
||||
var finalText = '<head><title>Chat Log</title></head> \
|
||||
<iframe src="saveInstructions.html" id="instructions" style="border:none;" height="220" width="100%"></iframe>'+
|
||||
saved
|
||||
openWindow(finalText);
|
||||
} else { // request returned http error
|
||||
openWindow('Style Doc Retrieve Error: '+xmlHttp.statusText);
|
||||
}
|
||||
}
|
||||
|
||||
// timeout and request errors
|
||||
xmlHttp.timeout = 300;
|
||||
xmlHttp.ontimeout = function (e) {
|
||||
openWindow('XMLHttpRequest Timeout');
|
||||
}
|
||||
xmlHttp.onerror = function (e) {
|
||||
openWindow('XMLHttpRequest Error: '+xmlHttp.statusText);
|
||||
}
|
||||
// css needs special headers
|
||||
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;
|
||||
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));
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
if (win && win.document && window.document.body) {
|
||||
win.document.body.innerHTML = saved;
|
||||
}
|
||||
xmlHttp.send(null);
|
||||
});
|
||||
|
||||
$('#highlightTerm').click(function(e) {
|
||||
|
||||
@@ -11,7 +11,8 @@ var/list/chatResources = list(
|
||||
"goon/browserassets/css/fonts/PxPlus_IBM_MDA.ttf",
|
||||
"goon/browserassets/css/font-awesome.css",
|
||||
"goon/browserassets/css/browserOutput.css",
|
||||
"goon/browserassets/json/unicode_9_annotations.json"
|
||||
"goon/browserassets/json/unicode_9_annotations.json",
|
||||
"goon/browserassets/html/saveInstructions.html"
|
||||
)
|
||||
|
||||
/var/savefile/iconCache = new /savefile("data/iconCache.sav")
|
||||
|
||||
Reference in New Issue
Block a user