Files
crm.clientright.ru/test_syntax_check.html

49 lines
2.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>🔧 Проверка синтаксиса JavaScript</title>
</head>
<body>
<h1>🔧 Проверка синтаксиса JavaScript</h1>
<button onclick="testEditButton('123', 'test.docx')" style="background: green; color: white; padding: 15px;">
Тест кнопки редактирования
</button>
<div id="log" style="background: #f0f0f0; padding: 15px; margin: 20px 0; font-family: monospace;"></div>
<script>
function addLog(message) {
document.getElementById('log').innerHTML += '[' + new Date().toLocaleTimeString() + '] ' + message + '<br>';
}
// Копируем функцию из Header.tpl для проверки синтаксиса
function testEditButton(recordId, fileName) {
console.log("🚀 Nextcloud Editor:", recordId, fileName);
// Простая версия для начала
var editUrl = "https://office.klientprav.tech/apps/files/?dir=/CRM_Active_Files";
var editorWindow = window.open(editUrl, "nextcloud_editor", "width=1200,height=800");
if (editorWindow) {
alert("✅ Открываю Nextcloud для файла: " + fileName + "\n\nПерейдите в папку CRM_Active_Files и найдите ваш файл для редактирования.");
} else {
alert("❌ Всплывающие окна заблокированы. Откройте Nextcloud вручную:\n" + editUrl);
}
}
addLog('✅ JavaScript загружен без ошибок');
addLog('✅ Функция testEditButton определена');
// Проверяем синтаксис
try {
eval('testEditButton("test", "test.txt")');
addLog('✅ Синтаксис функции корректный');
} catch (e) {
addLog('❌ Ошибка синтаксиса: ' + e.message);
}
</script>
</body>
</html>