PageSourceSearch

https://www.sarpang.gov.bt/wp-content/plugins/team-showcase-supreme/assets/js/wpm-common-output.js?ver=7.1

js sarpang.gov.bt collected 2026-09-25 08:32:33 UTC 18,062 bytes, 551 lines download raw bytes

1window.addEventListener("load", function () {
2  let wpm_6310_loading = jQuery(".wpm_6310_loading");
3  let loadingCounter = 0;
4  setTimeout(function () {
5    wpm_6310_loading.each(function () {
6      if (loadingCounter == 1) {
7        jQuery(this).remove();
8      }
9      loadingCounter = 1;
10    });
11  }, 1000);
12
13  jQuery("body").on("click", "a.open_in_new_tab_class", function (event) {
14    event.preventDefault();
15    if (jQuery(this).attr("target") == "_blank") {
16      window.open(jQuery(this).attr("href"), "_blank").focus();
17    } else if (jQuery(this).attr("wpm-6310-tooltip") == "yes") {
18      let totalWidth = parseInt(jQuery(this).parent().parent().width()) + 20;
19      let pos = parseInt(jQuery(this).position().left);
20
21      if (pos - 70 < 0) {
22        jQuery("head").append(
23          "<style>.wpm-6310-tooltip:after{left: " +
24            0 +
25            "px !important; right: initial !important;}</style>"
26        );
27      } else if (totalWidth > 170 && pos + 90 < totalWidth) {
28        jQuery("head").append(
29          "<style>.wpm-6310-tooltip:after{left: " +
30            (pos - 60) +
31            "px !important; right: initial !important;}</style>"
32        );
33      } else {
34        jQuery("head").append(
35          "<style>.wpm-6310-tooltip:after{left: initial !important; right: " +
36            0 +
37            "px !important;}</style>"
38        );
39      }
40    } else {
41      window.open(jQuery(this).attr("href"), "_parent").focus();
42    }
43    return false;
44  });
45
46  jQuery("body").on("mouseenter", "a.open_in_new_tab_class", function (event) {
47    var attr = jQuery(this).attr("data-social-modal");
48    if (typeof attr !== typeof undefined && attr !== false) {
49      jQuery("head").append(
50        "<style>.wpm-6310-tooltip:after{left: initial !important; right: initial !important;}</style>"
51      );
52    } else {
53      if (jQuery(this).attr("wpm-6310-tooltip") == "yes") {
54        let totalWidth = parseInt(jQuery(this).parent().parent().width()) + 20;
55        let pos = parseInt(jQuery(this).position().left);
56
57        if (pos - 70 < 0) {
58          jQuery("head").append(
59            "<style>.wpm-6310-tooltip:after{left: " +
60              0 +
61              "px !important; right: initial !important;}</style>"
62          );
63        } else if (totalWidth > 170 && pos + 90 < totalWidth) {
64          jQuery("head").append(
65            "<style>.wpm-6310-tooltip:after{left: " +
66              (pos - 60) +
67              "px !important; right: initial !important;}</style>"
68          );
69        } else {
70          jQuery("head").append(
71            "<style>.wpm-6310-tooltip:after{left: initial !important; right: " +
72              0 +
73              "px !important;}</style>"
74          );
75        }
76      }
77    }
78  });
79
80  //Category Filter
81  jQuery("body").on("click", ".wpm_6310_category_list", function () {
82    let ids = jQuery(this)
83      .closest(".wpm_main_template")
84      .attr("wpm-6310-carousel-id");
85    let itemPerRow = jQuery(this)
86      .closest(".wpm_main_template")
87      .attr("wpm-6310-carousel-itemperrow");
88    let attr = jQuery(this).attr("wpm-data-filter");
89    var searchActive = jQuery(this)
90      .closest(".wpm_main_template")
91      .attr("wpm-6310-search-active");
92    var value = jQuery(".wpm-6310-search-template-" + ids + " input")
93      .val()
94      .toLowerCase();
95
96    jQuery(
97      ".wpm_main_template_" + ids + " .wpm_6310_category_list_" + ids
98    ).removeClass("wpm_6310_category_list_active_" + ids);
99    jQuery(this).addClass("wpm_6310_category_list_active_" + ids);
100    jQuery(
101      ".wpm_main_template_" + ids + " .wpm-6310-row:not(." + attr + ")"
102    ).hide(300);
103
104    if (value != "" && value.trim() != "" && searchActive == true) {
105      jQuery(
106        ".wpm_main_template_" +
107          ids +
108          " ." +
109          attr +
110          " .wpm-6310-col-" +
111          itemPerRow
112      ).filter(function () {
113        jQuery("." + attr).show(300);
114        var title = jQuery(this)
115          .find(".wpm_6310_team_style_" + ids + "_title")
116          .text()
117          .toLowerCase();
118        var designation = jQuery(this)
119          .find(".wpm_6310_team_style_" + ids + "_designation")
120          .text()
121          .toLowerCase();
122        let status =
123          title.indexOf(value) > -1 || designation.indexOf(value) > -1;
124        if (status) {
125          jQuery(this).show(300);
126        } else {
127          jQuery(this).hide(300);
128        }
129      });
130    } else {
131      jQuery(".wpm_main_template_" + ids + " ." + attr).show(300);
132      jQuery(
133        ".wpm_main_template_" +
134          ids +
135          " ." +
136          attr +
137          " .wpm-6310-col-" +
138          itemPerRow
139      ).filter(function () {
140        jQuery(this).show(300);
141      });
142    }
143  });
144
145  //Search Filter
146  jQuery("body").on("keyup", ".wpm-6310-search-box", function () {
147    var ids = jQuery(this)
148      .closest(".wpm_main_template")
149      .attr("wpm-6310-carousel-id");
150    let itemPerRow = jQuery(this)
151      .closest(".wpm_main_template")
152      .attr("wpm-6310-carousel-itemperrow");
153    var value = jQuery(this).val().toLowerCase();
154    var category = Number(
155      jQuery(this).closest(".wpm_main_template").attr("wpm-6310-search-active")
156    );
157
158    let className = "";
159    if (category == 1) {
160      className = jQuery(
161        ".wpm_main_template_" + ids + " .wpm_6310_category_list_active_" + ids
162      ).attr("wpm-data-filter");
163    } else {
164      className = "c-1588100157";
165    }
166
167    jQuery(
168      ".wpm_main_template_" +
169        ids +
170        " ." +
171        className +
172        " .wpm-6310-col-" +
173        itemPerRow
174    ).filter(function () {
175      var title = jQuery(this)
176        .find(".wpm_6310_team_style_" + ids + "_title")
177        .text()
178        .toLowerCase();
179      var designation = jQuery(this)
180        .find(".wpm_6310_team_style_" + ids + "_designation")
181        .text()
182        .toLowerCase();
183      let status = title.indexOf(value) > -1 || designation.indexOf(value) > -1;
184      if (status) {
185        jQuery(this).show(300);
186      } else {
187        jQuery(this).hide(300);
188      }
189    });
190  });
191
192  //Fixed lazyLoad plugin error
193  var $allImages = jQuery(".wpm_main_template img");
194  $allImages.each(function () {
195    var clsName = "wpm-6310-img-responsive";
196    var alt = jQuery(this).attr("alt");
197    var hoverImage = jQuery(this).attr("data-6310-hover-image");
198    var image = jQuery(this).attr("data-wpm-6310-image-attr");
199    var attributes = this.attributes;
200    var i = attributes.length;
201    while (i--) {
202      this.removeAttributeNode(attributes[i]);
203    }
204    jQuery(this).attr({
205      src: image,
206      class: clsName,
207      alt: alt,
208      "data-6310-hover-image": hoverImage,
209      "data-wpm-6310-image-attr": image,
210    });
211  });
212
213  setTimeout(() => {
214    var $allImages = jQuery(".wpm_main_template img");
215    $allImages.each(function () {
216      var clsName = "wpm-6310-img-responsive";
217      var alt = jQuery(this).attr("alt");
218      var hoverImage = jQuery(this).attr("data-6310-hover-image");
219      var image = jQuery(this).attr("data-wpm-6310-image-attr");
220      var attributes = this.attributes;
221      var src = jQuery(this).attr("src");
222      var i = attributes.length;
223
224      while (i--) {
225        let attrName = attributes[i].name.toLowerCase();
226        if (
227          attrName != "src" &&
228          attrName != "class" &&
229          attrName != "alt" &&
230          attrName != "data-6310-hover-image" &&
231          attrName != "data-wpm-6310-image-attr"
232        ) {
233          this.removeAttributeNode(attributes[i]);
234        }
235      }
236      if (src != image) {
237        jQuery(this).attr({
238          src: image,
239          class: clsName,
240          alt: alt,
241          "data-6310-hover-image": hoverImage,
242          "data-wpm-6310-image-attr": image,
243        });
244      } else {
245        jQuery(this).attr({ class: clsName });
246      }
247    });
248  }, 1000);
249
250  setTimeout(() => {
251    var $allImages = jQuery(".wpm_main_template img");
252    $allImages.each(function () {
253      var clsName = "wpm-6310-img-responsive";
254      var alt = jQuery(this).attr("alt");
255      var hoverImage = jQuery(this).attr("data-6310-hover-image");
256      var image = jQuery(this).attr("data-wpm-6310-image-attr");
257      var attributes = this.attributes;
258      var src = jQuery(this).attr("src");
259      var i = attributes.length;
260
261      while (i--) {
262        let attrName = attributes[i].name.toLowerCase();
263        if (
264          attrName != "src" &&
265          attrName != "class" &&
266          attrName != "alt" &&
267          attrName != "data-6310-hover-image" &&
268          attrName != "data-wpm-6310-image-attr"
269        ) {
270          this.removeAttributeNode(attributes[i]);
271        }
272      }
273      if (src != image) {
274        jQuery(this).attr({
275          src: image,
276          class: clsName,
277          alt: alt,
278          "data-6310-hover-image": hoverImage,
279          "data-wpm-6310-image-attr": image,
280        });
281      } else {
282        jQuery(this).attr({ class: clsName });
283      }
284    });
285  }, 2500);
286
287  setTimeout(() => {
288    var $allImages = jQuery(".wpm_main_template img");
289    $allImages.each(function () {
290      var clsName = "wpm-6310-img-responsive";
291      var alt = jQuery(this).attr("alt");
292      var hoverImage = jQuery(this).attr("data-6310-hover-image");
293      var image = jQuery(this).attr("data-wpm-6310-image-attr");
294      var attributes = this.attributes;
295      var src = jQuery(this).attr("src");
296      var i = attributes.length;
297
298      while (i--) {
299        let attrName = attributes[i].name.toLowerCase();
300        if (
301          attrName != "src" &&
302          attrName != "class" &&
303          attrName != "alt" &&
304          attrName != "data-6310-hover-image" &&
305          attrName != "data-wpm-6310-image-attr"
306        ) {
307          this.removeAttributeNode(attributes[i]);
308        }
309      }
310      if (src != image) {
311        jQuery(this).attr({
312          src: image,
313          class: clsName,
314          alt: alt,
315          "data-6310-hover-image": hoverImage,
316          "data-wpm-6310-image-attr": image,
317        });
318      } else {
319        jQuery(this).attr({ class: clsName });
320      }
321    });
322  }, 5000);
323
324  setTimeout(() => {
325    var $allImages = jQuery(".wpm_main_template img");
326    $allImages.each(function () {
327      var clsName = "wpm-6310-img-responsive";
328      var alt = jQuery(this).attr("alt");
329      var hoverImage = jQuery(this).attr("data-6310-hover-image");
330      var image = jQuery(this).attr("data-wpm-6310-image-attr");
331      var attributes = this.attributes;
332      var src = jQuery(this).attr("src");
333      var i = attributes.length;
334
335      while (i--) {
336        let attrName = attributes[i].name.toLowerCase();
337        if (
338          attrName != "src" &&
339          attrName != "class" &&
340          attrName != "alt" &&
341          attrName != "data-6310-hover-image" &&
342          attrName != "data-wpm-6310-image-attr"
343        ) {
344          this.removeAttributeNode(attributes[i]);
345        }
346      }
347      if (src != image) {
348        jQuery(this).attr({
349          src: image,
350          class: clsName,
351          alt: alt,
352          "data-6310-hover-image": hoverImage,
353          "data-wpm-6310-image-attr": image,
354        });
355      } else {
356        jQuery(this).attr({ class: clsName });
357      }
358    });
359  }, 10000);
360  jQuery(".wpm_main_template").each(function () {
361    let ids = jQuery(this).attr("wpm-6310-carousel-id");
362    if (
363      jQuery(this).attr("wpm-6310-carousel-active") == 1 ||
364      jQuery(this).attr("wpm-6310-carousel-active") == "1"
365    ) {
366      jQuery(
367        "#wpm-6310-noslider-" + jQuery(this).attr("wpm-6310-carousel-id")
368      ).hide();
369      var owlVar = jQuery(
370        "#wpm-6310-slider-" + jQuery(this).attr("wpm-6310-carousel-id")
371      );
372      owlVar.tss6310OwlCarousel({
373        autoplay: true,
374        lazyLoad: true,
375        loop: true,
376        margin: Number(jQuery(this).attr("wpm-6310-item-margin")),
377        autoplayTimeout: jQuery(this).attr("wpm-6310-carousel-autoPlay"),
378        autoplayHoverPause: true,
379        responsiveClass: true,
380        autoHeight: true,
381        nav:
382          jQuery(this).attr("wpm-6310-carousel-nav") == "true" ||
383          jQuery(this).attr("wpm-6310-carousel-nav") == true
384            ? true
385            : false,
386        dots:
387          jQuery(this).attr("wpm-6310-carousel-dot") == "true" ||
388          jQuery(this).attr("wpm-6310-carousel-dot") == true
389            ? true
390            : false,
391        navText: [
392          "<i class='" +
393            jQuery(this).attr("wpm-6310-carousel-navText") +
394            "-left'></i>",
395          "<i class='" +
396            jQuery(this).attr("wpm-6310-carousel-navText") +
397            "-right'></i>",
398        ],
399        responsive: {
400          0: {
401            items: jQuery(this).attr("wpm-6310-carousel-itemPerRow-mobile"),
402          },
403          768: {
404            items: jQuery(this).attr("wpm-6310-carousel-itemPerRow-tablet"),
405          },
406          1024: {
407            items: jQuery(this).attr("wpm-6310-carousel-itemPerRow"),
408          },
409        },
410      });
411      owlVar.on("mouseleave", function () {
412        owlVar.trigger("stop.owl.autoplay"); //this is main line to fix it
413        owlVar.trigger("play.owl.autoplay", [
414          jQuery(this).attr("wpm-6310-carousel-autoPlay"),
415        ]);
416      });
417      setTimeout(function () {
418        let allSlider = jQuery(
419          "#wpm-6310-slider-" + ids + " .wpm-6310-owl-item"
420        );
421        let maxHeight = 0;
422        if (allSlider.length) {
423          for (let ii = 0; ii < allSlider.length; ii++) {
424            maxHeight = Math.max(maxHeight, allSlider[ii].offsetHeight);
425          }
426        }
427        if (maxHeight > 0) {
428          maxHeight += Number(
429            jQuery(".wpm_main_template_" + ids).attr("wpm-6310-padding")
430          );
431          jQuery("#wpm-6310-slider-" + ids + " .wpm-6310-owl-height").css({
432            height: maxHeight,
433          });
434        }
435      }, 500);
436      setTimeout(function () {
437        let allSlider = jQuery(
438          "#wpm-6310-slider-" + ids + " .wpm-6310-owl-item"
439        );
440        let maxHeight = 0;
441        if (allSlider.length) {
442          for (let ii = 0; ii < allSlider.length; ii++) {
443            maxHeight = Math.max(maxHeight, allSlider[ii].offsetHeight);
444          }
445        }
446        if (maxHeight > 0) {
447          maxHeight += Number(
448            jQuery(".wpm_main_template_" + ids).attr("wpm-6310-padding")
449          );
450          jQuery("#wpm-6310-slider-" + ids + " .wpm-6310-owl-height").css({
451            height: maxHeight,
452          });
453        }
454      }, 1000);
455      setTimeout(function () {
456        let allSlider = jQuery(
457          "#wpm-6310-slider-" + ids + " .wpm-6310-owl-item"
458        );
459        let maxHeight = 0;
460        if (allSlider.length) {
461          for (let ii = 0; ii < allSlider.length; ii++) {
462            maxHeight = Math.max(maxHeight, allSlider[ii].offsetHeight);
463          }
464        }
465        if (maxHeight > 0) {
466          maxHeight += Number(
467            jQuery(".wpm_main_template_" + ids).attr("wpm-6310-padding")
468          );
469          jQuery("#wpm-6310-slider-" + ids + " .wpm-6310-owl-height").css({
470            height: maxHeight,
471          });
472        }
473      }, 1500);
474      setTimeout(function () {
475        let allSlider = jQuery(
476          "#wpm-6310-slider-" + ids + " .wpm-6310-owl-item"
477        );
478        let maxHeight = 0;
479        if (allSlider.length) {
480          for (let ii = 0; ii < allSlider.length; ii++) {
481            maxHeight = Math.max(maxHeight, allSlider[ii].offsetHeight);
482          }
483        }
484        if (maxHeight > 0) {
485          maxHeight += Number(
486            jQuery(".wpm_main_template_" + ids).attr("wpm-6310-padding")
487          );
488          jQuery("#wpm-6310-slider-" + ids + " .wpm-6310-owl-height").css({
489            height: maxHeight,
490          });
491        }
492      }, 2000);
493      setTimeout(function () {
494        let allSlider = jQuery(
495          "#wpm-6310-slider-" + ids + " .wpm-6310-owl-item"
496        );
497        let maxHeight = 0;
498        if (allSlider.length) {
499          for (let ii = 0; ii < allSlider.length; ii++) {
500            maxHeight = Math.max(maxHeight, allSlider[ii].offsetHeight);
501          }
502        }
503        if (maxHeight > 0) {
504          maxHeight += Number(
505            jQuery(".wpm_main_template_" + ids).attr("wpm-6310-padding")
506          );
507          jQuery("#wpm-6310-slider-" + ids + " .wpm-6310-owl-height").css({
508            height: maxHeight,
509          });
510        }
511      }, 3000);
512    } else {
513      jQuery(
514        "#wpm-6310-slider-" + jQuery(this).attr("wpm-6310-carousel-id")
515      ).hide();
516      //Remove unnecessary p tag
517      let htmlCode = jQuery(this).html();
518      htmlCode = htmlCode.replace(/<p>/gi, "");
519      htmlCode = htmlCode.replace(/<\/p>/gi, "");
520      jQuery(this).html(htmlCode);
521    }
522  });
523
524  //Remove visual composer class
525  let noBorder = jQuery(".boxed-no-space");
526  if (noBorder && noBorder.length) {
527    noBorder.each(function () {
528      jQuery(this).removeAttr("class");
529    });
530  }
531});
532
533window.addEventListener("load", function () {
534  jQuery("body").on("click", ".wpm-6310-close", function () {
535    jQuery("#mywpm_6310_modal").remove();
536    jQuery("#mywpm_6310_modal").fadeOut(500);
537    jQuery("body").css({
538      overflow: "auto",
539    });
540  });
541
542  jQuery(window).click(function (event) {
543    if (event.target == document.getElementById("mywpm_6310_modal")) {
544      jQuery("#mywpm_6310_modal").remove();
545      jQuery("#mywpm_6310_modal").fadeOut(500);
546      jQuery("body").css({
547        overflow: "auto",
548      });
549    }
550  });
551});

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.