Update pages.html
Browse files- pages.html +16 -4
pages.html
CHANGED
@@ -946,15 +946,26 @@ editor.Components.addType('menu-settings-block', {
|
|
946 |
const initBlock = () => {
|
947 |
console.log('Menu settings block initialized with props:', { home_url });
|
948 |
};
|
949 |
-
|
950 |
-
|
951 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
952 |
// Загружаем необходимый скрипт динамически
|
953 |
loadScript('https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/menu_vk.js', () => {
|
954 |
console.log('Custom script loaded!');
|
955 |
initBlock();
|
956 |
});
|
957 |
-
}
|
958 |
},
|
959 |
// Добавляем traits
|
960 |
traits: [
|
@@ -980,6 +991,7 @@ editor.Blocks.add('menu-settings-block-block', {
|
|
980 |
</div>`,
|
981 |
content: { type: 'menu-settings-block' },
|
982 |
});
|
|
|
983 |
</script>
|
984 |
|
985 |
|
|
|
946 |
const initBlock = () => {
|
947 |
console.log('Menu settings block initialized with props:', { home_url });
|
948 |
};
|
949 |
+
|
950 |
+
// Проверяем, загружен ли уже jQuery
|
951 |
+
if (typeof $ === 'undefined') {
|
952 |
+
// Загружаем библиотеку jQuery
|
953 |
+
loadScript('https://code.jquery.com/jquery-3.6.0.min.js', () => {
|
954 |
+
console.log('jQuery loaded!');
|
955 |
+
// Загружаем необходимый скрипт динамически
|
956 |
+
loadScript('https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/menu_vk.js', () => {
|
957 |
+
console.log('Custom script loaded!');
|
958 |
+
initBlock();
|
959 |
+
});
|
960 |
+
});
|
961 |
+
} else {
|
962 |
+
console.log('jQuery is already loaded!');
|
963 |
// Загружаем необходимый скрипт динамически
|
964 |
loadScript('https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/menu_vk.js', () => {
|
965 |
console.log('Custom script loaded!');
|
966 |
initBlock();
|
967 |
});
|
968 |
+
}
|
969 |
},
|
970 |
// Добавляем traits
|
971 |
traits: [
|
|
|
991 |
</div>`,
|
992 |
content: { type: 'menu-settings-block' },
|
993 |
});
|
994 |
+
|
995 |
</script>
|
996 |
|
997 |
|