diff --git a/goon/browserassets/html/saveInstructions.html b/goon/browserassets/html/saveInstructions.html new file mode 100644 index 00000000000..90040b041a0 --- /dev/null +++ b/goon/browserassets/html/saveInstructions.html @@ -0,0 +1,19 @@ + + + +Save Instructions + + +

Save Instructions

+Due to the primitive nature of IE8, this file must be saved manually. To do so, simply follow these steps. (() indicates windows specific instuctions) +
    +
  1. Click anywhere below the line
  2. +
  3. Use the Select All shortcut (ctrl+A)
  4. +
  5. Use the Copy shortcut (ctrl+C)
  6. +
  7. Create a new text document (right click desktop or explorer -> new text document)
  8. +
  9. Click the document and paste to it (ctrl+v)
  10. +
  11. Save the document with the extension .html instead of .txt
  12. +
+
+ + diff --git a/goon/browserassets/js/browserOutput.js b/goon/browserassets/js/browserOutput.js index e9b5c3dff17..0632bad9688 100644 --- a/goon/browserassets/js/browserOutput.js +++ b/goon/browserassets/js/browserOutput.js @@ -871,40 +871,19 @@ $(function() { setCookie('pingdisabled', (opts.pingDisabled ? 'true' : 'false'), 365); }); - $('#saveLog').click(function(e) { //note that this will only work in browsers supporting CORS (IE 8+ and literally every alternative) - var makeHaste = function(txt) { //creates a haste and returns the url - if (window.XMLHttpRequest) { - hasteRequest = new XMLHttpRequest(); - } else { - hasteRequest = new ActiveXObject("Microsoft.XMLHTTP"); + $('#saveLog').click(function(e) { + 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; } - hasteRequest.open('POST', 'http://localhost:7777/documents', true); - hasteRequest.onerror = function () { - internalOutput('Error in CORS request.'); - }; - hasteRequest.onreadystatechange = function() { - if(hasteRequest.readyState == XMLHttpRequest.DONE) { - if(hasteRequest.responseText != '') { - var data = JSON.parse(hasteRequest.responseText); - if(data.key) { - var d = new Date(); - var timestamp = d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()+' '+ - d.getHours()+':'+d.getMinutes()+':'+d.getSeconds(); - - internalOutput('Chat log generated. Please click the link below to view the raw data.'); - internalOutput('To save your log: Open it, right click anywhere on the page, then select Save As.
\ - For best results, save the file as [name].html then open it in any browser.'); - internalOutput('Chat Log: '+timestamp+''); - } else { - internalOutput('Error in CORS Response, no key provided Response: '+JSON.stringify(hasteRequest.responseText)); - } - } else { - internalOutput('Error in CORS Response, null sting recieved') - } - } - }; - hasteRequest.send(txt); - } + if (win && win.document && window.document.body) { + win.document.body.innerHTML = content; + return win; + } + }; if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); @@ -914,30 +893,36 @@ $(function() { // synchronous requests are depricated in modern browsers xmlHttp.open('GET', 'browserOutput.css', true); - xmlHttp.onload = function () { - if (xmlHttp.status == 200) { // request successful + xmlHttp.onload = function (e) { + if (xmlHttp.status === 200) { // request successful + // Generate Log var saved = ''; saved += $messages.html(); + saved = saved.replace(/&/g, '&'); + saved = saved.replace(/