BBnepal-Accounts/assets_teacher/js/main.js
Sampanna Rimal 9cd05ef3cb commitall
2024-07-10 18:28:19 +05:45

164 lines
4.2 KiB
JavaScript

$(document).ready(function(){
$("document").ready(function () {
$(".my-info-header li:nth-child(2)").addClass("blue-line");
});
//mobile-menu
$(".mobileMenu").click(function(){
$(".sideMenu").toggleClass("side-menu-open");
});
//login-mobile-menu
$(".login-mob-menu").click(function(){
$(".mob-menu").toggleClass("mob-menu-open");
});
$(".quest-added").click(function(){
$(this).toggleClass("quest-added-green");
});
$(".check-inactive").click(function(){
$(this).find(".mark-around").toggleClass("mark-green");
});
//calendar
$(function () {
$("#Datepicker1").datepicker({
numberOfMonths: 1,
changeYear:true,
changeMonth:true,
showOtherMonths:true
});
$("#Datepicker2").datepicker({
numberOfMonths: 1,
changeYear:true,
changeMonth:true,
showOtherMonths:true
});
});
//owl-carousel-syllabus-modal
$('ul.tabs li').click(function(){
var tab_id = $(this).attr('data-tab');
$('ul.tabs li').removeClass('current');
$('.tab-content').removeClass('current');
$(this).addClass('current');
$("#"+tab_id).addClass('current');
})
$('.slider1').on('initialized.owl.carousel changed.owl.carousel', function(i) {
if (!i.namespace) {
return;
}
var carousel1 = i.relatedTarget;
$('.slider-no1').text(carousel1.relative(carousel1.current()) + 1 );
$('.tot-slider1').text('/' + carousel1.items().length)
}).owlCarousel({
items: 1,
loop:false,
margin:0,
nav:true
});
//owl carousel-assignment-modal
$('.slider').on('initialized.owl.carousel changed.owl.carousel', function(e) {
if (!e.namespace) {
return;
}
var carousel = e.relatedTarget;
$('.slider-no').text(carousel.relative(carousel.current()) + 1);
$('.tot-slider').text('/' + carousel.items().length);
}).owlCarousel({
items: 1,
loop:false,
margin:0,
nav:true
});
$('.slider3').on('initialized.owl.carousel changed.owl.carousel', function(i) {
if (!i.namespace) {
return;
}
var carousel1 = i.relatedTarget;
$('.slider-no3').text(carousel1.relative(carousel1.current()) + 1 );
$('.tot-slider3').text('/' + carousel1.items().length);
}).owlCarousel({
items: 1,
loop:false,
margin:0,
nav:true
});
//owl-carousel-view-assignment
$('.slider4').on('initialized.owl.carousel changed.owl.carousel', function(k) {
if (!k.namespace) {
return;
}
var carousel4 = k.relatedTarget;
$('.slider-counter4').text(carousel4.relative(carousel4.current()) + 1 + '/' + (carousel4.items().length)) ;
}).owlCarousel({
items: 1,
loop:false,
margin:0,
nav:true
});
//to show input image in a div
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#upImage').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#imgInp").change(function(){
readURL(this);
});
});
//file-upload
var input = document.getElementById( 'upload' );
var infoArea = document.getElementById( 'uploaded-file' );
//input.addEventListener( 'change', showFileName );
function showFileName( event ) {
var input = event.srcElement;
var fileName = input.files[0].name;
infoArea.textContent = fileName;
}
// Hides Notification from header Menu
function delete_notificaton(id, parentLi) {
parentLi.hide();
$.ajax({
url : 'ajax_hide_notification_msg',
data : {notifid : id},
type : 'POST',
async : false,
success: function(data){
let result = JSON.parse(data);
}
});
}
// Nepali Date-picker
if($('.nepal-date').length > 0) {
$('.nepal-date').nepaliDatePicker({
language : 'english',
ndpYear: true,
ndpMonth: true,
ndpYearCount: 10
})
}
let nd = NepaliFunctions.GetCurrentBsDate();
let {year,month,day} = nd;
let curr_nepali_date = year+'-'+month+'-'+day;
// Nepali Date-picker only Future Date
if($('.nepal-date-future').length > 0) {
$('.nepal-date-future').nepaliDatePicker({
language : 'english',
ndpYear: true,
ndpMonth: true,
ndpYearCount: 10,
disableBefore: curr_nepali_date
})
}