(function( $ ) {
'use strict';
/**
* All of the code for your admin-specific JavaScript source
* should reside in this file.
*
* Note that this assume you're going to use jQuery, so it prepares
* the $ function reference to be used within the scope of this
* function.
*
* From here, you're able to define handlers for when the DOM is
* ready:
*
* $(function() {
*
* });
*
* Or when the window is loaded:
*
* $( window ).load(function() {
*
* });
*
* ...and so on.
*
* Remember that ideally, we should not attach any more than a single DOM-ready or window-load handler
* for any particular page. Though other scripts in WordPress core, other plugins, and other themes may
* be doing this, we should try to minimize doing that in our own work.
*/
var i = 0;
$(document).ready(function(){
jQuery(document).on( 'click', '.aol .notice-dismiss', function() {
jQuery.ajax({
url: ajaxurl,
data: {
action: 'aol_dismiss_notice'
}
})
})
$('.datepicker').datepicker({
minDate: +1,
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true
});
$("#app_form_fields").sortable({
placeholder: "ui-state-highlight",
update: function( event, ui ) {
$('#aol_keys_order_wrapper').empty(); //
$( '#app_form_fields tr' ).each(function(){
var field = $(this).data( "id" );
$('#aol_keys_order_wrapper').append('');
});
}
});
/*Ad Types Settings*/
$('#ad_aol_type').click(function(){
var fieldNameRawSingular=$('#ad_type_singular').val(); // Get Raw value.
var fieldNameRawPlural=$('#ad_type_plural').val(); // Get Raw value.
var fieldNameRawDesc=$('#ad_type_description').val(); // Get Raw value.
var fieldNameSingular = sanitize_me(fieldNameRawSingular);
if(fieldNameSingular != '' && fieldNameRawPlural != ''){
$('#ad_types').append('