Commit Graph

18 Commits

Author SHA1 Message Date
Ali-D-Akbar
e8f548fa9c refactor: disable xsslint: PROD-2309 2021-04-19 12:21:43 +05:00
Samuel Walladge
18c7d72843 restructure code to pass lints 2020-05-05 09:25:23 +09:30
Samuel Walladge
9c4b458d2a Fix elem not selected if id contains special chars
If the id of a `.formulaequationinput input` element contains a special
character, then the selector for $preview was silently failing to match
the element, because no escaping was happening.

This fixes the issue by escaping the id before passing to the jQuery
selector function. CSS.escape is the ideal method, but this isn't
present in IE or Edge, so we use a fallback borrowed from the new
jQuery.escapeSelector method.
2020-05-04 09:27:12 +09:30
Eric Fischer
5bc6b31e29 eslint --fix 2017-12-08 14:38:41 -05:00
cahrens
156b43ec0f Allow passing through title to iFrame.
Also changes section to div.

TNL-6044
2016-12-05 12:53:57 -05:00
Brian Jacobel
163ff84699 Run eslint autofixer on /common 2016-08-08 15:59:18 -04:00
Adam Palay
d3a467d366 Only add event listener if it hasn't been added yet 2016-03-23 00:00:27 +05:00
Adam Palay
c63dcf0dfe render mathjax in svg by default (TNL-4145)
mathjax preview should be inline by default
2016-02-24 12:51:30 -05:00
cahrens
deb4e35f92 Disable Fast Preview for version 2.5.
Except for the Discussion Tab.
TNL-3693, TNL-3365
2015-10-29 11:56:08 -04:00
Waqas Khalid
4834e51aca Mathjax should be used after complete loading
Student couldn't able to submit his answer in ie9
becuase mathjax was used before its complete loading
thats cuase the problem. Mathjax operations should be
handled synchronously inorder to avoid error.

BLD-1199
2014-09-05 17:19:48 +05:00
Chris Terman
d3149f66aa add initial_state attribute to jsinput tag 2014-07-23 09:21:42 -04:00
stv
fd10fbf725 Fix JSInput scope leak
Declare variables locally
- The `allSections` variable was leaking into the global scope, due to a
  typo in the declaration.
- `dataProcessed` can be declared more narrowly within the callback.
2014-06-13 11:04:24 -07:00
Jonas Jelten
3de30aba2e fixed retry invokation for calling setState
to successfully call a function with parameters by setTimeout,
it needs to be a function that will be called by setTimeout internally.

this patch actually enables multiple tries for calling the setState function.
2014-04-18 23:00:25 +02:00
jmclaus
5478525a42 Added JSInput template to Studio and a sop attribute to JSInput. Only if it's set to false, as in JSInput's template, will JSChannel be used to bypass it. In all other cases (attribute not present or set to something else), SOP is enforced. Compatibility with jsVGL is therefore maintained. Multiple JSInput are supported in a vertical. Also, save button now functions. [BLD-523, BLD-556, BLD-568] 2013-12-20 17:03:56 +01:00
Peter Baratta
48cb05c037 Reset 'correctness' visual indicator of a problem on new input
Affects:
Choicegroups, option inputs, textline, and formula equation inputs
2013-08-30 12:03:41 -04:00
Peter Baratta
e312344dfa Fix initial loading bug.
Change the `MathJax.Hub.Queue(initializeRequest)` to a simpler function call
(`initializeRequest.call(this)`). This was failing to give a proper context
to initializeRequest, and `this.value` was turning up as `undefined`.

Also add a fallback if we need to display some code before MathJax finishes
its original typesetting.

I was stubbing out `Queue` in my specs, so the tests had to be changed around
a little.
2013-08-13 13:33:51 -04:00
Peter Baratta
735e3b01a2 Create a new response type for Numerical/Formula
Named `FormulaEquationInput` (name up for debate)

- Based off ChemEqnIn
- Add FormulaEquationInput in inputtypes.py
- Add a call to a skeleton method for a preview

javascript:

- Queue up some MathJax
- Put some ordering on the AJAX requests: add a parameter when the request was started, when it returns check that it isn't outdated before displaying the preview
- Tests

Note: we moved the `jsinput` tests and DISABLED them, because they were causing the tests to fail.
2013-08-12 11:48:45 -04:00
Julian Arni
fd6abc88e2 Incorporate review comments 2013-07-08 14:32:02 -04:00