PluginProbe
Advanced Ads – Ad Manager & AdSense / 2.0.22
Advanced Ads – Ad Manager & AdSense v2.0.22
2.0.26 2.0.25 2.0.24 2.0.23 2.0.22 2.0.21 1.38.0 1.39.0 1.39.1 1.39.2 1.39.3 1.39.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.40.0 1.40.1 1.40.2 All 348 releases
advanced-ads / src / admin / screen-support / support.js
support.js
32 lines 812 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import domReady from '@wordpress/dom-ready';
2
3 import './support.css';
4
5 import { searchCombobox } from './autocomplete';
6 import { ticketForm } from './submit-ticket';
7
8 domReady( function () {
9 searchCombobox(
10 'advads-support-search',
11 'suggestions-list',
12 'https://wpadvancedads.com/wp-json/wp/v2/search?subtype=post,bwl_kb&search={{search}}',
13 ( suggestion ) => {
14 const subtitle =
15 suggestion.subtype === 'post' ? 'Turotials' : 'Knowledge Base';
16 return `
17 <span class="main-text">${ suggestion.title }</span>
18 <span class="secondary-text">${ subtitle }</span>
19 `;
20 },
21 ( suggestion, input ) => {
22 window.open(
23 suggestion.url +
24 '?utm_source=advanced-ads&utm_medium=link&utm_campaign=plugin_support_searchbox',
25 '_blank'
26 );
27 input.value = '';
28 }
29 );
30 ticketForm();
31 } );
32