includes/clientside/static/editor.js
changeset 651 ce9d78d7251d
parent 650 e45183014778
child 672 08a7875258b4
equal deleted inserted replaced
650:e45183014778 651:ce9d78d7251d
    24       if ( ajax.readyState == 4 && ajax.status == 200 )
    24       if ( ajax.readyState == 4 && ajax.status == 200 )
    25       {
    25       {
    26         unsetAjaxLoading();
    26         unsetAjaxLoading();
    27         
    27         
    28         var response = String(ajax.responseText + '');
    28         var response = String(ajax.responseText + '');
    29         if ( response.substr(0, 1) != '{' )
    29         if ( !check_json_response(response) )
    30         {
    30         {
    31           handle_invalid_json(response);
    31           handle_invalid_json(response);
    32           return false;
    32           return false;
    33         }
    33         }
    34         
    34         
   578     {
   578     {
   579       if ( ajax.readyState == 4 && ajax.status == 200 )
   579       if ( ajax.readyState == 4 && ajax.status == 200 )
   580       {
   580       {
   581         ajaxUnSetEditorLoading();
   581         ajaxUnSetEditorLoading();
   582         var response = String(ajax.responseText + '');
   582         var response = String(ajax.responseText + '');
   583         if ( response.substr(0, 1) != '{' )
   583         if ( !check_json_response(response) )
   584         {
   584         {
   585           handle_invalid_json(response);
   585           handle_invalid_json(response);
   586           return false;
   586           return false;
   587         }
   587         }
   588         
   588         
   751       if ( ajax.readyState == 4 && ajax.status == 200 )
   751       if ( ajax.readyState == 4 && ajax.status == 200 )
   752       {
   752       {
   753         ajaxUnSetEditorLoading();
   753         ajaxUnSetEditorLoading();
   754         
   754         
   755         var response = String(ajax.responseText + '');
   755         var response = String(ajax.responseText + '');
   756         if ( response.substr(0, 1) != '{' )
   756         if ( !check_json_response(response) )
   757         {
   757         {
   758           handle_invalid_json(response);
   758           handle_invalid_json(response);
   759           return false;
   759           return false;
   760         }
   760         }
   761         
   761         
   970       if ( ajax.readyState == 4 && ajax.status == 200 )
   970       if ( ajax.readyState == 4 && ajax.status == 200 )
   971       {
   971       {
   972         ajaxUnSetEditorLoading();
   972         ajaxUnSetEditorLoading();
   973         
   973         
   974         var response = String(ajax.responseText + '');
   974         var response = String(ajax.responseText + '');
   975         if ( response.substr(0, 1) != '{' )
   975         if ( !check_json_response(response) )
   976         {
   976         {
   977           handle_invalid_json(response);
   977           handle_invalid_json(response);
   978           return false;
   978           return false;
   979         }
   979         }
   980         
   980         
   999         dn.parentNode.removeChild(dn);
   999         dn.parentNode.removeChild(dn);
  1000       }
  1000       }
  1001     }, true);
  1001     }, true);
  1002 }
  1002 }
  1003 
  1003 
  1004 /**
       
  1005  * Equivalent of PHP's time()
       
  1006  * @return int
       
  1007  */
       
  1008 
       
  1009 function unix_time()
       
  1010 {
       
  1011   return parseInt((new Date()).getTime()/1000);
       
  1012 }