Ignore:
Timestamp:
Apr 13, 2011, 9:42:50 AM (12 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #308: Move common style definitions and javascript functions to separate files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/persinfo.jsp

    r1333 r1342  
    2424<base:page type="default" >
    2525<base:head scripts="ajax.js" styles="path.css">
     26  <link rel="stylesheet" type="text/css" href="reggie.css">
     27  <script language="JavaScript" src="reggie.js" type="text/javascript" charset="UTF-8"></script>
     28 
     29 
    2630<script language="JavaScript">
    2731
     
    355359}
    356360
    357 
    358 function goNextOnTab(event)
    359 {
    360   if (event.keyCode == 9) setTimeout('goNext()', 200);
    361   return true;
    362 }
    363 
    364 function goNextOnTabOrEnter(event)
    365 {
    366   if (event.keyCode == 9 || event.keyCode == 13) setTimeout('goNext()', 200);
    367   return true;
    368 }
    369 
    370 function focusOnEnter(event, inputField)
    371 {
    372   if (event.keyCode == 13) setTimeout("document.forms['reggie']."+inputField+".focus()", 200);
    373   return true;
    374 }
    375 
    376361function getCaseInfo()
    377362{
     
    386371 
    387372  if (debug) Main.debug(request.responseText);
     373
    388374  var response = JSON.parse(request.responseText);
    389375  if (response.status != 'ok')
     
    738724
    739725  if (debug) Main.debug(request.responseText);
    740  
     726
    741727  var response = JSON.parse(request.responseText);
    742728  if (response.status != 'ok')
     
    757743
    758744}
    759 
    760 
    761 function setInnerHTML(id, html)
    762 {
    763   var tag = document.getElementById(id);
    764   if (!tag) alert('No tag with id='+id);
    765   tag.innerHTML = html;
    766 }
    767 
    768 function setInputStatus(prefix, message, clazz)
    769 {
    770   var tag = document.getElementById(prefix + '.status');
    771   tag.className = 'status ' + clazz;
    772  
    773   setInnerHTML(prefix + '.message', message);
    774   if (message)
    775   {
    776     Main.showInline(prefix + '.message');
    777   }
    778   else
    779   {
    780     Main.hide(prefix + '.message');
    781   }
    782 }
    783 
    784 function setFatalError(message)
    785 {
    786   setInnerHTML('errorMessage', message);
    787   Main.show('errorMessage');
    788   Main.hide('gonext');
    789   Main.hide('gocancel');
    790   Main.show('gorestart');
    791   var frm = document.forms['reggie'];
    792   for (var i = 0; i < frm.elements.length; i++)
    793   {
    794     frm.elements[i].disabled = true; 
    795   }
    796 
    797 }
    798 
    799 function goRestart(force)
    800 {
    801   if (!force && !confirm('Cancel this registration?')) return;
    802   location.href = location.href;
    803 }
    804745</script>
    805 <style>
    806 
    807 .stepform
    808 {
    809   margin-left: 20px;
    810   border: 1px solid #999999;
    811   width: 800px;
    812   table-layout: fixed;
    813 }
    814 
    815 .stepno
    816 {
    817   width: 20px;
    818   font-size: 20px;
    819   font-weight: bold;
    820   color: #E0E0E0;
    821   background: #555577;
    822   vertical-align: top;
    823   text-align: center;
    824 }
    825 
    826 .steptitle
    827 {
    828   width: 780px;
    829   color: #333377;
    830   background: #E0E0E0;
    831   font-weight: bold;
    832   padding: 1px 4px 1px 4px;
    833   border-bottom: 1px solid #999999;
    834 }
    835 
    836 .nextstep
    837 {
    838   width: 780px;
    839   color: #333377;
    840   background: #E0E0E0;
    841   font-weight: bold;
    842   padding: 1px 4px 1px 4px;
    843   border-top: 1px solid #999999;
    844 }
    845 
    846 .stepfields
    847 {
    848   width: 780px;
    849 }
    850 
    851 .stepfields .prompt
    852 {
    853   width: 150px;
    854   font-weight: bold;
    855   padding: 1px 2px 1px 2px;
    856 }
    857 
    858 .stepfields .subprompt
    859 {
    860   width: 150px;
    861   text-align: right;
    862   padding: 1px 2px 1px 2px;
    863   white-space: nowrap;
    864 }
    865 
    866 .stepfields .input
    867 {
    868   width: 250px;
    869   padding: 1px 2px 1px 2px;
    870 }
    871 
    872 .stepfields .status
    873 {
    874   width: 30px;
    875   padding: 1px 2px 1px 2px;
    876 }
    877 
    878 .stepfields .help
    879 {
    880   background: #e0e0e0;
    881   width: 350px;
    882   font-style: italic;
    883   padding: 1px 2px 1px 2px;
    884 }
    885 
    886 .stepfields .message, .navigation .message
    887 {
    888   color: #cc0000;
    889   font-weight: bold;
    890   padding-right: 6px;
    891 }
    892 
    893 .status.invalid:before
    894 {
    895   content: url('../../images/error.gif');
    896 }
    897 .status.warning:before
    898 {
    899   content: url('../../images/warning.gif');
    900 }
    901 .status.valid:before
    902 {
    903   content: url('../../images/ok.gif');
    904 }
    905 .success ul
    906 {
    907   list-style-image: url('../../images/ok.gif');
    908 }
    909 </style>
     746
    910747</base:head>
    911748<base:body onload="init()">
     
    949786        <td class="prompt">Personal number</td>
    950787        <td class="input"><input type="text" name="personalNumber"
    951           size="18" maxlength="12" onkeyup="personalNumberOnChange()" onkeypress="goNextOnTabOrEnter(event)"></td>
     788          size="18" maxlength="12" onkeyup="personalNumberOnChange()" onkeypress="doOnTabOrEnter(event, goNext)"></td>
    952789        <td class="status" id="pnr.status"></td>
    953790        <td class="help"><span id="pnr.message" class="message" style="display: none;"></span>(YYYYMMDDZZZZ)</td>
     
    988825        <td class="prompt">All first names</td>
    989826        <td class="input"><input type="text" name="allFirstNames"
    990           size="35" maxlength="255" onkeypress="goNextOnTabOrEnter(event)"></td>
     827          size="35" maxlength="255" onkeypress="doOnTabOrEnter(event, goNext)"></td>
    991828        <td class="status" id="allFirstNames.status"></td>
    992829        <td class="help"><span id="allFirstNames.message" class="message" style="display: none;"></span>Type all names, see FamilyName comment on valid characters.</td>
Note: See TracChangeset for help on using the changeset viewer.