diff --git a/UPlanetKEYS_refresh.sh b/UPlanetKEYS_refresh.sh index 1f91cdc9..e3d7d769 100755 --- a/UPlanetKEYS_refresh.sh +++ b/UPlanetKEYS_refresh.sh @@ -60,3 +60,4 @@ for key in ${UKEYS[@]}; do done echo "(◕‿◕ ) ${ME} :: $medo SUCCESS over $floop KEYS from ${#UKEYS[@]} JOBS" +exit 0 diff --git a/adventure/logic/leverlogic.ben= b/adventure/logic/leverlogic.ben= deleted file mode 100755 index cfb931e4..00000000 --- a/adventure/logic/leverlogic.ben= +++ /dev/null @@ -1 +0,0 @@ -off diff --git a/templates/UPlanetRegion/md.htm b/templates/UPlanetRegion/md.htm new file mode 100644 index 00000000..f0a95084 --- /dev/null +++ b/templates/UPlanetRegion/md.htm @@ -0,0 +1,39 @@ + + + + + + + + + + +
+ +
+ + + + + diff --git a/templates/UPlanetRegion/prism.min.css b/templates/UPlanetRegion/prism.min.css new file mode 100644 index 00000000..8c4cc057 --- /dev/null +++ b/templates/UPlanetRegion/prism.min.css @@ -0,0 +1 @@ +code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help} \ No newline at end of file diff --git a/templates/UPlanetRegion/zero-md.min.js b/templates/UPlanetRegion/zero-md.min.js new file mode 100644 index 00000000..d9d92f8c --- /dev/null +++ b/templates/UPlanetRegion/zero-md.min.js @@ -0,0 +1,2 @@ +class t extends HTMLElement{get src(){return this.getAttribute("src")}set src(t){this.reflect("src",t)}get manualRender(){return this.hasAttribute("manual-render")}set manualRender(t){this.reflect("manual-render",t)}reflect(t,e){!1===e?this.removeAttribute(t):this.setAttribute(t,!0===e?"":e)}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e,s){"src"===t&&this.connected&&!this.manualRender&&s!==e&&this.render()}constructor(t){super(),this.version="2.5.3",this.config={markedUrl:"https://cdn.jsdelivr.net/gh/markedjs/marked@4/marked.min.js",prismUrl:[["https://cdn.jsdelivr.net/gh/PrismJS/prism@1/prism.min.js","data-manual"],"https://cdn.jsdelivr.net/gh/PrismJS/prism@1/plugins/autoloader/prism-autoloader.min.js"],cssUrls:["https://cdn.jsdelivr.net/gh/sindresorhus/github-markdown-css@4/github-markdown.min.css","https://cdn.jsdelivr.net/gh/PrismJS/prism@1/themes/prism.min.css"],hostCss:":host{display:block;position:relative;contain:content;}:host([hidden]){display:none;}",...t,...window.ZeroMdConfig},this.root=this.hasAttribute("no-shadow")?this:this.attachShadow({mode:"open"}),this.root.prepend(...this.makeNodes('
')),this.constructor.ready||(this.constructor.ready=Promise.all([!!window.marked||this.loadScript(this.config.markedUrl),!!window.Prism||this.loadScript(this.config.prismUrl)])),this.clicked=this.clicked.bind(this),this.manualRender||this.render().then((()=>setTimeout((()=>this.goto(location.hash)),250))),this.observer=new MutationObserver((()=>{this.observeChanges(),this.manualRender||this.render()})),this.observer.observe(this,{childList:!0}),this.observeChanges()}observeChanges(){this.querySelectorAll('template,script[type="text/markdown"]').forEach((t=>{this.observer.observe(t.content||t,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}))}connectedCallback(){this.connected=!0,this.fire("zero-md-connected",{},{bubbles:!1,composed:!1}),this.waitForReady().then((()=>{this.fire("zero-md-ready")})),this.shadowRoot&&this.shadowRoot.addEventListener("click",this.clicked)}disconnectedCallback(){this.connected=!1,this.shadowRoot&&this.shadowRoot.removeEventListener("click",this.clicked)}waitForReady(){const t=this.connected||new Promise((t=>{this.addEventListener("zero-md-connected",(function e(){this.removeEventListener("zero-md-connected",e),t()}))}));return Promise.all([this.constructor.ready,t])}fire(t,e={},s={bubbles:!0,composed:!0}){e.msg&&console.warn(e.msg),this.dispatchEvent(new CustomEvent(t,{detail:{node:this,...e},...s}))}tick(){return new Promise((t=>requestAnimationFrame(t)))}arrify(t){return t?Array.isArray(t)?t:[t]:[]}onload(t){return new Promise(((e,s)=>{t.onload=e,t.onerror=t=>s(t.path?t.path[0]:t.composedPath()[0])}))}loadScript(t){return Promise.all(this.arrify(t).map((t=>{const[e,...s]=this.arrify(t),r=document.createElement("script");return r.src=e,r.async=!1,s.forEach((t=>r.setAttribute(t,""))),this.onload(document.head.appendChild(r))})))}goto(t){let e;try{e=this.root.querySelector(t)}catch{}e&&e.scrollIntoView()}clicked(t){if(t.metaKey||t.ctrlKey||t.altKey||t.shiftKey||t.defaultPrevented)return;const e=t.target.closest("a");e&&e.hash&&e.host===location.host&&e.pathname===location.pathname&&this.goto(e.hash)}dedent(t){const e=(t=t.replace(/^\n/,"")).match(/^\s+/);return e?t.replace(new RegExp(`^${e[0]}`,"gm"),""):t}getBaseUrl(t){const e=document.createElement("a");return e.href=t,e.href.substring(0,e.href.lastIndexOf("/")+1)}highlight(t){return new Promise((e=>{t.querySelectorAll('pre>code:not([class*="language-"])').forEach((t=>{const e=t.innerText.match(/^\s*{const e=this.querySelector(t);return e?e.innerHTML||" ":""},e=this.arrify(this.config.cssUrls);return`${t('template[data-merge="prepend"]')}${t("template:not([data-merge])")||e.reduce(((t,e)=>`${t}`),"")}${t('template[data-merge="append"]')}`}async buildMd(t={}){return await(async()=>{if(!this.src)return"";const e=await fetch(this.src);if(e.ok){const s=await e.text();return window.marked.parse(s,{baseUrl:this.getBaseUrl(this.src),...t})}return this.fire("zero-md-error",{msg:`[zero-md] HTTP error ${e.status} while fetching src`,status:e.status,src:this.src}),""})()||(()=>{const e=this.querySelector('script[type="text/markdown"]');if(!e)return"";const s=e.hasAttribute("data-dedent")?this.dedent(e.text):e.text;return window.marked.parse(s,t)})()}getHash(t){let e=5381;for(let s=0;s>>0).toString(36)}async stampStyles(t){const e=this.getHash(t),s=this.root.querySelector(".markdown-styles");if(s.getAttribute("data-hash")!==e){s.setAttribute("data-hash",e);const r=this.makeNodes(t),i=[...r].filter((t=>"LINK"===t.tagName&&"stylesheet"===t.getAttribute("rel")));return s.innerHTML="",s.append(...r),await Promise.all(i.map((t=>this.onload(t)))).catch((t=>{this.fire("zero-md-error",{msg:"[zero-md] An external stylesheet failed to load",status:void 0,src:t.href})})),!0}}async stampBody(t,e){const s=this.arrify(e),r=this.getHash(t+JSON.stringify(s)),i=this.root.querySelector(".markdown-body");if(i.getAttribute("data-hash")!==r){i.setAttribute("data-hash",r),s.unshift("markdown-body"),i.setAttribute("class",s.join(" "));const e=this.makeNodes(t);return i.innerHTML="",i.append(...e),await this.highlight(i),!0}}async render(t={}){await this.waitForReady();const e=this.buildMd(t),s=await this.stampStyles(this.buildStyles());await this.tick();const r=await this.stampBody(await e,t.classes);this.fire("zero-md-rendered",{node:this,stamped:{styles:s,body:r}})}}customElements.define("zero-md",t);export{t as ZeroMd}; +//# sourceMappingURL=zero-md.min.js.map diff --git a/templates/UPlanetRegion/zero-md.min.js.map b/templates/UPlanetRegion/zero-md.min.js.map new file mode 100644 index 00000000..435158af --- /dev/null +++ b/templates/UPlanetRegion/zero-md.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"zero-md.min.js","sources":["../src/index.js"],"sourcesContent":["export class ZeroMd extends HTMLElement {\n get src() {\n return this.getAttribute('src')\n }\n\n set src(val) {\n this.reflect('src', val)\n }\n\n get manualRender() {\n return this.hasAttribute('manual-render')\n }\n\n set manualRender(val) {\n this.reflect('manual-render', val)\n }\n\n reflect(name, val) {\n if (val === false) {\n this.removeAttribute(name)\n } else {\n this.setAttribute(name, val === true ? '' : val)\n }\n }\n\n static get observedAttributes() {\n return ['src']\n }\n\n attributeChangedCallback(name, old, val) {\n if (name === 'src' && this.connected && !this.manualRender && val !== old) {\n this.render()\n }\n }\n\n constructor(defaults) {\n super()\n this.version = '$VERSION'\n this.config = {\n markedUrl: 'https://cdn.jsdelivr.net/gh/markedjs/marked@4/marked.min.js',\n prismUrl: [\n ['https://cdn.jsdelivr.net/gh/PrismJS/prism@1/prism.min.js', 'data-manual'],\n 'https://cdn.jsdelivr.net/gh/PrismJS/prism@1/plugins/autoloader/prism-autoloader.min.js'\n ],\n cssUrls: [\n 'https://cdn.jsdelivr.net/gh/sindresorhus/github-markdown-css@4/github-markdown.min.css',\n 'https://cdn.jsdelivr.net/gh/PrismJS/prism@1/themes/prism.min.css'\n ],\n hostCss:\n ':host{display:block;position:relative;contain:content;}:host([hidden]){display:none;}',\n ...defaults,\n ...window.ZeroMdConfig\n }\n this.root = this.hasAttribute('no-shadow') ? this : this.attachShadow({ mode: 'open' })\n this.root.prepend(\n ...this.makeNodes(`
`)\n )\n if (!this.constructor.ready) {\n this.constructor.ready = Promise.all([\n !!window.marked || this.loadScript(this.config.markedUrl),\n !!window.Prism || this.loadScript(this.config.prismUrl)\n ])\n }\n this.clicked = this.clicked.bind(this)\n if (!this.manualRender) {\n // Scroll to hash id after first render. However, `history.scrollRestoration` inteferes with this\n // on refresh. It's much better to use a `setTimeout` rather than to alter the browser's behaviour.\n this.render().then(() => setTimeout(() => this.goto(location.hash), 250))\n }\n this.observer = new MutationObserver(() => {\n this.observeChanges()\n if (!this.manualRender) this.render()\n })\n this.observer.observe(this, { childList: true })\n this.observeChanges()\n }\n\n /**\n * Start observing changes, if not already so, in `template` and `script`.\n */\n observeChanges() {\n this.querySelectorAll('template,script[type=\"text/markdown\"]').forEach((n) => {\n this.observer.observe(n.content || n, {\n childList: true,\n subtree: true,\n attributes: true,\n characterData: true\n })\n })\n }\n\n connectedCallback() {\n this.connected = true\n this.fire('zero-md-connected', {}, { bubbles: false, composed: false })\n this.waitForReady().then(() => {\n this.fire('zero-md-ready')\n })\n if (this.shadowRoot) {\n this.shadowRoot.addEventListener('click', this.clicked)\n }\n }\n\n disconnectedCallback() {\n this.connected = false\n if (this.shadowRoot) {\n this.shadowRoot.removeEventListener('click', this.clicked)\n }\n }\n\n waitForReady() {\n const ready =\n this.connected ||\n new Promise((resolve) => {\n this.addEventListener('zero-md-connected', function handler() {\n this.removeEventListener('zero-md-connected', handler)\n resolve()\n })\n })\n return Promise.all([this.constructor.ready, ready])\n }\n\n fire(name, detail = {}, opts = { bubbles: true, composed: true }) {\n if (detail.msg) {\n console.warn(detail.msg)\n }\n this.dispatchEvent(\n new CustomEvent(name, {\n detail: { node: this, ...detail },\n ...opts\n })\n )\n }\n\n tick() {\n return new Promise((resolve) => requestAnimationFrame(resolve))\n }\n\n // Coerce anything into an array\n arrify(any) {\n return any ? (Array.isArray(any) ? any : [any]) : []\n }\n\n // Promisify an element's onload callback\n onload(node) {\n return new Promise((resolve, reject) => {\n node.onload = resolve\n node.onerror = (err) => reject(err.path ? err.path[0] : err.composedPath()[0])\n })\n }\n\n // Load a url or load (in order) an array of urls via