1jQuery( document ).ready( function( $ ) { 2 // Check when the #pmprogroupacct_apply_group_code button is clicked. 3 $( '#pmprogroupacct_apply_group_code' ).click( function() { 4 // Get the group code. 5 var group_code = $( '#pmprogroupacct_group_code' ).val(); 6 7 // If the group code is empty, do nothing. 8 if ( group_code == '' ) { 9 return; 10 } 11 12 // Get the current URL. 13 var url = window.location.href; 14 15 // Add the group code to the URL. 16 if ( url.indexOf( 'pmprogroupacct_group_code=' ) > 0 ) { 17 // If the URL already has a group code, replace it with the new group code. 18 url = url.replace( /pmprogroupacct_group_code=[^&]+/, 'pmprogroupacct_group_code=' + group_code ); 19 } else if ( url.indexOf( '?' ) > 0 ) { 20 // If the URL already has a query string, append the group code to it. 21 url += '&pmprogroupacct_group_code=' + group_code; 22 } else { 23 // If the URL does not have a query string, add one with the group code. 24 url += '?pmprogroupacct_group_code=' + group_code; 25 } 26 27 // Redirect to the new URL. 28 window.location.replace( url ); 29 } ); 30} );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.