/* adds the username to the date/time line */ window.setTimeout(function() { setDateTimeDetails(); }, 500); function getURLParameter(sParam) { var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) { return sParameterName[1]; } } } function setDateTimeDetails() { if (typeof (jQuery) === 'undefined' || jQuery('#isharemaps-print-date').text() === '') { window.setTimeout(function() { setDateTimeDetails(); }, 500); return; }; var span = jQuery('#isharemaps-print-date'); var user = Astun.JS.getAuthenticatedUser().name; var mapsource = getURLParameter('mapSource'); var isPdf = getURLParameter('isPdfRequest'); if (isPdf && isPdf === 'true' && mapsource && mapsource.indexOf('@') > -1) { var parts = mapsource.split('@'); user = parts[0]; } // bit of sanity checking if (typeof (span) === 'undefined' || !span || span.length === 0 || typeof (user) === 'undefined' || !user) return; span.text(span.text() + ' by ' + user); }