Changeset 1342


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

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

Location:
extensions/net.sf.basedb.reggie/trunk/resources
Files:
2 added
4 edited

Legend:

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

    r1341 r1342  
    8989        <dd>
    9090          <ul>
    91           <li>Check that all annotation types and other items used by Reggies exists in BASE.
     91          <li>Check that all annotation types and other items used by Reggie exists in BASE.
    9292          <li>Create missing items.
    9393          </ul>
  • extensions/net.sf.basedb.reggie/trunk/resources/install.jsp

    r1333 r1342  
    2424<base:page type="default" >
    2525<base:head scripts="ajax.js" styles="path.css,table.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
    2629<script language="JavaScript">
    2730
     
    121124}
    122125
    123 function setInnerHTML(id, html)
    124 {
    125   var tag = document.getElementById(id);
    126   if (!tag) alert('No tag with id='+id);
    127   tag.innerHTML = html;
    128 }
    129 function setFatalError(message)
    130 {
    131   setInnerHTML('errorMessage', message);
    132   Main.show('errorMessage');
    133 }
    134 
    135126function setWarningMessage(message)
    136127{
     
    190181  border-top: 1px dotted #cccccc;
    191182}
    192 
    193183</style>
    194184</base:head>
  • 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>
  • extensions/net.sf.basedb.reggie/trunk/resources/refform.jsp

    r1336 r1342  
    3838<base:page type="default" >
    3939<base:head scripts="ajax.js" styles="path.css">
     40  <link rel="stylesheet" type="text/css" href="reggie.css">
     41  <script language="JavaScript" src="reggie.js" type="text/javascript" charset="UTF-8"></script>
     42
    4043<script language="JavaScript">
    4144
     
    6164}
    6265
    63 
    64 function goNextOnTab(event)
    65 {
    66   if (event.keyCode == 9) setTimeout('goNext()', 200);
    67   return true;
    68 }
    69 
    70 function goNextOnTabOrEnter(event)
    71 {
    72   if (event.keyCode == 9 || event.keyCode == 13) setTimeout('goNext()', 200);
    73   return true;
    74 }
    75 
    76 function focusOnEnter(event, inputField)
    77 {
    78   if (event.keyCode == 13) setTimeout("document.forms['reggie']."+inputField+".focus()", 200);
    79   return true;
    80 }
    81 
    82 
    83 function setInnerHTML(id, html)
    84 {
    85   var tag = document.getElementById(id);
    86   if (!tag) alert('No tag with id='+id);
    87   tag.innerHTML = html;
    88 }
    89 
    90 function setInputStatus(prefix, message, clazz)
    91 {
    92   var tag = document.getElementById(prefix + '.status');
    93   tag.className = 'status ' + clazz;
    94  
    95   setInnerHTML(prefix + '.message', message);
    96   if (message)
    97   {
    98     Main.showInline(prefix + '.message');
    99   }
    100   else
    101   {
    102     Main.hide(prefix + '.message');
    103   }
    104 }
    105 
    106 function setFatalError(message)
    107 {
    108   setInnerHTML('errorMessage', message);
    109   Main.show('errorMessage');
    110   Main.hide('gonext');
    111   Main.hide('gocancel');
    112   Main.show('gorestart');
    113   var frm = document.forms['reggie'];
    114   for (var i = 0; i < frm.elements.length; i++)
    115   {
    116     frm.elements[i].disabled = true; 
    117   }
    118 
    119 }
    120 
    121 function goRestart(force)
    122 {
    123   if (!force && !confirm('Cancel this registration?')) return;
    124   location.href = location.href;
    125 }
    126 
    12766function selectDirectoryOnClick()
    12867{
    12968  if (currentStep != 1) return;
    13069  var frm = document.forms['reggie'];
     70  if (frm.directoryId.disabled) return;
    13171  var url = '../../filemanager/directories/index.jsp?ID=<%=ID%>&mode=selectonedirectory&callback=setDirectoryCallback';
    13272  if (frm.directoryId.length > 0)
     
    241181  Main.show('filesSection');
    242182  Main.show('gorestart');
    243  
    244  
    245183}
    246184
     
    251189  img.src = img.src.indexOf('show') > 0 ? '../../images/hide_section.gif' : '../../images/show_section.gif';
    252190}
    253 
    254191</script>
    255192<style>
    256 
    257 .stepform
    258 {
    259   margin-left: 20px;
    260   border: 1px solid #999999;
    261   width: 800px;
    262   table-layout: fixed;
    263 }
    264 
    265 .stepno
    266 {
    267   width: 20px;
    268   font-size: 20px;
    269   font-weight: bold;
    270   color: #E0E0E0;
    271   background: #555577;
    272   vertical-align: top;
    273   text-align: center;
    274 }
    275 
    276 .steptitle
    277 {
    278   width: 780px;
    279   color: #333377;
    280   background: #E0E0E0;
    281   font-weight: bold;
    282   padding: 1px 4px 1px 4px;
    283   border-bottom: 1px solid #999999;
    284 }
    285 
    286 .nextstep
    287 {
    288   width: 780px;
    289   color: #333377;
    290   background: #E0E0E0;
    291   font-weight: bold;
    292   padding: 1px 4px 1px 4px;
    293   border-top: 1px solid #999999;
    294 }
    295 
    296 .stepfields
    297 {
    298   width: 780px;
    299 }
    300 
    301 .stepfields .prompt
    302 {
    303   width: 150px;
    304   font-weight: bold;
    305   padding: 1px 2px 1px 2px;
    306 }
    307 
    308 .stepfields .subprompt
    309 {
    310   width: 150px;
    311   text-align: right;
    312   padding: 1px 2px 1px 2px;
    313   white-space: nowrap;
    314 }
    315 
    316 .stepfields .input
    317 {
    318   width: 250px;
    319   padding: 1px 2px 1px 2px;
    320 }
    321 
    322 .stepfields .status
    323 {
    324   width: 30px;
    325   padding: 1px 2px 1px 2px;
    326 }
    327 
    328 .stepfields .help
    329 {
    330   background: #e0e0e0;
    331   width: 350px;
    332   font-style: italic;
    333   padding: 1px 2px 1px 2px;
    334 }
    335 
    336193.stepfields select
    337194{
    338195  width: 15em;
    339 }
    340 
    341 .stepfields .message, .navigation .message
    342 {
    343   color: #cc0000;
    344   font-weight: bold;
    345   padding-right: 6px;
    346 }
    347 
    348 .status.invalid:before
    349 {
    350   content: url('../../images/error.gif');
    351 }
    352 .status.warning:before
    353 {
    354   content: url('../../images/warning.gif');
    355 }
    356 .status.valid:before
    357 {
    358   content: url('../../images/ok.gif');
    359 }
    360 .success ul
    361 {
    362   list-style-image: url('../../images/ok.gif');
    363196}
    364197
     
    393226  width: 120px;
    394227}
    395 
    396228</style>
    397229</base:head>
Note: See TracChangeset for help on using the changeset viewer.