From the list: Build ✔ Staff - if no extension, don't display "x" Veronica A. added this on Mar 29, 2019 Completed Mar 29, 2019 by Kyle S. Assigned to Kyle S. Notes https://stjpiiparish.diocesanweb.org/staff/ image.png 99.2 KB • Download image.png 27.4 KB • Download Comments & Events Kyle Sullivan, Web Development I rewrote staff.js to fix this issue. Here's the nuts and bolts of it.jQuery(document).ready(function($) { $('.staff-member-listing .tel-link').each(function(){ let phone = $(this).text(); let ph = phone.replace(/\D/g, ''); if(ph != ''){ let link = 'tel:+1-' + ph.substring(0, 3) + '-' + ph.substring(3, 6) + '-' + ph.substring(6, 10); phone = '(' + ph.substring(0, 3) + ') ' + ph.substring(3, 6) + '-' + ph.substring(6, 10); if( ph.length > 10 ){ link += ';' + ph.substring(10, ); phone += ' x ' + ph.substring(10, ); } $(this).html('<a href="' + link + '">' + phone + '</a>'); } }); }); Mar 29, 2019 at 7:53 PM Notified 1 person Kyle Sullivan completed this to-do. Mar 29, 2019 at 7:53 PM
Kyle Sullivan, Web Development I rewrote staff.js to fix this issue. Here's the nuts and bolts of it.jQuery(document).ready(function($) { $('.staff-member-listing .tel-link').each(function(){ let phone = $(this).text(); let ph = phone.replace(/\D/g, ''); if(ph != ''){ let link = 'tel:+1-' + ph.substring(0, 3) + '-' + ph.substring(3, 6) + '-' + ph.substring(6, 10); phone = '(' + ph.substring(0, 3) + ') ' + ph.substring(3, 6) + '-' + ph.substring(6, 10); if( ph.length > 10 ){ link += ';' + ph.substring(10, ); phone += ' x ' + ph.substring(10, ); } $(this).html('<a href="' + link + '">' + phone + '</a>'); } }); }); Mar 29, 2019 at 7:53 PM Notified 1 person
jQuery(document).ready(function($) { $('.staff-member-listing .tel-link').each(function(){ let phone = $(this).text(); let ph = phone.replace(/\D/g, ''); if(ph != ''){ let link = 'tel:+1-' + ph.substring(0, 3) + '-' + ph.substring(3, 6) + '-' + ph.substring(6, 10); phone = '(' + ph.substring(0, 3) + ') ' + ph.substring(3, 6) + '-' + ph.substring(6, 10); if( ph.length > 10 ){ link += ';' + ph.substring(10, ); phone += ' x ' + ph.substring(10, ); } $(this).html('<a href="' + link + '">' + phone + '</a>'); } }); });