alecpl
2011-07-28 b0eb95a662e537c9198d0df4ac841b5d3d4389d8
- Fix errors when console is not defined (#1488010)


1 files modified
15 ■■■■■ changed files
program/js/app.js 15 ●●●●● patch | view | raw | blame | history
program/js/app.js
@@ -429,6 +429,11 @@
    this.start_keepalive();
  };
  this.log = function(msg)
  {
    if (window.console && console.log)
      console.log(msg);
  };
  /*********************************************************/
  /*********       client command interface        *********/
@@ -5497,11 +5502,11 @@
      url = '?_task=utils&_action=html2text',
      lock = this.set_busy(true, 'converting');
    console.log('HTTP POST: ' + url);
    this.log('HTTP POST: ' + url);
    $.ajax({ type: 'POST', url: url, data: htmlText, contentType: 'application/octet-stream',
      error: function(o, status, err) { rcmail.http_error(o, status, err, lock); },
      success: function(data) { rcmail.set_busy(false, null, lock); $(document.getElementById(id)).val(data); console.log(data); }
      success: function(data) { rcmail.set_busy(false, null, lock); $(document.getElementById(id)).val(data); rcmail.log(data); }
    });
  };
@@ -5594,7 +5599,7 @@
    url += '&_remote=1';
    // send request
    console.log('HTTP GET: ' + url);
    this.log('HTTP GET: ' + url);
    return $.ajax({
      type: 'GET', url: url, data: { _unlock:(lock?lock:0) }, dataType: 'json',
@@ -5626,7 +5631,7 @@
    }
    // send request
    console.log('HTTP POST: ' + url);
    this.log('HTTP POST: ' + url);
    return $.ajax({
      type: 'POST', url: url, data: postdata, dataType: 'json',
@@ -5660,7 +5665,7 @@
    // if we get javascript code from server -> execute it
    if (response.exec) {
      console.log(response.exec);
      this.log(response.exec);
      eval(response.exec);
    }