PluginProbe
Property Hive / 1.4.6
Property Hive v1.4.6
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / assets / js / admin / dashboard.js

dashboard.js in Property Hive 1.4.6, at assets/js/admin/dashboard.js

49 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(window).load(function()
2 {
3 // Load news
4 var data = {
5 action: 'propertyhive_get_news',
6 security: 'get-news'
7 };
8
9 jQuery.post(propertyhive_dashboard.ajax_url, data, function(response)
10 {
11 if ( response == '' || response.length == 0 )
12 {
13 jQuery('#ph_dashboard_news').html('Unable to retrieve latest posts.');
14 return;
15 }
16
17 jQuery('#ph_dashboard_news').html('<ul></ul>')
18 for ( var i in response )
19 {
20 jQuery('#ph_dashboard_news ul').append('<li><a class="rsswidget" style="font-weight:400" href="' + response[i].permalink + '">' + response[i].title + '</a><br><small style="opacity:0.85">' + response[i].date + '</small></li>');
21 }
22
23 }, 'json');
24
25 // Load viewings awaiting feedback, if div is present (i.e. if viewings module hasn't been disabled)
26 if ( jQuery('#ph_dashboard_viewings_awaiting_applicant_feedback').length > 0 )
27 {
28 var data = {
29 action: 'propertyhive_get_viewings_awaiting_applicant_feedback',
30 security: 'get-viewings-awaiting-applicant-feedback'
31 };
32
33 jQuery.post(propertyhive_dashboard.ajax_url, data, function(response)
34 {
35 if ( response == '' || response.length == 0 )
36 {
37 jQuery('#ph_dashboard_viewings_awaiting_applicant_feedback').html('No viewings found awaiting feedback');
38 return;
39 }
40
41 jQuery('#ph_dashboard_viewings_awaiting_applicant_feedback').html('<ul></ul>')
42 for ( var i in response )
43 {
44 jQuery('#ph_dashboard_viewings_awaiting_applicant_feedback ul').append('<li><a class="rsswidget" style="font-weight:400" href="' + response[i].edit_link + '">' + response[i].applicant_name + '</a> viewed <a class="rsswidget" style="font-weight:400" href="' + response[i].edit_link + '">' + response[i].property_address + '</a><br><small style="opacity:0.85">' + response[i].start_date_time_formatted_Hi_jSFY + '</small></li>');
45 }
46
47 }, 'json');
48 }
49 });