Skip to content

Commit

Permalink
Merge pull request mathquill#947 from desmosinc/merge-with-upstream
Browse files Browse the repository at this point in the history
Merge in the desmos fork
  • Loading branch information
jwmerrill committed Sep 27, 2023
2 parents ee7073d + 8926a88 commit 47710a7
Show file tree
Hide file tree
Showing 60 changed files with 6,032 additions and 912 deletions.
4 changes: 4 additions & 0 deletions BUILDING
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ re-make, and also serve the demo, the unit tests, and the visual tests.
unit tests -> http://localhost:9292/test/unit.html
visual tests -> http://localhost:9292/test/visual.html

If building on Windows:
1. Install GNU Make from http://gnuwin32.sourceforge.net/packages/make.htm. Do not use make derivitives from mSYS or MinGW. Ensure the location of make.exe is added to your PATH environment variable.
2. Grab the latest Git for Windows from https://git-scm.com/download/win. When installing, add Git and its optional shell tools to your PATH environment variable (these questions are asked during setup).

If any of this does not work, please let us know! We want to make
hacking on mathquill as easy as possible.
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,22 @@ BASE_SOURCES = \
$(SRC_DIR)/cursor.js \
$(SRC_DIR)/controller.js \
$(SRC_DIR)/publicapi.js \
$(SRC_DIR)/services/*.util.js \
$(SRC_DIR)/services/*.js
$(SRC_DIR)/services/parser.util.js \
$(SRC_DIR)/services/saneKeyboardEvents.util.js \
$(SRC_DIR)/services/aria.js \
$(SRC_DIR)/services/exportText.js \
$(SRC_DIR)/services/focusBlur.js \
$(SRC_DIR)/services/keystroke.js \
$(SRC_DIR)/services/latex.js \
$(SRC_DIR)/services/mouse.js \
$(SRC_DIR)/services/scrollHoriz.js \
$(SRC_DIR)/services/textarea.js

SOURCES_FULL = \
$(BASE_SOURCES) \
$(SRC_DIR)/commands/math.js \
$(SRC_DIR)/commands/text.js \
$(SRC_DIR)/commands/math/*.js
# FIXME text.js currently depends on math.js (#435), restore these when fixed:
# $(SRC_DIR)/commands/*.js \
# $(SRC_DIR)/commands/*/*.js

SOURCES_BASIC = \
$(BASE_SOURCES) \
Expand Down Expand Up @@ -98,6 +103,7 @@ BUILD_DIR_EXISTS = $(BUILD_DIR)/.exists--used_by_Makefile
.PHONY: all basic dev js uglify css font clean
all: font css uglify
basic: $(UGLY_BASIC_JS) $(BASIC_CSS)
unminified_basic: $(BASIC_JS) $(BASIC_CSS)
# dev is like all, but without minification
dev: font css js
js: $(BUILD_JS)
Expand All @@ -111,24 +117,28 @@ $(PJS_SRC): $(NODE_MODULES_INSTALLED)

$(BUILD_JS): $(INTRO) $(SOURCES_FULL) $(OUTRO) $(BUILD_DIR_EXISTS)
cat $^ | ./script/escape-non-ascii > $@
perl -pi -e s/mq-/$(MQ_CLASS_PREFIX)mq-/g $@
perl -pi -e s/{VERSION}/v$(VERSION)/ $@

$(UGLY_JS): $(BUILD_JS) $(NODE_MODULES_INSTALLED)
$(UGLIFY) $(UGLIFY_OPTS) < $< > $@

$(BASIC_JS): $(INTRO) $(SOURCES_BASIC) $(OUTRO) $(BUILD_DIR_EXISTS)
cat $^ | ./script/escape-non-ascii > $@
perl -pi -e s/mq-/$(MQ_CLASS_PREFIX)mq-/g $@
perl -pi -e s/{VERSION}/v$(VERSION)/ $@

$(UGLY_BASIC_JS): $(BASIC_JS) $(NODE_MODULES_INSTALLED)
$(UGLIFY) $(UGLIFY_OPTS) < $< > $@

$(BUILD_CSS): $(CSS_SOURCES) $(NODE_MODULES_INSTALLED) $(BUILD_DIR_EXISTS)
$(LESSC) $(LESS_OPTS) $(CSS_MAIN) > $@
perl -pi -e s/mq-/$(MQ_CLASS_PREFIX)mq-/g $@
perl -pi -e s/{VERSION}/v$(VERSION)/ $@

$(BASIC_CSS): $(CSS_SOURCES) $(NODE_MODULES_INSTALLED) $(BUILD_DIR_EXISTS)
$(LESSC) --modify-var="basic=true" $(LESS_OPTS) $(CSS_MAIN) > $@
perl -pi -e s/mq-/$(MQ_CLASS_PREFIX)mq-/g $@
perl -pi -e s/{VERSION}/v$(VERSION)/ $@

$(NODE_MODULES_INSTALLED): package.json
Expand Down
20 changes: 20 additions & 0 deletions docs/Api_Methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,26 @@ Simulates typing text, one character at a time from where the cursor currently i
mathField.typedText('x=-b\\pm \\sqrt b^2 -4ac');
```

## .setAriaLabel(ariaLabel)

Specify an [ARIA label][`aria-label`] for this field, for screen readers. The actual [`aria-label`] includes this label followed by the math content of the field as speech. Default: `'Math Input'`

## .getAriaLabel()

Returns the [ARIA label][`aria-label`] for this field, for screen readers. If no ARIA label has been specified, `'Math Input'` is returned.

## .setAriaPostLabel(ariaPostLabel, timeout)

Specify a suffix to be appended to the [ARIA label][`aria-label`], after the math content of the field. Default: `''` (empty string)

If a timeout (in ms) is supplied, and the math field has keyboard focus when the time has elapsed, an ARIA alert will fire which will cause a screen reader to read the content of the field along with the ARIA post-label. This is useful if the post-label contains an evaluation, error message, or other text that the user needs to know about.

## .getAriaPostLabel()

Returns the suffix to be appended to the [ARIA label][`aria-label`], after the math content of the field. If no ARIA post-label has been specified, `''` (empty string) is returned.

[`aria-label`]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute

## .config(new_config)

Changes the [configuration](Config.md) of just this math field.
Expand Down
11 changes: 1 addition & 10 deletions docs/Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Just like [`autoCommands`](#autocommands) above, this takes a string formatted a
`maxDepth` specifies the maximum number of nested MathBlocks. When `maxDepth` is set to 1, the user can type simple math symbols directly into the editor but not into nested MathBlocks, e.g. the numerator and denominator of a fraction.

Nested content in latex rendered during initialization or pasted into mathquill is truncated to avoid violating `maxDepth`. When `maxDepth` is not set, no depth limit is applied by default.
You can also specify a speech-friendly representation of the operator name by supplying the operator name, a `|` and its speech alternative (separate multiple words with a `-`). For example, `'sin|sine cos|cosine tan|tangent sinh|hyperbolic-sine'`.

## substituteTextarea

Expand Down Expand Up @@ -158,13 +159,3 @@ For example, to style as white-on-black instead of black-on-white use:
border-color: white;
background: black;
}
#my-math-input .mq-matrixed {
background: black;
}
#my-math-input .mq-matrixed-container {
filter: progid:DXImageTransform.Microsoft.Chroma(color='black');
}

## Color Change Support on IE8

To support a MathQuill editable background color other than white in IE8, set the background color on both the editable mathField and on elements with class `mq-matrixed`. Then set a Chroma filter on elements with class `mq-matrixed-container`.
Loading

0 comments on commit 47710a7

Please sign in to comment.