@@ -17,11 +17,13 @@ const operations = [
1717 { value : "isBoolean" , label : "Is Boolean" } ,
1818 { value : "isCountry" , label : "Is Country" } ,
1919 { value : "isValidStateCode" , label : "Is Valid State Code" } ,
20+ { value : "isLatLong" , label : "Is Latitude/Longitude" } ,
2021] ;
2122
2223async function getResponse ( ) {
2324 const inputString = document . querySelector ( "#inputString" ) ?. value ;
2425 const endpoint = document . querySelector ( "#selectedOperation" ) ?. value ;
26+ const checkDMS = document . querySelector ( "#checkDMS" ) ?. checked ;
2527
2628 if ( ! endpoint ) {
2729 alert ( "Please select an operation first" ) ;
@@ -31,12 +33,16 @@ async function getResponse() {
3133 // Use window.location.origin to get the base URL
3234 const baseUrl = window . location . origin ;
3335
36+ let requestBody = { inputString } ;
37+
38+ if ( endpoint === "isLatLong" ) {
39+ requestBody . checkDMS = checkDMS ;
40+ }
41+
3442 try {
3543 const response = await fetch ( `${ baseUrl } /api/${ endpoint } ` , {
3644 method : "POST" ,
37- body : JSON . stringify ( {
38- inputString : inputString ,
39- } ) ,
45+ body : JSON . stringify ( requestBody ) ,
4046 headers : {
4147 "Content-Type" : "application/json" ,
4248 } ,
@@ -119,13 +125,17 @@ function clearSelection() {
119125 const selectedOperation = document . querySelector ( "#selectedOperation" ) ;
120126 const clearIcon = document . querySelector ( "#clearSearch" ) ;
121127 const dropdownIcon = document . querySelector ( "#dropdownToggle" ) ;
128+ const checkDMSContainer = document . querySelector ( "#checkDMSContainer" ) ;
129+ const checkDMS = document . querySelector ( "#checkDMS" ) ;
122130
123131 searchInput . value = "" ;
124132 renderOperations ( operations ) ;
125133 selectedOperation . value = "" ;
126134 searchResults . style . display = "block" ;
127135 clearIcon . style . display = "none" ;
128136 dropdownIcon . textContent = "▲" ;
137+ checkDMSContainer . style . display = "none" ;
138+ checkDMS . checked = false ;
129139}
130140
131141function selectOperation ( operation ) {
@@ -140,6 +150,13 @@ function selectOperation(operation) {
140150 searchResults . style . display = "none" ;
141151 clearIcon . style . display = "block" ;
142152 dropdownIcon . textContent = "▼" ;
153+
154+ if ( operation . value === "isLatLong" ) {
155+ checkDMSContainer . style . display = "block" ;
156+ } else {
157+ checkDMSContainer . style . display = "none" ;
158+ document . querySelector ( "#checkDMS" ) . checked = false ;
159+ }
143160}
144161
145162document . addEventListener ( "click" , ( e ) => {
0 commit comments