Aleksander Machniak
2015-10-20 8f8beafd5619bde6ceebf30f0d8bfbfaa58973ae
program/js/app.js
@@ -3435,8 +3435,6 @@
    }
    else if (action == 'compose') {
      this.env.compose_commands.push('compose-encrypted');
      // display the toolbar button
      $('#' + this.buttons['compose-encrypted'][0].id).show();
      var is_html = $('input[name="_is_html"]').val() > 0;
@@ -4316,7 +4314,7 @@
      '<textarea name="text" id="ffresponsetext" cols="40" rows="8"></textarea></div>' +
      '</form>';
    buttons[this.gettext('save')] = function(e) {
    buttons[this.get_label('save')] = function(e) {
      var name = $('#ffresponsename').val(),
        text = $('#ffresponsetext').val();
@@ -4332,11 +4330,11 @@
      $(this).dialog('close');
    };
    buttons[this.gettext('cancel')] = function() {
    buttons[this.get_label('cancel')] = function() {
      $(this).dialog('close');
    };
    this.show_popup_dialog(html, this.gettext('newresponse'), buttons, {button_classes: ['mainaction']});
    this.show_popup_dialog(html, this.get_label('newresponse'), buttons, {button_classes: ['mainaction']});
    $('#ffresponsetext').val(text);
    $('#ffresponsename').select();
@@ -5572,7 +5570,7 @@
      // add link to pop back to parent group
      if (this.env.address_group_stack.length > 1) {
        $('<a href="#list">...</a>')
          .attr('title', this.gettext('uponelevel'))
          .attr('title', this.get_label('uponelevel'))
          .addClass('poplink')
          .appendTo(boxtitle)
          .click(function(e){ return ref.command('popgroup','',this); });
@@ -7927,8 +7925,11 @@
  };
  // send a http request to the server
  this.http_request = function(action, data, lock)
  this.http_request = function(action, data, lock, type)
  {
    if (type != 'POST')
      type = 'GET';
    if (typeof data !== 'object')
      data = rcube_parse_query(data);
@@ -7952,60 +7953,26 @@
      }
    }
    var url = this.url(action, data);
    // send request
    this.log('HTTP GET: ' + url);
    var url = this.url(action);
    // reset keep-alive interval
    this.start_keepalive();
    // send request
    return $.ajax({
      type: 'GET', url: url, dataType: 'json',
      type: type, url: url, data: data, dataType: 'json',
      success: function(data) { ref.http_response(data); },
      error: function(o, status, err) { ref.http_error(o, status, err, lock, action); }
    });
  };
  // send a http GET request to the server
  this.http_get = this.http_request;
  // send a http POST request to the server
  this.http_post = function(action, data, lock)
  {
    if (typeof data !== 'object')
      data = rcube_parse_query(data);
    data._remote = 1;
    data._unlock = lock ? lock : 0;
    // trigger plugin hook
    var result = this.triggerEvent('request'+action, data);
    // abort if one of the handlers returned false
    if (result === false) {
      if (data._unlock)
        this.set_busy(false, null, data._unlock);
      return false;
    }
    else if (result !== undefined) {
      data = result;
      if (data._action) {
        action = data._action;
        delete data._action;
      }
    }
    var url = this.url(action);
    // send request
    this.log('HTTP POST: ' + url);
    // reset keep-alive interval
    this.start_keepalive();
    return $.ajax({
      type: 'POST', url: url, data: data, dataType: 'json',
      success: function(data){ ref.http_response(data); },
      error: function(o, status, err) { ref.http_error(o, status, err, lock, action); }
    });
    return this.http_request(action, data, lock, 'POST');
  };
  // aborts ajax request
@@ -8442,7 +8409,7 @@
      if (uri = e.dataTransfer.getData('roundcube-uri')) {
        var ts = new Date().getTime(),
          // jQuery way to escape filename (#1490530)
          content = $('<span>').text(e.dataTransfer.getData('roundcube-name') || this.gettext('attaching')).html();
          content = $('<span>').text(e.dataTransfer.getData('roundcube-name') || this.get_label('attaching')).html();
        args._uri = uri;
        args._uploadid = ts;