Aleksander Machniak
2014-07-09 1f164e4526a57ec25c2509d984e671ec411dc1d2
program/js/app.js
@@ -664,11 +664,11 @@
    // process external commands
    if (typeof this.command_handlers[command] === 'function') {
      ret = this.command_handlers[command](props, obj);
      ret = this.command_handlers[command](props, obj, event);
      return ret !== undefined ? ret : (obj ? false : true);
    }
    else if (typeof this.command_handlers[command] === 'string') {
      ret = window[this.command_handlers[command]](props, obj);
      ret = window[this.command_handlers[command]](props, obj, event);
      return ret !== undefined ? ret : (obj ? false : true);
    }
@@ -3722,10 +3722,7 @@
    // submit delete request
    if (key && confirm(this.get_label('deleteresponseconfirm'))) {
      this.http_post('settings/delete-response', { _key: key }, false);
      return true;
    }
    return false;
  };
  // updates spellchecker buttons on state change
@@ -4546,10 +4543,6 @@
      this.ksearch_pane = $('<div>').attr('id', 'rcmKSearchpane').attr('role', 'listbox')
        .css({ position:'absolute', 'z-index':30000 }).append(ul).appendTo(document.body);
      this.ksearch_pane.__ul = ul[0];
      // register (delegate) event handlers
      ul.on('mouseover', 'li', function(e){ ref.ksearch_select(e.target); })
        .on('mouseup', 'li', function(e){ ref.ksearch_click(e.target); })
    }
    ul = this.ksearch_pane.__ul;
@@ -4572,7 +4565,7 @@
    // add each result line to list
    if (results && (len = results.length)) {
      for (i=0; i < len && maxlen > 0; i++) {
        text = typeof results[i] === 'object' ? results[i].name : results[i];
        text = typeof results[i] === 'object' ? (results[i].display || results[i].name) : results[i];
        type = typeof results[i] === 'object' ? results[i].type : '';
        id = i + this.env.contacts.length;
        $('<li>').attr('id', 'rcmkSearchItem' + id)
@@ -4580,6 +4573,8 @@
          .html(this.quote_html(text.replace(new RegExp('('+RegExp.escape(value)+')', 'ig'), '##$1%%')).replace(/##([^%]+)%%/g, '<b>$1</b>'))
          .addClass(type || '')
          .appendTo(ul)
          .mouseover(function() { ref.ksearch_select(this); })
          .mouseup(function() { ref.ksearch_click(this); })
          .get(0)._rcm_id = id;
        maxlen -= 1;
      }
@@ -5702,10 +5697,8 @@
      id = this.env.iid ? this.env.iid : selection[0];
    // submit request with appended token
    if (confirm(this.get_label('deleteidentityconfirm')))
      this.goto_url('delete-identity', { _iid: id, _token: this.env.request_token }, true);
    return true;
    if (id && confirm(this.get_label('deleteidentityconfirm')))
      this.http_post('settings/delete-identity', { _iid: id }, true);
  };
  this.update_identity_row = function(id, name, add)
@@ -5749,6 +5742,23 @@
        frame.location.href = this.env.blankpage;
      }
    }
    this.enable_command('delete', false);
  };
  this.remove_identity = function(id)
  {
    var frame, list = this.identity_list,
      rid = this.html_identifier(id);
    if (list && id) {
      list.remove_row(rid);
      if (this.env.contentframe && (frame = this.get_frame_window(this.env.contentframe))) {
        frame.location.href = this.env.blankpage;
      }
    }
    this.enable_command('delete', false);
  };