summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/_themes/eldocs/static/asset/js/method-toc.js
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-02-09 16:30:06 +0100
committerAndrey Andreev <narf@devilix.net>2014-02-09 16:30:06 +0100
commitc2804a3f3eb085abcc50e8df51085db7a94c18d2 (patch)
treeb53e8a2798a75fa4f92ee2cc3201635ce7df319a /user_guide_src/source/_themes/eldocs/static/asset/js/method-toc.js
parentf6600f840125eadf2366c2244f78ad95defb156b (diff)
parentdb97fe561f03284a287c9a588ac1ff19a9f5e71d (diff)
Merge branch 'develop' into 'feature/encryption'
Diffstat (limited to 'user_guide_src/source/_themes/eldocs/static/asset/js/method-toc.js')
-rw-r--r--user_guide_src/source/_themes/eldocs/static/asset/js/method-toc.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/user_guide_src/source/_themes/eldocs/static/asset/js/method-toc.js b/user_guide_src/source/_themes/eldocs/static/asset/js/method-toc.js
new file mode 100644
index 000000000..a926b3da9
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/static/asset/js/method-toc.js
@@ -0,0 +1,44 @@
+/* modified from http://stackoverflow.com/a/12459801 */
+$(function (){
+ var createList = function(selector){
+
+ var ul = $('<ul>');
+ var selected = $(selector);
+
+ if (selected.length === 0){
+ return;
+ }
+
+ selected.clone().each(function (i,e){
+
+ var p = $(e).children('.descclassname');
+ var n = $(e).children('.descname');
+ var l = $(e).children('.headerlink');
+
+ var a = $('<a>');
+ a.attr('href',l.attr('href')).attr('title', 'jump to ' + n + '()');
+
+ a.append(p).append(n);
+
+ var entry = $('<li>').append(a);
+ ul.append(entry);
+ });
+ return ul;
+ }
+
+ var c = $('<div>');
+
+ var ul0 = c.clone().append($('.submodule-index'))
+
+ customIndex = $('.custom-index');
+ customIndex.empty();
+ customIndex.append(ul0);
+
+ var l = createList('dl.method > dt, dl.function > dt');
+ if (l) {
+ var ul = c.clone()
+ .append('<h3>Methods / Functions</h3>')
+ .append(l);
+ }
+ customIndex.append(ul);
+}); \ No newline at end of file