diff --git a/assets/css/fonts.css b/assets/css/fonts.css new file mode 100644 index 0000000..a0326af --- /dev/null +++ b/assets/css/fonts.css @@ -0,0 +1,53 @@ +/* latin-ext */ +/* @font-face { + font-family: 'Source Sans 3'; + font-style: normal; + font-weight: 300 600; + font-display: block; + src: url(/assets/font/ss3le.woff2) format('woff2'); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; + } */ + /* latin */ + @font-face { + font-family: 'Source Sans 3'; + font-style: normal; + font-weight: 300 600; + font-display: block; + src: url(/assets/fonts/ss3l.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; + } + /* latin-ext */ +/* @font-face { + font-family: 'Source Sans 3'; + font-style: italic; + font-weight: 300 600; + font-display: block; + src: url(/assets/font/ss3ile.woff2) format('woff2'); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; + } */ + /* latin */ + @font-face { + font-family: 'Source Sans 3'; + font-style: italic; + font-weight: 300 600; + font-display: block; + src: url(/assets/fonts/ss3il.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + /* arabic */ +/* @font-face { + font-family: 'Source Sans 3'; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/assets/font/UthmanicHafs1Ver09.woff2) format('woff2'); + unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; +} */ +/* Material Symbols Outlined */ +@font-face { + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: 400; + font-display: block; + src: url(/assets/fonts/materials.woff2) format('woff2'); +} \ No newline at end of file diff --git a/assets/css/molybdenum.css b/assets/css/molybdenum.css new file mode 100755 index 0000000..fb63e24 --- /dev/null +++ b/assets/css/molybdenum.css @@ -0,0 +1,545 @@ +/*! + * molybdenum v1.1.0 Companion CSS + * Copyright 2025 PT Nusa Angkasa Siber + * Released under the MIT License + */ +:root { + color-scheme: light only; + --secondary-table: #1e634a; + --primary-table: #1182a4; + --primary-foreground: #050607; + --secondary-foreground: #aaaaac; + --primary-background: #fefdfc; + --secondary-background: #d9d9dc; + --semi-background: #fdfcf975; + --primary-accent: #1b5d76; + --semi-primary: #1b5d76bb; + --secondary-accent: #4eaacc; + --semi-secondary: #4eaaccbb; + --negative-accent: #ad0400; + --positive-accent: #4ecc89; + --neutral-p-accent: #5fc4ff; + --neutral-n-accent: #f6c267; + --semi-negative: #ad0400bb; + --semi-positive: #4ecc89bb; + --semi-neutral-p: #5fc4ffbb; + --semi-neutral-n: #f6c267bb; + --input-background: #ebf2f4; + --blend-color: inherit; + height: 100vh; +} +* { + box-sizing: border-box; + position: relative; + font-family: 'Source Sans 3'; +} +body +{ + font-size: 13pt; + color: var(--primary-foreground); + background-color: var(--primary-background); +} +thead +{ + background-color: var(--primary-accent); + color: var(--primary-background); + position: sticky; + top: 1px; + z-index: 1; +} +button +{ + border: 1px solid var(--secondary-foreground); + color: var(--primary-foreground); + padding: .125em .35em .125em .35em; + border-radius: .15em; + margin: .15em 0 .15em 0; + font-size: .9em; +} +button.accented +{ + background-color: var(--primary-accent); + color: var(--primary-background); +} +button.p-accent +{ + background-color: var(--neutral-p-accent); +} +button.s-accent +{ + background-color: var(--secondary-accent); +} +button.n-accent +{ + background-color: var(--neutral-n-accent); +} +button.positive +{ + background-color: var(--positive-accent); +} +button.negative +{ + background-color: var(--negative-accent); + color: var(--primary-background); +} +button:hover:not(:disabled) +{ + filter: brightness(1.15); +} +button:active:not(:disabled) +{ + border: 1px inset var(--secondary-foreground); + filter: brightness(.95); +} +button:disabled +{ + background-color: var(--secondary-foreground); + color: var(--primary-foreground) +} +table +{ + isolation: isolate; +} +table, table th, table td { + border-collapse: collapse; + padding: .2ch .25ch .2ch .25ch; + margin: auto; +} +table.bordered, table.bordered th , table.bordered td { + border: 1px solid var(--primary-background); +} +table.fullwidth{ + width: calc(100% - 2ch); +} +table.selectable tr:not(thead tr){ + user-select: none; + -webkit-user-select: none; + cursor: pointer; +} +table.selectable tr:hover:not(thead tr) +{ + background-color: var(--semi-neutral-p); +} +tr:nth-child(odd):not(thead tr){ + background-color: white; +} +tr:not(thead tr){ + background-color: var(--input-background); +} +table.selectable tr.selected:not(thead tr), table.selectable tr.odd.selected:not(thead tr){ + background-color: var(--semi-positive); +} +table.selectablecell td:hover:not(.block) +{ + cursor: pointer; + background-color: var(--semi-neutral-p); +} +table.selectablecell td.selected:not(.block) +{ + background-color: var(--semi-positive); +} +textarea +{ + min-height: 1.85em; + resize: vertical; +} +input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), textarea, select +{ + background-color: var(--primary-background); + border: 1px solid var(--secondary-foreground); + border-radius: .15em; + font-size: 1em; + padding-inline-start: .35em; + padding-inline-end: .35em; + width: 25ch; + outline: none; + margin-bottom: .25em; +} +input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus-visible, textarea:focus-visible, select:focus-visible +{ + border: 1px solid var(--secondary-background); + border-bottom: 1px solid var(--primary-accent); + background-color: var(--input-background); +} +input.icon +{ + padding-left: 3.5ch !important; +} +input[type="password"].peek +{ + padding-right: 3.5ch !important; +} +sep-bar{ + -webkit-user-select: none; + user-select: none; + color: var(--secondary-foreground); + margin-inline-start: .75ch; + margin-inline-end: .5ch; +} +sep-bar::after{ + content: "|"; +} +background-screen, load-screen, dialog-screen +{ + display: flex; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: var(--semi-background); + backdrop-filter: blur(5px); + user-select: none; + justify-content: center; + align-items: center; + -webkit-user-select: none; + -webkit-user-drag: none; +} +load-screen:not(body>load-screen) +{ + position: absolute; +} +load-screen +{ + flex-direction: column; +} +dialog-box +{ + display: grid; + grid-template-rows: auto 1fr; + row-gap: .75em; + position: relative; + max-width: 90vw; + max-height: 90vh; + width: max-content; + height: max-content; + background-color: var(--primary-background); + border: 1px solid var(--secondary-foreground); + border-radius: .25em; + padding: .5em; + transition: scale .25s; + scale: 0; +} +dialog-title +{ + display: grid; + grid-template-columns: 1fr auto; + border-bottom: 1px solid var(--secondary-foreground); + font-weight: 500; + padding-left: .25em; + height: 1.65em; +} +load-screen.opaque +{ + background-color: var(--primary-background); +} +a, confirm-handle +{ + display: inline; + -webkit-user-select: none; + user-select: none; + cursor: pointer; + color: var(--primary-accent); + margin-inline-start: .5ch; + margin-inline-end: .5ch; + white-space: nowrap; + text-decoration: none; + filter: brightness(1); +} +a +{ + transition: filter .35s ease, text-shadow .35s ease; +} + a:hover /*, confirm-handle:hover */ +{ + filter: brightness(1.25); + text-shadow: 0 0 .25em var(--semi-primary); +} +a:active /*, confirm-handle:active*/ +{ + filter: brightness(1.25); + text-shadow: 0 0 .75em var(--semi-primary); +} +button.notifier::after +{ + content: "."; + background-color: var(--negative-accent); + color: var(--negative-accent); + width: 2em; + height: 2em; + border-radius: 1em; + display: block; + position: absolute; + top: -.75em; + right: -.75em; + font-size: .3em; +} +a-button.notifier::after +{ + content: "."; + background-color: var(--negative-accent); + color: var(--negative-accent); + width: 2em; + height: 2em; + border-radius: 1em; + display: block; + position: absolute; + top: -.1em; + right: -1.25em; + font-size: .26em; +} +/* .ellipsis +{ + display: inline-block; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + max-width: 100%; +} */ +.noscroll +{ + overflow: hidden; +} +/* ANIMATIONS */ +load-message +{ + display: block; + margin: .4em; +} +chat-load { /* POSSIBLE load-anim DEFINITION */ + display: flex; + justify-content: center; + align-items: center; + gap: 5px; +} + +chat-load span { /* ALSO PUT load-anim span IF USED */ + width: 1em; + height: 1em; + background-color: var(--primary-accent); + border-radius: 50%; + opacity: 0.3; + animation: pulse 1.5s infinite ease-in-out; +} + +chat-load span:nth-child(1) { + animation-delay: 0s; +} +chat-load span:nth-child(2) { + animation-delay: 0.2s; +} +chat-load span:nth-child(3) { + animation-delay: 0.4s; +} + +@keyframes pulse { + 0%, 100% { + opacity: 0.3; + transform: scale(1); + } + 50% { + opacity: 1; + transform: scale(1.3); + } +} +sonar-ping + { /* POSSIBLE load-anim DEFINITION */ + width: 2em; + height: 2em; + border: 2px solid var(--primary-accent); + border-radius: 50%; + position: relative; + animation: expandRing 1.5s infinite ease-out; +} + +@keyframes expandRing { + 0% { + transform: scale(0.5); + opacity: 1; + } + 100% { + transform: scale(2); + opacity: 0; + } +} +skeleton-view { + background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%); + background-size: 200% 100%; + animation: skeleton-loading 1.5s infinite linear; + border-radius: 4px; +} + +@keyframes skeleton-loading { + 0% { background-position: 200% 0; } + 100% { background-position: -200% 0; } +} +progress-loop { /* POSSIBLE load-anim DEFINITION */ + width: 95%; + height: .25em; + background: var(--secondary-background); + position: relative; + overflow: hidden; +} + +progress-loop::after { /* ALSO PUT load-anim::after IF USED */ + content: ""; + width: 50%; + height: 100%; + background: var(--primary-accent); + position: absolute; + left: -50%; + animation: progress-loop 2s infinite linear; +} + +@keyframes progress-loop { + 0% { left: -50%; } + 100% { left: 100%; } +} + +m-icon { + max-width: 1ch; + width: 1ch; + overflow: hidden; + font-family: 'Material Symbols Outlined'; + font-weight: normal; + font-style: normal; + font-size: 1.3em; + line-height: 1; + letter-spacing: normal; + text-transform: none; + display: inline-block; + white-space: nowrap; + word-wrap: normal; + direction: ltr; + -webkit-font-feature-settings: 'liga'; + font-feature-settings: 'liga'; + -webkit-font-smoothing: antialiased; +} +m-inline { + max-width: 1ch; + width: 1ch; + overflow: hidden; + font-family: 'Material Symbols Outlined'; + font-weight: normal; + font-style: normal; + font-size: 1.25em; + line-height: 1; + letter-spacing: normal; + text-transform: none; + display: inline-block; + white-space: nowrap; + word-wrap: normal; + direction: ltr; + -webkit-font-feature-settings: 'liga'; + font-feature-settings: 'liga'; + -webkit-font-smoothing: antialiased; + padding-bottom: .17em; + vertical-align: middle; +} +button>m-inline +{ + padding-bottom: .07em; +} +m-inline.icon +{ + position: absolute; + left: 0; + font-size: 1.2em; + padding-top: .25em; + padding-left: .2em; + max-width: 1.2ch; + width: 1.2ch; +} + +/* ALERT BOX */ +alert-screen, confirm-screen +{ + display: flex; + position: fixed !important; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: var(--semi-background); + backdrop-filter: blur(5px); + user-select: none; + justify-content: center; + align-items: center; + -webkit-user-select: none; + -webkit-user-drag: none; +} +alert-box, confirm-box +{ + border: 1px solid var(--secondary-foreground); + display: block; + width: calc(100vw - .75em); + max-width: 450px; + position: fixed; + height: 12.25em; + max-height: 12.25em; + padding: .5em; + background-color: var(--semi-background); + backdrop-filter: blur(5px); + -webkit-backdrop-filter: blur(5px); + border-radius: .25em; + scale: 0; + transition: scale .25s; + text-align: center; +} +confirm-box +{ + height: 14.25em; + max-height: 14.25em; +} +alert-handle +{ + display: inline; + -webkit-user-select: none; + user-select: none; + cursor: pointer; + color: var(--primary-accent); + margin-inline-start: .5ch; + margin-inline-end: .5ch; + white-space: nowrap; + text-decoration: none; + filter: brightness(1); +} +confirm-handle +{ + display: grid; + grid-template-rows: 1fr 1fr; + position: absolute; + bottom: .25em; + left: -.2em; + right: -.2em; + text-align: center; + height: 3.5em; + outline: none; + color: var(--primary-foreground); +} +alert-title, confirm-title +{ + display: block; + white-space: nowrap; + font-weight: 600; + max-width: 100%; + text-overflow: ellipsis; + overflow: hidden; + text-align: center; + margin-bottom: .25em; + border-bottom: 1px solid var(--secondary-background); +} +alert-text, confirm-text +{ + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 5; + line-clamp: 5; + overflow: hidden; + text-overflow: ellipsis; + padding-top: .25em; + border-bottom: 1px solid var(--secondary-background); + text-align: justify; + height: 7.75em; + margin-bottom: .25em; +} diff --git a/assets/fonts/materials.woff2 b/assets/fonts/materials.woff2 new file mode 100644 index 0000000..eb8808d Binary files /dev/null and b/assets/fonts/materials.woff2 differ diff --git a/assets/fonts/ss3il.woff2 b/assets/fonts/ss3il.woff2 new file mode 100644 index 0000000..d0b3455 Binary files /dev/null and b/assets/fonts/ss3il.woff2 differ diff --git a/assets/fonts/ss3l.woff2 b/assets/fonts/ss3l.woff2 new file mode 100644 index 0000000..bb24ab3 Binary files /dev/null and b/assets/fonts/ss3l.woff2 differ diff --git a/assets/images/bpn.webp b/assets/images/bpn.webp new file mode 100644 index 0000000..2c0684f Binary files /dev/null and b/assets/images/bpn.webp differ diff --git a/assets/js/app.js b/assets/js/app.js index e654ec4..c761f6a 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,3 +1,4 @@ +vernum = "1.0.250601.1020" async function getJson(url,headers={}) { try { const response = await fetch(url); diff --git a/assets/js/jquery.min.js b/assets/js/jquery.min.js new file mode 100755 index 0000000..7f37b5d --- /dev/null +++ b/assets/js/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0`; + const ele = par.firstChild; + options.style ? ele.style = options.style : null; + options.className ? ele.className = options.className : null; + typeof options.append === 'string' ? ele.append(options.append) : options.append instanceof Element ? ele.append(options.append) : null; + typeof options.href === 'string' && ele.nodeName === "A" ? ele.setAttribute("href",options.href) : null; + return ele; + } + loadScreen = class { + static clear() + { + $('load-screen').remove(); + moly._loads = []; + } + static show(message = "", style = "sonar", target = "body") + { + if (target != "body" && ($(target).length != 1 || $(target).prevObject)) + { + console.error("Target Invalid: " + JSON.stringify($(target))); + return -1; + } + let sid = Date.now() + Math.random().toString(16).slice(2); + let ls = moly.newElement("load-screen"); + let lm = moly.newElement("load-message"); + lm.append(message); + if (style == "dots") + { + let p = moly.newElement("chat-load") + ls.append(p); + p.append(moly.newElement("span")); + p.append(moly.newElement("span")); + p.append(moly.newElement("span")); + } + else if (style == "bar") + { + ls.append(moly.newElement("progress-loop")); + } + else + { + ls.append(moly.newElement("sonar-ping")); + } + ls.append(lm); + moly._loads.push({id: sid, screen: ls}); + $(target).append(ls); + return sid; + } + static update(id=0, message = "") + { + let i = moly._loads.findIndex(e=> e.id == id) + if(i >= 0 && message.length > 0) + { + $(moly._loads[i].screen).children("load-message").html(message); + } + } + static close(id=0) + { + let i = moly._loads.findIndex(e=> e.id == id) + if(i >= 0) + { + moly._loads[i].screen.remove(); + moly._loads.splice(i,1); + } + } + } + dialog = class { + static clear() + { + $('dialog-box').remove(); + moly._dialogs = []; + } + static async show({ title = "Dialog Box", content = "", fetching = false, data = {} } = {}) + { + let dialog = + { + id: Date.now() + Math.random().toString(16).slice(2), + screen: moly.newElement("dialog-screen"), + box: moly.newElement("dialog-box"), + titlet: moly.newElement("span"), + content: moly.newElement("div"), + beforeResolve: [], + resolve: undefined, + data: data + } + moly._dialogs.push(dialog); + dialog.screen.append(dialog.box) + let titlebar = moly.newElement("dialog-title"); + let closebtn = moly.newElement("a-button"); + let closeicn = moly.newElement("m-icon"); + closebtn.append(closeicn) + closeicn.append("close"); + closebtn.setAttribute("type","negative"); + dialog.box.append(titlebar); + $(dialog.box).css("width",data.width); + $(dialog.box).css("height",data.height); + titlebar.append(dialog.titlet); + $(dialog.titlet).html(title); + titlebar.append(closebtn); + dialog.box.append(dialog.content); + dialog.content.setAttribute("id",`db${dialog.id}`); + dialog.content.style = "overflow-y: auto;" + $('body').append(dialog.screen); + setTimeout(()=>{ + $(dialog.box).css("scale",1); + },5); + let loadid = moly.loadScreen.show("Memuat Konten...","sonar",`#db${dialog.id}`); + $(dialog.content).html(fetching ? await fetch(content).then(r => r.text()) : content); + moly.loadScreen.close(loadid); + return new Promise((resolve,reject)=>{ + dialog.resolve = function(out) + { + moly.dialog.close(dialog.id); + resolve(out); + } + $(closebtn).click(()=>{ + moly.dialog.close(dialog.id); + resolve(false); + }); + }); + } + static close(id="") + { + let i = moly._dialogs.findIndex(e => e.id == id); //this.screens.findIndex(e=> e.id == id) + if(i >= 0) + { + $(moly._dialogs[i].box).css("scale",0); + setTimeout(() => { + $.each(moly._dialogs[i].beforeResolve, (i,v)=> + { + typeof v == "function" ? v() : false; + }); + moly._dialogs[i].screen.remove(); + moly._dialogs.splice(i,1); + }, 250); + } + } + static resolve(id = 0, data) + { + let i = moly._dialogs.findIndex(e => e.id == id); //this.screens.findIndex(e=> e.id == id) + if(i >= 0) + { + moly._dialogs[i].resolve(data); + } + } + } + alert = class { + static show(title = "Perhatian", messageHTML = "", timeOut = 0) + { + let alert = + { + id: Date.now() + Math.random().toString(16).slice(2), + screen: moly.newElement("alert-screen"), + box: moly.newElement("alert-box"), + title: moly.newElement("alert-title"), + message: moly.newElement("alert-text"), + handle: moly.newElement("alert-handle") + } + alert.screen.append(alert.box); + alert.box.append(alert.title); + alert.box.append(alert.message); + alert.box.append(alert.handle); + alert.title.innerText = title; + alert.message.innerHTML = messageHTML; + alert.message.setAttribute("title", alert.message.innerText); + if (timeOut >0 ) {alert.handle.innerText = `Tunggu ${timeOut} detik.`;} else {alert.handle.innerText = "Tutup";} + moly._alerts.push(alert); + $('body').append(alert.screen); + setTimeout(() => { + $(alert.box).css("scale",1); + }, 5); + setTimeout(() => { + if ( timeOut > 0) + { + let ms = timeOut * 1000; + let intv = setInterval(()=>{ + ms -= 1000; + if (ms <= 0) + { + moly.alert.close(alert.id); + clearInterval(intv); + return; + } + $(moly._alerts.findLast(()=>true).screen).find("alert-handle")[0].innerText = `Tunggu ${ms/1000} detik`; + },1000); + } + else + { + $(alert.handle).click(()=> + { + moly.alert.close(alert.id); + }) + } + }, 250); + } + static close(id = "") + { + let ix = moly._alerts.findIndex(e=> e.id == id) + if (ix >= 0) + { + $(moly._alerts[ix].box).css("scale",0); + setTimeout(()=>{ + moly._alerts[ix].screen.remove(); + moly._alerts.splice(ix,1); + }, 250); + } + } + } + confirm = class { + static show(title = "Anda Yakin?", messageHTML = "", yesLabel = "Yes", noLabel = "No", positiveYes = null, positiveNo = null) + { + let confirm = + { + id: Date.now() + Math.random().toString(16).slice(2), + screen: moly.newElement("confirm-screen"), + box: moly.newElement("confirm-box"), + title: moly.newElement("confirm-title"), + message: moly.newElement("confirm-text"), + handle: moly.newElement("confirm-handle"), + resolve: undefined + } + let yes = moly.newElement("a-button"); + let no = moly.newElement("a-button"); + confirm.screen.append(confirm.box); + confirm.box.append(confirm.title); + confirm.box.append(confirm.message); + confirm.box.append(confirm.handle); + confirm.title.innerText = title; + confirm.message.innerHTML = messageHTML; + confirm.message.setAttribute("title", confirm.message.innerText); + confirm.handle.append(yes); + confirm.handle.append(no); + yes.innerText = yesLabel; + no.innerText = noLabel; + if (positiveYes == true) + { + yes.setAttribute("type","positive"); + } + else if (positiveYes == false) + { + yes.setAttribute("type","negative"); + } + else + { + yes.setAttribute("type","blend"); + } + if (positiveNo == true) + { + no.setAttribute("type","positive"); + } + else if (positiveNo == false) + { + no.setAttribute("type","negative"); + } + else + { + no.setAttribute("type","blend"); + } + moly._confirms.push(confirm); + $('body').append(confirm.screen); + setTimeout(() => { + $(confirm.box).css("scale",1); + }, 5); + return new Promise((resolve,reject)=>{ + confirm.resolve = function(out) + { + moly.confirm.close(confirm.id); + resolve(out); + } + $(no).click(()=>{ + moly.confirm.close(confirm.id); + resolve(false); + }); + $(yes).click(()=>{ + moly.confirm.close(confirm.id); + resolve(true); + }); + }); + } + static close(id ="") + { + let i = moly._confirms.findIndex(e => e.id == id); //this.screens.findIndex(e=> e.id == id) + if(i >= 0) + { + $(moly._confirms[i].box).css("scale",0); + setTimeout(() => { + moly._confirms[i].screen.remove(); + moly._confirms.splice(i,1); + }, 250); + } + } + } + file = class { + static async crc32(file){ + let crc32Table = new Uint32Array(256).map((t, c) => { + for (let k = 0; k < 8; k++) { + c = c & 1 ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1); + } + return c >>> 0; + }); + const arrayBuffer = await file.arrayBuffer(); + const buf = new Uint8Array(arrayBuffer); + let crc = 0 ^ (-1); + for (let i = 0; i < buf.length; i++) { + crc = (crc >>> 8) ^ crc32Table[(crc ^ buf[i]) & 0xFF]; + } + return ((crc ^ (-1)) >>> 0).toString(16).padStart(8, '0').toUpperCase(); + }; + static async serialise(file = new File([],"")){ + let hash = await this.crc32(file); + const reader = new FileReader(); + return new Promise((resolve, reject) => { + reader.onload = function(event) { + const base64Data = event.target.result.split(',')[1]; + const fileData = { + name: file.name, + type: file.type, + data: base64Data, + crc32: hash + }; + resolve(fileData); + }; + reader.onerror = reject; + reader.readAsDataURL(file); + }); + }; + static deserialise(fileData){ + const byteCharacters = atob(fileData.data); + const byteNumbers = new Array(byteCharacters.length); + + for (let i = 0; i < byteCharacters.length; i++) { + byteNumbers[i] = byteCharacters.charCodeAt(i); + } + + const byteArray = new Uint8Array(byteNumbers); + const blob = new Blob([byteArray], { type: fileData.type }); + + const file = new File([blob], fileData.name, { type: fileData.type }); + return file; + } + } + AButton = class extends HTMLElement + { + static observedAttributes = ["disabled"]; + constructor() { + super(); + this.attachShadow({ mode: "open" }); // Attach Shadow DOM + this.shadowRoot.innerHTML = ` + + + `; + } + + get disabled() { + return this.hasAttribute("disabled"); + } + + set disabled(value) { + if (value) { + this.setAttribute("disabled", ""); + } else { + this.removeAttribute("disabled"); + } + } + } + FileInput = class extends HTMLElement + { + static observedAttributes = ["disabled", "accept", "multiple"]; + constructor() { + super(); + this.attachShadow({ mode: "open" }); // Attach Shadow DOM + this.shadowRoot.innerHTML = ` + + `; + this._input = document.createElement("input"); + this._input.type = "file"; + this._input.setAttribute("hidden",""); + this._handleChange = this._handleChange.bind(this); + this._handleClick = this._handleClick.bind(this); + this._label = document.createElement("div"); + } + connectedCallback() + { + this._input.addEventListener("change", this._handleChange); + this.shadowRoot.appendChild(this._input); + this.shadowRoot.appendChild(this._label); + this._label.innerText = "Click to select a file."; + this.addEventListener("click", this._handleClick); + if (this.getAttribute("accept")) + { + this._input.setAttribute("accept", this.accept); + this.accept = this.getAttribute("accept"); + } + if (this.hasAttribute("multiple")) + { + this._input.setAttribute("multiple", ""); + this.multiple = this.hasAttribute("multiple"); + this._label.innerText = "Click to select files."; + } + } + disconnectedCallback() { + this._input.removeEventListener("change", this._handleChange); + } + _handleChange(event) + { + if (this.hasAttribute("multiple") && this._input.files.length == 1) + { + this._label.innerText = `${this._input.files[0].name} selected.`; + } + else if (this.hasAttribute("multiple") && this._input.files.length > 1) + { + this._label.innerText = `${this._input.files.length} files selected.` + } + else if (this.hasAttribute("multiple")) + { + this._label.innerText = "Click to select files."; + } + else if (this._input.files.length == 1) + { + this._label.innerText = `${this._input.files[0].name} selected.`; + } + else + { + this._label.innerText = "Click to select a file."; + } + this.dispatchEvent(new CustomEvent("change", {bubble: true, composed: true, detail: this.files})); + } + _handleClick(event) + { + this._input.click(); + } + get disabled() { + return this.hasAttribute("disabled"); + } + + set disabled(value) { + if (value) { + this.setAttribute("disabled", ""); + } else { + this.removeAttribute("disabled"); + } + } + get files() { + return this._input.files; + } + + set accept(value) { + if (value) { + this._input.accept = value; + this.setAttribute("accept", value); // Keep the attribute in sync + } else { + this._input.removeAttribute("accept"); + this.removeAttribute("accept"); + } + } + + get accept() { + return this._input.accept; + } + + set multiple(value) { + if (value) { + this._input.setAttribute("multiple", ""); + this.setAttribute("multiple", ""); + this._label.innerText = "Click to select files."; + } else { + this._input.removeAttribute("multiple"); + this.removeAttribute("multiple"); + this._label.innerText = "Click to select a file."; + } + this._input.value = ""; + } + + get multiple() { + return this._input.hasAttribute("multiple"); + } + reset() + { + this._input.value = ""; + if (this.hasAttribute("multiple")) + { + this._label.innerText = "Click to select files."; + } + else + { + this._label.innerText = "Click to select a file."; + } + return this._input.files.length; + } + } + Group = class extends HTMLElement + { + static observedAttributes = ["label", "type", "collapsed"]; + constructor() + { + super(); + this.attachShadow({mode: "open"}); + this.shadowRoot.innerHTML = ` + + + + `; + this._labelText = $(this.shadowRoot).children("group-label").children("a-button").children("span"); + this._labelIcon = $(this.shadowRoot).children("group-label").children("a-button").children("m-inline"); + } + connectedCallback() + { + if (this.label && this.label.length > 0) + { + $(this.shadowRoot).children("group-label").children("a-button").children("span").text(this.label); + } + else + { + $(this.shadowRoot).children("group-label").children("a-button").children("span").text("Group Label"); + } + if (this.collapsed) + { + $(this.shadowRoot).children("group-label").children("a-button").children("m-inline").text("expand_more"); + } + else + { + $(this.shadowRoot).children("group-label").children("a-button").children("m-inline").text("expand_less"); + } + $(this.shadowRoot).children("group-label").children("a-button").click(()=> + { + this.collapsed = !this.collapsed; + }); + } + disconnectedCallback() + { + $(this.shadowRoot).children("group-label").children("a-button").off("click"); + } + attributeChangedCallback(name, oldValue, newValue) + { + if (name === "label") + { + if (this.label && this.label.length > 0) + { + this._labelText.text(this.label); + } + else + { + this._labelText.text("Group Label"); + } + } + else if (name === "collapsed") + { + if (this.collapsed) + { + this._labelIcon.text("expand_more"); + } + else + { + this._labelIcon.text("expand_less"); + } + } + } + get collapsed() { + return this.hasAttribute("collapsed"); + } + set collapsed(value) { + if (value) { + this.setAttribute("collapsed", ""); + } else { + this.removeAttribute("collapsed"); + } + } + get label() { + return this.getAttribute("label"); + } + set label(value) { + this.setAttribute("label", value.toString()); + } + get type() { + return this.getAttribute("type"); + } + set type(value) { + this.setAttribute("type", value.toString()); + } + } + VSpacer = class extends HTMLElement + { + static observedAttributes = ["lines"]; + constructor() + { + super(); + this.attachShadow({mode: "open"}); + this.shadowRoot.innerHTML = ` + +
+ `; + this._div = $(this.shadowRoot).children("div"); + } + connectedCallback(){ + this._applyHeight(); + } + attributeChangedCallback(name, oldValue, newValue) + { + if (name === "lines") + { + this._applyHeight(); + } + } + _applyHeight() + { + const height = (!this.lines || isNaN(this.lines)) ? 1 : this.lines + this._div.css("height",`${height}lh`); + } + get lines() { + return Number(this.getAttribute("lines")); + } + set lines(value) { + if (isNaN(value)) + { + this.setAttribute("lines", 1); + } + else + { + this.setAttribute("lines", Number(value)); + } + } + } + MultiLineEllipsis = class extends HTMLElement + { + static observedAttributes = ["lines"]; + constructor() + { + super(); + this.attachShadow({mode: "open"}); + this.shadowRoot.innerHTML = ` + +
+ `; + this._div = $(this.shadowRoot).children("div"); + this._slot = $(this.shadowRoot).find("slot"); + } + connectedCallback(){ + this._applyLineClamp(); + this.title = this.innerText; + this._slot.on("slotchange", ()=>{this.title = this.innerText;}); + } + attributeChangedCallback(name, oldValue, newValue) + { + if (name === "lines") + { + this._applyLineClamp(); + } + } + _applyLineClamp() + { + const lines = (!this.lines || isNaN(this.lines)) ? "1" : this.lines.toString(); + this._div.css({ + "line-clamp": lines, + "-webkit-line-clamp": lines + }); + } + get lines() { + return Number(this.getAttribute("lines")); + } + set lines(value) { + if (isNaN(value)) + { + this.setAttribute("lines", 1); + } + else + { + this.setAttribute("lines", Number(value)); + } + } + } + MidlineEllipsis = class extends HTMLElement + { + static observedAttributes = ["chars"]; + constructor() + { + super(); + this.attachShadow({mode: "open"}); + this.shadowRoot.innerHTML = ` + + + `; + } + connectedCallback(){ + this.title = this.innerText; + this._chars = Number(this.getAttribute("chars")); + this._chars > 5 ? 1==1 : this.chars = 5; + this._originalNodes = this.cloneNode(true); + this._applyEllipsis(); + this.addEventListener("click",()=>{ + moly.alert.show("Konten Lengkap",this._originalNodes.innerHTML); + }) + } + disconnectedCallback() + { + this.removeEventListener("click"); + } + _applyEllipsis() + { + let sourceNodes = this._originalNodes.cloneNode(true).childNodes; + let skip = ["a-button","button", "img"]; + let fhalftl = Math.ceil((this.chars-3)/2); + let lhalftl = Math.floor((this.chars-3)/2); + let fhalfl = 0; + let lhalfl = 0; + let fsearch = true; + let fpart = moly.newElement("span"); + let lpart = moly.newElement("span"); + let title = ""; + $.each(sourceNodes,(i,v)=>{ + if (skip.includes(v.nodeName.toLowerCase())) return; + title += v.textContent; + if(fsearch && v.textContent.length > 0 ) + { + if (fhalfl + v.textContent.length < fhalftl) + { + fpart.append(v.cloneNode(true)); + } + else + { + let remaining = fhalftl - fhalfl ; + let snode = v.cloneNode(true); + snode.textContent = snode.textContent.substring(0,remaining); + if(snode.textContent.length>0) fpart.append(snode); + fpart.append("..."); + fsearch = false; + } + fhalfl += v.textContent.length; + } + }); + this.title = title.replace(/\s+/g, ' ').trim(); + for (let i = sourceNodes.length - 1; i >= 0; i--) { + let v = sourceNodes[i]; + if (skip.includes(v.nodeName.toLowerCase())) continue; + if(v.textContent.length > 0 ) + { + if (lhalfl + v.textContent.length < lhalftl) + { + lpart.prepend(v.cloneNode(true)); + } + else + { + let remaining = lhalftl - lhalfl; + let snode = v.cloneNode(true); + snode.textContent = snode.textContent.substring(snode.textContent.length-remaining); + if(snode.textContent.length>0) lpart.prepend(snode); + break; + } + lhalfl += v.textContent.length; + } + } + fpart.innerHTML = fpart.innerHTML.trim(); + lpart.innerHTML = lpart.innerHTML.trim() + $(this).empty().append(...fpart.childNodes,...lpart.childNodes); + } + attributeChangedCallback(name, oldValue, newValue) + { + if (name === "chars") + { + if (this._originalNodes) this._applyEllipsis(); + } + } + get chars() { + let retval; + this._chars = Number(this.getAttribute("chars")); + this._chars > 5 ? retval = this._chars : retval = 5; + return retval; + } + set chars(value) { + if (isNaN(value)) + { + this._chars = 5 + this.setAttribute("chars", 5); + } + else + { + this._chars = Number(value); + this.setAttribute("chars", this._chars > 5 ? this.chars : 5); + } + } + } +} +(async ()=>{ + let time = 0 + while (typeof window.jQuery === "undefined" && time < 10000) { + await new Promise(resolve => setTimeout(resolve, 50)); + time +=50; + } + if (window.jQuery) + { + window.moly = new molybdenum(); + customElements.define("a-button",moly.AButton); + customElements.define("file-input",moly.FileInput); + customElements.define("group-el",moly.Group); + customElements.define("v-spacer",moly.VSpacer); + customElements.define("multi-ellipsis",moly.MultiLineEllipsis); + customElements.define("midline-ellipsis",moly.MidlineEllipsis); + } +})(); \ No newline at end of file diff --git a/index.html b/index.html index 8093cb0..8f1ca95 100644 --- a/index.html +++ b/index.html @@ -1,18 +1,254 @@ - + - Agen Perubahan - + + + + Agen Perubahan Admin Panel + + + + + + + + - - Agen Perubahan + + Memuat Aplikasi... + +
+ +
+ +
+ +
+ \ No newline at end of file diff --git a/login.html b/login.html new file mode 100644 index 0000000..dca8bc5 --- /dev/null +++ b/login.html @@ -0,0 +1,112 @@ + + + + + + + Agen Perubahan ATR/BPN Riau + + + + + + + + + + + + Memuat Aplikasi... +
+
+

Agen Perubahan ATR/BPN
Kantor Wilayah Provinsi Riau

+
+ person
+ passwordvisibility_on
+
+
+ +
+
+
+
+ Agen Perubahan ATR/BPN Kanwil Riau
+ Kementerian ATR/BPN Kantor Wilayah Provinsi Riau +
+ + + \ No newline at end of file diff --git a/modules/agen.html b/modules/agen.html new file mode 100644 index 0000000..e69de29 diff --git a/modules/dasbor.html b/modules/dasbor.html new file mode 100644 index 0000000..e69de29 diff --git a/modules/kegiatan.html b/modules/kegiatan.html new file mode 100644 index 0000000..e69de29 diff --git a/modules/laporan.html b/modules/laporan.html new file mode 100644 index 0000000..e69de29