kyoto

package module

Versions in this module

v1
Oct 15, 2022
Oct 13, 2022
Oct 13, 2022
Oct 12, 2022
Oct 12, 2022
Oct 12, 2022
Aug 24, 2022
Aug 24, 2022
Changes in this version
Jul 28, 2022
Changes in this version
type ActionConfiguration
Jul 11, 2022
Jul 11, 2022
Jul 8, 2022
Jul 1, 2022
Jul 1, 2022
Changes in this version
+ var ActionClient = "<script>(()=>{var z=11;function ae(e,r){var t=r.attributes,n,a,l,u,v;if(!(r.nodeType===z||e.nodeType===z)){for(var f=t.length-1;f>=0;f--)n=t[f],a=n.name,l=n.namespaceURI,u=n.value,l?(a=n.localName||a,v=e.getAttributeNS(l,a),v!==u&&(n.prefix===\"xmlns\"&&(a=n.name),e.setAttributeNS(l,a,u))):(v=e.getAttribute(a),v!==u&&e.setAttribute(a,u));for(var w=e.attributes,m=w.length-1;m>=0;m--)n=w[m],a=n.name,l=n.namespaceURI,l?(a=n.localName||a,r.hasAttributeNS(l,a)||e.removeAttributeNS(l,a)):r.hasAttribute(a)||e.removeAttribute(a)}}var B,ie=\"http://www.w3.org/1999/xhtml\",h=typeof document==\"undefined\"?void 0:document,le=!!h&&\"content\"in h.createElement(\"template\"),oe=!!h&&h.createRange&&\"createContextualFragment\"in h.createRange();function se(e){var r=h.createElement(\"template\");return r.innerHTML=e,r.content.childNodes[0]}function de(e){B||(B=h.createRange(),B.selectNode(h.body));var r=B.createContextualFragment(e);return r.childNodes[0]}function ue(e){var r=h.createElement(\"body\");return r.innerHTML=e,r.childNodes[0]}function fe(e){return e=e.trim(),le?se(e):oe?de(e):ue(e)}function P(e,r){var t=e.nodeName,n=r.nodeName,a,l;return t===n?!0:(a=t.charCodeAt(0),l=n.charCodeAt(0),a<=90&&l>=97?t===n.toUpperCase():l<=90&&a>=97?n===t.toUpperCase():!1)}function ce(e,r){return!r||r===ie?h.createElement(e):h.createElementNS(r,e)}function ve(e,r){for(var t=e.firstChild;t;){var n=t.nextSibling;r.appendChild(t),t=n}return r}function G(e,r,t){e[t]!==r[t]&&(e[t]=r[t],e[t]?e.setAttribute(t,\"\"):e.removeAttribute(t))}var J={OPTION:function(e,r){var t=e.parentNode;if(t){var n=t.nodeName.toUpperCase();n===\"OPTGROUP\"&&(t=t.parentNode,n=t&&t.nodeName.toUpperCase()),n===\"SELECT\"&&!t.hasAttribute(\"multiple\")&&(e.hasAttribute(\"selected\")&&!r.selected&&(e.setAttribute(\"selected\",\"selected\"),e.removeAttribute(\"selected\")),t.selectedIndex=-1)}G(e,r,\"selected\")},INPUT:function(e,r){G(e,r,\"checked\"),G(e,r,\"disabled\"),e.value!==r.value&&(e.value=r.value),r.hasAttribute(\"value\")||e.removeAttribute(\"value\")},TEXTAREA:function(e,r){var t=r.value;e.value!==t&&(e.value=t);var n=e.firstChild;if(n){var a=n.nodeValue;if(a==t||!t&&a==e.placeholder)return;n.nodeValue=t}},SELECT:function(e,r){if(!r.hasAttribute(\"multiple\")){for(var t=-1,n=0,a=e.firstChild,l,u;a;)if(u=a.nodeName&&a.nodeName.toUpperCase(),u===\"OPTGROUP\")l=a,a=l.firstChild;else{if(u===\"OPTION\"){if(a.hasAttribute(\"selected\")){t=n;break}n++}a=a.nextSibling,!a&&l&&(a=l.nextSibling,l=null)}e.selectedIndex=t}}},S=1,he=11,W=3,j=8;function T(){}function pe(e){if(e)return e.getAttribute&&e.getAttribute(\"id\")||e.id}function be(e){return function(t,n,a){if(a||(a={}),typeof n==\"string\")if(t.nodeName===\"#document\"||t.nodeName===\"HTML\"||t.nodeName===\"BODY\"){var l=n;n=h.createElement(\"html\"),n.innerHTML=l}else n=fe(n);var u=a.getNodeKey||pe,v=a.onBeforeNodeAdded||T,f=a.onNodeAdded||T,w=a.onBeforeElUpdated||T,m=a.onElUpdated||T,Z=a.onBeforeNodeDiscarded||T,L=a.onNodeDiscarded||T,ee=a.onBeforeElChildrenUpdated||T,C=a.childrenOnly===!0,y=Object.create(null),E=[];function O(s){E.push(s)}function K(s,o){if(s.nodeType===S)for(var i=s.firstChild;i;){var d=void 0;o&&(d=u(i))?O(d):(L(i),i.firstChild&&K(i,o)),i=i.nextSibling}}function H(s,o,i){Z(s)!==!1&&(o&&o.removeChild(s),L(s),K(s,i))}function X(s){if(s.nodeType===S||s.nodeType===he)for(var o=s.firstChild;o;){var i=u(o);i&&(y[i]=o),X(o),o=o.nextSibling}}X(t);function F(s){f(s);for(var o=s.firstChild;o;){var i=o.nextSibling,d=u(o);if(d){var p=y[d];p&&P(o,p)?(o.parentNode.replaceChild(p,o),D(p,o)):F(o)}else F(o);o=i}}function te(s,o,i){for(;o;){var d=o.nextSibling;(i=u(o))?O(i):H(o,s,!0),o=d}}function D(s,o,i){var d=u(o);d&&delete y[d],!(!i&&(w(s,o)===!1||(e(s,o),m(s),ee(s,o)===!1)))&&(s.nodeName!==\"TEXTAREA\"?re(s,o):J.TEXTAREA(s,o))}function re(s,o){var i=o.firstChild,d=s.firstChild,p,b,N,x,g;e:for(;i;){for(x=i.nextSibling,p=u(i);d;){if(N=d.nextSibling,i.isSameNode&&i.isSameNode(d)){i=x,d=N;continue e}b=u(d);var _=d.nodeType,A=void 0;if(_===i.nodeType&&(_===S?(p?p!==b&&((g=y[p])?N===g?A=!1:(s.insertBefore(g,d),b?O(b):H(d,s,!0),d=g):A=!1):b&&(A=!1),A=A!==!1&&P(d,i),A&&D(d,i)):(_===W||_==j)&&(A=!0,d.nodeValue!==i.nodeValue&&(d.nodeValue=i.nodeValue))),A){i=x,d=N;continue e}b?O(b):H(d,s,!0),d=N}if(p&&(g=y[p])&&P(g,i))s.appendChild(g),D(g,i);else{var $=v(i);$!==!1&&($&&(i=$),i.actualize&&(i=i.actualize(s.ownerDocument||h)),s.appendChild(i),F(i))}i=x,d=N}te(s,d,b);var q=J[s.nodeName];q&&q(s,o)}var c=t,U=c.nodeType,k=n.nodeType;if(!C){if(U===S)k===S?P(t,n)||(L(t),c=ve(t,ce(n.nodeName,n.namespaceURI))):c=n;else if(U===W||U===j){if(k===U)return c.nodeValue!==n.nodeValue&&(c.nodeValue=n.nodeValue),c;c=n}}if(c===n)L(t);else{if(n.isSameNode&&n.isSameNode(c))return;if(D(c,n,C),E)for(var V=0,ne=E.length;V<ne;V++){var I=y[E[V]];I&&H(I,I.parentNode,!1)}}return!C&&c!==t&&t.parentNode&&(c.actualize&&(c=c.actualize(t.ownerDocument||h)),t.parentNode.replaceChild(c,t)),c}}var ge=be(ae),Y=ge;function R(e){let r=e.starter;if(e.id){let t=document.getElementById(e.id);if(!t)throw new Error(`Error while locating root with id: can't find direct with ${e}`);r=t}else{let t=0;for(;;){if(!r.parentElement)throw new Error(`Error while locating root: can't find parent with ${e}`);if(!r.getAttribute(\"state\"))r=r.parentElement;else if(e.depth&&t!=e.depth)r=r.parentElement,t++;else break}}return r}function Ae(e){return e.includes(\":\")&&(e=e.split(\":\")[1]),e.includes(\"$\")&&(e=e.replaceAll(\"$\",\"\")),e}function me(e){e.querySelectorAll(\"[ssa\\\\:oncall\\\\.display]\").forEach(t=>{let n=t.getAttribute(\"ssa:oncall.display\");n!=\"\"&&t.setAttribute(\"style\",\"display: \"+n)})}function Te(){document.querySelectorAll(\"[ssa\\\\:onload]\").forEach(e=>{let r=e.getAttribute(\"ssa:onload\");r&&r!=\"\"&&M(e,r)})}function we(){document.querySelectorAll(\"[ssa\\\\:poll]\").forEach(e=>{let r=e.getAttribute(\"ssa:poll\")||\"\",t=e.getAttribute(\"ssa:poll.interval\");r&&r!=\"\"&&t&&t!=\"\"&&setInterval(()=>{M(e,r)},parseInt(t))})}function ye(){document.querySelectorAll(\"[ssa\\\\:onintersect]\").forEach(e=>{let r=e.getAttribute(\"ssa:onintersect\")||\"\",t=e.getAttribute(\"ssa:onintersect.threshold\")||\"1.0\";r!=\"\"&&new IntersectionObserver(a=>{a.forEach(l=>{l.intersectionRatio>=parseFloat(t)&&M(e,r,parseFloat(t))})},{threshold:parseFloat(t)}).observe(e)})}function Q(e,r,t){let n=new Array,a={};t&&(a=t),a.onBeforeElUpdated=function(l,u){if(l.getAttribute(\"ssa:morph.ignore.attr\")!=null){let v=l.getAttribute(\"ssa:morph.ignore.attr\");if(v)if(v==\"innerHTML\")u.innerHTML=l.innerHTML;else{let f=l.getAttribute(v);f&&u.setAttribute(v,f)}}return l.getAttribute(\"ssa:morph.ignore\")!=null?!1:l.getAttribute(\"ssa:morph.ignore.this\")!=null&&l!=e?(n.push({fromEl:l,toEl:u}),!1):!0},Y(e,r,a),n.length>0&&n.forEach(l=>{Q(l.fromEl,l.toEl,{childrenOnly:!0})})}async function M(e,r,...t){let n=R({starter:e,depth:r.split(\"\").filter(f=>f===\"$\").length,id:r.includes(\":\")?r.split(\":\")[0]:void 0});me(n);let a=actionpath;a.endsWith(\"/\")||(a+=\"/\"),a+=`${n.getAttribute(\"name\")}`,a+=`/${Ae(r)}`;let l=new FormData;l.set(\"State\",n.getAttribute(\"state\")),l.set(\"Args\",JSON.stringify(t));let v=(await fetch(a,{method:\"POST\",body:l})).body?.pipeThrough(new TextDecoderStream).getReader();if(!!v)for(;;){let{value:f,done:w}=await v.read();if(w)break;if(f.startsWith(\"ssa:redirect=\")){window.location.href=f.replace(\"ssa:redirect=\",\"\");continue}if(n.getAttribute(\"ssa:render.mode\")==\"replace\"){n.outerHTML=f;continue}try{Q(n,f)}catch(m){console.log(\"Fallback from morphdom to root.outerHTML due to error\",m),n.outerHTML=f}}}function Ne(e,r){let t=R({starter:e,depth:r.split(\"\").filter(a=>a===\"$\").length,id:r.includes(\":\")?r.split(\":\")[0]:void 0});if(!t.getAttribute(\"state\"))throw new Error(\"Bind call error: component state is underfined\");let n=JSON.parse(atob(t.getAttribute(\"state\")));n[r]=e.value,t.setAttribute(\"state\",btoa(n))}function Se(e,r){r.preventDefault();let t=R({starter:e});if(!t.getAttribute(\"state\"))throw new Error(\"Bind call error: component state is underfined\");let n=JSON.parse(atob(t.getAttribute(\"state\"))),a=new FormData(r.target),l=Object.fromEntries(a.entries());return Object.entries(l).forEach(u=>{n[u[0]]=u[1]}),t.setAttribute(\"state\",btoa(JSON.stringify(n))),M(t,\"Submit\"),!1}window._root=R;window.Action=M;window.Bind=Ne;window.FormSubmit=Se;document.addEventListener(\"DOMContentLoaded\",Te);document.addEventListener(\"DOMContentLoaded\",ye);document.addEventListener(\"DOMContentLoaded\",we);})();</script>"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL