solved: insert this code into the itempost script...
// TITLE REMAINING CHARACTERS
var title_max = <?php echo osc_max_characters_per_title(); ?>;
var check_inputs = $('.add_item .title input');
check_inputs.attr('maxlength', title_max);
check_inputs.after('<div class="title-max-char max-char"></div>');
$('.title-max-char').html(' » máximo: ' + title_max + ' ' + '<?php echo osc_esc_js(__('caracteres...', 'veronika')); ?>');
$('ul.tabbernav li a').live('click', function(){
var title_length = 0;
check_inputs.each(function(){
if( $(this).val().length > title_length ) {
title_length = $(this).val().length;
}
});
var title_remaining = title_max - title_length;
$('.title-max-char').html(' » máximo: ' + title_remaining + ' ' + '<?php echo osc_esc_js(__('caracteres...', 'veronika')); ?>');
$('.title-max-char').removeClass('orange').removeClass('red');
if(title_remaining/title_length <= 0.2 && title_remaining/title_length > 0.1) {
$('.title-max-char').addClass('orange');
} else if (title_remaining/title_length <= 0.1) {
$('.title-max-char').addClass('red');
}
});
check_inputs.keyup(function() {
var title_length = $(this).val().length;
var title_remaining = title_max - title_length;
$('.title-max-char').html('<?php echo osc_esc_js(__(' ...quedan ', 'alpha')); ?>' + title_remaining + ' ' + '<?php echo osc_esc_js(__(' ', 'alpha')); ?>');
$('.title-max-char').removeClass('orange').removeClass('red');
if(title_remaining/title_length <= 0.2 && title_remaining/title_length > 0.1) {
$('.title-max-char').addClass('orange');
} else if (title_remaining/title_length <= 0.1) {
$('.title-max-char').addClass('red');
}
});