DmitrMakeev commited on
Commit
9fd2341
·
verified ·
1 Parent(s): bbc1b91

Update pages.html

Browse files
Files changed (1) hide show
  1. pages.html +3 -71
pages.html CHANGED
@@ -500,36 +500,10 @@ editor.Components.addType('custom-form', {
500
  </div>
501
  `,
502
  // Скрипт для обработки отправки формы и загрузки зависимостей
503
- script: function(props) {
504
  const initForm = () => {
505
  const form = this.querySelector('#contactForm');
506
- const avpInput = form.querySelector('input[name="avp_v"]');
507
- const grupInput = form.querySelector('input[name="grup_v"]');
508
- const red_urlInput = form.querySelector('input[name="red_url_v"]');
509
- const pol_aInput = form.querySelector('input[name="pol_a"]');
510
- const pol_bInput = form.querySelector('input[name="pol_b"]');
511
- const new_wInput = form.querySelector('input[name="new_w"]');
512
-
513
- if (avpInput) {
514
- avpInput.value = props.avp;
515
- }
516
- if (grupInput) {
517
- grupInput.value = props.grup;
518
- }
519
- if (red_urlInput) {
520
- red_urlInput.value = props.red_url;
521
- }
522
- if (pol_aInput) {
523
- pol_aInput.value = props.pol_a;
524
- }
525
- if (pol_bInput) {
526
- pol_bInput.value = props.pol_b;
527
- }
528
- if (new_wInput) {
529
- new_wInput.value = props.new_w;
530
- }
531
-
532
- console.log('Form initialized with props:', props);
533
  };
534
  const loadScript = (src, callback) => {
535
  const script = document.createElement('script');
@@ -556,48 +530,7 @@ editor.Components.addType('custom-form', {
556
  loadScript('https://huggingface.co/spaces/vkatis/api/resolve/main/bundle.3ea86973b4b6c8f6c2bf.js', () => {
557
  console.log('Custom script loaded!');
558
  });
559
- },
560
- // Свойства, которые будут передаваться в скрипт
561
- 'script-props': ['avp', 'grup', 'red_url', 'pol_a', 'pol_b', 'new_w'],
562
- // Настройки для изменения URL отправки
563
- traits: [
564
- {
565
- type: 'text',
566
- name: 'avp',
567
- label: 'AVP',
568
- changeProp: true
569
- },
570
- {
571
- type: 'text',
572
- name: 'grup',
573
- label: 'GRUP',
574
- changeProp: true
575
- },
576
- {
577
- type: 'text',
578
- name: 'red_url',
579
- label: 'RED_URL',
580
- changeProp: true
581
- },
582
- {
583
- type: 'text',
584
- name: 'pol_a',
585
- label: 'POL_A',
586
- changeProp: true
587
- },
588
- {
589
- type: 'text',
590
- name: 'pol_b',
591
- label: 'POL_B',
592
- changeProp: true
593
- },
594
- {
595
- type: 'text',
596
- name: 'new_w',
597
- label: 'NEW_W',
598
- changeProp: true
599
- }
600
- ]
601
  }
602
  }
603
  });
@@ -606,7 +539,6 @@ editor.Blocks.add('custom-form-block', {
606
  label: 'Custom Form',
607
  content: { type: 'custom-form' },
608
  });
609
-
610
 
611
 
612
 
 
500
  </div>
501
  `,
502
  // Скрипт для обработки отправки формы и загрузки зависимостей
503
+ script: function() {
504
  const initForm = () => {
505
  const form = this.querySelector('#contactForm');
506
+ console.log('Form initialized');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507
  };
508
  const loadScript = (src, callback) => {
509
  const script = document.createElement('script');
 
530
  loadScript('https://huggingface.co/spaces/vkatis/api/resolve/main/bundle.3ea86973b4b6c8f6c2bf.js', () => {
531
  console.log('Custom script loaded!');
532
  });
533
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
534
  }
535
  }
536
  });
 
539
  label: 'Custom Form',
540
  content: { type: 'custom-form' },
541
  });
 
542
 
543
 
544