Changeset 1922


Ignore:
Timestamp:
2001-02-07T14:10:21+13:00 (23 years ago)
Author:
kjm18
Message:

added javascript functions and macros for mgpp form search prefs. Prefs page
has been revamped.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/macros/pref.dm

    r1856 r1922  
    8484_getargsfunction_ {
    8585function getargs () \{
    86   return argk + args + argm + argo + arghd + argb_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_);
     86  return argk + args + argm + argo + arghd + argb + argqb + argfqn_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_);
    8787\}
    8888}
     
    134134_arghlon_ {arghl = "&hl=1";}
    135135_arghloff_ {arghl = "&hl=0";}
    136 
    137 _arghdblank_ {arghd = "";}
    138 _arghdon_ {arghd = "&hd=1";}
    139 _arghdoff_{arghd = "&hd=0";}
    140136
    141137_pagescriptextra_ {
     
    150146argb = "";
    151147arghd = "";
     148argqb = "";
     149argfqn = "";
     150
    152151_If_(_collectionoption_,_ccsfunctions_,_standardfunctions_)
    153152_If_(_htmloptions_,_htmlfunctions_)
     
    184183\}
    185184
     185function updatefqn () \{
     186  value = document.PrefForm.fqn.options[document.PrefForm.fqn.selectedIndex].value;
     187  if (value != _cgiargfqn_) argfqn = "&fqn=" + value;
     188  else argfqn = "";
     189  updatehrefs();
     190\}
     191
    186192function updateb (value) \{
    187193  if (value != _cgiargb_) argb = "&b=" + value;
     
    190196\}
    191197
    192 function updatehd () \{
    193   if (document.PrefForm.hd.checked)
    194     _If_("_cgiarghd_" eq "1",_arghdblank_,_arghdon_)
    195   else
    196     _If_("_cgiarghd_" ne "1",_arghdblank_,_arghdoff_)
     198function updatehd() \{
     199  arghd="";
     200  if (document.PrefForm.hd[0].checked) \{
     201     if ("_cgiarghd_" != "0") arghd = "&hd=0";
     202  \}
     203  else \{
     204     value = document.PrefForm.hdn[document.PrefForm.hdn.selectedIndex].value;
     205     if (_cgiarghd_ != value) arghd = "&hd="+value;
     206  \}
     207  updatehrefs();
     208\}
     209
     210function updateqb(value) \{
     211  if (value != _cgiargqb_) argqb = "&qb=" + value;
     212  else argqb = "";
    197213  updatehrefs();
    198214\}
     
    212228  location.href = location.href + "&nl=0&nw=" + value + getargs();
    213229\}
    214 }
     230
     231function updateqt () \{
     232  value = document.PrefForm.qt.options[document.PrefForm.qt.selectedIndex].value;
     233  location.href = location.href + "&qt=" + value + getargs();
     234\}
     235}
     236
    215237
    216238#######################################################################
     
    242264_htmloptionson_ {
    243265<p>
    244 _fcoption_
     266<tr><td colspan=2>_fcoption_</td></tr>
    245267<p>
    246 _hloption_
     268<tr><td colspan=2>_hloption_</td></tr>
    247269<p>
    248 _extlinkoption_
     270<tr>_extlinkoption_</tr>
    249271_If_(_PreferenceDocsFromWeb_,<p>
    250 _intlinkoption_)
    251 }
    252 
    253 _caseoption_ {
    254 <input type=radio name=k value=1 onClick="updatek(1);"
    255         _If_(_cgiargk_, checked)>_textignorecase_<br>
    256 <input type=radio name=k value=0 onClick="updatek(0);"
    257         _If_(_cgiargk_,, checked)>_textmatchcase_
    258 }
    259 
    260 _caseoption_ [l=ar] {}
     272<tr>_intlinkoption_</tr>)
     273}
    261274
    262275_fcoption_ {
     
    270283}
    271284
     285#search pref options
     286_boxsizeoption_{
     287<td valign=baseline>_textqueryboxsize_</td>
     288<td><input type=radio name=qb value=0 onClick="updateqb(0);"
     289        _If_(_cgiargqb_,, checked)>_textregbox_<br>
     290<input type=radio name=qb value=1 onClick="updateqb(1);"
     291        _If_(_cgiargqb_, checked)>_textbigbox_</td>
     292}
     293
     294_caseoption_ {
     295<td valign=baseline>_textcasediffs_</td>
     296<td><input type=radio name=k value=1 onClick="updatek(1);"
     297        _If_(_cgiargk_, checked)>_textignorecase_<br>
     298<input type=radio name=k value=0 onClick="updatek(0);"
     299        _If_(_cgiargk_,, checked)>_textmatchcase_</td>
     300}
     301
     302_caseoption_ [l=ar] {}
    272303_caseoption_ [l=zh] {}
    273304
    274305_stemoption_ {
    275 <input type=radio name=s value=1 onClick="updates(1);"
     306<td valign=baseline>_textwordends_</td>
     307<td><input type=radio name=s value=1 onClick="updates(1);"
    276308  _If_(_cgiargs_, checked)>_textstem_<br>
    277309<input type=radio name=s value=0 onClick="updates(0);"
    278   _If_(_cgiargs_,, checked)>_textnostem_
     310  _If_(_cgiargs_,, checked)>_textnostem_</td>
    279311}
    280312
    281313_stemoption_ [l=zh] {}
     314
     315
     316_modeoption_ {
     317<td valign=baseline>_textquerymode_</td>
     318<td><input type=radio name=b value=0 onClick="updateb(0);"
     319        _If_(_cgiargb_,, checked)>_textsimplemode_<br>
     320<input type=radio name=b value=1 onClick="updateb(1);"
     321        _If_(_cgiargb_, checked)>_textadvancedmode_</td>
     322}
     323
     324
     325_searchhistoryop_ {
     326<td valign=baseline>_textsearchhistory_</td>
     327<td><input type=radio name="hd" value=0 onClick="updatehd();"
     328                _If_("_cgiarghd_" eq "0", checked)>_textnohistorydisplay_<br>
     329<input type=radio name="hd" value=1 onClick="updatehd();"
     330        _If_("_cgiarghd_" eq "0",, checked)>_texthistorydisplay_</td>   
     331}
     332
     333_historynumrecords_{<select name="hdn" onChange="updatehd();">
     334    <option value="5"_If_("_cgiarghd_" eq "5", selected)>5
     335    <option value="10"_If_("_cgiarghd_" eq "10", selected)>10
     336    <option value="15"_If_("_cgiarghd_" eq "15", selected)>15
     337    <option value="20"_If_("_cgiarghd_" eq "20", selected)>20
     338</select>}
    282339
    283340_maxdocoption_ {
     
    298355}
    299356
    300 _modeoption_ {
    301 <input type=radio name=b value=0 onClick="updateb(0);"
    302         _If_(_cgiargb_,, checked)>_textsimplemode_<br>
    303 <input type=radio name=b value=1 onClick="updateb(1);"
    304         _If_(_cgiargb_, checked)>_textadvancedmode_
    305 }
    306 
    307 _searchhistoryop_ {
    308 <input type=checkbox name="hd" onClick="updatehd();"
    309                 _If_("_cgiarghd_" eq "1", checked)>_texthistorydisplay_
    310 }
    311 
    312357_extlinkoption_ {
    313 _textextlink_
    314 <select name="el" onChange="updateel();">
     358<td>_textextlink_</td>
     359<td><select name="el" onChange="updateel();">
    315360  <option value="prompt"_If_("_cgiargel_" eq "prompt", selected)>
    316361     _textlinkinterm_
    317362  <option value="direct"_If_("_cgiargel_" eq "direct", selected)>
    318363     _textlinkdirect_
    319 </select>
     364</select></td>
    320365}
    321366
    322367_intlinkoption_ {
    323 _textintlink_
    324 <select name="il" onChange="updateil();">
     368<td>_textintlink_</td>
     369<td><select name="il" onChange="updateil();">
    325370  <option value="l"_If_("_cgiargil_" eq "l", selected)>
    326371     _textdigitlib_
    327372  <option value="w"_If_("_cgiargil_" eq "w", selected)>
    328373     _textweb_
    329 </select>
     374</select></td>
    330375}
    331376
     
    335380
    336381_formatoption_ {
    337 _textformat_
    338 <select name="v" onChange="updatev();">
     382<td>_textformat_</td>
     383<td><select name="v" onChange="updatev();">
    339384  <option value="0"_If_("_cgiargv_" eq "0", selected)>_textgraphical_
    340385  <option value="1"_If_("_cgiargv_" eq "1", selected)>_texttextual_
    341 </select>
     386</select></td>
    342387}
    343388
     
    355400_If_(_collectionoption_,_collectionprefs_)
    356401_presentationprefs_
    357 _searchprefs_
     402_If_("_cgiargct_" eq "1",_mgppsearchprefs_,_mgsearchprefs_)
    358403
    359404</blockquote>
     
    361406}
    362407
    363 _searchprefs_ {
     408#search prefs for mg collections
     409_mgsearchprefs_ {
    364410<h3>_textsearchprefs_</h3>
    365 <p>
    366 _caseoption_
    367 
    368 <p>
    369 _stemoption_
    370 
    371 <p>
    372 _modeoption_
    373 
    374 <p>
    375 _searchhistoryop_
    376 
    377 <p>
    378 _textprefop_
     411<table>
     412<tr>_boxsizeoption_</tr>
     413
     414<tr>_caseoption_</tr>
     415
     416<tr>_stemoption_</tr>
     417
     418<tr>_modeoption_</tr>
     419
     420<tr>_searchhistoryop_</tr>
     421
     422<tr><td colspan=2>_textprefop_</td></tr>
     423</table>
    379424<br>_iconblankbar_
    380425}
     
    388433_presentationprefs_ {
    389434<h3>_textpresentationprefs_</h3>
    390 _htmloptions_
    391 
    392 <p>
    393 _If_(_languageoption_,_textlanguage__languageoption_)
    394 
    395 <p>
    396 _If_(_encodingoption_,_textencoding__encodingoption_)
    397 
    398 <p>
    399 _formatoption_
     435<table>_htmloptions_
     436
     437_If_(_languageoption_,<tr><td>_textlanguage_</td><td>_languageoption_</td></tr>)
     438
     439_If_(_encodingoption_,<tr><td>_textencoding_</td><td>_encodingoption_</td></tr>)
     440
     441<tr>_formatoption_</tr></table>
    400442<br>_iconblankbar_
    401443}
    402444
     445#######################################################
     446## new stuff for prefs for form vs text search - for mgpp collections
     447_mgppsearchprefs_ {
     448<h3>_textsearchprefs_</h3>
     449<table>
     450<tr>_searchtypeop_</tr>
     451
     452_If_(_cgiargqt_,_formsearchoptions_,_textsearchoptions_)
     453
     454<tr>_caseoption_</tr>
     455
     456<tr>_stemoption_</tr>
     457
     458<tr>_searchhistoryop_</tr>
     459
     460<tr><td colspan=2>_textprefop_</td></tr></table>
     461<br>_iconblankbar_
     462}
     463
     464
     465_searchtypeop_ {
     466<td>_texttypesearch_</td>
     467<td><select name="qt" onChange="updateqt();">
     468  <option value="0"_If_("_cgiargqt_" eq "0", selected)>_texttextsearch_
     469  <option value="1"_If_("_cgiargqt_" eq "1", selected)>_textformsearch_
     470</select></td>
     471}
     472
     473_formsearchoptions_ {
     474<tr>_formmodeoption_</tr>
     475}
     476
     477_textsearchoptions_ {
     478<tr>_boxsizeoption_</tr>
     479<tr>_modeoption_</tr>
     480}
     481
     482_formmodeoption_{
     483<td valign=baseline>_textformtype_</td>
     484<td><input type=radio name=b value=0 onClick="updateb(0);"
     485        _If_(_cgiargb_,, checked)>_textsimple_<br>
     486<input type=radio name=b value=1 onClick="updateb(1);"
     487        _If_(_cgiargb_, checked)>_textadvanced_<br>
     488_formnumoption_</td>
     489}
     490
     491_formnumoption_ {_textwith_
     492<select name="fqn" onChange="updatefqn();">
     493  <option value="2"_If_("_cgiargfqn_" eq "2", selected)>2 
     494  <option value="4"_If_("_cgiargfqn_" eq "4", selected)>4
     495  <option value="6"_If_("_cgiargfqn_" eq "6", selected)>6
     496  <option value="8"_If_("_cgiargfqn_" eq "8", selected)>8
     497</select>_textfields_</td>
     498}
     499
     500
    403501#######################################################################
    404502# icons
Note: See TracChangeset for help on using the changeset viewer.