Skip to content

Commit

Permalink
textlayout: Fix undefined label problem
Browse files Browse the repository at this point in the history
  • Loading branch information
r12a committed Jun 21, 2021
1 parent dd5abcf commit 698ac8b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
6 changes: 5 additions & 1 deletion textlayout/index-data/label-list.js
Expand Up @@ -57,8 +57,9 @@ var sectionNames = {
'baselines':'Baselines & inline alignment',
'bidi-text':'Bidirectional text direction',
'boundaries':'Text segmentation & selection',
'transforms':'Transforming characters',
'charset':'Characters & encodings',
'cursive':'Cursive text',
'data-formats':'Data formats & numbers',
'emphasis':'Emphasis (change me)',
'encoding':'Character encodings',
'fonts':'Fonts',
Expand All @@ -69,9 +70,11 @@ var sectionNames = {
'headers-footers':'Page headers, footers, etc',
'hyphenation':'Hyphenation',
'initials':'Styling initials',
'inline_features_punctuation':'Punctuation & other inline features',
'inline-notes':'Inline notes & annotations',
'interaction':'Forms & user interaction',
'justification':'Text alignment & justification',
'language':'Language related',
'line-breaking':'Line breaking',
'lists':'Lists, counters, etc',
'more-inline':'Other inline features',
Expand All @@ -81,6 +84,7 @@ var sectionNames = {
'punctuation':'Punctuation',
'quotations':'Quotations',
'spacing':'Word & letter spacing ',
'segmentation':'Grapheme/word segmentation & selection',
'text-decoration':'Text decoration',
'transforms':'Transforming characters',
'vertical-text':'Vertical text',
Expand Down
45 changes: 25 additions & 20 deletions textlayout/index.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<title>Language enablement issue tracker</title>
<meta name="description" content="Lists open type layout issues in i18n Activity github repositories." />
<script type="text/javascript">
<script>
var f = { }

// AUTHORS should fill in these assignments:
Expand All @@ -31,16 +31,15 @@

f.additionalLinks = ''
</script>
<script type="text/javascript" src="index-data/translations.js"> </script>
<script type="text/javascript" src="https://w3c.github.io/i18n-drafts/javascript/doc-structure/article-dt.js"> </script>
<script type="text/javascript" src="https://w3c.github.io/i18n-drafts/javascript/boilerplate-text/boilerplate-en.js"></script><!--TRANSLATORS must change -en to the subtag for their language!-->
<script type="text/javascript" src="https://w3c.github.io/i18n-drafts/javascript/doc-structure/sitepage.js"> </script>
<script type="text/javascript" src="https://w3c.github.io/i18n-drafts/javascript/articletoc-html5.js"></script>
<script type="text/javascript" src="index-data/label-list.js"></script>
<script src="index-data/translations.js"> </script>
<script src="https://w3c.github.io/i18n-drafts/javascript/doc-structure/article-dt.js"> </script>
<script src="https://w3c.github.io/i18n-drafts/javascript/boilerplate-text/boilerplate-en.js"></script><!--TRANSLATORS must change -en to the subtag for their language!-->
<script src="https://w3c.github.io/i18n-drafts/javascript/doc-structure/sitepage.js"> </script>
<script src="https://w3c.github.io/i18n-drafts/javascript/articletoc-html5.js"></script>
<script src="index-data/label-list.js"></script>
<link rel="stylesheet" href="https://w3c.github.io/i18n-drafts/style/sitepage-2016.css" type="text/css" />
<link rel="stylesheet" href="index-data/local.css" type="text/css" />
<link rel="copyright" href="#copyright"/>
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<script>
// Note that the code is designed to pull a maximum of 200 issues - for more, change maxpages
// It will only display issues with labels that correspond to those defined in the labels variable
Expand Down Expand Up @@ -112,15 +111,18 @@ <h2 class="notoc">Filter results</h2>
<script>
var totals=0
var counter=maxpages
var labelList = []

function getAllData () {
for (var p=1;p<maxpages+1;p++) fetchIssues(p)
var timer = setInterval(function() {
if (counter === 0) {
clearInterval(timer)
if (debug) console.log('finished','Issue length:',issues.length, sections)
if (debug) console.log('In getAllData')
if (debug) console.log('Finished.','Issue length:',issues.length,'Sections:',sections)

// group issues by label, adding to the labels array
if (debug) console.log('Following is a list of i: labels found:')
for (var i=0; i<issues.length; i++) {
if (issues[i].labels) {
for (var l=0;l<issues[i].labels.length;l++) { // for each label in that issue
Expand All @@ -130,16 +132,18 @@ <h2 class="notoc">Filter results</h2>
else {
sections[sLabelFound] = []
sections[sLabelFound].push(issues[i])
labelList.push(sLabelFound)
}
if (debug) console.log(sLabelFound)
}
if (debug) console.log(sLabelFound)
}

// for (var l=0;l<issues[i].labels.length;l++) {
// if (labels[issues[i].labels[l].name]) labels[issues[i].labels[l].name].push(issues[i])
}
}
}

if (debug) console.log('Sections:',sections)
if (debug) console.log('List of labels',labelList)
checkDates()
}
else if (debug) console.log(counter)
Expand All @@ -156,8 +160,9 @@ <h2 class="notoc">Filter results</h2>
for (var i=0;i<temp.length;i++) {
issues.push(temp[i])
}
totals += issues.length;
if (debug) console.log(issues.length,totals,page, counter)
totals += issues.length
if (debug) console.log('In fetchIssues:')
if (debug) console.log('Issues',issues.length,'Totals',totals,'Page',page,'Counter',counter)
counter--
}
request.send();
Expand Down Expand Up @@ -194,12 +199,12 @@ <h2 class="notoc">Filter results</h2>
function displayRepo(label) {
// Add a container to put the repository info and issues in
var table, tr, td, a, updated, toc, span
var labelSection = document.createElement('section');
var labelSection = document.createElement('section')

// Add a heading
var labelLink = document.createElement('a');
labelLink.setAttribute('href', '#'+label);
labelLink.innerHTML = sectionNames[label];
var labelLink = document.createElement('a')
labelLink.setAttribute('href', '#'+label)
labelLink.innerHTML = sectionNames[label]
var labelHeader = document.createElement('h2')
labelHeader.id = label
labelHeader.appendChild(labelLink);
Expand Down Expand Up @@ -472,8 +477,8 @@ <h2 class="notoc">Filter results</h2>
<script>window.onload = getAllData()</script>

<footer id="thefooter"></footer>
<script type="text/javascript">document.getElementById('thefooter').innerHTML = g.bottomOfPage</script>
<script type="text/javascript">completePage()</script>
<script>document.getElementById('thefooter').innerHTML = g.bottomOfPage</script>
<script>completePage()</script>

</div>
</body>
Expand Down

0 comments on commit 698ac8b

Please sign in to comment.