How to get available themes dynamically?

1,192 views
Skip to first unread message

Dennis Reil

unread,
Jan 31, 2014, 7:10:14 AM1/31/14
to ace-d...@googlegroups.com
Hi,

I'm quite new to ace editor. Is there any api function available to get all the available themes, so that I could show a select box showing the themes and let the user decide which one to use?

Regards,
   Dennis

Harutyun Amirjanyan

unread,
Jan 31, 2014, 6:41:39 PM1/31/14
to ace-d...@googlegroups.com

Robert DeRose

unread,
Aug 28, 2014, 11:56:35 AM8/28/14
to ace-d...@googlegroups.com
Could you please elaborate?

I've tried using ace.require("ace/ext/themelist")  as this seems to follow the basic structure, but I can't figure out how to actually access this list now.

On Friday, January 31, 2014 6:41:39 PM UTC-5, Harutyun Amirjanyan wrote:
Hi
use https://github.com/ajaxorg/ace/blob/master/lib/ace/ext/themelist.js

marty.nelson

unread,
Sep 3, 2014, 8:38:26 PM9/3/14
to ace-d...@googlegroups.com
var themelist = ace.require("ace/ext/themelist")
var themes = themelist.themesByName //object hash of theme objects by name


template example (jade + ractive.js) consuming themes:
      select(value='{{config.theme}}')
       
{{#themes:theme}}
        option
(value='{{.theme}}', selected='{{.theme===config.theme}}') {{desc}}
       
{{/themes}}

Reply all
Reply to author
Forward
0 new messages