Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No access to AMprocessNode, newcommand, etc. #22

Closed
drlippman opened this issue Jul 24, 2014 · 4 comments
Closed

No access to AMprocessNode, newcommand, etc. #22

drlippman opened this issue Jul 24, 2014 · 4 comments

Comments

@drlippman
Copy link
Contributor

The closure in ASCIIMathML.js blocks access to translate(), AMprocessNode(), newcommand(), etc.

Access to some of these functions are required for a dynamic website to operate effectively. The question is how we want to address this:

  1. Expose the functions: window.translate = translate, etc. The upside is that any existing dynamic applications will just work with the new version, no retooling necessary. The downside is that we're invading the global namespace with some fairly generic function names.

  2. Create a global ASCIIMATH object (or AM or AMML), and attach the functions to that object. That way we're only adding one new global object to the namespace. Existing apps will need to be retooled.

@adius
Copy link
Contributor

adius commented Jul 24, 2014

Definitely 2!

@drlippman
Copy link
Contributor Author

Is there any particular benefit, downside, or preference to using ASCIIMATH vs AM as the global object name?

I'm guessing we'll just comment out these lines in the MathJax ASCIIMath input jax, so probably doesn't matter in relation to that.

@dpvc
Copy link

dpvc commented Jul 24, 2014

AM seems like it might be more likely to conflict with other usage, so I'd recommend the longer ASCIIMATH as being far less likely to be a problem. If someone wants to alias AM to ASCIIMATH for brevity, that would be a choice she could make.

@adius
Copy link
Contributor

adius commented Jul 24, 2014

Actually I'd write it all lowercase (and the long version) as it's not supposed to be instantiated and best practice in Javascript is to write only instantiable functions capital case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants