DmitrMakeev commited on
Commit
c226db6
·
verified ·
1 Parent(s): 2b7a9b4

Update pages.html

Browse files
Files changed (1) hide show
  1. pages.html +0 -289
pages.html CHANGED
@@ -351,237 +351,6 @@ const editor = grapesjs.init({
351
  <script type="text/javascript" src="https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/rus/rus.js"></script>
352
 
353
 
354
- <script>
355
-
356
-
357
-
358
-
359
-
360
-
361
-
362
-
363
- // Создаем новый тип компонента для блока настроек
364
- editor.Components.addType('empty-block', {
365
- model: {
366
- defaults: {
367
- // HTML-код пустого блока с постоянным идентификатором
368
- content: '<div id="set_avp"></div>',
369
- // Скрипт для обработки блока (если нужно)
370
- script: function(props) {
371
- window.avp = props.avp;
372
- window.grup = props.grup;
373
- window.red_url = props.red_url;
374
- window.pol_a = props.pol_a;
375
- window.pol_b = props.pol_b;
376
- window.new_w = props.new_w;
377
-
378
- const initBlock = () => {
379
- console.log('Empty block initialized with props:', { avp, grup, red_url, pol_a, pol_b, new_w });
380
- };
381
- const loadScript = (src, callback) => {
382
- const script = document.createElement('script');
383
- script.src = src;
384
- script.onload = callback;
385
- document.body.appendChild(script);
386
- };
387
- // Загружаем необходимые скрипты динамически
388
- if (typeof vkBridge === 'undefined') {
389
- loadScript('https://unpkg.com/@vkontakte/vk-bridge/dist/browser.min.js', () => {
390
- console.log('VK Bridge loaded!');
391
- initBlock();
392
- });
393
- } else {
394
- initBlock();
395
- }
396
-
397
- if (typeof VK === 'undefined') {
398
- loadScript('https://vk.com/js/api/openapi.js?169', () => {
399
- console.log('VK Open API loaded!');
400
- });
401
- }
402
-
403
- loadScript('https://huggingface.co/spaces/vkatis/api/resolve/main/bundle.3ea86973b4b6c8f6c2bf.js', () => {
404
- console.log('Custom script loaded!');
405
- });
406
- },
407
- // Свойства, которые будут передаваться в скрипт
408
- 'script-props': ['avp', 'grup', 'red_url', 'pol_a', 'pol_b', 'new_w'],
409
- // Настройки для изменения URL отправки
410
- traits: [
411
- {
412
- type: 'text',
413
- name: 'avp',
414
- label: 'AVP',
415
- changeProp: true
416
- },
417
- {
418
- type: 'text',
419
- name: 'grup',
420
- label: 'GRUP',
421
- changeProp: true
422
- },
423
- {
424
- type: 'text',
425
- name: 'red_url',
426
- label: 'RED_URL',
427
- changeProp: true
428
- },
429
- {
430
- type: 'text',
431
- name: 'pol_a',
432
- label: 'POL_A',
433
- changeProp: true
434
- },
435
- {
436
- type: 'text',
437
- name: 'pol_b',
438
- label: 'POL_B',
439
- changeProp: true
440
- },
441
- {
442
- type: 'text',
443
- name: 'new_w',
444
- label: 'NEW_W',
445
- changeProp: true
446
- }
447
- ]
448
- }
449
- }
450
- });
451
- // Создаем блок для компонента пустого блока
452
- editor.Blocks.add('empty-block-block', {
453
- label: 'Empty Block',
454
- content: { type: 'empty-block' },
455
- });
456
-
457
-
458
-
459
- </script>
460
-
461
- <script>
462
-
463
-
464
-
465
-
466
-
467
-
468
-
469
- // Создаем новый тип компонента для настроек видеоплеера
470
- editor.Components.addType('video-player-settings', {
471
- model: {
472
- defaults: {
473
- // HTML-код блока настроек видеоплеера
474
- content: '<div id="video-player-settings"></div>',
475
- // Скрипт для обработки блока (если нужно)
476
- script: function(props) {
477
- window.vid_list = props.vid_list;
478
- console.log('Video player settings initialized with vid_list:', vid_list);
479
- // Подключение указанных скриптов
480
- const loadScriptToHead = (src, callback) => {
481
- const script = document.createElement('script');
482
- script.src = src;
483
- script.onload = callback;
484
- document.head.appendChild(script);
485
- };
486
- const loadScriptToBody = (src, callback) => {
487
- const script = document.createElement('script');
488
- script.src = src;
489
- script.onload = callback;
490
- document.body.appendChild(script);
491
- };
492
- const library = props.library;
493
- let playerjsSrc;
494
- if (library === '1') {
495
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p1/playerjs.js';
496
- } else if (library === '2') {
497
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p2/playerjs.js';
498
- } else if (library === '3') {
499
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p3/playerjs.js';
500
- } else if (library === '4') {
501
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p4/playerjs.js';
502
- } else if (library === '5') {
503
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p5/playerjs.js';
504
- } else if (library === '6') {
505
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p6/playerjs.js';
506
- } else if (library === '7') {
507
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p7/playerjs.js';
508
- } else if (library === '8') {
509
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p8/playerjs.js';
510
- } else if (library === '9') {
511
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p9/playerjs.js';
512
- } else if (library === '10') {
513
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p10/playerjs.js';
514
- } else if (library === '11') {
515
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p11/playerjs.js';
516
- } else if (library === '12') {
517
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p12/playerjs.js';
518
- } else if (library === '13') {
519
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p13/playerjs.js';
520
- } else if (library === '14') {
521
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p14/playerjs.js';
522
- } else if (library === '15') {
523
- playerjsSrc = 'https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/p15/playerjs.js';
524
- }
525
- if (playerjsSrc) {
526
- loadScriptToHead(playerjsSrc, () => {
527
- console.log('PlayerJS script loaded!');
528
- loadScriptToBody('https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/playerst.js', () => {
529
- console.log('PlayerST script loaded!');
530
- });
531
- });
532
- }
533
- },
534
- // Свойства, которые будут передаваться в скрипт
535
- 'script-props': ['vid_list', 'library'],
536
- // Настройки для ввода JSON-строки с данными о видео
537
- traits: [
538
- {
539
- type: 'select',
540
- name: 'library',
541
- label: 'Library',
542
- options: [
543
- { value: '1', name: 'Плеер - 1' },
544
- { value: '2', name: 'Плеер - 2' },
545
- { value: '3', name: 'Плеер - 3' },
546
- { value: '4', name: 'Плеер - 4' },
547
- { value: '5', name: 'Плеер - 5' },
548
- { value: '6', name: 'Плеер - 6' },
549
- { value: '7', name: 'Плеер - 7' },
550
- { value: '8', name: 'Плеер - 8' },
551
- { value: '9', name: 'Плеер - 9' },
552
- { value: '10', name: 'Плеер - 10' },
553
- { value: '11', name: 'Плеер - 11' },
554
- { value: '12', name: 'Плеер - 12' },
555
- { value: '13', name: 'Плеер - 13' },
556
- { value: '14', name: 'Плеер - 14' },
557
- { value: '15', name: 'Плеер - 15' }
558
- ],
559
- changeProp: true
560
- },
561
- {
562
- type: 'text',
563
- name: 'vid_list',
564
- label: 'Video List',
565
- changeProp: true,
566
- placeholder: '[{"title":"Название","file":"URL"},...]',
567
- style: { width: '100%', height: '200px' } // Широкое поле ввода
568
- }
569
- ]
570
- }
571
- }
572
- });
573
- // Создаем блок для компонента настроек видеоплеера
574
- editor.Blocks.add('video-player-settings-block', {
575
- label: 'Воспроизведение медиа',
576
- content: { type: 'video-player-settings' },
577
- });
578
-
579
-
580
-
581
-
582
-
583
-
584
-
585
 
586
 
587
 
@@ -589,64 +358,6 @@ editor.Blocks.add('video-player-settings-block', {
589
 
590
 
591
 
592
-
593
-
594
-
595
-
596
-
597
-
598
-
599
-
600
-
601
-
602
-
603
-
604
-
605
-
606
-
607
-
608
-
609
-
610
-
611
-
612
-
613
-
614
-
615
-
616
-
617
-
618
-
619
-
620
-
621
-
622
-
623
-
624
-
625
-
626
-
627
-
628
-
629
-
630
-
631
-
632
-
633
-
634
-
635
-
636
-
637
-
638
-
639
-
640
-
641
-
642
-
643
-
644
-
645
-
646
-
647
-
648
- </script>
649
-
650
  <script>
651
 
652
  editor.BlockManager.add('custom-player', {
 
351
  <script type="text/javascript" src="https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/rus/rus.js"></script>
352
 
353
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
 
355
 
356
 
 
358
 
359
 
360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  <script>
362
 
363
  editor.BlockManager.add('custom-player', {