Add links to bugs in the common landings page

This commit is contained in:
Marco Castelluccio 2017-01-17 18:28:16 +00:00
Родитель 9e632ff4de
Коммит 3c39d8f858
2 изменённых файлов: 17 добавлений и 10 удалений

Просмотреть файл

@ -7,14 +7,14 @@
<body>
<script src="common_landings.js" type="text/javascript"></script>
<p>Insert one or more links like <code>https://hg.mozilla.org/releases/mozilla-beta/pushloghtml?fromchange=FIREFOX_51_0b13_RELEASE&tochange=FIREFOX_51_0b14_RELEASE</code></p>
<input type="text" name="pushloglink1" id="pushloglink1" size="140" placeholder="First pushlog link...">
<input type="text" name="pushloglink1" id="pushloglink1" size="140" placeholder="First pushloghtml link...">
<br>
<input type="text" name="pushloglink2" id="pushloglink2" size="140" placeholder="Second pushlog link...">
<input type="text" name="pushloglink2" id="pushloglink2" size="140" placeholder="Second pushloghtml link...">
<br>
<input type="text" name="pushloglink3" id="pushloglink3" size="140" placeholder="Third pushlog link...">
<input type="text" name="pushloglink3" id="pushloglink3" size="140" placeholder="Third pushloghtml link...">
<br><br>
<button id="getCommonLandings">Find common landings</button>
<br><br>
<span id="results"></span>
<div id="results"></div>
</body>
</html>

Просмотреть файл

@ -54,14 +54,21 @@ onLoad
getCommonLandings()
.then(bugs => {
if (bugs.length === 0) {
return 'None';
document.getElementById('results').textContent = 'None';
}
return bugs.join(', ');
})
.then(text => {
document.getElementById('results').textContent = text;
})
let ul = document.createElement('ul');
for (let bug of bugs) {
let li = document.createElement('li');
let a = document.createElement('a');
a.textContent = bug;
a.href = 'https://bugzilla.mozilla.org/show_bug.cgi?id=' + bug;
li.appendChild(a);
ul.appendChild(li);
}
document.getElementById('results').appendChild(ul);
});
};
});