Editor.setSymbols

This function sets the array of symbols currently in use in Xopus.

In Xopus 4 a new way of supplying new symbols to the symbol inserted is available. Arrays can now be passed as rows of characters. Unicode character can also be passed to the function without any escaping.

Editor.setSymbols([
  ['a', 'b', 'c'],
  ['d', 'e', 'f', '©']
]);

Xopus 3

Xopus 3 uses a less handsome API for setSymbols(). It needs to be supplied a one-dimensional array with decimal entity reference codes. Use the website fileformat.info (for example) to lookup the decimal entity reference code for the trade mark sign (™). You need to supply the number only. The following example shows how to add the trade mark sign to the symbols inserter.

// Get the current array of special characters:
var symbols = Editor.getSymbols();

// Add the trademark sign:
symbols.push("8482");

// And use our altered array of characters:
Editor.setSymbols(symbols);

Alternatively you could build a new array of the symbols that you want to use and pass this back to Xopus, and overwrite the existing symbols.


Editor.setSymbols( rows : Array) : Array

Arguments

rows
Array. Two-dimensional array of characters

Return Value

Array
The new symbols array.

History

version event
Xopus 4.0.3 Change. Editor.setSymbols(null) resets the Special characters menu to defaults. Added a return value.
Xopus 4 Change. Added support for a two-dimensional array as argument. Characters no longer need to be escaped as decimal entity references.
Xopus 3 Introduction.