- Timestamp:
- 2003-04-17T10:36:43+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/macros/query.dm
r3775 r4175 321 321 \} 322 322 323 //argfqv += escape(format(document.QueryForm.fqv[0].value)); 323 324 324 325 function updatefqv() \{ … … 326 327 var i; 327 328 argfqv=""; 328 argfqv += escape(format(document.QueryForm.fqv[0].value));329 argfqv += format(document.QueryForm.fqv[0].value); 329 330 for (i=1; i<document.QueryForm.fqv.length;i++) \{ 330 331 argfqv += ","; 331 argfqv += escape(format(document.QueryForm.fqv[i].value));332 argfqv += format(document.QueryForm.fqv[i].value); 332 333 \} 333 334 \} … … 429 430 \} 430 431 432 //argq += escape(document.QueryForm.q.value); 433 431 434 function updateq() \{ 432 435 argq = ""; 433 argq += escape(document.QueryForm.q.value);436 argq += format(document.QueryForm.q.value); 434 437 \} 435 438 … … 440 443 441 444 // convert commas and spaces to plus 445 // also convert other illegal characters to %xx codes 442 446 function format(string) \{ 443 447 var str = "" + string; 444 448 var out = "", flag = 0; 449 var ch = ""; 445 450 var j; 446 451 for (j = 0; j < str.length; j++) \{ 447 if (str.charAt(j) == " "|| str.charAt(j) == ",") \{ 448 if ( flag == 0) \{ 449 out += "+"; 450 flag=1; 451 \} 452 ch=str.charAt(j); 453 if (ch == " "|| ch == ",") \{ 454 if ( flag == 0) \{ 455 out += "+"; 456 flag=1; 457 \} 458 continue; 452 459 \} 453 else \{ 454 out += str.charAt(j); 455 flag=0; 456 \} 460 if (ch == ";" || ch == ":" || ch == "/" || ch == "?" || 461 ch == "@" || ch == "&" || ch == "=" || ch == "#") \{ 462 out += escape(ch); 463 flag=0; 464 continue; 465 \} 466 out += str.charAt(j); 467 flag=0; 457 468 \} 458 469 return out;
Note:
See TracChangeset
for help on using the changeset viewer.