').attr({ type: 'button', id:'add_author_btn', class:"btn btn-default", value:'Add an author'}); jQuery("#authors").after(show_author_btn); /* Add buttons for auto-filling and clearing author lines */ var y=document.querySelectorAll(".author_row"); var row_count = y.length; for (var i1=0;i1').attr({ type: 'button', id:"author_autofill_btn_"+i2, name:"author_autofill_btn_"+i2, class:"link_btn2_def author_autofill_btn", style:"font-weight:bold; margin-bottom:5px; margin-right:15px;", value:"Fill with submitter's personal data"}); jQuery("#autofill_"+i2).after(author_autofill_btn); var author_clear_btn = jQuery('').attr({ type: 'button', id:"author_clear_btn_"+i2, name:"author_clear_btn_"+i2, class:"link_btn2_def author_clear_btn", style:"font-weight:bold; margin-bottom:5px;", value:"Clear the data"}); jQuery("#clear_author_"+i2).after(author_clear_btn); } /* AFFILIATIONS ----------------------------------------- */ /* Begin by hiding all elements with class new_affil */ jQuery(".new_affil").hide(); var old_affil=document.querySelectorAll(".old_affil"); var last_affil_id = old_affil.length; var next_new_affil_id = old_affil.length + 1; var show_affil_btn = jQuery('').attr({ type: 'button', id:'add_affil_btn', class:"btn btn-default", value:'Add an affiliation'}); jQuery("#affils").after(show_affil_btn); /* Add buttons for auto-filling and clearing author lines */ var y0=document.querySelectorAll(".affil_row"); var row_count0 = y0.length; for (var i0=0;i0').attr({ type: 'button', id:"affil_autofill_btn_"+i2, name:"affil_autofill_btn_"+i2, class:"link_btn2_def affil_autofill_btn", style:"margin-bottom:5px; font-weight:bold; margin-right:15px;", value:"Fill with submitter's affiliation data"}); jQuery("#affil_autofill_"+i2).after(affil_autofill_btn); var affil_clear_btn = jQuery('').attr({ type: 'button', id:"affil_clear_btn_"+i2, name:"author_clear_btn_"+i2, class:"link_btn2_def affil_clear_btn", style:" font-weight:bold;margin-bottom:5px; ", value:"Clear the data"}); jQuery("#clear_affil_"+i2).after(affil_clear_btn); } /* AUTHORS ---------------------------- */ jQuery(show_author_btn).click(function() { addAuthor(); }); /* Identify the line after autofil btn was clicked and call the auto fill function */ jQuery(".author_autofill_btn").click(function() { var item_clicked = this.id; var myRe = /author_autofill_btn_([0-9]+)/g; var match = myRe.exec(item_clicked); if (match) { var line_id=match[1]; AuthorAutoFill (line_id); } }); /* Identify the line after autofil btn was clicked and call the auto fill function */ jQuery(".author_clear_btn").click(function() { var item_clicked = this.id; var myRe = /author_clear_btn_([0-9]+)/g; var match = myRe.exec(item_clicked); if (match) { var line_id=match[1]; AuthorClearFields (line_id); } }); /* Given the author line, fill the fields with submitter vals */ function AuthorAutoFill (line_id) { var patt1=/_/; var c = jQuery(".author_row").find("*"); var rowHasData=0; /* var query = jQuery('form').serialize(); */ for (i2=0;i2 0) { x122=jQuery("#122").val(); } /* var email = document.getElementById("106").value; */ } jQuery("#"+item_id).val(submitter_val); } if (x2 == line_id && x1 == 169) { var x3=x1-50; /* affiliation ref */ var submitter_val=jQuery("#119").val(); jQuery("#169_"+line_id).val(submitter_val); } } } } return ; } /* Given the author line, clear the fields */ function AuthorClearFields (line_id) { var patt1=/_/; var c = jQuery(".author_row").find("*"); var rowHasData=0; for (i2=0;i2= row_count) {jQuery("#add_author_btn").hide();} } /* AFFILIATIONS ----------------------------------------- */ jQuery(show_affil_btn).click(function() { addAffil(); }); /* Identify the line after autofil btn was clicked and call the auto fill function */ jQuery(".affil_autofill_btn").click(function() { var item_clicked = this.id; var myRe = /affil_autofill_btn_([0-9]+)/g; var match = myRe.exec(item_clicked); if (match) { var line_id=match[1]; AffilAutoFill (line_id); } }); /* Identify the line after autofil btn was clicked and call the auto fill function */ jQuery(".affil_clear_btn").click(function() { var item_clicked = this.id; var myRe = /affil_clear_btn_([0-9]+)/g; var match = myRe.exec(item_clicked); if (match) { var line_id=match[1]; AffilClearFields (line_id); } }); /* Given the affiliation line, clear the fields */ function AffilClearFields (line_id) { var patt1=/_/; var c = jQuery(".affil_row").find("*"); /* var rowHasData=0; */ for (i2=0;i2= row_count) {jQuery("#add_affil_btn").hide();} } /* jQuery.fn.hideOptionGroup = function() { jQuery(this).hide(); jQuery(this).children().each(function(){ jQuery(this).attr("disabled", "disabled").removeAttr("selected"); }); jQuery(this).appendTo(jQuery(this).parent()); } jQuery.fn.showOptionGroup = function() { jQuery(this).show(); jQuery(this).children().each(function(){ jQuery(this).removeAttr("disabled" ); }); jQuery(this).prependTo(jQuery(this).parent()); jQuery(this).parent().animate({scrollTop:0},0); } */ }); function topic_opt (id, label) { this.id = id; this.label = label; } function track_opt (opt_id, opt_label, topic_options) { this.id = opt_id; this.label = opt_label; this.topic_options = topic_options; } jQuery(document).ready(function() { /* Begin by hiding all elements with class hide_show */ jQuery(".hide_show").hide(); /* Button to display an initially hidden item */ /* Iterate thru all elements with class hide_show, get their id, extract the paper id, create a button and show it. */ jQuery( ".hide_show" ).each(function( index ) { var item_id = jQuery(this).attr('id'); var myRegexp = /_(\d+)/g; var match = myRegexp.exec(item_id); var id1=match[1]; var show_btn = jQuery('').attr({ type: 'button', id:'hide_show_'+id1, value:'Display', class:'link_btn2_def'}); jQuery(this).before(show_btn); jQuery(show_btn).click(function() { jQuery("#"+item_id).toggle(); if (jQuery(show_btn).attr('value') == 'Display') {jQuery(this).attr({'value':'Hide'});} else {jQuery(this).attr({'value':'Display'}); } }); }); }); /* ------ automatically select the empty option if a multiselect is emptied -------- */ function count_options(select) { var options = getSelectValues(select); if (options.length == 0) { var option = document.createElement("option"); option.value = "0"; option.text = " "; select.add(option); options = getSelectValues(select); document.getElementById(select.id).value = "0"; } } /* ------ get a list of options of a selection -------- */ function getSelectValues(select) { var result = []; var options = select && select.options; var opt; for (var i=0, iLen=options.length; i 0) { for (var i = 0; i < scrollies.length; i++) {scrollies[i].value = 0;} } let x = document.getElementById(scrolly_id); if (typeof x != undefined) {document.getElementById(scrolly_id).value=scrollTop;} return scrollTop; } function get_stored_scroll_y(id) { var scrolly_id = 'scrolly_' + id; var scroll_pos=0; if (document.getElementById(scrolly_id)) { scroll_pos=document.getElementById(scrolly_id).value; } else { var scrollies = document.getElementsByName('scrolly'); for (var i = 0; i < scrollies.length; i++) { if (scrollies[i].value > 0) { scroll_pos=scrollies[i].value; i1=i; break; } } } return scroll_pos; } function set_scroll_y() { var i1=0; if (document.getElementsByName('scroll_to_top')) { var scroll_to_topies = document.getElementsByName('scroll_to_top'); for (var i = 0; i < scroll_to_topies.length; i++) { if (scroll_to_topies[i].value > 0) { scroll_to_topies[i].value=0; window.scrollTo(0, 0); return; } } } var scroll_pos=0; if (document.getElementsByName('scrolly')) { var scrollies = document.getElementsByName('scrolly'); for (var i = 0; i < scrollies.length; i++) { if (scrollies[i].value > 0) { scroll_pos=scrollies[i].value; window.scrollTo(0, scroll_pos); return ; } } } /*console.log('scroll_pos ' + scroll_pos);*/ return scroll_pos; } function set_prev_scroll_y(id) { var scroll_to_top_id = 'scroll_to_top_' + id; if (document.getElementById(scroll_to_top_id)) {document.getElementById(scroll_to_top_id).value = 1;} return; } window.addEventListener("load", function(event) { set_scroll_y(); });
Academy of International Business – UK and Ireland chapter 2021 •