Several ideas for addressing this. I'd suggest the third.
First, on the server: the way to address this is to move all the
analysis (document.scan, etc) outside of the HTML generation building
a Hash of the data to be displayed, and then generate the HTML in the
order you wish. (Aside: this is why many advocate separating logic
and presentation; but it's more work, enough so that I probably
wouldn't have invested the time to create this "throwaway" script in
the first place).
Second, with style: put the table on the bottom, and then reposition
the data using the CSS position property where you want it.
(something like: position: absolute, top: 10px, right: 100px)
Third, with javascript. There already is a loop at the bottom that
goes through the existing list of issues at the top of the page.
Adding a count to that table would look something like this:
matches = document.getElementsByClassName(inputs[i].id)
span = document.createElement('span')
span.textContent = "(#{matches.length})"
inputs[i].parentNode.appendChild(span)
What this does is get the elements with that issue in question,
creates an HTML span element, sets the text for that element, and then
adds that element to the end of the div that contains the input in
question.
Adding a total would be straightforward.
- Sam Ruby
On Wed, Dec 2, 2015 at 9:01 PM, Craig L Russell
<[email protected]> wrote:
> Even better would be to include the error count by type, e.g.
> 365 total
> 289 missing stub/dir name
> 12 extra text
> …
> 365 total
>
> Craig
>
>> On Dec 2, 2015, at 5:40 PM, Craig L Russell <[email protected]> wrote:
>>
>> I added an error count to the web page and it almost works.
>>
>> It correctly shows 0 errors at the beginning of the page, but at the end,
>> when displaying the errors, the error count is not set. I don’t want to put
>> the error count at the bottom of the page.
>>
>> Clearly, I need to do something else to cause the error count to be
>> (re)displayed. What is that something?
>>
>> Thanks,
>>
>> Craig
>>
>> Craig L Russell
>> Architect, Oracle
>> http://db.apache.org/jdo
>> 408 276-5638 mailto:[email protected]
>> P.S. A good JDO? O, Gasp!
>>
>
> Craig L Russell
> Architect, Oracle
> http://db.apache.org/jdo
> 408 276-5638 mailto:[email protected]
> P.S. A good JDO? O, Gasp!
>