Aleksander Machniak
2013-12-12 4187b3e26ff00b607d05cb9b588e83db18c3cab7
Merge branch 'master' of github.com:roundcube/roundcubemail
4 files modified
105 ■■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/js/app.js 12 ●●●●● patch | view | raw | blame | history
program/js/list.js 90 ●●●●● patch | view | raw | blame | history
program/steps/settings/save_folder.inc 2 ●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Fix regression where only first new folder was placed in correct place on the list (#1489472)
- Fix issue where children of selected and collapsed thread were skipped on various actions (#1489457)
- Fix issue where groups were not deleted when "Replace entire addressbook" option on contacts import was used (#1489420)
- Fix unreliable mimetype tests in Installer (#1489453)
program/js/app.js
@@ -5744,19 +5744,23 @@
      .prop({checked: subscribed ? true : false, disabled: is_protected ? true : false});
    // add to folder/row-ID map
    this.env.subscriptionrows[id] = [name, display_name, 0];
    this.env.subscriptionrows[id] = [name, display_name, false];
    // sort folders (to find a place where to insert the row)
    // replace delimiter with \0 character to fix sorting
    // issue where 'Abc Abc' would be placed before 'Abc/def'
    var replace_from = RegExp(RegExp.escape(this.env.delimiter), 'g'),
      replace_to = String.fromCharCode(0);
    $.each(this.env.subscriptionrows, function(k,v) {
      var n = v[0];
      n = n.replace(replace_from, replace_to);
      v.push(n);
      if (v.length < 4) {
        var n = v[0];
        n = n.replace(replace_from, replace_to);
        v.push(n);
      }
      folders.push(v);
    });
    folders.sort(function(a, b) {
      var len = a.length - 1; n1 = a[len], n2 = b[len];
      return n1 < n2 ? -1 : 1;
program/js/list.js
@@ -1322,59 +1322,71 @@
  if (this.drag_start) {
    // check mouse movement, of less than 3 pixels, don't start dragging
    var m = rcube_event.get_mouse_pos(e);
    var m = rcube_event.get_mouse_pos(e),
      limit = 10, selection = [], self = this;
    if (!this.drag_mouse_start || (Math.abs(m.x - this.drag_mouse_start.x) < 3 && Math.abs(m.y - this.drag_mouse_start.y) < 3))
      return false;
    // remember dragging start position
    this.drag_start_pos = {left: m.x, top: m.y};
    // initialize drag layer
    if (!this.draglayer)
      this.draglayer = $('<div>').attr('id', 'rcmdraglayer')
        .css({ position:'absolute', display:'none', 'z-index':2000 })
        .css({position: 'absolute', display: 'none', 'z-index': 2000})
        .appendTo(document.body);
    else
      this.draglayer.html('');
    // also select childs of (collapsed) threads for dragging
    var n, uid, selection = $.merge([], this.selection);
    for (n in selection) {
      uid = selection[n];
      if (!this.rows[uid].expanded)
        this.select_children(uid);
    }
    // get selected rows (in display order), don't use this.selection here
    $(this.row_tagname() + '.selected', this.tbody).each(function() {
      if (!String(this.id).match(self.id_regexp))
        return;
    // reset content
    this.draglayer.html('');
      var uid = RegExp.$1, row = self.rows[uid];
    // get subjects of selected messages
    var n, obj, me = this;
    for (n=0; n<this.selection.length; n++) {
      // only show 12 lines
      if (n>12) {
        this.draglayer.append('...');
        break;
      }
      if ($.inArray(uid, selection) > -1)
        return;
      if (obj = this.rows[this.selection[n]].obj) {
        $('> '+this.col_tagname(), obj).each(function(i, elem) {
          if (n == 0)
            me.drag_start_pos = $(elem).offset();
      selection.push(uid);
          if (me.subject_col < 0 || (me.subject_col >= 0 && me.subject_col == i)) {
            var subject = $(elem).text();
            if (subject) {
              // remove leading spaces
              subject = $.trim(subject);
              // truncate line to 50 characters
              subject = (subject.length > 50 ? subject.substring(0, 50) + '...' : subject);
              var entry = $('<div>').text(subject);
              me.draglayer.append(entry);
            }
            return false;  // break
          }
      // also handle children of (collapsed) trees for dragging (they might be not selected)
      if (row.has_children && !row.expanded)
        $.each(self.row_children(uid), function() {
          if ($.inArray(this, selection) > -1)
            return;
          selection.push(this);
        });
      // break the loop asap
      if (selection.length > limit + 1)
        return false;
    });
    // append subject (of every row up to the limit) to the drag layer
    $.each(selection, function(i, uid) {
      if (i > limit) {
        self.draglayer.append('...');
        return false;
      }
    }
      $('> ' + self.col_tagname(), self.rows[uid].obj).each(function(n, cell) {
        if (self.subject_col < 0 || (self.subject_col >= 0 && self.subject_col == n)) {
          var subject = $(cell).text();
          if (subject) {
            // remove leading spaces
            subject = $.trim(subject);
            // truncate line to 50 characters
            subject = (subject.length > 50 ? subject.substring(0, 50) + '...' : subject);
            self.draglayer.append($('<div>').text(subject));
            return false;
          }
        }
      });
    });
    this.draglayer.show();
    this.drag_active = true;
program/steps/settings/save_folder.inc
@@ -40,7 +40,7 @@
if ($options['protected'] || $options['norename']) {
}
else if (!strlen($name)) {
    $error = rcube_label('cannotbeempty');
    $error = rcube_label('namecannotbeempty');
}
else if (mb_strlen($name) > 128) {
    $error = rcube_label('nametoolong');