|
|
|
|
|
|
|
|
jQuery(document).ready(function () { |
|
|
jQuery(document).ready(function () { |
|
|
|
|
|
|
|
|
initLcCkEditor(); |
|
|
initLcCkEditor(); |
|
|
initCkFinder(); |
|
|
|
|
|
//generateNotice('error', 'Ceci est une notice'); |
|
|
//generateNotice('error', 'Ceci est une notice'); |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
function checkForm(){ |
|
|
function checkForm(){ |
|
|
$('form').addClass('form-sent'); |
|
|
$('form').addClass('form-sent'); |
|
|
//Panel vues js |
|
|
//Panel vues js |
|
|
if($('form').find('.panel').length){ |
|
|
if($('form').find('.panel').length){ |
|
|
log('here'); |
|
|
|
|
|
|
|
|
|
|
|
$('form').find('.panel').each(function(i, panel){ |
|
|
$('form').find('.panel').each(function(i, panel){ |
|
|
log(i); |
|
|
|
|
|
log($(panel).find(':invalid').length); |
|
|
|
|
|
if($(panel).find(':invalid').length){ |
|
|
if($(panel).find(':invalid').length){ |
|
|
$('#nav-params').find('.nav-item:eq('+i+')').addClass('has-invalid'); |
|
|
$('#nav-params').find('.nav-item:eq('+i+')').addClass('has-invalid'); |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function initCkFinder(){ |
|
|
|
|
|
|
|
|
|
|
|
$('.lc-ckfinder-wrap').each(function(){ |
|
|
|
|
|
$widget = $(this); |
|
|
|
|
|
|
|
|
|
|
|
if($widget.find('.lc-ckfinder-field').val() !== ''){ |
|
|
|
|
|
$widget.find('.lc-ckfinder-illu').css('background-image', "url('"+$widget.find('.lc-ckfinder-field').val()+"')"); |
|
|
|
|
|
$widget.find('.lc-ckfinder-remove').show(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$widget.find('.lc-ckfinder-button').on( 'click', function( e ) { |
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
CKFinder.popup( { |
|
|
|
|
|
chooseFiles: true, |
|
|
|
|
|
onInit: function( finder ) { |
|
|
|
|
|
finder.on( 'files:choose', function( evt ) { |
|
|
|
|
|
var file = evt.data.files.first(); |
|
|
|
|
|
$widget.find('.lc-ckfinder-illu').css('background-image', "url('"+file.getUrl()+"')"); |
|
|
|
|
|
$widget.find('.lc-ckfinder-remove').show(); |
|
|
|
|
|
$widget.find('.lc-ckfinder-field').val(file.getUrl()); |
|
|
|
|
|
} ); |
|
|
|
|
|
finder.on( 'file:choose:resizedImage', function( evt ) { |
|
|
|
|
|
var output = document.getElementById( '{{ id }}' ); |
|
|
|
|
|
output.value = evt.data.resizedUrl; |
|
|
|
|
|
} ); |
|
|
|
|
|
} |
|
|
|
|
|
} ); |
|
|
|
|
|
} ); |
|
|
|
|
|
$widget.find('.lc-ckfinder-remove').on('click', function () { |
|
|
|
|
|
$widget.find('.lc-ckfinder-remove').hide(); |
|
|
|
|
|
$widget.find('.lc-ckfinder-illu').css('background-image', 'none'); |
|
|
|
|
|
$widget.find('.lc-ckfinder-field').val(""); |
|
|
|
|
|
}) |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if ($('.field-ckfinder_file_chooser').length > 0) { |
|
|
|
|
|
CKFinder.config({connectorPath: '/ckfinder/connector'}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* CKEditor */ |
|
|
/* CKEditor */ |
|
|
|
|
|
|
|
|
function initLcCkEditor(){ |
|
|
function initLcCkEditor(){ |
|
|
|
|
|
|
|
|
], |
|
|
], |
|
|
"language": "fr" |
|
|
"language": "fr" |
|
|
}); |
|
|
}); |
|
|
CKFinder.setupCKEditor(editor); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |