Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version buttons use repetitive javascript code in wiki pages. #257

Open
ongun-kanat opened this issue Aug 30, 2018 · 1 comment
Open

Version buttons use repetitive javascript code in wiki pages. #257

ongun-kanat opened this issue Aug 30, 2018 · 1 comment

Comments

@ongun-kanat
Copy link

ROS Wiki version buttons use a long inline event handler which increases page length a lot. It can made as a javascript function.

<button id="kinetic" class="btn btn-default" 
onclick="Version({show:['boxturtle_and_newer', 'cturtle_and_newer', 
'diamondback_and_newer', 'electric_and_newer', 'fuerte_and_newer', 
'groovy_and_newer', 'hydro_and_newer', 'indigo_and_newer', 'jade_and_newer', 
'kinetic_and_newer', 'kinetic_and_older', 'lunar_and_older', 
'melodic_and_older', 'unstable_and_older', 'kinetic'], 
hide:['kinetic_and_newer', 'lunar_and_newer', 'melodic_and_newer', 
'unstable_and_newer', 'boxturtle_and_older', 'cturtle_and_older', 
'diamondback_and_older', 'electric_and_older', 'fuerte_and_older', 
'groovy_and_older', 'hydro_and_older', 'indigo_and_older', 'jade_and_older', 
'kinetic_and_older', 'boxturtle', 'cturtle', 'diamondback', 'electric', 
'fuerte', 'groovy', 'hydro', 'indigo', 'jade', 'lunar', 'melodic', 'unstable'], 
target_ros_distro:'kinetic'});this.style.color='#e6e6e6';this.style.background=
'#3e4f6e';var distro_button = document.getElementById('boxturtle');if 
(distro_button) {  distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('cturtle');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('diamondback');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('electric');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('fuerte');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('groovy');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('hydro');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('indigo');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('jade');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('lunar');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('melodic');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}var distro_button = 
document.getElementById('unstable');if (distro_button) {  
distro_button.style.background='#e6e6e6';  
distro_button.style.color='#3e4f6e';}return false" style="background: rgb(230, 
230, 230); color: rgb(62, 79, 110);"> kinetic </button>
@dirk-thomas
Copy link
Member

Please consider to provide a pull request for the suggested improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants