diff --git a/content/access.page.php b/content/access.page.php
index 0429d55..4f19396 100644
--- a/content/access.page.php
+++ b/content/access.page.php
@@ -15,81 +15,11 @@
-текст текст текст текст текст текст текст текст текст текст текст тексритчрсотат текст текст текст текст
-
- текст текст текст текст текыККПАФЦКАКПАМст текст текст текст текст текст текст текст урпкцуептекст текст текст
+test1цыкцып
- текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст
+test2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
]]>Uz šo brīdi šeit ne kā nav
diff --git a/content/index.page.php b/content/index.page.php
index d5301b6..aff41f8 100644
--- a/content/index.page.php
+++ b/content/index.page.php
@@ -8,24 +8,12 @@
-
-
-
-
-
+
-
-
-
+
-
-text
-]]>
+
diff --git a/content/rpi/index.page.php b/content/rpi/index.page.php
index 0fa9800..d71c80f 100644
--- a/content/rpi/index.page.php
+++ b/content/rpi/index.page.php
@@ -8,95 +8,18 @@
-
-
-
-
-
+
-
-
-
+
-
-текст текст текст текст текст текст текст текст текст текст текст тексритчрсотат текст текст текст текст
-
- текст текст текст текст текыККПАФЦКАКПАМст текст текст текст текст текст текст текст урпкцуептекст текст текст
-
-
- текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
+
+
+test1цыуквацыфавп
+]]>
+test2
+]]>
+ cb bbvcdjyfdyhyhdывепиwstdg
]]>
diff --git a/data/Basic_functions.js b/data/Basic_functions.js
index f226cb5..5dfbfe5 100644
--- a/data/Basic_functions.js
+++ b/data/Basic_functions.js
@@ -533,12 +533,12 @@ if(isPhone){
/** @brief Флаг, указывающий, были ли изменения в контенте */
window.contentIsEdit = false;
-if (document.getElementById("content")) {
- document.getElementById("content").addEventListener("input", function() {
- window.contentIsEdit = true;
+if (document.querySelectorAll(".content").length) {
+ document.querySelectorAll(".content").forEach(el => {
+ el.addEventListener("input", () => window.contentIsEdit = true);
+ const observer = new MutationObserver(() => window.contentIsEdit = true);
+ observer.observe(el, { childList: true, subtree: true });
});
- const observer = new MutationObserver(() => window.contentIsEdit = true);
- observer.observe(document.getElementById("content"), { childList: true, subtree: true });
}
/** @brief Очередь сообщений для отображения */
@@ -738,8 +738,11 @@ let cou=1;
* @brief Показать/скрыть HTML-код страницы в textarea
*/
function showHtmlCode() {
+ let contents = document.getElementsByClassName("content");
if (cou==1) {
- document.getElementById("tex").value=document.getElementById("content").innerHTML;
+ let combined = "";
+ for (let i=0; i";
+ document.getElementById("tex").value = combined;
document.getElementById("tex").value = decodeHtmlEntities(document.getElementById("tex").value);
document.getElementById("tex").value = formatHTML(document.getElementById("tex").value);
let sbe=document.getElementsByClassName("sb");
@@ -754,11 +757,18 @@ function showHtmlCode() {
}
cou=2;
} else {
- document.getElementById("content").innerHTML=document.getElementById("tex").value;
+ let text = document.getElementById("tex").value;
+ let split = text.match(//gs);
+ if (split) {
+ for (let i=0; i/g, '');
+ }
+ }
document.getElementById("tex").style.visibility="hidden";
cou=1;
}
}
+
window.showHtmlCode = showHtmlCode;
/** @brief Флаг нового состояния страницы при сохранении */
@@ -783,8 +793,10 @@ window.saveChanges = saveChanges;
*/
function saveContentId() {
if(cou==1) {
- document.getElementById("content").innerHTML = decodeHtmlEntities(document.getElementById("content").innerHTML);
- document.getElementById("tex").value=document.getElementById("content").innerHTML;
+ let contents = document.getElementsByClassName("content");
+ let combined = "";
+ for (let i = 0; i < contents.length; i++) combined += "";
+ document.getElementById("tex").value = combined;
}
document.getElementById("tex").value = decodeHtmlEntities(document.getElementById("tex").value);
let saveContentIdData = document.getElementById("tex").value.trim();
@@ -796,8 +808,8 @@ function saveContentId() {
messageFunction("{{main_block_not_saved}}");
}
});
- }
-
+}
+
/**
* @brief Сохраняет данные подключённых плагинов (левой и правой колонок)
*/
@@ -897,11 +909,10 @@ function formatHTML(html) {
*/
window.saveContentIdHow = async function (currentPath) {
if (cou == 1) {
- document.getElementById("content").innerHTML = decodeHtmlEntities(document.getElementById("content").innerHTML);
- document.getElementById("tex").value = document.getElementById("content").innerHTML;
+ let contents = Array.from(document.getElementsByClassName("content")).map(el => el.innerHTML.trim());
+ document.getElementById("tex").value = contents.map(c => ``).join('');
}
- document.getElementById("tex").value = decodeHtmlEntities(document.getElementById("tex").value);
- let saveContentIdData = document.getElementById("tex").value.trim();
+ let saveContentIdData = decodeHtmlEntities(document.getElementById("tex").value).trim();
let nameFile = document.getElementById('saveHowName').value;
if (!nameFile.endsWith('.page.php')) {
nameFile += '.page.php';
@@ -1315,17 +1326,47 @@ window.functionOpenPage = false;
function getPage(newPath) {
window.functionOpenPage = true;
jsonrpcRequest("getPage", { newPath }).then(page => {
+ const centerFloat = document.querySelector('.center-float');
+ const oldBlocks = centerFloat.querySelectorAll('.bfloat');
+
+ oldBlocks.forEach(b => {
+ if (b.querySelector('.content')) {
+ const next = b.nextSibling;
+ if (next && next.nodeType === 1 && next.tagName === 'BR') next.remove();
+ if (next && next.nodeType === 3 && next.textContent.trim() === '') {
+ const next2 = next.nextSibling;
+ if (next2 && next2.nodeType === 1 && next2.tagName === 'BR') next2.remove();
+ }
+ b.remove();
+ }
+ });
+
+ page.content.forEach((c, i) => {
+ const placeholder = document.getElementById('news-placeholder');
+ if (i > 0) {
+ const br = document.createElement('br');
+ centerFloat.insertBefore(br, placeholder);
+ }
+ const block = document.createElement('div');
+ block.className = 'bfloat' + (i === 0 ? ' content1' : '');
+ block.style.fontSize = '1em';
+ const inner = document.createElement('div');
+ inner.className = 'content';
+ inner.innerHTML = c;
+ block.appendChild(inner);
+ centerFloat.insertBefore(block, placeholder);
+ });
+
document.getElementById("right-float").innerHTML = page.right;
document.getElementById("left-float").innerHTML = page.left;
- document.getElementById("content").innerHTML = page.content;
document.getElementById("managerDiv").style.visibility = "hidden";
- // history.pushState(null, '', page.pagePath);
document.getElementById("mainTitle").innerHTML = "{{new_file}}!";
- removePluginDom("manager")
+ removePluginDom("manager");
});
window.newPageFunValue = "";
}
+
//обьявление функции для того, чтобы обращатся к ней из других файлов
window.getPage = getPage;
window.managerData = managerData;
diff --git a/data/filepath.lv.php b/data/filepath.lv.php
index ad01772..652f30b 100644
--- a/data/filepath.lv.php
+++ b/data/filepath.lv.php
@@ -3,5 +3,13 @@
RaspberryqePiRaspberry Pi
+
+
+
+
+
+
+
+
diff --git a/data/filepath.ru.php b/data/filepath.ru.php
index 6aa3697..3011d5c 100644
--- a/data/filepath.ru.php
+++ b/data/filepath.ru.php
@@ -3,7 +3,7 @@
sitesite
-
+
diff --git a/data/func.php b/data/func.php
index 33d8a6b..fe61722 100644
--- a/data/func.php
+++ b/data/func.php
@@ -307,17 +307,6 @@ function GetBlock ($BlockVar, $side) {
}
}
return $Block;
-
- // $Block.='