jQuery(document).ready(function($) { "use strict"; //------- Notifications Dropdowns $('.top-area > .setting-area > li > a').on("click",function(){ var $parent = $(this).parent('li'); $(this).addClass('active').parent().siblings().children('a').removeClass('active'); $parent.siblings().children('div').removeClass('active'); $(this).siblings('div').toggleClass('active'); return false; }); $("body *").not('.top-area > .setting-area > li > a').on("click", function() { $(".top-area > .setting-area > li > a").removeClass('active'); }); // New submit post box $(".new-postbox").click(function () { $(".postoverlay").fadeIn(500); }); $(".postoverlay").not(".new-postbox").click(function() { $(".postoverlay").fadeOut(500); }); $("[type = submit]").click(function () { var post = $("textarea").val(); $("
" + post + "
").appendTo("section"); }); // top menu list $('.main-menu > span').on('click', function () { $('.nav-list').slideToggle(300); }); // show comments $('.comment').on('click', function () { $(this).parents(".post-meta").siblings(".coment-area").slideToggle("slow"); }); // add / post location $('.add-loc').on('click', function () { $('.add-location-post').slideToggle("slow"); }); // add popup upload from gallery $('.from-gallery').on('click', function () { $('.already-gallery').addClass('active'); }); $('.canceld').on('click', function () { $('.already-gallery').removeClass('active'); }); // Stories slide show $('.story-box').on('click', function () { $('.stories-wraper').addClass('active'); }); $('.close-story').on('click', function () { $('.stories-wraper').removeClass('active'); }); // add popup upload photo $('.edit-prof').on('click', function () { $('.popup-wraper').addClass('active'); }); $('.popup-closed').on('click', function () { $('.popup-wraper, .popup-wraper1').removeClass('active'); }); // Create group friend $('.item-upload').on('click', function () { $('.popup-wraper4').addClass('active'); }); $('.popup-closed').on('click', function () { $('.popup-wraper4').removeClass('active'); }); // Create group friend $('.item-upload.album').on('click', function () { $('.popup-wraper5').addClass('active'); }); $('.popup-closed').on('click', function () { $('.popup-wraper5').removeClass('active'); }); // popup event $('.event-title h4').on('click', function () { $('.popup-wraper').addClass('active'); }); // chat messenger remove unread $('.msg-pepl-list .nav-item').on('click', function () { $(this).removeClass('unread'); }); // select gender on pitpoint page $('.select-gender > li').click( function() { $(this).addClass('selected').siblings().removeClass('selected'); }); // select amount on donation page $('.amount-select > li').click( function() { $(this).addClass('active').siblings().removeClass('active'); }); // select pay method on donation page $('.pay-methods > li').click( function() { $(this).addClass('active').siblings().removeClass('active'); }); // popup add user $('.user-add').on('click', function () { $('.popup-wraper6').addClass('active'); }); $('.popup-closed').on('click', function () { $('.popup-wraper6').removeClass('active'); return false; }); // popup send message $('.send-mesg').on('click', function () { $('.popup-wraper1').addClass('active'); return false; }); // popup report post $('.bad-report').on('click', function () { $('.popup-wraper3').addClass('active'); return false; }); $('.popup-closed, .cancel').on('click', function () { $('.popup-wraper3').removeClass('active'); return false; }); // comments popup jQuery(window).on("load", function(){ $('.show-comt').bind('click', function () { $('.pit-comet-wraper').addClass('active'); }); }); // comments popup $('.add-pitrest > a, .pitred-links > .main-btn, .create-pst').on('click', function () { $('.popup-wraper').addClass('active'); return false; }); // share post popup $('.share-pst').on('click', function () { $('.popup-wraper2').addClass('active'); return false; }); $('.popup-closed, .cancel').on('click', function () { $('.popup-wraper2').removeClass('active'); }); // messenger call popup $('.audio-call, .video-call').on('click', function () { $('.call-wraper').addClass('active'); }); $('.decline-call, .later-rmnd').on('click', function () { $('.call-wraper').removeClass('active'); }); // drag drop widget $( init ); function init() { $( ".droppable-area1, .droppable-area2" ).sortable({ connectWith: ".connected-sortable", stack: '.connected-sortable ul' }).disableSelection(); } //--- heart like and unlike var counter = 0; var animated = false; $('.heart').click(function(){ if(!animated){ $(this).addClass('happy').removeClass('broken'); animated = true; counter++; $(this).children('span').text(counter); } else { $(this).removeClass('happy').addClass('broken'); animated = false; counter--; $(this).children('span').text(counter); } }); // search fadein out at navlist area $('.search-data').on('click', function () { $( ".searchees" ).fadeIn( "slow", function() { }); return false; }); $('.cancel-search').on('click', function () { $( ".searchees" ).fadeOut( "slow", function() { }); return false; }); //------- remove class active on body $("body *").not('.top-area > .setting-area > li > a').on("click", function() { $(".top-area > .setting-area > li > div").not('.searched').removeClass('active'); }); //--- user setting dropdown on topbar $('.user-img').on('click', function() { $('.user-setting').toggleClass("active"); }); //--- side message box $('.friendz-list > li, .chat-users > li, .drops-menu > li > a.show-mesg').on('click', function() { $('.chat-box').addClass("show"); return false; }); $('.close-mesage').on('click', function() { $('.chat-box').removeClass("show"); return false; }); //------ scrollbar plugin if ($.isFunction($.fn.perfectScrollbar)) { $('.dropdowns, .twiter-feed, .invition, .followers, .chatting-area, .peoples, #people-list, .chat-list > ul, .message-list, .chat-users, .left-menu, .sugestd-photo-caro, .popup.events, .related-tube-psts, .music-list, .more-songs, .media > ul, .conversations, .msg-pepl-list, .menu-slide, .frnds-stories').perfectScrollbar(); } /*--- socials menu scritp ---*/ $('.trigger').on("click", function() { $(this).parent(".menu").toggleClass("active"); }); /*--- left menu full ---*/ $('.menu-small').on("click", function() { $(".fixed-sidebar.left").addClass("open"); }); $('.closd-f-menu').on("click", function() { $(".fixed-sidebar.left").removeClass("open"); }); /*--- emojies show on text area ---*/ $('.add-smiles > span, .smile-it').on("click", function() { $(this).siblings(".smiles-bunch").toggleClass("active"); }); $('.smile-it').on("click", function() { $(this).children(".smiles-bunch").toggleClass("active"); }); //save post click $('.save-post, .bane, .get-link').on("click", function() { $(this).toggleClass("save"); }); // delete notifications $('.notification-box > ul li > i.del').on("click", function(){ $(this).parent().slideUp(); return false; }); /*--- socials menu scritp ---*/ $('.f-page > figure i').on("click", function() { $(".drop").toggleClass("active"); }); //select photo in upload photo popup $('.sugestd-photo-caro > li').on('click', function() { $(this).toggleClass('active'); return false; }); //--- pitred point adding $('.minus').click(function () { var $input = $(this).parent().find('input'); $('.minus').on("click", function() { $(this).siblings('input').removeClass("active"); $(this).siblings('.plus').removeClass("active"); }); var count = parseInt($input.val()) - 1; count = count < 1 ? 0 : count; $input.val(count); $input.change(); return false; }); $('.plus').click(function () { var $input = $(this).parent().find('input'); $('.plus').on("click", function() { $(this).addClass("active"); $(this).siblings('input').addClass("active"); }); $input.val(parseInt($input.val()) + 1); $input.change(); return false; }); //Link copied on click $(".get-link").click(function (event) { event.preventDefault(); CopyToClipboard("This is some test value.", true, "Link copied"); }); function CopyToClipboard(value, showNotification, notificationText) { var $temp = $(""); $("body").append($temp); $temp.val(value).select(); document.execCommand("copy"); $temp.remove(); if (typeof showNotification === 'undefined') { showNotification = true; } if (typeof notificationText === 'undefined') { notificationText = "Copied to clipboard"; } var notificationTag = $("div.copy-notification"); if (showNotification && notificationTag.length == 0) { notificationTag = $("", { "class": "copy-notification", text: notificationText }); $("body").append(notificationTag); notificationTag.fadeIn("slow", function () { setTimeout(function () { notificationTag.fadeOut("slow", function () { notificationTag.remove(); }); }, 1000); }); } } //===== Search Filter =====// (function ($) { // custom css expression for a case-insensitive contains() jQuery.expr[':'].Contains = function(a,i,m){ return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0; }; function listFilter(searchDir, list) { var form = $("