Changeset 12037
- Timestamp:
- 2006-07-06T15:23:14+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cic-hcap/macros/extra.dm
r12036 r12037 1251 1251 if (document.QueryForm.aqv[i].value != "") \{ 1252 1252 var real_index = /aqv([0-9]+)field/.exec(document.QueryForm.aqv[i].id)[1]; 1253 addQueryTerm(document.QueryForm.q, "[" + document.QueryForm.aqv[i].value + "]:" + document.QueryForm.aqi[real_index].value, "&"); 1253 var combiner = "&"; 1254 if (document.QueryForm.aqc[real_index].value == "or") \{ 1255 combiner = "|"; 1256 \} 1257 addQueryTerm(document.QueryForm.q, "[" + document.QueryForm.aqv[i].value + "]:" + document.QueryForm.aqi[real_index].value, combiner); 1254 1258 \} 1255 1259 \} 1256 1260 1261 document.QueryForm.q.value += "("; 1257 1262 addIndexValue(document.QueryForm.q, document.QueryForm.fuq, "FU", "&"); 1258 1263 addIndexValue(document.QueryForm.q, document.QueryForm.tmq, "TM", "&"); … … 1261 1266 addIndexValue(document.QueryForm.q, document.QueryForm.deq, "DE", "&"); 1262 1267 addIndexValue(document.QueryForm.q, document.QueryForm.stq, "ST", "&"); 1268 document.QueryForm.q.value = removeFromEnd(document.QueryForm.q.value, " & "); 1269 document.QueryForm.q.value = removeFromEnd(document.QueryForm.q.value, " | "); 1270 document.QueryForm.q.value += ")"; 1263 1271 1264 1272 // Remove the trailing combiner 1265 if (document.QueryForm.q.value.lastIndexOf('\)') != -1) \{1266 document.QueryForm.q.value = document.QueryForm.q.value.substring(0, document.QueryForm.q.value.lastIndexOf('\)') + 1);1267 \}1273 document.QueryForm.q.value = removeFromEnd(document.QueryForm.q.value, "()"); 1274 document.QueryForm.q.value = removeFromEnd(document.QueryForm.q.value, " & "); 1275 document.QueryForm.q.value = removeFromEnd(document.QueryForm.q.value, " | "); 1268 1276 alert(document.QueryForm.q.value); 1269 1277 \} … … 1288 1296 \} 1289 1297 1298 function removeFromEnd(source_string, offender) 1299 \{ 1300 if (source_string.length < offender.length) \{ 1301 return source_string; 1302 \} 1303 1304 if (source_string.substring(source_string.length - offender.length, source_string.length) != offender) \{ 1305 return source_string; 1306 \} 1307 1308 return source_string.substring(0, source_string.length - offender.length); 1309 \} 1310 1290 1311 function initializereferencessearch() 1291 1312 \{
Note:
See TracChangeset
for help on using the changeset viewer.