Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
40 views
in Q2A Core by

This creates a burden on page load, which is not present in Q2A 1.8.3.

<script>
var qa_root = '..\/';
var qa_request = '1\/test-the-first-review-site';
var qa_wysiwyg_editor_config = {
    filebrowserUploadMethod: 'form',
    defaultLanguage: 'en',
    language: 'vi-VN'
};
var qa_optids_1 = ["a_notify"];
function qa_display_rule_1(first) {
    var opts = {};
    for (var i = 0; i < qa_optids_1.length; i++) {
        var e = document.getElementById(qa_optids_1[i]);
        opts[qa_optids_1[i]] = e && (e.checked || (e.options && e.options[e.selectedIndex].value));
    }
    qa_display_rule_show('a_email_display', (opts.a_notify), first);
    qa_display_rule_show('a_email_shown', (opts.a_notify), first);
    qa_display_rule_show('a_email_hidden', (!opts.a_notify), first);
}
var qa_optids_2 = ["c2_notify"];
function qa_display_rule_2(first) {
    var opts = {};
    for (var i = 0; i < qa_optids_2.length; i++) {
        var e = document.getElementById(qa_optids_2[i]);
        opts[qa_optids_2[i]] = e && (e.checked || (e.options && e.options[e.selectedIndex].value));
    }
    qa_display_rule_show('c2_email_display', (opts.c2_notify), first);
    qa_display_rule_show('c2_email_shown', (opts.c2_notify), first);
    qa_display_rule_show('c2_email_hidden', (!opts.c2_notify), first);
}
</script>
<script src="../qa-content/jquery-3.3.1.min.js"></script>
<script src="../qa-content/qa-global.js?1.8.4"></script>
<script src="../qa-plugin/wysiwyg-editor/ckeditor/ckeditor.js?1.8.4"></script>
<script>
$(window).on('load', function() {
    for (var i = 0; i < qa_optids_1.length; i++) {
        $('#'+qa_optids_1[i]).change(function() { qa_display_rule_1(false); });
    }
    qa_display_rule_1(true);
    document.getElementById('anew').qa_load = function() { if (qa_ckeditor_a_content = CKEDITOR.replace('a_content', qa_wysiwyg_editor_config)) { qa_ckeditor_a_content.setData(document.getElementById('a_content_ckeditor_data').value); document.getElementById('a_content_ckeditor_ok').value = 1; } };
    document.getElementById('anew').qa_focus = function() { if (qa_ckeditor_a_content) qa_ckeditor_a_content.focus(); };
    for (var i = 0; i < qa_optids_2.length; i++) {
        $('#'+qa_optids_2[i]).change(function() { qa_display_rule_2(false); });
    }
    qa_display_rule_2(true);
    document.getElementById('c2').qa_focus = function() { document.getElementById('c2_content').focus(); };
});
</script>

by
I found a solution for myself, but not sure if anybody cares.

Please log in or register to answer this question.

...