// Used to catch uploaded file name and show it name in a paragraph
var fileName = '';

$('input[type="file"]').change(function(e){
  fileName = e.target.files[0].name;
  document.getElementById('document-name').innerHTML = fileName;
});
//

// Used to display abstract of all informations typed in core form
function showAbstract() {
  var co_author_name = $("input[name='co_author_name[]']").map(function(){return $(this).val();}).get();
  var co_author_email = $("input[name='co_author_email[]']").map(function(){return $(this).val();}).get();
  var co_author_phone = $("input[name='co_author_phone[]']").map(function(){return $(this).val();}).get();
  var co_author_company = $("input[name='co_author_company[]']").map(function(){return $(this).val();}).get();
  var title = document.getElementById('title').value;
  var abstract = CKEDITOR.instances.abstract.getData();
  var keywords = $("input[name='keywords[]']").map(function(){return $(this).val();}).get();

  document.getElementById('check-title').innerHTML = title;
  document.getElementById('check-abstract').innerHTML = abstract;
  document.getElementById('check-keywords').innerHTML = keywords;
  document.getElementById('check-co-author-name').innerHTML = co_author_name;
  document.getElementById('check-co-author-email').innerHTML = co_author_email;
  document.getElementById('check-co-author-phone').innerHTML = co_author_phone;
  document.getElementById('check-co-author-company').innerHTML = co_author_company;
  document.getElementById('check-document').innerHTML = fileName;
}
// 