$(function(){ if ($('#myModal1').length == 0) { CKEDITOR.replace('homework_text', { language: 'ru', toolbarGroups: [ {name: 'tools'}, {name: 'links'}, {name: 'basicstyles', groups: ['basicstyles', 'cleanup']}, {name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ]}, {name: 'styles'}, {name: 'others'} ] }); } }); function send_comment(form, root){ // Проверить комментарий // Отправить if (CKEDITOR.instances.homework_text.getData()){ $('[name=homework_text]').val(CKEDITOR.instances.homework_text.getData()); $.ajax({ type: 'POST', url: '/courses/sent_homework_comment', data: $('[name='+form+']').serialize(), success: function(data){ if(data['code'] == '1'){ document.forms[form].reset(); CKEDITOR.instances.homework_text.setData(''); $('[name='+$('#'+root).attr('sketch_place')+']').html(''); if (!$('[name=try_'+data['data']['try']['id']+']').html()){ $('[name=comment_list_place]').append('
' +
'
' +
'
'
} else {
avatar = '' +
'