PageSourceSearch

https://www.therdthai.go.th/utils/appConfig.js?v=1791461854

js therdthai.go.th collected 2026-10-08 12:17:58 UTC 14,789 bytes, 454 lines download raw bytes

1const url_main = "https://www.therdthai.go.th/",
2  urlApi = "https://api.therdthai.go.th/",
3  urlPdpa = url_main + "public/pdpa/PRIVACY_POLICY.pdf",
4  { createApp: createApp } = Vue,
5  router = VueRouter.createRouter({
6    history: VueRouter.createWebHistory(),
7    routes: [],
8  });
9
10function getdataapi(e) {
11  return new Promise((t, o) => {
12    axios({ url: urlApi + e, method: "GET", dataType: "json" })
13      .then((e) => {
14        t(e);
15      })
16      .catch((e) => {
17        o(e);
18      });
19  });
20}
21function sw_alert(e, t, o, s) {
22  Swal.fire(e, t, o).then(function () {
23    null != s && location.replace(s);
24  });
25}
26function sw_loading() {
27  Swal.fire({
28    html: '<div class="loader mt-5"></div>\n <h5 class="mt-4 mb-3 text-center">กำลังบันทึกข้อมูลกรุณารอสักครู่</h5>\n<div class="flex justify-center">\n\t\t\t\t\t\t\t<img src="https://chiangraientersoft.com/loading.gif">\n\t\t\t\t\t\t\t</div>\n',
29    showConfirmButton: !1,
30    allowOutsideClick: !1,
31  });
32}
33function editordetailinit(e) {
34  SUNEDITOR.create(e, {
35    mode: "classic",
36    display: "block",
37    width: "100%",
38    height: "500px",
39    popupDisplay: "full",
40    imageResizing: !0,
41    imageFileInput: !1,
42    imageUrlInput: !0,
43    toolbarItem: [
44      ["undo", "redo"],
45      ["font", "fontSize", "formatBlock"],
46      ["bold", "underline", "italic", "strike", "fontColor", "hiliteColor"],
47      ["outdent", "indent", "align", "list", "horizontalRule"],
48      ["link", "table", "image", "video"],
49      ["lineHeight", "textStyle"],
50      ["showBlocks", "codeView"],
51      ["preview", "fullScreen"],
52      ["removeFormat"],
53    ],
54    charCounter: !0,
55    callBackSave: (e) => {
56      document.getElementById("editorsave").value = e;
57    },
58  }).onChange = function (e) {
59    $(".ke-component figure img").each(function (e, t) {
60      1 ==
61        (function (e) {
62          let t = e;
63          if (1 != t.includes("base64,")) return !1;
64          if (1 == t.includes("data:image")) return !0;
65        })(this.src) &&
66        (alert(
67          "แจ้งเตือน !!!  กรุณากดปุ่มแทรกรูปถาพและคัดลอก URL หรือ ที่อยู่ของรูปภาพให้ถูกต้อง"
68        ),
69        this.parentElement.parentElement.remove());
70    }),
71      (document.getElementById("editor").value = e);
72  };
73}
74function editordetailsinit(e) {
75  (editordetails = SUNEDITOR.create(e, {
76    defaultStyle: "font-size:18px;caret-color: transparent;",
77    fontSizeUnit: "px",
78    mode: "classic",
79    display: "block",
80    width: "100%",
81    height: "100%",
82  })),
83    editordetails.readOnly(true);
84    editordetails.toolbar.hide();
85}
86
87function closeShowImages() {
88  document.getElementById("images-show").classList.add("opacity-0"),
89    setTimeout(() => {
90      document.getElementById("images-show").classList.add("hidden");
91    }, 1e3),
92    sessionStorage.setItem("images-show", "hidden");
93}
94function closeShowpopup() {
95  document.getElementById("popup-modal").classList.add("opacity-0"),
96    setTimeout(() => {
97      document.getElementById("popup-modal").classList.add("hidden");
98    }, 500),
99    sessionStorage.setItem("popup-modal", "hidden");
100}
101function Checkpopup() {
102  "hidden" == sessionStorage.getItem("popup-modal") &&
103    document.getElementById("popup-modal").classList.add("hidden"),
104    "hidden" == sessionStorage.getItem("images-show") &&
105      document.getElementById("images-show").classList.add("hidden");
106}
107
108$(document).on("submit", "form[data-action]", function () {
109  window.top.sw_loading();
110});
111
112const showLoading = () => {
113  document.querySelectorAll(".lazyLoading").forEach((res) => {
114    res.classList.remove("hidden");
115  });
116  document.querySelectorAll(".dataLazyLoad").forEach((res) => {
117    setTimeout(() => {
118      res.classList.add("opacity-0");
119      setTimeout(() => {
120        res.remove();
121      }, 500);
122    }, 1500);
123  });
124};
125const SetLazyLoad = () => {
126  window.lazyLoadOptions = {
127    elements_selector: ".lazy",
128  };
129};
130
131const scrollToTop = () => {
132  window.scrollTo({
133    top: 0,
134    behavior: "smooth",
135  });
136};
137
138const scrollFixed = () => {
139  window.addEventListener("scroll", function () {
140    const dial_up_id = document.getElementById("dial-up-id");
141    const divmenu = document.querySelector("#divmenu");
142    const headernav = document.querySelector("#headernav");
143    const ulmenu = document.querySelector("#ulmenu");
144    const ClientRect = document
145      .querySelector("#divmenu")
146      .getBoundingClientRect();
147    if (window.scrollY > ClientRect.top + 100) {
148      ulmenu.classList.remove("bg-white/50");
149      divmenu.classList.remove("overflow-hidden");
150      divmenu.classList.add(
151        "fixed",
152        "h-[70px]",
153        "w-full",
154        "left-0",
155        "top-0",
156        "bg-[#008352]",
157        "border-b-4",
158        "border-white"
159      );
160      ulmenu.classList.add("!justify-center", "pt-5");
161      // dial up
162      dial_up_id.classList.remove("opacity-0", "-z-[1]");
163      dial_up_id.classList.add("z-50");
164    } else {
165      ulmenu.classList.add("bg-white/50");
166      divmenu.classList.add("overflow-hidden");
167      divmenu.classList.remove(
168        "fixed",
169        "h-[70px]",
170        "w-full",
171        "left-0",
172        "top-0",
173        "bg-[#008352]",
174        "border-b-4",
175        "border-white"
176      );
177      ulmenu.classList.remove("!justify-center", "pt-5");
178      // dial up
179      dial_up_id.classList.add("opacity-0", "-z-[1]");
180      dial_up_id.classList.remove("z-50");
181    }
182  });
183};
184
185const activeMenu = () => {
186  const currentUrl = window.location.href;
187  const e = window.location.pathname;
188  document.querySelectorAll("[data-page]").forEach((a) => {
189    if (a.dataset.page == e) {
190      a.classList.add(
191        "underline",
192        "decoration-[#D4AD7F]",
193        "decoration-2",
194        "underline-offset-8",
195        "text-[#D4AD7F]"
196      );
197    }
198  });
199};
200
201const slickAll = () => {
202  // $(".slick-header").slick({
203  //   speed: 5000,
204  //   arrows: false,
205  //   autoplay: true,
206  //   dots: true,
207  //   pauseOnHover: false,
208  //   lazyLoad: "ondemand",
209  //   infinite: true,
210  //   slidesToShow: 1,
211  //   centerMode: true,
212  //   variableWidth: true,
213  //   autoplaySpeed: 4500,
214  // });
215  // $(".activity-items").slick({
216  //   infinite: true,
217  //   slidesToShow: 2,
218  //   slidesToScroll: 1,
219  //   autoplaySpeed: 4500,
220  //   speed: 3000,
221  //   autoplay: true,
222  // });
223  // $(".souvenirs-items").slick({
224  //   infinite: true,
225  //   slidesToShow: 3,
226  //   slidesToScroll: 1,
227  //   autoplaySpeed: 4500,
228  //   speed: 3000,
229  //   autoplay: true,
230  // });
231  // $(".slick-travel").slick({
232  //   dots: false,
233  //   infinite: false,
234  //   arrows: true,
235  //   autoplay: true,
236  //   autoplaySpeed: 4500,
237  //   speed: 3000,
238  //   slidesToShow: 4,
239  //   slidesToScroll: 4,
240  // });
241  // $(".slick-picture").slick({
242  //   infinite: true,
243  //   slidesToShow: 4,
244  //   slidesToScroll: 1,
245  //   autoplaySpeed: 4500,
246  //   speed: 3000,
247  //   autoplay: true,
248  //   arrows: false,
249  //   dots: true,
250  // });
251};
252
253const menuShowSet = () => {
254  const elementMain = document.querySelectorAll("[data-show-set]");
255  const elementData = document.querySelectorAll("[data-show]");
256  elementMain.forEach((childrenMain) => {
257    childrenMain.addEventListener("click", function (actElement) {
258      elementMain.forEach((e) => {
259        elementData.forEach((t) => {
260          if (childrenMain.dataset.showSet == t.dataset.show) {
261            setTimeout(() => {
262              t.classList.remove("h-0", "opacity-0", "overflow-hidden");
263            }, 300);
264          } else {
265            t.classList.add("h-0", "opacity-0", "overflow-hidden");
266            setTimeout(() => {}, 300);
267          }
268        });
269      });
270      if (childrenMain.dataset.showSet == "vdo") {
271        document
272          .querySelectorAll("[data-show-set='journal']")[0]
273          .children[0].children[0].classList.remove("active_vdo");
274        document
275          .querySelectorAll("[data-show-set='journal']")[0]
276          .children[1].classList.remove("flex");
277        document
278          .querySelectorAll("[data-show-set='journal']")[0]
279          .children[1].classList.add("hidden");
280
281        document
282          .querySelectorAll("[data-show-set='vdo']")[0]
283          .children[0].children[0].classList.add("active_vdo");
284        document
285          .querySelectorAll("[data-show-set='vdo']")[0]
286          .children[1].classList.add("flex");
287        document
288          .querySelectorAll("[data-show-set='vdo']")[0]
289          .children[1].classList.remove("hidden");
290      } else if (childrenMain.dataset.showSet == "journal") {
291        document
292          .querySelectorAll("[data-show-set='journal']")[0]
293          .children[0].children[0].classList.add("active_vdo");
294        document
295          .querySelectorAll("[data-show-set='journal']")[0]
296          .children[1].classList.add("flex");
297        document
298          .querySelectorAll("[data-show-set='journal']")[0]
299          .children[1].classList.remove("hidden");
300
301        document
302          .querySelectorAll("[data-show-set='vdo']")[0]
303          .children[0].children[0].classList.remove("active_vdo");
304        document
305          .querySelectorAll("[data-show-set='vdo']")[0]
306          .children[1].classList.remove("flex");
307        document
308          .querySelectorAll("[data-show-set='vdo']")[0]
309          .children[1].classList.add("hidden");
310      }
311    });
312  });
313};
314const MenuBook = () => {
315  const elementMain = document.querySelectorAll("[data-title-book]");
316  const elementData = document.querySelectorAll("[data-book]");
317  elementMain.forEach((childrenMain) => {
318    childrenMain.addEventListener("click", function (actElement) {
319      elementMain.forEach((e) => {
320        childrenMain.dataset.titleBook == e.dataset.titleBook
321          ? e.classList.add("menu-book-active")
322          : e.classList.remove("menu-book-active");
323        elementData.forEach((t) => {
324          childrenMain.dataset.titleBook == t.dataset.book
325            ? t.classList.remove("hidden")
326            : t.classList.add("hidden");
327        });
328      });
329    });
330  });
331};
332const Menunewscrf = () => {
333  let object = document.querySelectorAll("[data-crf]");
334  object.forEach((element) => {
335    element.addEventListener("click", function (e) {
336      object.forEach((element) => {
337        element.classList.remove("title_crf_active");
338        element.children[1].children[0].classList.add("hidden");
339      });
340      document.querySelectorAll("[aria-newscrf]").forEach((element) => {
341        element.classList.add("hidden");
342      });
343      if (document.querySelector("[aria-newscrf='" + this.dataset.crf + "']")) {
344        document
345          .querySelector("[aria-newscrf='" + this.dataset.crf + "']")
346          .classList.remove("hidden");
347      }
348      this.classList.add("title_crf_active");
349      this.children[1].children[0].classList.remove("hidden");
350    });
351  });
352};
353
354const menuShowSouvenirs = (tabsactive) => {
355  const elementMain = document.querySelectorAll("[data-show-souvenirs-set]");
356  const elementData = document.querySelectorAll("[data-show-souvenirs]");
357  elementMain.forEach((childrenMain) => {
358    if (childrenMain.dataset.showSouvenirsSet == tabsactive) {
359      childrenMain.classList.add("active_souvenirs");
360      childrenMain.children[1].classList.add("flex");
361      childrenMain.children[1].classList.remove("hidden");
362    }
363    childrenMain.addEventListener("click", function (actElement) {
364      elementMain.forEach((e) => {
365        if (
366          actElement.target.dataset.showSouvenirsSet ==
367            e.dataset.showSouvenirsSet ||
368          actElement.currentTarget.dataset.showSouvenirsSet ==
369            e.dataset.showSouvenirsSet
370        ) {
371          e.classList.add("active_souvenirs");
372          e.children[1].classList.add("flex");
373          e.children[1].classList.remove("hidden");
374          e.children[0].children[0].children[1].classList.add("hidden");
375        } else {
376          e.classList.remove("active_souvenirs");
377          e.children[1].classList.remove("flex");
378          e.children[1].classList.add("hidden");
379          e.children[0].children[0].children[1].classList.remove("hidden");
380        }
381        elementData.forEach((t) => {
382          if (
383            childrenMain.dataset.showSouvenirsSet == t.dataset.showSouvenirs
384          ) {
385            setTimeout(() => {
386              t.classList.remove("h-0", "opacity-0", "overflow-hidden");
387            }, 300);
388          } else {
389            t.classList.add("h-0", "opacity-0", "overflow-hidden");
390            setTimeout(() => {}, 300);
391          }
392        });
393      });
394    });
395  });
396};
397const selectUrl = () => {
398  document.querySelectorAll('[name="selectUrl"]').forEach((select) => {
399    select.addEventListener("change", function () {
400      const url = this.value;
401      if (url) {
402        window.location.href = url;
403      }
404    });
405  });
406};
407document.addEventListener("readystatechange", async function (e) {
408  if (document.readyState == "interactive") {
409    scrollFixed();
410    
411    menuShowSet();
412    // slickAll();
413  }
414  if (document.readyState == "complete") {
415    // activeMenu();
416    selectUrl();
417    var platform = navigator.platform.toLowerCase();
418    var userAgent = navigator.userAgent.toLowerCase();
419
420    if (
421      platform === "iphone" ||
422      platform === "ipad" ||
423      platform === "ipod" ||
424      platform === "macintel" ||
425      userAgent.indexOf("android") > -1
426    ) {
427      setTimeout(() => {
428        const arrayPage = ["moveout_report", "contact", "petition"];
429        const page = new URL(document.location).searchParams.get("page");
430        const found = arrayPage.find((res) => res == page);
431        if ($("iframe").length > 0 && found == undefined) {
432          $("iframe").each(function (i, obj) {
433            const link = obj.src;
434            // ตรวจสอบว่าเป็นไฟล์ PDF
435            if (link && link.toLowerCase().endsWith(".pdf")) {
436              $(this).parent().parent().css("height", "50px");
437              $(this).parent().parent().html(`  
438              <div class="flex justify-center bg-gray-300 rounded-xl p-4 w-full">  
439                <div class="bg-gray-400 p-4 rounded-xl">  
440                  <a class="block md:flex items-center justify-center" href="${link}" target="_blank">  
441                    <img class="mx-auto" src="https://img.icons8.com/color/96/000000/downloads-folder.png" />  
442                    <p class="text-white font-bold"> ดาวน์โหลดไฟล์แนบ </p>  
443                  </a>  
444                </div>  
445              </div>  
446            `);
447            }
448          });
449        }
450      }, 1000);
451    }
452        showLoading();
453  }
454});

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.