Bot releases are hidden (Show)
Published by arnog over 5 years ago
$
. This convention is also used, for example,_el()
, _insert()
, _keystroke()
, _latex()
,_perform()
, _revertToOriginalContent()
, _selectedText()
,_selectionAtEnd()
, _selectionAtStart()
, _selectionDepth()
,_selectionIsCollapsed()
, _setConfig()
, _text()
, _typedText()
(this was initially implemented in 0.25)theme="dark"
on the <body>
tag._
, (
and other keys.MathLive.toSpeakableText()
functionconfig.onAnnounce
handler$perform()
function now accepts selector both in camelCasePublished by arnog almost 6 years ago
Added support for a Vue wrapper.
Published by arnog almost 6 years ago
Fix issues in keyboard handling.
Published by arnog almost 6 years ago
MathLive.makeMathField('input', {
onContentDidChange: mf => {
document.getElementById('output').innerHTML = mf.latex();
}
});
Keep in mind that arrow functions lexically bind their context, so this
actually refers to the originating context (not to the mathfield).
The affected handlers are:
onFocus
onBlur
onKeystroke
onMoveOutOf
onTabOutOf
onContentWillChange
onContentDidChange
onSelectionWillChange
onSelectionDidChange
onUndoStateWillChange
onUndoStateDidChange
onVirtualKeyboardToggle
onReadAloudStatus
It is recommended that you check if you use any of those handlers and
validate their signatures.
The previous method, using a <script>
tag, is still supported:
<script src="../../dist/mathlive.js"></script>
but it is recommended to use native JavaScript modules:
<script type='module'>
import MathLive from '../../dist/mathlive.mjs';
</script>
(note the .mjs
extension indicating this is a JavaScript module).
A few caveats about using modules:
<script>
type='module'
attribute. The code inside<script>
tag) willwindow
) or in the case of even handlers, attach themaddEventListener
.See examples/basic/index.esm.html
for a complete example.
If you were previously loading the non-minified version, that is the raw sources,
which can be useful to debug issues, you need to use modules to load them, while
you may have used requirejs
previously. The sources are now included in the
distribution for this purpose.
Instead of:
define(['mathlive/src/mathlive'], function(MathLive) {
MathLive.makeMathField(/*...*/);
}
use:
import MathLive from '../../dist/src/mathlive.js';
MathLive.makeMathField(/*...*/);
horizontalSpacingScale
. Supplying a value > 1.0 can improve readability foronUndoStateWillChange
andonUndoStateDidChange
Published by arnog over 7 years ago
renderMathInDocument()
andrenderMathInElement()
preserveOriginalContent
option to MathLive.renderMathIn...()
\backslash
work in text mode, for example when an argument of \rlap{}
MathField.revertToOriginalContent()
when a math field is no longerMathField.config()
andconfig.commands
MathLive.revertToOriginalContent()
and MathLive.getOriginalContent()
data-
attributesonContentWillChange
and onContentDidChange
handlers in the math^
key´
, ^
, ¨
, ˜
and others on some keyboards) were not properly\color
command\rlap
, \color
and many other commands. Now,Published by arnog over 7 years ago
This is the first release on GitHub.
New in this release: