Advertisement
fs0c131y

Untitled

Mar 28th, 2019
1,000
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.19 KB | None | 0 0
  1. /**
  2. *
  3. */
  4. /*
  5. if (navigator.serviceWorker) {
  6. window.addEventListener('load', function() {
  7. navigator.serviceWorker.register('/service-worker.js').then(function(registration) {
  8. }).catch(function(err) {
  9. });
  10. });
  11. } */
  12.  
  13. $("#close-btn").click(function(){
  14. $(".navbar-collapse").removeClass('show');
  15. });
  16.  
  17. $(document).ready(function(){
  18. $('.bxslider').bxSlider({
  19. auto: '',
  20. controls:false,
  21. });
  22.  
  23. $('.bxslider-thumbnail').bxSlider({
  24. auto: '',
  25. pager:false,
  26. slideWidth: 385,
  27. minSlides: 1,
  28. maxSlides:5,
  29. moveSlides: 1,
  30. slideMargin: 0,
  31. speed: 450,
  32. infiniteLoop: false
  33. });
  34.  
  35.  
  36. $(window).scroll(function(){
  37. if( $(window).scrollTop() > 40 ){
  38. $("#header").addClass("sticky");
  39. $("#topbar").addClass("hide");
  40. } else{
  41. $("#header").removeClass("sticky");
  42. $("#topbar").removeClass("hide");
  43. }
  44. });
  45.  
  46. $(".tp-slider").owlCarousel({
  47. items: 1,
  48. smartSpeed: 800,
  49. loop: true,
  50. // autoplay: true
  51. });
  52.  
  53. $(".pv-slider").owlCarousel({
  54. items: 1,
  55. smartSpeed: 1000,
  56. loop: true,
  57. animateOut: 'fadeOut',
  58. autoplaySpeed: true,
  59. autoplay: true
  60. });
  61.  
  62. // Slick Slider
  63. $('.oj-slide').slick({
  64. slidesToShow: 1,
  65. slidesToScroll: 1,
  66. arrows: false,
  67. adaptiveHeight: true,
  68. infinite: false,
  69. useTransform: true,
  70. speed: 800,
  71. // fade: true,
  72. // autoplay: true,
  73. autoplaySpeed: 4000,
  74. });
  75.  
  76. $('.oj-slide-nav')
  77. .on('init', function(event, slick) {
  78. $('.oj-slide-nav .slick-slide.slick-current').addClass('is-active');
  79. })
  80. .slick({
  81. slidesToShow: 11,
  82. slidesToScroll: 11,
  83. dots: false,
  84. focusOnSelect: false,
  85. infinite: false,
  86. margin: 15,
  87. prevArrow: '<span class="oj-prev"><i class="fa fa-angle-left"></i></span>',
  88. nextArrow: '<span class="oj-next"><i class="fa fa-angle-right"></i></span>',
  89. responsive: [{
  90. breakpoint: 1300,
  91. settings: {
  92. slidesToShow: 8,
  93. slidesToScroll: 8,
  94. }
  95. }, {
  96. breakpoint: 991,
  97. settings: {
  98. slidesToShow: 6,
  99. slidesToScroll: 6,
  100. }
  101. }, {
  102. breakpoint: 767,
  103. settings: {
  104. slidesToShow: 2,
  105. slidesToScroll: 2,
  106. }
  107. }]
  108. });
  109.  
  110. $('.oj-slide').on('afterChange', function(event, slick, currentSlide) {
  111. $('.oj-slide-nav').slick('slickGoTo', currentSlide);
  112. var currrentNavSlideElem = '.oj-slide-nav .slick-slide[data-slick-index="' + currentSlide + '"]';
  113. $('.oj-slide-nav .slick-slide.is-active').removeClass('is-active');
  114. $(currrentNavSlideElem).addClass('is-active');
  115. });
  116.  
  117. $('.oj-slide-nav').on('click', '.slick-slide', function(event) {
  118. event.preventDefault();
  119. var goToSingleSlide = $(this).data('slick-index');
  120.  
  121. $('.oj-slide').slick('slickGoTo', goToSingleSlide);
  122. });
  123.  
  124. var inspiration = $('.inspiration');
  125. inspiration.owlCarousel({
  126. autoplay: true,
  127. smartSpeed: 1000,
  128. items:1,
  129. nav: true,
  130. navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
  131. onInitialized : counter, //When the plugin has initialized.
  132. onTranslated : counter //When the translation of the stage has finished.
  133. });
  134.  
  135. function counter(event) {
  136. var element = event.target; // DOM element, in this example .owl-carousel
  137. var items = event.item.count; // Number of items
  138. var item = event.item.index + 1; // Position of the current item
  139. $('#counter').html(item+"/"+items)
  140. }
  141.  
  142. $(".dream-india").owlCarousel({
  143. responsiveClass: true,
  144. nav: true,
  145. navText:['',''],
  146. responsive: {
  147. 0: {
  148. items: 1,
  149. },
  150. 320: {
  151. items: 1,
  152. },
  153. 500: {
  154. items: 2,
  155. },
  156. 700: {
  157. items: 3,
  158. },
  159. 991: {
  160. items: 4,
  161. }
  162. }
  163. });
  164.  
  165. $(".fp-btn").click(function(e){
  166. e.preventDefault();
  167. e.stopPropagation();
  168. $("#MobileOnlyStates").addClass("open");
  169. });
  170.  
  171. $("#MobileOnlyStates .crosss").click(function(e) {
  172. e.preventDefault();
  173. e.stopPropagation();
  174. $("#MobileOnlyStates").removeClass("open");
  175. });
  176.  
  177. // setHeight in mobile browser for content
  178. setTimeout(function(){
  179. var getWinHeight = $(window).innerHeight();
  180. $('.pv-slide-section .pv-slide-item, .tp-slide-section .tp-slide-item, .oj-slide-section .oj-item, .inspiration-section .inspiration-item, .dream-india .dream-item, .journey, .home-social-block-section .fp-scrollable').css({'min-height': getWinHeight, 'height' : getWinHeight});
  181. $(window).resize(function(){
  182. $('.pv-slide-section .pv-slide-item, .tp-slide-section .tp-slide-item, .oj-slide-section .oj-item, .inspiration-section .inspiration-item, .dream-india .dream-item, .journey, .home-social-block-section .fp-scrollable').css({'min-height': getWinHeight, 'height' : getWinHeight});
  183. })
  184. }, 1000);
  185.  
  186. setTimeout(function(){
  187. var winHeight = $(window).height();
  188. $(".ig-slider, .video-banner").css({'height' : winHeight-120, 'overflow' : 'hidden'});
  189. $(window).resize(function(){
  190. var winHeight = $(window).height();
  191. $(".ig-slider, .video-banner").css({'height' : winHeight-120, 'overflow' : 'hidden'});
  192. })
  193. }, 500)
  194.  
  195. $(document).on('click', 'a[href^="#"]:not(".nav-tabs a ,#faqPage a, .updte-pro-tab a")', function(e) {
  196. var id = $(this).attr('href');
  197. var $id = $(id);
  198. if ($id.length === 0) {
  199. return;
  200. }
  201. e.preventDefault();
  202. var pos = $id.offset().top;
  203. $('body, html').animate({scrollTop: pos}, 800);
  204. });
  205.  
  206. $(".bjpmember").click(function(e){
  207. e.preventDefault();
  208. e.stopPropagation();
  209. $(".client-detail-wrap").fadeIn('slow');
  210. $("body").addClass('hidden');
  211. });
  212.  
  213. $(".client-detail-wrap .crosss").click(function(){
  214. $(".client-detail-wrap").fadeOut('slow');
  215. $("body").removeClass('hidden');
  216. });
  217.  
  218. $('.client-detail').click(function(e){
  219. e.stopPropagation();
  220. });
  221.  
  222. $(window).click(function(){
  223. $(".client-detail-wrap").fadeOut('slow');
  224. $("body").removeClass('hidden');
  225. });
  226. });
  227.  
  228. $("#topbar .search").click(function(e){
  229. $("#searchAutocomplete").show();
  230. });
  231.  
  232. $(document).mouseup(function(e)
  233. {
  234. var container = $("#searchAutocomplete");
  235.  
  236. // if the target of the click isn't the container nor a descendant of the container
  237. if (!container.is(e.target) && container.has(e.target).length === 0)
  238. {
  239. container.hide();
  240. }
  241. });
  242. $('.placeholder').click(function() {
  243. $(this).siblings('input').focus();
  244. });
  245. $('.required').focus(function() {
  246. $(this).siblings('.placeholder').hide();
  247. });
  248. $('.required').blur(function() {
  249. var $this = $(this);
  250. if ($this.val().length == 0)
  251. $(this).siblings('.placeholder').show();
  252. });
  253. $('.required').blur();
  254.  
  255. $('.clickClose').on('click',function(e) {
  256. var closeFrgtBtn = "true";
  257. localStorage.setItem('closeFrgtBtn',closeFrgtBtn);
  258. $('.placeholder').css('display','block');
  259. $('input[type="text"]').val('');
  260. $('input[type="password"]').val('');
  261.  
  262. });
  263. $(document).ready(function() {
  264. localStorage.removeItem('closeFrgtBtn');
  265. localStorage.removeItem('closeBtn');
  266. });
  267.  
  268. jQuery(document).ready(function() {
  269. $("#loginForm").on('submit', function (e) {
  270. e.preventDefault();
  271. if ($("#loginForm").valid()) {
  272. jQuery(".loadgif").show();
  273. var header = $('#redirect').text();
  274. var email = $("#loginEmail").val();
  275. var password = $("#loginPassword").val();
  276. var email = CryptoJS.AES.encrypt(JSON.stringify(email),'123456789', {format: CryptoJSAesJson}).toString();
  277. var password = CryptoJS.AES.encrypt(JSON.stringify(password),'123456789', {format: CryptoJSAesJson}).toString();
  278. var data = {
  279. "email": email,
  280. "password": password,
  281. "locale": lang
  282. }
  283. $.ajax({
  284. url: siteUrl + '/Login/dologin',
  285. type: 'POST',
  286. dataType: "json",
  287. data: data,
  288. async: true,
  289. success: function (data) {
  290. jQuery(".loadgif").hide();
  291. $('p.error').css('display', 'block');
  292. if (data.success) {
  293. if (data.loginWith == "email") {
  294. $("#loginErrorMsg").html(data.message);
  295. $("#loginErrorMsg").css("color", "green");
  296. if (data.lastLogin != "" && data.lastLogin != null && data.isPwdUpdated != 0) {
  297. if (header == 1) {
  298. var redirectURL = '/' + lang + '' + '/myprofile';
  299. $(location).attr('href', redirectURL);
  300. } else {
  301. if(header == 2) {
  302. makebookmark();
  303. }
  304. location.reload();
  305. }
  306. } else {
  307. $(".loginBox").hide();
  308. $(".changePwdBox").show();
  309. }
  310. } else {
  311. localStorage.setItem('EmailforOtp', data.mobileNo);
  312. localStorage.setItem('EmailforPassword', data.password);
  313. $("#otpToken").val(data.accessKey);
  314. $(".loginBox").hide();
  315. $(".otpBox").show();
  316. }
  317.  
  318. //
  319. } else {
  320. $("#loginErrorMsg").html(data.message);
  321. $("#loginErrorMsg").css("color", "red");
  322.  
  323. }
  324. }
  325. });
  326.  
  327. } else {
  328. $('p.error').css('display', 'block');
  329.  
  330. }
  331.  
  332. });
  333.  
  334. $("#fgtPwdForm").on('submit',function(e){
  335. e.preventDefault();
  336. if($("#fgtPwdForm").valid()){
  337. jQuery("#forgotPwd-loadgif").show();
  338. var fgtpwdemail = $("#fgtpwdemail").val();
  339. $.ajax({
  340. url: siteUrl + '/Login/forgotPwd',
  341. type: 'POST',
  342. dataType: "json",
  343. data: {
  344. "email":fgtpwdemail,
  345. "locale": lang
  346. },
  347. async: true,
  348. success: function(data) {
  349. jQuery("#forgotPwd-loadgif").hide();
  350. $('p.error').css('display','block');
  351. if(data.success == true){
  352. if(data.medium == "phone"){
  353. $(".fgtPwdBox").hide();
  354. $(".forgotPwdotpBox").show();
  355. $("#fgtPwdErrorMsg").html(data.message);
  356. $(".modal .error").css("color","green");
  357. localStorage.setItem('MobileforForgotOtp' , data.mobile);
  358. }else{
  359. $(".modal .error").css("color","green");
  360. $("#fgtPwdErrorMsg").html(data.message);
  361. }
  362. }else{
  363. $(".modal .error").css("color","red");
  364. $("#fgtPwdErrorMsg").html(data.message);
  365. }
  366.  
  367. }
  368. });
  369. } else {
  370. $('p.error').css('display','block');
  371.  
  372. }
  373. });
  374.  
  375. $("#forgotPwdotpForm").on('submit',function(e){
  376. e.preventDefault();
  377. if($("#forgotPwdotpForm").valid()){
  378. jQuery(".loadgif").show();
  379. var otp = $("#forgotPwdotp").val();
  380. $.ajax({
  381. url: siteUrl + '/Login/forgotPwdotpLogin',
  382. type: 'POST',
  383. dataType: "json",
  384. data: {
  385. "otp":otp,
  386. "email" : localStorage.getItem('MobileforForgotOtp')
  387. },
  388. async: true,
  389. success: function(data) {
  390. jQuery(".loadgif").hide();
  391. if(data.success){
  392. //location.reload();
  393. $(".forgotPwdotpBox").hide();
  394. $('#fgtPwdBox').hide();
  395. $(".fgtPwdResetBox").show();
  396. $("#fgtPwdresetSlug").val(data.resetToken);
  397. }else{
  398. $("#ForgotPwdOTPErrorMsg").html(data.message);
  399. }
  400. }
  401. });
  402.  
  403. }
  404. });
  405.  
  406. $("#fgtPwdResetForm").on('submit',function(e){
  407. e.preventDefault();
  408. if($("#fgtPwdResetForm").valid()){
  409. jQuery(".fgtPwdResetLoader").show();
  410. var fgtpwdpassword = $("#fgtpwdpassword").val();
  411. var fgtpwdConfpassword = $("#fgtpwdConfpassword").val();
  412. var fgtPwdresetSlug = $("#fgtPwdresetSlug").val();
  413. $.ajax({
  414. url: siteUrl + '/Login/forgotPwdReset',
  415. type: 'POST',
  416. dataType: "json",
  417. data: {
  418. "fgtpwdpassword":fgtpwdpassword,
  419. "fgtpwdConfpassword":fgtpwdConfpassword,
  420. "fgtPwdresetSlug":fgtPwdresetSlug,
  421. "locale": lang
  422. },
  423. async: true,
  424. success: function(data) {
  425. jQuery(".fgtPwdResetLoader").hide();
  426. console.log(data,"hjhsa");
  427. if(data.success == true){
  428. var redirectURL = '/'+lang+''+'/MyProfile';
  429. $(location).attr('href', redirectURL);
  430. $("#fgtPwdResetErrorMsg").html(data.message);
  431. $("#fgtPwdResetErrorMsg").css("color","green");
  432. }else{
  433. $("#fgtPwdResetErrorMsg").html(data.message);
  434. }
  435.  
  436. }
  437. });
  438. }
  439. });
  440.  
  441. $("#changePwdForm").on('submit',function(e){
  442. e.preventDefault();
  443. if($("#changePwdForm").valid()){
  444. console.log("manasa");
  445. jQuery(".loadgif").show();
  446. var oldPassword = $("#oldPassword").val();
  447. var oldPassword = CryptoJS.AES.encrypt(JSON.stringify(oldPassword),'123456789', {format: CryptoJSAesJson}).toString();
  448. var newPassword = $("#newPassword").val();
  449. var newPassword = CryptoJS.AES.encrypt(JSON.stringify(newPassword),'123456789', {format: CryptoJSAesJson}).toString();
  450. var confirmPassword = $("#confirmPassword").val();
  451. var confirmPassword = CryptoJS.AES.encrypt(JSON.stringify(confirmPassword),'123456789', {format: CryptoJSAesJson}).toString();
  452. $.ajax({
  453. url: siteUrl + '/Login/firstPwdChange',
  454. type: 'POST',
  455. dataType: "json",
  456. data: {
  457. "newPassword": newPassword,
  458. "confirmPassword": confirmPassword,
  459. "oldPassword": oldPassword,
  460. "locale": lang
  461. },
  462. async: true,
  463. success: function(data) {
  464. console.log(data);
  465. if(data.success == true){
  466. setTimeout(function(){
  467. jQuery(".loadgif").hide();
  468.  
  469. }, 500);
  470. if(data.previousispwdUpdated == 0 || data.previousispwdUpdated == "false"){
  471. $(".changePwdBox").hide();
  472. $(".saPopup").show();
  473. }else{
  474. setTimeout(function(){
  475. $('#loginModal').modal('hide');
  476. $("#changePwdForm")[0].reset();
  477. }, 500);
  478. }
  479. $("#CPErrorMsg").html(data.message);
  480. $("#CPErrorMsg").css("color","green");
  481. }else{
  482. jQuery(".loadgif").hide();
  483. $("#CPErrorMsg").css({"display": "block", "color": "red"});
  484. jQuery("#CPErrorMsg").html(data.message);
  485. }
  486.  
  487. }
  488. });
  489. }
  490. });
  491.  
  492. $("#namoLoginForm").on('submit',function(e){
  493. e.preventDefault();
  494. if($("#namoLoginForm").valid()){
  495. var email = $("#email").val();
  496. jQuery(".namo-loader").show();
  497. $.ajax({
  498. url: siteUrl + '/Login/namoLogin',
  499. type: 'POST',
  500. dataType: "json",
  501. data: {
  502. "email": email,
  503. "locale": lang
  504. },
  505. async: true,
  506. success: function(data) {
  507. if(data.success){
  508. jQuery(".namo-loader").hide();
  509. $(location).attr('href', data.url);
  510. }
  511. else
  512. {
  513. jQuery(".namo-loader").hide();
  514. $("#namoErrorMsg").html(data.message);
  515. }
  516. }
  517. });
  518. }
  519. });
  520. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement