From 76177aa280494bb36d7a0bcbda1078d4db717020 Mon Sep 17 00:00:00 2001 From: Ali Labbene Date: Mon, 9 Dec 2019 11:25:19 +0100 Subject: Official ARM version: v4.5 --- Documentation/DSP/html/printComponentTabs.js | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/DSP/html/printComponentTabs.js (limited to 'Documentation/DSP/html/printComponentTabs.js') diff --git a/Documentation/DSP/html/printComponentTabs.js b/Documentation/DSP/html/printComponentTabs.js new file mode 100644 index 0000000..64d846b --- /dev/null +++ b/Documentation/DSP/html/printComponentTabs.js @@ -0,0 +1,36 @@ +var strgURL = location.pathname; // path of current component + +// constuctor for the array of objects +function tabElement(id, folderName, tabTxt ) { + this.id = id; // elementID as needed in html; + this.folderName = folderName; // folder name of the component + this.tabTxt = tabTxt; // Text displayed as menu on the web + this.currentListItem = '
  • ' + this.tabTxt + '
  • '; + this.listItem = '
  • ' + this.tabTxt + '
  • '; +}; + +// array of objects +var arr = []; + +// fill array + arr.push( new tabElement( "GEN", "/General/html/", "General") ); + arr.push( new tabElement( "CORE", "/Core/html/", "Core") ); + arr.push( new tabElement( "DRV", "/Driver/html/", "Driver") ); + arr.push( new tabElement( "DSP", "/DSP/html/", "DSP") ); + arr.push( new tabElement( "RTOS", "/RTOS/html/", "RTOS API") ); + arr.push( new tabElement( "RTX", "/RTX/html/", "RTX") ); + arr.push( new tabElement( "PACK", "/Pack/html/", "Pack") ); + arr.push( new tabElement( "SVD", "/SVD/html/", "SVD") ); + arr.push( new tabElement( "DAP", "/DAP/html/", "DAP") ); + +// write tabs +// called from the header file. +function writeComponentTabs() { + for ( var i=0; i < arr.length; i++ ) { + if (strgURL.search(arr[i].folderName) > 0) { // if this is the current folder + document.write(arr[i].currentListItem); // then print and hightlight the tab + } else { + document.write(arr[i].listItem); // else, print the tab + } + } +}; -- cgit