1 line
20 KiB
Plaintext
1 line
20 KiB
Plaintext
{"version":3,"file":"utility.min.js","sources":["../lib/utility/cookie.js","../lib/utility/request.js","../lib/utility/strings.js","../lib/utility/lgres.js","../lib/utility.js"],"sourcesContent":["function setCookie(name, value, expireDays) {\r\n if (name == null) {\r\n return;\r\n }\r\n let extra = `; domain=${location.host}; path=/`;\r\n if (expireDays != null) {\r\n const d = new Date();\r\n d.setTime(d.getTime() + (expireDays * 24 * 60 * 60 * 1000));\r\n extra += `; expires=${d.toGMTString()}`;\r\n }\r\n if (/^(https|wss):$/.test(location.protocol)) {\r\n extra += '; secure';\r\n }\r\n document.cookie = `${name}=${encodeURIComponent(value)}${extra}`;\r\n}\r\n\r\nfunction getCookie(name) {\r\n if (name == null) {\r\n return null;\r\n }\r\n name += '=';\r\n const cookies = document.cookie.split(';');\r\n for (let cookie of cookies) {\r\n cookie = cookie.trim();\r\n if (cookie.indexOf(name) === 0) {\r\n return decodeURIComponent(cookie.substring(name.length));\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nfunction deleteCookie(name) {\r\n setCookie(name, '', -1);\r\n}\r\n\r\nexport {\r\n getCookie,\r\n setCookie,\r\n deleteCookie\r\n}","function combineUrl(url) {\r\n if (/^(https?|wss?|ftp):/.test(url)) {\r\n return url;\r\n }\r\n if (typeof consts === 'undefined') {\r\n return url;\r\n }\r\n return (consts.path || '') + url;\r\n}\r\n\r\nfunction get(url, options = {}) {\r\n return fetch(combineUrl(url), {\r\n method: options.method || 'GET',\r\n headers: {\r\n ...options.customerHeaders,\r\n 'Accept': options.accept || 'application/json'\r\n },\r\n signal: options.signal,\r\n cache: 'default'\r\n });\r\n}\r\n\r\nfunction post(url, data, options = {}) {\r\n // let contentType;\r\n if (data instanceof FormData) {\r\n // contentType = 'multipart/form-data';\r\n } else {\r\n if (typeof data !== 'string') {\r\n data = JSON.stringify(data);\r\n }\r\n // contentType = 'application/json';\r\n if (options.customerHeaders == null) {\r\n options.customerHeaders = {};\r\n }\r\n if (options.customerHeaders['Content-Type'] == null) {\r\n options.customerHeaders['Content-Type'] = 'application/json';\r\n }\r\n }\r\n return fetch(combineUrl(url), {\r\n method: options.method || 'POST',\r\n headers: options.customerHeaders,\r\n body: data,\r\n signal: options.signal,\r\n cache: 'no-cache'\r\n });\r\n}\r\n\r\nfunction upload(url, data, options = {}) {\r\n return new Promise((resolve, reject) => {\r\n const request = new XMLHttpRequest();\r\n request.onreadystatechange = function () {\r\n if (this.readyState === XMLHttpRequest.DONE) {\r\n if (this.status === 200) {\r\n resolve(this);\r\n } else {\r\n reject(`${this.status} ${this.statusText}: ${this.responseText}`);\r\n }\r\n }\r\n };\r\n if (typeof options.progress === 'function') {\r\n request.upload.addEventListener('progress', function (ev) {\r\n if (ev.lengthComputable) {\r\n options.progress.call(this, ev);\r\n }\r\n }, false);\r\n }\r\n request.open('POST', combineUrl(url));\r\n if (options.customerHeaders != null) {\r\n for (let header of Object.entries(options.customerHeaders)) {\r\n request.setRequestHeader(header[0], header[1]);\r\n }\r\n }\r\n request.send(data);\r\n });\r\n}\r\n\r\nexport {\r\n get,\r\n post,\r\n upload\r\n}","function nullOrEmpty(s) {\r\n return s == null || typeof s !== 'string' || s.length === 0;\r\n}\r\n\r\nfunction contains(s, key, ignoreCase) {\r\n if (nullOrEmpty(s) || key == null) {\r\n return false;\r\n }\r\n if (typeof key !== 'string') {\r\n key = String(key);\r\n }\r\n if (ignoreCase) {\r\n return s.toLowerCase().indexOf(key.toLowerCase()) >= 0;\r\n }\r\n return s.indexOf(key) >= 0;\r\n}\r\n\r\nfunction endsWith(s, suffix) {\r\n if (nullOrEmpty(s) || nullOrEmpty(suffix)) {\r\n return false;\r\n }\r\n return s.indexOf(suffix) === s.length - suffix.length;\r\n}\r\n\r\nfunction padStart(s, num, char) {\r\n if (nullOrEmpty(s) || isNaN(num) || num <= s.length) {\r\n return s;\r\n }\r\n return (char ?? ' ').repeat(num - s.length);\r\n}\r\n\r\nfunction formatUrl(msg) {\r\n //const urlReg = /(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?/ig;\r\n //const urlArrray = str.match(urlReg);\r\n const p = /(http|ftp|https):\\/\\/.+?(\\s|\\r\\n|\\r|\\n|\\\"|\\'|\\*|$)/g;\r\n const r = msg.match(p);\r\n msg = escapeHtml(msg);\r\n\r\n if (r?.length > 0) {\r\n const rs = [];\r\n for (let t of r) {\r\n t = t.replace(/[\"'\\r\\n ]/g, '');\r\n if (rs.indexOf(t) < 0) {\r\n rs.push(t);\r\n }\r\n }\r\n\r\n for (let r of rs) {\r\n msg = msg.replaceAll(r, '<a target=\"_blank\" href=\"' + r + '\"><svg><use xlink:href=\"' + ((typeof consts !== 'undefined' && consts.path) || '') + 'fonts/fa-regular.svg#link\"></use></svg></a>');\r\n }\r\n }\r\n\r\n return msg;\r\n}\r\n\r\nfunction escapeHtml(text) {\r\n if (text == null) {\r\n return '';\r\n }\r\n return String(text)\r\n .replaceAll('&', '&')\r\n .replaceAll('<', '<')\r\n .replaceAll('>', '>')\r\n .replaceAll('\\r\\n', '<br/>')\r\n .replaceAll('\\n', '<br/>')\r\n .replaceAll(' ', ' ');\r\n}\r\n\r\nexport {\r\n nullOrEmpty,\r\n contains,\r\n endsWith,\r\n padStart,\r\n formatUrl,\r\n escapeHtml\r\n}","import { getCookie } from \"./cookie\";\r\nimport { get } from \"./request\";\r\nimport { nullOrEmpty } from \"./strings\";\r\n\r\nlet cache;\r\n\r\nfunction getCurrentLgId() {\r\n let lgid;\r\n if (typeof consts !== 'undefined') {\r\n lgid = getCookie(consts.cookie?.lang);\r\n if (nullOrEmpty(lgid)) {\r\n lgid = consts.user?.language;\r\n }\r\n }\r\n if (nullOrEmpty(lgid)) {\r\n lgid = getCookie('lgid');\r\n }\r\n if (nullOrEmpty(lgid)) {\r\n lgid = navigator.language || 'en-us';\r\n }\r\n lgid = lgid.toLowerCase().replace(/-/g, '_');\r\n if (nullOrEmpty(lgid)) {\r\n lgid = 'en';\r\n }\r\n switch (lgid) {\r\n case 'en':\r\n case 'en_au':\r\n case 'fr':\r\n case 'zh_cn':\r\n return lgid;\r\n }\r\n const lang = lgid.split('_')[0];\r\n switch (lang) {\r\n case 'en':\r\n case 'fr':\r\n return lang;\r\n }\r\n return 'en';\r\n}\r\n\r\nfunction getStorageKey(lgid) {\r\n if (typeof consts !== 'undefined') {\r\n return (consts.prefix || '') + `res_${lgid}`;\r\n }\r\n return `res_${lgid}`;\r\n}\r\n\r\nasync function doRefreshLgres(template = '') {\r\n const lgid = getCurrentLgId();\r\n const r = await get(`language/${lgid}${template}`);\r\n const dict = await r.json();\r\n localStorage.setItem(getStorageKey(lgid), JSON.stringify(dict));\r\n return dict;\r\n}\r\n\r\nasync function refreshLgres(template, lgres) {\r\n if (lgres == null || typeof consts === 'undefined') {\r\n lgres = await doRefreshLgres(template);\r\n }\r\n const ver = Number(consts.resver);\r\n if (isNaN(lgres.ver) || isNaN(ver) || ver > lgres.ver) {\r\n console.log(`found new language res version: ${lgres.ver} => ${ver}`);\r\n lgres = await doRefreshLgres(template);\r\n }\r\n Object.defineProperty(lgres, 'r', {\r\n writable: false,\r\n configurable: false,\r\n enumerable: false,\r\n value: function (key, defaultValue) {\r\n return getLanguage(this, key, defaultValue);\r\n }\r\n });\r\n cache = lgres;\r\n return lgres;\r\n}\r\n\r\nfunction getLanguage(lgres, key, defaultValue) {\r\n let value = lgres[key];\r\n return value ?? defaultValue;\r\n}\r\n\r\nfunction applyLanguage(dom, result) {\r\n for (let text of dom.querySelectorAll('[data-lgid]')) {\r\n const key = text.dataset.lgid;\r\n if (text.tagName === 'INPUT') {\r\n text.value = getLanguage(result, key, text.value);\r\n } else {\r\n text.innerText = getLanguage(result, key, text.innerText);\r\n }\r\n }\r\n for (let title of dom.querySelectorAll('[data-title-lgid]')) {\r\n const key = title.dataset.titleLgid;\r\n title.setAttribute('title', getLanguage(result, key, title.getAttribute('title')));\r\n }\r\n for (let holder of dom.querySelectorAll('[data-placeholder-lgid]')) {\r\n const key = holder.dataset.placeholderLgid;\r\n holder.setAttribute('placeholder', getLanguage(result, key, holder.getAttribute('placeholder')));\r\n }\r\n}\r\n\r\nasync function init(dom = document.body, options = {}) {\r\n const lgid = getCurrentLgId();\r\n let lgres = localStorage.getItem(getStorageKey(lgid));\r\n let result;\r\n if (lgres != null) {\r\n try {\r\n lgres = JSON.parse(lgres);\r\n result = await refreshLgres(options.template, lgres);\r\n } catch (e) {\r\n console.error('error while parsing lgres, try refresh ...', e);\r\n result = await refreshLgres(options.template);\r\n }\r\n } else {\r\n result = await refreshLgres(options.template);\r\n }\r\n\r\n try {\r\n if (document.readyState === 'loading') {\r\n return await new Promise((resolve, reject) => {\r\n let tid = setTimeout(() => reject('timeout'), 30000);\r\n document.addEventListener('DOMContentLoaded', () => {\r\n clearTimeout(tid);\r\n tid = void 0;\r\n if (typeof options.callback === 'function') {\r\n options.callback(result);\r\n }\r\n applyLanguage(dom, result);\r\n resolve(result);\r\n });\r\n });\r\n }\r\n if (typeof options.callback === 'function') {\r\n options.callback(result);\r\n }\r\n applyLanguage(dom, result);\r\n return result;\r\n } catch (err) {\r\n console.error('error while loading language res ...', err);\r\n }\r\n}\r\n\r\nfunction r(key, defaultValue) {\r\n if (cache != null) {\r\n return getLanguage(cache, key, defaultValue);\r\n }\r\n return defaultValue;\r\n}\r\n\r\nconst lang = {\r\n get current() {\r\n return getCurrentLgId();\r\n },\r\n get unknownError() {\r\n return r('unknownError', 'An unknown error occurred, please contact the administrator.');\r\n },\r\n get savedSuccessfully() {\r\n return r('savedSuccessfully', 'Saved successfully.');\r\n }\r\n}\r\n\r\nexport {\r\n init,\r\n r,\r\n lang\r\n}","import { getCookie, setCookie, deleteCookie } from \"./utility/cookie\";\r\nimport { init, r, lang } from \"./utility/lgres\";\r\nimport { get, post, upload } from \"./utility/request\";\r\nimport { nullOrEmpty, contains, endsWith, padStart, formatUrl, escapeHtml } from \"./utility/strings\";\r\n\r\nlet g = typeof globalThis !== 'undefined' ? globalThis : self;\r\n\r\nfunction isPositive(n) {\r\n return !isNaN(n) && n > 0;\r\n}\r\n\r\nfunction isMobile() {\r\n return /mobile/i.test(navigator.userAgent);\r\n}\r\n\r\nfunction throttle(method, delay = 100, context = g, ...args) {\r\n if (method == null) {\r\n return;\r\n }\r\n method.tiid && clearTimeout(method.tiid);\r\n const current = new Date();\r\n if (method.tdate == null || current - method.tdate > delay) {\r\n method.apply(context, args);\r\n method.tdate = current;\r\n } else {\r\n method.tiid = setTimeout(() => method.apply(context, args), delay);\r\n }\r\n}\r\n\r\nfunction debounce(method, delay = 100, context = g, ...args) {\r\n if (method == null) {\r\n return;\r\n }\r\n method.tiid && clearTimeout(method.tiid);\r\n method.tiid = setTimeout(() => method.apply(context, args), delay);\r\n}\r\n\r\nfunction truncate(v) {\r\n return (v > 0 ? Math.floor : Math.ceil)(v);\r\n}\r\n\r\nfunction isEmail(text) {\r\n return /^\\w[-\\w.+]*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/.test(text);\r\n}\r\n\r\nfunction isPhone(text) {\r\n return /^[1-9]\\d{9,}$/.test(text);\r\n}\r\n\r\nexport {\r\n // cookie\r\n getCookie,\r\n setCookie,\r\n deleteCookie,\r\n // lgres\r\n init,\r\n r,\r\n lang,\r\n // request\r\n get,\r\n post,\r\n upload,\r\n // strings\r\n nullOrEmpty,\r\n contains,\r\n endsWith,\r\n padStart,\r\n formatUrl,\r\n escapeHtml,\r\n // variables\r\n g as global,\r\n isPositive,\r\n isMobile,\r\n // functions\r\n throttle,\r\n debounce,\r\n truncate,\r\n isEmail,\r\n isPhone\r\n}"],"names":["setCookie","name","value","expireDays","extra","d","getCookie","cookies","cookie","deleteCookie","combineUrl","url","get","options","post","data","upload","resolve","reject","request","ev","header","nullOrEmpty","s","contains","key","ignoreCase","endsWith","suffix","padStart","num","char","formatUrl","msg","p","r","escapeHtml","rs","t","text","cache","getCurrentLgId","lgid","_a","_b","lang","getStorageKey","doRefreshLgres","template","dict","refreshLgres","lgres","ver","defaultValue","getLanguage","applyLanguage","dom","result","title","holder","init","e","tid","err","g","isPositive","n","isMobile","throttle","method","delay","context","args","current","debounce","truncate","v","isEmail","isPhone"],"mappings":"sOAAA,SAASA,EAAUC,EAAMC,EAAOC,EAAY,CACxC,GAAIF,GAAQ,KACR,OAEJ,IAAIG,EAAQ,YAAY,SAAS,eACjC,GAAID,GAAc,KAAM,CACpB,MAAME,EAAI,IAAI,KACdA,EAAE,QAAQA,EAAE,UAAaF,EAAa,GAAK,GAAK,GAAK,GAAK,EAC1DC,GAAS,aAAaC,EAAE,YAAW,IAEnC,iBAAiB,KAAK,SAAS,QAAQ,IACvCD,GAAS,YAEb,SAAS,OAAS,GAAGH,KAAQ,mBAAmBC,CAAK,IAAIE,GAC7D,CAEA,SAASE,EAAUL,EAAM,CACrB,GAAIA,GAAQ,KACR,OAAO,KAEXA,GAAQ,IACR,MAAMM,EAAU,SAAS,OAAO,MAAM,GAAG,EACzC,QAASC,KAAUD,EAEf,GADAC,EAASA,EAAO,OACZA,EAAO,QAAQP,CAAI,IAAM,EACzB,OAAO,mBAAmBO,EAAO,UAAUP,EAAK,MAAM,CAAC,EAG/D,OAAO,IACX,CAEA,SAASQ,EAAaR,EAAM,CACxBD,EAAUC,EAAM,GAAI,EAAE,CAC1B,CCjCA,SAASS,EAAWC,EAAK,CAIrB,MAHI,sBAAsB,KAAKA,CAAG,GAG9B,OAAO,OAAW,IACXA,GAEH,OAAO,MAAQ,IAAMA,CACjC,CAEA,SAASC,EAAID,EAAKE,EAAU,GAAI,CAC5B,OAAO,MAAMH,EAAWC,CAAG,EAAG,CAC1B,OAAQE,EAAQ,QAAU,MAC1B,QAAS,CACL,GAAGA,EAAQ,gBACX,OAAUA,EAAQ,QAAU,kBAC/B,EACD,OAAQA,EAAQ,OAChB,MAAO,SACf,CAAK,CACL,CAEA,SAASC,EAAKH,EAAKI,EAAMF,EAAU,CAAA,EAAI,CAEnC,OAAIE,aAAgB,WAGZ,O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