Common processing after data change via both UI and API
@param {HTMLElement} el
15756
function processAfterStateChange(el) {
    const optionValue = el.dataset.optionValue;
    const optionIndex = Array.prototype.slice.call(el.parentNode.children).indexOf(el);
    this.setSelectedOption(optionValue);
    elementScroll.scroll(el);
    emitAndFire(this, 'listbox-change', {
        index: optionIndex,
        selected: [optionValue],
        el
    });
}
747827
protected void requestElementUpdate (String name, int index, Object value, Object oldValue)
    {
        requestElementUpdate(name, index, value, oldValue, Transport.DEFAULT);
    }
698824
function removeElData(el) {
  var id = el[elIdAttr];

  if (!id) {
    return;
  }

  // Remove all stored data
  delete elData[id];

  // Remove the elIdAttr property from the DOM node
  try {
    delete el[elIdAttr];
  } catch (e) {
    if (el.removeAttribute) {
      el.removeAttribute(elIdAttr);
    } else {
      // IE doesn't appear to support removeAttribute on the document element
      el[elIdAttr] = null;
    }
  }
}
236006
function(el, document) {
            var self    = this;

            self.callActions('beforeCacheDom', arguments);

            self.dom.document  = document;
            self.dom.body      = self.dom.document.querySelector('body');
            self.dom.container = el;
            self.dom.parent    = el;

            self.callActions('afterCacheDom', arguments);
        }
