-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ReduxFramework/ReduxFrame…
…work * 'master' of https://github.com/ReduxFramework/ReduxFramework: EDD field works # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
- Loading branch information
Showing
3 changed files
with
64 additions
and
59 deletions.
There are no files selected for viewing
103 changes: 50 additions & 53 deletions
103
ReduxCore/extensions/edd/edd_license/field_edd_license.js
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,53 +1,50 @@ | ||
/*global jQuery, document */ | ||
(function($){ | ||
'use strict'; | ||
|
||
$.redux = $.redux || {}; | ||
|
||
$(document).ready(function(){ | ||
$.redux.edd(); | ||
}); | ||
|
||
$.redux.edd = function(){ | ||
|
||
jQuery('.redux-edd-input').change(function() { | ||
jQuery(this).parent().find('.redux-edd-status').val(''); | ||
}); | ||
jQuery( document ).on( "click", ".redux-EDDAction", function(e) { | ||
e.preventDefault(); | ||
var parent = jQuery(this).parents('.redux-container-edd_license:first'); | ||
var id = jQuery(this).attr('data-id'); | ||
|
||
var theData = {}; | ||
parent.find('.redux-edd').each(function() { | ||
theData[jQuery(this).attr('id').replace(id+'-', '')] = jQuery(this).val(); | ||
}); | ||
theData['edd_action'] = jQuery(this).attr('data-edd_action'); | ||
theData['opt_name'] = redux_opts.opt_name; | ||
|
||
jQuery.post( | ||
ajaxurl, { | ||
'action': 'redux_edd_'+redux_opts.opt_name+'_license', | ||
'data': theData | ||
}, | ||
function(response) { | ||
response = jQuery.parseJSON(response); | ||
console.log(response); | ||
jQuery('#'+id+'-status').val(response.status); | ||
jQuery('#'+id+'-status_notice').html(response.status); | ||
if (response.response === "valid") { | ||
//jQuery('#'+id+'-notice').switchClass( "big", "blue", 1000, "easeInOutQuad" ); | ||
jQuery('#'+id+'-notice').attr('class', "redux-info-field redux-success" ); | ||
} else if (response.response === "deactivated") { | ||
jQuery('#'+id+'-notice').attr('class', "redux-info-field redux-warning" ); | ||
} else { // Inactive or bad | ||
|
||
} | ||
|
||
} | ||
); | ||
}); | ||
|
||
} | ||
|
||
})(jQuery); | ||
/*global jQuery, document, redux_opts, ajaxurl */ | ||
(function($) { | ||
'use strict'; | ||
$.redux = $.redux || {}; | ||
$(document).ready(function() { | ||
$.redux.edd(); | ||
}); | ||
$.redux.edd = function() { | ||
jQuery('.redux-edd-input').change(function() { | ||
jQuery(this).parent().find('.redux-edd-status').val(''); | ||
}); | ||
jQuery(document).on("click", ".redux-EDDAction", function(e) { | ||
e.preventDefault(); | ||
var parent = jQuery(this).parents('.redux-container-edd_license:first'); | ||
var id = jQuery(this).attr('data-id'); | ||
var theData = {}; | ||
parent.find('.redux-edd').each(function() { | ||
theData[jQuery(this).attr('id').replace(id + '-', '')] = jQuery(this).val(); | ||
}); | ||
theData.edd_action = jQuery(this).attr('data-edd_action'); | ||
theData.opt_name = redux_opts.opt_name; | ||
jQuery.post( | ||
ajaxurl, { | ||
'action': 'redux_edd_' + redux_opts.opt_name + '_license', | ||
'data': theData | ||
}, function(response) { | ||
response = jQuery.parseJSON(response); | ||
jQuery('#' + id + '-status').val(response.status); | ||
jQuery('#' + id + '-status_notice').html(response.status); | ||
if (response.response === "valid") { | ||
//jQuery('#'+id+'-notice').switchClass( "big", "blue", 1000, "easeInOutQuad" ); | ||
jQuery('#' + id + '-notice').attr('class', "redux-info-field redux-success"); | ||
jQuery('#' + id + '-activate').fadeOut('medium', function() { | ||
jQuery('#' + id + '-deactivate').fadeIn().css("display", "inline-block"); | ||
}); | ||
} else if (response.response === "deactivated") { | ||
jQuery('#' + id + '-notice').attr('class', "redux-info-field redux-warning"); | ||
jQuery('#' + id + '-deactivate').fadeOut('medium', function() { | ||
jQuery('#' + id + '-activate').fadeIn().css("display", "inline-block"); | ||
}); | ||
} else { // Inactive or bad | ||
jQuery('#' + id + '-deactivate').fadeOut('medium', function() { | ||
jQuery('#' + id + '-notice').attr('class', "redux-info-field redux-critical"); | ||
jQuery('#' + id + '-activate').fadeIn().css("display", "inline-block"); | ||
}); | ||
} | ||
}); | ||
}); | ||
}; | ||
})(jQuery); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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