• R/O
  • SSH

fcf: Commit

FCF - Full Stack Javascript Framework

OpenSource is a full stack development framework designed to simplify the development of WEB projects of various complexity levels.

It is based on unique technologies that open up new opportunities in development approaches with NODEJS.


Commit MetaInfo

Revision7dac5a692093ac0842146bf90992ae445c576823 (tree)
Time2021-09-18 14:10:52
Authorv.o.markin
Commiterv.o.markin

Log Message

optimization DOM merge

Change Summary

Incremental Difference

diff -r 8e3745a96b88 -r 7dac5a692093 NClient/Wrapper.js
--- a/NClient/Wrapper.js Sat Sep 18 07:14:05 2021 +0300
+++ b/NClient/Wrapper.js Sat Sep 18 08:10:52 2021 +0300
@@ -37,7 +37,8 @@
3737 for(let i = 0; i < rm.length; ++i)
3838 a_dst.removeAttribute(rm[i]);
3939 for(let i = 0; i < a_src.attributes.length; ++i) {
40- a_dst.setAttribute(a_src.attributes[i].name, a_src.attributes[i].value);
40+ if (a_dst.attributes.value != a_src.attributes[i].value)
41+ a_dst.setAttribute(a_src.attributes[i].name, a_src.attributes[i].value);
4142 }
4243 }
4344
@@ -48,10 +49,17 @@
4849 for(let i = 0; i < a_src.childNodes.length; ++i) {
4950 let srcNode = a_src.childNodes[i];
5051 if (srcNode.nodeType == Node.TEXT_NODE){
51- a_dst.insertBefore(srcNode, a_dst.childNodes[di]);
52- srcNode.___fcf___merge = true;
53- --i;
54- ++di
52+ if (a_dst.childNodes[di] && a_dst.childNodes[di].nodeType == Node.TEXT_NODE){
53+ if (a_dst.childNodes[di].nodeValue != srcNode.nodeValue)
54+ a_dst.childNodes[di].nodeValue = srcNode.nodeValue;
55+ a_dst.childNodes[di].___fcf___merge = true;
56+ ++di;
57+ } else {
58+ a_dst.insertBefore(srcNode, a_dst.childNodes[di]);
59+ srcNode.___fcf___merge = true;
60+ --i;
61+ ++di;
62+ }
5563 } else {
5664 let dnext = -1;
5765 if (srcNode.hasAttribute("fcfmrj")) {
Show on old repository browser