1253698
function prepareItem(def, idx) {
      // updateData is called in response to UI events; it tells
      // the dataProvider to update the data to match the UI.
      //
      // updateData must be inside prepareItem() since it uses idx;
      // d3's listener method cannot guarantee the index passed to
      // updateData will be correct:
      function updateData(data) {
        // data.selectedGen++;
        // model.provider.updateField(data.name, { active: data.selected });
        model.provider.toggleFieldSelection(data.name);
      }

      // get existing sub elements
      const ttab = d3.select(this);
      let trow1 = ttab.select(`tr.${style.jsLegendRow}`);
      let trow2 = ttab.select(`tr.${style.jsTr2}`);
      let tdsl = trow2.select(`td.${style.jsSparkline}`);
      let legendCell = trow1.select(`.${style.jsLegend}`);
      let fieldCell = trow1.select(`.${style.jsFieldName}`);
      let iconCell = trow1.select(`.${style.jsLegendIcons}`);
      let iconCellViz = iconCell.select(`.${style.jsLegendIconsViz}`);
      let svgGr = tdsl.select('svg').select(`.${style.jsGHist}`);
      // let svgOverlay = svgGr.select(`.${style.jsOverlay}`);

      // if they are not created yet then create them
      if (trow1.empty()) {
        trow1 = ttab
          .append('tr')
          .classed(style.legendRow, true)
          .on(
            'click',
            multiClicker([
              function singleClick(d, i) {
                // single click handler
                // const overCoords = d3.mouse(model.listContainer);
                updateData(d);
              },
              // double click handler
              toggleSingleModeEvt,
            ])
          );
        trow2 = ttab.append('tr').classed(style.jsTr2, true);
        tdsl = trow2
          .append('td')
          .classed(style.sparkline, true)
          .attr('colspan', '3');
        legendCell = trow1.append('td').classed(style.legend, true);

        fieldCell = trow1.append('td').classed(style.fieldName, true);
        iconCell = trow1.append('td').classed(style.legendIcons, true);
        iconCellViz = iconCell
          .append('span')
          .classed(style.legendIconsViz, true);
        scoreHelper.createScoreIcons(iconCellViz);
        iconCellViz
          .append('i')
          .classed(style.expandIcon, true)
          .on('click', toggleSingleModeEvt);

        // Create SVG, and main group created inside the margins for use by axes, title, etc.
        svgGr = tdsl
          .append('svg')
          .classed(style.sparklineSvg, true)
          .append('g')
          .classed(style.jsGHist, true)
          .attr(
            'transform',
            `translate( ${model.histMargin.left}, ${model.histMargin.top} )`
          );
        // nested groups inside main group
        svgGr.append('g').classed(style.axis, true);
        svgGr.append('g').classed(style.jsGRect, true);
        // scoring interface
        scoreHelper.createGroups(svgGr);
        svgGr
          .append('rect')
          .classed(style.overlay, true)
          .style('cursor', 'default');
      }
      const dataActive = def.active;
      // Apply legend
      if (model.provider.isA('LegendProvider')) {
        const { color, shape } = model.provider.getLegend(def.name);
        legendCell.html(`<svg class='${
          style.legendSvg
        }' width='${legendSize}' height='${legendSize}' viewBox='${
          shape.viewBox
        }'
                  fill='${color}' stroke='black'><use xlink:href='#${
          shape.id
        }'/></svg>`);
      } else {
        legendCell.html('<i></i>').select('i');
      }
      trow1
        .classed(
          !dataActive ? style.selectedLegendRow : style.unselectedLegendRow,
          false
        )
        .classed(
          dataActive ? style.selectedLegendRow : style.unselectedLegendRow,
          true
        );
      // selection outline
      ttab
        .classed(style.hiddenBox, false)
        .classed(!dataActive ? style.selectedBox : style.unselectedBox, false)
        .classed(dataActive ? style.selectedBox : style.unselectedBox, true);

      // Change interaction icons based on state.
      // scoreHelper has save icon and score icon.
      const numIcons =
        (model.singleModeSticky ? 0 : 1) + scoreHelper.numScoreIcons(def);
      iconCell.style('width', `${numIcons * iconSize + 2}px`);
      scoreHelper.updateScoreIcons(iconCellViz, def);
      iconCellViz
        .select(`.${style.jsExpandIcon}`)
        .attr(
          'class',
          model.singleModeName === null ? style.expandIcon : style.shrinkIcon
        )
        .style('display', model.singleModeSticky ? 'none' : null);
      // + 2 accounts for internal padding.
      const allIconsWidth =
        Math.ceil(iconCellViz.node().getBoundingClientRect().width) + 2;
      // reset to the actual width used.
      iconCell.style('width', `${allIconsWidth}px`);
      // Apply field name
      fieldCell
        .style(
          'width',
          `${model.boxWidth - (10 + legendSize + 6 + allIconsWidth)}px`
        )
        .text(def.name);

      // adjust some settings based on current size
      tdsl
        .select('svg')
        .attr('width', publicAPI.svgWidth())
        .attr('height', publicAPI.svgHeight());

      // get the histogram data and rebuild the histogram based on the results
      const hobj = def.hobj;
      if (hobj) {
        const cmax = 1.0 * d3.max(hobj.counts);
        const hsize = hobj.counts.length;
        const hdata = svgGr
          .select(`.${style.jsGRect}`)
          .selectAll(`.${style.jsHistRect}`)
          .data(hobj.counts);

        hdata.enter().append('rect');
        // changes apply to both enter and update data join:
        hdata
          .attr(
            'class',
            (d, i) => (i % 2 === 0 ? style.histRectEven : style.histRectOdd)
          )
          .attr('pname', def.name)
          .attr('y', (d) => model.histHeight * (1.0 - d / cmax))
          .attr('x', (d, i) => (model.histWidth / hsize) * i)
          .attr('height', (d) => model.histHeight * (d / cmax))
          .attr('width', Math.ceil(model.histWidth / hsize));

        hdata.exit().remove();

        const svgOverlay = svgGr.select(`.${style.jsOverlay}`);
        svgOverlay
          .attr('x', -model.histMargin.left)
          .attr('y', -model.histMargin.top)
          .attr('width', publicAPI.svgWidth())
          .attr('height', publicAPI.svgHeight()); // allow clicks inside x-axis.

        if (!scoreHelper.editingScore(def)) {
          if (model.provider.isA('HistogramBinHoverProvider')) {
            svgOverlay
              .on('mousemove.hs', (d, i) => {
                const mCoords = publicAPI.getMouseCoords(tdsl);
                const binNum = Math.floor(
                  (mCoords[0] / model.histWidth) * hsize
                );
                const state = {};
                state[def.name] = [binNum];
                model.provider.setHoverState({ state });
              })
              .on('mouseout.hs', (d, i) => {
                const state = {};
                state[def.name] = [-1];
                model.provider.setHoverState({ state });
              });
          }
          svgOverlay.on('click.hs', (d) => {
            const overCoords = publicAPI.getMouseCoords(tdsl);
            if (overCoords[1] <= model.histHeight) {
              updateData(d);
            }
          });
        } else {
          // disable when score editing is happening - it's distracting.
          // Note we still respond to hovers over other components.
          svgOverlay.on('.hs', null);
        }

        // Show an x-axis with just min/max displayed.
        // Attach scale, axis objects to this box's
        // data (the 'def' object) to allow persistence when scrolled.
        if (typeof def.xScale === 'undefined') {
          def.xScale = d3.scale.linear();
        }
        const [minRange, maxRange] = scoreHelper.getHistRange(def);
        def.xScale
          .rangeRound([0, model.histWidth])
          .domain([minRange, maxRange]);

        if (typeof def.xAxis === 'undefined') {
          const formatter = d3.format('.3s');
          def.xAxis = d3.svg
            .axis()
            .tickFormat(formatter)
            .orient('bottom');
        }
        def.xAxis.scale(def.xScale);
        let numTicks = 2;
        if (model.histWidth >= model.moreTicksSize) {
          numTicks = 5;
          // using .ticks() results in skipping min/max values,
          // if they aren't 'nice'. Make exactly 5 ticks.
          const myTicks = d3
            .range(numTicks)
            .map(
              (d) => minRange + (d / (numTicks - 1)) * (maxRange - minRange)
            );
          def.xAxis.tickValues(myTicks);
        } else {
          def.xAxis.tickValues(def.xScale.domain());
        }
        // nested group for the x-axis min/max display.
        const gAxis = svgGr.select(`.${style.jsAxis}`);
        gAxis
          .attr('transform', `translate(0, ${model.histHeight})`)
          .call(def.xAxis);
        const tickLabels = gAxis
          .selectAll('text')
          .classed(style.axisText, true);
        numTicks = tickLabels.size();
        tickLabels.style(
          'text-anchor',
          (d, i) => (i === 0 ? 'start' : i === numTicks - 1 ? 'end' : 'middle')
        );
        gAxis.selectAll('line').classed(style.axisLine, true);
        gAxis.selectAll('path').classed(style.axisPath, true);

        scoreHelper.prepareItem(def, idx, svgGr, tdsl);
      }
    }
