jQuery(document).ready(function($){ var editor_css = ace.edit("wsp-loader-opt[custom_css]"), textarea_css = $('textarea[name="wsp-loader-opt[custom_css]"]').hide(); editor_css.setTheme("ace/theme/monokai"); editor_css.$blockScrolling = Infinity; editor_css.getSession().setMode("ace/mode/css"); editor_css.getSession().setValue(textarea_css.val()); editor_css.getSession().on('change', function(){ textarea_css.val(editor_css.getSession().getValue()); }); var editor_html = ace.edit("wsp-loader-opt[custom_animation]"), textarea_html = $('textarea[name="wsp-loader-opt[custom_animation]"]').hide(); editor_html.setTheme("ace/theme/monokai"); editor_html.$blockScrolling = Infinity; editor_html.getSession().setMode("ace/mode/html"); editor_html.getSession().setValue(textarea_html.val()); editor_html.getSession().on('change', function(){ textarea_html.val(editor_html.getSession().getValue()); }); var loader_image = $('#loader-img'), preview_image = $('#loader-preview'); wsp_init(); loader_image.on('change',function(){ wsp_init(); }); function wsp_init(){ var value =loader_image.val(), block ='