PluginProbe
wp-forecast / 9.6
wp-forecast v9.6
10.0 trunk 1.4 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3..5 3..8 3.0 3.1 3.2 3.3 3.4 3.6 All 86 releases
wp-forecast / wp-forecast-admin.js

wp-forecast-admin.js in wp-forecast 9.6, at wp-forecast-admin.js

66 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Javascript for search and check dialog in admin
3 *
4 * @package wp-forecast
5 */
6
7 /* add color picker */
8 jQuery( document ).ready( function($){ jQuery( '.fonticon_color' ).wpColorPicker(); } );
9
10 /* get the data for the new location */
11 function wpf_search()
12 {
13 var searchterm = document.getElementById( "searchloc" ).value;
14 var language = document.getElementById( "wpf_search_language" ).value;
15 var wid = document.getElementById( "wpfcid" ).value;
16 var nonce = document.getElementById( "wpf_nonce_3" ).value;
17
18 jQuery.ajax(
19 {
20 type: 'POST',
21 url: ajaxurl,
22 data: {
23 action: 'wpf_search_ajax', searchterm: searchterm, language: language, wpfcid: wid, wpf_nonce_3: nonce },
24 success: function (data, textStatus, XMLHttpRequest) {
25 jQuery( "div#search_results" ).html( data );
26 },
27 error: function (XMLHttpRequest, textStatus, errorThrown) {
28 alert( errorThrown );
29 }
30 }
31 );
32 }
33
34 function wpf_set_loc( name, lat, lon ) {
35 document.getElementById( "location" ).value = name.trim();
36 document.getElementById( "locname" ).value = name.trim();
37 document.getElementById( "loclatitude" ).value = lat;
38 document.getElementById( "loclongitude" ).value = lon;
39 document.getElementById( "searchloc" ).value = '';
40 jQuery( "div#search_results" ).html( '' );
41 tb_remove();
42 }
43
44 /* get the data from the connection test */
45 function wpf_check()
46 {
47 var wprovider = document.getElementById( "wprovider" ).value;
48 var nonce = document.getElementById( "wpf_nonce_3" ).value;
49 jQuery( "div#check_log" ).html( '' );
50
51 jQuery.ajax(
52 {
53 type: 'POST',
54 url: ajaxurl,
55 data: {
56 action: 'wpf_check_ajax', provider : wprovider, wpf_nonce_3: nonce },
57 success: function (data, textStatus, XMLHttpRequest) {
58 jQuery( "div#check_log" ).html( data );
59 },
60 error: function (XMLHttpRequest, textStatus, errorThrown) {
61 alert( errorThrown );
62 }
63 }
64 );
65 }
66