Skip to content

Commit

Permalink
Merge pull request #2411 from QuizandSurveyMaster/dev2
Browse files Browse the repository at this point in the history
Release - QSM 8.2.0
  • Loading branch information
etvarun authored Dec 15, 2023
2 parents 47d1cdc + d4bd5b2 commit 40babbf
Show file tree
Hide file tree
Showing 21 changed files with 467 additions and 257 deletions.
78 changes: 78 additions & 0 deletions css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,85 @@ td.scheduled_time_start {
.admin_page_mlw_quiz_options .nav-tab-active:focus, .admin_page_mlw_quiz_options .nav-tab-active:focus:active, .admin_page_mlw_quiz_options .nav-tab-active:hover {
border: 1px solid #c3c4c7;
}
.notice-error.notice-advance-timer {
padding: 10px 15px;
}

.qsm-page-setting-top {
display: flex;
}

.qsm-page-setting-top .qsm-page-setting-left span {
width: 120px;
display: inline-block;
color: #000;
font-weight: 500;
margin: 0 5px 5px 0;
font-size: 13px;
}

#page-options .qsm-popup-upgrade-warning {
line-height: 1.5;
max-width: 500px;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
font-size: 13px;
}

#page-options .qsm-page-setting-top .qsm-row label {
display: none;
}

#page-options .qsm-page-setting-top .qsm-row input[type=number] {
min-width: 50px !important;
max-width: 50px !important;
}

#page-options .qsm-page-setting-top .qsm-row input[type=number]::placeholder {
font-size: 12px;
}


#page-options > div {
line-height: 2.5;
}

#page-options .qsm-row label {
display: inline-block;
width: 115px;
margin-bottom: 5px;
color: #000;
font-weight: 500;
padding: 0 0 0 10px;
}

#page-options .qsm-page-setting-label {
font-weight: 500;
}

#page-options .qsm-page-setting-span {
font-weight: 500;
}

.qsm-disabled-td {
pointer-events: none;
opacity: 0.5;
}


.qsm-page-setting-container {
padding: 10px;
}

#page-options .qsm-page-setting-right input[type="number"] {
border-radius: 4px;
}

#page-options .qsm-popup-upgrade-warning img {
width: auto;
height: 16px;
margin-right: 8px;
margin-bottom: 16px;
}
.qsm-popup-upgrade-warning,
.qsm-popup-upgrade-info {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion data/parsing_script.json

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1805,8 +1805,14 @@ var import_button;
QSMAdmin.displayAlert(qsm_admin_messages.saving_page_info, 'info');
var pageInfo = QSMQuestion.qpages.get(pageID);
pageInfo.set("update_name", 1);
jQuery('#page-options').find(':input, select, textarea').each(function (i, field) {
jQuery('#page-options').find(':input, select, textarea, :checkbox').each(function (i, field) {
pageInfo.set(field.name, field.value);
if (field.type === 'checkbox') {
pageInfo.set(field.name, field.checked ? '1' : '0');
}
if (field.type === 'number') {
pageInfo.set(field.name, field.value == "" ? 0 : field.value);
}
});
},
savePages: function () {
Expand Down Expand Up @@ -2091,7 +2097,7 @@ var import_button;
});
model.set('answers', answers);
model.set('required', required);

jQuery(document).trigger('qsm_save_question_before', [questionID, CurrentElement, model, advanced_option]);
$('.questionElements .advanced-content > .qsm-row:not(.core-option)').each(function () {
if ($(this).find('input[type="text"]').length > 0) {
$($(this).find('input[type="text"]')).each(function () {
Expand Down Expand Up @@ -2422,6 +2428,7 @@ var import_button;
$('#match-answer').val(value);
}
});
jQuery(document).trigger('qsm_all_question_setting_after', [all_setting]);
}
CurrentElement.parents('.question').next('.questionElements').slideDown('slow');
$('#modal-1-content').html(questionElements);
Expand All @@ -2445,11 +2452,15 @@ var import_button;
var page = QSMQuestion.qpages.get(pageID);
$('#edit_page_id').val(pageID);
$("#edit-page-id").text('').text(pageID);
jQuery('#page-options').find(':input, select, textarea').each(function (i, field) {
jQuery('#page-options').find(':input, select, textarea, :checkbox').each(function (i, field) {
field.value = page.get(field.name);
if ('undefined' == field.value) {
field.value = "";
}
if (field.type === 'checkbox') {
field.value = page.get(field.name);
field.checked = field.value === '1';
}
});
MicroModal.show('modal-page-1');
},
Expand Down Expand Up @@ -2748,6 +2759,7 @@ var import_button;
QSMQuestion.saveQuestion($(this).parents('.questionElements').children('#edit_question_id').val(), $(this));
$('.save-page-button').trigger('click');
$('#modal-1-content').html(model_html);
jQuery(document).trigger('qsm_save_popup_button_after', [questionElements]);
});
$(document).on('click', '#new-answer-button', function (event) {
event.preventDefault();
Expand Down Expand Up @@ -2986,10 +2998,9 @@ var import_button;
if ('image' === answerType) {
$('#image_size_area').show();
}
jQuery(document).trigger('qsm_question_type_change_after', [question_val]);
});



//Add new category
$(document).on('click', '#qsm-category-add-toggle', function () {
if ($('#qsm-category-add').is(":visible")) {
Expand Down
33 changes: 31 additions & 2 deletions js/qsm-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,36 @@
if(polarQuestions.length >0){
qsmPolarSlider('answer', polarQuestions);
}


});

jQuery(document).on('submit', 'form[name="qsm-login-form"]', function (e) {
e.preventDefault();

let form = jQuery(this);
let username = form.find('input[name="log"]').val();
let password = form.find('input[name="pwd"]').val();
form.find('input[type="submit"]').attr('disabled', true);
jQuery(".qsm-login-form-warning").remove();

// Make a request to the WordPress REST API to log in
jQuery.ajax({
url: qmn_common_ajax_object.ajaxurl,
method: 'POST',
data: {
action: 'qsm_ajax_login',
username: username,
password: password,
},
success: function (response) {
if ( response.success ) {
form.get(0).submit();
} else {
form.append('<div class="qsm-result-page-warning qsm-login-form-warning">' + response.data.message + '</div>');
form.find('input[type="submit"]').attr('disabled', false);
}
}
});
});

function qsmPolarSlider(page , polarQuestions){
Expand Down Expand Up @@ -144,7 +173,7 @@
jQuery('.question-section-id-'+questionID+' .question-type-polar-s').find(
upperMidClass).css('font-weight', '600');
jQuery('.question-section-id-'+questionID+' .question-type-polar-s').find(
'.right-polar-title img').css('opacity', "0.8");
'.right-polar-title img').css('opacity', "0.8");
}
}

Expand Down
Loading

0 comments on commit 40babbf

Please sign in to comment.