318561
function(elem) {
      var t = this,
          strValue;

      // Catch recursive stringify
      try {strValue = JSON.stringify(elem.value);}
      catch (e) {strValue = "{object}";}

      // Set if the value changed
      if (strValue !== elem.strValue) {
        var priorStrValue = elem.strValue;
        elem.strValue = strValue;

        // Set the value of this element or the inner element
        elem.span.text(strValue);
        if (elem.innerView) {
          elem.innerView.model = elem.value;
          elem.innerView.setData();

          // Set the inner element open or closed
          var isClosed = false;
          if (priorStrValue) {
            isClosed = elem.innerView.isClosed;
          } else {
            isClosed = t.closedOnInit ? true : strValue.length < AUTO_CLOSE_CHARS;
          }
          t.toggleClosed(elem, isClosed);
        }
      }
    }
592283
function(el, attrName, val) {
                    var oldValue;
                    // In order to later trigger an event we need to compare the new value to the old value, so here we go ahead and retrieve the old value for browsers that don't have native MutationObservers.
                    if (!attr.MutationObserver) {
                        oldValue = attr.get(el, attrName);
                    }

                    var tagName = el.nodeName.toString()
                        .toLowerCase(),
                        prop = attr.map[attrName],
                        newValue;

                    // Using the property of `attr.map`, go through and check if the property is a function, and if so call it. Then check if the property is `true`, and if so set the value to `true`, also making sure to set `defaultChecked` to `true` for elements of `attr.defaultValue`. We always set the value to true because for these boolean properties, setting them to false would be the same as removing the attribute.
                    // For all other attributes use `setAttribute` to set the new value.
                    if (typeof prop === "function") {
                        newValue = prop(el, val);
                    } else if (prop === true) {
                        newValue = el[attrName] = true;

                        if (attrName === "checked" && el.type === "radio") {
                            if (can.inArray(tagName, attr.defaultValue) >= 0) {
                                el.defaultChecked = true;
                            }
                        }

                    } else if (prop) {
                        newValue = el[prop] = val;
                        if (prop === "value" && can.inArray(tagName, attr.defaultValue) >= 0) {
                            el.defaultValue = val;
                        }
                    } else {
                        el.setAttribute(attrName, val);
                        newValue = val;
                    }

                    // Now that the value has been set, for browsers without MutationObservers, check to see that value has changed and if so trigger the "attributes" event on the element.
                    if (!attr.MutationObserver && newValue !== oldValue) {
                        attr.trigger(el, attrName, oldValue);
                    }
                }
