| 1 |
; (function ($) { |
| 2 |
const hash = window.location.hash.replace('#', '').split('#')[1]; |
| 3 |
$(window).on('hashchange', function() { |
| 4 |
let hash = window.location.hash.replace('#', '').split('#')[1]; |
| 5 |
|
| 6 |
if ('get-start' === hash || 'recommended' === hash || 'lite-to-pro' === hash || 'pro-plugins' === hash || '#tab=help' === window.location.hash) { |
| 7 |
$('.darkify-nav.darkify-nav-options ul li:last-child a').addClass('darkify-active'); |
| 8 |
$('.darkify-section[data-section-id="help"]').show(); |
| 9 |
} |
| 10 |
if( !hash && '#tab=help' !== window.location.hash ) { |
| 11 |
$('.darkify-section[data-section-id="help"]').hide(); |
| 12 |
} |
| 13 |
}) |
| 14 |
// Help page tab menu script. |
| 15 |
$('.darkify').on('click', '.header_nav_left a', function (e) { |
| 16 |
if ($(this).hasClass('active')) { |
| 17 |
return; |
| 18 |
} |
| 19 |
let tabId = $(this).attr('data-id'); |
| 20 |
$('.header_nav_left a').each((i, item) => { |
| 21 |
$(item).removeClass('active'); |
| 22 |
$('#' + $(item).attr('data-id')).css('display', 'none'); |
| 23 |
}) |
| 24 |
$(this).addClass('active'); |
| 25 |
|
| 26 |
$('#' + tabId).css('display', 'block'); |
| 27 |
}) |
| 28 |
|
| 29 |
if ('get-start' === hash || 'recommended' === hash || 'lite-to-pro' === hash || 'pro-plugins' === hash) { |
| 30 |
$('.darkify-nav.darkify-nav-options ul li:last-child a').addClass('darkify-active'); |
| 31 |
$('.darkify-section[data-section-id="help"]').show(); |
| 32 |
} |
| 33 |
|
| 34 |
if ('get-start' === hash) { |
| 35 |
$('.darkify .header_nav a[data-id="get-start-tab"]').trigger('click'); |
| 36 |
} |
| 37 |
|
| 38 |
if ('recommended' === hash) { |
| 39 |
$('.darkify .header_nav a[data-id="recommended-tab"]').trigger('click'); |
| 40 |
} |
| 41 |
if ('lite-to-pro' === hash) { |
| 42 |
$('.darkify .header_nav a[data-id="lite-to-pro-tab"]').trigger('click'); |
| 43 |
} |
| 44 |
if ('pro-plugins' === hash) { |
| 45 |
$('.darkify .header_nav a[data-id="pro-plugins-tab"]').trigger('click'); |
| 46 |
} |
| 47 |
|
| 48 |
$('body').on('click', '.install-now', function (e) { |
| 49 |
var _this = $(this); |
| 50 |
var _href = _this.attr('href'); |
| 51 |
|
| 52 |
_this.addClass('updating-message').html('Installing...'); |
| 53 |
|
| 54 |
$.get(_href, function (data) { |
| 55 |
location.reload(); |
| 56 |
}); |
| 57 |
|
| 58 |
e.preventDefault(); |
| 59 |
}); |
| 60 |
|
| 61 |
document.addEventListener("DOMContentLoaded", function () { |
| 62 |
const playListItems = document.querySelectorAll(".play_list_item"); |
| 63 |
const iframe = document.querySelector(".video iframe"); |
| 64 |
|
| 65 |
playListItems.forEach(item => { |
| 66 |
item.addEventListener("click", function () { |
| 67 |
// Get the video ID from data attribute |
| 68 |
const videoId = this.getAttribute("data-video_id"); |
| 69 |
|
| 70 |
// Update iframe source |
| 71 |
iframe.src = `https://www.youtube.com/embed/${videoId}?autoplay=1`; |
| 72 |
|
| 73 |
// Remove 'active' class from all items |
| 74 |
playListItems.forEach(el => el.classList.remove("active")); |
| 75 |
|
| 76 |
// Add 'active' class to clicked item |
| 77 |
this.classList.add("active"); |
| 78 |
}); |
| 79 |
}); |
| 80 |
}); |
| 81 |
|
| 82 |
})(jQuery); |