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

Paths for .setTheme/.setMode #1518

Closed
ghost opened this issue Jul 15, 2013 · 8 comments
Closed

Paths for .setTheme/.setMode #1518

ghost opened this issue Jul 15, 2013 · 8 comments

Comments

@ghost
Copy link

ghost commented Jul 15, 2013

Running editor.setTheme('libs/ace/theme/twilight') will look for theme-twilight.js in the root folder.

I tried looking at the documentation without finding any help.

@ghost
Copy link
Author

ghost commented Jul 15, 2013

Also, the workers, are they required for any languages, or is there an option to turn them off?
Again, found no solution to this in the docs.

@ghost
Copy link
Author

ghost commented Jul 15, 2013

After searching for a good while I found these two:

ace.config.set('basePath', '/libs/ace');
editor.getSession().setUseWorker(false);

@p3lim p3lim closed this as completed Jul 15, 2013
@Quixomatic
Copy link

You are a hero, needed that basePath property and had been looking for days. Thank you.

@joh-klein
Copy link

For future reference, this is a complete example (modeled after the embedding example on the official ace website) for having ace.js somewhere else (I had it concatenated into a libs.min.js):

<script src="libs.min.js" type="text/javascript" charset="utf-8"></script>
<script>
    ace.config.set('basePath', '/ace-builds/src-noconflict');
    var editor = ace.edit("editor");
    editor.setTheme("ace/theme/monokai");
    editor.getSession().setMode("ace/mode/javascript");
</script>

@efatsi
Copy link

efatsi commented Aug 22, 2017

For anyone who struggles to get this to work in production environments, I've found that not only setting basePath, but also setting modePath and themePath are sometimes necessary for loading modes and themes:

ace.config.set('basePath', '/ace-builds/src-noconflict');
ace.config.set('modePath', '/ace-builds/src-noconflict');
ace.config.set('themePath', '/ace-builds/src-noconflict');

@PrabakarKaruppasamy
Copy link

@efatsi Can u please share with me how can we do it angular 6 project with https://github.com/fxmontigny/ng2-ace-editor . I am also facing the same issue.

@efatsi
Copy link

efatsi commented May 30, 2019

Sorry @PrabakarKaruppasamy, I don't have any angular experience. good luck!

@manuchadha1979
Copy link

@PrabakarKaruppasamy - were you able to make it work mate? Any change you could look at https://stackoverflow.com/questions/60177855/theme-and-mode-path-infer-issue-with-ace-js-and-angular

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

6 participants