How to use the @ephox/katamari.Arr.each function in @ephox/katamari

To help you get started, we’ve selected a few @ephox/katamari examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / core / complex / StyleFormat.ts View on Github external
const registerFormats = (customFormats: {name: string, format: StyleFormat}[]) => {
    Arr.each(customFormats, (fmt) => {
      // Only register the custom format with the editor, if it's not already registered
      if (!editor.formatter.has(fmt.name)) {
        editor.formatter.register(fmt.name, fmt.format);
      }
    });
  };
github tinymce / tinymce / modules / tinymce / src / core / main / ts / annotate / Wrapping.ts View on Github external
const processElements = (elems) => {
    Arr.each(elems, processElement);
  };
github tinymce / tinymce / modules / tinymce / src / themes / mobile / main / ts / android / core / AndroidEvents.ts View on Github external
const destroy = function () {
    Arr.each(listeners, function (l) {
      l.unbind();
    });
  };
github tinymce / tinymce / modules / tinymce / src / plugins / visualchars / main / ts / core / VisualChars.ts View on Github external
const show = (editor: Editor, rootElm: Node) => {
  const nodeList = Nodes.filterDescendants(SugarElement.fromDom(rootElm), Nodes.isMatch);

  Arr.each(nodeList, (n) => {
    const parent = n.dom().parentNode;
    if (isWrappedNbsp(parent)) {
      Class.add(SugarElement.fromDom(parent), Data.nbspClass);
    } else {
      const withSpans = Nodes.replaceWithSpans(editor.dom.encode(SugarNode.value(n)));

      const div = editor.dom.create('div', null, withSpans);
      let node: any;
      while ((node = div.lastChild)) {
        editor.dom.insertAfter(node, n.dom());
      }

      editor.dom.remove(n.dom());
    }
  });
};
github tinymce / tinymce / modules / tinymce / src / core / main / ts / html / FilterNode.ts View on Github external
Arr.each(matches, (match: FilterMatch) => {
    Arr.each(match.filter.callbacks, (callback: ParserFilterCallback) => {
      callback(match.nodes, match.filter.name, {});
    });
  });
};
github tinymce / tinymce / modules / tinymce / src / plugins / lists / main / ts / core / DlIndentation.ts View on Github external
const dlIndentation = (editor: Editor, indentation: Indentation, dlItems: Element[]) => {
  if (indentation === Indentation.Indent) {
    Arr.each(dlItems, indentDlItem);
  } else {
    Arr.each(dlItems, (item) => outdentDlItem(editor, item));
  }
};
github tinymce / tinymce / modules / tinymce / src / core / main / ts / html / FilterNode.ts View on Github external
const filter = (nodeFilters: ParserFilter[], attributeFilters: ParserFilter[], node: Node): void => {
  const matches = findMatchingNodes(nodeFilters, attributeFilters, node);

  Arr.each(matches, (match: FilterMatch) => {
    Arr.each(match.filter.callbacks, (callback: ParserFilterCallback) => {
      callback(match.nodes, match.filter.name, {});
    });
  });
};
github tinymce / tinymce / modules / alloy / src / main / ts / ephox / alloy / behaviour / docking / DockingApis.ts View on Github external
const morphToStatic = (component: AlloyComponent, config: DockingConfig): void => {
  Arr.each([ 'left', 'top', 'position' ], (prop) => Css.remove(component.element(), prop));
  config.onUndocked(component);
};
github tinymce / tinymce / modules / tinymce / src / plugins / table / main / ts / ui / Helpers.ts View on Github external
Arr.each(comparisonData, (items) => {
    Arr.each(keys, (key) => {
      Obj.each(items, (itemValue, itemKey) => {
        const comparisonValue = baseData[key];
        if (comparisonValue !== '' && key === itemKey) {
          if (comparisonValue !== itemValue) {
            baseData[key] = '';
          }
        }
      });
    });
  });