diff --git a/applications/admin/views/default/edit.html b/applications/admin/views/default/edit.html index 8a62106d..882284ec 100644 --- a/applications/admin/views/default/edit.html +++ b/applications/admin/views/default/edit.html @@ -74,6 +74,26 @@ jQuery(document).on('click', 'a.editor_filelink', function (e) { load_file(url); }); +// change the codemirror theme +jQuery(document).on('click', '#themes a', function (e) { + e.preventDefault(); + var href = jQuery(this).attr('href'); + var name = jQuery(this).text().replace('.css', ''); + var link = jQuery(""); + link.attr({ + type: 'text/css', + rel: 'stylesheet', + href: href + }); + jQuery("head").append( link ); + jQuery('textarea[name="data"]') .each(function(id, ta) { + editor = jQuery(ta).data('editor'); + editor.setOption("theme", name); + }); + jQuery('#themeName').html(name); +//#TODO save on session +}); + function isFullScreen(instance) { return /\bCodeMirror-fullscreen\b/.test(instance.getWrapperElement().className); } @@ -121,13 +141,22 @@ jQuery(document).on('click', 'a.editor_filelink', function (e) {
+