File size: 7,564 Bytes
a47e1ac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
"use strict";
var initial = '';
function umsLoading(btn)
{
btn.attr('disabled','disabled');
if(!btn.find('spinner').length){
btn.append('<span class="spinner"></span>');
}
btn.find('.spinner').css('visibility','unset');
}
function umsRmLoading(btn)
{
btn.removeAttr('disabled');
btn.find('.spinner').remove();
}
function mainChanged()
{
if(jQuery('.input-checkbox').is(":checked"))
{
jQuery(".hideMain").show();
}
else
{
jQuery(".hideMain").hide();
}
if(jQuery("#spin_text option:selected").val() === 'best' || jQuery("#spin_text option:selected").val() === 'wordai' || jQuery("#spin_text option:selected").val() === 'spinrewriter')
{
jQuery(".hideBest").show();
}
else
{
jQuery(".hideBest").hide();
}
if (mycustommainsettings.best_user == '' || mycustommainsettings.best_password == '')
{
if(jQuery("#spin_text option:selected").val() === 'best')
{
jQuery("#bestspin").show();
}
else
{
jQuery("#bestspin").hide();
}
if(jQuery("#spin_text option:selected").val() === 'wordai')
{
jQuery("#wordai").show();
}
else
{
jQuery("#wordai").hide();
}
if(jQuery("#spin_text option:selected").val() === 'spinrewriter')
{
jQuery("#spinrewriter").show();
}
else
{
jQuery("#spinrewriter").hide();
}
}
else
{
if(initial == '')
{
initial = jQuery("#spin_text option:selected").val();
}
if(initial != '' && initial != jQuery("#spin_text option:selected").val())
{
if(jQuery("#spin_text option:selected").val() === 'best')
{
jQuery("#bestspin").show();
}
else
{
jQuery("#bestspin").hide();
}
if(jQuery("#spin_text option:selected").val() === 'wordai')
{
jQuery("#wordai").show();
}
else
{
jQuery("#wordai").hide();
}
if(jQuery("#spin_text option:selected").val() === 'spinrewriter')
{
jQuery("#spinrewriter").show();
}
else
{
jQuery("#spinrewriter").hide();
}
}
else
{
jQuery("#spinrewriter").hide();
jQuery("#wordai").hide();
jQuery("#bestspin").hide();
}
}
if(jQuery('#send_email').is(":checked"))
{
jQuery(".hideMail").show();
}
else
{
jQuery(".hideMail").hide();
}
if(jQuery('#enable_logging').is(":checked"))
{
jQuery(".hideLog").show();
}
else
{
jQuery(".hideLog").hide();
}
if(jQuery('#links_hide').is(":checked"))
{
jQuery(".hideGoo").show();
}
else
{
jQuery(".hideGoo").hide();
}
}
window.onload = mainChanged;
jQuery(document).ready(function(){
jQuery('span.wpums-delete').on('click', function(){
var confirm_delete = confirm('Delete This Rule?');
if (confirm_delete) {
jQuery(this).parent().parent().remove();
jQuery('#myForm').submit();
}
});
var plugin_slug = mycustommainsettings.plugin_slug;
jQuery('#' + plugin_slug + '_register').on('click', function()
{
var ajaxurl = mycustommainsettings.ajaxurl;
var nonce = jQuery('#' + plugin_slug + '_activation_nonce').val();
var code = jQuery('#' + plugin_slug + '_register_code').val();
if(code == '')
{
alert('You need to enter a purchase code for the activation to work.');
}
else
{
var thisbut = jQuery(this);
umsLoading(thisbut);
var data = {
action: 'ums_activation',
code: code,
nonce: nonce
};
jQuery.post(ajaxurl, data, function(response) {
umsRmLoading(thisbut);
if(response.trim() == 'ok')
{
location.reload();
}
else
{
alert('Error in registration process: ' + response);
}
}).fail( function(xhr)
{
umsRmLoading(thisbut);
alert('Exception in registration process: ' + xhr.statusText);
});
}
});
jQuery('#' + plugin_slug + '_revoke_license').on('click', function()
{
var confirm_delete = confirm('Are you sure you want to revoke your license?');
if (confirm_delete)
{
var ajaxurl = mycustommainsettings.ajaxurl;
var nonce = jQuery('#' + plugin_slug + '_activation_nonce').val();
var thisbut = jQuery(this);
umsLoading(thisbut);
var data = {
action: 'ums_revoke',
nonce: nonce
};
jQuery.post(ajaxurl, data, function(response) {
umsRmLoading(thisbut);
if(response.trim() == 'ok')
{
location.reload();
}
else
{
alert('Error in revoking process: ' + response);
}
}).fail( function(xhr)
{
umsRmLoading(thisbut);
alert('Exception in revoking process: ' + xhr.statusText);
});
}
});
});
var unsaved = false;
jQuery(document).ready(function () {
jQuery(":input").change(function(){
if (this.id != 'PreventChromeAutocomplete' && this.className != 'sc_chat_form_field_prompt_text')
unsaved = true;
});
function unloadPage(){
if(unsaved){
return "You have unsaved changes on this page. Do you want to leave this page and discard your changes or stay on this page?";
}
}
window.onbeforeunload = unloadPage;
});
function revealRec(){document.getElementById("diviIdrec").innerHTML = '<br/>We recommend that you check <b><a href="https://www.elegantthemes.com/affiliates/idevaffiliate.php?id=50837_5_1_16" target="_blank">Divi theme</a></b>, by <b><a href="https://www.elegantthemes.com/affiliates/idevaffiliate.php?id=50837_1_1_3" target="_blank">ElegantThemes</a></b>! It is easy to configure and it looks gorgeous. Check it out now!<br/><br/><a href="https://www.elegantthemes.com/affiliates/idevaffiliate.php?id=50837_5_1_19" target="_blank" rel="nofollow"><img style="border:0px" src="https://3.bp.blogspot.com/-h9TLQozNO6Q/W92Sk80zwjI/AAAAAAAAAjg/JC8sFWAUPzseR4nnjhVNbRQmCnr1ZMu4gCLcBGAs/s1600/divi.jpg" width="468" height="60" alt="Divi WordPress Theme"></a>';} |