Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the source path in Ace editor

I am embedding Ace locally offline and so am not using the hosted package and am subject to the same origin policy. How do you tell ace to look in a particular folder for it's source of modes, themes and workers?

You used to be able to use:

editor.config.set("modePath", "Scripts/Ace");
editor.config.set("workerPath", "Scripts/Ace");
editor.config.set("themePath", "Scripts/Ace");

But that doesn't work in the latest version. How can this be achieved?

Thanks in advance

like image 221
James Avatar asked Dec 27 '12 11:12

James


2 Answers

I had a similar issue and you can actually let Ace know what's the base folder path this way: ace.config.set("basePath", "/Scripts/Ace");

This work with the latest version I have, v1.1.3

like image 161
rorofromfrance Avatar answered Oct 30 '22 01:10

rorofromfrance


The simple way to achieve the same thing is to embed all scripts from the Ace source folder into the web page manually, excluding the worker-xxx.js files. This is still a bodge though.

like image 38
James Avatar answered Oct 29 '22 23:10

James