templates/default/fulldoc/html/js/app.js in yard-0.5.4 vs templates/default/fulldoc/html/js/app.js in yard-0.5.5

- old
+ new

@@ -89,23 +89,50 @@ $('#menu .noframes a').attr('href', document.location); } } function keyboardShortcuts() { + if (window.top.frames.main) return; $(document).keypress(function(evt) { if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return; + if (evt.originalTarget.nodeName == "INPUT" || + evt.originalTarget.nodeName == "TEXTAREA") return; switch (evt.charCode) { case 67: case 99: $('#class_list_link').click(); break; // 'c' case 77: case 109: $('#method_list_link').click(); break; // 'm' case 70: case 102: $('#file_list_link').click(); break; // 'f' } }); } +function summaryToggle() { + $('.summary_toggle').click(function() { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().next(); + if (next.hasClass('compact')) { + next.toggle(); + next.next().toggle(); + } + else if (next.hasClass('summary')) { + var list = $('<ul class="summary compact" />'); + list.html(next.html()); + list.find('.summary_desc, .note').remove(); + list.find('a').each(function() { + $(this).html($(this).find('strong').html()); + $(this).parent().html($(this)[0].outerHTML); + }); + next.before(list); + next.toggle(); + } + return false; + }) +} + $(framesInit); $(createSourceLinks); $(createDefineLinks); $(createFullTreeLinks); $(fixBoxInfoHeights); $(searchFrameLinks); $(linkSummaries); $(keyboardShortcuts); +$(summaryToggle);