PageSourceSearch

https://www.ubackup.com/resource/acbn/js/collect.js

js ubackup.com collected 2026-10-01 06:44:07 UTC 11,978 bytes, 713 lines download raw bytes

1let timer1;
2
3let timer2;
4
5let timer3;
6
7// form请求
8
9var oTipsInf = {
10
11  en: {
12
13    empty: "Please fill out this field.",
14
15    emailFormat: "Make sure you give a valid email address.",
16
17    // 'namelength': '名字长度为2-40个字符字符',
18
19    nameFormat: "Please enter the correct information",
20
21    country: "Please enter the correct country",
22
23  },
24  jp: {
25    empty: "この項目は入力必須です。",
26    emailFormat: "有効なメールアドレスをご入力ください。",
27    nameFormat: "正しい情報をご入力ください",
28    country: "正しい国をご入力ください",
29  },
30
31};
32
33var tipsTxt = oTipsInf[__gc.showCurrentLang()];
34
35var downloadLink = "";
36
37
38
39var requestObj = {
40
41  downloadLink: "",
42
43  inputFoucesInLabel: function() {
44
45    $("input").focus(function() {
46
47        $(this).parents("label").addClass("focus");
48
49        $(this).parents(".row").find(".tips-info").remove();
50
51      }),
52
53      $("input").blur(function() {
54
55        $(this).parents("label").removeClass("focus");
56
57      });
58
59  },
60
61
62
63  showTip: function($this, info, type) {
64
65    // console.log($this, info, type, "555");
66
67    var tipsEle = '<p class="tips-info">' + info + "</p>";
68
69    $this.parents(".form-row").find(".tips-info").remove();
70
71    $this.parents(".form-row").append(tipsEle);
72
73    if (type == "error") {
74
75      $this
76
77        .addClass("err")
78
79        .parents(".form-row")
80
81        .find(".tips-info")
82
83        .addClass("err");
84
85    } else {
86
87      $this.parents(".form-row").find(".tips-info").addClass("suc");
88
89    }
90
91    info == "" && $this.parents(".form-row").find(".tips-info").remove();
92
93  },
94
95
96
97  notEmpty: function($elem) {
98
99    var value = $.trim($elem.val());
100
101    if (value == "") {
102
103      this.showTip($elem, tipsTxt["empty"], "error");
104
105    } else {
106
107      this.showTip($elem, "");
108
109      return value;
110
111    }
112
113  },
114
115
116
117  emailTest: function($email, type) {
118
119    var emailValue = $.trim($email.val());
120
121
122
123    var emailRegex =
124
125      /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
126
127    // console.log(!emailRegex.test(emailValue), "email");
128
129    if (emailValue == "") {
130
131      this.showTip($email, tipsTxt[emailEmpty], "error");
132
133    } else if (!emailRegex.test(emailValue)) {
134
135      this.showTip($email, tipsTxt["emailFormat"], "error");
136
137    } else {
138
139      this.showTip($email, "");
140
141      return emailValue;
142
143    }
144
145  },
146
147  nameTest: function($name) {
148
149    var userVlue = $.trim($name.val());
150
151    var nameRegex = /^[\u4e00-\u9fa5_a-zA-Z0-9\s]+$/;
152
153    if (!nameRegex.test(userVlue)) {
154
155      showTip($name, tipsTxt["nameFormat"], "error");
156
157    } else {
158
159      showTip($name, "");
160
161      return userVlue;
162
163    }
164
165  },
166
167  isPCDevice: function() {
168
169    var isPc = "";
170
171    isPc =
172
173      navigator.userAgent
174
175      .toLowerCase()
176
177      .match(
178
179        /(ipod|ipad|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i
180
181      ) == null
182
183      ?
184      "pc"
185
186      :
187      "mobile";
188
189    return isPc;
190
191  },
192
193  downloadFile: function(downloadUrl, downloadText) {
194
195    // create form
196
197    var formObj = document.createElement("form");
198
199    formObj.action = downloadUrl;
200
201    formObj.method = "get";
202
203    formObj.style.display = "none";
204
205    var formItem = document.createElement("input");
206
207    var downloadLinkArry = downloadUrl && downloadUrl.split("/")
208
209    formItem.value = downloadLinkArry[downloadLinkArry.length - 1].replace(
210
211      ".exe",
212
213      ""
214
215    );
216
217    formItem.name = "fileName";
218
219
220
221    // append form
222
223    formObj.appendChild(formItem);
224
225    document.body.appendChild(formObj);
226
227
228
229    formObj.submit();
230
231
232
233    document.body.removeChild(formObj); // send end remove
234
235    sendAcbnDataFunc(downloadText, downloadUrl)
236
237
238
239  },
240
241  submit: function() {
242
243    var _this = this;
244
245    $('[data-elem="form"] .submit').on("click", function() {
246
247      //   console.log(_this.downloadLink);
248
249      var $this = $(this),
250
251        $form = $this.parents('[data-elem="form"]'),
252
253        $email = $form.find('[name="email"]'),
254
255        $name = $form.find('[name="username"]'),
256
257        // $Country = $form.find('[data-flags="parents"]'),
258
259        $company = $form.find('[name="company"]'),
260
261        // $purpose = $form.find('[data-check"]'),
262
263        $details = $form.find('[name="details"]'),
264
265        name = "empty",
266
267        email = "",
268
269        Country = "empty",
270
271        company = "empty",
272
273        details = "empty",
274
275        device = _this.isPCDevice(),
276
277        // productName = $("[data-check].active").data("check") || "empty",
278
279        // productName = $this.data("check") || "empty",
280
281        isSend = false;
282
283      var productName = "";
284
285      if ($this.data("check")) {
286
287        productName = $this.data("check") || "empty";
288
289      } else {
290
291        productName = $("#product-name").data("product") || "vm";
292
293      }
294
295      // isSend ?
296
297      $.each($form.find('[data-elem="notempty"]'), function(i, item) {
298
299        _this.notEmpty($(item));
300
301      });
302
303
304
305      $name.val() && (name = _this.nameTest($name));
306
307      $email.val() && (email = _this.emailTest($email));
308
309      // $("[name=country]").val() == ""
310
311      //   ? (Country = "")
312
313      //   : (Country = isSelectFlags($Country));
314
315      company = $.trim($company.val());
316
317      details = $.trim($details.val());
318
319      isSend = email;
320
321      var isSending = false; // Prevent multiple requests
322
323      if (isSending) {
324
325        return false;
326
327      }
328
329
330
331      if (isSend) {
332
333        $.ajax({
334
335          url: "https://account.aomeitech.com/enterprise/request",
336
337          type: "post",
338
339          data: {
340
341            email: email,
342
343            username: name,
344
345            city: Country,
346
347            device: device,
348
349            product: productName, // 没有产品选择时传empty
350
351            company: company,
352
353            descrption: details,
354
355            url: window.location.pathname,
356
357            lang: __gc.showCurrentLang(),
358
359            website: window.location.host,
360
361            lpi: __qt.getCookie("_ll_lp"),
362
363            is_send: true,
364
365          },
366
367          beforeSend: function() {
368
369            isSending = true;
370
371            $this.addClass("loading");
372
373            !__qt.isMobile() &&
374
375              $(".am-download-x").addClass("isopen").removeClass("isclose");
376
377          },
378
379          success: function(resp) {
380
381            if (resp.status_code == 200) {
382
383              $(".endpop").addClass("show");
384
385              $(".ic-label").children("input").val("");
386
387              $("[name=country]").val("");
388
389              $("[name=purpose]").val("");
390
391              $(".close").trigger("click");
392
393              //var downloadLink = $this.attr("data-download");
394
395              //   window.open(downloadLink);
396
397              //   var newTab = window.open('about:blank')
398
399              //   newTab.location.href = downloadLink;
400
401              //$("[data-downloadpop='currenturl']").attr("href", downloadLink)
402
403              //_this.downloadFile(downloadLink);
404
405              requestObj.changeTxt();
406
407            } else {
408
409              _this.showTip($("button"), resp, "error");
410
411            }
412
413          },
414
415          complete: function(resp) {
416
417            isSending = false;
418
419            $this.removeClass("loading");
420
421            var downloadLink = $this.attr("data-download");
422
423            var downloadTxt = $this.text();
424
425            $("[data-downloadpop='currenturl']").attr("href", downloadLink);
426
427            _this.downloadFile(downloadLink, downloadTxt);
428
429          },
430
431        });
432
433        //guide 下载指示
434
435        var isChrome =
436
437          window.navigator.userAgent.indexOf("Chrome") !== -1 &&
438
439          window.navigator.userAgent.indexOf("Edge") == -1 &&
440
441          window.navigator.userAgent.indexOf("Edg") == -1 &&
442
443          window.navigator.userAgent.indexOf("OPR") == -1;
444
445        if (isChrome) {
446
447          $(".guide").addClass("start");
448
449          // $('.guide').oneTime('5s', function () {
450
451          //   $('.guide').css('opacity', '1')
452
453          // })
454
455        }
456
457      }
458
459    });
460
461  },
462
463  closeDownloadPop: function() {
464
465    $(".am-close").click(function() {
466
467      $(".am-download-x").addClass("isclose");
468
469      $(".guide").removeClass("start");
470
471      $("body").removeClass("overflow");
472
473      $("[data-downloadpop='changetxt']")
474
475        .eq(0)
476
477        .addClass("txt-show")
478
479        .siblings()
480
481        .removeClass("txt-show");
482
483      clearTimeout(timer1);
484
485      clearTimeout(timer2);
486
487      clearTimeout(timer3);
488
489      timer1 = null;
490
491      timer2 = null;
492
493      timer3 = null;
494
495    });
496
497  },
498
499  changeTxt() {
500
501    if (!timer1 && !timer2 && !timer3) {
502
503      timer1 = setTimeout(function() {
504
505        $("[data-downloadpop='changetxt']")
506
507          .eq(0)
508
509          .addClass("txt-show")
510
511          .siblings()
512
513          .removeClass("txt-show");
514
515        timer2 = setTimeout(function() {
516
517          $("[data-downloadpop='changetxt']")
518
519            .eq(1)
520
521            .addClass("txt-show")
522
523            .siblings()
524
525            .removeClass("txt-show");
526
527          timer3 = setTimeout(function() {
528
529            $("[data-downloadpop='changetxt']")
530
531              .eq(2)
532
533              .addClass("txt-show")
534
535              .siblings()
536
537              .removeClass("txt-show");
538
539          }, 15000);
540
541        }, 0);
542
543      }, 3000);
544
545    }
546
547  },
548
549};
550
551
552
553// console.log(window.navigator.userAgent);
554
555
556
557// if (isChrome) {
558
559//     alert("是Chrome浏览器");
560
561// } else {
562
563//     alert("不是Chrome浏览器");
564
565// }
566
567
568
569$(".guide-close").click(function() {
570
571  // console.log(11111111);
572
573  $(".guide").removeClass("start");
574
575});
576
577
578
579function closePopup() {
580
581  $(".close").click(function() {
582
583    var $this = $(this);
584
585    // console.log($this.parents('[data-popup="parent"]'));
586
587    $this.parents('[data-popup="parent"]').hide();
588
589  });
590
591}
592
593
594
595function showPopup() {
596
597  $('[data-btn="show-popup"]').click(function() {
598
599    var $this = $(this);
600
601    var $popup = $('[data-popup="parent"]');
602
603    var type = $this.attr("data-type");
604
605    var downloadLinkArry = $this.attr("data-download") && $this.attr("data-download").split("|")
606
607    var downloadNameArry =
608
609      $this.attr("data-name") && $this.attr("data-name").split("|")
610
611    $popup.show().attr("data-type", type);
612
613    // add download link
614
615    $popup.find(".submit").each(function(i, item) {
616
617      $(item).attr("data-download", downloadLinkArry[i]);
618
619      if (downloadNameArry) {
620
621        var gaArry = $(item).attr("onclick") && $(item).attr("onclick").split(",")
622
623        gaArry[2] = "'" + downloadNameArry[i] + "'";
624
625        $(item).attr("onclick", gaArry.join(","));
626
627      }
628
629    });
630
631  });
632
633}
634
635showPopup();
636
637closePopup();
638
639function changeAcbnGa() {
640
641  $("[data-btn='show-popup']").click(function() {
642
643    if ($(this).parents("table").length > 0) {
644
645      $("[data-popup='parent'] .popup-cnt a").each(function(i, m) {
646
647        var newOnclick = $(m)
648
649          .attr("onclick")
650
651          .replace("_banner_emfilled", "_table_emfilled")
652
653          .replace(".html_emfilled", ".html_table_emfilled")
654
655          .replace("_bottom_emfilled", "_banner_emfilled");
656
657        $(m).attr("onclick", newOnclick);
658
659      });
660
661    } else if ($(this).parents(".bnr,.banner").length > 0) {
662
663      $("[data-popup='parent'] .popup-cnt a").each(function(i, m) {
664
665        var newOnclick = $(m)
666
667          .attr("onclick")
668
669          .replace("_table_emfilled", "_banner_emfilled")
670
671          .replace(".html_emfilled", ".html_banner_emfilled")
672
673          .replace("_bottom_emfilled", "_banner_emfilled");
674
675        $(m).attr("onclick", newOnclick);
676
677      });
678
679    } else {
680
681      $("[data-popup='parent'] .popup-cnt a").each(function(i, m) {
682
683        var newOnclick = $(m)
684
685          .attr("onclick")
686
687          .replace(".html_emfilled", ".html_bottom_emfilled")
688
689          .replace("_banner_emfilled", "_bottom_emfilled");
690
691        $(m).attr("onclick", newOnclick);
692
693      });
694
695    }
696
697  });
698
699}
700
701
702
703changeAcbnGa();
704
705requestObj.inputFoucesInLabel();
706
707requestObj.submit();
708
709requestObj.closeDownloadPop();
710
711
712
713//提交

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.