Skip to content

Commit

Permalink
Merge pull request #2481 from QuizandSurveyMaster/CU-867968jpx-email-…
Browse files Browse the repository at this point in the history
…and-result-page-redesign

update result page UI
  • Loading branch information
zubairraeen authored Mar 5, 2024
2 parents 23d4e28 + 1cb5f59 commit 5241731
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 24 deletions.
30 changes: 21 additions & 9 deletions css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ span.qsm-quiz-name {
margin-bottom: 15px;
border-radius: 2px;
background: #fff;
padding: 15px;
padding: 25px 20px;
position: relative;
border: 1px solid #dfd4d4;
}
Expand All @@ -520,6 +520,7 @@ span.qsm-quiz-name {
display: block;
font-weight: 500;
margin-bottom: 3px;
color: #959494;
}
.qsm-result-condition-mode,
.qsm-email-condition-mode {
Expand Down Expand Up @@ -3355,12 +3356,12 @@ input#preferred-date-format-custom {
top: calc( 100% - 18px);
}
.mce-container .qsm-autocomplete .qsm-autocomplete-item-group {
font-weight: 600;
font-weight: 500;
padding: 10px;
font-size: 14px;
font-size: 11px;
text-transform: uppercase;
background: #2271b1;
color: #fff;
color: #a2a2a2;
border-top: 1px solid #dfd4d4;
}
.mce-container .qsm-autocomplete .qsm-autocomplete-item {
padding: 10px 15px;
Expand All @@ -3372,7 +3373,8 @@ input#preferred-date-format-custom {
justify-content: space-between;
column-gap: 20px;
}
.mce-container .qsm-autocomplete .qsm-autocomplete-item:hover {
.mce-container .qsm-autocomplete .qsm-autocomplete-item:hover,
.mce-container .qsm-autocomplete .qsm-autocomplete-item-active {
background-color: #f0f0f0;
}
.mce-container .qsm-autocomplete .qsm-autocomplete-item .qsm-autocomplete-item-description {
Expand All @@ -3384,10 +3386,20 @@ input#preferred-date-format-custom {
float: right;
}
.qsm-hightlight-text{
color: #ffffff;
font-size: 11px;
margin-right: 2px;
}
.qsm-hightlight-text,
.mce-qsm-variables-editor-btn button{
background: #187FFA;
padding: 1px 3px 4px 5px;
border-radius: 2px;
margin-right: 2px;
display: inline-block;
text-align: center;
border: none;
}
.qsm-hightlight-text,
.mce-qsm-variables-editor-btn button span.mce-txt{
color: #ffffff;
padding: 0px 7px;
}
/*TinyMCE Text-editor : end */
54 changes: 41 additions & 13 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1187,10 +1187,11 @@ function qsm_is_substring_in_array( text, array ) {
//Add stylesheet
editor.settings.extended_valid_elements = 'qsmvariabletag';
editor.settings.custom_elements = '~qsmvariabletag';
editor.settings.content_style = 'qsmvariabletag { color: #ffffff; background: #187FFA; padding: 2px 5px; border-radius: 2px; }';
editor.settings.content_style = 'qsmvariabletag { color: #ffffff; background: #187FFA; padding: 5px 8px; border-radius: 2px;font-family: Arial, Helvetica, sans-serif;font-size: 12px; font-weight: 600; }';
editor.addButton('qsm_slash_command', {
text: '/' +qsm_admin_messages.slash_command,
text: '/ ' +qsm_admin_messages.variables,
tooltip: qsm_admin_messages.insert_variable,
classes: 'qsm-variables-editor-btn',
onclick: function () {
editor.insertContent('/');
showAutocomplete( editor, true );
Expand Down Expand Up @@ -1239,7 +1240,8 @@ function qsm_is_substring_in_array( text, array ) {

if ( 0 < newCommand.length ) {
let var_group = [];
newCommand.forEach( function( command ) {
newCommand.forEach(function (command, key) {
console.log(key);
//Add Group Name
if ( -1 == var_group.indexOf( command.group ) ) {
var_group.push( command.group );
Expand All @@ -1250,6 +1252,9 @@ function qsm_is_substring_in_array( text, array ) {
}
//Add Item
var item = document.createElement('div');
if (0 == key) {
item.classList.add('qsm-autocomplete-item-active');
}
item.classList.add('qsm-autocomplete-item');
item.setAttribute('title', command.description);
item.innerHTML = "/" + command.name + "<span class='qsm-autocomplete-item-description'>" + command.description + "</span>";
Expand Down Expand Up @@ -1337,8 +1342,34 @@ function qsm_is_substring_in_array( text, array ) {

showAutocomplete(editor);
}
}
if (40 === e.keyCode) {
let active_item = jQuery('.qsm-autocomplete-item-active');
jQuery('.qsm-autocomplete-item').removeClass('qsm-autocomplete-item-active');
if (active_item.length) {
active_item.next('.qsm-autocomplete-item').addClass('qsm-autocomplete-item-active');
} else {
jQuery('.qsm-autocomplete-item:first').addClass('qsm-autocomplete-item-active');
}
e.preventDefault();
}

}
if (38 === e.keyCode) {
let active_item = jQuery('.qsm-autocomplete-item-active');
jQuery('.qsm-autocomplete-item').removeClass('qsm-autocomplete-item-active');
if (active_item.length) {
active_item.prev('.qsm-autocomplete-item').addClass('qsm-autocomplete-item-active');
} else {
jQuery('.qsm-autocomplete-item:last').addClass('qsm-autocomplete-item-active');
}
e.preventDefault();
}
if ( 13 == e.keyCode ) {
if (jQuery('.qsm-autocomplete-item-active').length) {
jQuery('.qsm-autocomplete-item-active').click();
e.preventDefault();
}
}
}

});
Expand Down Expand Up @@ -1762,13 +1793,10 @@ var QSMContact;
var settings = {
mediaButtons: true,
tinymce: {
plugins: ["qsmslashcommands"],
plugins: "qsmslashcommands link image lists charmap colorpicker textcolor hr fullscreen wordpress",
forced_root_block: '',
toolbar1: 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,wp_more,fullscreen,wp_adv, qsm_slash_command',
toolbar2: 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help,wp_code',
setup: function (editor) {

}
toolbar1: 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,qsm_slash_command,wp_adv',
toolbar2: 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help,wp_code,fullscreen',
},
quicktags: true,
};
Expand Down Expand Up @@ -3784,10 +3812,10 @@ var import_button;
var settings = {
mediaButtons: true,
tinymce: {
plugins: ["qsmslashcommands"],
plugins: "qsmslashcommands link image lists charmap colorpicker textcolor hr fullscreen wordpress",
forced_root_block: '',
toolbar1: 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,wp_more,fullscreen,wp_adv, qsm_slash_command',
toolbar2: 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help,wp_code'
toolbar1: 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,qsm_slash_command,wp_adv',
toolbar2: 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help,wp_code,fullscreen',
},
quicktags: true,
};
Expand Down
1 change: 1 addition & 0 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ public function qsm_admin_scripts_style( $hook ) {
'qsm_variables_name' => $qsm_variables_name,
'no_variables' => __("No Variable Found", 'quiz-master-next'),
'slash_command' => __("slash command", 'quiz-master-next'),
'variables' => __("Variables", 'quiz-master-next'),
'insert_variable' => __("Insert QSM variables", 'quiz-master-next'),
);
$qsm_admin_messages = apply_filters( 'qsm_admin_messages_after', $qsm_admin_messages );
Expand Down
2 changes: 1 addition & 1 deletion php/admin/options-page-email-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function qsm_options_emails_tab_template() {
<div class="email-condition">
<div class="qsm-email-condition-mode">
<div class="email-condition-category-container qsm-email-condition-container-inner">
<label class="qsm-email-condition-title"><?php esc_html_e( 'Mode', 'quiz-master-next' ); ?></label>
<label class="qsm-email-condition-title"><?php esc_html_e( 'Select Mode', 'quiz-master-next' ); ?></label>
<select class="email-condition-category">
<option value="quiz" <# if (data.category == 'quiz' || data.category == '') { #>selected<# } #>><?php esc_html_e( 'Quiz', 'quiz-master-next' ); ?></option>
<?php if ( ! empty( $categories ) ) {
Expand Down
2 changes: 1 addition & 1 deletion php/admin/options-page-results-page-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ function qsm_options_results_tab_template(){
<div class="results-page-condition">
<div class="qsm-result-condition-mode qsm-result-condition-container">
<div class="results-page-condition-category-container qsm-result-condition-container-inner">
<label class="qsm-result-condition-title"><?php esc_html_e( 'Mode', 'quiz-master-next' ); ?></label>
<label class="qsm-result-condition-title"><?php esc_html_e( 'Select Mode', 'quiz-master-next' ); ?></label>
<select class="results-page-condition-category">
<option value="quiz" <# if (data.category == 'quiz' || data.category == '') { #>selected<# } #>><?php esc_html_e( 'Quiz', 'quiz-master-next' ); ?></option>
<?php if ( ! empty( $categories ) ) {
Expand Down

0 comments on commit 5241731

Please sign in to comment.