$(function(){ //load_lesson_comments(); window.in_reload = false; window.wbbOpt = { lang: 'RU', buttons: "bold,italic,underline,|,link,bullist,numlist,fontcolor,|,quote,code,myquote" } if ($('#myModal1').length == 0) { $('[name=comment_sent_text]').wysibb(window.wbbOpt); } }); function get_reply_form(id){ var reply_form = '
'; return reply_form } function send_comment(form, root){ // Проверить комментарий // Отправить if ($('[name=comment_sent_text]').bbcode()){ $('[name=sent_comment_progress]').show(); $('[name=comment_sent_text]').val($('[name=comment_sent_text]').bbcode()); $.ajax({ type: 'POST', url: '/courses/sent_lesson_comment', data: $('[name='+form+']').serialize(), success: function(data){ if(data['code'] == '1'){ $('[name=sent_comment_progress]').hide(); document.forms[form].reset(); $('[name=comment_sent_text]').htmlcode(''); reload_lesson_comments(data['data']); $('[name='+$('#'+root).attr('sketch_place')+']').html('') } } }); } else { show_system_message('Введите текст сообщения') } } function read_lesson(id){ $.ajax({ type: 'POST', url: '/courses/read_lesson/', data: {'lesson': id}, success: function(data){ if (data['code'] == '1'){ $('[name=current_button]').fadeOut('slow', function(){ $('[name=next_button]').fadeIn('slow'); }); } } }); } function write_comment(block, data){ var message; var user_status; var reply; if (NotEmpty(data)) { if (!NotEmpty(data['replies'])) { reply = '' } else { reply = '
' +
'
'
} else {
avatar = '' +
'