2020-06-19 18:28:23 +00:00
|
|
|
{"version":3,"sources":["utils.js"],"names":["lsKeys","siBytes","page","prepareShareX","const","sharexElement","document","querySelector","headers","token","albumid","album","filelength","fileLength","age","uploadAge","striptags","stripTags","origin","window","location","hostname","pathname","replace","originClean","sharexConfObj","Name","DestinationType","RequestMethod","RequestURL","Headers","Body","FileFormName","URL","ThumbnailURL","DeletionURL","sharexConfStr","JSON","stringify","sharexBlob","Blob","type","setAttribute","createObjectURL","getPrettyDate","date","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getPrettyBytes","num","isFinite","si","localStorage","neg","scale","exponent","Math","min","floor","log","LOG10E","Number","pow","toPrecision","charAt","escape","string","str","String","match","exec","let","html","index","lastIndex","length","charCodeAt","substring"],"mappings":"AAGAA,OAAOC,QAAU,UAEjBC,KAAKC,cAAa,WAChBC,IAAMC,EAAgBC,SAASC,cAAc,WAC7C,GAAKF,EAAL,CAEAD,IAAMI,EAAU,GAEZN,KAAKO,QACPD,EAAQC,MAAQP,KAAKO,OAAS,GAC9BD,EAAQE,QAAUR,KAAKS,OAAS,IAGlCH,EAAQI,WAAaV,KAAKW,YAAc,GACxCL,EAAQM,IAAMZ,KAAKa,WAAa,GAChCP,EAAQQ,UAAYd,KAAKe,WAAa,GAEtCb,IAAMc,GAAUC,OAAOC,SAASC,SAAWF,OAAOC,SAASE,UAAUC,QAAQ,kBAAmB,IAC1FC,EAAcN,EAAOK,QAAQ,MAAO,KAEpCE,EAAgB,CACpBC,KAAMF,EACNG,gBAAiB,8BACjBC,cAAe,OACfC,WAAeV,OAAOC,SAAS,SAAQ,KAAKF,EAAM,cAClDY,QAAStB,EACTuB,KAAM,oBACNC,aAAc,UACdC,IAAK,sBACLC,aAAc,uBAGZhC,KAAKO,QACPgB,EAAcU,YAAc,6BAE9B/B,IAAMgC,EAAgBC,KAAKC,UAAUb,EAAe,KAAM,GACpDc,EAAa,IAAIC,KAAK,CAACJ,GAAgB,CAAEK,KAAM,6BAErDpC,EAAc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ACF,KAAK,GACHA,EAAS,QACT,MACF,KAAK,GACHA,EAAS,QACT,MACF,KAAK,GACHA,EAAS,OACT,MACF,KAAK,GACHA,EAAS,OACT,MACF,QACE,SAGAS,IAAcD,IAChBD,GAAQL,EAAIU,UAAUH,EAAWD,IAEnCC,EAAYD,EAAQ,EACpBD,GAAQP,EAGV,OAAOS,IAAcD,EACjBD,EAAOL,EAAIU,UAAUH,EAAWD,GAChCD","file":"utils.js","sourcesContent":["/* global lsKeys, page */\n\n// keys for localStorage\nlsKeys.siBytes = 'siBytes'\n\npage.prepareShareX = () => {\n const sharexElement = document.querySelector('#ShareX')\n if (!sharexElement) return\n\n const headers = {}\n\n if (page.token) {\n headers.token = page.token || ''\n headers.albumid = page.album || ''\n }\n\n headers.filelength = page.fileLength || ''\n headers.age = page.uploadAge || ''\n headers.striptags = page.stripTags || ''\n\n const origin = (window.location.hostname + window.location.pathname).replace(/\\/(dashboard)?$/, '')\n const originClean = origin.replace(/\\//g, '_')\n\n const sharexConfObj = {\n Name: originClean,\n DestinationType: 'ImageUploader, FileUploader',\n RequestMethod: 'POST',\n RequestURL: `${window.location.protocol}//${origin}/api/upload`,\n Headers: headers,\n Body: 'MultipartFromData',\n FileFormName: 'files[]',\n URL: '$json:files[0].url$',\n ThumbnailURL: '$json:files[0].url$'\n }\n\n if (page.token)\n sharexConfObj.DeletionURL = '$json:files[0].deleteUrl$'\n\n const sharexConfStr = JSON.stringify(sharexConfObj, null, 2)\n const sharexBlob = new Blob([sharexConfStr], { type: 'application/oc
|