관리-도구
편집 파일: discount-notice.js.map
{"mappings":"6DAAO,MAMMA,EAAa,CACzBC,EACAC,EACAC,KAEA,GAAIF,EAAGG,QAAQF,GACd,OAAOD,EAGR,GAAmB,SAAfA,EAAGI,SAAqC,SAAfJ,EAAGI,QAC/B,OAGD,IAAIC,EACJH,EAAQA,GAAgB,GAExB,IAAK,IAAII,EAAI,EAAGA,EAAIJ,EAAOI,IAAK,CAC/B,MAAMC,EAAaP,EAAGO,WAEtB,IACEA,GACsB,SAAvBA,EAAWH,SACY,SAAvBG,EAAWH,QAEX,MAGD,GAAIG,EAAWJ,QAAQF,GACtB,OAAOM,EAGRP,EAAKO,CACN,CAEA,OAAOF,CAAA,E,MCxCRG,EAAeC,OCKd,WASA,SAASC,EAAQC,GAChB,MAAMC,EAASb,EAAWc,KAAM,0BAChC,IAAKD,EAAQ,OACb,IAAIE,EAAQF,EAAOG,QAAQC,aAC3BF,EAAQA,GAAgB,GAExBG,EAAAT,GACEU,KAAK,CACLC,IAAKC,QACLC,KAAM,OACNC,KAAM,CACLC,OAAQ,gCACRT,MAAOA,EACPJ,QAAS,KAGVc,QAAO,SAAUC,GACbA,EAAEC,SAASC,QAAQC,IAAIH,EAAEH,KAC9B,GACF,CA1BCL,EAAAT,EAAA,CAAOqB,UAAUC,GAChB,QACA,wDACApB,EA0BH,CA/BC,E","sources":["kirki-packages/settings/src/utils.ts","jQuery.js","kirki-packages/settings/src/discount-notice.ts"],"sourcesContent":["export const emptyElement = (el: HTMLElement) => {\n\twhile (el.firstChild) {\n\t\tel.removeChild(el.firstChild);\n\t}\n};\n\nexport const getClosest = (\n\tel: HTMLElement,\n\tselector: string,\n\tdepth?: number\n): HTMLElement | undefined => {\n\tif (el.matches(selector)) {\n\t\treturn el;\n\t}\n\n\tif (el.tagName === \"BODY\" || el.tagName === \"HTML\") {\n\t\treturn undefined;\n\t}\n\n\tlet closest = undefined;\n\tdepth = depth ? depth : 20;\n\n\tfor (let i = 0; i < depth; i++) {\n\t\tconst parentNode = el.parentNode as HTMLElement;\n\n\t\tif (\n\t\t\t!parentNode ||\n\t\t\tparentNode.tagName === \"BODY\" ||\n\t\t\tparentNode.tagName === \"HTML\"\n\t\t) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (parentNode.matches(selector)) {\n\t\t\treturn parentNode;\n\t\t}\n\n\t\tel = parentNode;\n\t}\n\n\treturn closest;\n};\n\nexport const startLoading = (button: HTMLButtonElement | HTMLElement) => {\n\tbutton.classList.add(\"is-loading\");\n};\n\nexport const stopLoading = (button: HTMLButtonElement | HTMLElement) => {\n\tbutton.classList.remove(\"is-loading\");\n};\n","module.exports=jQuery;","import { getClosest } from \"./utils\";\r\nimport jQuery from \"jquery\";\r\n\r\ndeclare var ajaxurl: string;\r\n\r\n(function () {\r\n\tfunction init() {\r\n\t\tjQuery(document).on(\r\n\t\t\t\"click\",\r\n\t\t\t\".kirki-discount-notice.is-dismissible .notice-dismiss\",\r\n\t\t\tdismiss\r\n\t\t);\r\n\t}\r\n\r\n\tfunction dismiss(e: JQuery.ClickEvent) {\r\n\t\tconst notice = getClosest(this, \".kirki-discount-notice\");\r\n\t\tif (!notice) return;\r\n\t\tlet nonce = notice.dataset.dismissNonce;\r\n\t\tnonce = nonce ? nonce : \"\";\r\n\r\n\t\tjQuery\r\n\t\t\t.ajax({\r\n\t\t\t\turl: ajaxurl,\r\n\t\t\t\ttype: \"post\",\r\n\t\t\t\tdata: {\r\n\t\t\t\t\taction: \"kirki_dismiss_discount_notice\",\r\n\t\t\t\t\tnonce: nonce,\r\n\t\t\t\t\tdismiss: 1,\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t\t.always(function (r) {\r\n\t\t\t\tif (r.success) console.log(r.data);\r\n\t\t\t});\r\n\t}\r\n\r\n\tinit();\r\n})();\r\n"],"names":["$f448701b1a546a82$export$211731fc355e9121","el","selector","depth","matches","tagName","closest","i","parentNode","$0a2eb9defebd2c69$exports","jQuery","dismiss","e","notice","this","nonce","dataset","dismissNonce","$parcel$interopDefault","ajax","url","ajaxurl","type","data","action","always","r","success","console","log","document","on"],"version":3,"file":"discount-notice.js.map"}