[processor-sdk/pdk.git] / packages / ti / drv / sciclient / docs / system-firmware-public-documentation / _static / js / theme.js
1 require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"sphinx-rtd-theme":[function(require,module,exports){
2 var jQuery = (typeof(window) != 'undefined') ? window.jQuery : require('jquery');
4 // Sphinx theme nav state
5 function ThemeNav () {
7 var nav = {
8 navBar: null,
9 win: null,
10 winScroll: false,
11 winResize: false,
12 linkScroll: false,
13 winPosition: 0,
14 winHeight: null,
15 docHeight: null,
16 isRunning: null
17 };
19 nav.enable = function () {
20 var self = this;
22 jQuery(function ($) {
23 self.init($);
25 self.reset();
26 self.win.on('hashchange', self.reset);
28 // Set scroll monitor
29 self.win.on('scroll', function () {
30 if (!self.linkScroll) {
31 self.winScroll = true;
32 }
33 });
34 setInterval(function () { if (self.winScroll) self.onScroll(); }, 25);
36 // Set resize monitor
37 self.win.on('resize', function () {
38 self.winResize = true;
39 });
40 setInterval(function () { if (self.winResize) self.onResize(); }, 25);
41 self.onResize();
42 });
43 };
45 nav.init = function ($) {
46 var doc = $(document),
47 self = this;
49 this.navBar = $('div.wy-side-scroll:first');
50 this.win = $(window);
52 // Set up javascript UX bits
53 $(document)
54 // Shift nav in mobile when clicking the menu.
55 .on('click', "[data-toggle='wy-nav-top']", function() {
56 $("[data-toggle='wy-nav-shift']").toggleClass("shift");
57 $("[data-toggle='rst-versions']").toggleClass("shift");
58 })
60 // Nav menu link click operations
61 .on('click', ".wy-menu-vertical .current ul li a", function() {
62 var target = $(this);
63 // Close menu when you click a link.
64 $("[data-toggle='wy-nav-shift']").removeClass("shift");
65 $("[data-toggle='rst-versions']").toggleClass("shift");
66 // Handle dynamic display of l3 and l4 nav lists
67 self.toggleCurrent(target);
68 self.hashChange();
69 })
70 .on('click', "[data-toggle='rst-current-version']", function() {
71 $("[data-toggle='rst-versions']").toggleClass("shift-up");
72 })
74 // Make tables responsive
75 $("table.docutils:not(.field-list)")
76 .wrap("<div class='wy-table-responsive'></div>");
78 // Add expand links to all parents of nested ul
79 $('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
80 var link = $(this);
81 expand = $('<span class="toctree-expand"></span>');
82 expand.on('click', function (ev) {
83 self.toggleCurrent(link);
84 ev.stopPropagation();
85 return false;
86 });
87 link.prepend(expand);
88 });
89 };
91 nav.reset = function () {
92 // Get anchor from URL and open up nested nav
93 var anchor = encodeURI(window.location.hash);
94 if (anchor) {
95 try {
96 var link = $('.wy-menu-vertical')
97 .find('[href="' + anchor + '"]');
98 $('.wy-menu-vertical li.toctree-l1 li.current')
99 .removeClass('current');
100 link.closest('li.toctree-l2').addClass('current');
101 link.closest('li.toctree-l3').addClass('current');
102 link.closest('li.toctree-l4').addClass('current');
103 }
104 catch (err) {
105 console.log("Error expanding nav for anchor", err);
106 }
107 }
108 };
110 nav.onScroll = function () {
111 this.winScroll = false;
112 var newWinPosition = this.win.scrollTop(),
113 winBottom = newWinPosition + this.winHeight,
114 navPosition = this.navBar.scrollTop(),
115 newNavPosition = navPosition + (newWinPosition - this.winPosition);
116 if (newWinPosition < 0 || winBottom > this.docHeight) {
117 return;
118 }
119 this.navBar.scrollTop(newNavPosition);
120 this.winPosition = newWinPosition;
121 };
123 nav.onResize = function () {
124 this.winResize = false;
125 this.winHeight = this.win.height();
126 this.docHeight = $(document).height();
127 };
129 nav.hashChange = function () {
130 this.linkScroll = true;
131 this.win.one('hashchange', function () {
132 this.linkScroll = false;
133 });
134 };
136 nav.toggleCurrent = function (elem) {
137 var parent_li = elem.closest('li');
138 parent_li.siblings('li.current').removeClass('current');
139 parent_li.siblings().find('li.current').removeClass('current');
140 parent_li.find('> ul li.current').removeClass('current');
141 parent_li.toggleClass('current');
142 }
144 return nav;
145 };
147 module.exports.ThemeNav = ThemeNav();
149 if (typeof(window) != 'undefined') {
150 window.SphinxRtdTheme = { StickyNav: module.exports.ThemeNav };
151 }
153 },{"jquery":"jquery"}]},{},["sphinx-rtd-theme"]);