Merge branch 'main' of src.opensuse.org:adamm/autogits

This commit is contained in:
Adam Majer 2024-08-19 12:26:03 +02:00
commit 571c47a83b

View File

@ -17,19 +17,20 @@
xmlns:cc="http://creativecommons.org/ns#" xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"> xmlns:dc="http://purl.org/dc/elements/1.1/">
<script <script
id="script2"><![CDATA[ id="script2">
console.log("script")
window.addEventListener('load', (event) => { window.addEventListener('load', (event) => {
layerNo = 1 layerNo = 1
maxLayer = 1 maxLayer = 1
updateLayers = () => { updateLayers = () =&gt; {
for (i=0; i<svg.children.length; i++) { for (i=0; i&lt;svg.children.length; i++) {
elem = svg.children[i] elem = svg.children[i]
e = elem.attributes['inkscape:label'] e = elem.attributes['inkscape:label']
if(e && e.value == 'Layer' + layerNo) { if(e &amp;&amp; e.value == 'Layer' + layerNo) {
elem.style = "display: inline;" elem.style = "display: inline;"
} else if (e && e.value.startsWith('Layer') && !isNaN(Number(e.value.slice(5)))) { } else if (e &amp;&amp; e.value.startsWith('Layer') &amp;&amp; !isNaN(Number(e.value.slice(5)))) {
elem.style = "display: none;" elem.style = "display: none;"
} }
} }
@ -37,9 +38,9 @@ window.addEventListener('load', (event) => {
}; };
svg = document.getElementById("svg5"); svg = document.getElementById("svg5");
for (i=0; i<svg.children.length; i++) { for (i=0; i&lt;svg.children.length; i++) {
e=svg.children[i].attributes['inkscape:label'] e=svg.children[i].attributes['inkscape:label']
if (e && e.value.startsWith('Layer') && !isNaN(Number(e.value.slice(5))) && maxLayer < Number(e.value.slice(5))) { if (e &amp;&amp; e.value.startsWith('Layer') &amp;&amp; !isNaN(Number(e.value.slice(5))) &amp;&amp; maxLayer &lt; Number(e.value.slice(5))) {
maxLayer = Number(e.value.slice(5)) maxLayer = Number(e.value.slice(5))
} }
} }
@ -47,7 +48,7 @@ window.addEventListener('load', (event) => {
updateLayers() updateLayers()
setInterval(updateLayers, 2000) setInterval(updateLayers, 2000)
}) })
]]></script> </script>
<sodipodi:namedview <sodipodi:namedview
id="namedview7" id="namedview7"
pagecolor="#ffffff" pagecolor="#ffffff"

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB