First commit, version 0.1 beta base nibiru framework
This commit is contained in:
126
public/js/v3/application.js
Normal file
126
public/js/v3/application.js
Normal file
@@ -0,0 +1,126 @@
|
||||
var App = {
|
||||
|
||||
_isWithTooltips: false,
|
||||
|
||||
init: function () {
|
||||
App._tableSorters()
|
||||
App._tooltips()
|
||||
App._navDoc()
|
||||
|
||||
$(window).on('resize', App._tooltips)
|
||||
|
||||
$(document).on('shown.bs.tab', function () {
|
||||
$(document).trigger('redraw.bs.charts')
|
||||
})
|
||||
|
||||
// docs top button
|
||||
if ($('.docs-top').length) {
|
||||
App._backToTopButton()
|
||||
$(window).on('scroll', App._backToTopButton)
|
||||
}
|
||||
},
|
||||
|
||||
_navDoc: function () {
|
||||
// doc nav js
|
||||
var $toc = $('#markdown-toc')
|
||||
var $window = $(window)
|
||||
|
||||
if ($toc[0]) {
|
||||
|
||||
maybeActivateDocNavigation()
|
||||
$window.on('resize', maybeActivateDocNavigation)
|
||||
|
||||
function maybeActivateDocNavigation () {
|
||||
if ($window.width() > 768) {
|
||||
activateDocNavigation()
|
||||
} else {
|
||||
deactivateDocNavigation()
|
||||
}
|
||||
}
|
||||
|
||||
function deactivateDocNavigation() {
|
||||
$window.off('resize.theme.nav')
|
||||
$window.off('scroll.theme.nav')
|
||||
$toc.css({
|
||||
position: '',
|
||||
left: '',
|
||||
top: ''
|
||||
})
|
||||
}
|
||||
|
||||
function activateDocNavigation() {
|
||||
|
||||
var cache = {}
|
||||
|
||||
function updateCache() {
|
||||
cache.containerTop = $('.docs-content').offset().top - 40
|
||||
cache.containerRight = $('.docs-content').offset().left + $('.docs-content').width() + 45
|
||||
measure()
|
||||
}
|
||||
|
||||
function measure() {
|
||||
var scrollTop = $window.scrollTop()
|
||||
var distance = Math.max(scrollTop - cache.containerTop, 0)
|
||||
|
||||
if (!distance) {
|
||||
$($toc.find('li')[1]).addClass('active')
|
||||
return $toc.css({
|
||||
position: '',
|
||||
left: '',
|
||||
top: ''
|
||||
})
|
||||
}
|
||||
|
||||
$toc.css({
|
||||
position: 'fixed',
|
||||
left: cache.containerRight,
|
||||
top: 40
|
||||
})
|
||||
}
|
||||
|
||||
updateCache()
|
||||
|
||||
$(window)
|
||||
.on('resize.theme.nav', updateCache)
|
||||
.on('scroll.theme.nav', measure)
|
||||
|
||||
$('body').scrollspy({
|
||||
target: '#markdown-toc',
|
||||
selector: 'li > a'
|
||||
})
|
||||
|
||||
setTimeout(function () {
|
||||
$('body').scrollspy('refresh')
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_backToTopButton: function () {
|
||||
if ($(window).scrollTop() > $(window).height()) {
|
||||
$('.docs-top').fadeIn()
|
||||
} else {
|
||||
$('.docs-top').fadeOut()
|
||||
}
|
||||
},
|
||||
|
||||
_tooltips: function () {
|
||||
if ($(window).width() > 768) {
|
||||
if (App._isWithTooltips) return
|
||||
App._isWithTooltips = true
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
|
||||
} else {
|
||||
if (!App._isWithTooltips) return
|
||||
App._isWithTooltips = false
|
||||
$('[data-toggle="tooltip"]').tooltip('destroy')
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
_tableSorters: function () {
|
||||
$('[data-sort="table"]').tablesorter( {sortList: [[1,0]]} )
|
||||
}
|
||||
}
|
||||
|
||||
App.init()
|
||||
3474
public/js/v3/chart.js
Normal file
3474
public/js/v3/chart.js
Normal file
File diff suppressed because it is too large
Load Diff
18706
public/js/v3/jquery-ui.js
vendored
Normal file
18706
public/js/v3/jquery-ui.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
public/js/v3/jquery.min.js
vendored
Normal file
4
public/js/v3/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
16
public/js/v3/nibiru-debug.js
Normal file
16
public/js/v3/nibiru-debug.js
Normal file
@@ -0,0 +1,16 @@
|
||||
$( document ).ready(function() {
|
||||
console.log( "Nibiru Debugbar loaded!" );
|
||||
$("#nibiru-bar-open").click(function() {
|
||||
if($('#nibiru-debug').hasClass('up')) {
|
||||
$('#nibiru-debug').addClass('down', 1000, 'easeOutElastic');
|
||||
$('#nibiru-debug').removeClass('up');
|
||||
$('#nibiru-bar-open').addClass('closed', 1000, 'easeOutElastic');
|
||||
$('#nibiru-bar-open').removeClass('open');
|
||||
} else {
|
||||
$('#nibiru-debug').removeClass('down');
|
||||
$('#nibiru-debug').addClass('up', 1000, 'easeInElastic');
|
||||
$('#nibiru-bar-open').removeClass('closed');
|
||||
$('#nibiru-bar-open').addClass('open', 1000, 'easeInElastic');
|
||||
}
|
||||
});
|
||||
});
|
||||
4
public/js/v3/tablesorter.min.js
vendored
Normal file
4
public/js/v3/tablesorter.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/js/v3/tether.min.js
vendored
Normal file
1
public/js/v3/tether.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4288
public/js/v3/toolkit.js
Normal file
4288
public/js/v3/toolkit.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user