MIF_E31211459/public/admin/assets/js/script.js

305 lines
8.7 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function($) {
"use strict";
$(".mobile-toggle").click(function(){
$(".nav-menus").toggleClass("open");
});
$(".mobile-toggle-left").click(function(){
$(".left-header").toggleClass("open");
});
$(".mobile-search").click(function(){
$(".form-control-plaintext").toggleClass("open");
});
$(".bookmark-search").click(function(){
$(".form-control-search").toggleClass("open");
})
$(".filter-toggle").click(function(){
$(".product-sidebar").toggleClass("open");
});
$(".toggle-data").click(function(){
$(".product-wrapper").toggleClass("sidebaron");
});
$(".form-control-search").keyup(function(e){
if(e.target.value) {
$(".page-wrapper.horizontal-wrapper").addClass("offcanvas-bookmark");
} else {
$(".page-wrapper.horizontal-wrapper").removeClass("offcanvas-bookmark");
}
});
})(jQuery);
$('.loader-wrapper').fadeOut('slow', function() {
$(this).remove();
});
$(window).on('scroll', function() {
if ($(this).scrollTop() > 600) {
$('.tap-top').fadeIn();
} else {
$('.tap-top').fadeOut();
}
});
$('.media-size-email svg').on('click', function (e) {
$(this).toggleClass("like");
});
$('.tap-top').click( function() {
$("html, body").animate({
scrollTop: 0
}, 600);
return false;
});
function toggleFullScreen() {
if ((document.fullScreenElement && document.fullScreenElement !== null) ||
(!document.mozFullScreen && !document.webkitIsFullScreen)) {
if (document.documentElement.requestFullScreen) {
document.documentElement.requestFullScreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullScreen) {
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
}
(function($, window, document, undefined) {
"use strict";
var $ripple = $(".js-ripple");
$ripple.on("click.ui.ripple", function(e) {
var $this = $(this);
var $offset = $this.parent().offset();
var $circle = $this.find(".c-ripple__circle");
var x = e.pageX - $offset.left;
var y = e.pageY - $offset.top;
$circle.css({
top: y + "px",
left: x + "px"
});
$this.addClass("is-active");
});
$ripple.on(
"animationend webkitAnimationEnd oanimationend MSAnimationEnd",
function(e) {
$(this).removeClass("is-active");
});
})(jQuery, window, document);
// active link
$(".chat-menu-icons .toogle-bar").click(function(){
$(".chat-menu").toggleClass("show");
});
// Language
var tnum = 'en';
$(document).ready(function () {
if (localStorage.getItem("primary") != null) {
var primary_val = localStorage.getItem("primary");
$("#ColorPicker1").val(primary_val);
var secondary_val = localStorage.getItem("secondary");
$("#ColorPicker2").val(secondary_val);
}
$(document).click(function (e) {
$('.translate_wrapper, .more_lang').removeClass('active');
});
$('.translate_wrapper .current_lang').click(function (e) {
e.stopPropagation();
$(this).parent().toggleClass('active');
setTimeout(function () {
$('.more_lang').toggleClass('active');
}, 5);
});
/*TRANSLATE*/
translate(tnum);
$('.more_lang .lang').click(function () {
$(this).addClass('selected').siblings().removeClass('selected');
$('.more_lang').removeClass('active');
var i = $(this).find('i').attr('class');
var lang = $(this).attr('data-value');
var tnum = lang;
translate(tnum);
$('.current_lang .lang-txt').text(lang);
$('.current_lang i').attr('class', i);
});
});
function translate(tnum) {
$('.lan-1').text(trans[0][tnum]);
$('.lan-2').text(trans[1][tnum]);
$('.lan-3').text(trans[2][tnum]);
$('.lan-4').text(trans[3][tnum]);
$('.lan-5').text(trans[4][tnum]);
$('.lan-6').text(trans[5][tnum]);
$('.lan-7').text(trans[6][tnum]);
$('.lan-8').text(trans[7][tnum]);
$('.lan-9').text(trans[8][tnum]);
}
var trans = [{
en: 'General',
pt: 'Geral',
es: 'Generalo',
fr: 'Générale',
de: 'Generel',
cn: '一般',
ae: 'حجنرال لواء'
}, {
en: 'Dashboards,widgets & layout.',
pt: 'Painéis, widgets e layout.',
es: 'Paneloj, fenestraĵoj kaj aranĝo.',
fr: "Tableaux de bord, widgets et mise en page.",
de: 'Dashboards, widgets en lay-out.',
cn: '仪表板,小工具和布局。',
ae: 'لوحات المعلومات والأدوات والتخطيط.'
}, {
en: 'Dashboards',
pt: 'Painéis',
es: 'Paneloj',
fr: 'Tableaux',
de: 'Dashboards',
cn: ' 仪表板 ',
ae: 'وحات القيادة '
}, {
en: 'Default',
pt: 'Padrão',
es: 'Vaikimisi',
fr: 'Défaut',
de: 'Standaard',
cn: '電子商務',
ae: 'وإفتراضي'
}, {
en: 'Ecommerce',
pt: 'Comércio eletrônico',
es: 'Komerco',
fr: 'Commerce électronique',
de: 'E-commerce',
cn: '電子商務',
ae: 'والتجارة الإلكترونية'
}, {
en: 'Widgets',
pt: 'Ferramenta',
es: 'Vidin',
fr: 'Widgets',
de: 'Widgets',
cn: '小部件',
ae: 'والحاجيات'
}, {
en: 'Page layout',
pt: 'Layout da página',
es: 'Paĝa aranĝo',
fr: 'Tableaux',
de: 'Mise en page',
cn: 'é é¢ä½ˆå±€',
ae: 'وتخطيط الصفحة'
}, {
en: 'Applications',
pt: 'Formulários',
es: 'Aplikoj',
fr: 'Applications',
de: 'Toepassingen',
cn: 'æ‡‰ç”¨é ˜åŸŸ',
ae: 'والتطبيقات'
}, {
en: 'Ready to use Apps',
pt: 'Pronto para usar aplicativos',
es: 'Preta uzi Apps',
fr: ' Applications prêtes à lemploi ',
de: 'Klaar om apps te gebruiken',
cn: '仪表板',
ae: 'جاهز لاستخدام التطبيقات'
},
];
/*=====================
02. Background Image js
==========================*/
$(".bg-center").parent().addClass('b-center');
$(".bg-img-cover").parent().addClass('bg-size');
$('.bg-img-cover').each(function () {
var el = $(this),
src = el.attr('src'),
parent = el.parent();
parent.css({
'background-image': 'url(' + src + ')',
'background-size': 'cover',
'background-position': 'center',
'display': 'block'
});
el.hide();
});
/*----------------------------------------
passward show hide
----------------------------------------*/
$('.show-hide').show();
$('.show-hide span').addClass('show');
$('.show-hide span').click(function () {
if ($(this).hasClass('show')) {
$('input[name="login[password]"]').attr('type', 'text');
$(this).removeClass('show');
} else {
$('input[name="login[password]"]').attr('type', 'password');
$(this).addClass('show');
}
});
$('form button[type="submit"]').on('click', function () {
$('.show-hide span').addClass('show');
$('.show-hide').parent().find('input[name="login[password]"]').attr('type', 'password');
});
//landing header //
$(".toggle-menu").click(function(){
$('.landing-menu').toggleClass('open');
});
$(".menu-back").click(function(){
$('.landing-menu').toggleClass('open');
});
$('.product-size ul li ').on('click', function(e) {
$(".product-size ul li ").removeClass("active");
$(this).addClass("active");
});
$('.email-sidebar .email-aside-toggle ').on('click', function(e) {
$(".email-sidebar .email-left-aside ").toggleClass("open");
});
$('.job-sidebar .job-toggle ').on('click', function(e) {
$(".job-sidebar .job-left-aside ").toggleClass("open");
});