Mercurial > hg-website
comparison static/js/download.js @ 478:c65b81353b8f
downloads: replace inline scripts with an onload function
author | Kevin Bullock <kbullock+mercurial@ringworld.org> |
---|---|
date | Wed, 10 May 2017 12:19:45 -0500 |
parents | 8e3b10220bb9 |
children | 23ff698c5dbb |
comparison
equal
deleted
inserted
replaced
477:aec3b193e5af | 478:c65b81353b8f |
---|---|
130 out += '</table>'; | 130 out += '</table>'; |
131 out += '<br/>'; | 131 out += '<br/>'; |
132 return out; | 132 return out; |
133 } | 133 } |
134 }; | 134 }; |
135 | |
136 (function (document, window) { | |
137 var load = function () { | |
138 Downloader.init(sources); | |
139 var dl = Downloader.select(); | |
140 var versElement = document.getElementById('download-version') | |
141 , descElement = document.getElementById('download-description'); | |
142 versElement.appendChild(document.createTextNode(dl.attr('version'))); | |
143 descElement.appendChild(document.createTextNode(dl.attr('desc'))); | |
144 } | |
145 | |
146 if (document.readyState !== 'complete') { | |
147 document.addEventListener('DOMContentLoaded', load); | |
148 return; | |
149 } | |
150 | |
151 load(); | |
152 })(document, window); |