Changeset 4982 in subversion


Ignore:
Timestamp:
Jul 28, 2011 2:23:12 AM (23 months ago)
Author:
alec
Message:
  • Fix errors when console is not defined (#1488010)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/js/app.js

    r4972 r4982  
    430430  }; 
    431431 
     432  this.log = function(msg) 
     433  { 
     434    if (window.console && console.log) 
     435      console.log(msg); 
     436  }; 
    432437 
    433438  /*********************************************************/ 
     
    54985503      lock = this.set_busy(true, 'converting'); 
    54995504 
    5500     console.log('HTTP POST: ' + url); 
     5505    this.log('HTTP POST: ' + url); 
    55015506 
    55025507    $.ajax({ type: 'POST', url: url, data: htmlText, contentType: 'application/octet-stream', 
    55035508      error: function(o, status, err) { rcmail.http_error(o, status, err, lock); }, 
    5504       success: function(data) { rcmail.set_busy(false, null, lock); $(document.getElementById(id)).val(data); console.log(data); } 
     5509      success: function(data) { rcmail.set_busy(false, null, lock); $(document.getElementById(id)).val(data); rcmail.log(data); } 
    55055510    }); 
    55065511  }; 
     
    55955600 
    55965601    // send request 
    5597     console.log('HTTP GET: ' + url); 
     5602    this.log('HTTP GET: ' + url); 
    55985603 
    55995604    return $.ajax({ 
     
    56275632 
    56285633    // send request 
    5629     console.log('HTTP POST: ' + url); 
     5634    this.log('HTTP POST: ' + url); 
    56305635 
    56315636    return $.ajax({ 
     
    56615666    // if we get javascript code from server -> execute it 
    56625667    if (response.exec) { 
    5663       console.log(response.exec); 
     5668      this.log(response.exec); 
    56645669      eval(response.exec); 
    56655670    } 
Note: See TracChangeset for help on using the changeset viewer.