var $devotion = jQuery.noConflict();
function devotionSetQuickLinks() {
if ($devotion(window).scrollTop() >= $devotion('.devotion-jump-links').offset().top - 62) {
$devotion('.devotion-jump-links').addClass('fixed')
} else {
$devotion('.devotion-jump-links').removeClass('fixed')
}
}
$devotion(document).ready(function () {
// Initialise if jumplinks are present
if ($devotion('.devotion-jump-links').length) {
$devotion('.devotion-jump-links .links-trigger').click(function (e) {
e.preventDefault();
$devotion('.devotion-jump-links .links').slideToggle(250);
});
$devotion('.devotion-jump-links .links a').click(function (e) {
e.preventDefault();
e.stopPropagation();
$devotion('.devotion-jump-links .links').slideUp(250);
$devotion('html, body').animate({scrollTop: $devotion($devotion(this).attr('href')).offset().top}, 250)
$devotion('.devotion-jump-links .links-trigger').text($devotion(this).text())
});
$devotion(window).scroll(function (e) {
self.devotionSetQuickLinks()
});
}
});
window.devotionInit = function () {
$devotion(document).ready(function () {
$devotion('.devotion-tombstone-carousel').each(function (i, el) {
// init carousel
var swiper = new Swiper($devotion(el).find('.swiper:not(.swiper-initialized)').get(0), {
slidesPerView: 1,
spaceBetween: 20,
loop: true,
// Navigation arrows
navigation: {
nextEl: $devotion(el).find('.swiper-button-next').get(0),
prevEl: $devotion(el).find('.swiper-button-prev').get(0),
},
breakpoints: {
// when window width is >= 320px
600: {
slidesPerView: 2,
spaceBetween: 20
},
// when window width is >= 480px
900: {
slidesPerView: 3,
spaceBetween: 30
}
}
});
});
$devotion('.devotion-tv-advanced-chart').each(function (i, el) {
$devotion(el).attr('id', 'tvac_widget');
new TradingView.widget(
{
"width": "100%",
"height": "500",
"symbol": "ASX:AND",
"interval": "D",
"timezone": "Etc/UTC",
"theme": "light",
"style": "1",
"locale": "en",
"toolbar_bg": "#f1f3f6",
"enable_publishing": false,
"allow_symbol_change": true,
"container_id": "tvac_widget"
}
);
$devotion(el).removeClass('devotion-tv-advanced-chart')
})
$devotion('.devotion-tv-symbol-info').each(function (i, el) {
let $script = $devotion("",
{
type: "text/javascript",
src: "https://s3.tradingview.com/external-embedding/embed-widget-symbol-info.js",
async: ""
});
$script.html(JSON.stringify({
symbol: 'ASX:AND',
width: '100%',
locale: 'en',
colorTheme: 'light',
isTransparent: false
}));
$devotion(".devotion-tv-symbol-info").after($script)
$devotion(el).removeClass('devotion-tv-symbol-info')
});
$devotion('.devotion-tv-symbol-profile').each(function (i, el) {
let $script = $devotion("",
{
type: "text/javascript",
src: "https://s3.tradingview.com/external-embedding/embed-widget-symbol-profile.js",
async: ""
});
$script.html(JSON.stringify({
symbol: 'ASX:AND',
width: '100%',
height: '400',
colorTheme: 'light',
isTransparent: false,
locale: 'en'
}));
$devotion(".devotion-tv-symbol-profile").after($script)
$devotion(el).removeClass('devotion-tv-symbol-profile')
});
});
};
$devotion(document).ready(function () {
window.devotionInit();
});