whisper.cat stuff
This commit is contained in:
1
weboasis/stocks/assets/vendor/air-datepicker-master/docs/js/highlight.pack.js
vendored
Normal file
1
weboasis/stocks/assets/vendor/air-datepicker-master/docs/js/highlight.pack.js
vendored
Normal file
File diff suppressed because one or more lines are too long
29
weboasis/stocks/assets/vendor/air-datepicker-master/docs/js/logger.js
vendored
Normal file
29
weboasis/stocks/assets/vendor/air-datepicker-master/docs/js/logger.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
var logger;
|
||||
(function (window) {
|
||||
logger = function (el, clearText) {
|
||||
var $el = $(el);
|
||||
|
||||
addContent($el);
|
||||
addClearButton(clearText, $el);
|
||||
|
||||
$('.logger--clear', $el).on('click', clear.bind('', $el));
|
||||
|
||||
return function(text) {
|
||||
var count = $('p', $el).length,
|
||||
$content = $('.logger--content', $el);
|
||||
$content.append('<p><span>' + ++count + '.</span> ' + text + '</p>').scrollTop(100000)
|
||||
}
|
||||
};
|
||||
|
||||
function addClearButton (text, el) {
|
||||
el.append('<span class="logger--clear">' + text + '</span>')
|
||||
}
|
||||
|
||||
function addContent (el) {
|
||||
el.html('<div class="logger--content"></div>')
|
||||
}
|
||||
|
||||
function clear (el) {
|
||||
$('.logger--content', el).html('');
|
||||
}
|
||||
})(window);
|
123
weboasis/stocks/assets/vendor/air-datepicker-master/docs/js/navigation.js
vendored
Normal file
123
weboasis/stocks/assets/vendor/air-datepicker-master/docs/js/navigation.js
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
var navigation;
|
||||
|
||||
(function (window, $) {
|
||||
var $sections = $('article'),
|
||||
idCounter = 1,
|
||||
idPrefix = 'sub-section-',
|
||||
navTemplate = '<div class="nav-wrap"><nav class="nav" id="nav"></nav></div>',
|
||||
$nav,
|
||||
cache = {};
|
||||
|
||||
function init () {
|
||||
updateCache();
|
||||
createHtml();
|
||||
|
||||
$($nav).on('click', 'a', onClickNavItem);
|
||||
}
|
||||
|
||||
function createHtml () {
|
||||
var html = '',
|
||||
section,
|
||||
curSection,
|
||||
subsection,
|
||||
curSubSection;
|
||||
|
||||
$(navTemplate).appendTo('body');
|
||||
$nav = $('#nav');
|
||||
|
||||
for (section in cache) {
|
||||
curSection = cache[section];
|
||||
|
||||
html += '<div class="nav--section">' +
|
||||
'<h2 class="nav--section-title">' +
|
||||
'<a href="#' + section + '">' + curSection.title +'</a>' +
|
||||
'</h2>';
|
||||
|
||||
if (curSection.subSections) {
|
||||
html += '<div class="nav--subsection">';
|
||||
|
||||
for (subsection in curSection.subSections) {
|
||||
curSubSection = curSection.subSections[subsection];
|
||||
html += '' +
|
||||
'<h3 class="nav--subsection-title">' +
|
||||
'<a href="#' + subsection + '">' + curSubSection.title + '</a>' +
|
||||
'</h3>'
|
||||
|
||||
}
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
$nav.html(html);
|
||||
}
|
||||
|
||||
function updateCache () {
|
||||
cache = {};
|
||||
idCounter = 1;
|
||||
|
||||
var id,
|
||||
title,
|
||||
subTitles,
|
||||
$subTitle,
|
||||
$current;
|
||||
|
||||
$sections.each(function () {
|
||||
$current = $(this);
|
||||
title = $('h2', $current);
|
||||
subTitles = $('h3', $current);
|
||||
id = title.attr('id');
|
||||
|
||||
cache[id] = {
|
||||
title: title.text(),
|
||||
offset: title.offset().top,
|
||||
subSections: ''
|
||||
};
|
||||
|
||||
if (subTitles.length) {
|
||||
cache[id].subSections = {};
|
||||
|
||||
subTitles.each(function () {
|
||||
var $subTitle = $(this),
|
||||
subId = $(this).attr('id');
|
||||
|
||||
if (!subId) {
|
||||
subId = idPrefix + idCounter++;
|
||||
$subTitle.attr('id', subId);
|
||||
}
|
||||
|
||||
cache[id].subSections[subId] = {
|
||||
title: $subTitle.text(),
|
||||
offset: $subTitle.offset().top
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function scrollTo (pos) {
|
||||
$('body, html').animate({
|
||||
scrollTop: pos
|
||||
}, 700, 'easeInOutCubic')
|
||||
}
|
||||
|
||||
function onClickNavItem (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var $link = $(e.target),
|
||||
$section = $($link.attr('href'));
|
||||
|
||||
$section.addClass('-hilited-');
|
||||
|
||||
setTimeout(function () {
|
||||
$section.removeClass('-hilited-');
|
||||
}, 1400)
|
||||
|
||||
scrollTo($section.offset().top - 16)
|
||||
}
|
||||
|
||||
navigation = {
|
||||
init: init
|
||||
}
|
||||
})(window, jQuery);
|
Reference in New Issue
Block a user