Ignore:
Timestamp:
1999-06-16T14:22:05+12:00 (25 years ago)
Author:
sjboddie
Message:

lots of changes to all macro files

File:
1 edited

Legend:

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

    r180 r276  
    11package preferences
     2
     3
     4#######################################################################
     5# scripts
     6# note that changing either the "m" or the "o" argument
     7# from the preferences page necessitates reseting the "r"
     8# argument to 1
     9#######################################################################
     10
     11_pagescriptextra_ {
     12// preferences scripts generated from \_preferences:pagescriptextra\_
     13
     14    savedhrefs = new Object();
     15
     16    k\_arg = "";
     17    s\_arg = "";       
     18    m\_arg = "";
     19    o\_arg = "";
     20
     21    function initialize () \{
     22        for (i = 0; i < document.links.length; i++)
     23            savedhrefs[i] = document.links[i].href;
     24    \}
     25
     26    function update\_hrefs () \{
     27        for (i = 0; i < document.links.length; i++)
     28            document.links[i].href = savedhrefs[i] + k\_arg + s\_arg + m\_arg + o\_arg;
     29    \}
     30
     31    function k\_update (value) \{
     32        if (value != _cgiargk_) k\_arg = "&k=" + value;
     33        else k\_arg = "";
     34        update\_hrefs();
     35    \}
     36
     37    function s\_update (value) \{
     38        if (value != _cgiargs_) s\_arg = "&s=" + value;
     39        else s\_arg = "";
     40        update\_hrefs();
     41    \}
     42
     43    function m\_update () \{
     44        value = document.PrefForm.m.options[document.PrefForm.m.selectedIndex].value;
     45        if (value != _cgiargm_) m\_arg = "&r=1&m=" + value;
     46        else m\_arg = "";
     47        update\_hrefs();
     48    \}
     49
     50    function o\_update () \{
     51        value = document.PrefForm.o.options[document.PrefForm.o.selectedIndex].value;
     52        if (value != _cgiargo_) o\_arg = "&r=1&o=" + value;
     53        else o\_arg = "";
     54        update\_hrefs();
     55    \}
     56
     57    function l\_update () \{
     58        value = document.PrefForm.l.options[document.PrefForm.l.selectedIndex].value;
     59        location.href = location.href + k\_arg + s\_arg + m\_arg + o\_arg + "&l=" + value;
     60    \}
     61
     62    function v\_update () \{
     63        value = document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value;
     64        location.href = location.href + k\_arg + s\_arg + m\_arg + o\_arg + "&v=" + value;
     65    \}
     66}
     67
     68#######################################################################
     69# headers
     70# these are overridden so we can put an onLoad event handler
     71# in the <body> tag of this page
     72#######################################################################
     73
     74
     75_header_ {_cgihead_
     76_htmlhead_(background="_httpiconchalk_" onLoad="initialize();")_startspacer__pagebanner_
     77}
     78
     79# this declaration ends up being the same as style=restrict, never mind
     80_header_[version=text] {_cgihead_
     81_htmlhead_(onLoad="initialize();")_pagebanner_
     82}
     83
     84# style=restrict lacks the sidestripe, version links and
     85# language links
     86_header_[style=restrict] {_cgihead_
     87_htmlhead_(onLoad="initialize();")_pagebanner_
     88}
    289
    390
     
    1097
    1198_caseoption_ {
    12 <input type=radio name=k value=1
     99<input type=radio name=k value=1 onClick="k\_update(1);"
    13100        _If_(_cgiargk_, checked)>_textignorecase_<br>
    14 <input type=radio name=k value=0
     101<input type=radio name=k value=0 onClick="k\_update(0);"
    15102        _If_(_cgiargk_,, checked)>_textmatchcase_
    16103}
    17104
    18105_stemoption_ {
    19 <input type=radio name=s value=1
     106<input type=radio name=s value=1 onClick="s\_update(1);"
    20107        _If_(_cgiargs_, checked)>_textstem_<br>
    21 <input type=radio name=s value=0
     108<input type=radio name=s value=0 onClick="s\_update(0);"
    22109        _If_(_cgiargs_,, checked)>_textnostem_
    23110}
    24111
    25112_maxdocoption_ {
    26 <select name="m">
     113<select name="m" onChange="m\_update();">
    27114  <option value="50"_If_("_cgiargm_" eq "50", selected)>50
    28115  <option value="100"_If_("_cgiargm_" eq "100", selected)>100
     
    33120
    34121_hitsperpageoption_ {
    35 <select name="o">
     122<select name="o" onChange="o\_update();">
    36123  <option value="10"_If_("_cgiargo_" eq "10", selected)>10 
    37124  <option value="20"_If_("_cgiargo_" eq "20", selected)>20
     
    42129}
    43130
     131_languageoption_ {
     132_textlanguage_
     133<select name="l" onChange="l\_update();">
     134  <option value="en"_If_("_cgiargl_",, selected)_If_("_cgiargl_" eq "en", selected)>English
     135  <option value="mi"_If_("_cgiargl_" eq "mi", selected)>Maori
     136</select>
     137}
     138
     139_formatoption_ {
     140_textformat_
     141<select name="v" onChange="v\_update();">
     142  <option value="0"_If_("_cgiargv_" eq "0", selected)>Graphical
     143  <option value="1"_If_("_cgiargv_" eq "1", selected)>Textual
     144</select>
     145}
     146
    44147_content_ {
     148<center>
     149_navigationbar_
     150</center>
    45151<blockquote>
    46152
    47153<form name=PrefForm method=get action="_gwcgi_">
    48 <_font_>
    49154
    50155<input type="hidden" name="e" value="_compressedoptions_">
    51 <input type="hidden" name="q" value="_querystring_">
    52 <input type="hidden" name="a" value="q">
    53 <input type="hidden" name="r" value="1">
    54156
    55157<p>_caseoption_
     
    60162_textprefop_
    61163
    62 <table width="100%">
    63 <tr><td>
    64 <input type="submit" value="_textsetprefs_">
    65 </td></tr></table>
     164<p>
     165_languageoption_
     166
     167<p>
     168_formatoption_
     169
    66170</blockquote>
    67 </font>
    68171</form>
    69172}
     
    99202_textnostem_ { whole word must match}
    100203_textprefop_ {Return up to _maxdocoption_ hits with _hitsperpageoption_ hits per page.}
    101 _textsetprefs_ {Set these preferences}
     204_textlanguage_ {Interface language: }
     205_textformat_ {Interface format: }
    102206
    103207#######################################################################
     
    111215_textnostem_ [language=mi] { me tika te k&uuml;muri}
    112216_textprefop_ [language=mi] {Whakahokia mai te _maxdocoption_ kupu, &auml;, kia _hitsperpageoption_ kupu ki ia wh&auml;rangi.}
    113 _textsetprefs_ [language=mi] {Whakamaua}
    114 
    115 
    116 
    117 
    118 
     217
     218
     219
     220
     221
     222
Note: See TracChangeset for help on using the changeset viewer.