From 12896bd23eeba79884245c1c29fdc568cf21a7fa Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 14 Mar 2016 08:50:46 -0400 Subject: Converting to Webpack. Stage 1. --- webapp/non_npm_dependencies/katex/src/Settings.js | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 webapp/non_npm_dependencies/katex/src/Settings.js (limited to 'webapp/non_npm_dependencies/katex/src/Settings.js') diff --git a/webapp/non_npm_dependencies/katex/src/Settings.js b/webapp/non_npm_dependencies/katex/src/Settings.js new file mode 100644 index 000000000..644014504 --- /dev/null +++ b/webapp/non_npm_dependencies/katex/src/Settings.js @@ -0,0 +1,28 @@ +/** + * This is a module for storing settings passed into KaTeX. It correctly handles + * default settings. + */ + +/** + * Helper function for getting a default value if the value is undefined + */ +function get(option, defaultValue) { + return option === undefined ? defaultValue : option; +} + +/** + * The main Settings object + * + * The current options stored are: + * - displayMode: Whether the expression should be typeset by default in + * textstyle or displaystyle (default false) + */ +function Settings(options) { + // allow null options + options = options || {}; + this.displayMode = get(options.displayMode, false); + this.throwOnError = get(options.throwOnError, true); + this.errorColor = get(options.errorColor, "#cc0000"); +} + +module.exports = Settings; -- cgit v1.2.3-1-g7c22