diff --git a/builds/v1.8.x/FeatherWiki-bones_Skylark_hu.js b/builds/v1.8.x/FeatherWiki-bones_Skylark_hu.js new file mode 100644 index 0000000..2b5a80f --- /dev/null +++ b/builds/v1.8.x/FeatherWiki-bones_Skylark_hu.js @@ -0,0 +1,14 @@ +(()=>{var pe=Object.defineProperty,wr=Object.defineProperties,Er=Object.getOwnPropertyDescriptor,kr=Object.getOwnPropertyDescriptors,Tr=Object.getOwnPropertyNames,He=Object.getOwnPropertySymbols;var Be=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable;var Ve=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,q=(e,t)=>{for(var r in t||(t={}))Be.call(t,r)&&Ve(e,r,t[r]);if(He)for(var r of He(t))_r.call(t,r)&&Ve(e,r,t[r]);return e},H=(e,t)=>wr(e,kr(t));var ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var L=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),G=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Ar=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Tr(t))!Be.call(e,a)&&a!==r&&pe(e,a,{get:()=>t[a],enumerable:!(n=Er(t,a))||n.enumerable});return e};var de=e=>Ar(pe({},"__esModule",{value:!0}),e);var _e=(e,t,r)=>new Promise((n,a)=>{var i=o=>{try{s(r.next(o))}catch(u){a(u)}},l=o=>{try{s(r.throw(o))}catch(u){a(u)}},s=o=>o.done?n(o.value):Promise.resolve(o.value).then(i,l);s((r=r.apply(e,t)).next())});var Ue=L((Vn,Ge)=>{"use strict";Ge.exports=function(t,r,n){var a,i=t.length;if(!(r>=i||n===0)){n=r+n>i?i-r:n;var l=i-n;for(a=r;a{V.notEqual=Fr;V.notOk=Lr;V.equal=xr;V.ok=V;Je.exports=V;function xr(e,t,r){V(e==t,r)}function Fr(e,t,r){V(e!=t,r)}function Lr(e,t){V(!e,t)}function V(e,t){if(!e)throw new Error(t||"AssertionError")}});var Ne=L((Gn,Ke)=>{var Sr=J(),Or=typeof window!="undefined";function Cr(){var e;return Or?(window._nanoScheduler||(window._nanoScheduler=new se(!0)),e=window._nanoScheduler):e=new se,e}function se(e){this.hasWindow=e,this.hasIdle=this.hasWindow&&window.requestIdleCallback,this.method=this.hasIdle?window.requestIdleCallback.bind(window):this.setTimeout,this.scheduled=!1,this.queue=[]}se.prototype.push=function(e){Sr.equal(typeof e,"function","nanoscheduler.push: cb should be type function"),this.queue.push(e),this.schedule()};se.prototype.schedule=function(){if(!this.scheduled){this.scheduled=!0;var e=this;this.method(function(t){for(var r;e.queue.length&&t.timeRemaining()>0;)r=e.queue.shift(),r(t);e.scheduled=!1,e.queue.length&&e.schedule()})}};se.prototype.setTimeout=function(e){setTimeout(e,0,{timeRemaining:function(){return 1}})};Ke.exports=Cr});var Qe=L((Un,Ye)=>{var Xe=Ne()(),zr=J(),U;he.disabled=!0;try{U=window.performance,he.disabled=window.localStorage.DISABLE_NANOTIMING==="true"||!U.mark}catch(e){}Ye.exports=he;function he(e){if(zr.equal(typeof e,"string","nanotiming: name should be type string"),he.disabled)return Wr;var t=(U.now()*1e4).toFixed()%Number.MAX_SAFE_INTEGER,r="start-"+t+"-"+e;U.mark(r);function n(a){var i="end-"+t+"-"+e;U.mark(i),Xe.push(function(){var l=null;try{var s=e+" ["+t+"]";U.measure(s,r,i),U.clearMarks(r),U.clearMarks(i)}catch(o){l=o}a&&a(l,e)})}return n.uuid=t,n}function Wr(e){e&&Xe.push(function(){e(new Error("nanotiming: performance API unavailable"))})}});var et=L((Jn,Ze)=>{var Ir=Ue(),qr=Qe(),R=J();Ze.exports=I;function I(e){if(!(this instanceof I))return new I(e);this._name=e||"nanobus",this._starListeners=[],this._listeners={}}I.prototype.emit=function(e){R.ok(typeof e=="string"||typeof e=="symbol","nanobus.emit: eventName should be type string or symbol");for(var t=[],r=1,n=arguments.length;r0&&this._emit(this._listeners[e],t),this._starListeners.length>0&&this._emit(this._starListeners,e,t,a.uuid),a(),this};I.prototype.on=I.prototype.addListener=function(e,t){return R.ok(typeof e=="string"||typeof e=="symbol","nanobus.on: eventName should be type string or symbol"),R.equal(typeof t,"function","nanobus.on: listener should be type function"),e==="*"?this._starListeners.push(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)),this};I.prototype.prependListener=function(e,t){return R.ok(typeof e=="string"||typeof e=="symbol","nanobus.prependListener: eventName should be type string or symbol"),R.equal(typeof t,"function","nanobus.prependListener: listener should be type function"),e==="*"?this._starListeners.unshift(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].unshift(t)),this};I.prototype.once=function(e,t){R.ok(typeof e=="string"||typeof e=="symbol","nanobus.once: eventName should be type string or symbol"),R.equal(typeof t,"function","nanobus.once: listener should be type function");var r=this;this.on(e,n);function n(){t.apply(r,arguments),r.removeListener(e,n)}return this};I.prototype.prependOnceListener=function(e,t){R.ok(typeof e=="string"||typeof e=="symbol","nanobus.prependOnceListener: eventName should be type string or symbol"),R.equal(typeof t,"function","nanobus.prependOnceListener: listener should be type function");var r=this;this.prependListener(e,n);function n(){t.apply(r,arguments),r.removeListener(e,n)}return this};I.prototype.removeListener=function(e,t){if(R.ok(typeof e=="string"||typeof e=="symbol","nanobus.removeListener: eventName should be type string or symbol"),R.equal(typeof t,"function","nanobus.removeListener: listener should be type function"),e==="*")return this._starListeners=this._starListeners.slice(),r(this._starListeners,t);return typeof this._listeners[e]!="undefined"&&(this._listeners[e]=this._listeners[e].slice()),r(this._listeners[e],t);function r(n,a){if(n){var i=n.indexOf(a);if(i!==-1)return Ir(n,i,1),!0}}};I.prototype.removeAllListeners=function(e){return e?e==="*"?this._starListeners=[]:this._listeners[e]=[]:(this._starListeners=[],this._listeners={}),this};I.prototype.listeners=function(e){var t=e!=="*"?this._listeners[e]:this._starListeners,r=[];if(t)for(var n=t.length,a=0;a{var Ae=J(),Rr=/(noopener|noreferrer) (noopener|noreferrer)/,Dr=/^[\w-_]+:/;tt.exports=Mr;function Mr(e,t){Ae.notEqual(typeof window,"undefined","nanohref: expected window to exist"),t=t||window.document,Ae.equal(typeof e,"function","nanohref: cb should be type function"),Ae.equal(typeof t,"object","nanohref: root should be type object"),window.addEventListener("click",function(r){if(!(r.button&&r.button!==0||r.ctrlKey||r.metaKey||r.altKey||r.shiftKey||r.defaultPrevented)){var n=function a(i){if(!(!i||i===t))return i.localName!=="a"||i.href===void 0?a(i.parentNode):i}(r.target);n&&(window.location.protocol!==n.protocol||window.location.hostname!==n.hostname||window.location.port!==n.port||n.hasAttribute("data-nanohref-ignore")||n.hasAttribute("download")||n.getAttribute("target")==="_blank"&&Rr.test(n.getAttribute("rel"))||Dr.test(n.getAttribute("href"))||(r.preventDefault(),e(n)))}})}});var it=L((Nn,nt)=>{nt.exports=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmousemove","onmouseout","onmouseenter","onmouseleave","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ondragstart","ondrag","ondragenter","ondragleave","ondragover","ondrop","ondragend","onkeydown","onkeypress","onkeyup","onunload","onabort","onerror","onresize","onscroll","onselect","onchange","onsubmit","onreset","onfocus","onblur","oninput","onanimationend","onanimationiteration","onanimationstart","oncontextmenu","onfocusin","onfocusout"]});var st=L((Xn,lt)=>{var at=it(),jr=at.length,Pr=1,Hr=3,Vr=8;lt.exports=Br;function Br(e,t){var r=e.nodeType,n=e.nodeName;r===Pr&&Gr(e,t),(r===Hr||r===Vr)&&t.nodeValue!==e.nodeValue&&(t.nodeValue=e.nodeValue),n==="INPUT"?Kr(e,t):n==="OPTION"?Jr(e,t):n==="TEXTAREA"&&Nr(e,t),Ur(e,t)}function Gr(e,t){for(var r=t.attributes,n=e.attributes,a=null,i=null,l=null,s=null,o=null,u=n.length-1;u>=0;--u)o=n[u],s=o.name,a=o.namespaceURI,i=o.value,a?(s=o.localName||s,l=t.getAttributeNS(a,s),l!==i&&t.setAttributeNS(a,s,i)):t.hasAttribute(s)?(l=t.getAttribute(s),l!==i&&(i==="null"||i==="undefined"?t.removeAttribute(s):t.setAttribute(s,i))):t.setAttribute(s,i);for(var m=r.length-1;m>=0;--m)o=r[m],o.specified!==!1&&(s=o.name,a=o.namespaceURI,a?(s=o.localName||s,e.hasAttributeNS(a,s)||t.removeAttributeNS(a,s)):e.hasAttributeNS(null,s)||t.removeAttribute(s))}function Ur(e,t){for(var r=0;r{var Fe=J(),Xr=st(),Yr=3;ct.exports=Qr;function Qr(e,t,r){return Fe.equal(typeof e,"object","nanomorph: oldTree should be an object"),Fe.equal(typeof t,"object","nanomorph: newTree should be an object"),r&&r.childrenOnly?(ft(t,e),e):(Fe.notEqual(t.nodeType,11,"nanomorph: newTree should have one root node (which is not a DocumentFragment)"),me(t,e))}function me(e,t){return t?e?e.isSameNode&&e.isSameNode(t)?t:e.tagName!==t.tagName||ot(e)!==ot(t)?e:(Xr(e,t),ft(e,t),t):null:e}function ot(e){return e.dataset?e.dataset.nanomorphComponentId:void 0}function ft(e,t){for(var r,n,a,i,l=0,s=0;r=t.childNodes[s],n=e.childNodes[s-l],!(!r&&!n);s++)if(!n)t.removeChild(r),s--;else if(!r)t.appendChild(n),l++;else if(ut(n,r))a=me(n,r),a!==r&&(t.replaceChild(a,r),l++);else{i=null;for(var o=s;o{"use strict";var dt=J();ht.exports=Zr;function Zr(e,t){dt.equal(typeof e,"function","nanoraf: render should be a function"),dt.ok(typeof t=="function"||typeof t=="undefined","nanoraf: raf should be a function or undefined"),t||(t=window.requestAnimationFrame);var r=!1,n=null;return function(){n===null&&!r&&(r=!0,t(function(){r=!1;for(var l=n.length,s=new Array(l),o=0;o{Le=(e,t,r={})=>{var{events:n}=e,{showDelete:a=!1,showUsed:i=!1,insert:l=null}=r,s=o();return html`

Beágyazott Képek

${s.map(c=>html`
${c.alt} (${c.size[0]}x${c.size[1]}px)
${a?html``:""} ${a?html``:""} ${l?html``:""}
${i?[html`
${c.pgs.length} oldalon van használva
`]:""}
`)}
`;function o(){var{pages:c,img:p}=e.p;return Object.keys(p).map(h=>H(q({id:h},p[h]),{pgs:i?c.filter(g=>{var E;return(E=g.content)==null?void 0:E.includes(`img:${h}:img`)}):[]}))}function u(c){var p=new Image;p.src=c;var h=window.open("");h.document.write(p.outerHTML)}function m(c){var p;e.p.img[c.id].alt=(p=prompt("Alt sz\xF6veg:",c.alt))!=null?p:c.alt,t(n.CHECK_CHANGED)}function d(c){if(!confirm("V\xE9glegesen t\xF6rli a k\xE9pet a wiki \xF6sszes oldal\xE1r\xF3l?"))return!1;delete e.p.img[c.id],c.pgs.length>0&&(e.p.pages=e.p.pages.map(p=>(p.content&&(p.content=p.content.replaceAll(`img:${c.id}:img`,"deleted")),p))),t(n.CHECK_CHANGED)}},ge=(e,t)=>html`
${Le(e,()=>{},{insert:(r,n)=>FW.img.put(r,n,t)})}
`});var Se,wt,Oe=ee(()=>{Se=e=>{var u;var{img:t,pg:r,out:n,hLink:a}=FW.inject,i=[],l=0,s=((u=e.content)!=null?u:"").replace(new RegExp("(.*<\\/nowiki>)","gs"),(m,d)=>(i[l]=d,`{nowiki-${l++}}`));s=r(FW.img.fix(s)),s=e.editor==="md"?md(s!=null?s:""):s,s=t(a(n(s)));for(var o=0;o{var n;var t=Se(e),r=FW.getChildren(e,!0);return[!(e!=null&&e.e)&&((n=e==null?void 0:e.tags)!=null&&n.length)?html``:"",html`
${t?html.raw(t):"\xDCres Oldal"}
`,r.length>0?html`

Aloldalak

    ${r.map(a=>FW.getChildList(a,!0))}
`:null]}});var Et={};G(Et,{editor:()=>an});var an,kt=ee(()=>{Oe();ve();an=e=>{var t=html``,r=i=>{e.edits.content=i.target.value,clearTimeout(e.debounce),e.debounce=setTimeout(()=>{t.innerHTML=Se(H(q({},e.edits),{editor:"md"}))},500)},n=html``;return r({target:n}),[n,html``,html``,html``,t,ge(e,a)];function a({id:i}){var l=`![](img:${i}:img)`;if(document.activeElement!==n&&n.focus(),document.selection){var s=document.selection.createRange();s.text=l}else if(n.selectionStart||n.selectionStart===0){var o=n.selectionStart,u=n.selectionEnd;n.value=n.value.substring(0,o)+l+n.value.substring(u,n.value.length),n.selectionStart=o+l.length,n.selectionEnd=o+l.length}else n.value+=l;r({target:n})}}});var Tt={};G(Tt,{editor:()=>ln});var ln,_t=ee(()=>{ve();ln=(e,t)=>{var{init:r}=ed,{src:n,edits:a}=e,{content:i}=a,l;return n?l=html``:(l=r({onChange:s=>e.edits.content=s}),l.isSameNode=()=>!0,l.edUc.innerHTML=i.includes(" `,ge(e,()=>{var s;return(s=l.edUc)==null?void 0:s.img()})]}});var Ut=L((zi,Gt)=>{Gt.exports=_n;var Bt={class:"className",for:"htmlFor","http-equiv":"httpEquiv"};function _n(e){return function(t,r,n){for(var a in r)a in Bt&&(r[Bt[a]]=r[a],delete r[a]);return e(t,r,n)}}});var Kt=L((Wi,Jt)=>{var An=Ut(),te=0,M=1,C=2,ye=3,D=4,x=5,De=6,N=7,S=8,ne=9,ie=10,ue=11,X=12,re=13;Jt.exports=function(e,t){t||(t={});var r=t.concat||function(a,i){return String(a)+String(i)};return t.attrToProp!==!1&&(e=An(e)),function(a){for(var i=M,l="",s=arguments.length,o=[],u=0;u1&&(h.pop(),h[h.length-1][0][2][v]=e(g[0],g[1],g[2].length?g[2]:void 0))}else if(E===C){var k=[d[1],{},[]];g[2].push(k),h.push([k,g[2].length-1])}else if(E===x||E===te&&d[1]===x){for(var w="",O;u1&&/^\s*$/.test(p[2][0])&&p[2].shift(),p[2].length>2||p[2].length===2&&/\S/.test(p[2][1])){if(t.createFragment)return t.createFragment(p[2]);throw new Error("multiple root elements must be wrapped in an enclosing tag")}return Array.isArray(p[2][0])&&typeof p[2][0][0]=="string"&&Array.isArray(p[2][0][2])&&(p[2][0]=e(p[2][0][0],p[2][0][1],p[2][0][2])),p[2][0];function j(B){var T=[];i===N&&(i=D);for(var A=0;A"&&!xn(i)&&i!==re?(i===C&&l.length?T.push([C,l]):i===x?T.push([x,l]):i===S&&l.length&&T.push([S,l]),T.push([ye]),l="",i=M):i===re&&/-$/.test(l)&&f==="-"?(t.comments&&T.push([S,l.substr(0,l.length-1)]),l="",i=M):i===C&&/^!--$/.test(l)?(t.comments&&T.push([C,l],[x,"comment"],[ue]),l=f,i=re):i===M||i===re?l+=f:i===C&&f==="/"&&l.length||(i===C&&/\s/.test(f)?(l.length&&T.push([C,l]),l="",i=D):i===C?l+=f:i===D&&/[^\s"'=/]/.test(f)?(i=x,l=f):i===D&&/\s/.test(f)?(l.length&&T.push([x,l]),T.push([X])):i===x&&/\s/.test(f)?(T.push([x,l]),l="",i=De):i===x&&f==="="?(T.push([x,l],[ue]),l="",i=N):i===x?l+=f:(i===De||i===D)&&f==="="?(T.push([ue]),i=N):(i===De||i===D)&&!/\s/.test(f)?(T.push([X]),/[\w-]/.test(f)?(l+=f,i=x):i=D):i===N&&f==='"'?i=ie:i===N&&f==="'"?i=ne:i===ie&&f==='"'?(T.push([S,l],[X]),l="",i=D):i===ne&&f==="'"?(T.push([S,l],[X]),l="",i=D):i===N&&!/\s/.test(f)?(i=S,A--):i===S&&/\s/.test(f)?(T.push([S,l],[X]),l="",i=D):(i===S||i===ne||i===ie)&&(l+=f))}return i===M&&l.length?(T.push([M,l]),l=""):i===S&&l.length?(T.push([S,l]),l=""):i===ie&&l.length?(T.push([S,l]),l=""):i===ne&&l.length?(T.push([S,l]),l=""):i===x&&(T.push([x,l]),l=""),T}};function n(a){return typeof a=="function"||typeof a=="string"||a&&typeof a=="object"||a==null?a:r("",a)}};function xn(e){return e===ne||e===ie}var Fn=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","!--","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9\x7F-\uFFFF_:-]+)*$");function Ln(e){return Fn.test(e)}});var Zt=L((Ii,Qt)=>{"use strict";var $e=/\n[\s]+$/,we=/^\n[\s]+/,Nt=/[\s]+$/,Xt=/^[\s]+/,Ee=/[\n\s]+/g,Yt=["a","abbr","b","bdi","bdo","br","cite","data","dfn","em","i","kbd","mark","q","rp","rt","rtc","ruby","s","amp","small","span","strong","sub","sup","time","u","var","wbr"],ke=["code","pre","textarea"];Qt.exports=function e(t,r){if(Array.isArray(r))for(var n=t.nodeName.toLowerCase(),a=!1,i,l,s=0,o=r.length;s{"use strict";er.exports=["svg","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"]});var nr=L((Ri,rr)=>{"use strict";rr.exports=["async","autofocus","autoplay","checked","controls","default","defaultchecked","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","novalidate","open","playsinline","readonly","required","reversed","selected"]});var ar=L((Di,ir)=>{"use strict";ir.exports=["indeterminate"]});var sr=L((Mi,lr)=>{"use strict";var Sn=Kt(),On=Zt(),Cn=tr(),zn=nr(),Wn=ar(),In="http://www.w3.org/2000/svg",qn="http://www.w3.org/1999/xlink",Rn="!--";lr.exports=function(e){function t(a,i,l){var s;Cn.indexOf(a)!==-1&&(i.namespace=In);var o=!1;i.namespace&&(o=i.namespace,delete i.namespace);var u=!1;if(i.is&&(u=i.is,delete i.is),o)u?s=e.createElementNS(o,a,{is:u}):s=e.createElementNS(o,a);else{if(a===Rn)return e.createComment(i.comment);u?s=e.createElement(a,{is:u}):s=e.createElement(a)}for(var m in i)if(i.hasOwnProperty(m)){var d=m.toLowerCase(),c=i[m];if(d==="classname"&&(d="class",m="class"),m==="htmlFor"&&(m="for"),zn.indexOf(d)!==-1){if(String(c)==="true")c=d;else if(String(c)==="false")continue}d.slice(0,2)==="on"||Wn.indexOf(d)!==-1?s[m]=c:o?m==="xlink:href"?s.setAttributeNS(qn,m,c):/^xmlns($|:)/i.test(m)||s.setAttributeNS(null,m,c):s.setAttribute(m,c)}return On(s,l),s}function r(a){for(var i=e.createDocumentFragment(),l=0;l{or.exports=sr()(document)});var cr=L((Pi,fr)=>{"use strict";function Dn(e){var t=document.createElement("div");return t.innerHTML=e,Mn(t.childNodes)}function Mn(e){return Array.isArray(e)?e:[].slice.call(e)}fr.exports=Dn});var hr={};G(hr,{bar:()=>je,default:()=>jn,init:()=>dr});var Y,Me,pr,ae,F,z,je,dr,jn,mr=ee(()=>{Y="formatBlock",Me=(e,t,r)=>e.addEventListener(t,r),pr=(e,t)=>e.appendChild(t),ae=e=>document.queryCommandState(e),F=(e,t=null)=>document.execCommand(e,!1,t),je=[{icon:"\u2612",title:"Form\xE1z\xE1s T\xF6rl\xE9se",result:()=>F("removeFormat")},{icon:"B",title:"F\xE9lk\xF6v\xE9r",state:()=>ae("bold"),result:()=>F("bold")},{icon:"I",title:"D\u0151lt",state:()=>ae("italic"),result:()=>F("italic")},{icon:"U",title:"Al\xE1h\xFAz\xE1s",state:()=>ae("underline"),result:()=>F("underline")},{icon:"H",title:"C\xEDmsor",result:()=>F(Y,"

")},{icon:"H2",title:"Alc\xEDmsor",result:()=>F(Y,"

")},{icon:"\xB6",title:"Bekezd\xE9s",result:()=>F(Y,"

")},{icon:"\u21A6",title:"Balra Igaz\xEDt\xE1s",state:()=>ae("justifyLeft"),result:()=>F("justifyLeft")},{icon:"\u2194",title:"K\xF6z\xE9pre Igaz\xEDt\xE1s",state:()=>ae("justifyCenter"),result:()=>F("justifyCenter")},{icon:"\u21A4",title:"Jobbra Igaz\xEDt\xE1s",state:()=>ae("justifyRight"),result:()=>F("justifyRight")},{icon:"#",title:"Sz\xE1mozott Lista",result:()=>F("insertOrderedList")},{icon:"\u2022",title:"Felsorol\xE1si Lista",result:()=>F("insertUnorderedList")},{icon:"\u201C \u201D",title:"Id\xE9zet",result:()=>F(Y,"

")},{icon:"\u2015",title:"Elv\xE1laszt\xF3",result:()=>F("insertHorizontalRule")},{icon:"\u{1F517}",title:"Hivatkoz\xE1s",result:()=>{var e=window.prompt("Hivatkoz\xE1s URL:");e&&F("createLink",e)}},{icon:"\u{1F5BC}\uFE0F",title:"Hivatkoz\xE1s K\xFCls\u0151 K\xE9pre",result:()=>{var e=window.prompt("K\xE9p URL:");e&&F("insertImage",e)}},{icon:"\u{1F4F8}",title:"K\xE9p Besz\xFAr\xE1sa F\xE1jlb\xF3l",result:()=>z==null?void 0:z.img()},{icon:"\u{1F4CE}",title:"L\xE9tez\u0151 K\xE9p Hozz\xE1ad\xE1sa",result:()=>document.getElementById("g").showModal()}],dr=e=>{var a;var t=document.querySelector("#e");if(t&&!e.rebuild)return t;t==null||t.parentNode.removeChild(t);var r=html`
`;z=r.edUc=html`
{i&&i.nodeType===3?F(Y,"

"):z.innerHTML==="
"&&(z.innerHTML=""),e.onChange(z.innerHTML)}} onkeydown=${i=>{i.key==="Enter"&&document.queryCommandValue(Y).match(/blockquote|h\d/)&&setTimeout(()=>F(Y,"

"),0),i.key==="Tab"&&(i.preventDefault(),setTimeout(()=>F(i.shiftKey?"outdent":"indent"),0))}}>

`,z.img=()=>FW.img.upload(FW.state,i=>{document.activeElement!==z&&z.focus(),F("insertHTML",`

`)});var n=html``;return pr(r,n),pr(r,z),F("defaultParagraphSeparator","p"),r},jn={bar:je,init:dr}});var vr={};G(vr,{default:()=>gr});function gr(e){if(!e)return"";var t=[],r=0,n=[],a=0,i=e.length;e[i-1]!==` +`&&e[i-2]!==` +`&&(e+=` + +`),e=e.replace(/\\(.)/g,(d,c)=>Te[c]||d).replace(/```(.*)\n([^\0]+?)```(?!```)/gm,(d,c,p)=>(t[r]={lang:c,block:fe(p)},`{code-${r++}}`)).replace(/`([^`]+?)`/g,(d,c)=>`${fe(c)}`).replace(/<([^>\s]+(\/\/|@)[^>\s]+)>/g,(d,c,p)=>`[${c}](${p==="@"?"mailto:":""}${c})`).replace(/(!?)\[([^\]]*?)\]\(([^\s\n]*)(?:| "(.*)")\)/gm,(d,c,p,h,g)=>{p=fe(p);try{h=decodeURI(h)}catch(E){}return h=encodeURI(h),g=g?` title="${fe(g)}"`:"",c?`${p}`:`${p}`}).replace(/(<\/?[a-zA-Z]+[^>]*>)/gm,(d,c)=>(n[a]=c,`{html-${a++}}`)).replace(/^[ \t]*>+ (.*)/gm,`
+$1 +
`).replace(/(<\/blockquote>\n?
)+?/g,"").replace(/^(#+) +(.*)/gm,(d,c,p)=>`${p}`).replace(/^([^\n\t ])(.*)\n====+/gm,"

$1$2

").replace(/^([^\n\t ])(.*)\n----+/gm,"

$1$2

").replace(/\n( *[-*]){3,}\n/gm,"
").replace(/\[( |x)\]/g,(d,c)=>``).replace(/ +\n/gm,"
").replace(/^([^-\+\*\d<\t \n])([^]*?)(?:\n\n)/gm,(d,c,p)=>`

${c}${p}

+`);var l;e=e.replace(/^([\t ]*)(?:(-|\+|\*)|(\d+(?:\)|\.))) (.*)/gm,(d,c,p,h,g)=>{c.length>0&&!l?l=c.replace(/[^ ]/g,""):c.length===0&&l&&(l=void 0),l&&(c=c.replace(new RegExp(l,"g")," "));var E=h?"o":"u";return`${c}<${E}l>
  • ${g}
  • `});for(var s=/<\/li><\/(u|o)l>\n(\t+)<(u|o)l>
  • (.*)<\/li><\/(u|o)l>/;e.match(s);)e=e.replace(s,function(d,c,p,h,g,E){return p.length>0&&(p=p.substring(1),p.length>0&&(p=` +`+p)),`${p}<${h}l>
  • ${g}
  • `});e=e.replace(/(<\/ul>\n?[ \t]*
      )+?/g,"").replace(/(<\/ol>\n?[ \t]*
        )+?/g,"").replace(/\*\*([^\n*]+?)\*\*/g,"$1").replace(/__([^\n_]+?)__/g,"$1").replace(/\*([^\n*]+?)\*/g,"$1").replace(/_([^\n_]+?)_/g,"$1").replace(/(?:~~)([^~]+?)(?:~~)/g,"$1");for(var o=0;o${fe(m)}`)}return e.trim()}var Te,Pn,fe,br=ee(()=>{Te={"<":"<",">":">",'"':""","'":"'",$:"$","&":"&","[":"[","]":"]","(":"(",")":")",_:"_","*":"*","`":"`"},Pn=Object.keys(Te).filter(e=>e!="&").map(e=>Te[e].replace(e!="&"?"&":"","")),fe=e=>e.replace(/[<>$&\(\)\[\]"']/g,t=>Te[t]||t).replace(new RegExp(`&(${Pn.join("|")})`,"g"),"&$1")});var en=et(),tn=rt(),gt=pt(),rn=mt(),vt=()=>{var e={};return new URLSearchParams(window.location.search).forEach((t,r,n)=>{t=n.getAll(r),e[r]=t.length>1?t:t[0]}),e},nn={};function K(){if(!(this instanceof K))return new K;this.ready=e=>{document.readyState==="complete"||document.readyState==="interactive"?e():document.addEventListener("DOMContentLoaded",e)},this._events={ONLOAD:"DOMContentLoaded",TITLE:"DOMTitleChange",RENDER:"render",GO:"go"},this._loaded=!1,this._tree=null,this._view=()=>{},this.emitter=en("choo.emit"),this.emit=this.emitter.emit.bind(this.emitter),this.state={events:this._events,title:document.title,query:vt()},this.emitter.prependListener(this._events.TITLE,e=>{this.state.title=document.title=e})}K.prototype.start=function(){var e=()=>{var r=document.getElementById(location.hash.substring(1));return r?(r==null||r.scrollIntoView(),!0):!1};this.emitter.prependListener(this._events.GO,(r=null,n="push")=>{r&&history[n+"State"](nn,this.state.title,r),this.state.query=vt(),this._loaded&&this.emit(this._events.RENDER,()=>{e()||window.scroll(0,0)})}),window.onpopstate=()=>{this.emit(this._events.GO)},tn(({href:r})=>{var n=window.location.href;r!==n&&this.emit(this._events.GO,r)});var t=()=>this._view(this.state,this.emit);return this._tree=t(),this._rq=[],this._rd=null,this.emitter.prependListener(this._events.RENDER,r=>{typeof r=="function"&&this._rq.push(r),this._rd!==null&&clearTimeout(this._rd),this._rd=setTimeout(rn(()=>{var n=t();for(gt(this._tree,n);this._rq.length>0;)this._rq.shift()()}),9)}),this.ready(()=>{this.emit(this._events.ONLOAD),this._loaded=!0,e()}),this._tree};K.prototype.mount=function(e){this.ready(()=>{var t=this.start();typeof e=="string"?this._tree=document.querySelector(e):this._tree=e,gt(this._tree,t)})};var bt=(e,t)=>{var{p:r}=e;return[html`

        Összes Oldal

        `,html`
          ${r.pages.filter(n=>!n.parent).map(n=>FW.getChildList(n))}
        `]};ve();var yt=(e,t)=>{var d,c;var{events:r,p:n,c:a,j:i}=e,l=n.pages.map(p=>p.slug).join(` +`);return[html`

        Wiki Beállítások

        `,html`
        Csak egyszer fut, a wiki betöltésekor. Teszteléshez mentse el a wikit, majd töltse be a mentett fájlt. HTML hozzáadása közvetlenül a head elemhez. Teszteléshez mentse el a wikit, majd töltse be a mentett fájlt. Legyen óvatos: a hibás HTML működésképtelenné teszi a wikit. A wiki tartalmának hozzáadása HTML verzióban, JS-sel nem rendelkező böngészők számára. A wiki mérete így majdnem a duplájára nő. Elrejti a Mentés, Új Oldal és Wiki Beállítások gombokat. A beállítás kikapcsolásához látogassa meg a következő oldalt: ?page=s

        Feather Wiki Verzió: 1.8.0 (Skylark)

        ${Le(e,t,{showDelete:!0,showUsed:!0})}
        `];function s(p){p.preventDefault();var h=p.currentTarget,g=h.wTitle.value.trim();if(g.length<1)return alert("C\xEDm sz\xFCks\xE9ges");e.p.name=g,e.p.desc=h.wDesc.value.trim(),h.home.value.length>1?e.p.home=h.home.value:delete e.p.home;var E=h.wPo.value.split(` +`).map(v=>v.trim());e.p.pages.sort((v,k)=>E.indexOf(v.slug){FW.xtr(p,h=>{h&&(e.p=h[0],u(h[1]),m(h[2]),t(r.ONLOAD),t(r.CHECK_CHANGED),t(r.NOTIFY,"A wiki bet\xF6ltve"))})})}function u(p){var h=document.getElementById("c");p.trim()?(e.c=p,h?h.innerHTML=p:document.head.innerHTML+=``):(delete e.c,h&&document.head.removeChild(h))}function m(p){p.trim()?(e.j!==p&&alert("A JavaScript futtat\xE1s\xE1hoz ment\xE9s \xE9s \xFAjrat\xF6lt\xE9s sz\xFCks\xE9ges"),e.j=p):delete e.j}};var $t=(e,t)=>{var{p:r,query:n}=e,a=r.pages.filter(i=>{var l,s;return(s=(l=i.tags)==null?void 0:l.split(","))==null?void 0:s.includes(n.tag)});return[html`

        Címkézett Oldalak ${n.tag}

        `,html`
        ${a.length>0?html``:"Nincs tal\xE1lat"}
        `]};Oe();var At=(e,t,r)=>{var{events:n,edits:a,p:i}=e,l=FW.getChildren(r).map(v=>v.id),s=!i.pages.some(v=>v.id===r.id),{useMd:o}=a;function u(v){v.preventDefault();var{useMd:k,content:w}=a;k?confirm(`Markdown konvert\xE1l\xE1sa HTML-be? +("M\xE9gse" konvert\xE1l\xE1s n\xE9lk\xFCl)`)&&(e.edits.content=md(w)):e.edits.content=FW.img.abbr(w),e.edits.useMd=!k,t(n.RENDER)}var m=[html`
        `,(o?(kt(),de(Et)):(_t(),de(Tt))).editor(e,t)];return html`

        Oldal Szerkesztése

        Belső hivatkozások (a kettőskereszt opcionális): [[Oldal Címe]] vagy [[szöveg|oldal_slug#címsor]]. ${m}
        ${s?"":[html`
        `,html`
        `]}
        `;function d(v){v.preventDefault(),document.getElementById("slug").value=FW.slug(document.getElementById("name").value.trim())}function c(v){var k=v.target;e.edits[k.id]=k.value,t(n.RENDER)}function p(){return FW.tidy(document.getElementById("tags").value.split(","))}function h(v){var k=v.target.value;if(k.length>0){var w=p();w.includes(k)||(a.tags+=(w.length>0?",":"")+k,t(n.RENDER))}v.target.value=""}function g(v){v.preventDefault();var k=v.currentTarget,w=k.name.value.trim();if(w.length<1)return alert("Az oldal c\xEDme nem lehet \xFCres.");var O=k.slug.value.trim();if(O.length<2)return alert("Az Oldal Slug egy karaktern\xE9l hosszabb kell hogy legyen.");var y=q({},r);y.name=w,y.slug=FW.slug(O),y.content=FW.img.fix(FW.img.abbr(e.edits.content),!0),y.tags=p().join(","),y.parent=k.parent.value,k.hide.checked?y.hide=!0:delete y.hide,a.useMd?y.editor="md":delete y.editor,t(n.UPDATE_PAGE,y)}function E(v){v.preventDefault(),confirm("Ezt nem vonhatja vissza a wiki ment\xE9se ut\xE1n! T\xF6rli ezt az oldalt?")&&t(n.DELETE_PAGE,r.id)}};var xt=(e,t,r)=>{var{edit:n,p:a,events:i}=e,{cd:l,md:s}=r;if(n)return At(e,t,r);for(var o=h=>a.pages.find(g=>g.id===(h==null?void 0:h.parent)),u=[],m=o(r);m;)u.unshift(m),m=o(m);var d=FW.date(new Date(l)),c=new Date(s!=null?s:l),p=FW.date(c);return[html`
        ${html.raw(u.map(h=>`${h.name} /`).join(" "))}

        ${r.name}

        ${r.e?"":html`
        ${a.published?"":html``}
        `}
        `,wt(r)]};var Ft=(e,t)=>{var r=FW.missing();return[html`

        Hiányzó Oldalak

        `,html`

        Hivatkozott, de nem létrehozott:

          ${r.map(n=>html`
        • ${n}
        • `)}
        `]};var Lt=e=>{var r,n,a,i;e.root=location.pathname||"/",e.sb=!1,e.sbTab="Oldalak",e.sbx=new Set,e.recent=[],e.edit=!1,e.edits=null,e.keep=!1,e.src=!1,e.notis={},e.canPut=!1,e.events=H(q({},e.events),{HANDLE_404:"404",CREATE_PAGE:"cp",START_EDIT:"se",CANCEL_EDIT:"ce",UPDATE_PAGE:"up",DELETE_PAGE:"dp",COLLECT_TAGS:"ct",CHECK_CHANGED:"cc",SAVE_WIKI:"sw",NOTIFY:"n",REMOVE_NOTI:"rn",PUT_SAVE_WIKI:"psw",DETECT_PUT_SUPPORT:"dps"}),e.views={a:bt,s:yt,t:$t,p:xt,m:Ft},e.c=(n=(r=document.querySelector("style#c"))==null?void 0:r.innerHTML)!=null?n:"",e.j=FW.parseJs((i=(a=document.querySelector("script#j"))==null?void 0:a.innerHTML)!=null?i:"");try{e.p=FW.json.decompress(JSON.parse(document.querySelector("script#p").innerHTML))}catch(l){e.p={name:"\xDAj Wiki",desc:"",pages:[],img:{}}}e.pg=FW.getPage();var t=e.p.pages.find(l=>{var s;return l.id===((s=e.recent[0])==null?void 0:s.p)});return e.useMd=(t==null?void 0:t.editor)==="md",e.t=[],e.prev=FW.hash.object(e.p),e.now=e.prev,e.changed=!1,e};function St(e){if(e.key==="Tab"){var t=this,r=k=>{var w=document.activeElement;w!==t&&t.focus();var O=k===""?document.execCommand("delete"):document.execCommand("insertText",!1,k);O||(t.setRangeText(k,t.selectionStart||0,t.selectionEnd||0,"end"),t.dispatchEvent(new InputEvent("input",{text:k,inputType:"insertText"})))},{selectionStart:n,selectionEnd:a,value:i}=t,l=i.lastIndexOf(` +`,n-1)+1;if(e.shiftKey){var s=i.lastIndexOf(` +`,a-1)+1,o=i.charAt(s)!==" "?a:s+1,u=t.value.slice(l,o),m=u.replace(/(^|\n)(\t| {1,2})/g,"$1"),d=u.length-m.length;t.setSelectionRange(l,o),r(m);var c=/\t| {1,2}/.exec(i.slice(l,n)),p=c?c[0].length:0,h=n-p;t.setSelectionRange(n-p,Math.max(h,a-d))}else{var g,E=i.slice(n,a),v=(g=/\n/g.exec(E))===null||g===void 0?void 0:g.length;if(v>0){var u=t.value.slice(l,a-1),m=u.replace(/^|\n/g,"$& "),d=m.length-u.length;t.setSelectionRange(l,a-1),r(m),t.setSelectionRange(n+1,a+d)}else r(" ")}e.preventDefault()}}var Ot=(e,t)=>{var{root:r,views:n}=e,{ONLOAD:a,TITLE:i,RENDER:l,GO:s,HANDLE_404:o,CREATE_PAGE:u,START_EDIT:m,CANCEL_EDIT:d,UPDATE_PAGE:c,DELETE_PAGE:p,COLLECT_TAGS:h,CHECK_CHANGED:g,SAVE_WIKI:E,PUT_SAVE_WIKI:v,DETECT_PUT_SUPPORT:k,NOTIFY:w,REMOVE_NOTI:O}=e.events,y=(...f)=>t.emit(...f),j=()=>y(i,e.p.name+(e.pg?" | "+e.pg.name:"")),B=()=>setTimeout(()=>document.querySelectorAll("textarea:not(.notab)").forEach(f=>f.onkeydown=St),300),T=()=>e.edits&&!confirm("Elveti a nem mentett v\xE1ltoztat\xE1sokat?"),A=()=>{e.edit=!1,e.edits=null};return t.on(a,()=>{y(o),j(),e.recent=e.p.pages.map(f=>{var b;return{p:f.id,t:(b=f.md)!=null?b:f.cd}}).sort((f,b)=>f.t>b.t?-1:1),y(h),e.t.length?y(l):B(),y(k)}),t.on(l,B),t.on(o,()=>{var{page:f}=e.query;if((f==null?void 0:f.length)>1){var b=FW.slug(f),$=FW.find(b);if(!$&&!n[b]){var _=f.split("_").map(W=>W[0].toUpperCase()+W.substring(1)).join(" ");y(u,_,!1)}}else(f==null?void 0:f.length)>0&&!n[f]&&(e.pg={e:!0,name:"404",content:"

        Az oldal nem tal\xE1lhat\xF3

        "},y(l))}),t.on(s,()=>{var W;var{p:f,pg:b}=e,$=(W=e.query.page)!=null?W:null,_=(b==null?void 0:b.slug)===$||!$&&(b==null?void 0:b.id)===f.home;if(!_&&T())return history.go(-1);_||(A(),e.pg=FW.getPage(),y(o),j())}),t.on(u,(f,b=!0)=>{if(!(f.length<2)&&!T()){A();var{p:$,query:_}=e,W=()=>{for(var Z=[],Pe=0;Pe<9;Pe++){var $r=Math.round(Math.random()*94)+32;Z.push(String.fromCharCode($r))}return Z.join("")},P;do P=W();while($.pages.findIndex(Z=>Z.id===P)>=0);var Q=0,yr=FW.slug(f),le;do le=yr+(Q>0?"_"+Q:""),Q++;while($.pages.some(Z=>Z.slug===le));var ce={id:P,name:f,slug:le,cd:Date.now()};e.showNewPageField=!1,b?(e.p.pages.push(ce),e.recent.unshift({p:ce.id,t:ce.cd}),y(g),y(s,r+"?page="+le,_.page!==le?"replace":"push")):e.pg=ce,y(m)}}),t.on(m,()=>{var $,_,W,P,Q;var{pg:f}=e;e.edit=!0;var b={name:($=f.name)!=null?$:"",slug:(_=f.slug)!=null?_:"",content:FW.img.fix((W=f.content)!=null?W:""),tags:(P=f.tags)!=null?P:"",parent:(Q=f.parent)!=null?Q:"",hide:!!f.hide};b.useMd=f.editor==="md"||!b.content&&e.useMd,e.edits=b,e.src=!1,y(l)}),t.on(d,()=>{T()||(A(),y(l))}),t.on(c,f=>{var{p:b}=e;if(b.pages.some(_=>_.slug===f.slug&&_.id!==f.id))return alert(`Egy oldal m\xE1r l\xE9tezik "${f.slug}" alatt!`);var $=b.pages.findIndex(_=>_.id===f.id);Object.keys(f).forEach(_=>{f[_].length<1&&delete f[_]}),f.md=Date.now(),$>-1?b.pages[$]=f:b.pages.push(f),e.recent=[{p:f.id,t:f.md},...e.recent.filter(_=>_.p!==f.id)],A(),e.useMd=f.editor==="md",y(h),e.pg=FW.getPage(),y(g)}),t.on(p,f=>{e.p.pages=e.p.pages.map(b=>(b.parent===f&&delete b.parent,b)).filter(b=>b.id!==f),e.recent=e.recent.filter(b=>b.p!==f),A(),y(h),delete e.pg,y(s,r),y(g)}),t.on(h,()=>{e.t=FW.tidy(e.p.pages.reduce((f,b)=>{var $,_;return[...f,...(_=($=b.tags)==null?void 0:$.split(","))!=null?_:[]]},[]))}),t.on(g,f=>{e.now=FW.hash.object(e.p),e.changed=e.prev!==e.now,y(l,f)}),t.on(w,(f,b=5e3,$="background:#ddd; color:#000")=>{var _=Date.now(),W=()=>y(O,_),P=html`
        W()} title="Kattintson a Bezáráshoz"> ${f}×
        `;e.notis[_]=P,b>0&&setTimeout(W,b),document.querySelector(".notis").appendChild(P)}),t.on(O,f=>{var b=e.notis[f];b==null||b.parentNode.removeChild(b),delete e.notis[f]}),t.on(E,()=>{var f=FW.gen(e),{p:b}=e,$=document.createElement("a");$.setAttribute("href","data:text/html;charset=utf-8,"+encodeURIComponent(f));var _=/\/$/.test(r)?"index.html":decodeURI(r.substring(r.lastIndexOf("/")+1));$.setAttribute("download",_),document.body.appendChild($),$.click(),document.body.removeChild($),e.canPut||(e.prev=FW.hash.object(b),y(g))}),t.on(v,()=>{var f=FW.gen(e),{p:b}=e;fetch(r,{method:"PUT",body:f}).then($=>$.text().then(_=>({ok:$.ok,status:$.status,text:_}))).then($=>{if(!$.ok)throw $.text?$.text:`\xC1llapot ${$.status}.`;y(w,"Elmentve"),e.prev=FW.hash.object(b),y(g)}).catch($=>{y(w,`A ment\xE9s sikertelen! ${$}`,9999,"background:#e88")})}),t.on(k,()=>{!location.protocol.startsWith("http")||e.canPut||fetch(r,{method:"OPTIONS"}).then(f=>{f.ok&&f.headers.get("dav")&&(e.canPut=!0,y(l))}).catch(f=>{})}),t};var be=(e,t)=>{var B,T;var{root:r,pg:n,p:a,t:i,recent:l,events:s,query:o,changed:u,sb:m,sbTab:d,views:c,notis:p}=e,h=!a.published||o.page==="s",g=a.pages.filter(A=>!A.parent),E=l.map(A=>a.pages.find(f=>f.id===A.p)),v=n?c.p(e,t,n):((T=c[(B=o.page)!=null?B:"a"])!=null?T:()=>{})(e,t);o.tag&&(v=c.t(e,t));var k=[u?html`
        A wiki megváltozott!
        `:""];if(e.canPut){var w=location.origin+r;k.push(html`
        `)}return k.push(html`
        `),html`
        ${a.name} ${a.desc?html`

        ${a.desc}

        `:""} ${h?k:""}
        ${v}
        ${Object.values(p)}
        `;function O(A){A.preventDefault();var f=A.currentTarget.np.value.trim();if(f.length<2)return alert("\xCDrjon be egy karaktern\xE9l t\xF6bbet az oldal l\xE9trehoz\xE1s\xE1hoz.");t(s.CREATE_PAGE,f.trim())}function y(){e.sb=!e.sb,t(s.RENDER)}function j(A){e.sbTab=A.target.innerText,t(s.RENDER)}};function Ct(e,t=()=>{}){var r=new FileReader;r.onload=n=>_e(this,null,function*(){var a=n.target.result,i=Ce(a,"script","p type=application/json");if(!i.length||i[0]!=="{")return alert("A Feather Wiki nem tal\xE1lhat\xF3.");var l=FW.json.decompress(JSON.parse(i));l.img=yield sn(l.img),t([l,Ce(a,"style","c"),FW.parseJs(Ce(a,"script","j"))])}),r.onerror=function(n){t(null)},r.readAsText(e)}function Ce(e,t,r){var n=`\\s<${t} id=${r}>`,a=e.match(new RegExp(n+`.+?(?=)`,"s"));return(a!=null?a:[]).length?a[0].replace(n.replace("\\s",""),"").trim():""}function sn(e){return _e(this,null,function*(){var t=Object.keys(e);return t.length&&!e[t[0]].img&&(yield Promise.all(t.map(r=>new Promise(n=>{var a=new Image;a.src=e[r],a.onload=()=>{e[r]={img:e[r],alt:"image",size:[a.width,a.height]},n()}})))),e})}function zt(e){var{c:t,p:r,j:n}=e;return` ${r.name} ${r.desc?``:""} ${t?``:""} JavaScript szükséges \ No newline at end of file diff --git a/extensions/v1.8.x/auto-save_hu.js b/extensions/v1.8.x/auto-save_hu.js new file mode 100644 index 0000000..75389f7 --- /dev/null +++ b/extensions/v1.8.x/auto-save_hu.js @@ -0,0 +1,26 @@ +/** + * This file is part of Feather Wiki. + * + * Feather Wiki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Feather Wiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with Feather Wiki. If not, see https://www.gnu.org/licenses/. + */ +// Ez a kiterjesztés a Feather Wiki Warbler verzióit automatikusan elmenti a szerverre, amikor az oldalakon változtatásokat végeznek. +FW.ready(() => { + const { state, emitter } = FW; + console.log('auto-save.js futtatása'); + const { events } = state; + [events.UPDATE_PAGE, events.NOTIFY].forEach(ev => { + emitter.on(ev, (noti = null) => { + if (!state.canPut && noti !== 'Nem lehet automatikusan menteni') { + emitter.emit(events.NOTIFY, 'Nem lehet automatikusan menteni', 5000, 'background:#e88'); + return; + } + if (typeof noti !== 'string' || noti === 'Settings updated' || noti === 'Beállítások frissítve') { + emitter.emit(events.PUT_SAVE_WIKI); + } + }); + }); +}); diff --git a/extensions/v1.8.x/clone-page_hu.js b/extensions/v1.8.x/clone-page_hu.js new file mode 100644 index 0000000..3fd35b8 --- /dev/null +++ b/extensions/v1.8.x/clone-page_hu.js @@ -0,0 +1,44 @@ +/** + * This file is part of Feather Wiki. + * + * Feather Wiki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Feather Wiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with Feather Wiki. If not, see https://www.gnu.org/licenses/. + */ +// Ez a kiterjesztés minden oldalon a „Szerkesztés” gomb mellé egy „Oldal klónozása” gombot helyez. Kattintson rá, adjon meg egy új nevet, és megjelenik az aktuális oldal másolata szerkesztésre. +FW.ready(() => { + const { state, emitter } = FW; + console.log('a clone-page.js futtatása'); + + ['DOMContentLoaded', 'render'].forEach(ev => { + emitter.on(ev, () => { + setTimeout(() => { // Adds a very small delay so it injects after render when elements exist in DOM + renderClonePageButton(); + }, 50); + }); + }); + emitter.emit('DOMContentLoaded'); + + function renderClonePageButton () { + const editButton = Array.from(document.querySelectorAll('main > section > header button')).find(el => el.textContent === 'Edit'); + if (!editButton || !!document.querySelector('#cloneButton')) return; + const pg = { ...state.pg }; + const cloneButton = html``; + editButton.parentElement.insertBefore(cloneButton, editButton.nextSibling); + } +}); diff --git a/extensions/v1.8.x/data-import-export_hu.js b/extensions/v1.8.x/data-import-export_hu.js new file mode 100644 index 0000000..ddc3ead --- /dev/null +++ b/extensions/v1.8.x/data-import-export_hu.js @@ -0,0 +1,236 @@ +/** + * This file is part of Feather Wiki. + * + * Feather Wiki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Feather Wiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with Feather Wiki. If not, see https://www.gnu.org/licenses/. + */ +// Ez a kiegészítő egy „Adatkezelés” szekciót ad a Wiki beállítások oldalához, amely lehetővé teszi, hogy több HTML, Markdown és egyszerű szöveges fájlt importáljon új oldalaként a wikibe és +// exportálja a jelenlegi wiki összes oldalát HTML vagy Markdown fájlként. Exportáláskor egy CDN-ből tölti be a JSZip modult, hogy az összes oldalt egyetlen .zip fájlba csomagolja. +// A wiki teljes nyers JSON-adatait is exportálhatja tömörítetlen formában, de ez kevésbé hasznos lehet számára, ha nem tudja, hogyan lehet a JSON-adatokat manipulálni. +FW.ready(() => { + const { state, emitter } = FW; + console.log('a data-import-export.js futtatása'); + + window.FW.data = { + import: () => { + const input = html` { + const { files } = e.target; + if (files.length < 1) return; + function readFile(file, callback) { + const reader = new FileReader(); + reader.onload = e => callback(e.target.result); + reader.onerror = e => callback(null); + reader.readAsText(file); + } + let processed = 0; + for (let i = 0; i < files.length; i++) { + const f = files[i]; + readFile(f, (content => { + if (content) { + const pg = window.FW.data['parse' + (f.type === 'text/html' ? 'Html' : 'Text')](f, content); + pg.content = window.FW.img.fix(pg.content, true); + state.p.pages.push(pg); + emitter.emit(state.events.CHECK_CHANGED); + } + processed++; + })); + } + const checkDone = setInterval(() => { + if (processed >= files.length) { + clearInterval(checkDone); + emitter.emit(state.events.NOTIFY, 'Az importálás befejeződött. Ne felejtse el menteni a wikijét!'); + } + }, 300); + }} />`; + document.body.appendChild(input); + input.click(); + document.body.removeChild(input); + }, + parseHtml: (file, content) => { + let name; + if (content.includes('')) { + const headContent = content.replace(/.*?]*?>(.*)?<\/head>.*/ims, '$1'); + const head = html`${html.raw(headContent)}`; + if (head.querySelector('title')) { + name = head.querySelector('title').innerText; + } + } + const body = content.includes('') ? content.replace(/.*?]*?>(.*)?<\/body>.*/ims, '$1') : content; + const doc = html`${html.raw(body)}`; + if (!name && doc.querySelector('h1')) { + name = doc.querySelector('h1').innerText; + } + const pg = window.FW.data.generatePage(name ?? file.name); + if (pg.cd > (file.lastModified ?? (Date.now() + 1))) { + pg.cd = file.lastModified; + } + pg.content = doc.innerHtml; + return pg; + }, + parseText: (file, content) => { + let name, tags, headContent; + if (content.match(/^---/) !== null) { + headContent = content.replace(/^---\r?\n(.*)?\r?\n---.*/ms, '$1'); + if (headContent.match(/^(name|title): */im) !== null) { + name = headContent.replace(/.*\n(?:name|title): *(.+?)\r?\n.*/ims, '$1'); + } + if (headContent.match(/^tags: */im) !== null) { + if (headContent.match(/^tags:\s*^- /ims) !== null) { + tags = headContent.replace(/.*\ntags:\s*(- .+)+.*/ims, '$1').replace(/- /g, '').split('\n'); + } else { + tagsRaw = headContent.replace(/.*\ntags: *(.+).*/ims, '$1'); + try { + if (tagsRaw.includes('[')) { + tags = JSON.parse(tagsRaw); + } else { + tags = tagsRaw.split(','); + } + } catch (e) {} + } + } + } + const body = headContent ? content.replace(new RegExp('---\\r?\\n' + headContent + '\\r?\\n---\\r?\\n'), '') : content; + const doc = html`${md(body)}`; + if (!name && doc.querySelector('h1')) { + name = doc.querySelector('h1').innerText; + } + const pg = window.FW.data.generatePage(name ?? file.name); + if (pg.cd > (file.lastModified ?? (Date.now() + 1))) { + pg.cd = file.lastModified; + } + pg.content = body; + pg.editor = 'md'; + if (tags) pg.tags = tags.map(t => t.trim()).filter(t => t.length).join(','); + return pg; + }, + generatePage: name => { + const genId = () => { + const s = []; + for (let i = 0; i < 9; i++) { + const code = Math.round(Math.random() * (126 - 32)) + 32; + s.push(String.fromCharCode(code)); + } + return s.join(''); + } + let id; + do { + id = genId(); + } + while (state.p.pages.findIndex(p => p.id === id) >= 0); + // Ensure unique slug + let d = 0, + s = FW.slug(name), + slug; + do { + slug = s + (d > 0 ? '_' + d : ''); + d++; + } + while (state.p.pages.some(pp => pp.slug === slug)) + return { id, name, slug, cd: Date.now() }; + }, + export: () => { + // If JSZip hasn't been loaded yet, load it before running the export + if (typeof JSZip === 'undefined') { + const jszipScript = document.createElement('script'); + document.body.appendChild(jszipScript); + jszipScript.onload = () => window.FW.data.doExport(); + jszipScript.src = 'https://cdn.jsdelivr.net/npm/jszip@3.10.1/dist/jszip.min.js'; + } else { + window.FW.data.doExport(); + } + }, + dl: (mime, b64, suffix) => { + const download = html`download`; + document.body.appendChild(download); + download.click(); + document.body.removeChild(download); + }, + doExport: () => { + var zip = new JSZip(); + state.p.pages.forEach(pg => { + let filename = pg.slug; + let content = window.FW.inject.img(window.FW.img.fix(pg.content ?? '')); + // replace internal links + (content?.match(/\[\[.+?(?=\]\])/g) ?? []).forEach(l => { + const match = l.replace('[[', '').split('|'); + const slug = match[1] ? match[1].trim() : window.FW.slug(match[0]); + const exists = state.p.pages.find(pg => pg.slug === slug); + if (exists) { + content = content.replace( + `${l}]]`, + `${match[0]}` + ); + } + }); + if (pg.editor === 'md') { + filename += '.md'; + if (pg.tags) { + content = 'Tagged: ' + pg.tags + '\n\n' + content; + } + content = '# ' + pg.name + '\n\n' + content; + } else { + filename += '.html'; + if (pg.tags) { + content = '

        Tagged: ' + pg.tags + '

        \n' + content; + } + content = '

        ' + pg.name + '

        \n' + content; + } + zip.file(filename, content); + }); + zip.generateAsync({type:"base64"}).then(function (base64) { + window.FW.data.dl('application/zip', base64, '_pages.zip'); + }); + }, + exportJson: () => { + window.FW.data.dl('application/json', btoa(unescape(encodeURIComponent(JSON.stringify(state.p)))), '.json'); + }, + exportStaticHtml: () => { + const css = state.c + ' main>section>header{display:none;} @media print{main>.sb{display:none;}main>section>article{page-break-after:always;}main>section>header{display:unset;}}'; + const st = { ...state, c: css, p: { ...state.p, static: true, published: true } }; + const static = FW.gen(st) + .replace(//gsm, '') + .replace(/<\/main>
        .+?<\/footer>/g, '') + // Insert print-only header + .replace('
    ', `
    ${st.p.name}${ st.p.desc ? `

    ${st.p.desc}

    ` : ''}
    `); + window.FW.data.dl('text/html', btoa(unescape(encodeURIComponent(static))), '.html'); + }, + }; + ['DOMContentLoaded', 'render'].forEach(ev => { + emitter.on(ev, () => { + setTimeout(() => { // Adds a very small delay so it injects after render when elements exist in DOM + renderImportExportSection(); + }, 50); + }); + }); + emitter.emit('DOMContentLoaded'); + + function renderImportExportSection () { + // Don't run if not on settings page or if already rendered + if (state.query.page !== 's' || !!document.querySelector('#dataManagementSection')) return; + const section = html`
    +

    Adatkezelés

    +
    +
    + +

    Válasszon ki 1 vagy több HTML-, Markdown- és egyszerű szöveges fájlt, amelyeket oldalakként szeretne importálni.

    +

    Ha a HTML fájlok rendelkeznek egy title elemmel a head elemen belül, vagy egy H1 elemet tartalmaznak, szövegük az oldal címe lesz. Egyéb esetben az oldal címe a fájl neve, kiterjesztés nélkül.

    +

    Ha a Markdown fájlok rendelkeznek YAML frontmatterrel, a name vagy a title mező lesz az oldal címe és a tags mező a címkéket határozza meg. Egyéb esetben az első # címsorszint (ha légezik), vagy a fájl neve kiterjesztés nélkül lesz használva.

    +

    Az importáló mindent megtesz a tartalom és a fájltípus elemzése érdekében, de különböző felhasználási esetek kimaradhatnak. Minél egyszerűbbek a fájlok, annál jobbak lesznek az eredmények.

    +
    +
    + +

    Összegyűjt minden wiki oldalt egy .zip fájlba, az oldalakat slugjuknak megfelelően elnevezve. Az oldalak neve egy H1 elemben lesz megadva a fájlok elején, minden létező címke ezek alatt lesz megtalálható.

    +

    A szülő/gyerek kapcsolatok nem lesznek megőrizve a kiterjesztéssel való exportáláskor, valamint minden kép az oldal tartalmába lesz beszúrva. Belső hivatkozások HTML hivatkozásokká alakulnak át, megfelelően hivatkozva a céloldal HTML fájljára.

    +

    Megjegyzés: az exportban a wiki beállítások oldalán megadott tartalom nem lesz elérhető.

    + + +
    +
    +
    `; + const page = document.querySelector('article.mw'); + page.appendChild(section); + } +}); diff --git a/extensions/v1.8.x/feather-search_hu.js b/extensions/v1.8.x/feather-search_hu.js new file mode 100644 index 0000000..df7a13e --- /dev/null +++ b/extensions/v1.8.x/feather-search_hu.js @@ -0,0 +1,116 @@ +/** + * This file is part of Feather Wiki. + * + * Feather Wiki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Feather Wiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with Feather Wiki. If not, see https://www.gnu.org/licenses/. + */ +// Ez a bővítmény egy keresőmezőt ad hozzá egy nagyon egyszerű szöveges kereséssel, amelynek eredményei a mezőből felugranak, ha van találat. +FW.ready(() => { + const { state, emitter } = FW; + console.log('a feather-search.js futtatása'); + state.searchDebounce = null; + ['DOMContentLoaded', 'render'].forEach(ev => { + emitter.on(ev, () => { + setTimeout(() => { // Adds a very small delay so it injects after render when elements exist in DOM + renderSearchBar(); + }, 50); + }); + }); + emitter.emit('DOMContentLoaded'); + + function renderSearchBar () { + if (!!document.getElementById('featherSearch')) return; + const input = html`
    + search(e)} oninput=${e => search(e)} onblur=${() => { + setTimeout(() => document.getElementById('featherSearchResults').style.display = 'none', 300); + }} onfocus=${() => { + if (document.getElementById('featherSearchResults').innerHTML.length > 0) document.getElementById('featherSearchResults').style.display = null; + }} /> + + +
    `; + const nav = document.querySelector('.sb nav'); + nav.parentNode.insertBefore(input, nav); + } + + function search (e) { + if (state.searchDebounce !== null) clearTimeout(state.searchDebounce); + state.searchDebounce = setTimeout(() => { + const val = e.target.value.trim().toLowerCase(); + const resultsContainer = document.getElementById('featherSearchResults'); + resultsContainer.innerHTML = ''; + if (val.length < 2) return resultsContainer.style.display = 'none'; + const index = state.p.pages.map(p => { + const { id, name, slug, content, editor } = p; + let textContent = ''; + if (content) { + const contentHtml = (html`
    `); + contentHtml.innerHTML = FW.inject.pg((typeof md !== 'undefined' && editor === 'md') ? md(content) : content, state); + textContent = contentHtml.textContent.trim(); + } + return { id, name, searchName: name.toLowerCase(), slug, content: textContent, searchContent: textContent.toLowerCase() }; + }); + const matches = []; + [ + ...index.filter(p => p.searchName.startsWith(val)), + ...index.filter(p => p.searchContent.startsWith(val)), + ...index.filter(p => p.searchName.endsWith(val)), + ...index.filter(p => p.searchContent.endsWith(val)), + ...index.filter(p => p.searchName.includes(val)), + ...index.filter(p => p.searchContent.includes(val)), + ].forEach(p => { + if (!matches.find(m => m.id === p.id)) matches.push(p); + }); + const markMatch = m => { + const start = m.toLowerCase().indexOf(val); + if (start < 0) return m; + const end = start + val.length; + return m.substring(0, start) + '' + m.substring(start, end) + '' + m.substring(end); + }; + resultsContainer.innerHTML = matches.map(p => { + let contentSnippet = ''; + let contentStart = p.searchContent.indexOf(val); + if (contentStart >= 0) { + const pad = 20; + let contentEnd = contentStart + val.length + pad; + if (contentEnd > p.searchContent.length) contentEnd = p.searchContent.length; + contentStart -= pad; + if (contentStart < 0) contentStart = 0; + contentSnippet = p.content.substring(contentStart, contentEnd); + if (contentStart > 0) contentSnippet = '...' + contentSnippet; + if (contentEnd < p.searchContent.length) contentSnippet += '...'; + } + return `${markMatch(p.name)}${contentSnippet.length > 0 ? '
    ' + markMatch(contentSnippet) + '
    ' : ''}
    `; + }).join(''); + resultsContainer.style.display = null; + }, 500); + } +}); diff --git a/extensions/v1.8.x/full-search_hu.js b/extensions/v1.8.x/full-search_hu.js new file mode 100644 index 0000000..f4ff9a5 --- /dev/null +++ b/extensions/v1.8.x/full-search_hu.js @@ -0,0 +1,86 @@ +/** + * This file is part of Feather Wiki. + * + * Feather Wiki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Feather Wiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with Feather Wiki. If not, see https://www.gnu.org/licenses/. + */ +// Ez a bővítmény hozzáadja a Fuse.js-t egy CDN-ből, létrehoz egy keresési eredmény nézetet, és minden rendereléskor hozzáad egy keresősávot a menühöz, +// és megjeleníti a keresési eredményeket, amikor a keresőmezőben megnyomja az Entert. Ez valószínűleg bővíthető vagy javítható, +// de kezdetnek nem rossz! +FW.ready(() => { + const { state, emitter } = FW; + console.log('a full-search.js futtatása'); + const fuseScript = document.createElement('script'); + document.body.appendChild(fuseScript); + fuseScript.onload = () => {if (state.query.search) emitter.emit('search', state.query.search);} + fuseScript.src = 'https://cdn.jsdelivr.net/npm/fuse.js@6.6.2'; + state.searchInput = ''; + state.results = []; + state.views.r = resultsView; + emitter.on('search', q => { + state.searchInput = q; + state.results = (new Fuse(state.p.pages, { + shouldSort: true, + threshold: 0.4, + ignoreLocation: true, + keys: ['name', 'content'], + })).search(q); + emitter.emit(state.events.GO, state.root + '?page=r&search=' + encodeURIComponent(q)); + }); + ['DOMContentLoaded', 'render'].forEach(ev => { + emitter.on(ev, () => { + setTimeout(() => { // Adds a very small delay so it injects after render when elements exist in DOM + renderSearchBar(); + }, 50); + }); + }); + emitter.emit('DOMContentLoaded'); + + function renderSearchBar () { + if (!!document.getElementById('searchBar')) return; + const input = html` { + if (e.key === 'Enter') emitter.emit('search', e.target.value); + }} oninput=${e => state.searchInput = e.target.value} value=${state.searchInput} />`; + const nav = document.querySelector('.sb nav'); + nav.parentNode.insertBefore(input, nav); + } + + function resultsView (state, emit) { + return [ + html`
    +

    Keresési Eredmények

    + ${ state.searchInput.length ? html`

    Kifejezés: "${state.searchInput}"

    ` : '' } +
    `, + ...( + state.results.length + ? state.results.map(r => { + const { name, slug, content, tags, editor } = r.item; + let textContent = ''; + if (content) { + const contentHtml = (html`
    `); + contentHtml.innerHTML = FW.inject.pg((typeof md !== 'undefined' && editor === 'md') ? md(content) : content, state); + textContent = contentHtml.textContent.trim(); + } + return html`
    +

    ${name} (${slug})

    +
    ${textContent.substring(0, 200)}${textContent.length > 200 ? '...' : ''}
    + ${tags?.length + ? html`` + : '' + } +
    `; + }) : [html`

    Nincs Találat

    `] + ), + ]; + } +}); diff --git a/extensions/v1.8.x/simple-navigation_hu.js b/extensions/v1.8.x/simple-navigation_hu.js new file mode 100644 index 0000000..a8ef938 --- /dev/null +++ b/extensions/v1.8.x/simple-navigation_hu.js @@ -0,0 +1,39 @@ +/** + * This file is part of Feather Wiki. + * + * Feather Wiki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Feather Wiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with Feather Wiki. If not, see https://www.gnu.org/licenses/. + */ +// Ez a kiterjesztés a következő/előző gombokat helyezi el az oldalak alján, hogy a Wiki beállításoknál beállított Oldalsorrendben a következő/előző oldalra navigálhasson. Nem minden Feather Wiki esetében hasznos, de bizonyos szituációkban praktikus. +FW.ready(() => { + const { state, emitter } = FW; + console.log('a simple-navigation.js futtatása'); + + ['DOMContentLoaded', 'render'].forEach(ev => { + emitter.on(ev, () => { + setTimeout(() => { // Adds a very small delay so it injects after render when elements exist in DOM + renderNavigationButtons(); + }, 50); + }); + }); + emitter.emit('DOMContentLoaded'); + + function renderNavigationButtons () { + if (!state.pg || state.edit || document.querySelector('#simpleNavigationExtension')) return; + const { pages } = state.p; + const pageIndex = pages.findIndex(p => p.id === state.pg.id); + const buttons = []; + if (pageIndex > 0) { + const prevSlug = pages[pageIndex - 1].slug; + buttons.push(html`← Előző`); + } + if (pageIndex < pages.length - 1) { + const nextSlug = pages[pageIndex + 1].slug; + buttons.push(html`Következő →`); + } + document.querySelector('main>section').appendChild(html`
    ${buttons}
    `); + } +}); diff --git a/extensions/v1.8.x/toggle-menu_hu.js b/extensions/v1.8.x/toggle-menu_hu.js new file mode 100644 index 0000000..d810ae6 --- /dev/null +++ b/extensions/v1.8.x/toggle-menu_hu.js @@ -0,0 +1,68 @@ +/** + * This file is part of Feather Wiki. + * + * Feather Wiki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Feather Wiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with Feather Wiki. If not, see https://www.gnu.org/licenses/. + */ +// Ez a kiterjesztés hozzáad egy gombot, amely a mobil nézeten kívül váltja az oldalsáv láthatóságát. +// Az oldalsáv alapértelmezett állapotának beállítása a `window.toggleSidebarHiddenDefault = true` segítségével lehetséges. +// A kapcsoló gomb eltávolítása a `window.toggleSidebarButtonHidden = true` kapcsolóval lehetséges. +FW.ready(() => { + const { state, emitter } = FW; + console.log('a toggle-menu.js futtatása'); + state.sidebarHidden = window.toggleSidebarHiddenDefault ?? false; + state.hideToggleButton = window.toggleSidebarButtonHidden ?? false; + ['DOMContentLoaded', 'render'].forEach(ev => { + emitter.on(ev, () => { + setTimeout(() => { // Adds a very small delay so it injects after render when elements exist in DOM + renderSidebarToggleState(); + renderToggleSidebarButton(); + }, 50); + }); + }); + emitter.emit('DOMContentLoaded'); + + function renderToggleSidebarButton () { + if (state.hideToggleButton || !!document.getElementById('toggleSidebar')) return; + const btn = html`
    + + +
    `; + const main = document.querySelector('main'); + main.parentNode.appendChild(btn); + } + + function renderSidebarToggleState() { + if (state.sidebarHidden) { + document.querySelector('main>.sb').setAttribute('style', 'display:none!important'); + document.querySelector('main>section').style.paddingLeft = '2.5rem'; + } + } +}); diff --git a/extensions/v1.8.x/transclusion.js b/extensions/v1.8.x/transclusion.js index 56734e7..f157714 100644 --- a/extensions/v1.8.x/transclusion.js +++ b/extensions/v1.8.x/transclusion.js @@ -10,6 +10,7 @@ // This extension finds any content between double braces {{like_this}} and looks for a page with a matching // slug. If found, the braced content will be replaced with the content of the target page within an `article` // tag with a class of `transclusion` so it can be targeted and styled. +// Add `|raw` {{like_this|raw}} to exclude the heading and link to the transcluded page & only show content. FW.ready(() => { const { state, emitter } = FW; state.tDepth = 0; @@ -27,24 +28,22 @@ FW.ready(() => { function injectTransclusion() { if (state.pg) { const uc = document.querySelector('.uc'); - const matches = uc?.innerHTML?.match(/{{.+?(?=}})/g) ?? []; + const matches = uc?.innerHTML?.match(/{{[^}]+}}/g) ?? []; matches.forEach(l => { - const slug = l.replace('{{', '').trim(); + let includeHeading = true; + let slug = l.replace(/[}{]/g, '').trim(); + if (/\|\s?raw/.test(slug)) { + includeHeading = false; + slug = slug.replace(/\|\s?raw/, '').trim(); + } const page = state.p.pages.find(pg => pg.slug === slug); - console.log(slug, page); if (!page) return; - const { img, pg, out, hLink } = FW.inject; - const pageContent = img( - pg( - hLink( - out(`

    ${page.name} Go to Page

    ${page.editor === 'md' ? md(page.content) : page.content}`) - ), - state - ), - state - ); + const parsed = parseContent(page.content, page.editor === 'md'); + const pageContent = includeHeading + ? `

    ${page.name} Go to Page

    ${parsed}` + : parsed; uc.innerHTML = uc.innerHTML.replace( - `${l}}}`, + l, `
    ${pageContent}
    ` ); }); @@ -56,4 +55,30 @@ FW.ready(() => { } } } + + function parseContent(pageContent, isMd = false) { + if (typeof FW.parseContent !== 'undefined') { + return FW.parseContent(pageContent, isMd); + } + + const { img, pg, out, hLink } = FW.inject; + let nowiki = []; + let nIdx = 0; // nowiki index + // Parse out content wrapped "nowiki" HTML tags - must be added in either HTML or Markdown view + let c = (pageContent ?? '').replace(/(.*<\/nowiki>)/gs, (m, content) => { + nowiki[nIdx] = content; + return `{nowiki-${nIdx++}}`; + }); + c = pg(FW.img.fix(c)); + c = isMd ? md(c ?? '') : c; + c = img( + hLink( + out(c) + ) + ); + for (let i = 0; i < nIdx; i++) { + c = c.replace(`{nowiki-${i}}`, nowiki[i]); + } + return c; + } }); diff --git a/extensions/v1.8.x/transclusion_hu.js b/extensions/v1.8.x/transclusion_hu.js new file mode 100644 index 0000000..440a5a8 --- /dev/null +++ b/extensions/v1.8.x/transclusion_hu.js @@ -0,0 +1,84 @@ +/** + * This file is part of Feather Wiki. + * + * Feather Wiki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Feather Wiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with Feather Wiki. If not, see https://www.gnu.org/licenses/. + */ +// Ez a kiterjesztés megkeresi a kettős kapcsos zárójelek közötti tartalmat {{mint_ez}}, és keres egy olyan oldalt, amelyiknek a slug definíciója azonos. +// Ha van találat, akkor a kapcsos zárójeles tartalom helyére a céloldal tartalma kerül egy `article` elemben. +// Osztálya `transclusion` lesz, így a behelyettesített tartalom később célzottan megtalálható és stilizálható. +// A `|raw` kóddal {{mint_ez|raw}} a címsor és az oldalra ugró hivatkozás kikapcsolható, így csak az oldal tartalma lesz látható . +FW.ready(() => { + const { state, emitter } = FW; + state.tDepth = 0; + state.tDepthMax = 20; // Maximum depth to check for transclusion + ['DOMContentLoaded', 'render'].forEach(ev => { + emitter.on(ev, () => { + state.tDepth = 0; + setTimeout(() => { // Adds a very small delay so it injects after render when elements exist in DOM + injectTransclusion(); + }, 300); + }); + }); + emitter.emit('DOMContentLoaded'); + + function injectTransclusion() { + if (state.pg) { + const uc = document.querySelector('.uc'); + const matches = uc?.innerHTML?.match(/{{[^}]+}}/g) ?? []; + matches.forEach(l => { + let includeHeading = true; + let slug = l.replace(/[}{]/g, '').trim(); + if (/\|\s?raw/.test(slug)) { + includeHeading = false; + slug = slug.replace(/\|\s?raw/, '').trim(); + } + const page = state.p.pages.find(pg => pg.slug === slug); + if (!page) return; + const parsed = parseContent(page.content, page.editor === 'md'); + const pageContent = includeHeading + ? `

    ${page.name} Ugrás az Oldalra

    ${parsed}` + : parsed; + uc.innerHTML = uc.innerHTML.replace( + l, + `
    ${pageContent}
    ` + ); + }); + if (matches.length > 0 && state.tDepth < state.tDepthMax) { + state.tDepth++; + // If transclusion is injected, run again to see if more is needed + // Only run it state.tDepthMax times to prevent potential infinite recursion + injectTransclusion(); + } + } + } + + function parseContent(pageContent, isMd = false) { + if (typeof FW.parseContent !== 'undefined') { + return FW.parseContent(pageContent, isMd); + } + + const { img, pg, out, hLink } = FW.inject; + let nowiki = []; + let nIdx = 0; // nowiki index + // Parse out content wrapped "nowiki" HTML tags - must be added in either HTML or Markdown view + let c = (pageContent ?? '').replace(/(.*<\/nowiki>)/gs, (m, content) => { + nowiki[nIdx] = content; + return `{nowiki-${nIdx++}}`; + }); + c = pg(FW.img.fix(c)); + c = isMd ? md(c ?? '') : c; + c = img( + hLink( + out(c) + ) + ); + for (let i = 0; i < nIdx; i++) { + c = c.replace(`{nowiki-${i}}`, nowiki[i]); + } + return c; + } +}); diff --git a/extensions/v1.8.x/upgrade-feather-wiki.js b/extensions/v1.8.x/upgrade-feather-wiki.js index de9dfac..ffbf9b9 100644 --- a/extensions/v1.8.x/upgrade-feather-wiki.js +++ b/extensions/v1.8.x/upgrade-feather-wiki.js @@ -64,7 +64,9 @@ FW.ready(() => { } async function getUpgradedHtml() { - const upgrade = await fetch('https://feather.wiki/builds/FeatherWiki.html').then(r => r.text()).then(h => { + const lang = document.documentElement.lang ?? 'en-US'; + const buildName = `FeatherWiki${lang !== 'en-US' ? '_' + lang : ''}.html`; + const upgrade = await fetch(`https://feather.wiki/builds/${buildName}`).then(r => r.text()).then(h => { const { c, p, j } = state; const static = FW.gen(state).replace(new RegExp(`.* (.*?) <${j ? 'script' : '/body'}.*`, 's'), '$1'); // Try to match the most specific pieces of HTML possible @@ -81,9 +83,12 @@ FW.ready(() => { / JavaScript<\/a> is required /, ` ${static} ${j ? ` -

    All Pages

    All Pages