Changeset 28223

Show
Ignore:
Timestamp:
05.09.2013 13:47:41 (6 years ago)
Author:
kjdon
Message:

tidying up advanced form stem/case/accent boxes. added in boxes and javascript for accentfolding tick boxes. Made all three dependent on ks/ss/afs support args for display - if the collection doesn't provide stemming for example, then we don't want any stemming checkboxes

Location:
main/trunk/greenstone2/macros
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/macros/english.dm

    r27297 r28223  
    422422 
    423423#these go together in form search: 
    424 #"Words  (fold, stem)  ... in field" 
     424#"Words  fold case fold accents stem  ... in field" 
    425425_textwordphrase_ {Words} 
    426426_textinfield_ {... in field} 
    427427_textfieldphrase_ {Field} 
    428428_textinwords_ {... in word(s)} 
    429 _textfoldstem_ {(fold, stem)} 
     429_textformcasefold_ {fold case} 
     430_textformaccentfold_ {fold accents} 
     431_textformstem_ {stem} 
    430432 
    431433_textadvquery_ {Or enter a query directly:} 
  • main/trunk/greenstone2/macros/query.dm

    r27059 r28223  
    9191  args = "&fqa=0&fqv="+argfqv+"&fqf="+argfqf; 
    9292  _If_(_cgiargb_, 
    93      args += "&fqk="+argfqk+"&fqs="+argfqs+"&fqc="+argfqc; 
     93     args += "&fqk="+argfqk+"&fqs="+argfqs+"&fqc="+argfqc+"&fqaf="+argfqaf; 
    9494  ) 
    9595  _If_("_cgiarga_" eq "sqlq",args += "&sqlfqf="+argsqlfqf + "&sqlfqc="+argsqlfqc;) 
     
    102102function getqueryargs () \{ 
    103103  var args =  "&fqa=1"+"&q="+argq+"&fqv="+argfqv+"&fqf="+argfqf+ 
    104      "&fqk="+argfqk+"&fqs="+argfqs+"&fqc="+argfqc; 
     104     "&fqk="+argfqk+"&fqs="+argfqs+"&fqc="+argfqc+"&fqaf="+argfqaf; 
    105105 _If_("_cgiarga_" eq "sqlq",args += "&sqlfqf="+argsqlfqf + "&sqlfqc="+argsqlfqc;) 
    106106 return args; 
     
    211211argfqk="_cgiargfqk_"; 
    212212argfqs="_cgiargfqs_"; 
     213argfqaf="_cgiargfqaf_"; 
    213214argfqc="_cgiargfqc_"; 
    214215_If_("_cgiarga_" eq "sqlq", 
     
    224225   if (document.QueryForm.fqs != null) \{initfqs(); \} 
    225226   if (document.QueryForm.fqk != null) \{initfqk(); \} 
     227   if (document.QueryForm.fqaf != null) \{initfqaf(); \} 
    226228   if (document.QueryForm.fqc != null) \{initfqc(); \} 
    227229_If_("_cgiarga_" eq "sqlq", 
     
    556558\} 
    557559 
    558 // kqk - the casefolding checkboxes 
     560// fqk - the casefolding checkboxes 
    559561function initfqk() \{ 
    560562   var i; 
     
    595597   \} 
    596598   updatefqk(); 
     599\} 
     600 
     601// fqaf - the casefolding checkboxes 
     602function initfqaf() \{ 
     603   var i; 
     604   fqaf = argfqaf.split(","); 
     605   for (i=0; i<fqaf.length; i++) \{ 
     606       if (fqaf[i]=="1") \{ 
     607      document.QueryForm.fqaf[i].checked = true; 
     608       \} 
     609   \} 
     610   updatefqaf(); 
     611 
     612\} 
     613 
     614 
     615function updatefqaf() \{ 
     616   argfqaf=""; 
     617   if (document.QueryForm.fqaf[0].checked) \{ 
     618      argfqaf += "1"; 
     619   \} 
     620   else \{ 
     621      argfqaf += "0";    
     622   \} 
     623   var i; 
     624   for (i=1; i<document.QueryForm.fqaf.length; i++) \{ 
     625       if (document.QueryForm.fqaf[i].checked) \{ 
     626      argfqaf += ",1"; 
     627    \} 
     628    else \{ 
     629      argfqaf += ",0"; 
     630    \} 
     631   \} 
     632\} 
     633 
     634function clearfqaf() \{ 
     635   var i; 
     636   for (i=0; i<document.QueryForm.fqaf.length; i++) \{ 
     637       document.QueryForm.fqaf[i].checked = false; 
     638   \} 
     639   updatefqaf(); 
    597640\} 
    598641 
     
    688731      if (document.QueryForm.fqk != null) \{clearfqk();\} 
    689732      if (document.QueryForm.fqs != null) \{clearfqs();\} 
     733      if (document.QueryForm.fqaf != null) \{clearfqaf();\} 
    690734      if (document.QueryForm.fqc != null) \{clearfqc();\} 
    691735_If_("_cgiarga_" eq "sqlq", 
     
    894938} 
    895939 
    896  
    897  
     940_stemcaseheader_ { 
     941_If_("_cgiargct_" eq "1",_If_("_cgiargks_" eq "1",<th align="center" style="font-size:smaller;">_textformcasefold_</th>) 
     942_If_("_cgiargafs_" eq "1",<th align="center" style="font-size:smaller;">_textformaccentfold_</th>)_If_("_cgiargss_" eq "1",<th align="center" style="font-size:smaller;">_textformstem_</th>) 
     943 
     944} 
    898945_advancedforms_{ 
    899946<table border="0" cellspacing="0" cellpadding="0" width="90%"> 
    900 <tr><th></th><th align="left">_textwordphrase_</th>_If_("_cgiargct_" eq "1",<th colspan="2"><nobr>_textfoldstem_</nobr></th>)<th align="center">&nbsp;&nbsp;_textinfield_</th></tr>  
     947<tr><th></th><th align="left">_textwordphrase_</th>_stemcaseheader_<th align="center">&nbsp;&nbsp;_textinfield_</th></tr>    
    901948_advformlist_ 
    902949<tr> 
     
    9821029# 
    9831030 
     1031_stemcaseboxes_ { 
     1032_If_("_cgiargks_" eq "1",<td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td>) 
     1033_If_("_cgiargafs_" eq "1",<td align="center"><input type="checkbox" name="fqaf" onClick="updatefqaf();"></td>) 
     1034_If_("_cgiargss_" eq "1",<td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>) 
     1035} 
    9841036_regformelement_{ 
    9851037<tr><td><input type="text" size="39" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td> 
     
    9891041_firstadvformelement_{ 
    9901042<tr><td></td><td><input type="text" size="31" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td> 
    991 _If_("_cgiargct_" eq "1",<td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td> 
    992 <td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>) 
     1043_stemcaseboxes_ 
    9931044<td align="right">_fqfselection_</td></tr>} 
    9941045 
     
    9961047<tr><td>_fqcselection_</td> 
    9971048<td><input type="text" size="31" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td> 
    998 _If_("_cgiargct_" eq "1",<td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td> 
    999 <td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>) 
     1049_stemcaseboxes_ 
    10001050<td align="right">_fqfselection_</td></tr>} 
    10011051