filesafe/dist/js/misc/render.js.map
Bobby Wibowo 21f39dff9d
Updated
Updated axios to v0.18.1.
Also added its source map.

Updated lazyload to v12.0.0.
Also added its source map.

Added bulma's source map.

---

Moved fontello.css from public/libs/fontello to src/libs/fontello,
to make use of CSS builder.

Updated thumbnails styling to properly make sure the thumbnails are
displayed as 200x200 (their actual configured dimension).

Added fixes to some flexbox's bugs that affect IE 10/11.
The safe should display much better in those browsers now.

Show files' expiry dates in thumbs view.

Updated global error handlers in home.js.
I will do similar setup with dashboard.js in the future.
Just not now, I'm tired.

Only load renders after API request to /api/check has been initiated.

Used native lazyloading on album pages' nojs version.

Removed unnecessary is-expanded class.

Rephrased max upload size disclaimer in nojs uploader page.

Bumped v1 and v3 version strings.
2019-09-16 01:18:22 +07:00

1 line
5.8 KiB
Plaintext

{"version":3,"sources":["render.js"],"names":["lsKeys","render","page","renderType","renderConfig","al","name","root","array","miku","let","i","push","slice","config","doRenderSwal","const","div","document","createElement","innerHTML","localStorage","swal","content","buttons","confirm","then","value","newValue","querySelector","checked","undefined","removeItem","remove","doRender","getRenderVersion","renderScript","dataset","version","element","length","className","title","Math","floor","random","alt","src","classList","add","addEventListener","body","appendChild"],"mappings":"AAGAA,OAAOC,OAAS,SAEhBC,KAAKC,WAAa,OAClBD,KAAKE,aAAe,CAClBC,GAAI,CACFC,KAAM,cACNC,KAAM,aACNC,MAAO,CACL,0BACA,uBACA,cACA,eACA,eACA,cACA,cACA,cACA,cACA,gBACA,gBACA,oBACA,mBACA,iBACA,gBACA,gBACA,gBACA,kBACA,aACA,aACA,aACA,eACA,eACA,eACA,oBACA,kBACA,cACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,kBACA,kBACA,kBACA,mBAGJC,KAAM,CACJH,KAAM,WACNC,KAAM,eACNC,MAAO,KAKX,IAAKE,IAAIC,EAAI,EAAGA,GAAK,GAAIA,IACvBT,KAAKE,aAAaK,KAAKD,MAAMI,MAAS,KAAOD,GAAGE,OAAO,GAAE,Q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C,IAAI,UACtBV,EAAQW,iBAAiB,QAAShD,KAAKa,cACvCG,SAASiC,KAAKC,YAAYb","file":"render.js","sourcesContent":["/* global lsKeys, page, swal */\n\n// keys for localStorage\nlsKeys.render = 'render'\n\npage.renderType = 'miku'\npage.renderConfig = {\n al: {\n name: 'ship waifu~',\n root: 'render/al/',\n array: [\n 'admiral_graf_spee_1.png',\n 'admiral_hipper_1.png',\n 'akagi_1.png',\n 'akashi_1.png',\n 'akashi_2.png',\n 'atago_1.png',\n 'atago_3.png',\n 'atago_4.png',\n 'atago_5.png',\n 'belfast_2.png',\n 'choukai_1.png',\n 'deutschland_1.png',\n 'enterprise_1.png',\n 'glorious_1.png',\n 'hammann_1.png',\n 'hammann_2.png',\n 'hammann_3.png',\n 'hatsuharu_1.png',\n 'kaga_1.png',\n 'kaga_2.png',\n 'kaga_3.png',\n 'laffey_1.png',\n 'laffey_2.png',\n 'laffey_3.png',\n 'prinz_eugen_3.png',\n 'san_diego_1.png',\n 'takao_3.png',\n 'unicorn_1.png',\n 'unicorn_2.png',\n 'unicorn_3.png',\n 'unicorn_4.png',\n 'unicorn_6.png',\n 'unicorn_7.png',\n 'unicorn_8.png',\n 'yamashiro_1.png',\n 'yamashiro_2.png',\n 'yamashiro_3.png',\n 'yukikaze_1.png'\n ]\n },\n miku: {\n name: 'miku ❤️~',\n root: 'render/miku/',\n array: []\n }\n}\n\n// miku: Generate an array of file names from 001.png to 050.png\nfor (let i = 1; i <= 50; i++)\n page.renderConfig.miku.array.push(`${('00' + i).slice(-3)}.png`)\n\npage.config = null\npage.render = null\n\npage.doRenderSwal = () => {\n const div = document.createElement('div')\n div.innerHTML = `\n <div class=\"field\">\n <div class=\"control\">\n <label class=\"checkbox\">\n <input id=\"swalRender\" type=\"checkbox\" ${localStorage[lsKeys.render] === '0' ? '' : 'checked'}>\n Enable random render of ${page.config.name}\n </label>\n </div>\n <p class=\"help\">If disabled, you will still be able to see a small button on the bottom right corner of the screen to re-enable it.</p>\n </div>\n `\n\n swal({\n content: div,\n buttons: {\n confirm: true\n }\n }).then(value => {\n if (!value) return\n const newValue = div.querySelector('#swalRender').checked ? undefined : '0'\n if (newValue !== localStorage[lsKeys.render]) {\n if (newValue)\n localStorage[lsKeys.render] = newValue\n else\n localStorage.removeItem(lsKeys.render)\n swal('Success!', `Random render is now ${newValue ? 'disabled' : 'enabled'}.`, 'success')\n const element = document.querySelector('body > .render')\n element.remove()\n page.doRender()\n }\n })\n}\n\npage.getRenderVersion = () => {\n const renderScript = document.querySelector('#renderScript')\n if (renderScript && renderScript.dataset.version)\n return `?v=${renderScript.dataset.version}`\n return ''\n}\n\npage.doRender = () => {\n page.config = page.renderConfig[page.renderType]\n if (!page.config || !page.config.array.length) return\n\n let element\n if (localStorage[lsKeys.render] === '0') {\n element = document.createElement('a')\n element.className = 'button is-info is-hidden-mobile'\n element.title = page.config.name\n element.innerHTML = '<i class=\"icon-picture\"></i>'\n } else {\n // Let us just allow people to get new render when toggling the option\n page.render = page.config.array[Math.floor(Math.random() * page.config.array.length)]\n element = document.createElement('img')\n element.alt = element.title = page.config.name\n element.className = 'is-hidden-mobile'\n element.src = `${page.config.root}${page.render}${page.getRenderVersion()}`\n }\n\n element.classList.add('render')\n element.addEventListener('click', page.doRenderSwal)\n document.body.appendChild(element)\n}\n"]}