Sha256: b22e27b4130c20b99332e251279f20fedd1b5562b386364290ec0a101a1f7f39

Contents?: true

Size: 1.23 KB

Versions: 12

Compression:

Stored size: 1.23 KB

Contents

// Allows simulation of the 'separator' key-press.
// (Painfully difficult to do in Prototype.)

FacebookList.prototype.fireSeparatorEvent = function() {
  // focus the .maininput li element. This sets the fbtaglist.current variable.
  fbtaglist.focus($$('.bit-input.maininput').first()); 
  var splitOn = this.options.get('separator').value;
  if(this.options.get('newValues')) {
    new_value_el = this.current.retrieveData('input');
    if (!new_value_el.value.endsWith('<')) {
      keep_input = "";
      if (new_value_el.value.indexOf(splitOn) < (new_value_el.value.length - splitOn.length)){
        separator_pos = new_value_el.value.indexOf(splitOn);
        keep_input = new_value_el.value.substr(separator_pos + 1);
        new_value_el.value = new_value_el.value.substr(0,separator_pos).escapeHTML().strip();
      } else {
        new_value_el.value = new_value_el.value.gsub(splitOn,"").escapeHTML().strip();
      }
      if(!this.options.get("spaceReplace").blank()) new_value_el.value.gsub(" ", this.options.get("spaceReplace"));
      if(!new_value_el.value.blank()) {
        this.newvalue = true;
        this.current_input = keep_input.escapeHTML().strip();
        this.autoAdd(new_value_el);
        this.update();
      }
    }
  };
};

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
fat_free_crm-0.13.2 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.12.3 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.12.2 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.13.1 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.12.1 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.13.0 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.12.0 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.11.4 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.11.3 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.11.2 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.11.1 vendor/assets/javascripts/facebooklist.simulate.js
fat_free_crm-0.11.0 vendor/assets/javascripts/facebooklist.simulate.js