appscms-tools-theme 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_data/calculators/en/biology-calc/bulb-spacing.json +79 -1
- data/_data/calculators/en/biology-calc/cat-chocolate-toxicity.json +53 -1
- data/_data/calculators/en/chemistry-calc/activation-energy.json +45 -1
- data/_data/feature/en/allele-frequency.json +242 -242
- data/_data/feature/en/batch-conversion.json +78 -0
- data/_data/feature/en/compress-pdf.json +11 -5
- data/_data/feature/en/theframe.json +64 -64
- data/_data/photo-categories.json +10 -10
- data/_includes/batch-conversion.html +70 -0
- data/_includes/monumetric/ads.html +57 -57
- data/_includes/monumetric/profitablecpmgate.html +51 -51
- data/_layouts/batch.html +97 -0
- data/_layouts/calculator.html +69 -69
- data/_layouts/frame.html +128 -128
- data/assets/css/batch.css +423 -0
- data/assets/css/calculators.css +40 -40
- data/assets/css/frame.css +431 -431
- data/assets/images/add-image.png +0 -0
- data/assets/images/add.png +0 -0
- data/assets/images/cloud-computing.png +0 -0
- data/assets/images/convert.png +0 -0
- data/assets/images/download.png +0 -0
- data/assets/images/file.png +0 -0
- data/assets/images/safeimagekit. (2).png +0 -0
- data/assets/images/safeimagekit. (3).png +0 -0
- data/assets/images/safeimagekit..png +0 -0
- data/assets/images/safeimagekit.png +0 -0
- data/assets/images/spinner.gif +0 -0
- data/assets/images/trust.svg +1 -0
- data/assets/images/vectorpaint.svg +6 -0
- data/assets/js/ads.js +8 -8
- data/assets/js/append-div.js +10 -10
- data/assets/js/batch.js +190 -0
- data/assets/js/frame.js +251 -251
- data/assets/js/photo-effects.json +55 -55
- data/assets/js/testing-batch.js +36 -0
- data/assets/js/theme.js +11 -11
- metadata +26 -7
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg id="Capa_1" enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><g><path d="m408.42 213.557c-.581.3-1.235.458-1.893.458s-1.313-.159-1.894-.458c-49.456-25.54-79.495-65.46-86.293-113.851-27.401-13.379-58.188-20.897-90.734-20.897-114.36 0-207.066 92.707-207.066 207.066s92.707 207.066 207.066 207.066 207.066-92.707 207.066-207.066c0-27.738-5.468-54.195-15.362-78.371-3.519 2.097-7.145 4.119-10.89 6.053z" fill="#d8ecfe"/><g><g><path d="m57.701 343.045c2.901-2.901 7.604-2.901 10.505 0l3.018 3.018c-5.778-19.048-8.898-39.252-8.898-60.188 0-107.307 81.626-195.547 186.174-206.022-6.871-.688-13.84-1.044-20.893-1.044-114.36 0-207.066 92.707-207.066 207.066 0 27.9 5.531 54.504 15.535 78.795z" fill="#c4e2ff"/></g></g><g><path d="m321.188 360.306c-11.462 11.461-26.702 17.774-42.909 17.774-.747 0-1.496-.014-2.245-.042l-14.704-.543c-.775-.028-1.547-.042-2.319-.042-11.381 0-22.296 3.02-31.84 8.669l59.088 59.088 92.922-92.922-24.987-24.987z" fill="#ffe5c2"/><path d="m275.997 379.038-14.705-.544c-11.802-.436-23.362 2.526-33.378 8.372l57.636 57.636 32.075-32.075-33.633-33.633c-2.643.247-5.311.344-7.995.244z" fill="#fed2a4"/><g><path d="m312.176 509.824-40.721-40.721c-2.901-2.901-2.901-7.604 0-10.505l115.554-115.554c2.901-2.901 7.604-2.901 10.505 0l40.721 40.721c2.901 2.901 2.901 7.604 0 10.505l-115.554 115.554c-2.901 2.901-7.604 2.901-10.505 0z" fill="#fe646f"/></g><g><path d="m314.715 469.104c-2.901-2.901-2.901-7.604 0-10.505l99.177-99.177-16.377-16.378c-2.901-2.901-7.604-2.901-10.505 0l-115.555 115.555c-2.901 2.901-2.901 7.604 0 10.505l40.721 40.721c2.901 2.901 7.604 2.901 10.505 0l16.377-16.378z" fill="#fd4755"/></g><path d="m392.295 260.223c-7.089-7.579-18.123-9.061-26.755-4.444-.864.462-1.823-.462-1.36-1.325 4.518-8.423 3.223-19.141-3.884-26.247-7.105-7.105-17.82-8.401-26.242-3.887-.852.457-1.797-.488-1.34-1.34 4.514-8.422 3.218-19.136-3.887-26.242-7.107-7.107-17.825-8.401-26.248-3.884-.863.463-1.787-.496-1.325-1.36 4.624-8.645 3.131-19.701-4.48-26.789-8.829-8.223-22.729-7.591-31.261.941l-1.951 1.951-1.679.265-27.012 27.011.184 1.23 16.349 16.349c4.247 4.247 6.784 10.011 6.622 16.015-.157 5.809-2.609 11.171-6.911 15.111-3.802 3.48-8.796 5.396-14.063 5.396-.001 0-.001 0-.002 0-5.866 0-11.62-2.39-15.786-6.555l-1.414 1.414 5.968 5.968c3.977 3.977 6.455 9.294 6.573 14.917.147 7.029-3.073 13.548-8.892 17.769-2.727 1.978-5.929 3.264-9.265 3.731-6.805.952-13.381-1.273-18.116-6.008l-10.273-10.273-1.414 1.414c5.007 5.007 7.201 12.05 5.817 19.261-.48 2.501-1.434 4.907-2.81 7.05-4.439 6.915-12.009 10.581-19.955 9.882-5.093-.448-9.819-2.85-13.434-6.466l-11.984-11.984-1.418 1.418c4.403 4.453 6.603 10.488 6.06 16.82-.338 3.941-1.783 7.746-4.179 10.893-4.13 5.425-10.347 8.474-16.99 8.474-5.635 0-10.934-2.184-14.937-6.142l-33.149 33.149 90.376 90.376 47.563-47.563c12.128-12.128 28.758-18.659 45.899-18.026l14.705.544c17.14.634 33.77-5.897 45.898-18.025l69.457-69.457c8.554-8.551 9.206-22.5.945-31.332z" fill="#d88a55"/><g fill="#c57a44"><path d="m252.52 212.151c3.786 3.786 5.904 8.597 6.391 13.539l44.954-44.954c-.067-5.605-2.228-11.19-6.505-15.467-8.69-8.69-22.779-8.69-31.468 0l-30.127 30.127z"/><path d="m147.977 336.624 29.513-29.512c-7.984 3.109-17.388 1.433-23.82-5l-12.31-12.31-.005.005c8.698 8.793 8.562 23.003-.331 31.622-8.697 8.429-22.528 8.344-31.128-.162l-31.735 31.733 90.376 90.376 28.528-28.527-49.088-49.087c-8.046-8.046-8.046-21.092 0-29.138z"/></g><path d="m252.52 212.151-51.568-51.568c-8.69-8.69-22.779-8.69-31.468 0-8.69 8.69-8.69 22.779 0 31.468-8.69-8.69-22.778-8.69-31.468 0-8.69 8.69-8.69 22.779 0 31.468-8.69-8.69-22.779-8.69-31.469 0s-8.69 22.779 0 31.468l9.631 9.631c-8.69-8.69-22.778-8.69-31.468 0s-8.69 22.779 0 31.468l25.096 25.096c8.594 8.594 22.492 8.703 31.22.245 8.923-8.647 9.035-22.927.249-31.713l12.397 12.397c8.594 8.594 22.492 8.703 31.22.245 8.923-8.647 9.035-22.927.249-31.713l10.274 10.273c8.594 8.594 22.492 8.703 31.22.245 8.923-8.647 9.035-22.927.249-31.713l-6.322-6.322c8.5 8.499 22.368 9.306 31.234 1.189 9.407-8.615 9.65-23.238.724-32.164z" fill="#ffe5c2"/><g><path d="m242.046 150.992h-39.732c-6.724 0-12.175 5.451-12.175 12.175v5.054c0 15.063 12.211 27.274 27.274 27.274l18.352-.098 27.799-27.8c-2.497-9.54-11.168-16.605-21.518-16.605z" fill="#ffbd86"/></g><g><path d="m239.808 234.058-51.075-51.075c-7.872-7.872-8.588-20.162-2.197-28.868-6.126-.362-12.373 1.787-17.053 6.468-8.69 8.69-8.69 22.778 0 31.468l51.075 51.075c8.5 8.5 22.368 9.307 31.234 1.19 1.167-1.069 2.179-2.237 3.058-3.471-5.489-.349-10.902-2.648-15.042-6.787z" fill="#fed2a4"/><g><path d="m216.984 270.086-57.397-57.397c-7.327-7.327-8.45-18.481-3.422-27.012-6.471-.703-13.19 1.414-18.15 6.374-8.69 8.69-8.69 22.779 0 31.468l57.397 57.397c8.594 8.594 22.493 8.703 31.22.245 1.471-1.425 2.678-3.014 3.669-4.695-4.867-.529-9.591-2.654-13.317-6.38z" fill="#fed2a4"/></g><g><path d="m174.746 291.72-47.124-47.124c-7.462-7.462-8.497-18.896-3.144-27.483-6.403-.632-13.028 1.501-17.933 6.406-8.69 8.69-8.69 22.779 0 31.469l47.124 47.124c8.594 8.594 22.492 8.703 31.22.245 1.335-1.293 2.447-2.724 3.388-4.232-4.942-.489-9.75-2.624-13.531-6.405z" fill="#fed2a4"/></g><g><path d="m131.026 310.84-25.096-25.096c-7.469-7.469-8.499-18.919-3.129-27.508-6.453-.684-13.147 1.437-18.093 6.383-8.69 8.69-8.69 22.779 0 31.468l25.096 25.096c8.594 8.594 22.492 8.702 31.22.245 1.325-1.284 2.432-2.703 3.368-4.2-4.884-.52-9.628-2.649-13.366-6.388z" fill="#fed2a4"/></g></g><g><path d="m183.76 469.104-40.721 40.721c-2.901 2.901-7.604 2.901-10.505 0l-115.554-115.555c-2.901-2.901-2.901-7.604 0-10.505l40.721-40.721c2.901-2.901 7.604-2.901 10.505 0l115.554 115.555c2.901 2.901 2.901 7.604 0 10.505z" fill="#97d729"/></g><g><path d="m59.351 394.27c-2.901-2.901-2.901-7.604 0-10.505l24.788-24.788-15.933-15.933c-2.901-2.901-7.604-2.901-10.505 0l-40.721 40.721c-2.901 2.901-2.901 7.604 0 10.505l115.554 115.554c2.901 2.901 7.604 2.901 10.505 0l15.933-15.933z" fill="#8bc727"/></g></g><g><g><path d="m406.527 0c-26.888 0-52.254 26.844-74.646 19.542-2.619-.854-5.45.608-6.382 3.2-6.231 17.328-9.64 36.001-9.64 55.475 0 63.284 35.836 109.127 88.317 136.229 1.471.76 3.233.76 4.704 0 52.481-27.102 88.317-72.945 88.317-136.229 0-19.474-3.41-38.147-9.64-55.475-.932-2.592-3.763-4.054-6.382-3.2-22.394 7.302-47.761-19.542-74.648-19.542z" fill="#fed402"/></g><g><path d="m393.086 156.285c-27.157-6.139-47.503-30.446-47.503-59.432 0-15.04 5.487-28.814 14.55-39.455.558-15.729 3.339-30.889 8.025-45.187-12.734 5.927-24.891 11.044-36.277 7.331-2.619-.854-5.45.608-6.382 3.2-6.231 17.328-9.64 36.001-9.64 55.475 0 63.284 35.836 109.127 88.317 136.229 1.471.76 3.233.76 4.704 0 11.08-5.722 21.407-12.289 30.823-19.67-18.108-10.455-33.935-23.309-46.617-38.491z" fill="#fac600"/></g><g><g><circle cx="406.527" cy="96.852" fill="#97d729" r="53.444"/></g><g><path d="m390.954 96.852c0-22.847 14.341-42.335 34.509-49.98-5.887-2.232-12.266-3.464-18.935-3.464-29.516 0-53.444 23.928-53.444 53.444s23.928 53.444 53.444 53.444c6.669 0 13.048-1.232 18.935-3.464-20.168-7.645-34.509-27.133-34.509-49.98z" fill="#8bc727"/></g><g><path d="m406.526 157.796c-33.604 0-60.943-27.339-60.943-60.944s27.339-60.944 60.943-60.944 60.944 27.339 60.944 60.944-27.339 60.944-60.944 60.944zm0-106.887c-25.333 0-45.943 20.61-45.943 45.944s20.61 45.944 45.943 45.944c25.334 0 45.944-20.61 45.944-45.944s-20.61-45.944-45.944-45.944z" fill="#e8b800"/></g><g><path d="m402.913 120.352c-1.989 0-3.896-.79-5.304-2.197l-22.096-22.096c-2.929-2.929-2.929-7.678 0-10.606 2.931-2.929 7.679-2.929 10.607 0l16.792 16.793 24.02-24.02c2.93-2.929 7.678-2.929 10.607 0s2.929 7.678 0 10.606l-29.323 29.323c-1.406 1.407-3.314 2.197-5.303 2.197z" fill="#fff"/></g></g></g></g></svg>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="512.000000" height="512.000000" preserveAspectRatio="xMidYMid meet" style=""><rect id="backgroundrect" width="100%" height="100%" x="0" y="0" fill="none" stroke="none"/>
|
2
|
+
|
3
|
+
|
4
|
+
<g class="currentLayer" style=""><title>Layer 1</title><g transform="translate(0,512) scale(0.10000000149011612,-0.10000000149011612) " fill="#ffffff" stroke="none" id="svg_1" class="selected" fill-opacity="1">
|
5
|
+
<path d="M0 2560 l0 -2560 2560 0 2560 0 0 2560 0 2560 -2560 0 -2560 0 0 -2560z m2653 1407 c69 -53 67 -31 67 -671 l0 -576 576 0 c641 0 618 2 672 -68 39 -51 39 -133 0 -184 -54 -70 -31 -68 -672 -68 l-576 0 0 -576 c0 -641 2 -618 -68 -672 -51 -39 -133 -39 -184 0 -70 54 -68 31 -68 672 l0 576 -576 0 c-641 0 -618 -2 -672 68 -39 51 -39 133 0 184 54 70 31 68 672 68 l576 0 2 588 3 589 27 35 c55 72 152 88 221 35z" id="svg_2" fill="#ffffff" fill-opacity="1"/>
|
6
|
+
</g></g></svg>
|
data/assets/js/ads.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
;(function (s, u, z, p) {
|
2
|
-
;(s.src = u), s.setAttribute('data-zone', z), p.appendChild(s)
|
3
|
-
})(
|
4
|
-
document.createElement('script'),
|
5
|
-
'https://inklinkor.com/tag.min.js',
|
6
|
-
5225477,
|
7
|
-
document.body || document.documentElement
|
8
|
-
)
|
1
|
+
;(function (s, u, z, p) {
|
2
|
+
;(s.src = u), s.setAttribute('data-zone', z), p.appendChild(s)
|
3
|
+
})(
|
4
|
+
document.createElement('script'),
|
5
|
+
'https://inklinkor.com/tag.min.js',
|
6
|
+
5225477,
|
7
|
+
document.body || document.documentElement
|
8
|
+
)
|
data/assets/js/append-div.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
---
|
2
|
-
---
|
3
|
-
function insertAfter(referenceNode, newNode) {
|
4
|
-
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)
|
5
|
-
}
|
6
|
-
let themeContentBox = document.getElementById('theme-content-box')
|
7
|
-
const div = document.createElement('div')
|
8
|
-
const profitablecpmgateId = '{{site.profitablecpmgateId}}'
|
9
|
-
div.setAttribute('id', `container-${profitablecpmgateId}`)
|
10
|
-
insertAfter(themeContentBox, div)
|
1
|
+
---
|
2
|
+
---
|
3
|
+
function insertAfter(referenceNode, newNode) {
|
4
|
+
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)
|
5
|
+
}
|
6
|
+
let themeContentBox = document.getElementById('theme-content-box')
|
7
|
+
const div = document.createElement('div')
|
8
|
+
const profitablecpmgateId = '{{site.profitablecpmgateId}}'
|
9
|
+
div.setAttribute('id', `container-${profitablecpmgateId}`)
|
10
|
+
insertAfter(themeContentBox, div)
|
data/assets/js/batch.js
ADDED
@@ -0,0 +1,190 @@
|
|
1
|
+
const getScript = document.currentScript
|
2
|
+
const pageTool = getScript.dataset.tool
|
3
|
+
const lang = getScript.dataset.lang
|
4
|
+
const inputBox = document.querySelector('#Inputbox')
|
5
|
+
const addFiles = document.querySelector(".add-more-files")
|
6
|
+
const gdrive = document.querySelector('#filepicker')
|
7
|
+
const fileDropBox = document.querySelector('.custom-box')
|
8
|
+
const workspace = document.querySelector(".workspace")
|
9
|
+
const selectedFilesList = document.querySelector('.selectedFilesList')
|
10
|
+
const downloadButton = document.querySelector('#download-button')
|
11
|
+
const submitButton = document.querySelector("#submit-button")
|
12
|
+
const showProcessingFiles = document.querySelector(".files-processing-list")
|
13
|
+
|
14
|
+
let root = document.querySelector(':root')
|
15
|
+
root.style.setProperty('--maincolor', fileDropBox.dataset.color)
|
16
|
+
|
17
|
+
const getFile = (file) => {
|
18
|
+
handleFile(file)
|
19
|
+
}
|
20
|
+
fileDropBox.addEventListener('dragover', (e) => {
|
21
|
+
e.preventDefault()
|
22
|
+
})
|
23
|
+
fileDropBox.addEventListener('drop', (e) => {
|
24
|
+
e.preventDefault()
|
25
|
+
handleFile(e.dataTransfer.files[0])
|
26
|
+
})
|
27
|
+
const fileOnChange = () => {
|
28
|
+
handleFile(file.files)
|
29
|
+
}
|
30
|
+
inputBox.onclick = function () {
|
31
|
+
document.querySelector('#file').click()
|
32
|
+
}
|
33
|
+
const fileOnChange2 = () => {
|
34
|
+
addMoreFiles(document.querySelector('#file2').files)
|
35
|
+
}
|
36
|
+
addFiles.onclick = function () {
|
37
|
+
document.querySelector('#file2').click()
|
38
|
+
}
|
39
|
+
var files = []
|
40
|
+
let fileName = "";
|
41
|
+
let blobList = []
|
42
|
+
const addMoreFiles = (addFiles) => {
|
43
|
+
handleFile(addFiles)
|
44
|
+
}
|
45
|
+
const onSubmit = (files) => {
|
46
|
+
blobList = []
|
47
|
+
Promise.all(
|
48
|
+
files.map((item, index) => {
|
49
|
+
document.querySelector(`#loader-${index}`).innerHTML = `<span class="processing">processing</span>
|
50
|
+
<div class="spinner-border" role="status"><span class="sr-only">Loading...</span></div>`
|
51
|
+
return new Promise((resolve, reject) => {
|
52
|
+
batchConversion(item, index).then(([indexValue, blob, type]) => {
|
53
|
+
blobList.push(blob)
|
54
|
+
document.querySelector(`#loader-${indexValue}`).innerHTML = `<span class="done">finished</span>`
|
55
|
+
document.querySelector(`#download-${indexValue}`).style.display = "inline-block"
|
56
|
+
resolve()
|
57
|
+
})
|
58
|
+
}).catch((error) => {
|
59
|
+
console.log(error)
|
60
|
+
})
|
61
|
+
})).then(() => {
|
62
|
+
document.querySelector('#download-zip').style.display = "block"
|
63
|
+
let zip = new JSZip()
|
64
|
+
let zipFiles = zip.folder(`safeimagekit-batch`)
|
65
|
+
blobList.map((file, index) => {
|
66
|
+
zipFiles.file(
|
67
|
+
`safeimagekit-${index + 1}.png`,
|
68
|
+
getBase64String(file),
|
69
|
+
{ base64: true }
|
70
|
+
)
|
71
|
+
})
|
72
|
+
document.querySelector('#download-zip').addEventListener('click', () => {
|
73
|
+
zip.generateAsync({ type: 'blob' }).then(function (content) {
|
74
|
+
saveAs(content, `safeimagekit-batch.zip`)
|
75
|
+
if (lang === 'en') {
|
76
|
+
window.location.href = `/download?tool=${pageTool}`
|
77
|
+
} else {
|
78
|
+
window.location.href = `/${lang}/download?tool=${pageTool}`
|
79
|
+
}
|
80
|
+
})
|
81
|
+
})
|
82
|
+
})
|
83
|
+
}
|
84
|
+
const renderFiles = (files) => {
|
85
|
+
files.map((file, index) => {
|
86
|
+
if (file) {
|
87
|
+
let loader = "Ready"
|
88
|
+
showProcessingFiles.innerHTML += `
|
89
|
+
<tr>
|
90
|
+
<th scope="row" class="file-icon-row">
|
91
|
+
<img src="/assets/images/file.png" alt="file" class="file-icon">
|
92
|
+
</th>
|
93
|
+
<td class="fileName">${file.name}</td>
|
94
|
+
<td id=loader-${index} class="file-processing"><span class="ready">${loader}</span></td>
|
95
|
+
<td class="file-download-button text-right">
|
96
|
+
<button style="display:none;" id=download-${index} data-type="image" onclick="handleDownload(this)" class="btn download-file-btn">
|
97
|
+
<svg class="download-icon" width="16px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"
|
98
|
+
fill="currentColor">
|
99
|
+
<path
|
100
|
+
d="M18 20H5V15H6V19H17V15H18V20ZM12 4V15.19L14.3 13L15 13.6667L11.5 17L8 13.6667L8.7 13L11 15.19V4H12Z">
|
101
|
+
</path>
|
102
|
+
</svg> Download
|
103
|
+
</button>
|
104
|
+
</td>
|
105
|
+
</tr>
|
106
|
+
`
|
107
|
+
}
|
108
|
+
})
|
109
|
+
}
|
110
|
+
const handleFile = (file) => {
|
111
|
+
showProcessingFiles.innerHTML = ""
|
112
|
+
if (file) {
|
113
|
+
for (let i = 0; i < file.length; i++) {
|
114
|
+
files.push(file[i])
|
115
|
+
stopLoading()
|
116
|
+
workspace.style.display = 'block'
|
117
|
+
document.querySelector('#file').style.display = "block"
|
118
|
+
let listItem = document.createElement('li')
|
119
|
+
listItem.style.listStyle = "none"
|
120
|
+
let getFileSize = formatBytes(file[i].size)
|
121
|
+
listItem.innerHTML = `${file[i].name} (${getFileSize})`
|
122
|
+
selectedFilesList.appendChild(listItem)
|
123
|
+
}
|
124
|
+
}
|
125
|
+
renderFiles(files)
|
126
|
+
submitButton.addEventListener("click", () => onSubmit(files))
|
127
|
+
}
|
128
|
+
function formatBytes(bytes, decimals = 2) {
|
129
|
+
if (bytes === 0) return '0 Bytes';
|
130
|
+
|
131
|
+
const k = 1024;
|
132
|
+
const dm = decimals < 0 ? 0 : decimals;
|
133
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
134
|
+
|
135
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
136
|
+
|
137
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
138
|
+
}
|
139
|
+
const handleDownload = (e) => {
|
140
|
+
let find = blobList[Number(e.id.replace(/^\D+/g, ''))]
|
141
|
+
switch (e.dataset.type) {
|
142
|
+
case "image":
|
143
|
+
let a = document.createElement('a')
|
144
|
+
a.href = find
|
145
|
+
a.download = `safeimagekit.png`
|
146
|
+
document.body.appendChild(a)
|
147
|
+
a.click()
|
148
|
+
break;
|
149
|
+
default:
|
150
|
+
break;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
const showLoading = () => {
|
154
|
+
document.querySelector('#file-loader').style.display = 'flex'
|
155
|
+
document.querySelector('.file-input').style.display = 'none'
|
156
|
+
}
|
157
|
+
const stopLoading = () => {
|
158
|
+
fileDropBox.style.display = 'none'
|
159
|
+
}
|
160
|
+
const showDropDown = document.querySelector('.file-pick-dropdown')
|
161
|
+
const icon = document.querySelector('.arrow-sign')
|
162
|
+
const dropDown = document.querySelector('.file-picker-dropdown')
|
163
|
+
showDropDown.addEventListener('click', () => {
|
164
|
+
addScripts()
|
165
|
+
if (dropDown.style.display !== 'none') {
|
166
|
+
dropDown.style.display = 'none'
|
167
|
+
icon.classList.remove('fa-angle-up')
|
168
|
+
icon.classList.add('fa-angle-down')
|
169
|
+
} else {
|
170
|
+
dropDown.style.display = 'block'
|
171
|
+
icon.classList.remove('fa-angle-down')
|
172
|
+
icon.classList.add('fa-angle-up')
|
173
|
+
}
|
174
|
+
})
|
175
|
+
|
176
|
+
const getBase64String = (dataURL) => {
|
177
|
+
const idx = dataURL.indexOf('base64,') + 'base64,'.length
|
178
|
+
return dataURL.substring(idx)
|
179
|
+
}
|
180
|
+
const dataURLtoBlob = (dataurl) => {
|
181
|
+
let arr = dataurl.split(','),
|
182
|
+
mime = arr[0].match(/:(.*?);/)[1],
|
183
|
+
bstr = atob(arr[1]),
|
184
|
+
n = bstr.length,
|
185
|
+
u8arr = new Uint8Array(n)
|
186
|
+
while (n--) {
|
187
|
+
u8arr[n] = bstr.charCodeAt(n)
|
188
|
+
}
|
189
|
+
return new Blob([u8arr], { type: mime })
|
190
|
+
}
|