mirror of
https://github.com/jimeh/time_ext.git
synced 2026-02-19 13:26:39 +00:00
added documentation
This commit is contained in:
138
doc/js/app.js
Normal file
138
doc/js/app.js
Normal file
@@ -0,0 +1,138 @@
|
||||
function createSourceLinks() {
|
||||
$('.method_details_list .source_code').
|
||||
before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
|
||||
$('.toggleSource').toggle(function() {
|
||||
$(this).parent().next().slideDown(100);
|
||||
$(this).text("Hide source");
|
||||
},
|
||||
function() {
|
||||
$(this).parent().next().slideUp(100);
|
||||
$(this).text("View source");
|
||||
});
|
||||
}
|
||||
|
||||
function createDefineLinks() {
|
||||
var tHeight = 0;
|
||||
$('.defines').after(" <a href='#' class='toggleDefines'>more...</a>");
|
||||
$('.toggleDefines').toggle(function() {
|
||||
tHeight = $(this).parent().prev().height();
|
||||
$(this).prev().show();
|
||||
$(this).parent().prev().height($(this).parent().height());
|
||||
$(this).text("(less)");
|
||||
},
|
||||
function() {
|
||||
$(this).prev().hide();
|
||||
$(this).parent().prev().height(tHeight);
|
||||
$(this).text("more...")
|
||||
});
|
||||
}
|
||||
|
||||
function createFullTreeLinks() {
|
||||
var tHeight = 0;
|
||||
$('.inheritanceTree').toggle(function() {
|
||||
tHeight = $(this).parent().prev().height();
|
||||
$(this).prev().prev().hide();
|
||||
$(this).prev().show();
|
||||
$(this).text("(hide)");
|
||||
$(this).parent().prev().height($(this).parent().height());
|
||||
},
|
||||
function() {
|
||||
$(this).prev().prev().show();
|
||||
$(this).prev().hide();
|
||||
$(this).parent().prev().height(tHeight);
|
||||
$(this).text("show all")
|
||||
});
|
||||
}
|
||||
|
||||
function fixBoxInfoHeights() {
|
||||
$('dl.box dd.r1, dl.box dd.r2').each(function() {
|
||||
$(this).prev().height($(this).height());
|
||||
});
|
||||
}
|
||||
|
||||
function searchFrameLinks() {
|
||||
$('#method_list_link').click(function() {
|
||||
toggleSearchFrame(this, relpath + 'method_list.html');
|
||||
});
|
||||
|
||||
$('#class_list_link').click(function() {
|
||||
toggleSearchFrame(this, relpath + 'class_list.html');
|
||||
});
|
||||
|
||||
$('#file_list_link').click(function() {
|
||||
toggleSearchFrame(this, relpath + 'file_list.html');
|
||||
});
|
||||
}
|
||||
|
||||
function toggleSearchFrame(id, link) {
|
||||
var frame = $('#search_frame');
|
||||
$('#search a').removeClass('active').addClass('inactive');
|
||||
if (frame.attr('src') == link && frame.css('display') != "none") {
|
||||
frame.slideUp(100);
|
||||
$('#search a').removeClass('active inactive');
|
||||
}
|
||||
else {
|
||||
$(id).addClass('active').removeClass('inactive');
|
||||
frame.attr('src', link).slideDown(100);
|
||||
}
|
||||
}
|
||||
|
||||
function linkSummaries() {
|
||||
$('.summary_signature').click(function() {
|
||||
document.location = $(this).find('a').attr('href');
|
||||
});
|
||||
}
|
||||
|
||||
function framesInit() {
|
||||
if (window.top.frames.main) {
|
||||
document.body.className = 'frames';
|
||||
$('#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);
|
||||
117
doc/js/full_list.js
Normal file
117
doc/js/full_list.js
Normal file
@@ -0,0 +1,117 @@
|
||||
function fullListSearch() {
|
||||
$('#search input').keyup(function() {
|
||||
var value = this.value.toLowerCase();
|
||||
if (value == "") {
|
||||
$('#full_list').removeClass('insearch');
|
||||
$('#full_list li').each(function() {
|
||||
var link = $(this).children('a:last');
|
||||
link.text(link.text());
|
||||
});
|
||||
if (clicked) {
|
||||
clicked.parents('ul').each(function() {
|
||||
$(this).removeClass('collapsed').prev().removeClass('collapsed');
|
||||
});
|
||||
}
|
||||
highlight();
|
||||
}
|
||||
else {
|
||||
$('#full_list').addClass('insearch');
|
||||
$('#full_list li').each(function() {
|
||||
var link = $(this).children('a:last');
|
||||
var text = link.text();
|
||||
if (text.toLowerCase().indexOf(value) == -1) {
|
||||
$(this).removeClass('found');
|
||||
link.text(link.text());
|
||||
}
|
||||
else {
|
||||
$(this).css('padding-left', '10px').addClass('found');
|
||||
link.html(link.text().replace(new RegExp("(" +
|
||||
value.replace(/([\/.*+?|()\[\]{}\\])/g, "\\$1") + ")", "ig"),
|
||||
'<strong>$1</strong>'));
|
||||
}
|
||||
});
|
||||
highlight(true);
|
||||
}
|
||||
|
||||
if ($('#full_list li:visible').size() == 0) {
|
||||
$('#noresults').fadeIn();
|
||||
}
|
||||
else {
|
||||
$('#noresults').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#search input').focus();
|
||||
$('#full_list').after("<div id='noresults'>No results were found.</div>")
|
||||
}
|
||||
|
||||
clicked = null;
|
||||
function linkList() {
|
||||
$('#full_list li, #full_list li a:last').click(function(evt) {
|
||||
if ($(this).hasClass('toggle')) return true;
|
||||
if (this.tagName.toLowerCase() == "li") {
|
||||
var toggle = $(this).children('a.toggle');
|
||||
if (toggle.size() > 0 && evt.pageX < toggle.offset().left) {
|
||||
toggle.click();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (clicked) clicked.removeClass('clicked');
|
||||
var win = window.parent;
|
||||
if (window.top.frames.main) {
|
||||
win = window.top.frames.main;
|
||||
var title = $('html head title', win.document).text();
|
||||
$('html head title', window.parent.document).text(title);
|
||||
}
|
||||
if (this.tagName.toLowerCase() == "a") {
|
||||
clicked = $(this).parent('li').addClass('clicked');
|
||||
win.location = this.href;
|
||||
}
|
||||
else {
|
||||
clicked = $(this).addClass('clicked');
|
||||
win.location = $(this).find('a:last').attr('href');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function collapse() {
|
||||
if (!$('#full_list').hasClass('class')) return;
|
||||
$('#full_list.class a.toggle').click(function() {
|
||||
$(this).parent().toggleClass('collapsed').next().toggleClass('collapsed');
|
||||
highlight();
|
||||
return false;
|
||||
});
|
||||
$('#full_list.class ul').each(function() {
|
||||
$(this).addClass('collapsed').prev().addClass('collapsed');
|
||||
});
|
||||
$('#full_list.class').children().removeClass('collapsed');
|
||||
highlight();
|
||||
}
|
||||
|
||||
function highlight(no_padding) {
|
||||
var n = 1;
|
||||
$('#full_list li:visible').each(function() {
|
||||
var next = n == 1 ? 2 : 1;
|
||||
$(this).removeClass("r" + next).addClass("r" + n);
|
||||
if (!no_padding && $('#full_list').hasClass('class')) {
|
||||
$(this).css('padding-left', (10 + $(this).parents('ul').size() * 15) + 'px');
|
||||
}
|
||||
n = next;
|
||||
});
|
||||
}
|
||||
|
||||
function escapeShortcut() {
|
||||
$(document).keydown(function(evt) {
|
||||
if (evt.which == 27) {
|
||||
$('#search_frame', window.top.document).slideUp(100);
|
||||
$('#search a', window.top.document).removeClass('active inactive')
|
||||
$(window.top).focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(escapeShortcut);
|
||||
$(fullListSearch);
|
||||
$(linkList);
|
||||
$(collapse);
|
||||
19
doc/js/jquery.js
vendored
Normal file
19
doc/js/jquery.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user