-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from dwnload/feature/edd-slm-v2
Updating PHP >= 8.0 - Version 2
- Loading branch information
Showing
16 changed files
with
2,900 additions
and
1,538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea | ||
.DS_Store | ||
vendor | ||
wordpress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,42 @@ | ||
/* global jQuery, ajaxurl, EddLicenseManager */ | ||
(function ($) { | ||
"use strict"; | ||
'use strict' | ||
|
||
$(document).ready(function () { | ||
$('input#EddSoftwareLicenseManagerButton').on('click', function (e) { | ||
e.preventDefault(); | ||
var $this = $(this), | ||
img = 'EddLicenseLoader'; | ||
$(document).ready(function () { | ||
$('a[id^="EddSoftwareLicenseManagerButton"]:not(:disabled)').on('click', function (e) { | ||
e.preventDefault() | ||
const $this = $(this) | ||
const $element = $('input[name$="[' + $this.data('plugin_id') + ']"]') | ||
|
||
$.ajax({ | ||
method: "POST", | ||
url: ajaxurl, | ||
data: { | ||
action: EddLicenseManager.action, | ||
license_key: $('input[name="'+ EddLicenseManager.license_attr +'"]').val(), | ||
nonce: EddLicenseManager.nonce, | ||
plugin_action: $this.prop('name') | ||
}, | ||
beforeSend: function () { | ||
$this.attr('disabled', true); | ||
$('<img class="' + img + '" src="'+ EddLicenseManager.loading + '" height="16" width="16">').insertAfter($this); | ||
}, | ||
success: function (response) { | ||
if (typeof response.success !== 'undefined' && response.success) { | ||
location.reload(true); | ||
} | ||
$this.attr('disabled', false); | ||
$('img[class="'+ img +'"]').remove(); | ||
}, | ||
fail: function () { | ||
window.alert('Unknown Error'); | ||
} | ||
}); | ||
}); | ||
}); | ||
}(jQuery)); | ||
if ($this.attr('disabled') === 'disabled' || $element.val().length === 0) { | ||
return | ||
} | ||
|
||
$.ajax({ | ||
method: 'POST', | ||
url: ajaxurl, | ||
data: { | ||
action: EddLicenseManager.action, | ||
license_key: $element.val(), | ||
nonce: EddLicenseManager.nonce, | ||
plugin_action: $this.data('action'), | ||
plugin_id: $this.data('plugin_id') | ||
}, | ||
beforeSend: function () { | ||
$this.attr('disabled', true) | ||
$('<img class="EddLicenseLoader" src="' + EddLicenseManager.loading + '" height="16" width="16">').insertAfter($this) | ||
}, | ||
success: function (response) { | ||
if (typeof response.success !== 'undefined' && response.success) { | ||
$this.closest('form').submit() | ||
} | ||
$('img[class="EddLicenseLoader"]').remove() | ||
}, | ||
fail: function (response) { | ||
$this.attr('disabled', false) | ||
window.alert(response) | ||
} | ||
}) | ||
}) | ||
}) | ||
}(jQuery)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.