| 1 |
<div id="tg_setting_help_search"> |
| 2 |
<div class="tg-settings-search-area"> |
| 3 |
<label for="tg_setting_help_search_field"></label><input id="tg_setting_help_search_field" placeholder="<?php _e('Search for settings', 'tag-groups') ?>" autocomplete="off" title="<?php _e('Search for setting pages. Type a space to show all settings.', 'tag-groups') ?>"> |
| 4 |
</div> |
| 5 |
<div id="tg_setting_help_search_results" style="display:none;"> |
| 6 |
<h2><?php _e('Search Results', 'tag-groups') ?></h2> |
| 7 |
<div class="chatty-mango-settings-columns tg_setting_help_search_results_inner"> |
| 8 |
<h4 id="tg_setting_help_nothing_found" style="display:none"><?php _e('Nothing found', 'tag-groups') ?></h4> |
| 9 |
<?php foreach ($topics as $tab => $atts) : |
| 10 |
$keywords = strtolower(implode(',', $atts['keywords'])) . ',' . strtolower($atts['title']) . ',' . $tab; |
| 11 |
?> |
| 12 |
<div id="tg_topic_' . $tab . '" class="tg_settings_topic" data-keywords="<?php echo esc_attr($keywords) ?>"> |
| 13 |
<h4><span class="dashicons dashicons-arrow-right-alt tg_no_underline"></span> <a href="<?php echo esc_url(admin_url('admin.php?page=' . esc_attr($atts['page']) . '&active-tab=' . esc_attr($tab))) ?>"><?php echo esc_html($atts['title']) ?></a></h4> |
| 14 |
</div> |
| 15 |
<?php endforeach; ?> |
| 16 |
</div> |
| 17 |
</div> |
| 18 |
</div> |
| 19 |
<script> |
| 20 |
var searchText = ""; |
| 21 |
jQuery(document).ready(function(){ |
| 22 |
jQuery("#tg_setting_help_search_field").on('keyup', function(){ |
| 23 |
searchText = jQuery("#tg_setting_help_search_field").val().toLowerCase(); |
| 24 |
if (searchText.length === 0) { |
| 25 |
jQuery("#tg_setting_help_search_results").slideUp(); |
| 26 |
} else { |
| 27 |
if (jQuery("#tg_setting_help_search_results").css("display") === "none") { |
| 28 |
jQuery("#tg_setting_help_search_results").slideDown(); |
| 29 |
} |
| 30 |
if (searchText==="' . __( 'all', 'tag-groups') . '" || searchText==="*" || searchText===" ") { |
| 31 |
jQuery(".tg_settings_topic").removeClass("tg_hide"); |
| 32 |
} else { |
| 33 |
jQuery(".tg_settings_topic") |
| 34 |
.addClass("tg_hide") |
| 35 |
.filter(function(index){ |
| 36 |
var keywords = jQuery(this).attr("data-keywords"); |
| 37 |
return keywords.indexOf(searchText) > -1; |
| 38 |
}) |
| 39 |
.removeClass("tg_hide"); |
| 40 |
} |
| 41 |
if (jQuery(".tg_settings_topic:not(.tg_hide)").length === 0 ){ |
| 42 |
jQuery("#tg_setting_help_nothing_found").slideDown(); |
| 43 |
} else { |
| 44 |
jQuery("#tg_setting_help_nothing_found").slideUp(); |
| 45 |
} |
| 46 |
jQuery(".tg_settings_topic.tg_hide").slideUp(); |
| 47 |
jQuery(".tg_settings_topic:not(.tg_hide)").slideDown(); |
| 48 |
} |
| 49 |
}); |
| 50 |
}); |
| 51 |
</script> |
| 52 |
|