Added Contrbuting Guide and Refactored some documentation
diff --git a/docs/Api_Methods.md b/docs/Api_Methods.md new file mode 100644 index 0000000..a1452cc --- /dev/null +++ b/docs/Api_Methods.md
@@ -0,0 +1,86 @@ +# Api Methods + +To use the MathQuill API, first get the latest version of the interface: + +```js +var MQ = MathQuill.getInterface(2); +``` + +## Constructors + +### `MQ.StaticMath(DOM_OBJECT)` + +Creates a non-editable MathQuill with the contents of the HTML element and returns a [static MathField object](). + +If the element is already a static MathField, this will return a new static Mathfield object with the same ID. If the element is a different type of MathQuill element, this will return null. + +### `MQ.MathField(DOM_OBJECT, CONFIG)` + +Creates an editable MathQuill with the contents of the HTML element and returns an [editable MathField object](). + +If the element is already an editable MathField, this will return a new editable Mathfield object with the same ID. If the element is a different type of MathQuill element, this will return null. + +### `MQ(DOM_OBJECT)` + +`MQ` itself is a function that takes an HTML element and, if it's the root +HTML element of a static math or math field, returns an API object for it +(if not, `null`): + +```js +MQ(mathFieldSpan) instanceof MQ.MathField // => true +MQ(otherSpan) // => null +``` + +## Comparing MathFields + +### Checking Type +```js +var staticMath = MQ.StaticMath(staticMathSpan); +mathField instanceof MQ.StaticMath // => true +mathField instanceof MQ // => true +mathField instanceof MathQuill // => true + +var mathField = MQ.MathField(mathFieldSpan); +mathField instanceof MQ.MathField // => true +mathField instanceof MQ.EditableField // => true +mathField instanceof MQ // => true +mathField instanceof MathQuill // => true +``` + +### ID +API objects for the same MathQuill instance have the same `.id`, which will +always be a unique truthy primitive value that can be used as an object key +(like an ad hoc [`Map`][] or [`Set`][]): + +```js +MQ(mathFieldSpan).id === mathField.id // => true + +var setOfMathFields = {}; +setOfMathFields[mathField.id] = mathField; +MQ(mathFieldSpan).id in setOfMathFields // => true +staticMath.id in setOfMathFields // => false +``` + +[`Map`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map +[`Set`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set + +### Data Object +Similarly, API objects for the same MathQuill instance share a `.data` object +(which can be used like an ad hoc [`WeakMap`][] or [`WeakSet`][]): + +```js +MQ(mathFieldSpan).data === mathField.data // => true +mathField.data.foo = 'bar'; +MQ(mathFieldSpan).data.foo // => 'bar' +``` + +[`WeakMap`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap +[`WeakSet`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet + +## MathField Methods + +These are methods that every MathField has. + +## Editable MathField Methods + +Editable MathFields have all of the [above]() methods in addition to the ones listed here.
diff --git a/docs/Config.md b/docs/Config.md new file mode 100644 index 0000000..e32b603 --- /dev/null +++ b/docs/Config.md
@@ -0,0 +1,183 @@ +# MathField Config + +## Setting Configuration + +The configuration options for a given mathField has the following structure and [properties](): +```js +{ + spaceBehavesLikeTab: true, + leftRightIntoCmdGoes: 'up', + restrictMismatchedBrackets: true, + sumStartsWithNEquals: true, + supSubsRequireOperand: true, + charsThatBreakOutOfSupSub: '+-=<>', + autoSubscriptNumerals: true, + autoCommands: 'pi theta sqrt sum', + autoOperatorNames: 'sin cos etc', + substituteTextarea: function() { + return document.createElement('textarea'); + }, + handlers: { + edit: function(mathField) { ... }, + upOutOf: function(mathField) { ... }, + moveOutOf: function(dir, mathField) { if (dir === MQ.L) ... else ... } + } +}); +``` + +On initialization, pass the configuration object, structured like the one above as the second argument to `MQ.MathField(HTML_ELEMENT, CONFIG)`. + +To change the options later on, use `mathField.config(NEW_CONFIG)`. + +Global defaults for a page may be set with `MQ.config(NEW_CONFIG)`. + +## Configuration Options + +### spacesBehavesLikeTab + +If `spaceBehavesLikeTab` is true the keystrokes {Shift-,}Spacebar will behave +like {Shift-,}Tab escaping from the current block (as opposed to the default +behavior of inserting a Space character). + +### leftRightIntoCmdGoes + +By default, the Left and Right keys move the cursor through all possible cursor +positions in a particular order: right into a fraction puts the cursor at the +left end of the numerator, right out of the numerator puts the cursor at the +left end of the denominator, right out of the denominator puts the cursor to the +right of the fraction; symmetrically, left into a fraction puts the cursor at +the right end of the denominator, etc. Note that right out of the numerator to +the left end of the denominator is actually leftwards (and downwards, it's +basically wrapped). If instead you want right to always go right, and left to +always go left, you can set `leftRightIntoCmdGoes` to `'up'` or `'down'` so that +left and right go up or down (respectively) into commands, e.g. `'up'` means +that left into a fraction goes up into the numerator, skipping the denominator; +symmetrically, right out of the numerator skips the denominator and puts the +cursor to the right of the fraction, which unlike the default behavior is +actually rightwards (the drawback is the denominator is always skipped, you +can't get to it with just Left and Right, you have to press Down); which is +the same behavior as the Desmos calculator. `'down'` instead means it is the +numerator that is always skipped, which is the same behavior as the Mac OS X +built-in app Grapher. + +### restrictMismatchedBrackets + +If `restrictMismatchedBrackets` is true then you can type [a,b) and [a,b), but +if you try typing `[x}` or `\langle x|`, you'll get `[{x}]` or +`\langle|x|\rangle` instead. This lets you type `(|x|+1)` normally; otherwise, +you'd get `\left( \right| x \left| + 1 \right)`. + +### sumStartsWithNEquals + +If `sumStartsWithNEquals` is true then when you type `\sum`, `\prod`, or +`\coprod`, the lower limit starts out with `n=`, e.g. you get the LaTeX +`\sum_{n=}^{ }`, rather than empty by default. + +### supSubsRequireOperand + +`supSubsRequireOperand` disables typing of superscripts and subscripts when +there's nothing to the left of the cursor to be exponentiated or subscripted. +Averts the especially confusing typo `x^^2`, which looks much like `x^2`. + +### charsThatBreakOutOfSupSub + +`charsThatBreakOutOfSupSub` sets the chars that when typed, "break out" of +superscripts and subscripts: for example, typing `x^2n+y` normally results in +the LaTeX `x^{2n+y}`, you have to hit Down or Tab (or Space if +`spaceBehavesLikeTab` is true) to move the cursor out of the exponent and get +the LaTeX `x^{2n}+y`; this option makes `+` "break out" of the exponent and +type what you expect. Problem is, now you can't just type `x^n+m` to get the +LaTeX `x^{n+m}`, you have to type `x^(n+m` and delete the paren or something. +(Doesn't apply to the first character in a superscript or subscript, so typing +`x^-6` still results in `x^{-6}`.) + +### autoCommands + +`autoCommands`, a space-delimited list of LaTeX control words (no backslash, +letters only, min length 2), defines the (default empty) set of "auto-commands", +commands automatically rendered by just typing the letters without typing a +backslash first. + +### autoOperatorNames + +`autoOperatorNames`, a list of the same form (space-delimited letters-only each +length>=2), and overrides the set of operator names that automatically become +non-italicized when typing the letters without typing a backslash first, like +`sin`, `log`, etc. (Defaults to [the LaTeX built-in operator names][Wikia], but +with additional trig operators like `sech`, `arcsec`, `arsinh`, etc.) + +[Wikia]: http://latex.wikia.com/wiki/List_of_LaTeX_symbols#Named_operators:_sin.2C_cos.2C_etc. + +### substituteTextarea + +`substituteTextarea`, a function that creates a focusable DOM element, called +when setting up a math field. It defaults to `<textarea autocorrect=off .../>`, +but for example, Desmos substitutes `<span tabindex=0></span>` on iOS to +suppress the built-in virtual keyboard in favor of a custom math keypad that +calls the MathQuill API. Unfortunately there's no universal [check for a virtual +keyboard][StackOverflow], you can't even [detect a touchscreen][stucox] (notably +[Modernizr gave up][Modernizr]) and even if you could, Windows 8 and ChromeOS +devices have both physical keyboards and touchscreens and you can connect +physical keyboards to iOS and Android devices with Bluetooth, so touchscreen != +virtual keyboard. Desmos currently sniffs the user agent for iOS, so Bluetooth +keyboards just don't work in Desmos on iOS, the tradeoffs are up to you. + +[StackOverflow]: http://stackoverflow.com/q/2593139/362030 +[stucox]: http://www.stucox.com/blog/you-cant-detect-a-touchscreen/ +[Modernizr]: https://github.com/Modernizr/Modernizr/issues/548 + +### Handlers + +Supported handlers: +- `moveOutOf`, `deleteOutOf`, and `selectOutOf` are called with `dir` and the + math field API object as arguments +- `upOutOf`, `downOutOf`, `enter`, and `edit` are called with just the API + object as the argument + +The `*OutOf` handlers are called when Left/Right/Up/Down/Backspace/Del/ +Shift-Left/Shift-Right is pressed but the cursor is at the left/right/top/bottom +edge and so nothing happens within the math field. For example, when the cursor +is at the left edge, pressing the Left key causes the `moveOutOf` handler (if +provided) to be called with `MQ.L` and the math field API object as arguments, +and Backspace causes `deleteOutOf` (if provided) to be called with `MQ.L` and +the API object as arguments, etc. + +The `enter` handler is called whenever Enter is pressed. + +The `edit` handler is called when the contents of the field might have been +changed by stuff being typed, or deleted, or written with the API, etc. +(Deprecated aliases: `edited`, `reflow`.) + +Handlers are always called directly on the `handlers` object passed in, +preserving the `this` value, so you can do stuff like: +```js +var MathList = P(function(_) { + _.init = function() { + this.maths = []; + this.el = ... + }; + _.add = function() { + var math = MQ.MathField($('<span/>')[0], { handlers: this }); + $(math.el()).appendTo(this.el); + math.data.i = this.maths.length; + this.maths.push(math); + }; + _.moveOutOf = function(dir, math) { + var adjacentI = (dir === MQ.L ? math.data.i - 1 : math.data.i + 1); + var adjacentMath = this.maths[adjacentI]; + if (adjacentMath) adjacentMath.focus().moveToDirEnd(-dir); + }; + ... +}); +``` +Of course you can always ignore the last argument, like when the handlers close +over the math field: +```js +var latex = ''; +var mathField = MQ.MathField($('#mathfield')[0], { + handlers: { + edit: function() { latex = mathField.latex(); }, + enter: function() { submitLatex(latex); } + } +}); +```
diff --git a/docs/Contributing.md b/docs/Contributing.md new file mode 100644 index 0000000..a8f9408 --- /dev/null +++ b/docs/Contributing.md
@@ -0,0 +1,3 @@ +# Contributing + +## Build from Source \ No newline at end of file
diff --git a/docs/Getting_Started.md b/docs/Getting_Started.md new file mode 100644 index 0000000..3365bdc --- /dev/null +++ b/docs/Getting_Started.md
@@ -0,0 +1,61 @@ +# Getting Started + +## Download and Load + +Download [the latest release](https://github.com/mathquill/mathquill/releases/latest). +MathQuill depends on [jQuery 1.4.3+](http://jquery.com) and we recommend that you use the [Google CDN-hosted copy](http://code.google.com/apis/libraries/devguide.html#jquery). + +Then you can load MathQuill with something like (order matters): +```html +<link rel="stylesheet" href="/path/to/mathquill.css"/> +<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> +<script src="/path/to/mathquill.js"></script> +``` + +To use the MathQuill API, load it with: +```javascript +var MQ = MathQuill.getInterface(2); +``` + +All [API methods]() will be called on `MQ`. + +You can also [build from the source code](). + +## Basic Usage + +MathQuill instances can be created on DOM objects. For the full list of constructors and API methods, see [API Methods](). + +The below examples assume that MathQuill has been properly loaded and exposed as `MQ` as shown [above](). + +### Render Static Math + +Call `MQ.StaticMath` on the DOM object. +```html +<p>Solve <span id="problem">ax^2 + bx + c = 0</span></p> + +<script> + var problemSpan = document.getElementById('#problem'); + MQ.StaticMath(problemSpan); +</script> +``` + +### Editable Math + +To create an editable math field, call `MQ.MathField` with the dom object and the [config](). The following example shows a mathfield created on the answer span with a handler to check the answer every time an edit may occur. +```html +<p><span id="answer">x=</span></p> + +<script> + var answerDomObject = document.getElementById('#answer'); + var answerMathField = MQ.MathField(answerDomObject, { + handlers: { + edit: function() { + var enteredMath = answerMathField.latex() // Retreive entered math in LaTeX format + checkAnswer(enteredMath); + } + } + }); +</script> +``` + +The recommended way to retrieve and store the contents of the math field is to call `mathField.latex()`.
diff --git a/docs/index.md b/docs/index.md index caa3fef..19adf2c 100644 --- a/docs/index.md +++ b/docs/index.md
@@ -1,105 +1,8 @@ # [MathQuill](http://mathquill.github.com) -## Usage +MathQuill is a web formula editor designed to make typing math easy and beautiful. To view a demo, check out our [website](http://mathquill.com/). -Just load MathQuill and call our constructors on some HTML element DOM objects, -for example: - -```html -<link rel="stylesheet" href="/path/to/mathquill.css"/> -<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> -<script src="/path/to/mathquill.js"></script> - -<p> - Solve <span id="problem">ax^2 + bx + c = 0</span>: - <span id="answer">x=</span> -</p> - -<script> - var MQ = MathQuill.getInterface(2); - MQ.StaticMath($('#problem')[0]); - var answer = MQ.MathField($('#answer')[0], { - handlers: { - edit: function() { - checkAnswer(answer.latex()); - } - } - }); -</script> -``` - -To load MathQuill, -- [jQuery 1.4.3+](http://jquery.com) has to be loaded before `mathquill.js` - ([Google CDN-hosted copy][] recommended) -- the fonts should be served from the `font/` directory relative to - `mathquill.css` (unless you'd rather change where your copy of `mathquill.css` - includes them from), which is already the case if you just: -- download and serve [the latest release][]. - -[Google CDN-hosted copy]: http://code.google.com/apis/libraries/devguide.html#jquery -[the latest release]: https://github.com/mathquill/mathquill/releases/latest - -To use the MathQuill API, first get the latest version of the interface: - -```js -var MQ = MathQuill.getInterface(2); -``` - -Now you can call `MQ.StaticMath()` or `MQ.MathField()`, which MathQuill-ify -an HTML element and return an API object. If the element had already been -MathQuill-ified into the same kind, return that kind of API object (if -different kind or not an HTML element, `null`). Note that it always returns -either an instance of itself, or `null`. - -```js -var staticMath = MQ.StaticMath(staticMathSpan); -mathField instanceof MQ.StaticMath // => true -mathField instanceof MQ // => true -mathField instanceof MathQuill // => true - -var mathField = MQ.MathField(mathFieldSpan); -mathField instanceof MQ.MathField // => true -mathField instanceof MQ.EditableField // => true -mathField instanceof MQ // => true -mathField instanceof MathQuill // => true -``` - -`MQ` itself is a function that takes an HTML element and, if it's the root -HTML element of a static math or math field, returns an API object for it -(if not, `null`): - -```js -MQ(mathFieldSpan) instanceof MQ.MathField // => true -MQ(otherSpan) // => null -``` - -API objects for the same MathQuill instance have the same `.id`, which will -always be a unique truthy primitive value that can be used as an object key -(like an ad hoc [`Map`][] or [`Set`][]): - -```js -MQ(mathFieldSpan).id === mathField.id // => true - -var setOfMathFields = {}; -setOfMathFields[mathField.id] = mathField; -MQ(mathFieldSpan).id in setOfMathFields // => true -staticMath.id in setOfMathFields // => false -``` - -[`Map`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map -[`Set`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set - -Similarly, API objects for the same MathQuill instance share a `.data` object -(which can be used like an ad hoc [`WeakMap`][] or [`WeakSet`][]): - -```js -MQ(mathFieldSpan).data === mathField.data // => true -mathField.data.foo = 'bar'; -MQ(mathFieldSpan).data.foo // => 'bar' -``` - -[`WeakMap`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap -[`WeakSet`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet +## Everything Below this still needs to be refactored Any element that has been MathQuill-ified can be reverted: @@ -185,164 +88,7 @@ #### Configuration Options -`MQ.MathField()` can also take an options object: -```js -var el = $('<span>x^2</span>').appendTo('body'); -var mathField = MQ.MathField(el[0], { - spaceBehavesLikeTab: true, - leftRightIntoCmdGoes: 'up', - restrictMismatchedBrackets: true, - sumStartsWithNEquals: true, - supSubsRequireOperand: true, - charsThatBreakOutOfSupSub: '+-=<>', - autoSubscriptNumerals: true, - autoCommands: 'pi theta sqrt sum', - autoOperatorNames: 'sin cos etc', - substituteTextarea: function() { - return document.createElement('textarea'); - }, - handlers: { - edit: function(mathField) { ... }, - upOutOf: function(mathField) { ... }, - moveOutOf: function(dir, mathField) { if (dir === MQ.L) ... else ... } - } -}); -``` - -To change `mathField`'s options, the `.config({ ... })` method takes an options -object in the same format. - -Global defaults for a page may be set with `MQ.config({ ... })`. - -If `spaceBehavesLikeTab` is true the keystrokes {Shift-,}Spacebar will behave -like {Shift-,}Tab escaping from the current block (as opposed to the default -behavior of inserting a Space character). - -By default, the Left and Right keys move the cursor through all possible cursor -positions in a particular order: right into a fraction puts the cursor at the -left end of the numerator, right out of the numerator puts the cursor at the -left end of the denominator, right out of the denominator puts the cursor to the -right of the fraction; symmetrically, left into a fraction puts the cursor at -the right end of the denominator, etc. Note that right out of the numerator to -the left end of the denominator is actually leftwards (and downwards, it's -basically wrapped). If instead you want right to always go right, and left to -always go left, you can set `leftRightIntoCmdGoes` to `'up'` or `'down'` so that -left and right go up or down (respectively) into commands, e.g. `'up'` means -that left into a fraction goes up into the numerator, skipping the denominator; -symmetrically, right out of the numerator skips the denominator and puts the -cursor to the right of the fraction, which unlike the default behavior is -actually rightwards (the drawback is the denominator is always skipped, you -can't get to it with just Left and Right, you have to press Down); which is -the same behavior as the Desmos calculator. `'down'` instead means it is the -numerator that is always skipped, which is the same behavior as the Mac OS X -built-in app Grapher. - -If `restrictMismatchedBrackets` is true then you can type [a,b) and [a,b), but -if you try typing `[x}` or `\langle x|`, you'll get `[{x}]` or -`\langle|x|\rangle` instead. This lets you type `(|x|+1)` normally; otherwise, -you'd get `\left( \right| x \left| + 1 \right)`. - -If `sumStartsWithNEquals` is true then when you type `\sum`, `\prod`, or -`\coprod`, the lower limit starts out with `n=`, e.g. you get the LaTeX -`\sum_{n=}^{ }`, rather than empty by default. - -`supSubsRequireOperand` disables typing of superscripts and subscripts when -there's nothing to the left of the cursor to be exponentiated or subscripted. -Averts the especially confusing typo `x^^2`, which looks much like `x^2`. - -`charsThatBreakOutOfSupSub` sets the chars that when typed, "break out" of -superscripts and subscripts: for example, typing `x^2n+y` normally results in -the LaTeX `x^{2n+y}`, you have to hit Down or Tab (or Space if -`spaceBehavesLikeTab` is true) to move the cursor out of the exponent and get -the LaTeX `x^{2n}+y`; this option makes `+` "break out" of the exponent and -type what you expect. Problem is, now you can't just type `x^n+m` to get the -LaTeX `x^{n+m}`, you have to type `x^(n+m` and delete the paren or something. -(Doesn't apply to the first character in a superscript or subscript, so typing -`x^-6` still results in `x^{-6}`.) - -`autoCommands`, a space-delimited list of LaTeX control words (no backslash, -letters only, min length 2), defines the (default empty) set of "auto-commands", -commands automatically rendered by just typing the letters without typing a -backslash first. - -`autoOperatorNames`, a list of the same form (space-delimited letters-only each -length>=2), and overrides the set of operator names that automatically become -non-italicized when typing the letters without typing a backslash first, like -`sin`, `log`, etc. (Defaults to [the LaTeX built-in operator names][Wikia], but -with additional trig operators like `sech`, `arcsec`, `arsinh`, etc.) - -[Wikia]: http://latex.wikia.com/wiki/List_of_LaTeX_symbols#Named_operators:_sin.2C_cos.2C_etc. - -`substituteTextarea`, a function that creates a focusable DOM element, called -when setting up a math field. It defaults to `<textarea autocorrect=off .../>`, -but for example, Desmos substitutes `<span tabindex=0></span>` on iOS to -suppress the built-in virtual keyboard in favor of a custom math keypad that -calls the MathQuill API. Unfortunately there's no universal [check for a virtual -keyboard][StackOverflow], you can't even [detect a touchscreen][stucox] (notably -[Modernizr gave up][Modernizr]) and even if you could, Windows 8 and ChromeOS -devices have both physical keyboards and touchscreens and you can connect -physical keyboards to iOS and Android devices with Bluetooth, so touchscreen != -virtual keyboard. Desmos currently sniffs the user agent for iOS, so Bluetooth -keyboards just don't work in Desmos on iOS, the tradeoffs are up to you. - -[StackOverflow]: http://stackoverflow.com/q/2593139/362030 -[stucox]: http://www.stucox.com/blog/you-cant-detect-a-touchscreen/ -[Modernizr]: https://github.com/Modernizr/Modernizr/issues/548 - -Supported handlers: -- `moveOutOf`, `deleteOutOf`, and `selectOutOf` are called with `dir` and the - math field API object as arguments -- `upOutOf`, `downOutOf`, `enter`, and `edit` are called with just the API - object as the argument - -The `*OutOf` handlers are called when Left/Right/Up/Down/Backspace/Del/ -Shift-Left/Shift-Right is pressed but the cursor is at the left/right/top/bottom -edge and so nothing happens within the math field. For example, when the cursor -is at the left edge, pressing the Left key causes the `moveOutOf` handler (if -provided) to be called with `MQ.L` and the math field API object as arguments, -and Backspace causes `deleteOutOf` (if provided) to be called with `MQ.L` and -the API object as arguments, etc. - -The `enter` handler is called whenever Enter is pressed. - -The `edit` handler is called when the contents of the field might have been -changed by stuff being typed, or deleted, or written with the API, etc. -(Deprecated aliases: `edited`, `reflow`.) - -Handlers are always called directly on the `handlers` object passed in, -preserving the `this` value, so you can do stuff like: -```js -var MathList = P(function(_) { - _.init = function() { - this.maths = []; - this.el = ... - }; - _.add = function() { - var math = MQ.MathField($('<span/>')[0], { handlers: this }); - $(math.el()).appendTo(this.el); - math.data.i = this.maths.length; - this.maths.push(math); - }; - _.moveOutOf = function(dir, math) { - var adjacentI = (dir === MQ.L ? math.data.i - 1 : math.data.i + 1); - var adjacentMath = this.maths[adjacentI]; - if (adjacentMath) adjacentMath.focus().moveToDirEnd(-dir); - }; - ... -}); -``` -Of course you can always ignore the last argument, like when the handlers close -over the math field: -```js -var latex = ''; -var mathField = MQ.MathField($('#mathfield')[0], { - handlers: { - edit: function() { latex = mathField.latex(); }, - enter: function() { submitLatex(latex); } - } -}); -``` **A Note On Changing Colors:**