/**
* Settings UI JavaScript
*
* @summary Settings JavaScript / jQuery for UI design and conditional logic.
*
* @since 0.4.0
* @package APL_Admin
* @requires jQuery
* @requires jQuery UI
* @requires jQuery UI Multiselect
*
*/
( function($) {
var trans = apl_settings_ui_local.trans;
apl_init_tooltips();
/**
* Initialize Tooltips
*
* @since 0.4.0
*
* @returns {undefined}
*/
function apl_init_tooltips() {
$( '.apl-tooltip' ).tooltip({
// content: function( callback ) {
// //callback( $( this ).prop('title').replace( '(
)', '
' ) );
// }
content: function( callback ) {
callback( $( this ).prop( 'title' ) );
}
});
}
/**
* WordPress MetaBox Workaround (toggle)
*/
$('.if-js-closed').removeClass('if-js-closed').addClass('closed');
postboxes.add_postbox_toggles( 'apl_post_list_page_apl_settings' );
/**
* Event lister for Invalid Characters
*
* @since 0.4.0
*/
$( '#apl_export' ).change( function( event ) {
console.log( 'Filename change().' );
var fileName = $( this ).val();
var iChars = "<>:\"/\\|,?*";
for ( var i = 0; i < fileName.length; i++ ) {
if ( iChars.indexOf( fileName.charAt(i) ) != -1) {
apl_alert( '
' + trans.fileName_char_alert_message1 + '
' + trans.fileName_char_alert_message2 + '