46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
jQuery(function($) {
|
|
editer_bien();
|
|
//onAjaxLoad(editer_bien);
|
|
|
|
function editer_bien(){
|
|
// chargement du datepicker
|
|
$('.datepicker').datepicker({
|
|
dateFormat: "dd/mm/yy",
|
|
});
|
|
|
|
// on charge dans le input #tags_save les mots au chargement du formulaire
|
|
if (typeof(T_hastag_ini) !== 'undefined') {
|
|
$('#tags_save').val(JSON.stringify(T_hastag_ini));
|
|
}
|
|
|
|
/* DOC :
|
|
* https://goodies.pixabay.com/jquery/tag-editor/demo.html
|
|
*/
|
|
$('#tags_ouverts').tagEditor({
|
|
autocomplete: {
|
|
delay: 0, // show suggestions immediately
|
|
position: { collision: 'flip' }, // automatic menu position up/down
|
|
source: T_hashtag
|
|
},
|
|
initialTags: T_hastag_ini,
|
|
forceLowercase: false,
|
|
placeholder: 'HashTags',
|
|
onChange: function(field, editor, tags){
|
|
$('#tags_save').val(JSON.stringify(tags));
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
// nb caractères champs SEO
|
|
$('.compter').each( function() {
|
|
var nb = $(this).val().length;
|
|
var id_s = $(this).attr('data-nb');
|
|
$('#' + id_s).html(nb);
|
|
});
|
|
$('.compter').on('keyup', function(e) {
|
|
var nb = $(this).val().length;
|
|
var id_s = $(this).attr('data-nb');
|
|
$('#' + id_s).html(nb);
|
|
});
|
|
});
|