PageSourceSearch

https://1221.org.il/app/plugins/donate/assets/donate.js?a=2&ver=6.7.2

js 1221.org.il collected 2026-10-02 08:20:18 UTC 18,052 bytes, 547 lines download raw bytes

1jQuery(document).ready(function (e) {
2  //if (window.outerWidth > 980)
3  //jQuery('#donation_main_con').paroller();
4  var sum_all = jQuery("input[name=amount]").val();
5  jQuery("button.amount").on("click touchstart", function () {
6    jQuery("#another_amount").val("");
7    // jQuery('span#amount').text(jQuery(this).text().trim() * jQuery('input[name=months]').val());
8    // jQuery('input[name=amount_single]').val(jQuery(this).text().trim());
9    // jQuery('input[name=amount]').val(jQuery(this).text().trim() * jQuery('input[name=months]').val());
10    var sum = jQuery(this).attr("data-sum").trim();
11    sum_all = sum;
12    jQuery("input[name=months]").val(1);
13    jQuery("span#amount").text(sum_all * jQuery("input[name=months]").val());
14
15    jQuery("input[name=amount_single]").val(sum_all);
16
17    jQuery("input[name=amount]").val(sum_all * jQuery("input[name=months]").val());
18    // jQuery("input[name=months]").val(1);
19    // jQuery("#donation_months_total").hide();
20
21    jQuery(this).addClass("active");
22    jQuery(this).siblings().removeClass("active");
23    return false;
24  });
25
26  jQuery("#another_amount").on("keyup change paste", function () {
27   
28    jQuery("span#amount").text(
29      jQuery(this).val() * jQuery("input[name=months]").val()
30    );
31    jQuery("input[name=amount_single]").val(jQuery(this).val());
32    jQuery("input[name=amount]").val(
33      jQuery(this).val() * jQuery("input[name=months]").val()
34    );
35    jQuery("button.amount").removeClass("active");
36  });
37  jQuery("#another_amount1").on("keyup change paste", function () {
38   sum_all = jQuery(this).val();
39    jQuery("span#amount").text(
40      jQuery(this).val() * jQuery("input[name=months]").val()
41    );
42    jQuery("input[name=amount_single]").val(jQuery(this).val());
43    jQuery("input[name=amount]").val(
44      jQuery(this).val() * jQuery("input[name=months]").val()
45    );
46    jQuery("button.amount").removeClass("active");
47  });
48
49  jQuery("input[name=months]").on("keyup change paste", function () {
50   
51    var type_payment = jQuery("input[name=type_payment]").val();
52    var sum = jQuery("input[name=amount]").val();
53    switch (type_payment) {       
54        case "payments_split":// amount / payments                  
55          jQuery("input[name=amount_single]").val(sum_all/jQuery(this).val());        
56          jQuery("span#amount").text(  Math.floor(sum_all)  +" , מחולק ל ");
57          break;
58        case "subscibtion":// amount * payments          
59          jQuery("input[name=amount]").val( sum_all*jQuery(this).val());
60          jQuery("input[name=amount_single]").val(sum_all/jQuery("input[name=months]").val());        
61          jQuery("span#amount").text(  Math.floor(jQuery("input[name=amount_single]").val())  +" , למשך ");
62          break;
63      //   case "payments_hk": // amount / payments hk
64      //   
65      //     break;
66      }    
67  });
68
69  jQuery("button.months").on("click touchstart", function () {
70    jQuery(this).siblings("button").removeClass("active");
71    jQuery(this).addClass("active");
72    var type_payment = jQuery(this).data("type");
73    jQuery("input[name=type_payment]").val(type_payment);
74
75    switch (type_payment) {
76      case "onetime":// 1 month all amount
77        jQuery("#total_months").hide();
78        // jQuery("input[name=amount]").val();
79        jQuery("input[name=amount_single]").val(jQuery("input[name=amount]").val());
80        jQuery("input[name=months]").val(1);
81        jQuery("span#amount").text(  jQuery("input[name=amount]").val()  +" בתשלום אחד ");
82        break;
83      case "payments_split":// amount / payments
84        jQuery("#total_months").css("display","inline-block");
85        // jQuery("#total_months").show();
86        // jQuery("input[name=amount]").val();
87        jQuery("input[name=months]").val(12);
88        jQuery("input[name=amount_single]").val(jQuery("input[name=amount]").val()/jQuery("input[name=months]").val());        
89        jQuery("span#amount").text(  jQuery("input[name=amount]").val()  +" , מחולק ל ");
90        break;
91      case "subscibtion":// amount * payments
92        jQuery("#total_months").css("display","inline-block");
93        jQuery("input[name=months]").val(12);
94        jQuery("input[name=amount]").val( jQuery("input[name=amount]").val()*jQuery("input[name=months]").val());
95        jQuery("input[name=amount_single]").val(jQuery("input[name=amount]").val()/jQuery("input[name=months]").val());        
96        jQuery("span#amount").text(  jQuery("input[name=amount_single]").val()  +" , למשך ");
97        break;
98      case "bit":
99        jQuery("#total_months").hide();
100        jQuery("input[name=amount_single]").val(jQuery("input[name=amount]").val());
101        jQuery("input[name=months]").val(1);
102        jQuery("span#amount").text(  jQuery("input[name=amount]").val()  +" בתשלום אחד ");
103        break;
104      case "bank_transfer": 
105        jQuery("#total_months").hide();
106        jQuery("input[name=amount_single]").val(jQuery("input[name=amount]").val());
107        jQuery("input[name=months]").val(1);
108        jQuery("span#amount").text(  jQuery("input[name=amount]").val()  +" בתשלום אחד ");
109        break;    
110    //   case "payments_hk": // amount / payments hk
111    //     jQuery("input[name=amount]").val();
112    //     jQuery("input[name=amount_single]").val();
113    //     jQuery("input[name=months]").val();
114    //     jQuery("span#amount").text();
115    //     break;
116    }    
117    return false;
118  });
119
120  jQuery("#donation_form1").validate({
121    ignore: "",
122    rules: {
123      amount: {
124        required: true,
125        number: true,
126        min: 1,
127      },
128      months: {
129        required: true,
130        number: true,
131        min: 1,
132      },
133    },
134    messages: {
135      amount: {
136        required: "נא לבחור / להזין סכום לתרומה",
137        number: "נא לבחור / להזין סכום לתרומה",
138        min: "נא לבחור / להזין סכום לתרומה",
139      },
140      months: {
141        required: "נא לבחור כמות חודשים לתרומה",
142        number: "נא לבחור כמות חודשים לתרומה",
143        min: "נא לבחור כמות חודשים לתרומה",
144      },
145    },
146    errorPlacement: function (error, element) {
147      console.log(error);
148      if (jQuery(element).attr("name") == "months") {
149        error.insertAfter("#donation_months");
150        error.addClass("error");
151      } else {
152        error.insertAfter(element);
153        error.addClass("error");
154      }
155    },
156    submitHandler: function (form) {
157      var data = toJSONString(form);
158      var button = jQuery("#donation_form1").find("[type=submit]");
159      jQuery("#amount_total").val(100 * jQuery("input[name=amount]").val());
160      jQuery("#firstPayment").val(
161        100 * jQuery("input[name=amount_single]").val()
162      );
163      jQuery("#numPayment").val(jQuery("input[name=months]").val());
164      jQuery("#uniqid2").val(jQuery("#uniqid1").val());
165
166      button.text("נא להמתין...").prop("disabled", true);
167      event.preventDefault();
168      jQuery("html, body").animate(
169        {
170          scrollTop: jQuery("#donation_form_con").offset().top,
171        },
172        1000
173      );
174      jQuery("#donation_form_step1")
175        .slideUp("slow")
176        .promise()
177        .done(function () {
178          jQuery("#donation_amount span").text(jQuery("span#amount").text());
179          jQuery("#donation_progress_con").attr("data-steps", "2");
180          jQuery(".donation_progress_item[data-num=2]").addClass("active");
181          jQuery("#donation_form_step2").slideDown("slow");
182        	
183        });
184    },
185  });
186
187  jQuery("#donation_form2").validate({
188    ignore: "",
189    rules: {
190      first_name: {
191        required: true,
192      },
193      idd: {
194        required: true,
195      },
196      city: {
197        required: true,
198      },
199      phone: {
200        required: true,
201      },
202      email: {
203        required: true,
204        email: true,
205      },
206    },
207    messages: {
208      first_name: {
209        required: "נא להזין שם ",
210      },
211      idd: {
212        required: "נא להזין תעודת זהות",
213      },
214
215      city: {
216        required: "נא להזין עיר",
217      },
218
219      phone: {
220        required: "נא להזין מספר טלפון",
221      },
222
223      email: {
224        required: 'נא להזין כתובת דוא"ל',
225        email: 'נא להזין כתובת דוא"ל חוקית',
226      },
227    },
228    submitHandler: function (form) {
229      event.preventDefault();
230      var data = toJSONString(form);
231
232      jQuery("#comment").val(data);
233      jQuery("#mail").val(jQuery("input[name=email]").val());
234      jQuery("#phone").val(jQuery("input[name=phone]").val());
235      // jQuery('#project').val(jQuery("select[id=p_options]").val());
236      //jQuery('#project').val(jQuery("#p_options option:selected").val());
237
238      jQuery("#amount1").val(jQuery("#amount").text());
239      jQuery("#months").val(jQuery("input[name=months]").val());
240      jQuery("#donation_form1").find("[type=submit]").click();
241
242      // console.log(jQuery("#project").val());
243      // console.log(jQuery("input[name=amount_total]").val());
244
245      set_donor(getFormData(jQuery(form)));
246      get_ifreme(getFormData(jQuery(form)));
247      jQuery("html, body").animate(
248        {
249          scrollTop: jQuery("#donation_form_con").offset().top,
250        },
251        1000
252      );
253      jQuery("#donation_form_step2")
254        .slideUp("slow")
255        .promise()
256        .done(function () {
257          jQuery("#donation_progress_con").attr("data-steps", "3");
258          jQuery(".donation_progress_item[data-num=3]").addClass("active");
259          jQuery("#donation_form_step3").slideDown("slow");
260        });
261    },
262  });
263  jQuery("#donation_form3").validate({
264    ignore: "",
265    rules: {
266      creditNum: {
267        required: true,
268        creditcard: true,
269      },
270      id: {
271        required: true,
272      },
273      Tmonth: {
274        required: true,
275        min: 1,
276      },
277      Tyear: {
278        required: true,
279        min: 1,
280      },
281      cvv2: {
282        required: true,
283        digits: true,
284        minlength: 3,
285        maxlength: 3,
286      },
287    },
288    messages: {
289      creditNum: {
290        required: "נא להזין מספר כרטיס",
291        creditcard: "נא להזין מספר כרטיס תקי×
291Ÿ",
292      },
293      // id : {
294      // 	required : 'נא להזין מספר זהות',
295      // },
296
297      Tmonth: {
298        required: "נא להזין תוקף",
299        min: "נא להזין תוקף",
300      },
301
302      Tyear: {
303        required: "נא להזין תוקף",
304        min: "נא להזין תוקף",
305      },
306
307      // cvv2 : {
308      // 	required : 'נא להזין 3 ספרות בגב הכרטיס',
309      // 	digits:'נא להזין 3 ספרות בגב הכרטיס',minlength:'נא להזין 3 ספרות בגב הכרטיס',maxlength:'נא להזין 3 ספרות בגב הכרטיס'
310      // },
311    },
312    submitHandler: function (form) {
313      event.preventDefault();
314
315      var button = jQuery("#donation_form3").find("[type=submit]");
316
317      button.text("נא להמתין...").prop("disabled", true);
318
319      // console.log(jQuery(form).serialize());
320      var frame = document.getElementById("iframe");
321      frame.contentWindow.postMessage(
322        {
323          cardNum: jQuery("#credit-card-input").val(),
324          expiry: jQuery("#expmonth").val() + jQuery("#expyear").val(),
325        },
326        "*"
327      );
328
329      var interval = setInterval(function () {
330        // console.log(document.getElementById('iframe'));
331        var url = "";
332        if (parent != window) url = window.self.location.href;
333        else
334          url =
335            document.getElementById("iframe").contentWindow.self.location.href;
336        var token = url.substr(url.indexOf("token=") + 6);
337        console.log(url);
338        if (token) {
339          clearInterval(interval);
340          var data = getFormData(jQuery("#donationForm"));
341          data.token = token;
342          data.creditNum = 0;
343          data = {
344            data: data,
345          };
346          submitDonate(data);
347        }
348      }, 3000);
349    },
350  });
351  var submitDonate = function (data) {
352    jQuery.post(ajax_object.ajaxurl, data, function (response) {
353      response = JSON.parse(response);
354      if (response.status == 1) {
355        jQuery("html, body").animate(
356          {
357            scrollTop: jQuery("#donation_form_con").offset().top,
358          },
359          1000
360        );
361        jQuery("#donation_form_step3")
362          .slideUp("slow")
363          .promise()
364          .done(function () {
365            jQuery("#donation_progress_con").attr("data-steps", "4");
366            jQuery(".donation_progress_item[data-num=4]").addClass("active");
367            jQuery("#donation_form_step4").slideDown("slow");
368          });
369      } else {
370        button.text(button.attr("data-text")).prop("disabled", false);
371        jQuery("#errorMsg").text(response.message);
372      }
373    });
374  };
375
376  function toJSONString(form) {
377    var obj = {};
378    var elements = form.querySelectorAll(
379      "input:not([class^=multifield]), select:not([class^=multifield]), textarea:not([class^=multifield])"
380    );
381    for (var i = 0; i < elements.length; ++i) {
382      var element = elements[i];
383      var name = element.name;
384      var value = element.value;
385
386      if (name) {
387        obj[name] = value;
388      }
389    }
390
391    return JSON.stringify(obj);
392  }
393
394  function getFormData($form) {
395    var unindexed_array = $form.serializeArray();
396    // console.log(unindexed_array);
397    var indexed_array = {};
398
399    jQuery.map(unindexed_array, function (n, i) {
400      indexed_array[n["name"]] = n["value"];
401    });
402    return indexed_array;
403  }
404  jQuery("#p_options").change(function () {
405    jQuery("input[name=project]").val(
406      jQuery("#p_options option:selected").val()
407    );
408    jQuery("input[name=terminal]").val(
409      jQuery("#p_options option:selected").attr("data_terminal")
410    );
411    // console.log(jQuery('#p_options option:selected').attr('data_terminal'));
412    // console.log("aaaa");
413    var options = jQuery("#p_options option:selected").attr("data_amount");
414    var array = options.split(",");
415    jQuery("#donation_amounts_buttons").html("");
416    jQuery.each(array, function (index, value) {
417      //alert('<button type="button" class="amount">' + value + '</button>');
418      jQuery("#donation_amounts_buttons").append(
419        '<button type="button" class="amount">' + value + "</button>"
420      );
421    });
422    jQuery("#donation_amounts_buttons").append(
423      '<input type="text" autocomplete="off" name="another_amount" id="another_amount" placeholder="הזן סכום אחר">'
424    );
425    amountPlay();
426  });
427  jQuery("input[name=idd]").on("blur paste", function () {
428    num = jQuery("input[name=idd]").val();
429    LegalTz(num);
430  });
431});
432
433function LegalTz(num) {
434  var tot = 0;
435  var tz = new String(num);
436  for (i = 0; i < 8; i++) {
437    x = ((i % 2) + 1) * tz.charAt(i);
438    if (x > 9) {
439      x = x.toString();
440      x = parseInt(x.charAt(0)) + parseInt(x.charAt(1));
441    }
442    tot += x;
443  }
444
445  if ((tot + parseInt(tz.charAt(8))) % 10 == 0) {
446    //alert("תקין");
447    return true;
448  } else {
449    alert("תעודת זהות לא תקינה");
450    return false;
451  }
452}
453
454function amountPlay() {
455  jQuery("button.amount").on("click touchstart", function () {
456    jQuery("#another_amount").val("");
457    jQuery("span#amount").text(
458      jQuery(this).text().trim() * jQuery("input[name=months]").val()
459    );
460    jQuery("input[name=amount_single]").val(jQuery(this).text().trim());
461    jQuery("input[name=amount]").val(
462      jQuery(this).text().trim() * jQuery("input[name=months]").val()
463    );
464
465    jQuery(this).addClass("active");
466    jQuery(this).siblings().removeClass("active");
467    return false;
468  });
469}
470
471if (
472  navigator.userAgent.match(/MSIE 10/i) ||
473  navigator.userAgent.match(/Trident\/7\./) ||
474  navigator.userAgent.match(/Edge\/12\./)
475) {
476  jQuery("#donation_main_con").on("mousewheel", function () {
477    event.preventDefault();
478    var wd = event.wheelDelta;
479    var csp = window.pageYOffset;
480    window.scrollTo(0, csp - wd);
481  });
482}
483
484function get_ifreme(data) {
485  // var data1 = JSON.stringify(data);
486  jQuery.post(ajax_object.ajaxurl, data, function (response) {
487    //  ifreme_url =JSON.parse(response);
488
489    jQuery("#iframe").attr("src", response);
490      var interval = setInterval(function () {
491      // console.log(document.getElementById('iframe'));
492      var url = "";
493      if (parent != window) url = window.self.location.href;
494      else
495        url =
496          document.getElementById("iframe").contentWindow.self.location.href;
497       // console.log(url);
498    }, 3000);
499
500    // response = JSON.parse(response);
501    // console.log(response);
502    if (response.status == 1) {
503      jQuery("html, body").animate(
504        {
505          scrollTop: jQuery("#donation_form_con").offset().top,
506        },
507        1000
508      );
509      jQuery("#donation_form_step3")
510        .slideUp("slow")
511        .promise()
512        .done(function () {
513          jQuery("#donation_progress_con").attr("data-steps", "4");
514          jQuery(".donation_progress_item[data-num=4]").addClass("active");
515          jQuery("#donation_form_step4").slideDown("slow");
516        });
517    } else {
518      // button.text(button.attr("data-text")).prop('disabled', false);
519      jQuery("#errorMsg").text(response.message);
520    }
521  });
522}
523
524function set_donor(data) {
525  var formData = {
526    formData: data,
527  };
528
529  formData["status"] = "pending";
530
531  jQuery.post(ajax_object2.ajaxurl2, formData, function (response) {
532    if (response.status == 1) {
533    } else {
534      jQuery("#errorMsg").text(response.message);
535    }
536  });
537}
538jQuery("button.project").on("click touchstart", function () {
539  jQuery("input[name=project]").val("");
540
541  jQuery("input[name=project]").val(jQuery(this).text().trim());
542  // jQuery('input[name=amount]').val(jQuery(this).text().trim() * jQuery('input[name=months]').val());
543
544  jQuery(this).addClass("active");
545  jQuery(this).siblings().removeClass("active");
546  return false;
547});

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.