PageSourceSearch

https://inkyfada.com/wp-content/plugins/inkyfada-authentication/as…=5.9.5.pagespeed.ce.rtC7zKK4KN.js

js inkyfada.com collected 2026-10-02 05:41:41 UTC 14,984 bytes, 399 lines download raw bytes

1jQuery(document).ready(function ($) {
2  var escpaedLocation = window.location.hostname.replace(
3      /[|\\{}()[\]^$+*?.]/g,
4      "\\$&"
5    ),
6    location = window.location.href,
7    regex = new RegExp(escpaedLocation + "/(ar|en|fr)/podcast");
8
9  if (location.match(regex)) {
10    if (!$("#login-modal").hasClass("login-modal-podcast")) {
11      $("#login-modal").addClass("login-modal-podcast");
12    }
13  }
14  if ($(".modal-login-alert").length) {
15    $(".modal-login-alert").modal("show");
16  }
17  $(".login-module-toggler")
18    .attr("data-toggle", "modal")
19    .attr("data-target", "#login-modal");
20  $('input[name="current_url"]').val(location);
21
22  $.fn.loginModule = function () {
23    let $loginModule = $(this);
24
25    $loginModule.find("[data-show-form]").click(function (e) {
26      e.preventDefault();
27      $(".alert-from-session").remove();
28      if (this.matches("[data-form]")) {
29        if (this.getAttribute("data-form") == "register-form") {
30          $(".login-module-register-status").html("");
31          $(".login-module-register-status").addClass("hide");
32          $(".register-form-content__container").removeClass("d-none");
33        } else if (this.getAttribute("data-form") == "forgot-password") {
34          $(".login-module-forget-password-status").html("");
35          $(".login-module-forget-password-status").addClass("hide");
36          $("#lwa_user_remember").val("");
37        }
38      }
39      if ($loginModule.find("#" + $(this).data("showForm")).length == 1) {
40        if (this.matches("[data-flip]")) {
41          $(".search-logo svg,.close-modal-form").toggleClass("white");
42          $(".modal-form__flex_item").each(function () {
43            if ($(this).attr("data-order") == "1") {
44              $(this).attr("data-order", "2");
45            } else {
46              $(this).attr("data-order", "1");
47            }
48          });
49        }
50        $(".modal-login form").hide();
51        $(`.modal-login form#${$(this).data("showForm")}`).show();
52      }
53    });
54
55    $loginModule.find("form").submit(function (e) {
56      e.preventDefault();
57      var form = $(this).hide();
58      if (this.id == "reset-form") {
59        $(".reset-password-alert").removeClass("d-none");
60        let data = new FormData(this);
61        if (data.get("password1") != data.get("password2")) {
62          form = $(this).show();
63          $(".reset-password-alert").html(trans("error-missmatch"));
64          return;
65        }
66        $(".modal-backdrop").remove();
67        $(".reset-password-form").remove();
68      }
69
70      var statusElement = form.find(".login-module-status");
71      if (statusElement.length == 0) {
72        statusElement = $(
73          '<div class="login-module-status alert w-100"></div>'
74        );
75        form.prepend(statusElement);
76      }
77
78      let extraActions = form.find(".extra-actions");
79      if (!extraActions.length) {
80        statusElement.after('<div class="extra-actions"></div>');
81      }
82
83      extraActions = form.find(".extra-actions");
84      statusElement.html("");
85      var ajaxFlag = form.find(".lwa-ajax");
86      if (ajaxFlag.length == 0) {
87        ajaxFlag = $(
88          '<input class="lwa-ajax" name="lwa" type="hidden" value="1" />'
89        );
90        form.prepend(ajaxFlag);
91      }
92      if ($(form).attr("id") == "register-form") {
93        $("#loadmorehistory").css("display", "flex");
94      }
95      var form_action = form.attr("action");
96      if (typeof LWA !== "undefined") form_action = LWA.ajaxurl;
97      $.ajax({
98        type: "POST",
99        url: form_action,
100        data: form.serialize(),
101        success: function (data) {
102          let action = $(form).attr("id");
103          let innerHtml = "";
104          if (action == "register-form") {
105            const email = form.find('input[name="user_email"]').val();
106            const domain = email.split("@")[1];
107            $("#loadmorehistory").css("display", "none");
108            form.show();
109            form.find(".login-module-status").remove();
110            innerHtml = `
111                            <div  class="login-module-forget-password-status-content">
112                                <h2>
113                                    ${trans("check-box")}
114                                </h2>
115                                <p class="mb-3">
116                                    ${trans(
117                                      "sign-in-link"
118                                    )} <a href="//www.${domain}" target="_blank">${email}</a> 
119                                </p>
120                            </div>
121                        `;
122          }
123          if (action == "remember-form") {
124            const email = form.find('input[name="user_email"]').val();
125            const domain = email.split("@")[1];
126            form.show();
127            form.find(".login-module-status").remove();
128            innerHtml = `
129                            <div id="confirm-registration" class="login-module-forget-password-status-content">
130                                <h2>
131                                    ${trans("check-box")}
132                                </h2>
133                                <p class="mb-3">
134                                    ${trans(
135                                      "forget-link"
136                                    )} <a href="//www.${domain}" target="_blank">${email}</a> 
137                                </p>
138                                <p>
139                                    ${trans("finish-reset-password")}
140                                </p>
141                            </div>
142                        `;
143          }
144          if (action == "remember-form" && !data.error_code) {
145            $(".login-module-forget-password-status").addClass("hide");
146            $(".login-module-forget-password-status").html(innerHtml);
147            $(".login-module-forget-password-status").removeClass("hide");
148            return;
149          }
150          if (action == "register-form" && data.result) {
151            $(".register-form-content__container").addClass("d-none");
152            $(".login-module-register-status").addClass("hide");
153            $(".login-module-register-status").html(innerHtml);
154            $(".login-module-register-status").removeClass("hide");
155            return;
156          }
157          if (action == "register-form" && data.error) {
158            $("#loadmorehistory").css("display", "none");
159            const lang = document.documentElement.lang;
160            const translation = {
161              ar: {
162                mail_exist: "للأسف، هذا الاسم مُستَخدم !",
163              },
164              "fr-FR": {
165                mail_exist:
166                  "Désolé, cette adresse de messagerie est déjà utilisée !",
167              },
168              "en-US": {
169                mail_exist: "Sorry, this username is already in use!",
170              },
171            };
172            $(".login-module-register-alert").addClass("d-none");
173            $(".login-module-register-alert").text(
174              data.error ? `${translation[lang]["mail_exist"]}` : ""
175            );
176            $(".login-module-register-alert").removeClass("d-none");
177            $(".login-module-register-alert").addClass("alert-danger");
178            return;
179          }
180          if (action == "reset-form" && data.result) {
181            window.location.reload();
182            return;
183          }
184
185          form.show();
186          if (data.result) {
187            $(document).trigger("user_" + data.action, [data, form]);
188          }
189          notify(data, statusElement);
190          if (data.error_code == "unverified_account") {
191            let validationurl =
192              window.location.origin +
193              "?lwa=true&login-module=send-validation-email&account=" +
194              data.error_data.user;
195            statusElement.append(
196              `<div><a href="#" data-action="${validationurl}">${trans(
197                "send-code"
198              )}</a></div>`
199            );
200            statusElement.find("a[data-action]").click(function (e) {
201              e.preventDefault();
202              callUrlAction($(this).data("action"), form, statusElement);
203            });
204          }
205        },
206        error: function () {
207          form.show();
208          notify({}, statusElement);
209        },
210        dataType: "json",
211      });
212
213      return false;
214    });
215
216    function callUrlAction(url, form, statusElement) {
217      form.hide();
218      $("#loadmorehistory").css("display", "none");
219      $.ajax({
220        type: "GET",
221        url: url,
222        success: function (data) {
223          form.show();
224          notify(data, statusElement);
225        },
226        error: function () {
227          form.show();
228          notify({}, statusElement);
229        },
230        dataType: "json",
231      });
232    }
233
234    function trans(key) {
235      let locale = document.documentElement.lang;
236      const translation = {
237        ar: {
238          "check-box": "تثبّت من صندوق البريد الوارد",
239          "sign-in-link":
240            "الرجاء التثبت من بريدك الإلكتروني لتأكيد عملية التسجيل. أرسلنا لك رسالة على :",
241          "forget-link": "تحقق من بريدك الإلكتروني لمزيد من المعلومات",
242          "finish-reset-password": "اضغط على الرابط الموجود في بريدك للدخول",
243          "finish-sign-in": "اضغط على الرابط الموجود في بريدك للدخول",
244          "error-missmatch": "كلمات العبور عير متطابقين",
245          "send-code": "Renvoyer le lien de validation",
246        },
247        "fr-FR": {
248          "check-box": "Vérifiez votre boîte de réception",
249          "sign-in-link":
250            "Confirmez votre adresse email pour terminer votre inscription. Nous avons envoyé un message à :",
251          "forget-link": "Vérifiez votre email pour plus d'informations",
252          "finish-reset-password":
253            "Cliquez sur le lien dans votre boîte de réception pour vous connecter",
254          "finish-sign-in":
255            "Cliquez sur le lien dans votre boîte de réception pour vous connecter",
256          "error-missmatch": "les mots de passe sont incorrectes",
257          "send-code": "Renvoyer le lien de validation",
258        },
259        "en-US": {
260          "check-box": "Check your inbox",
261          "sign-in-link":
262            "Please follow the instructions to confirm your email address and complete your registration. An email has been sent to :  ",
263          "forget-link": "Check your email for more information",
264          "finish-reset-password": "Click on the link to log in",
265          "finish-sign-in":
266            "Please follow the instructions to confirm your email address and complete your registration.",
267          "error-missmatch":
268            "the confirm password does not match your current password",
269          "send-code": "Renvoyer le lien de validation",
270        },
271      };
272      return (translation[locale] ?? [])[key] ?? "";
273    }
274
275    $(document).on("user_login", function (event, data, form) {
276      if (data.result === true) {
277        if (data.redirect == null) {
278          window.location.reload();
279        } else {
280          window.location = data.redirect;
281        }
282      }
283    });
284
285    $(document).on("user_reset", function (event, data, form) {
286      if (data.result === true) {
287        $("form#reset-form .reset-form-fields").hide();
288      }
289    });
290
291    function notify(data, statusElement) {
292      $("#loadmorehistory").css("display", "none");
293      statusElement = $(statusElement);
294      if (data.result === true) {
295        statusElement
296          .removeClass("lwa-status-invalid alert-danger")
297          .addClass("d-nones");
298      } else if (data.result === false) {
299        const lang = document.documentElement.lang;
300        const translation = {
301          ar: {
302            userNameNotexist:
303              "عنوان البريد الإلكتروني خاطئ. الرجاء إعادة كتابته أو استعمال اسم المستخدم",
304          },
305          "fr-FR": {
306            userNameNotexist:
307              "Adresse e-mail incorrecte. Vérifiez la saisie de nouveau ou essayez avec votre identifiant.",
308          },
309          "en-US": {
310            userNameNotexist:
311              "Incorrect e-mail address. Please check the entry again or try with your username.",
312          },
313        };
314
315        statusElement
316          .removeClass("lwa-status-confirm alert-danger")
317          .addClass("lwa-status-invalid alert-danger")
318          .html(data.error ? `${translation[lang]["userNameNotexist"]}` : "");
319      }
320
321      statusElement.find("a").click(function (e) {
322        const href = $(this).attr("href");
323        statusElement.html("");
324        if (href == "#login-form") {
325          var login_form = $loginModule.find("#login-form");
326          if (login_form.length > 0) {
327            e.preventDefault();
328            statusElement.parents("form").slideUp();
329            login_form.slideDown();
330            return;
331          }
332        }
333        if (href.includes("lostpassword")) {
334          var remember_form = $loginModule.find("#remember-form");
335          if (remember_form.length > 0) {
336            e.preventDefault();
337            statusElement.parents("form").slideUp();
338            remember_form.slideDown();
339            return;
340          }
341        }
342      });
343    }
344  };
345  $(".login-module").each(function () {
346    $(this).loginModule();
347  });
348  $(document).on(
349    "click",
350    ".svg-show-hide-password__container[data-target]",
351    function (e) {
352      $(this).toggleClass("on");
353      $($(this).data("target")).attr(
354        "type",
355        $(this).hasClass("on") ? "text" : "password"
356      );
357    }
358  );
359
360  $(document).on(
361    "click",
362    ".inkyfada-header-dropdown .dropdown a[data-controls]",
363    function () {
364      $(this).closest(".menuIsOpen").removeClass("menuIsOpen");
365      $(this).closest(".dropdown").css("visibility", "hidden");
366      $(this).closest(".dropdown").css("opacity", "0");
367    }
368  );
369
370  var callback = function (mutationsList) {
371    let max = 0;
372    for (var mutation of mutationsList) {
373      $("#login-modal .login-module form").each(function () {
374        $(this).css("height", $(this).height());
375        if (max <= $(this).height()) {
376          max = $(this).height();
377        }
378      });
379    }
380    $("#login-modal .login-module").css("min-height", max);
381    $("#login-modal .login-module").parent().css("min-height", max);
382    $("#login-modal .login-module").parent().parent().css("min-height", max);
383    // observer.disconnect();
384  };
385
386  var observer = new MutationObserver(callback);
387  var els = document.querySelectorAll("#login-modal");
388  [...els].forEach((el) => {
389    observer.observe(el, {
390      attributes: true,
391      childList: false,
392    });
393  });
394  $(document).on("click", "a[data-show-form]", function () {
395    $("#login-modal .login-module form").each(function () {
396      console.log($(this).css("display"));
397    });
398  });
399});

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.