Changeset 14083


Ignore:
Timestamp:
05/18/07 14:03:47 (14 years ago)
Author:
lh92
Message:

change the book viewer mode to use combo box because radio button can only have numeric value but the book mode need to be in "on" or "off" state

File:
1 edited

Legend:

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

    r13982 r14083  
    4646        document.PrefForm.elements["cc"][j].checked = true;
    4747        savedccs[a[i]] = 1;
    48         argcc = argcc + "&cc=" + a[i];
     48    argcc = argcc + "&cc=" + a[i];
    4949        break;
    5050      \} else \{
     
    257257\}
    258258
    259 
    260 function updatebook (value) \{
     259function updatebook () \{
     260  value = document.PrefForm.book.options[document.PrefForm.book.selectedIndex].value;
    261261  href = location.href;
    262   if (href.match(/&book=[^&]+/))
    263   \{
    264     if (value == 0) 
    265         href = href.replace(/&book=[^&]+/, "&book=off");
    266     else
    267         href = href.replace(/&book=[^&]+/, "&book=on");
    268   \}
    269   else
    270   \{
    271     if (value == 0)
    272         href += "&book=off";
    273     else
    274         href += "&book=on";
    275   \}
     262  if (href.match(/&book=[^&]+/)) href = href.replace(/&book=[^&]+/, "&book=" + value);
     263  else href += "&book=" + value;
    276264  while (href.match(/&cc=[\\w]+/)) href = href.replace(/&cc=[\\w]+/, "");
    277265  location.href = href + getargs();
     
    279267
    280268}
    281 
    282269
    283270#######################################################################
     
    480467_bookoption_ {
    481468<td valign=baseline>_textbookoption_</td>
    482 <td><input type=radio name=book value=0 onClick="updatebook(0);"
    483         _If_("_cgiargbook_" eq "off", checked)>_textbookvieweroff_<br>
    484 <input type=radio name=book value=1 onClick="updatebook(1);"
    485         _If_("_cgiargbook_" eq "on", checked)>_textbookvieweron_</td>
     469<td><select name="book" onChange="updatebook();">
     470    <option value="off"_If_("_cgiargbook_" eq "off", selected)>_textbookvieweroff_
     471    <option value="on"_If_("_cgiargbook_" eq "on", selected)>_textbookvieweron_
     472</select></td>
    486473}
    487474
    488475# for [l=en]
    489 _textbookoption_  {Book viewer mode}
     476_textbookoption_  {Book viewer mode:}
    490477_textbookvieweron_ {on}
    491478_textbookvieweroff_ {off}
Note: See TracChangeset for help on using the changeset viewer.