| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
global $wpdb; |
| 6 |
?> |
| 7 |
|
| 8 |
<?php |
| 9 |
if(isset($_GET['opt']) && $_GET['opt']=='add'): |
| 10 |
|
| 11 |
do_action('qcld_str_add_category'); |
| 12 |
|
| 13 |
elseif(isset($_GET['opt']) && $_GET['opt']=='edit'): |
| 14 |
|
| 15 |
do_action('qcld_str_edit_category'); |
| 16 |
|
| 17 |
elseif(isset($_GET['page']) && $_GET['page']=='simple-text-response' && isset($_GET['action']) && $_GET['action']=='import'): |
| 18 |
|
| 19 |
do_action('qcld_str_import'); |
| 20 |
|
| 21 |
elseif(isset($_GET['action']) && wp_unslash($_GET['action'])=='manage-categories'): |
| 22 |
|
| 23 |
include_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH.'/includes/templates/manage-categories.php'); |
| 24 |
|
| 25 |
elseif(isset($_GET['action']) && wp_unslash($_GET['action'])=='edit'): |
| 26 |
|
| 27 |
if(class_exists('Qcld_str_pro')): |
| 28 |
do_action('qcld_str_pro_stredit'); |
| 29 |
else: |
| 30 |
|
| 31 |
$hasEdit = false; |
| 32 |
if(isset($_GET['query']) && wp_unslash($_GET['query'])!=''){ |
| 33 |
$hasEdit = true; |
| 34 |
$id = sanitize_text_field(wp_unslash($_GET['query'])); |
| 35 |
$table = $wpdb->prefix.'wpbot_response'; |
| 36 |
$data = $wpdb->get_row($wpdb->prepare("select * from {$table} where id = %d", $id)); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter |
| 37 |
} |
| 38 |
?> |
| 39 |
<div class="wpbot-str-page"> |
| 40 |
<div class="qcld-wp-chatbot-wrap-header"> |
| 41 |
<div class="qcld-wp-chatbot-wrap-header-logo"><a href="#" class="qcld-wp-chatbot-wrap-site__logo"><img src="<?php echo esc_url( QCLD_wpCHATBOT_IMG_URL . '/chatbot.png' ); ?>" alt="<?php esc_attr_e( 'WPBot', 'chatbot' ); ?>"> WPBot Control Panel </a> |
| 42 |
<p><strong><?php esc_html_e( 'Core Version:', 'chatbot' ); ?></strong> v<?php echo esc_html( QCLD_wpCHATBOT_VERSION ); ?></p> |
| 43 |
</div> |
| 44 |
<ul class="qcld-wp-chatbot-wrap-version-wrapper"> |
| 45 |
<li> |
| 46 |
<a class="wpchatbot-Upgrade" href="https://www.wpbot.pro/" target="_blank"><?php esc_html_e( 'Upgrade To Pro', 'chatbot' ); ?></a> |
| 47 |
</li> |
| 48 |
</ul> |
| 49 |
</div> |
| 50 |
|
| 51 |
<div class="wpbot-str-main"> |
| 52 |
<div class="wpbot-str-hero"> |
| 53 |
<div class="wpbot-str-hero-copy"> |
| 54 |
<h1><?php echo $hasEdit ? esc_html__( 'Edit Response', 'chatbot' ) : esc_html__( 'Add Response', 'chatbot' ); ?></h1> |
| 55 |
<p><?php esc_html_e( 'Query, response, and keywords are all searched. Add keywords so the best match is easier to find.', 'chatbot' ); ?></p> |
| 56 |
</div> |
| 57 |
<a class="wpbot-str-btn" href="<?php echo esc_url( admin_url( 'admin.php?page=simple-text-response' ) ); ?>"><?php esc_html_e( 'Back to responses', 'chatbot' ); ?></a> |
| 58 |
</div> |
| 59 |
|
| 60 |
<div class="wpbot-str-card"> |
| 61 |
<div class="wpbot-str-callout"> |
| 62 |
<p><?php esc_html_e( 'Clear browser cache and cookies before testing a new response.', 'chatbot' ); ?></p> |
| 63 |
</div> |
| 64 |
<form method="post" action=""> |
| 65 |
<input name="str_nonce" type="hidden" value="<?php echo esc_attr( sanitize_key( wp_create_nonce( 'str-nonce' ) ) ); ?>" /> |
| 66 |
<?php if ( $hasEdit ) : ?> |
| 67 |
<input type="hidden" name="qc_bot_str_id" value="<?php echo esc_attr( $data->id ); ?>" /> |
| 68 |
<?php endif; ?> |
| 69 |
|
| 70 |
<div class="wpbot-str-field"> |
| 71 |
<span class="wpbot-str-label"><?php esc_html_e( 'Query', 'chatbot' ); ?></span> |
| 72 |
<div> |
| 73 |
<input class="wpbot-str-input" type="text" name="qc_bot_str_query" value="<?php echo esc_attr( $hasEdit ? $data->query : '' ); ?>" required /> |
| 74 |
<p class="wpbot-str-hint"><?php esc_html_e( 'Required. Add the question or phrase a visitor might ask.', 'chatbot' ); ?></p> |
| 75 |
</div> |
| 76 |
</div> |
| 77 |
|
| 78 |
<div class="wpbot-str-field wpbot-str-field-editor"> |
| 79 |
<span class="wpbot-str-label"><?php esc_html_e( 'Response', 'chatbot' ); ?></span> |
| 80 |
<div> |
| 81 |
<?php |
| 82 |
$content = ( $hasEdit ? $data->response : '' ); |
| 83 |
$editor_id = 'qc_bot_str_response'; |
| 84 |
wp_editor( $content, $editor_id, array() ); |
| 85 |
?> |
| 86 |
<p class="wpbot-str-hint"><?php esc_html_e( 'Required. Add the reply the chatbot should send.', 'chatbot' ); ?></p> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
|
| 90 |
<div class="wpbot-str-field"> |
| 91 |
<span class="wpbot-str-label"><?php esc_html_e( 'Keyword', 'chatbot' ); ?></span> |
| 92 |
<div> |
| 93 |
<input class="wpbot-str-input" type="text" name="qc_bot_str_keyword" value="<?php echo esc_attr( $hasEdit ? $data->keyword : '' ); ?>" /> |
| 94 |
<p class="wpbot-str-hint"><?php esc_html_e( 'Optional. Add multiple keywords or phrases, separated by commas, to improve matching.', 'chatbot' ); ?></p> |
| 95 |
</div> |
| 96 |
</div> |
| 97 |
|
| 98 |
<div class="wpbot-str-form-actions"> |
| 99 |
<a class="wpbot-str-btn" href="<?php echo esc_url( admin_url( 'admin.php?page=simple-text-response' ) ); ?>"><?php esc_html_e( 'Cancel', 'chatbot' ); ?></a> |
| 100 |
<button type="submit" class="wpbot-str-btn wpbot-str-btn-primary" name="submit"><?php esc_html_e( 'Save Response', 'chatbot' ); ?></button> |
| 101 |
</div> |
| 102 |
</form> |
| 103 |
</div> |
| 104 |
</div> |
| 105 |
</div> |
| 106 |
<?php endif; ?> |
| 107 |
|
| 108 |
|
| 109 |
<?php else: ?> |
| 110 |
|
| 111 |
<div class="wpbot-str-page"> |
| 112 |
<div class="qcld-wp-chatbot-wrap-header"> |
| 113 |
<div class="qcld-wp-chatbot-wrap-header-logo"><a href="#" class="qcld-wp-chatbot-wrap-site__logo"><img src="<?php echo esc_url( QCLD_wpCHATBOT_IMG_URL . '/chatbot.png' ); ?>" alt="<?php esc_attr_e( 'WPBot', 'chatbot' ); ?>"> WPBot Control Panel </a> |
| 114 |
<p><strong><?php esc_html_e( 'Core Version:', 'chatbot' ); ?></strong> v<?php echo esc_html( QCLD_wpCHATBOT_VERSION ); ?></p> |
| 115 |
</div> |
| 116 |
<ul class="qcld-wp-chatbot-wrap-version-wrapper"> |
| 117 |
<li> |
| 118 |
<a class="wpchatbot-Upgrade" href="https://www.wpbot.pro/" target="_blank"><?php esc_html_e( 'Upgrade To Pro', 'chatbot' ); ?></a> |
| 119 |
</li> |
| 120 |
</ul> |
| 121 |
</div> |
| 122 |
|
| 123 |
<div class="wpbot-str-main"> |
| 124 |
<div class="wpbot-str-hero"> |
| 125 |
<div class="wpbot-str-hero-copy"> |
| 126 |
<h1><?php esc_html_e( 'Simple Text Responses', 'chatbot' ); ?></h1> |
| 127 |
<p><?php esc_html_e( 'Create simple text responses and the ChatBot will use an advanced search algorithm to answer user questions. This is a simpler alternative to OpenAI or DialogFlow.', 'chatbot' ); ?></p> |
| 128 |
<span class="wpbot-str-note"><?php esc_html_e( 'Requires MySQL client version 5.6+', 'chatbot' ); ?></span> |
| 129 |
</div> |
| 130 |
<?php if ( class_exists( 'Qcld_str_pro' ) ) : ?> |
| 131 |
<div class="wpbot-str-hero-actions"> |
| 132 |
<a href="<?php echo esc_url( add_query_arg( 'action', 'manage-categories', admin_url( 'admin.php?page=simple-text-response' ) ) ); ?>" class="wpbot-str-btn"><?php esc_html_e( 'Manage Categories', 'chatbot' ); ?></a> |
| 133 |
<a href="<?php echo esc_url( admin_url( 'admin-post.php?action=qc_str_export' ) ); ?>" class="wpbot-str-btn"><?php esc_html_e( 'Export', 'chatbot' ); ?></a> |
| 134 |
<a href="<?php echo esc_url( add_query_arg( 'action', 'import', admin_url( 'admin.php?page=simple-text-response' ) ) ); ?>" class="wpbot-str-btn"><?php esc_html_e( 'Import', 'chatbot' ); ?></a> |
| 135 |
</div> |
| 136 |
<?php endif; ?> |
| 137 |
</div> |
| 138 |
|
| 139 |
<div class="wpbot-str-card"> |
| 140 |
<div class="wpbot-str-card-head"> |
| 141 |
<div> |
| 142 |
<h2><?php esc_html_e( 'Search settings', 'chatbot' ); ?></h2> |
| 143 |
<p><?php esc_html_e( 'Tune how closely a visitor’s phrase must match, and which fields are searched.', 'chatbot' ); ?></p> |
| 144 |
</div> |
| 145 |
</div> |
| 146 |
|
| 147 |
<form method="post" action=""> |
| 148 |
<input name="str_nonce" type="hidden" value="<?php echo esc_attr( sanitize_key( wp_create_nonce( 'str-nonce' ) ) ); ?>" /> |
| 149 |
|
| 150 |
<div class="wpbot-str-field"> |
| 151 |
<span class="wpbot-str-label"><?php esc_html_e( 'Phrase matching accuracy', 'chatbot' ); ?></span> |
| 152 |
<div> |
| 153 |
<input class="wpbot-str-input wpbot-str-input-short" type="text" name="qc_bot_str_weight" value="<?php echo esc_attr( ! empty( get_option( 'qc_bot_str_weight' ) ) ? get_option( 'qc_bot_str_weight' ) : '0.4' ); ?>" required /> |
| 154 |
<p class="wpbot-str-hint"><?php esc_html_e( 'Enter a value between 0 and 1. A higher value means phrases must match more exactly.', 'chatbot' ); ?></p> |
| 155 |
</div> |
| 156 |
</div> |
| 157 |
|
| 158 |
<div class="wpbot-str-field"> |
| 159 |
<span class="wpbot-str-label"><?php esc_html_e( 'Search fields', 'chatbot' ); ?></span> |
| 160 |
<div> |
| 161 |
<?php $fields = get_option( 'qc_bot_str_fields' ); ?> |
| 162 |
<div class="wpbot-str-checks"> |
| 163 |
<label for="qc_bot_str_field_title"> |
| 164 |
<input id="qc_bot_str_field_title" type="checkbox" name="qc_bot_str_fields[]" value="query" <?php echo ( ! $fields ? 'checked="checked"' : '' ); ?> <?php echo ( $fields && in_array( 'query', $fields, true ) ? 'checked="checked"' : '' ); ?> /> |
| 165 |
<?php esc_html_e( 'Title', 'chatbot' ); ?> |
| 166 |
</label> |
| 167 |
<label for="qc_bot_str_field_keyword"> |
| 168 |
<input id="qc_bot_str_field_keyword" type="checkbox" name="qc_bot_str_fields[]" value="keyword" <?php echo ( ! $fields ? 'checked="checked"' : '' ); ?> <?php echo ( $fields && in_array( 'keyword', $fields, true ) ? 'checked="checked"' : '' ); ?> /> |
| 169 |
<?php esc_html_e( 'Keyword', 'chatbot' ); ?> |
| 170 |
</label> |
| 171 |
<label for="qc_bot_str_field_response"> |
| 172 |
<input id="qc_bot_str_field_response" type="checkbox" name="qc_bot_str_fields[]" value="response" <?php echo ( ! $fields ? 'checked="checked"' : '' ); ?> <?php echo ( $fields && in_array( 'response', $fields, true ) ? 'checked="checked"' : '' ); ?> /> |
| 173 |
<?php esc_html_e( 'Response', 'chatbot' ); ?> |
| 174 |
</label> |
| 175 |
</div> |
| 176 |
<p class="wpbot-str-hint"><?php esc_html_e( 'Check a field to include it in search. Uncheck it to leave it out.', 'chatbot' ); ?></p> |
| 177 |
</div> |
| 178 |
</div> |
| 179 |
|
| 180 |
<div class="wpbot-str-extra" hidden> |
| 181 |
<?php |
| 182 |
$current_user = wp_get_current_user(); |
| 183 |
if ( in_array( 'administrator', $current_user->roles, true ) ) : |
| 184 |
?> |
| 185 |
<div class="wpbot-str-field"> |
| 186 |
<span class="wpbot-str-label"><?php esc_html_e( 'Editor access', 'chatbot' ); ?></span> |
| 187 |
<div> |
| 188 |
<div class="wpbot-str-checks"> |
| 189 |
<label for="qc_bot_str_allow_author_editor"> |
| 190 |
<input id="qc_bot_str_allow_author_editor" type="checkbox" name="qc_bot_str_allow_author_editor" value="1" <?php echo ( get_option( 'qc_bot_str_allow_author_editor' ) && get_option( 'qc_bot_str_allow_author_editor' ) == 1 ? 'checked="checked"' : '' ); ?> /> |
| 191 |
<?php esc_html_e( 'Allow Author & Editor to edit STR', 'chatbot' ); ?> |
| 192 |
</label> |
| 193 |
</div> |
| 194 |
<p class="wpbot-str-hint"><?php esc_html_e( 'Enable this so Authors and Editors can edit Simple Text Responses.', 'chatbot' ); ?></p> |
| 195 |
</div> |
| 196 |
</div> |
| 197 |
<?php endif; ?> |
| 198 |
|
| 199 |
<div class="wpbot-str-form-actions"> |
| 200 |
<button type="submit" class="wpbot-str-btn wpbot-str-btn-primary" name="submit"><?php esc_html_e( 'Save Settings', 'chatbot' ); ?></button> |
| 201 |
</div> |
| 202 |
</div> |
| 203 |
</form> |
| 204 |
|
| 205 |
<form class="wpbot-str-reindex wpbot-str-extra" method="post" action="" hidden> |
| 206 |
<input name="str_nonce" type="hidden" value="<?php echo esc_attr( sanitize_key( wp_create_nonce( 'str-nonce' ) ) ); ?>" /> |
| 207 |
<div class="wpbot-str-reindex-copy"> |
| 208 |
<strong><?php esc_html_e( 'Re-index responses', 'chatbot' ); ?></strong> |
| 209 |
<p class="wpbot-str-hint"><?php esc_html_e( 'Run this if search results are not what you expect.', 'chatbot' ); ?></p> |
| 210 |
</div> |
| 211 |
<button type="submit" class="wpbot-str-btn" name="qc-re-index" id="re-index" value="1"><?php esc_html_e( 'Re-index', 'chatbot' ); ?></button> |
| 212 |
</form> |
| 213 |
|
| 214 |
<button type="button" class="wpbot-str-expand" aria-expanded="false"> |
| 215 |
<span class="wpbot-str-expand-label"><?php esc_html_e( 'Expand for More Options', 'chatbot' ); ?></span> |
| 216 |
<span class="wpbot-str-expand-icon" aria-hidden="true">+</span> |
| 217 |
</button> |
| 218 |
</div> |
| 219 |
|
| 220 |
<div class="wpbot-str-card wpbot-str-list-card"> |
| 221 |
<div class="wpbot-str-list-head"> |
| 222 |
<div> |
| 223 |
<h2><?php esc_html_e( 'Responses', 'chatbot' ); ?></h2> |
| 224 |
<p><?php esc_html_e( 'Questions, keywords, and the replies your chatbot can send.', 'chatbot' ); ?></p> |
| 225 |
</div> |
| 226 |
<a href="<?php echo esc_url( add_query_arg( 'action', 'edit', admin_url( 'admin.php?page=simple-text-response' ) ) ); ?>" class="wpbot-str-btn wpbot-str-btn-primary"><?php esc_html_e( 'Add New', 'chatbot' ); ?></a> |
| 227 |
</div> |
| 228 |
<form method="post"> |
| 229 |
<?php |
| 230 |
$this->response_list->prepare_items(); |
| 231 |
$this->response_list->display(); |
| 232 |
?> |
| 233 |
</form> |
| 234 |
</div> |
| 235 |
</div> |
| 236 |
</div> |
| 237 |
<?php endif; ?> |
| 238 |
|
| 239 |
<style> |
| 240 |
/* Scoped to Simple Text Responses. Tokens match the WPBot admin UI. */ |
| 241 |
.wpbot-str-page { |
| 242 |
--woobot-primary: #5B4E96; |
| 243 |
--woobot-primary-color: #5B4E96; |
| 244 |
--woobot-primary-dark: #463a7a; |
| 245 |
--woobot-primary-soft: #f3f1fa; |
| 246 |
--woobot-primary-border: #e4e0f2; |
| 247 |
--woobot-surface: #ffffff; |
| 248 |
--woobot-page-bg: #F5F7FD; |
| 249 |
--woobot-text: #2d2a3a; |
| 250 |
--woobot-muted: #6b6680; |
| 251 |
--woobot-danger: #e25563; |
| 252 |
--woobot-nav-muted: #988FBD; |
| 253 |
--woobot-primary-rgb: 91, 78, 150; |
| 254 |
display: block; |
| 255 |
width: calc(100% - 20px); |
| 256 |
max-width: calc(100% - 20px); |
| 257 |
margin: 20px 20px 36px 0; |
| 258 |
box-sizing: border-box; |
| 259 |
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; |
| 260 |
color: var(--woobot-text); |
| 261 |
font-size: 14px; |
| 262 |
} |
| 263 |
|
| 264 |
body.wpbot-panel_page_simple-text-response, |
| 265 |
body.chatbot-wpbot-lite_page_simple-text-response, |
| 266 |
body:has(.wpbot-str-page) { |
| 267 |
background-color: #F5F7FD; |
| 268 |
} |
| 269 |
|
| 270 |
body:has(.wpbot-str-page) .notice.qcbot-feedback, |
| 271 |
body:has(.wpbot-str-page) .notice.qcbot-str-top-notic { |
| 272 |
width: calc(100% - 20px) !important; |
| 273 |
max-width: calc(100% - 20px) !important; |
| 274 |
margin-left: 0 !important; |
| 275 |
margin-right: 20px !important; |
| 276 |
box-sizing: border-box; |
| 277 |
float: none; |
| 278 |
} |
| 279 |
|
| 280 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header { |
| 281 |
display: flex; |
| 282 |
align-items: center; |
| 283 |
justify-content: space-between; |
| 284 |
align-self: stretch; |
| 285 |
float: none; |
| 286 |
gap: 16px; |
| 287 |
width: 100%; |
| 288 |
max-width: 100%; |
| 289 |
margin: 0 0 16px; |
| 290 |
padding: 12px 18px; |
| 291 |
background: #fff; |
| 292 |
border: 1px solid var(--woobot-primary-border); |
| 293 |
border-radius: 16px; |
| 294 |
box-sizing: border-box; |
| 295 |
} |
| 296 |
|
| 297 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header-logo { |
| 298 |
display: flex; |
| 299 |
align-items: center; |
| 300 |
gap: 14px; |
| 301 |
min-width: 0; |
| 302 |
} |
| 303 |
|
| 304 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header img { |
| 305 |
width: 50px; |
| 306 |
height: 50px; |
| 307 |
max-width: 50px; |
| 308 |
flex: 0 0 50px; |
| 309 |
object-fit: contain; |
| 310 |
} |
| 311 |
|
| 312 |
.wpbot-str-page a.qcld-wp-chatbot-wrap-site__logo { |
| 313 |
display: flex; |
| 314 |
align-items: center; |
| 315 |
gap: 12px; |
| 316 |
margin: 0; |
| 317 |
padding: 0; |
| 318 |
color: #000; |
| 319 |
font-size: 22px; |
| 320 |
font-weight: 700; |
| 321 |
line-height: 1.2; |
| 322 |
text-decoration: none; |
| 323 |
} |
| 324 |
|
| 325 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header p, |
| 326 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header ul, |
| 327 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header li { |
| 328 |
margin: 0; |
| 329 |
padding: 0; |
| 330 |
list-style: none; |
| 331 |
} |
| 332 |
|
| 333 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header p { |
| 334 |
color: var(--woobot-text); |
| 335 |
font-size: 14px; |
| 336 |
white-space: nowrap; |
| 337 |
} |
| 338 |
|
| 339 |
.wpbot-str-page .qcld-wp-chatbot-wrap-version-wrapper { |
| 340 |
margin: 0; |
| 341 |
padding: 0; |
| 342 |
list-style: none; |
| 343 |
} |
| 344 |
|
| 345 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header a.wpchatbot-Upgrade { |
| 346 |
display: inline-block; |
| 347 |
padding: 12px 25px; |
| 348 |
background: #fff; |
| 349 |
color: var(--woobot-primary); |
| 350 |
border: 2px solid var(--woobot-primary); |
| 351 |
border-radius: 6px; |
| 352 |
font-size: 14px; |
| 353 |
font-weight: 700; |
| 354 |
line-height: 1.2; |
| 355 |
text-decoration: none; |
| 356 |
white-space: nowrap; |
| 357 |
} |
| 358 |
|
| 359 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header a.wpchatbot-Upgrade:hover, |
| 360 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header a.wpchatbot-Upgrade:focus { |
| 361 |
background: var(--woobot-primary); |
| 362 |
border-color: var(--woobot-primary); |
| 363 |
color: #fff; |
| 364 |
text-decoration: none; |
| 365 |
} |
| 366 |
|
| 367 |
.wpbot-str-main { |
| 368 |
display: block; |
| 369 |
width: 100%; |
| 370 |
max-width: 100%; |
| 371 |
margin: 0; |
| 372 |
box-sizing: border-box; |
| 373 |
} |
| 374 |
|
| 375 |
.wpbot-str-hero, |
| 376 |
.wpbot-str-card { |
| 377 |
background: #fff; |
| 378 |
border: 1px solid var(--woobot-primary-border); |
| 379 |
border-radius: 16px; |
| 380 |
padding: 20px 22px; |
| 381 |
margin: 0 0 16px; |
| 382 |
box-sizing: border-box; |
| 383 |
} |
| 384 |
|
| 385 |
.wpbot-str-hero, |
| 386 |
.wpbot-str-list-head, |
| 387 |
.wpbot-str-card-head, |
| 388 |
.wpbot-str-hero-actions, |
| 389 |
.wpbot-str-form-actions, |
| 390 |
.wpbot-str-reindex { |
| 391 |
display: flex; |
| 392 |
align-items: flex-start; |
| 393 |
justify-content: space-between; |
| 394 |
gap: 16px; |
| 395 |
} |
| 396 |
|
| 397 |
.wpbot-str-hero-actions, |
| 398 |
.wpbot-str-form-actions { |
| 399 |
flex-wrap: wrap; |
| 400 |
justify-content: flex-start; |
| 401 |
} |
| 402 |
|
| 403 |
.wpbot-str-card-head { |
| 404 |
margin-bottom: 4px; |
| 405 |
} |
| 406 |
|
| 407 |
.wpbot-str-list-head { |
| 408 |
align-items: center; |
| 409 |
margin-bottom: 14px; |
| 410 |
padding-bottom: 14px; |
| 411 |
border-bottom: 1px solid var(--woobot-primary-border); |
| 412 |
} |
| 413 |
|
| 414 |
.wpbot-str-hero h1, |
| 415 |
.wpbot-str-card h2 { |
| 416 |
margin: 0 0 6px; |
| 417 |
padding: 0; |
| 418 |
border: 0; |
| 419 |
color: var(--woobot-primary); |
| 420 |
font-weight: 700; |
| 421 |
line-height: 1.3; |
| 422 |
} |
| 423 |
|
| 424 |
.wpbot-str-hero h1 { |
| 425 |
font-size: 24px; |
| 426 |
} |
| 427 |
|
| 428 |
.wpbot-str-card h2 { |
| 429 |
font-size: 18px; |
| 430 |
} |
| 431 |
|
| 432 |
.wpbot-str-hero p, |
| 433 |
.wpbot-str-card-head p, |
| 434 |
.wpbot-str-list-head p { |
| 435 |
margin: 0; |
| 436 |
max-width: 720px; |
| 437 |
color: var(--woobot-muted); |
| 438 |
font-size: 14px; |
| 439 |
line-height: 1.55; |
| 440 |
} |
| 441 |
|
| 442 |
.wpbot-str-note { |
| 443 |
display: inline-flex; |
| 444 |
margin-top: 12px; |
| 445 |
padding: 6px 12px; |
| 446 |
border-radius: 999px; |
| 447 |
background: var(--woobot-primary-soft); |
| 448 |
border: 1px solid var(--woobot-primary-border); |
| 449 |
color: var(--woobot-primary); |
| 450 |
font-size: 12px; |
| 451 |
font-weight: 600; |
| 452 |
} |
| 453 |
|
| 454 |
.wpbot-str-callout { |
| 455 |
margin: 0 0 4px; |
| 456 |
padding: 12px 14px; |
| 457 |
background: var(--woobot-primary-soft); |
| 458 |
border: 1px solid var(--woobot-primary-border); |
| 459 |
border-radius: 10px; |
| 460 |
} |
| 461 |
|
| 462 |
.wpbot-str-callout p { |
| 463 |
margin: 0; |
| 464 |
color: var(--woobot-text); |
| 465 |
font-size: 13px; |
| 466 |
} |
| 467 |
|
| 468 |
.wpbot-str-field { |
| 469 |
display: grid; |
| 470 |
grid-template-columns: 220px minmax(0, 1fr); |
| 471 |
gap: 8px 24px; |
| 472 |
align-items: start; |
| 473 |
padding: 16px 0; |
| 474 |
border-bottom: 1px solid #eef0f6; |
| 475 |
} |
| 476 |
|
| 477 |
.wpbot-str-label { |
| 478 |
padding-top: 10px; |
| 479 |
color: var(--woobot-text); |
| 480 |
font-size: 14px; |
| 481 |
font-weight: 600; |
| 482 |
} |
| 483 |
|
| 484 |
.wpbot-str-hint { |
| 485 |
margin: 6px 0 0; |
| 486 |
color: var(--woobot-muted); |
| 487 |
font-size: 12px; |
| 488 |
font-style: italic; |
| 489 |
font-weight: 400; |
| 490 |
} |
| 491 |
|
| 492 |
.wpbot-str-page .wpbot-str-input { |
| 493 |
width: 100%; |
| 494 |
max-width: 100%; |
| 495 |
min-height: 40px; |
| 496 |
margin: 0; |
| 497 |
padding: 8px 12px; |
| 498 |
border: 1px solid var(--woobot-primary-border); |
| 499 |
border-radius: 8px; |
| 500 |
background: #fff; |
| 501 |
color: var(--woobot-text); |
| 502 |
box-shadow: none; |
| 503 |
} |
| 504 |
|
| 505 |
.wpbot-str-page .wpbot-str-input-short { |
| 506 |
max-width: 160px; |
| 507 |
} |
| 508 |
|
| 509 |
.wpbot-str-page .wpbot-str-input:focus { |
| 510 |
border-color: var(--woobot-primary); |
| 511 |
box-shadow: 0 0 0 3px rgba(var(--woobot-primary-rgb), 0.15); |
| 512 |
outline: none; |
| 513 |
} |
| 514 |
|
| 515 |
.wpbot-str-checks { |
| 516 |
display: flex; |
| 517 |
flex-wrap: wrap; |
| 518 |
gap: 8px; |
| 519 |
} |
| 520 |
|
| 521 |
.wpbot-str-checks label { |
| 522 |
display: inline-flex; |
| 523 |
align-items: center; |
| 524 |
gap: 8px; |
| 525 |
margin: 0; |
| 526 |
padding: 8px 12px; |
| 527 |
border: 1px solid var(--woobot-primary-border); |
| 528 |
border-radius: 10px; |
| 529 |
background: var(--woobot-primary-soft); |
| 530 |
color: var(--woobot-text); |
| 531 |
font-size: 13px; |
| 532 |
font-weight: 500; |
| 533 |
} |
| 534 |
|
| 535 |
.wpbot-str-page input[type="checkbox"] { |
| 536 |
accent-color: var(--woobot-primary); |
| 537 |
} |
| 538 |
|
| 539 |
.wpbot-str-form-actions { |
| 540 |
padding-top: 16px; |
| 541 |
} |
| 542 |
|
| 543 |
.wpbot-str-reindex { |
| 544 |
align-items: center; |
| 545 |
margin-top: 8px; |
| 546 |
padding-top: 16px; |
| 547 |
border-top: 1px solid var(--woobot-primary-border); |
| 548 |
} |
| 549 |
|
| 550 |
.wpbot-str-reindex-copy strong { |
| 551 |
display: block; |
| 552 |
color: var(--woobot-text); |
| 553 |
font-size: 14px; |
| 554 |
} |
| 555 |
|
| 556 |
.wpbot-str-page .wpbot-str-btn { |
| 557 |
display: inline-flex; |
| 558 |
align-items: center; |
| 559 |
justify-content: center; |
| 560 |
gap: 6px; |
| 561 |
margin: 0; |
| 562 |
padding: 0 16px; |
| 563 |
height: auto; |
| 564 |
min-height: 36px; |
| 565 |
border: 2px solid var(--woobot-primary); |
| 566 |
border-radius: 8px; |
| 567 |
background: #fff; |
| 568 |
color: var(--woobot-primary); |
| 569 |
font-family: inherit; |
| 570 |
font-size: 13px; |
| 571 |
font-weight: 600; |
| 572 |
line-height: 1.2; |
| 573 |
text-decoration: none; |
| 574 |
cursor: pointer; |
| 575 |
box-shadow: none; |
| 576 |
} |
| 577 |
|
| 578 |
.wpbot-str-page .wpbot-str-btn:hover, |
| 579 |
.wpbot-str-page .wpbot-str-btn:focus { |
| 580 |
background: var(--woobot-primary); |
| 581 |
border-color: var(--woobot-primary); |
| 582 |
color: #fff; |
| 583 |
box-shadow: none; |
| 584 |
outline: none; |
| 585 |
} |
| 586 |
|
| 587 |
.wpbot-str-page .wpbot-str-btn-primary { |
| 588 |
background: var(--woobot-primary); |
| 589 |
color: #fff; |
| 590 |
} |
| 591 |
|
| 592 |
.wpbot-str-page .wpbot-str-btn-primary:hover, |
| 593 |
.wpbot-str-page .wpbot-str-btn-primary:focus { |
| 594 |
background: var(--woobot-primary-dark); |
| 595 |
border-color: var(--woobot-primary-dark); |
| 596 |
color: #fff; |
| 597 |
} |
| 598 |
|
| 599 |
.wpbot-str-page .wpbot-str-extra[hidden] { |
| 600 |
display: none !important; |
| 601 |
} |
| 602 |
|
| 603 |
.wpbot-str-page .wpbot-str-expand { |
| 604 |
display: flex; |
| 605 |
align-items: center; |
| 606 |
justify-content: center; |
| 607 |
gap: 8px; |
| 608 |
width: 100%; |
| 609 |
margin-top: 16px; |
| 610 |
padding: 10px 14px; |
| 611 |
border: 2px solid var(--woobot-primary); |
| 612 |
border-radius: 8px; |
| 613 |
background: #fff; |
| 614 |
color: var(--woobot-primary); |
| 615 |
font-family: inherit; |
| 616 |
font-size: 13px; |
| 617 |
font-weight: 600; |
| 618 |
line-height: 1.2; |
| 619 |
cursor: pointer; |
| 620 |
box-shadow: none; |
| 621 |
box-sizing: border-box; |
| 622 |
/* max-width: 220px; */ |
| 623 |
margin: 20px auto 0 auto; |
| 624 |
color: #ffffff; |
| 625 |
position: relative; |
| 626 |
padding: 40px 0 0 0; |
| 627 |
height: 80px; |
| 628 |
text-align: center; |
| 629 |
background: #f1f1f1; |
| 630 |
cursor: pointer; |
| 631 |
background: linear-gradient(to bottom, rgb(255 255 255 / 53%) 0%, rgb(84 68 157) 100%); |
| 632 |
margin: -77px 0 0 0; |
| 633 |
border-radius: 0 0 15px 15px; |
| 634 |
z-index: 99999; |
| 635 |
font-weight: bold; |
| 636 |
border: none; |
| 637 |
} |
| 638 |
|
| 639 |
.wpbot-str-page .wpbot-str-expand:hover, |
| 640 |
.wpbot-str-page .wpbot-str-expand:focus { |
| 641 |
background: linear-gradient(to bottom, rgb(255 255 255 / 53%) 0%, rgb(84 68 157) 100%); |
| 642 |
color: #fff; |
| 643 |
outline: none; |
| 644 |
} |
| 645 |
|
| 646 |
.wpbot-str-page .wpbot-str-expand[aria-expanded="true"] { |
| 647 |
margin: 0 0 0 0; |
| 648 |
} |
| 649 |
|
| 650 |
|
| 651 |
.wpbot-str-page .wpbot-str-expand-icon { |
| 652 |
font-size: 16px; |
| 653 |
line-height: 1; |
| 654 |
} |
| 655 |
|
| 656 |
.wpbot-str-page .wp-editor-wrap { |
| 657 |
border: 1px solid var(--woobot-primary-border); |
| 658 |
border-radius: 10px; |
| 659 |
} |
| 660 |
|
| 661 |
.wpbot-str-page .tablenav { |
| 662 |
height: auto; |
| 663 |
margin: 0 0 12px; |
| 664 |
padding: 0; |
| 665 |
background: transparent; |
| 666 |
} |
| 667 |
|
| 668 |
.wpbot-str-page .tablenav.bottom { |
| 669 |
margin: 12px 0 0; |
| 670 |
} |
| 671 |
|
| 672 |
.wpbot-str-page .tablenav .actions select, |
| 673 |
.wpbot-str-page .tablenav .tablenav-pages .current-page { |
| 674 |
min-height: 36px; |
| 675 |
border: 1px solid var(--woobot-primary-border); |
| 676 |
border-radius: 8px; |
| 677 |
box-shadow: none; |
| 678 |
} |
| 679 |
|
| 680 |
.wpbot-str-page .tablenav .button, |
| 681 |
.wpbot-str-page .tablenav .tablenav-pages a, |
| 682 |
.wpbot-str-page .tablenav .tablenav-pages span.button { |
| 683 |
min-height: 32px; |
| 684 |
border: 1px solid var(--woobot-primary-border); |
| 685 |
border-radius: 8px; |
| 686 |
background: #fff; |
| 687 |
color: var(--woobot-primary); |
| 688 |
font-weight: 600; |
| 689 |
box-shadow: none; |
| 690 |
} |
| 691 |
|
| 692 |
.wpbot-str-page .tablenav .button:hover, |
| 693 |
.wpbot-str-page .tablenav .tablenav-pages a:hover { |
| 694 |
border-color: var(--woobot-primary); |
| 695 |
background: var(--woobot-primary); |
| 696 |
color: #fff; |
| 697 |
} |
| 698 |
|
| 699 |
.wpbot-str-page .displaying-num { |
| 700 |
color: var(--woobot-muted); |
| 701 |
font-size: 13px; |
| 702 |
} |
| 703 |
|
| 704 |
.wpbot-str-page .wp-list-table { |
| 705 |
border: 1px solid var(--woobot-primary-border); |
| 706 |
border-radius: 12px; |
| 707 |
border-collapse: separate; |
| 708 |
border-spacing: 0; |
| 709 |
background: #fff; |
| 710 |
overflow: hidden; |
| 711 |
} |
| 712 |
|
| 713 |
.wpbot-str-page .wp-list-table thead th, |
| 714 |
.wpbot-str-page .wp-list-table thead td, |
| 715 |
.wpbot-str-page .wp-list-table tfoot th, |
| 716 |
.wpbot-str-page .wp-list-table tfoot td { |
| 717 |
padding: 12px 10px; |
| 718 |
border: none; |
| 719 |
background: var(--woobot-primary); |
| 720 |
color: #fff; |
| 721 |
font-weight: 600; |
| 722 |
} |
| 723 |
|
| 724 |
.wpbot-str-page .wp-list-table thead a, |
| 725 |
.wpbot-str-page .wp-list-table tfoot a { |
| 726 |
color: #fff; |
| 727 |
} |
| 728 |
|
| 729 |
.wpbot-str-page .wp-list-table thead .sorting-indicator:before, |
| 730 |
.wpbot-str-page .wp-list-table thead th.sorted.asc .sorting-indicator.asc:before, |
| 731 |
.wpbot-str-page .wp-list-table thead th.sorted.desc .sorting-indicator.desc:before, |
| 732 |
.wpbot-str-page .wp-list-table thead th.sorted:hover .sorting-indicator:before, |
| 733 |
.wpbot-str-page .wp-list-table thead th.sorted a:hover .sorting-indicator:before { |
| 734 |
color: #fff; |
| 735 |
} |
| 736 |
|
| 737 |
.wpbot-str-page .wp-list-table tfoot { |
| 738 |
display: none; |
| 739 |
} |
| 740 |
|
| 741 |
.wpbot-str-page .wp-list-table.striped > tbody > tr, |
| 742 |
.wpbot-str-page .wp-list-table.striped > tbody > :nth-child(odd), |
| 743 |
.wpbot-str-page .wp-list-table.striped > tbody > :nth-child(even) { |
| 744 |
background: #fff; |
| 745 |
} |
| 746 |
|
| 747 |
.wpbot-str-page .wp-list-table tbody tr:hover { |
| 748 |
background: var(--woobot-primary-soft); |
| 749 |
} |
| 750 |
|
| 751 |
.wpbot-str-page .wp-list-table td { |
| 752 |
padding: 12px 10px; |
| 753 |
border-bottom: 1px solid #eef0f6; |
| 754 |
color: var(--woobot-text); |
| 755 |
vertical-align: middle; |
| 756 |
} |
| 757 |
|
| 758 |
.wpbot-str-page .wp-list-table tr:last-child td { |
| 759 |
border-bottom: none; |
| 760 |
} |
| 761 |
|
| 762 |
.wpbot-str-page .wp-list-table .row-actions { |
| 763 |
position: static; |
| 764 |
left: auto; |
| 765 |
padding-top: 4px; |
| 766 |
visibility: visible; |
| 767 |
} |
| 768 |
|
| 769 |
.wpbot-str-page .wp-list-table .row-actions a { |
| 770 |
color: var(--woobot-primary); |
| 771 |
font-weight: 600; |
| 772 |
} |
| 773 |
|
| 774 |
.wpbot-str-page .wp-list-table .row-actions .delete a { |
| 775 |
color: var(--woobot-danger); |
| 776 |
} |
| 777 |
|
| 778 |
.wpbot-str-page .no-items td { |
| 779 |
padding: 28px 16px; |
| 780 |
color: var(--woobot-muted); |
| 781 |
text-align: center; |
| 782 |
} |
| 783 |
|
| 784 |
form.wpbot-str-reindex.wpbot-str-extra { |
| 785 |
display: flex; |
| 786 |
flex-direction: column; |
| 787 |
align-content: flex-start; |
| 788 |
align-items: flex-start; |
| 789 |
} |
| 790 |
|
| 791 |
@media (max-width: 782px) { |
| 792 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header, |
| 793 |
.wpbot-str-page .qcld-wp-chatbot-wrap-header-logo, |
| 794 |
.wpbot-str-hero, |
| 795 |
.wpbot-str-list-head, |
| 796 |
.wpbot-str-reindex, |
| 797 |
.wpbot-str-form-actions { |
| 798 |
flex-direction: column; |
| 799 |
align-items: flex-start; |
| 800 |
} |
| 801 |
|
| 802 |
.wpbot-str-field { |
| 803 |
grid-template-columns: 1fr; |
| 804 |
gap: 6px; |
| 805 |
} |
| 806 |
|
| 807 |
.wpbot-str-label { |
| 808 |
padding-top: 0; |
| 809 |
} |
| 810 |
|
| 811 |
.wpbot-str-page .wpbot-str-input-short { |
| 812 |
max-width: 100%; |
| 813 |
} |
| 814 |
} |
| 815 |
</style> |
| 816 |
<script> |
| 817 |
jQuery(function ($) { |
| 818 |
$(document).on('click', '.wpbot-str-page .wpbot-str-expand', function () { |
| 819 |
var $button = $(this); |
| 820 |
var $card = $button.closest('.wpbot-str-card'); |
| 821 |
var isOpen = $button.attr('aria-expanded') === 'true'; |
| 822 |
|
| 823 |
if (isOpen) { |
| 824 |
$card.find('.wpbot-str-extra').attr('hidden', 'hidden'); |
| 825 |
$button.attr('aria-expanded', 'false'); |
| 826 |
$button.find('.wpbot-str-expand-label').text('<?php echo esc_js( __( 'Expand for More Options', 'chatbot' ) ); ?>'); |
| 827 |
$button.find('.wpbot-str-expand-icon').text('+'); |
| 828 |
} else { |
| 829 |
$card.find('.wpbot-str-extra').removeAttr('hidden'); |
| 830 |
$button.attr('aria-expanded', 'true'); |
| 831 |
$button.find('.wpbot-str-expand-label').text('<?php echo esc_js( __( 'Collapse Options', 'chatbot' ) ); ?>'); |
| 832 |
$button.find('.wpbot-str-expand-icon').text('\u2212'); |
| 833 |
} |
| 834 |
}); |
| 835 |
}); |
| 836 |
</script> |
| 837 |
|