Ignore:
Timestamp:
Mar 4, 2011, 1:58:17 PM (11 years ago)
Author:
Nicklas Nordborg
Message:

References #292: Check/create annotation types, etc. required by reggie

  • Added warning-level messages.
  • Added check for active project.
  • Always do all checks for annotation types.
File:
1 edited

Legend:

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

    r1288 r1309  
    4848 
    4949  var numMissing = 0;
     50  var numWarnings = 0;
    5051  var numErrors = 0;
    5152  var checks = response.checks;
     
    5657  {
    5758    var check = checks[i];
    58     var icon = check.status == 'ok' ? 'ok.gif' : 'error.gif';
    59     if (check.status == 'missing') numMissing++;
    60     if (check.status == 'error') numErrors++;
     59    var icon = 'ok.gif';
     60    if (check.status == 'missing')
     61    {
     62      numMissing++;
     63      icon = 'error.gif';
     64    }
     65    if (check.status == 'error')
     66    {
     67      numErrors++;
     68      icon = 'error.gif';
     69    }
     70    if (check.status == 'warning')
     71    {
     72      numWarnings++;
     73      icon = 'warning.gif';
     74    }
    6175    if (lastItemType != check.itemType)
    6276    {
    63       html += '<tr class="newitemtype"><td>'+check.itemType+'</td>';
     77      html += '<tr class="newitemtype" valign="top"><td>'+check.itemType+'</td>';
    6478    }
    6579    else
    6680    {
    67       html += '<tr><td>&nbsp;</td>';
     81      html += '<tr class="sameitemtype" valign="top"><td>&nbsp;</td>';
    6882    }
    6983    lastItemType = check.itemType;
    70     html += '<td><div class="link" onclick="itemOnClick(event, \''+check.itemType+'\','+check.id+')"';
    71     html += ' title="View this item (use CTRL, ALT or SHIFT to edit)">'+check.name+'</div></td>';
    72     html += '<td><img src="../../images/'+icon+'"></td>';
    73     html += '<td>'+check.message+'</td>';
    74     html += '</tr>';
     84    if (check.id)
     85    {
     86      html += '<td><div class="link" onclick="itemOnClick(event, \''+check.itemType+'\','+check.id+')"';
     87      html += ' title="View this item (use CTRL, ALT or SHIFT to edit)">'+check.name+'</div></td>';
     88    }
     89    else
     90    {
     91      html += '<td><i>' + check.name + '</i></td>';
     92    }
     93    html += '<td><img src="../../images/'+icon+'"></td><td>';
     94    if (check.messages.length > 1)
     95    {
     96      for (var m = 0; m < check.messages.length; m++)
     97      {
     98        html += '• '+check.messages[m] + '<br>';
     99      }
     100    }
     101    else
     102    {
     103      html += check.messages;
     104    }
     105    html += '</td></tr>';
    75106  }
    76107  html += '</table>';
     
    81112  {
    82113    setFatalError(numErrors+' errors was detected. You need to fix those manually.');
     114  }
     115  else if (numWarnings > 0)
     116  {
     117    setWarningMessage(numWarnings+' warnings was detected. Reggie may still work. If not, you need to fix it manually.');
    83118  }
    84119  Main.showHide('createMissingItems', numMissing > 0); 
     
    96131  setInnerHTML('errorMessage', message);
    97132  Main.show('errorMessage');
     133}
     134
     135function setWarningMessage(message)
     136{
     137  setInnerHTML('warningMessage.message', message);
     138  Main.show('warningMessage');
    98139}
    99140
     
    143184.report .newitemtype td
    144185{
    145   border-top: 1px  solid #999999;
     186  border-top: 1px solid #999999;
     187}
     188.report .sameitemtype td
     189{
     190  border-top: 1px dotted #cccccc;
    146191}
    147192
     
    156201
    157202  <div id="validationResult" style="margin-left: 20px;">Checking; please wait...</div>
    158 
    159   <div class="error" id="errorMessage" style="display: none; width: 800px; margin-left: 20px; margin-bottom: 0px;"></div>
    160203
    161204  <div id="createMissingItems" style="display:none; margin-left: 20px; margin-top: 10px;">
     
    165208  </div>
    166209
     210  <div class="error" id="errorMessage" style="display: none; width: 800px; margin-left: 20px; margin-bottom: 0px;"></div>
     211
     212  <base:note id="warningMessage" type="warning" style="display: none; width: 800px; margin-left: 20px; margin-top: 20px;"><div id="warningMessage.message"></div></base:note>
     213
    167214  <pre>
    168215  <div id="debug"></div>
Note: See TracChangeset for help on using the changeset viewer.