window.addEventListener('load', function () {
let task = {"id":115,"name":"Коллизии закона","user_id":1,"instruction":"","content":"<p>Какой закон применяется при коллизии норм различных нормативных актов ?<\/p>","answer":"","answer_pattern":"упк","allow_document":0,"users_check":0,"status":null,"visible":1,"type":"pattern","auto_check":1,"auto_check_type":"now","check_ai":0,"check_ai_type":null,"copy_paste":1,"modify":0,"modify_call_user_id":204,"modify_user_comment":"","created_at":"2021-09-07T09:30:12.000000Z","updated_at":"2023-02-21T13:48:13.000000Z","documents":[]};
autosize($('#textarea-decision'));
$('#original').click(function () {
let html = `<p>Какой закон применяется при коллизии норм различных нормативных актов ?</p>`;
tinyMCE.activeEditor.setContent(html);
});
$('#activate-tinymce').on('click', function () {
$(this).hide();
tinymce.EditorManager.execCommand("mceAddEditor", true, 'textarea-decision');
$('#blocks_toasts').hide();
if (1 == 0) {
tinymce?.activeEditor?.addShortcut("ctrl+v", "Custom Ctrl+V", "custom_ctrl_v");
tinymce?.activeEditor?.addCommand("custom_ctrl_v", function () {
$('#loader_message').css('backgroundColor', 'red').css('fontSize', '24px').css('color', 'white').text('Запрещено').fadeIn(100).delay(300).fadeOut(100);
return false;
});
tinymce?.activeEditor?.on('paste', function () {
$('#loader_message').css('backgroundColor', 'red').css('fontSize', '24px').css('color', 'white').text('Запрещено').fadeIn(100).delay(300).fadeOut(100);
return false;
})
}
});
if (localStorage.getItem('decision')) {
let lsDecision = JSON.parse(localStorage.getItem('decision'))
if (Number(lsDecision.taskId) === 115) {
$('.numberDecision').css('backgroundColor', 'black').css('color', 'white')
$('.numberDecision').html('<span class="badge badge-danger">ЧЕРНОВИК </span>' + $('.numberDecision').text());
$('#textarea-decision').html(lsDecision.textarea)
if (lsDecision.textarea && lsDecision.textarea[0] == '<') {
$('#activate-tinymce').trigger('click').hide()
tinyMCE.activeEditor.setContent(lsDecision.textarea);
}
}
}
if ($('#textarea-decision').val()) {
$('#count_symbols').html($('#textarea-decision').val().length)
}
})
© 2023 Quttera Ltd. All rights reserved.