DmitrMakeev
commited on
Update js/rus/rus.js
Browse files- js/rus/rus.js +140 -0
js/rus/rus.js
CHANGED
@@ -465,6 +465,146 @@ editor.Blocks.add('avp_kol_f_v1-settings-block-block', {
|
|
465 |
|
466 |
|
467 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
// Создаем новый тип компонента для настройки
|
469 |
editor.Components.addType('avp-look_1-settings-block', {
|
470 |
model: {
|
|
|
465 |
|
466 |
|
467 |
|
468 |
+
|
469 |
+
|
470 |
+
editor.Components.addType('avp_kol_s-settings-block', {
|
471 |
+
model: {
|
472 |
+
defaults: {
|
473 |
+
content: '<div id="set_kol_s"></div>',
|
474 |
+
script: function(props) {
|
475 |
+
window.idSpun = props.idSpun;
|
476 |
+
window.but_text = props.but_text;
|
477 |
+
window.color_but = props.color_but;
|
478 |
+
window.sector = JSON.parse(props.sector); // Парсим JSON строку сектора
|
479 |
+
window.delay = parseInt(props.delay, 10); // Парсим числовое значение delay
|
480 |
+
window.avp = props.avp;
|
481 |
+
window.grup = props.grup;
|
482 |
+
window.red_url = props.red_url;
|
483 |
+
window.new_w = props.new_w;
|
484 |
+
window.hook = props.hook;
|
485 |
+
const initBlock = () => {
|
486 |
+
console.log('Empty block initialized with props:', { idSpun, but_text, color_but, sector, delay, avp, grup, red_url, new_w, hook });
|
487 |
+
console.log('Parsed sector:', sector); // Выводим сектор в консоль
|
488 |
+
};
|
489 |
+
const loadScript = (src, callback) => {
|
490 |
+
const script = document.createElement('script');
|
491 |
+
script.src = src;
|
492 |
+
script.onload = callback;
|
493 |
+
document.body.appendChild(script);
|
494 |
+
};
|
495 |
+
if (typeof vkBridge === 'undefined') {
|
496 |
+
loadScript('https://unpkg.com/@vkontakte/vk-bridge/dist/browser.min.js', () => {
|
497 |
+
console.log('VK Bridge loaded!');
|
498 |
+
initBlock();
|
499 |
+
});
|
500 |
+
} else {
|
501 |
+
initBlock();
|
502 |
+
}
|
503 |
+
|
504 |
+
if (typeof VK === 'undefined') {
|
505 |
+
loadScript('https://vk.com/js/api/openapi.js?169', () => {
|
506 |
+
console.log('VK Open API loaded!');
|
507 |
+
});
|
508 |
+
}
|
509 |
+
|
510 |
+
loadScript('https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/avp_koleso_v1.js', () => {
|
511 |
+
console.log('Custom script loaded!');
|
512 |
+
});
|
513 |
+
},
|
514 |
+
'script-props': ['idSpun', 'but_text', 'color_but', 'sector', 'delay', 'avp', 'grup', 'red_url', 'pol_a', 'pol_b', 'new_w'],
|
515 |
+
traits: [
|
516 |
+
{
|
517 |
+
type: 'text',
|
518 |
+
name: 'idSpun',
|
519 |
+
label: 'IDSPUN',
|
520 |
+
changeProp: true
|
521 |
+
},
|
522 |
+
{
|
523 |
+
type: 'text',
|
524 |
+
name: 'but_text',
|
525 |
+
label: 'BUT_TEXT',
|
526 |
+
changeProp: true
|
527 |
+
},
|
528 |
+
{
|
529 |
+
type: 'color',
|
530 |
+
name: 'color_but',
|
531 |
+
label: 'COLOR_BUT',
|
532 |
+
changeProp: true
|
533 |
+
},
|
534 |
+
{
|
535 |
+
type: 'text',
|
536 |
+
name: 'sector',
|
537 |
+
label: 'SECTORS',
|
538 |
+
changeProp: true
|
539 |
+
},
|
540 |
+
{
|
541 |
+
type: 'number', // Изменено на number
|
542 |
+
name: 'delay',
|
543 |
+
label: 'DELAY',
|
544 |
+
changeProp: true,
|
545 |
+
min: 100, // Минимальное значение
|
546 |
+
max: 10000, // Минимальное значение
|
547 |
+
step: 100, // Шаг изменения
|
548 |
+
default: 500 // Значение по умолчанию
|
549 |
+
},
|
550 |
+
{
|
551 |
+
type: 'text',
|
552 |
+
name: 'avp',
|
553 |
+
label: 'AVP',
|
554 |
+
changeProp: true
|
555 |
+
},
|
556 |
+
{
|
557 |
+
type: 'text',
|
558 |
+
name: 'grup',
|
559 |
+
label: 'GRUP',
|
560 |
+
changeProp: true
|
561 |
+
},
|
562 |
+
{
|
563 |
+
type: 'text',
|
564 |
+
name: 'red_url',
|
565 |
+
label: 'RED_URL',
|
566 |
+
changeProp: true
|
567 |
+
},
|
568 |
+
{
|
569 |
+
type: 'checkbox', // Изменено на checkbox
|
570 |
+
name: 'new_w',
|
571 |
+
label: 'NEW_W', // Обновлен лейбл
|
572 |
+
changeProp: true
|
573 |
+
},
|
574 |
+
{
|
575 |
+
type: 'checkbox', // Изменено на checkbox
|
576 |
+
name: 'hook',
|
577 |
+
label: 'HOOK',
|
578 |
+
changeProp: true
|
579 |
+
}
|
580 |
+
]
|
581 |
+
}
|
582 |
+
}
|
583 |
+
});
|
584 |
+
|
585 |
+
editor.Blocks.add('avp_kol_s-settings-block-block', {
|
586 |
+
label: `
|
587 |
+
<!-- icon666.com - MILLIONS vector ICONS FREE --><svg id="Layer_1" enable-background="new 0 0 152 152" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg" width="36" height="36"><path id="Icon" clip-rule="evenodd" d="m74.5 112.8h7.8c1.3-.2 2.6-.8 3.6-1.6.6-1 1.1-2.1 1.1-3.4 0 0-.2-10.4 4.7-12s10.9 10.1 17.4 14.6c4.9 3.4 8.6 2.6 8.6 2.6l17.4-.3s9.1-.5 4.7-7.6c-.3-.6-2.6-5.2-13-14.9-10.9-10.1-9.4-8.4 3.7-26 8-10.6 11.2-17.1 10.2-20s-6.8-1.9-6.8-1.9l-19.5.2c-.8-.2-1.8 0-2.6.5s-1.3 1.3-1.8 2.1c-1.9 5.2-4.4 10.4-7.1 15.3-8.8 14.8-12.2 15.6-13.6 14.6-3.2-2.1-2.4-8.6-2.4-13.2 0-14.3 2.1-20.3-4.2-21.8-2.9-.6-6-1-9.1-1-7 0-12.8 0-16.2 1.6-2.4 1-4 3.4-3 3.4 2.3.2 4.2 1.3 5.8 2.9 1.9 2.8 1.9 8.8 1.9 8.8s1.1 16.9-2.8 19c-2.6 1.5-6.2-1.5-14-14.9-2.6-4.7-5-9.4-7-14.5-.3-.8-1-1.6-1.6-2.1-.3-.2-.6-.5-1-.5-1-.5-2.1-.6-3.2-.6l-17.4.2s-2.8 0-3.7 1.3c-1 1.3 0 3.2 0 3.2s14.6 34.1 31 51.2c15.1 15.9 32.1 14.8 32.1 14.8z" fill-rule="evenodd" fill="#000000" style="fill: rgb(255, 255, 255);"></path></svg>
|
588 |
+
avp_kol_s`,
|
589 |
+
content: { type: 'avp_kol_s-settings-block' },
|
590 |
+
category: 'Автопилот - ВК', // Добавляем категорию "Автопилот - ВК"
|
591 |
+
});
|
592 |
+
|
593 |
+
|
594 |
+
|
595 |
+
|
596 |
+
|
597 |
+
|
598 |
+
|
599 |
+
|
600 |
+
|
601 |
+
|
602 |
+
|
603 |
+
|
604 |
+
|
605 |
+
|
606 |
+
|
607 |
+
|
608 |
// Создаем новый тип компонента для настройки
|
609 |
editor.Components.addType('avp-look_1-settings-block', {
|
610 |
model: {
|