Development mbed library for MAX32630FTHR
Dependents: blinky_max32630fthr
tools/ci_templates/scripts.js@3:1198227e6421, 2016-12-16 (annotated)
- Committer:
- switches
- Date:
- Fri Dec 16 16:27:57 2016 +0000
- Revision:
- 3:1198227e6421
- Parent:
- 0:5c4d7b2438d3
Changed ADC scale for MAX32625 platforms to 1.2V full scale to match MAX32630 platforms
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
switches | 0:5c4d7b2438d3 | 1 | <script> |
switches | 0:5c4d7b2438d3 | 2 | var elements = document.querySelectorAll(".toggleshow"), |
switches | 0:5c4d7b2438d3 | 3 | hideClass = 'toggleshow-hide'; |
switches | 0:5c4d7b2438d3 | 4 | |
switches | 0:5c4d7b2438d3 | 5 | for (var i = 0; i < elements.length; i++) { |
switches | 0:5c4d7b2438d3 | 6 | var arrow = elements[i].querySelector(".toggleshow-arrow"); |
switches | 0:5c4d7b2438d3 | 7 | // Initial hide/show based on class |
switches | 0:5c4d7b2438d3 | 8 | // Update arrow as well |
switches | 0:5c4d7b2438d3 | 9 | if (containsClass(elements[i], 'toggleshow-hide')) { |
switches | 0:5c4d7b2438d3 | 10 | toggleDisplay(elements[i]); |
switches | 0:5c4d7b2438d3 | 11 | changeArrow(arrow, false); |
switches | 0:5c4d7b2438d3 | 12 | } else { |
switches | 0:5c4d7b2438d3 | 13 | changeArrow(arrow, true); |
switches | 0:5c4d7b2438d3 | 14 | } |
switches | 0:5c4d7b2438d3 | 15 | |
switches | 0:5c4d7b2438d3 | 16 | // Add click handler |
switches | 0:5c4d7b2438d3 | 17 | addClick(elements[i], toggleDisplay); |
switches | 0:5c4d7b2438d3 | 18 | } |
switches | 0:5c4d7b2438d3 | 19 | |
switches | 0:5c4d7b2438d3 | 20 | function containsClass(element, className) { |
switches | 0:5c4d7b2438d3 | 21 | var eleClassName = ' ' + elements[i].className + ' '; |
switches | 0:5c4d7b2438d3 | 22 | return eleClassName.indexOf(' ' + className + ' ') > -1; |
switches | 0:5c4d7b2438d3 | 23 | } |
switches | 0:5c4d7b2438d3 | 24 | |
switches | 0:5c4d7b2438d3 | 25 | function toggleDisplay(parentElement) { |
switches | 0:5c4d7b2438d3 | 26 | var body = parentElement.querySelector(".toggleshow-body"), |
switches | 0:5c4d7b2438d3 | 27 | arrow = parentElement.querySelector(".toggleshow-arrow"); |
switches | 0:5c4d7b2438d3 | 28 | |
switches | 0:5c4d7b2438d3 | 29 | if (body.style.display == 'block' || body.style.display == '') { |
switches | 0:5c4d7b2438d3 | 30 | body.style.display = 'none'; |
switches | 0:5c4d7b2438d3 | 31 | changeArrow(arrow, false); |
switches | 0:5c4d7b2438d3 | 32 | } else { |
switches | 0:5c4d7b2438d3 | 33 | body.style.display = 'block'; |
switches | 0:5c4d7b2438d3 | 34 | changeArrow(arrow, true); |
switches | 0:5c4d7b2438d3 | 35 | } |
switches | 0:5c4d7b2438d3 | 36 | } |
switches | 0:5c4d7b2438d3 | 37 | |
switches | 0:5c4d7b2438d3 | 38 | function changeArrow(element, visible) { |
switches | 0:5c4d7b2438d3 | 39 | if (visible) { |
switches | 0:5c4d7b2438d3 | 40 | element.innerHTML = '▲'; |
switches | 0:5c4d7b2438d3 | 41 | } else { |
switches | 0:5c4d7b2438d3 | 42 | element.innerHTML = '▼'; |
switches | 0:5c4d7b2438d3 | 43 | } |
switches | 0:5c4d7b2438d3 | 44 | } |
switches | 0:5c4d7b2438d3 | 45 | |
switches | 0:5c4d7b2438d3 | 46 | function addClick(parentElement, func) { |
switches | 0:5c4d7b2438d3 | 47 | parentElement.querySelector(".toggleshow-title").addEventListener("click", function(e) { |
switches | 0:5c4d7b2438d3 | 48 | func(parentElement); |
switches | 0:5c4d7b2438d3 | 49 | e.preventDefault(); |
switches | 0:5c4d7b2438d3 | 50 | return false; |
switches | 0:5c4d7b2438d3 | 51 | }); |
switches | 0:5c4d7b2438d3 | 52 | } |
switches | 0:5c4d7b2438d3 | 53 | </script> |