ikinci temizlik tamamlandı
This commit is contained in:
File diff suppressed because one or more lines are too long
+7
File diff suppressed because one or more lines are too long
@@ -0,0 +1,601 @@
|
||||
/**
|
||||
* Blogzine - Blog and Magazine Bootstrap 5 Theme
|
||||
*
|
||||
* @author Webestica (https://www.webestica.com/)
|
||||
* @version 1.0.0
|
||||
**/
|
||||
|
||||
|
||||
/* ===================
|
||||
Table Of Content
|
||||
======================
|
||||
01 PRELOADER
|
||||
02 MEGA MENU
|
||||
03 STICKY HEADER
|
||||
04 TINY SLIDER
|
||||
05 PARALLAX BACKGROUND
|
||||
06 STICKY BAR
|
||||
07 TOOLTIP
|
||||
08 POPOVER
|
||||
09 BACK TO TOP
|
||||
10 STICKY POST
|
||||
11 STICKY FOOTER
|
||||
12 GLIGHTBOX
|
||||
13 ISOTOPE
|
||||
====================== */
|
||||
|
||||
"use strict";
|
||||
!function () {
|
||||
|
||||
window.Element.prototype.removeClass = function () {
|
||||
let className = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
|
||||
selectors = this;
|
||||
if (!(selectors instanceof HTMLElement) && selectors !== null) {
|
||||
selectors = document.querySelector(selectors);
|
||||
}
|
||||
if (this.isVariableDefined(selectors) && className) {
|
||||
selectors.classList.remove(className);
|
||||
}
|
||||
return this;
|
||||
}, window.Element.prototype.addClass = function () {
|
||||
let className = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
|
||||
selectors = this;
|
||||
if (!(selectors instanceof HTMLElement) && selectors !== null) {
|
||||
selectors = document.querySelector(selectors);
|
||||
}
|
||||
if (this.isVariableDefined(selectors) && className) {
|
||||
selectors.classList.add(className);
|
||||
}
|
||||
return this;
|
||||
}, window.Element.prototype.toggleClass = function () {
|
||||
let className = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
|
||||
selectors = this;
|
||||
if (!(selectors instanceof HTMLElement) && selectors !== null) {
|
||||
selectors = document.querySelector(selectors);
|
||||
}
|
||||
if (this.isVariableDefined(selectors) && className) {
|
||||
selectors.classList.toggle(className);
|
||||
}
|
||||
return this;
|
||||
}, window.Element.prototype.isVariableDefined = function () {
|
||||
return !!this && typeof (this) != 'undefined' && this != null;
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
var e = {
|
||||
init: function () {
|
||||
e.preLoader(),
|
||||
e.megaMenu(),
|
||||
e.stickyHeader(),
|
||||
e.tinySlider(),
|
||||
e.parallaxBG(),
|
||||
e.stickyBar(),
|
||||
e.toolTipFunc(),
|
||||
e.popOverFunc(),
|
||||
e.backTotop(),
|
||||
e.stickyPost(),
|
||||
e.stickyFooter(),
|
||||
e.lightBox(),
|
||||
e.enableIsotope(),
|
||||
e.activeClass();
|
||||
},
|
||||
isVariableDefined: function (el) {
|
||||
return typeof !!el && (el) != 'undefined' && el != null;
|
||||
},
|
||||
getParents: function (el, selector, filter) {
|
||||
const result = [];
|
||||
const matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
|
||||
|
||||
// match start from parent
|
||||
el = el.parentElement;
|
||||
while (el && !matchesSelector.call(el, selector)) {
|
||||
if (!filter) {
|
||||
if (selector) {
|
||||
if (matchesSelector.call(el, selector)) {
|
||||
return result.push(el);
|
||||
}
|
||||
} else {
|
||||
result.push(el);
|
||||
}
|
||||
} else {
|
||||
if (matchesSelector.call(el, filter)) {
|
||||
result.push(el);
|
||||
}
|
||||
}
|
||||
el = el.parentElement;
|
||||
if (e.isVariableDefined(el)) {
|
||||
if (matchesSelector.call(el, selector)) {
|
||||
return el;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
},
|
||||
getNextSiblings: function (el, selector, filter) {
|
||||
let sibs = [];
|
||||
let nextElem = el.parentNode.firstChild;
|
||||
const matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
|
||||
do {
|
||||
if (nextElem.nodeType === 3) continue; // ignore text nodes
|
||||
if (nextElem === el) continue; // ignore elem of target
|
||||
if (nextElem === el.nextElementSibling) {
|
||||
if ((!filter || filter(el))) {
|
||||
if (selector) {
|
||||
if (matchesSelector.call(nextElem, selector)) {
|
||||
return nextElem;
|
||||
}
|
||||
} else {
|
||||
sibs.push(nextElem);
|
||||
}
|
||||
el = nextElem;
|
||||
|
||||
}
|
||||
}
|
||||
} while (nextElem = nextElem.nextSibling)
|
||||
return sibs;
|
||||
},
|
||||
on: function (selectors, type, listener) {
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
if (!(selectors instanceof HTMLElement) && selectors !== null) {
|
||||
selectors = document.querySelector(selectors);
|
||||
}
|
||||
selectors.addEventListener(type, listener);
|
||||
});
|
||||
},
|
||||
onAll: function (selectors, type, listener) {
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
document.querySelectorAll(selectors).forEach((element) => {
|
||||
if (type.indexOf(',') > -1) {
|
||||
let types = type.split(',');
|
||||
types.forEach((type) => {
|
||||
element.addEventListener(type, listener);
|
||||
});
|
||||
} else {
|
||||
element.addEventListener(type, listener);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
},
|
||||
removeClass: function (selectors, className) {
|
||||
if (!(selectors instanceof HTMLElement) && selectors !== null) {
|
||||
selectors = document.querySelector(selectors);
|
||||
}
|
||||
if (e.isVariableDefined(selectors)) {
|
||||
selectors.removeClass(className);
|
||||
}
|
||||
},
|
||||
removeAllClass: function (selectors, className) {
|
||||
if (e.isVariableDefined(selectors) && (selectors instanceof HTMLElement)) {
|
||||
document.querySelectorAll(selectors).forEach((element) => {
|
||||
element.removeClass(className);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
toggleClass: function (selectors, className) {
|
||||
if (!(selectors instanceof HTMLElement) && selectors !== null) {
|
||||
selectors = document.querySelector(selectors);
|
||||
}
|
||||
if (e.isVariableDefined(selectors)) {
|
||||
selectors.toggleClass(className);
|
||||
}
|
||||
},
|
||||
toggleAllClass: function (selectors, className) {
|
||||
if (e.isVariableDefined(selectors) && (selectors instanceof HTMLElement)) {
|
||||
document.querySelectorAll(selectors).forEach((element) => {
|
||||
element.toggleClass(className);
|
||||
});
|
||||
}
|
||||
},
|
||||
addClass: function (selectors, className) {
|
||||
if (!(selectors instanceof HTMLElement) && selectors !== null) {
|
||||
selectors = document.querySelector(selectors);
|
||||
}
|
||||
if (e.isVariableDefined(selectors)) {
|
||||
selectors.addClass(className);
|
||||
}
|
||||
},
|
||||
select: function (selectors) {
|
||||
return document.querySelector(selectors);
|
||||
},
|
||||
selectAll: function (selectors) {
|
||||
return document.querySelectorAll(selectors);
|
||||
},
|
||||
|
||||
// START: 01 Preloader
|
||||
preLoader: function () {
|
||||
window.onload = function () {
|
||||
var preloader = e.select('.preloader');
|
||||
if (e.isVariableDefined(preloader)) {
|
||||
preloader.className += ' animate__animated animate__fadeOut';
|
||||
setTimeout(function(){
|
||||
preloader.style.display = 'none';
|
||||
}, 200);
|
||||
}
|
||||
};
|
||||
},
|
||||
// END: Preloader
|
||||
|
||||
// START: 02 Mega Menu
|
||||
megaMenu: function () {
|
||||
e.onAll('.dropdown-menu a.dropdown-item.dropdown-toggle', 'click', function (event) {
|
||||
var element = this;
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
if (e.isVariableDefined(element.nextElementSibling) && !element.nextElementSibling.classList.contains("show")) {
|
||||
const parents = e.getParents(element, '.dropdown-menu');
|
||||
e.removeClass(parents.querySelector('.show'), "show");
|
||||
if(e.isVariableDefined(parents.querySelector('.dropdown-opened'))){
|
||||
e.removeClass(parents.querySelector('.dropdown-opened'), "dropdown-opened");
|
||||
}
|
||||
|
||||
}
|
||||
var $subMenu = e.getNextSiblings(element, ".dropdown-menu");
|
||||
e.toggleClass($subMenu, "show");
|
||||
$subMenu.previousElementSibling.toggleClass('dropdown-opened');
|
||||
var parents = e.getParents(element, 'li.nav-item.dropdown.show');
|
||||
if (e.isVariableDefined(parents) && parents.length > 0) {
|
||||
e.on(parents, 'hidden.bs.dropdown', function (event) {
|
||||
e.removeAllClass('.dropdown-submenu .show');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// END: Mega Menu
|
||||
|
||||
// START: 03 Sticky Header
|
||||
stickyHeader: function () {
|
||||
var stickyNav = e.select('.navbar-sticky');
|
||||
if (e.isVariableDefined(stickyNav)) {
|
||||
var stickyHeight = stickyNav.offsetHeight;
|
||||
stickyNav.insertAdjacentHTML('afterend', '<div id="sticky-space"></div>');
|
||||
var stickySpace = e.select('#sticky-space');
|
||||
if (e.isVariableDefined(stickySpace)) {
|
||||
document.addEventListener('scroll', function (event) {
|
||||
var scTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
if (scTop >= 400) {
|
||||
stickySpace.addClass('active');
|
||||
e.select("#sticky-space.active").style.height = stickyHeight + 'px';
|
||||
stickyNav.addClass('navbar-sticky-on');
|
||||
} else {
|
||||
stickySpace.removeClass('active');
|
||||
stickySpace.style.height = '0px';
|
||||
stickyNav.removeClass("navbar-sticky-on");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// END: Sticky Header
|
||||
|
||||
// START: 04 Tiny Slider
|
||||
tinySlider: function () {
|
||||
var $carousel = e.select('.tiny-slider-inner');
|
||||
if (e.isVariableDefined($carousel)) {
|
||||
var tnsCarousel = e.selectAll('.tiny-slider-inner');
|
||||
tnsCarousel.forEach(slider => {
|
||||
var slider1 = slider;
|
||||
var sliderMode = slider1.getAttribute('data-mode') ? slider1.getAttribute('data-mode') : 'carousel';
|
||||
var sliderAxis = slider1.getAttribute('data-axis') ? slider1.getAttribute('data-axis') : 'horizontal';
|
||||
var sliderSpace = slider1.getAttribute('data-gutter') ? slider1.getAttribute('data-gutter') : 30;
|
||||
var sliderEdge = slider1.getAttribute('data-edge') ? slider1.getAttribute('data-edge') : 0;
|
||||
|
||||
var sliderItems = slider1.getAttribute('data-items') ? slider1.getAttribute('data-items') : 4; //option: number (items in all device)
|
||||
var sliderItemsXl = slider1.getAttribute('data-items-xl') ? slider1.getAttribute('data-items-xl') : Number(sliderItems); //option: number (items in 1200 to end )
|
||||
var sliderItemsLg = slider1.getAttribute('data-items-lg') ? slider1.getAttribute('data-items-lg') : Number(sliderItemsXl); //option: number (items in 992 to 1199 )
|
||||
var sliderItemsMd = slider1.getAttribute('data-items-md') ? slider1.getAttribute('data-items-md') : Number(sliderItemsLg); //option: number (items in 768 to 991 )
|
||||
var sliderItemsSm = slider1.getAttribute('data-items-sm') ? slider1.getAttribute('data-items-sm') : Number(sliderItemsMd); //option: number (items in 576 to 767 )
|
||||
var sliderItemsXs = slider1.getAttribute('data-items-xs') ? slider1.getAttribute('data-items-xs') : Number(sliderItemsSm); //option: number (items in start to 575 )
|
||||
|
||||
var sliderSpeed = slider1.getAttribute('data-speed') ? slider1.getAttribute('data-speed') : 500;
|
||||
var sliderautoWidth = slider1.getAttribute('data-autowidth') === 'true'; //option: true or false
|
||||
var sliderArrow = slider1.getAttribute('data-arrow') !== 'false'; //option: true or false
|
||||
var sliderDots = slider1.getAttribute('data-dots') !== 'false'; //option: true or false
|
||||
|
||||
var sliderAutoPlay = slider1.getAttribute('data-autoplay') !== 'false'; //option: true or false
|
||||
var sliderAutoPlayTime = slider1.getAttribute('data-autoplaytime') ? slider1.getAttribute('data-autoplaytime') : 4000;
|
||||
var sliderHoverPause = slider1.getAttribute('data-hoverpause') === 'true'; //option: true or false
|
||||
var sliderLoop = slider1.getAttribute('data-loop') !== 'false'; //option: true or false
|
||||
var sliderRewind = slider1.getAttribute('data-rewind') === 'true'; //option: true or false
|
||||
var sliderAutoHeight = slider1.getAttribute('data-autoheight') === 'true'; //option: true or false
|
||||
var sliderfixedWidth = slider1.getAttribute('data-fixedwidth') === 'true'; //option: true or false
|
||||
var sliderTouch = slider1.getAttribute('data-touch') !== 'false'; //option: true or false
|
||||
var sliderDrag = slider1.getAttribute('data-drag') !== 'false'; //option: true or false
|
||||
// Check if document DIR is RTL
|
||||
var ifRtl = document.getElementsByTagName("html")[0].getAttribute("dir");
|
||||
var sliderDirection;
|
||||
if (ifRtl === 'rtl') {
|
||||
sliderDirection = 'rtl';
|
||||
}
|
||||
|
||||
var tnsSlider = tns({
|
||||
container: slider,
|
||||
mode: sliderMode,
|
||||
axis: sliderAxis,
|
||||
gutter: sliderSpace,
|
||||
edgePadding: sliderEdge,
|
||||
speed: sliderSpeed,
|
||||
autoWidth: sliderautoWidth,
|
||||
controls: sliderArrow,
|
||||
nav: sliderDots,
|
||||
autoplay: sliderAutoPlay,
|
||||
autoplayTimeout: sliderAutoPlayTime,
|
||||
autoplayHoverPause: sliderHoverPause,
|
||||
autoplayButton: false,
|
||||
autoplayButtonOutput: false,
|
||||
controlsPosition: top,
|
||||
// navContainer: '#custom-thumb',
|
||||
// controlsContainer: '#customize-controls',
|
||||
navPosition: top,
|
||||
autoplayPosition: top,
|
||||
controlsText: [
|
||||
'<i class="fas fa-chevron-left"></i>',
|
||||
'<i class="fas fa-chevron-right"></i>'
|
||||
],
|
||||
loop: sliderLoop,
|
||||
rewind: sliderRewind,
|
||||
autoHeight: sliderAutoHeight,
|
||||
fixedWidth: sliderfixedWidth,
|
||||
touch: sliderTouch,
|
||||
mouseDrag: sliderDrag,
|
||||
arrowKeys: true,
|
||||
items: sliderItems,
|
||||
// 'customize': {
|
||||
// container: '#customize-cont',
|
||||
// items: 3,
|
||||
// controlsContainer: '#customize-controls',
|
||||
// navContainer: '#custom-thumbnails',
|
||||
// navAsThumbnails: true,
|
||||
// autoplay: true,
|
||||
// autoplayTimeout: 1000,
|
||||
// autoplayButton: '#customize-toggle',
|
||||
// },
|
||||
textDirection: sliderDirection,
|
||||
responsive: {
|
||||
0: {
|
||||
items: Number(sliderItemsXs)
|
||||
},
|
||||
576: {
|
||||
items: Number(sliderItemsSm)
|
||||
},
|
||||
768: {
|
||||
items: Number(sliderItemsMd)
|
||||
},
|
||||
992: {
|
||||
items: Number(sliderItemsLg)
|
||||
},
|
||||
1200: {
|
||||
items: Number(sliderItemsXl)
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
// END: Tiny Slider
|
||||
|
||||
// START: 05 Parallax Background
|
||||
parallaxBG: function () {
|
||||
var parBG = e.select('.bg-parallax');
|
||||
if (e.isVariableDefined(parBG)) {
|
||||
jarallax(e.selectAll('.bg-parallax'), {
|
||||
speed: 0.6
|
||||
});
|
||||
}
|
||||
},
|
||||
// END: Parallax Background
|
||||
|
||||
// START: 06 Sticky Bar
|
||||
stickyBar: function () {
|
||||
var stickyBar = e.select('[data-sticky]');
|
||||
if (e.isVariableDefined(stickyBar)) {
|
||||
var sticky = new Sticky('[data-sticky]');
|
||||
}
|
||||
},
|
||||
// END: Sticky Bar
|
||||
|
||||
// START: 07 Tooltip
|
||||
// Enable tooltips everywhere via data-toggle attribute
|
||||
toolTipFunc: function () {
|
||||
var tooltipTriggerList = [].slice.call(e.selectAll('[data-bs-toggle="tooltip"]'))
|
||||
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl)
|
||||
})
|
||||
},
|
||||
// END: Tooltip
|
||||
|
||||
// START: 08 Popover
|
||||
// Enable popover everywhere via data-toggle attribute
|
||||
popOverFunc: function () {
|
||||
var popoverTriggerList = [].slice.call(e.selectAll('[data-bs-toggle="popover"]'))
|
||||
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
|
||||
return new bootstrap.Popover(popoverTriggerEl)
|
||||
})
|
||||
},
|
||||
// END: Popover
|
||||
|
||||
// START: 09 Back to Top
|
||||
backTotop: function () {
|
||||
var scrollpos = window.scrollY;
|
||||
var backBtn = e.select('.back-top');
|
||||
if (e.isVariableDefined(backBtn)) {
|
||||
var add_class_on_scroll = () => backBtn.addClass("back-top-show");
|
||||
var remove_class_on_scroll = () => backBtn.removeClass("back-top-show");
|
||||
|
||||
window.addEventListener('scroll', function () {
|
||||
scrollpos = window.scrollY;
|
||||
if (scrollpos >= 800) {
|
||||
add_class_on_scroll()
|
||||
} else {
|
||||
remove_class_on_scroll()
|
||||
}
|
||||
});
|
||||
|
||||
backBtn.addEventListener('click', () => window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth',
|
||||
}));
|
||||
}
|
||||
},
|
||||
// END: Back to Top
|
||||
|
||||
|
||||
// START: 10 Sticky post
|
||||
stickyPost: function () {
|
||||
var scrollpos = window.scrollY;
|
||||
var stkpost = e.select('.sticky-post');
|
||||
if (e.isVariableDefined(stkpost)) {
|
||||
var add_class_on_scroll = () => stkpost.addClass("sticky-post-stick");
|
||||
var remove_class_on_scroll = () => stkpost.removeClass("sticky-post-stick");
|
||||
|
||||
window.addEventListener('scroll', function () {
|
||||
scrollpos = window.scrollY;
|
||||
if (scrollpos >= 1400) {
|
||||
add_class_on_scroll()
|
||||
} else {
|
||||
remove_class_on_scroll()
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// END: Back to Top
|
||||
|
||||
// START: 11 Sticky Footer
|
||||
stickyFooter: function () {
|
||||
var fixedFooter = e.select('.footer-sticky');
|
||||
if (e.isVariableDefined(fixedFooter)) {
|
||||
window.addEventListener("load", function () {
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
});
|
||||
window.addEventListener('resize', function (event) {
|
||||
var screenWidth = window.outerWidth;
|
||||
var footerHeight = fixedFooter.offsetHeight - 1;
|
||||
if (screenWidth >= 768) {
|
||||
document.getElementsByTagName('main')[0].style.marginBottom = footerHeight + 'px';
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// END: Sticky Footer
|
||||
|
||||
// START: 12 GLightbox
|
||||
lightBox: function () {
|
||||
var light = e.select('[data-glightbox]');
|
||||
if (e.isVariableDefined(light)) {
|
||||
var lb = GLightbox({
|
||||
selector: '*[data-glightbox]',
|
||||
openEffect: 'fade',
|
||||
closeEffect: 'fade'
|
||||
});
|
||||
}
|
||||
},
|
||||
// END: GLightbox
|
||||
|
||||
// START: 13 Isotope
|
||||
enableIsotope: function () {
|
||||
var isGridItem = e.select('.grid-item');
|
||||
if (e.isVariableDefined(isGridItem)) {
|
||||
|
||||
// Code only for normal Grid
|
||||
var onlyGrid = e.select('[data-isotope]');
|
||||
if (e.isVariableDefined(onlyGrid)) {
|
||||
var allGrid = e.selectAll("[data-isotope]");
|
||||
allGrid.forEach(gridItem => {
|
||||
var gridItemData = gridItem.getAttribute('data-isotope');
|
||||
var gridItemDataObj = JSON.parse(gridItemData);
|
||||
var iso = new Isotope(gridItem, {
|
||||
itemSelector: '.grid-item',
|
||||
layoutMode: gridItemDataObj.layoutMode
|
||||
});
|
||||
|
||||
imagesLoaded(gridItem).on('progress', function () {
|
||||
// layout Isotope after each image loads
|
||||
iso.layout();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Code only for normal Grid
|
||||
var onlyGridFilter = e.select('.grid-menu');
|
||||
if (e.isVariableDefined(onlyGridFilter)) {
|
||||
var filterMenu = e.selectAll('.grid-menu');
|
||||
filterMenu.forEach(menu => {
|
||||
var filterContainer = menu.getAttribute('data-target');
|
||||
var a = menu.dataset.target;
|
||||
var b = e.select(a);
|
||||
var filterContainerItemData = b.getAttribute('data-isotope');
|
||||
var filterContainerItemDataObj = JSON.parse(filterContainerItemData);
|
||||
var filter = new Isotope(filterContainer, {
|
||||
itemSelector: '.grid-item',
|
||||
transitionDuration: '0.7s',
|
||||
layoutMode: filterContainerItemDataObj.layoutMode
|
||||
});
|
||||
|
||||
var menuItems = menu.querySelectorAll('li a');
|
||||
menuItems.forEach(menuItem => {
|
||||
menuItem.addEventListener('click', function (event) {
|
||||
var filterValue = menuItem.getAttribute('data-filter');
|
||||
filter.arrange({filter: filterValue});
|
||||
menuItems.forEach((control) => control.removeClass('active'));
|
||||
menuItem.addClass('active');
|
||||
});
|
||||
});
|
||||
|
||||
imagesLoaded(filterContainer).on('progress', function () {
|
||||
filter.layout();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// END: Isotope
|
||||
// START: 17 Active class
|
||||
activeClass: function () {
|
||||
var currentPath = window.location.pathname;
|
||||
var path = currentPath.split("/").pop();
|
||||
|
||||
var d = e.select(".navbar .left-sidebar");
|
||||
if(e.isVariableDefined(d)) {
|
||||
var hTarget = e.select('.left-sidebar .list-group-borderless .list-group-item[href="'+path+'"]');
|
||||
|
||||
if(e.isVariableDefined(hTarget)) {
|
||||
var hh = hTarget.getAttribute("href");
|
||||
|
||||
if(path === hh) {
|
||||
hTarget.classList.add('active');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// END: Active class
|
||||
};
|
||||
e.init();
|
||||
|
||||
/* Custom Scrollbar */
|
||||
var el = document.querySelector('.left-sidebar');
|
||||
SimpleScrollbar.initEl(el);
|
||||
|
||||
/* Clipboard JS - Copy code button */
|
||||
var cl = document.querySelector('.copy-link');
|
||||
if(typeof !!cl && (cl) != 'undefined' && cl != null) {
|
||||
var cle = document.querySelectorAll('.copy-link');
|
||||
cle.forEach(el => {
|
||||
el.addEventListener("click", function () {
|
||||
var theButton = this;
|
||||
var copyId = this.getAttribute('id');
|
||||
var clipboard = new ClipboardJS( '#' + copyId );
|
||||
|
||||
clipboard.on('success', function(e) {
|
||||
e.clearSelection();
|
||||
theButton.innerHTML = 'Copied';
|
||||
setTimeout(function() {
|
||||
theButton.innerHTML = 'Copy';
|
||||
}, 10000);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
!function(t,e){"object"==typeof exports?module.exports=e(window,document):t.SimpleScrollbar=e(window,document)}(this,function(t,e){function s(t){Object.prototype.hasOwnProperty.call(t,"data-simple-scrollbar")||Object.defineProperty(t,"data-simple-scrollbar",{value:new o(t)})}function i(t,s){function i(t){var e=t.pageY-a;a=t.pageY,n(function(){s.el.scrollTop+=e/s.scrollRatio})}function r(){t.classList.remove("ss-grabbed"),e.body.classList.remove("ss-grabbed"),e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",r)}var a;t.addEventListener("mousedown",function(s){return a=s.pageY,t.classList.add("ss-grabbed"),e.body.classList.add("ss-grabbed"),e.addEventListener("mousemove",i),e.addEventListener("mouseup",r),!1})}function r(t){for(this.target=t,this.direction=window.getComputedStyle(this.target).direction,this.bar='<div class="ss-scroll">',this.wrapper=e.createElement("div"),this.wrapper.setAttribute("class","ss-wrapper"),this.el=e.createElement("div"),this.el.setAttribute("class","ss-content"),"rtl"===this.direction&&this.el.classList.add("rtl"),this.wrapper.appendChild(this.el);this.target.firstChild;)this.el.appendChild(this.target.firstChild);this.target.appendChild(this.wrapper),this.target.insertAdjacentHTML("beforeend",this.bar),this.bar=this.target.lastChild,i(this.bar,this),this.moveBar(),this.el.addEventListener("scroll",this.moveBar.bind(this)),this.el.addEventListener("mouseenter",this.moveBar.bind(this)),this.target.classList.add("ss-container");var s=window.getComputedStyle(t);"0px"===s.height&&"0px"!==s["max-height"]&&(t.style.height=s["max-height"])}function a(){for(var t=e.querySelectorAll("*[ss-container]"),i=0;i<t.length;i++)s(t[i])}var n=t.requestAnimationFrame||t.setImmediate||function(t){return setTimeout(t,0)};r.prototype={moveBar:function(t){var e=this.el.scrollHeight,s=this.el.clientHeight,i=this;this.scrollRatio=s/e;var r="rtl"===i.direction,a=r?i.target.clientWidth-i.bar.clientWidth+18:-1*(i.target.clientWidth-i.bar.clientWidth);n(function(){i.scrollRatio>=1?i.bar.classList.add("ss-hidden"):(i.bar.classList.remove("ss-hidden"),i.bar.style.cssText="height:"+Math.max(100*i.scrollRatio,10)+"%; top:"+i.el.scrollTop/e*100+"%;right:"+a+"px;")})}},e.addEventListener("DOMContentLoaded",a),r.initEl=s,r.initAll=a;var o=r;return o});
|
||||
Reference in New Issue
Block a user