mirror of
https://github.com/KevinMidboe/rohnenedre.git
synced 2025-12-08 20:39:02 +00:00
Initial commit. State 04.2021.
This commit is contained in:
42
wp-content/plugins/wpclef/assets/dist/js/badge.js
vendored
Normal file
42
wp-content/plugins/wpclef/assets/dist/js/badge.js
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
(function($) {
|
||||
return $(document).ready(function() {
|
||||
var $prompt, ajaxData, sending;
|
||||
$prompt = $(".clef-badge-prompt");
|
||||
ajaxData = {
|
||||
action: "clef_badge_prompt"
|
||||
};
|
||||
sending = false;
|
||||
$prompt.find(".add-badge").click(function(e) {
|
||||
var data;
|
||||
e.preventDefault();
|
||||
if (sending) {
|
||||
return;
|
||||
}
|
||||
sending = true;
|
||||
data = {};
|
||||
$prompt.find('input').each(function() {
|
||||
return data[$(this).attr('name')] = $(this).val();
|
||||
});
|
||||
data.enable = 'badge';
|
||||
$.extend(data, ajaxData);
|
||||
$prompt.slideUp();
|
||||
return $.post(ajaxurl, data, (function() {}), "json");
|
||||
});
|
||||
return $prompt.find(".no-badge, .dismiss").click(function(e) {
|
||||
var data;
|
||||
e.preventDefault();
|
||||
if (sending) {
|
||||
return;
|
||||
}
|
||||
sending = true;
|
||||
data = {};
|
||||
$prompt.find('input').each(function() {
|
||||
return data[$(this).attr('name')] = $(this).val();
|
||||
});
|
||||
data.disable = true;
|
||||
$.extend(data, ajaxData);
|
||||
$.post(ajaxurl, data, (function() {}), "json");
|
||||
return $prompt.slideUp();
|
||||
});
|
||||
});
|
||||
}).call(this, jQuery);
|
||||
Reference in New Issue
Block a user