Paths for .setTheme/.setMode #1518

Closed
ghost opened this Issue Jul 15, 2013 · 4 comments

Projects

None yet

3 participants

@ghost
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
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
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 Jul 15, 2013
@Quixomatic

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

@joh-klein

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment