Time params on the action and URI encode content

This commit is contained in:
Matt Pass
2014-11-13 13:59:44 +00:00
parent 6e12da596c
commit 2f66afa4e4
3 changed files with 29 additions and 21 deletions

View File

@@ -2070,6 +2070,10 @@ var ICEcoder = {
if (xhr.readyState==4 && xhr.status==200) {
// console.log(xhr.responseText);
var statusArray = JSON.parse(xhr.responseText);
// Set the actions end time and time taken in JSON object
statusArray.action.timeEnd = new Date().getTime();
statusArray.action.timeTaken = statusArray.action.timeEnd - statusArray.action.timeStart;
// console.log(statusArray);
if (statusArray.status.error) {
@@ -2084,7 +2088,8 @@ var ICEcoder = {
// console.log('Calling '+saveURL+' via XHR');
xhr.open("POST",saveURL,true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.send('contents='+top.document.getElementById('saveTemp1').value);
timeStart = new Date().getTime();
xhr.send('timeStart='+timeStart+'&contents='+encodeURIComponent(top.document.getElementById('saveTemp1').value));
} else {