772222
function(rendered, manager, def) {
    // Actually put the rendered contents into the element.
    if (_.isString(rendered)) {
      // If no container is specified, we must replace the content.
      if (manager.noel) {
        rendered = $.parseHTML(rendered, true);

        // Remove extra root elements.
        this.$el.slice(1).remove();

        // Swap out the View on the first top level element to avoid
        // duplication.
        this.$el.replaceWith(rendered);

        // Don't delegate events here - we'll do that in resolve()
        this.setElement(rendered, false);
      } else {
        this.html(this.$el, rendered);
      }
    }

    // Resolve only after fetch and render have succeeded.
    def.resolveWith(this, [this]);
  }
94310
function doReveal(el) {
      var orig = el.getAttribute('src') || false;

      el.addEventListener('error', function handler(e) {
        // on error put back the original image if available (usually a placeholder)
        console.log('error loading image', e);
        if (orig) {
          el.setAttribute('src', orig);
        }
        el.removeEventListener('error', handler); // hate this.
      });

      var src = el.getAttribute('data-src');
      if (src) {
        el.setAttribute('src', src);
        addClass(el);
        return;
      }
      src = el.getAttribute('data-bkg');
      if (src) {
        el.style.backgroundImage = 'url("' + src + '")';
        addClass(el);
        return;
      }
    }
53089
function( runDefaults, el ) {
					var part = parts.shift();
					if (!part ) {
						callback(runDefaults, el);
						return;
					}
					el = el || element;
					if ( part.length > 1 ) {
						part = part.substr(1, part.length - 2)
					}
					self._key(part, el, runNextPart)
				}
642250
function( el, eventName, detail ) {
            var event = document.createEvent( "CustomEvent" );
            event.initCustomEvent( eventName, true, true, detail );
            el.dispatchEvent( event );
        }
390174
function ( type, data ) {
            var el = this.element();
    
            if ( typeof type === 'string' ) {
                $B.event.trigger( el, type, data );
            }
        }
738850
public void processElement(OutputStream outputStream, Object element) throws IOException {
        if (canProcess(element)) {
            process(outputStream, element);
        } else {
            if (next != null) {
                this.next.processElement(outputStream, element);
            }
        }
    }
22735
function (el) {
    var index = this.usedEls.indexOf(el);
    if (index === -1) {
      warn('The returned entity was not previously pooled from ' + this.attrName);
      return;
    }
    this.usedEls.splice(index, 1);
    this.availableEls.push(el);
    el.object3D.visible = false;
    el.pause();
    return el;
  }
523373
public void contentsChanged (ListDataEvent e)
    {
        // if this update is informing us of a new selection, reflect that
        // in the UI
        int start = e.getIndex0(), count = start - e.getIndex1() + 1;
        if (start == -1) {
            // figure out the selected index
            int selidx = -1;
            Object eitem = _model.getSelectedItem();
            if (eitem != null) {
                int ecount = _model.getSize();
                for (int i = 0; i < ecount; i++) {
                    if (eitem == _model.getElementAt(i)) {
                        selidx = i;
                        break;
                    }
                }
            }

            // and update it
            updateSelection(selidx);

        } else {
            // replace the buttons in this range
            removeButtons(start, count);
            addButtons(start, count);
        }
   }
937276
public void handleChangeTemplateContext(final CmsContainerPageElementPanel element, final String newValue) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(newValue) || CmsTemplateContextInfo.EMPTY_VALUE.equals(newValue)) {
            if (CmsInheritanceContainerEditor.getInstance() != null) {
                CmsInheritanceContainerEditor.getInstance().removeElement(element);
            } else {
                removeElement(element, ElementRemoveMode.silent);
            }
        }
    }
235474
function( elem, options, callback ) {
		var old = {};

		// Remember the old values, and insert the new ones
		for ( var name in options ) {
			old[ name ] = elem.style[ name ];
			elem.style[ name ] = options[ name ];
		}

		callback.call( elem );

		// Revert the old values
		for ( var name in options ) {
			elem.style[ name ] = old[ name ];
		}
	}