PageSourceSearch

https://globalinch.org/wp-content/themes/understrap-child/js/custo…&ver=8ecd85375d39de62bc966d77ffa06932

js globalinch.org collected 2026-10-03 00:25:12 UTC 17,416 bytes, 539 lines download raw bytes

1(function($) {
2
3  var header = $(".navbar");
4  $(window).scroll(function() {
5      var scroll = $(window).scrollTop();
6
7      if (scroll >= 50 && $(this).width() > 50) {
8        console.log(scroll)
9        $('.navbar-bg-crt').addClass("navbar-fixed-top");
10      } else {
11        $('.navbar-bg-crt').removeClass('navbar-fixed-top');
12      }
13  })
14
15
16  $(function() {
17    $('.arrow-right-side-block').html('<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 12 12" style="color: #ca3531"><path fill="currentColor" id="ShopArrow.svg" class="cls-1" d="M945.991,310L946,316h-2v-4.483L935.5,320l-1.5-1.5,8.52-8.5H938v-2l6,0.009V308l0.677,0.01,1.318,0,0,1.507h0V310h-0.009Z" transform="translate(-934 -308)"></path></svg>');
18    if($(".crt-grayed").length > 0 ) {
19
20      var docHeight = $(".crt-grayed").height();
21      console.log("hello change height" + docHeight);
22
23      $(".crt-grayed").html("<div class='crt-parent-gray-full'></div><div class='crt-parent-gray-text'><div class='hidden-content p-2' style='background-color: #DDDDDD'> <span style='font-size:22px;'><strong>This is a preview. To access all the essays on the Global InCH Journal a modest subscription cost is being levied to cover costs of hosting, editing, peer reviewing etc. The fee also includes access to the Bibliography. To subscribe, <a target='_blank' href='/subscription-global-inch/'>Click Here</a>.</strong></span> </div></div>" + $(".crt-grayed").html());
24
25      $(".crt-parent-gray")
26      .height(docHeight);
27
28      $(".crt-parent-gray-full")
29      .height(docHeight);
30    
31
32    }
33
34    
35
36    if ((
37      $("body").attr("id") == "indiainch" ||
38      $("body").attr("id") == "globalinch"
39    ) && !$(".crt-grayed").length){
40      console.log("global exected");
41      var myVar = setInterval(resizeWindow, 2000);
42
43      function resizeWindow() {
44        if ($("#disqus_thread").length > 0) {
45          setTimeout(function () {
46            setHeight();
47            myStopFunction();
48          }, 8000);
49        }
50      }
51
52      function myStopFunction() {
53        clearInterval(myVar);
54      }
55
56      setTimeout(function () {
57        setHeight();
58      }, 2000);
59
60      function setHeight() {
61        var index_height =
62          $(window).height() - ($("#wrapper-footer").height() + 85);
63
64        if ($("#wrapper-index").height() < index_height) {
65          $("#wrapper-index").height(index_height);
66        }
67      }
68      $(window).resize(function () {
69        setTimeout(function () {
70          setHeight();
71        }, 2000);
72      });
73    }
74
75
76    if ($(".special-link")[0]) {
77      $('.special-link').html('<svg style="color:red;" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="currentColor" id="ShopArrow.svg" class="cls-1" d="M945.991,310L946,316h-2v-4.483L935.5,320l-1.5-1.5,8.52-8.5H938v-2l6,0.009V308l0.677,0.01,1.318,0,0,1.507h0V310h-0.009Z" transform="translate(-934 -308)"></path></svg>');
78    }
79
80    $("body").on(
81      "click",
82      "#contributors-tab, #innovators-tab, #collectors-tab, #contributors #alphabetical-pagination a, #contributors .crt-pagination ul li a, #innovators #alphabetical-pagination a, #innovators .crt-pagination ul li a",
83      function(event) {
84        var id = $(this).attr("id");
85        event.preventDefault();
86        var page_url = "";
87        if (id == "contributors-tab") {
88          page_url = "/contributor/";
89        } else if (id == "innovators-tab") {
90          page_url = "/innovator/";
91        } else if (id == "collectors-tab") {
92          page_url = "/collector/";
93        } else {
94          page_url = $(this).attr("href");
95        }
96        if (id === undefined) {
97          id = $(this)
98            .closest("div.tab-pane")
99            .attr("aria-labelledby");
100        }
101        console.log(page_url);
102        // var page_url = id == "" ? "/contributor/" : $(this).attr('href');
103        $("#contributors").html(
104          "<span>Craft Revival Trust Contributors</span>"
105        );
106        $.get(page_url, function(html_data) {
107          var part_html_data = $(html_data)
108            .find("#profile")
109            .html();
110          console.log(id);
111          $("#contributors").html(part_html_data);
112          if (id == "innovators-tab") {
113            $("#innovators").html(part_html_data);
114          } else if (id == "collectors-tab") {
115            $("#collectors").html(part_html_data);
116          }
117        });
118      }
119    );
120
121    $("form#loginForm").on("submit", function(e) {
122      e.preventDefault();
123      $("form#loginForm p.status").removeClass("alert alert-danger");
124      $("form#loginForm p.status")
125        .show()
126        .text(ajax_login_object.loadingmessage);
127      $.ajax({
128        type: "POST",
129        dataType: "json",
130        url: ajax_login_object.ajaxurl,
131        data: {
132          action: "ajaxlogin", //calls wp_ajax_nopriv_ajaxlogin
133          username: $("form#loginForm #username").val(),
134          password: $("form#loginForm #password").val(),
135          security: $("form#loginForm #security").val()
136        },
137        success: function(data) {
138          $("form#loginForm p.status").text(data.message);
139          if (data.loggedin == true) {
140            // alert("user is already logged in");
141            document.location.href =
142              "https://indiainch.org/craft/?crt_type=practitioner&crt_country=india";
143          } else {
144            $("form#loginForm p.status").addClass("alert alert-danger");
145          }
146        }
147      });
148    });
149
150    $("a.showLoginModal").click(function(e) {
151      e.preventDefault();
152      $("#loginModal").modal("show");
153    });
154
155    $("a.biblio-title-tab")
156      .closest("li")
157      .prependTo($("a.biblio-title-tab").closest("ul"));
158
159    $(".tmp-grayed").each(function(index) {
160      $(this).html("<div class='parent_gray'>
160" + $(this).html() + "</div>");
161      $(".parent_gray").css({
162        opacity: 0.1
163      });
164    });
165
166    $(".tmp-grayed").on("click", "a", function(event) {
167      event.preventDefault();
168    });
169
170 
171  
172
173    $("#single-content-modal").on("hidden.bs.modal", function() {
174      $("#single-content-modal .modal-body").html("");
175    });
176
177    $("body").on("click", ".show-content-modal", function (event) {
178      event.preventDefault();
179      $(".jig-imageContainer").hide();
180      $(".justified-image-grid").prop("id", "jig_saved");
181      var page_url = $(this).attr("href");
182      var postId = $(this).attr("data-id");
183      var postTitle = $(this).attr("data-title");
184      var baseUrl = "<?php echo get_site_url(); ?>";
185      $.get(page_url, function (html_data) {
186        console.log(page_url);
187        //  html_data=html_data.replace('jig1', 'jig2');
188        // html_data=html_data.replace('id="jig1-html"', 'id="jig2-html"');
189
190        var part_html_data = "";
191        //part_html_data +='<button type="button" class="close" data-dismiss="modal" style="color:#ca3531;text-align:right; padding: 10px; opacity: 1;">&times;</button>';
192        //part_html_data += '<button type="button" class="close" data-dismiss="modal">&times;</button>';
193        part_html_data += '<a class="close" data-dismiss="modal">&times;</a>';
194        part_html_data += $(html_data).find("#single-page-modal-content").html();
195        $("#single-content-modal .modal-body").html(part_html_data);
196
197        if ($(".contributor-article-list-row").length > 0) {
198          var alpha_all = [];
199
200          var alpha_keys = [];
201
202          var $divs = $("div.contributor-article-list-row");
203
204          $divs.each(function () {
205            alpha_all[$(this).find(".post-title").attr("data-title")] = $(this);
206            alpha_keys.push($(this).find(".post-title").attr("data-title"));
207          });
208
209          var contri_html = "";
210
211          alpha_keys.sort();
212
213          alpha_keys.forEach(function (element) {
214            console.log(element);
215            contri_html +=
216              '<div class="row list-data-row contributor-article-list-row">' +
217              alpha_all[element].html() +
218              "</div>";
219          });
220
221          $(".contributor-article-list").html(contri_html);
222        }
223
224        $("#single-content-modal .modal-body-extra").html("");
225        $("#single-content-modal").modal("show");
226        console.log("here I am");
227        var myLazyLoad = new LazyLoad({
228          elements_selector: ".lazy",
229        });
230        $(".jig-imageContainer").show();
231        $(".justified-image-grid").prop("id", "jig1");
232      });
233    });
234
235
236    $("body").on(
237      "click",
238      "#bibliography-authors-tab, #bibliography-authors #alphabetical-pagination a, #bibliography-authors .crt-pagination ul li a",
239      function(event) {
240        var id = $(this).attr("id");
241        event.preventDefault();
242        var page_url =
243          id == "bibliography-authors-tab"
244            ? "/bibliographyauthor/"
245            : $(this).attr("href");
246        $("#bibliography-authors").html(
247          "<span>Craft Revival Trust bibliography-authors</span>"
248        );
249        $.get(page_url, function(html_data) {
250          var part_html_data = $(html_data)
251            .find("#profile")
252            .html();
253          $("#bibliography-authors").html(part_html_data);
254        });
255      }
256    );
257
258    $("body").on("click", ".show-content-modal-biblio", function(event) {
259      event.preventDefault();
260      var page_url = $(this).attr("href");
261      var author_name = $(this).attr("data-name");
262      $.get(page_url, function(html_data) {
263        var part_html_data =
264          '<div class="col-md-12 p-0"><h3 class="modal-content-title mb-4">' +
265          author_name +
266          "</h3></div>";
267        var regex = new RegExp(author_name + ".", "g");
268        part_html_data += $(html_data)
269          .find("#profile .bibliography-list-data-row")
270          .html()
271          .replace(regex, "");
272        $(
273          "#single-content-modal .modal-body .modal-bibliography-reviews"
274        ).hide();
275        $("#single-content-modal .modal-body .modal-bibliography").html(
276          part_html_data
277        );
278        $("#single-content-modal .modal-body")
279          .find(".show-content-modal-biblio")
280          .hide();
281        $("#single-content-modal").modal("show");
282        $("#single-content-modal  div.modal-body .crt-pagination").hide();
283        $(
284          "#single-content-modal  div.modal-body .list-data-row > div > div.row:first"
285        ).hide();
286      });
287    });
288
289    if (ajax_login_object.showloginModal) {
290      $("#loginModal").modal("show");
291    }
292
293    $(".selectpicker").selectpicker({
294      style: "crt-select-btn"
295    });
296
297    $("body").on("click", "#archive-main-search-submit", function() {
298      var country = "";
299
300      var params_filters = [];
301
302      var redirect_url = "/" + current_post_type;
303      var ele_category = document.getElementById("btn-inputs-category");
304      var ele_country = document.getElementById("btn-inputs-country");
305      var input_category =
306        ele_category !== null
307          ? ele_category.getElementsByClassName("active")
308          : [];
309      var input_country =
310        ele_country !== null
311          ? ele_country.getElementsByClassName("active")
312          : [];
313
314      var country = $('input[name=crt-country-filers]').val();
315      if (input_country.length > 0) {
316
317        if(location.hostname == "asiainch.org" && input_country[0].id == "india" && is_craft_practitioner === 1 && is_paid_subscriber === 0) {
318          var win = window.open("https://indiainch.org/subscription/", '_blank');
319          win.focus();
320          return;
321        }
322
323        if (country == "india") {
324          if(input_country[0].id !== "all") {
325            params_filters["crt_state"] = input_country[0].id;
326          }
327          params_filters["crt_country"] = "india";
328        } else {
329          if(input_country[0].id !== "all")
330            params_filters["crt_country"] = input_country[0].id;
331          
332         
333
334        }
335      }
336
337      if(is_india_page === 1) {
338        params_filters["crt_country"] = "india";
339      }
340
341      if (input_category.length > 0 && input_category[0].id !== 'all') {
342        params_filters["crt_category"] = input_category[0].id;
343      }
344      params_filters["all-tab"] = 1;
345      params_filters["current_tab"] = "craft-list-tab";
346      if (crt_type) {
347        params_filters["crt_type"] = crt_type;
348      }
349
350      var current_tab_id = $('input[name=current_tab]');
351
352      if (current_tab_id.length > 0) {
353        var current_tab = $('input[name=current_tab]').val();
354        params_filters["current_tab"] = $('input[name=current_tab]').val();
355      }
356
357      window.location = buildUrl(redirect_url, params_filters);
358    });
359
360    $(".all-tab").click(function() {
361      if ($(this).hasClass("india-tab")) {
362        params_filters["crt_country"] = "india";
363      } else {
364        params_filters["all-tab"] = 1;
365      }
366
367      var all_url = buildUrl(window.location.pathname, params_filters);
368      window.open(all_url, "_self");
369    });
370
371    $(".india-subscription").click(function(e) {
372      e.preventDefault();
373      if(location.hostname == "asiainch.org"){
374         var win = window.open("https://indiainch.org/subscription/", '_blank');
375         win.focus();
376      }
377      else {
378        if(window.private_oc === 1) {
379              var win = window.open("https://indiainch.org/subscription/", '_blank');
380              win.focus();
381        } 
382      }
383    });
384
385    $(".list-filters-practitioner a.dropdown-item").click(function(e) {
386
387      if($('body').attr('id') == 'indiainch') {
388        return;
389      }
390
391      e.preventDefault();
392
393      params_practitioner_page_filters[$(this).attr("data-type")] = $(
394        this
395      ).attr("data-val");
396
397      var all_url = buildUrl(
398        window.location.pathname,
399        params_practitioner_page_filters
400      );
401      window.open(all_url, "_self");
402    });
403
404    // following is deprecated
405    $(".archive-filters-box").change(function() {
406      var gender_val = $("#gender").val();
407      var awards_val = $("#awards").val();
408      var state_val = $("#state").val();
409      var crt_category_val = $("#crt_category").val();
410
411      if (gender_val != undefined && gender_val != "" && gender_val != "0")
412        params_practitioner_page_filters["gender_val"] = gender_val;
413
414      if (awards_val != undefined && awards_val != 0)
415        params_practitioner_page_filters["award_id"] = awards_val;
416
417      if (crt_category_val != undefined)
418        params_practitioner_page_filters["crt_category"] = crt_category_val;
419
420      if (state_val != undefined)
421        params_practitioner_page_filters["crt_country"] = state_val;
422
423      var all_url = buildUrl(
424        window.location.pathname,
425        params_practitioner_page_filters
426      );
427      window.open(all_url, "_self");
428    });
429
430    if ( $( ".country-card-img" ).length ) {
431      var loc = window.location;
432      var pathName = loc.pathname.substring(0,loc.pathname.lastIndexOf('/') + 1);
433      var array = pathName.split('/');
434
435      var country = array[array.length-2];
436      
437      
438      $(".country-card-img").each(function(){
439        var new_result = '';
440         var current = this;
441          var type = $(this).attr('alt');
442          $.ajax({
443            url: "https://asiainch.org/oc_custom_scripts/image_list.php?ski
443p_checks=1&country_slug="+country+"&crt_post_type="+type.toLowerCase(), 
444            success: function(result){
445                  new_result = $.parseJSON(result);
446                  if (new_result != null) {
447                    if (new_result.length) {
448                      $(current).attr('src', new_result);
449                      console.log(new_result); 
450                    }
451                  }
452                  
453            }});
454      });
455    }
456
457    if ( $( ".home-img-box" ).length ) {
458
459      
460      
461      $(".home-img-box").each(function(){
462         var current = this;
463          var type = $(this).attr('data-posttype');
464          $.ajax({
465            url: "https://asiainch.org/oc_custom_scripts/image_list.php?skip_checks=1&country_slug=all&crt_post_type="+type.toLowerCase(), 
466            success: function(result){
467                  var new_result = $.parseJSON(result);
468                  if (new_result != null) {
469                    if (new_result.length) {
470                      $(current).attr('src', new_result);
471                      console.log(new_result); 
472                    }
473                  }
474                  
475                  
476            }});
477      });
478    }
479    hide = true;
480
481
482
483if ($(".reset-page")[0]){
484    $('.standard-p-header').css('display', 'none');
485} 
486
487$('body').on('click', '.custom-first-tabs', function () {
488    var self = $(this);
489    if (self.hasClass('active')) {
490        setTimeout(
491          function() 
492          {
493            self.removeClass('active');
494          }, 50
495        );
496    }
497});
498
499  });
500})(jQuery);
501
502function buildUrl(url, parameters) {
503  var qs = "";
504  for (var key in parameters) {
505    var value = parameters[key];
506    qs += encodeURIComponent(key) + "=" + encodeURIComponent(value) + "&";
507  }
508  if (qs.length > 0) {
509    qs = qs.substring(0, qs.length - 1); //chop off last "&"
510    url = url + "?" + qs;
511  }
512  return url;
513}
514
515setTimeout(
516  function() 
517  {
518    console.log("here");
519    jQuery("#lostpasswordform").closest('.row').css('padding', '10px');
520    jQuery("#somfrp_user_info").parent().find('label').html("Registered email id");
521    jQuery('.lostpassword-submit').after("<span>You will receive a link to create a new password on your registered email id.</span>");
522  }, 50);
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.