Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wordpres.../assets/js
File: wws-admin-script.js
(function( $ ) {
[0] Fix | Delete
"use strict";
[1] Fix | Delete
[2] Fix | Delete
var whatsappIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"></path></svg>'
[3] Fix | Delete
[4] Fix | Delete
jQuery( document ).ready( function() {
[5] Fix | Delete
[6] Fix | Delete
// Init select2
[7] Fix | Delete
jQuery('.wws-select2').select2();
[8] Fix | Delete
[9] Fix | Delete
// Init WordPress color picker
[10] Fix | Delete
jQuery('.colorpicker').wpColorPicker();
[11] Fix | Delete
[12] Fix | Delete
// Time picker initilization
[13] Fix | Delete
jQuery( '.wws-timepicker' ).timepicker( {
[14] Fix | Delete
timeFormat: 'HH:mm:ss',
[15] Fix | Delete
dynamic: false,
[16] Fix | Delete
scrollbar: true,
[17] Fix | Delete
} );
[18] Fix | Delete
[19] Fix | Delete
/*
[20] Fix | Delete
* Button generator JS
[21] Fix | Delete
* @since 1.3
[22] Fix | Delete
*/
[23] Fix | Delete
jQuery( document ).on('keyup change click load', '.wws-button-generator', function(event) {
[24] Fix | Delete
event.preventDefault();
[25] Fix | Delete
[26] Fix | Delete
var buttonType = jQuery( '#wws-button-gen-button-type' ).val();
[27] Fix | Delete
var buttonText = jQuery( '#wws-button-gen-button-text' ).val();
[28] Fix | Delete
var buttonBgColor = jQuery( '#wws-button-gen-bg-color' ).val();
[29] Fix | Delete
var buttonTextColor = jQuery( '#wws-button-gen-text-color' ).val();
[30] Fix | Delete
var buttonBoldText = jQuery( '#wws-button-gen-bold-text' ).val();
[31] Fix | Delete
var buttonFullWidth = jQuery( '#wws-button-gen-full-width' ).val();
[32] Fix | Delete
[33] Fix | Delete
jQuery( '#wws-button-gen-support, #wws-button-gen-invitation' ).hide();
[34] Fix | Delete
if ( buttonType == 'support-button' ) {
[35] Fix | Delete
jQuery( '#wws-button-gen-support' ).show();
[36] Fix | Delete
} else {
[37] Fix | Delete
jQuery( '#wws-button-gen-invitation' ).show();
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
// change button text
[41] Fix | Delete
jQuery( '#wws-button-gen-btn-visual' ).html( whatsappIcon + ' <span>' + buttonText + '</span>' );
[42] Fix | Delete
// change button style
[43] Fix | Delete
jQuery( '#wws-button-gen-btn-visual' ).css({
[44] Fix | Delete
'background-color': buttonBgColor,
[45] Fix | Delete
'color': buttonTextColor,
[46] Fix | Delete
'font-weight': ( buttonBoldText == 1 ) ? '700' : 'inherit',
[47] Fix | Delete
'width': ( buttonFullWidth == 1 ) ? '100%' : 'auto',
[48] Fix | Delete
});
[49] Fix | Delete
[50] Fix | Delete
});
[51] Fix | Delete
[52] Fix | Delete
jQuery( document ).on('click', '#wws-button-gen-code', function(event) {
[53] Fix | Delete
event.preventDefault();
[54] Fix | Delete
var html = '';
[55] Fix | Delete
var shortcodeBox = jQuery( '#wws-button-gen-shortcode' );
[56] Fix | Delete
var htmlBox = jQuery( '#wws-button-gen-html' );
[57] Fix | Delete
var supportNumber = jQuery( '#wws-button-gen-support-number' ).val();
[58] Fix | Delete
var invitationID = jQuery( '#wws-button-gen-invitation-id' ).val();
[59] Fix | Delete
var buttonType = jQuery( '#wws-button-gen-button-type' ).val();
[60] Fix | Delete
var buttonText = jQuery( '#wws-button-gen-button-text' ).val();
[61] Fix | Delete
var buttonBgColor = jQuery( '#wws-button-gen-bg-color' ).val();
[62] Fix | Delete
var buttonTextColor = jQuery( '#wws-button-gen-text-color' ).val();
[63] Fix | Delete
var buttonBoldText = jQuery( '#wws-button-gen-bold-text' ).val();
[64] Fix | Delete
var buttonFullWidth = jQuery( '#wws-button-gen-full-width' ).val();
[65] Fix | Delete
var buttonFont = jQuery( '#wws-button-gen-font' ).val();
[66] Fix | Delete
var message = jQuery( '#wws-button-gen-message' ).val();
[67] Fix | Delete
var onMobile = jQuery( '#wws-button-gen-on-mobile' ).val();
[68] Fix | Delete
var onDesktop = jQuery( '#wws-button-gen-on-desktop' ).val();
[69] Fix | Delete
[70] Fix | Delete
var shortcode = '';
[71] Fix | Delete
shortcode += '[whatsappsupport ';
[72] Fix | Delete
[73] Fix | Delete
if ( buttonType == 'support-button' ) {
[74] Fix | Delete
shortcode += 'number="'+supportNumber+'" ';
[75] Fix | Delete
} else if ( buttonType == 'invitation-button' ) {
[76] Fix | Delete
shortcode += 'group="'+invitationID+'" ';
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
shortcode += 'text="'+buttonText+'" ';
[80] Fix | Delete
shortcode += 'text-color="'+buttonTextColor+'" ';
[81] Fix | Delete
shortcode += 'bg-color="'+buttonBgColor+'" ';
[82] Fix | Delete
[83] Fix | Delete
if ( buttonBoldText == 1 ) {
[84] Fix | Delete
shortcode += 'bold-text="'+( ( buttonBoldText == 1 ) ? '700' : 'inherit' )+'" ';
[85] Fix | Delete
}
[86] Fix | Delete
if ( buttonFont != 'inherit' ) {
[87] Fix | Delete
shortcode += 'font="'+buttonFont+'" ';
[88] Fix | Delete
}
[89] Fix | Delete
shortcode += 'message="'+message+'" ';
[90] Fix | Delete
[91] Fix | Delete
if ( buttonFullWidth == 1 ) {
[92] Fix | Delete
shortcode += 'full-width="'+( ( buttonFullWidth == 1 ) ? 'yes' : 'no' )+'" ';
[93] Fix | Delete
}
[94] Fix | Delete
if ( onMobile == 0 ) {
[95] Fix | Delete
shortcode += 'on-mobile="'+( ( onMobile == 1 ) ? 'yes' : 'no' )+'" ';
[96] Fix | Delete
}
[97] Fix | Delete
if ( onDesktop == 0 ) {
[98] Fix | Delete
shortcode += 'on-desktop="'+( ( onDesktop == 1 ) ? 'yes' : 'no' )+'"';
[99] Fix | Delete
}
[100] Fix | Delete
[101] Fix | Delete
shortcode += ']';
[102] Fix | Delete
[103] Fix | Delete
if ( buttonType == 'support-button' ) {
[104] Fix | Delete
html += '<a href="https://wa.me/'+supportNumber+'?text='+message+'" ';
[105] Fix | Delete
} else if ( buttonType == 'invitation-button' ) {
[106] Fix | Delete
html += '<a href="https://chat.whatsapp.com/'+invitationID+'" ';
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
html += 'style="';
[110] Fix | Delete
html += 'background-color:'+buttonBgColor+'; ';
[111] Fix | Delete
html += 'color:'+buttonTextColor+'; ';
[112] Fix | Delete
html += 'font-weight:'+( ( buttonBoldText == 1 ) ? '700' : 'inherit' )+'; ';
[113] Fix | Delete
html += 'width:'+( ( buttonFullWidth == 1 ) ? '100%; display: block; ' : 'auto' )+'; ';
[114] Fix | Delete
html += 'padding: 8px 25px; ';
[115] Fix | Delete
html += 'margin: 2px ;';
[116] Fix | Delete
html += 'border-radius: 3px; ';
[117] Fix | Delete
html += 'text-align: center;';
[118] Fix | Delete
html += '" '; // Style tag close
[119] Fix | Delete
html += 'target="_blank">'+buttonText+'</a>';
[120] Fix | Delete
[121] Fix | Delete
htmlBox.val( html );
[122] Fix | Delete
shortcodeBox.val( shortcode );
[123] Fix | Delete
[124] Fix | Delete
});
[125] Fix | Delete
[126] Fix | Delete
[127] Fix | Delete
/*
[128] Fix | Delete
* Link generator JS
[129] Fix | Delete
* @since 1.3
[130] Fix | Delete
*/
[131] Fix | Delete
jQuery( document ).on('keyup change click load', '.wws-link-generator', function(event) {
[132] Fix | Delete
event.preventDefault();
[133] Fix | Delete
[134] Fix | Delete
var linkType = jQuery( '#wws-link-gen-link-type' ).val();
[135] Fix | Delete
[136] Fix | Delete
jQuery( '#wws-link-gen-chat, #wws-link-gen-group, #wws-link-gen-message-field' ).hide();
[137] Fix | Delete
[138] Fix | Delete
if ( linkType == 'chat-link' ) {
[139] Fix | Delete
jQuery( '#wws-link-gen-chat, #wws-link-gen-message-field' ).show();
[140] Fix | Delete
} else if ( linkType == 'group-link' ) {
[141] Fix | Delete
jQuery( '#wws-link-gen-group' ).show();
[142] Fix | Delete
}
[143] Fix | Delete
[144] Fix | Delete
});
[145] Fix | Delete
[146] Fix | Delete
jQuery( document ).on('click', '#wws-link-gen-code', function(event) {
[147] Fix | Delete
event.preventDefault();
[148] Fix | Delete
[149] Fix | Delete
var linkBox = jQuery( '#wws-link-gen-link' );
[150] Fix | Delete
var linkType = jQuery( '#wws-link-gen-link-type' ).val();
[151] Fix | Delete
var whatsappNumber = jQuery( '#wws-link-gen-chat-number' ).val();
[152] Fix | Delete
var groupID = jQuery( '#wws-link-gen-group-id' ).val();
[153] Fix | Delete
var message = jQuery( '#wws-link-gen-message' ).val();
[154] Fix | Delete
[155] Fix | Delete
if ( linkType == 'chat-link' ) {
[156] Fix | Delete
linkBox.val( 'https://wa.me/'+whatsappNumber+'?text='+message+'' );
[157] Fix | Delete
} else if ( linkType == 'group-link' ) {
[158] Fix | Delete
linkBox.val( 'https://chat.whatsapp.com/'+groupID+'' );
[159] Fix | Delete
}
[160] Fix | Delete
[161] Fix | Delete
});
[162] Fix | Delete
[163] Fix | Delete
// Display edit multi account popup
[164] Fix | Delete
jQuery('.wws_edit_multi_account_show_popup').click(function() {
[165] Fix | Delete
var key = jQuery(this).attr('data-multi-account-key');
[166] Fix | Delete
tb_show('Edit Multi Account Support', 'admin-ajax.php?action=wws_edit_multi_support_person&person_id=' + key);
[167] Fix | Delete
return false;
[168] Fix | Delete
});
[169] Fix | Delete
[170] Fix | Delete
// Display add multi account popup
[171] Fix | Delete
jQuery('.wws_add_multi_account_show_popup').click(function() {
[172] Fix | Delete
tb_show('Add Multi Account Support', 'admin-ajax.php?action=wws_add_multi_support_person');
[173] Fix | Delete
return false;
[174] Fix | Delete
});
[175] Fix | Delete
[176] Fix | Delete
[177] Fix | Delete
// Analytics deep report
[178] Fix | Delete
jQuery( document ).on( 'click', '[data-ip]', function() {
[179] Fix | Delete
var ip = jQuery( this ).attr( 'data-ip' );
[180] Fix | Delete
tb_show('Analytics Deep Report', 'admin-ajax.php?action=wws_analytics_deep_report&ip=' + ip );
[181] Fix | Delete
return false;
[182] Fix | Delete
[183] Fix | Delete
});
[184] Fix | Delete
[185] Fix | Delete
[186] Fix | Delete
// QR Code generation.
[187] Fix | Delete
jQuery( '#wws-qr-gen-code' ).on( 'click', function() {
[188] Fix | Delete
jQuery( '#wws-qr-gen-code i' ).css( 'display', 'inline-block' );
[189] Fix | Delete
[190] Fix | Delete
jQuery.ajax({
[191] Fix | Delete
url: wwsAdminObj.admin_url,
[192] Fix | Delete
type: 'post',
[193] Fix | Delete
dataType: 'json',
[194] Fix | Delete
data: {
[195] Fix | Delete
'action': 'wws_admin_qr_generator',
[196] Fix | Delete
'support_number' : jQuery( '#wws-qr-number' ).val(),
[197] Fix | Delete
'pre_message' : jQuery( '#wws-qr-textarea' ).val(),
[198] Fix | Delete
'qr_size' : jQuery( '#wws-qr-size' ).val(),
[199] Fix | Delete
}
[200] Fix | Delete
}).done(function( response ) {
[201] Fix | Delete
jQuery( '#wws-qr-gen-shortcode' ).val( response.shortcode );
[202] Fix | Delete
jQuery( '#wws-admin-qr-view img' ).attr( 'src', response.generatedQR );
[203] Fix | Delete
jQuery( '#wws-admin-qr-view div' ).html( response.preMessage );
[204] Fix | Delete
jQuery( '#wws-qr-gen-code i' ).hide();
[205] Fix | Delete
});
[206] Fix | Delete
[207] Fix | Delete
} );
[208] Fix | Delete
[209] Fix | Delete
// Input masking selection.
[210] Fix | Delete
jQuery( '[data-wws-mask]' ).on( 'click', function( e ) {
[211] Fix | Delete
e.preventDefault();
[212] Fix | Delete
[213] Fix | Delete
var maskFormat = jQuery( this ).attr( 'data-wws-mask' );
[214] Fix | Delete
jQuery( '#wws_number_masking' ).val( maskFormat );
[215] Fix | Delete
} );
[216] Fix | Delete
[217] Fix | Delete
} ); // Document ready end here
[218] Fix | Delete
[219] Fix | Delete
})(jQuery)
[220] Fix | Delete
[221] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function