1/** 2 * Plugin Name: Provide Support Live Chat 3 * Version: 5.0.1 4 * Requires PHP: 7.4 5 * Tested up to: 6.9 6 * Author: Provide Support, LLC 7 * Author URI: http://www.providesupport.com?utm_source=wp-plugin&utm_medium=list&utm_campaign=Plugins 8 **/ 9 10var BUTTONTEXT = 'ProvideSupport : chat button code loaded'; 11var HIDDENTEXT = 'ProvideSupport : hidden monitoring code loaded'; 12jQuery(document).ready(function() { 13 14 var loaded = typeof(jQuery('#f7widgetBlock').html()) !== 'undefined'; 15 var rvmEnabled = false; 16 var f7s = f7php.settings; 17 18 // Send request only if no code added yet thus adding the code may be required 19 if ((!loaded) && (('urlRvmEnabled' in f7php) && f7php.urlRvmEnabled.length)) { 20 jQuery.ajax({ 21 method: "GET", 22 url: f7php.urlRvmEnabled + '¶ms=rvm.enabled', 23 }).done(function(res) { 24 // Get messenger type 25 rvmEnabled = ('rvm.enabled' in res.params) && (res.params['rvm.enabled'] == 'true'); 26 27 // Add code for fixed or rvm button 28 // Widget and shortcode buttons are added by means of WP 29 if ((rvmEnabled) || (f7s.buttonLocation == 'fixed')) { 30 launchRender(); 31 } 32 33 // Add monitoring code if required and no other code added yet 34 // Monitoring code is never required for shortcode 35 if (f7s.buttonAvailableWhole + '' == 'true' && !loaded ) { 36 showChat(f7php.hiddencode); 37 } 38 }); 39 } 40 41 function launchRender() { 42 if (f7php.page == '1') { 43 if (f7s.buttonAvailablePages + '' == 'true') { 44 if (f7s.buttonAvailablePagesWhich == 'all') { 45 showChat(f7php.code); 46 } else { 47 for (pageid in f7s.buttonAvailablePagesList) { 48 if (f7php.pageid == f7s.buttonAvailablePagesList[pageid]) { 49 showChat(f7php.code); 50 } 51 } 52 } 53 } 54 } 55 if (f7s.buttonAvailablePosts + '' == 'true' && f7php.single == '1') { 56 showChat(f7php.code); 57 } 58 if (f7s.buttonAvailableOther + '' == 'true' && f7php.other == '1') { 59 showChat(f7php.code); 60 } 61 if (f7s.buttonAvailableMain + '' == 'true' && f7php.frontpage == '1') { 62 showChat(f7php.code); 63 } 64 } 65 66 showChat = function(code) { 67 if (!loaded) { 68 code = code || ''; 69 var codeBlock = document.createElement('div'); 70 codeBlock.className = 'f7x'; 71 document.body.appendChild(codeBlock); 72 jQuery('.f7x').html(code); 73 if (f7s.buttonLocation == 'fixed' && !rvmEnabled) { 74 jQuery('.f7x').css(f7s.buttonLocationHorizontalFrom, f7s.buttonLocationHorizontalValue + f7s.buttonLocationHorizontalBy); 75 jQuery('.f7x').css(f7s.buttonLocationVerticalFrom, f7s.buttonLocationVerticalValue + f7s.buttonLocationVerticalBy); 76 } 77 loaded = true; 78 } 79 } 80 81});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.