First Initialization

This commit is contained in:
aliakbar
2026-06-29 15:32:24 +03:30
commit 29c2add74e
105 changed files with 13177 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
// static/js/main.js
window.addEventListener("message", function(event) {
const data = event.data;
if (!data || !data.type) return;
// به‌روزرسانی سایدبار گراف هنگام هاور
if (data.type === 'hoverNode' || data.type === 'hoverEdge') {
const infoDiv = document.getElementById('hover-info');
if (infoDiv) {
// تبدیل \n به <br> برای نمایش درست در HTML
const formattedInfo = data.info.replace(/\n/g, '<br>');
infoDiv.innerHTML = `<strong>جزئیات:</strong><br><br>${formattedInfo}`;
infoDiv.style.borderRightColor = data.type === 'hoverEdge' ? '#e9c46a' : '#2a9d8f';
}
}
// پاک کردن سایدبار وقتی موس از روی عنصر کنار می‌رود
if (data.type === 'blur') {
const infoDiv = document.getElementById('hover-info');
if (infoDiv) {
infoDiv.innerHTML = '<em>برای مشاهده جزئیات، موس را روی گزاره‌ها یا خطوط ارتباطی ببرید...</em>';
infoDiv.style.borderRightColor = '#444';
}
}
});
function showLoading() {
document.getElementById('process-form').style.display = 'none';
document.getElementById('loading-section').style.display = 'block';
}
+49
View File
File diff suppressed because one or more lines are too long