appscms-tools-theme 2.4.6 → 2.4.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" style="" viewBox="0 0 512 512">
2
- <path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 368C269.3 368 280 357.3 280 344V280H344C357.3 280 368 269.3 368 256C368 242.7 357.3 232 344 232H280V168C280 154.7 269.3 144 256 144C242.7 144 232 154.7 232 168V232H168C154.7 232 144 242.7 144 256C144 269.3 154.7 280 168 280H232V344C232 357.3 242.7 368 256 368z"/>
1
+ <svg xmlns="http://www.w3.org/2000/svg" style="" viewBox="0 0 512 512">
2
+ <path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 368C269.3 368 280 357.3 280 344V280H344C357.3 280 368 269.3 368 256C368 242.7 357.3 232 344 232H280V168C280 154.7 269.3 144 256 144C242.7 144 232 154.7 232 168V232H168C154.7 232 144 242.7 144 256C144 269.3 154.7 280 168 280H232V344C232 357.3 242.7 368 256 368z"/>
3
3
  </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
+ )
@@ -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 CHANGED
@@ -2,95 +2,116 @@ const getScript = document.currentScript
2
2
  const pageTool = getScript.dataset.tool
3
3
  const lang = getScript.dataset.lang
4
4
  const inputBox = document.querySelector('#Inputbox')
5
- const addFiles = document.querySelector(".add-more-files")
5
+ const addFiles = document.querySelector('.add-more-files')
6
6
  const gdrive = document.querySelector('#filepicker')
7
7
  const fileDropBox = document.querySelector('.custom-box')
8
- const workspace = document.querySelector(".workspace")
8
+ const workspace = document.querySelector('.workspace')
9
9
  const selectedFilesList = document.querySelector('.selectedFilesList')
10
10
  const downloadButton = document.querySelector('#download-button')
11
- const submitButton = document.querySelector("#submit-button")
12
- const showProcessingFiles = document.querySelector(".files-processing-list")
13
-
11
+ const submitButton = document.querySelector('#submit-button')
12
+ const showProcessingFiles = document.querySelector('.files-processing-list')
13
+ let zipFileType = null
14
+ let renderFileTypes = []
14
15
  let root = document.querySelector(':root')
15
16
  root.style.setProperty('--maincolor', fileDropBox.dataset.color)
16
17
 
17
18
  const getFile = (file) => {
18
- handleFile(file)
19
+ handleFile(file)
19
20
  }
20
21
  fileDropBox.addEventListener('dragover', (e) => {
21
- e.preventDefault()
22
+ e.preventDefault()
22
23
  })
23
24
  fileDropBox.addEventListener('drop', (e) => {
24
- e.preventDefault()
25
- handleFile(e.dataTransfer.files[0])
25
+ e.preventDefault()
26
+ handleFile(e.dataTransfer.files[0])
26
27
  })
27
28
  const fileOnChange = () => {
28
- handleFile(file.files)
29
+ handleFile(file.files)
29
30
  }
30
31
  inputBox.onclick = function () {
31
- document.querySelector('#file').click()
32
+ document.querySelector('#file').click()
32
33
  }
33
34
  const fileOnChange2 = () => {
34
- addMoreFiles(document.querySelector('#file2').files)
35
+ addMoreFiles(document.querySelector('#file2').files)
35
36
  }
36
37
  addFiles.onclick = function () {
37
- document.querySelector('#file2').click()
38
+ document.querySelector('#file2').click()
38
39
  }
39
40
  var files = []
40
- let fileName = "";
41
+ let fileName = ''
41
42
  let blobList = []
42
43
  const addMoreFiles = (addFiles) => {
43
- handleFile(addFiles)
44
+ handleFile(addFiles)
44
45
  }
45
46
  const onSubmit = (files) => {
46
- blobList = []
47
- Promise.all(
48
- files.map((item, index) => {
49
- document.querySelector(`#loader-${index}`).innerHTML = `<span class="processing">processing</span>
47
+ blobList = []
48
+ Promise.all(
49
+ files.map((item, index) => {
50
+ document.querySelector(
51
+ `#loader-${index}`
52
+ ).innerHTML = `<span class="processing">processing</span>
50
53
  <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: blob, fileName: item })
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(".bottom-section-container").style.display = "flex"
63
- document.querySelector(".bottom-section-container").style.padding = "20px .75rem"
64
- document.querySelector('#download-zip').style.display = "block"
65
- let zip = new JSZip()
66
- let zipFiles = zip.folder(`safeimagekit-batch-images`)
67
-
68
- blobList.map((item) => {
69
- zipFiles.file(
70
- `safeimagekit-batch-${item.fileName.name.split(".")[0]}.png`,
71
- getBase64String(item.blob),
72
- { base64: true }
73
- )
74
- })
54
+ return new Promise((resolve, reject) => {
55
+ batchConversion(item, index).then(([indexValue, blob, type]) => {
56
+ blobList.push({ blob: blob, fileName: item })
57
+ document.querySelector(
58
+ `#loader-${indexValue}`
59
+ ).innerHTML = `<span class="done">finished</span>`
60
+ document.querySelector(`#download-${indexValue}`).style.display =
61
+ 'inline-block'
62
+ resolve()
63
+ })
64
+ }).catch((error) => {
65
+ console.log(error)
66
+ })
67
+ })
68
+ ).then(() => {
69
+ document.querySelector('.bottom-section-container').style.display = 'flex'
70
+ document.querySelector('.bottom-section-container').style.padding =
71
+ '20px .75rem'
72
+ document.querySelector('#download-zip').style.display = 'block'
73
+ let zip = new JSZip()
74
+ let zipFiles = zip.folder(`safeimagekit-batch-images`)
75
75
 
76
+ blobList.map((item) => {
77
+ zipFiles.file(
78
+ `safeimagekit-batch-${item.fileName.name.split('.')[0]}.${
79
+ zipFileType ? zipFileType : 'png'
80
+ }`,
81
+ getBase64String(item.blob),
82
+ { base64: true }
83
+ )
84
+ })
76
85
 
77
- document.querySelector('#download-zip').addEventListener('click', () => {
78
- zip.generateAsync({ type: 'blob' }).then(function (content) {
79
- saveAs(content, `safeimagekit-batch-conversion.zip`)
80
- if (lang === 'en') {
81
- window.location.href = `/download?tool=${pageTool}`
82
- } else {
83
- window.location.href = `/${lang}/download?tool=${pageTool}`
84
- }
85
- })
86
- })
87
- })
86
+ document.querySelector('#download-zip').addEventListener('click', () => {
87
+ zip.generateAsync({ type: 'blob' }).then(function (content) {
88
+ saveAs(content, `safeimagekit-batch-conversion.zip`)
89
+ if (lang === 'en') {
90
+ window.location.href = `/download?tool=${pageTool}`
91
+ } else {
92
+ window.location.href = `/${lang}/download?tool=${pageTool}`
93
+ }
94
+ })
95
+ })
96
+ })
88
97
  }
98
+ let renderFileTypesHtml = ` <option value="png">png</option>
99
+ <option value="jpg">jpg</option>
100
+ <option value="jpeg">jpeg</option>
101
+ <option value="webp">webp</option>
102
+ `
103
+
89
104
  const renderFiles = (files) => {
90
- files.map((file, index) => {
91
- if (file) {
92
- let loader = "Ready"
93
- showProcessingFiles.innerHTML += `
105
+ if (renderFileTypes !== []) {
106
+ renderFileTypesHtml = ''
107
+ renderFileTypes.map((i) => {
108
+ renderFileTypesHtml += `<option value="${i}">${i}</option>`
109
+ })
110
+ }
111
+ files.map((file, index) => {
112
+ if (file) {
113
+ let loader = 'Ready'
114
+ showProcessingFiles.innerHTML += `
94
115
  <tr>
95
116
  <th scope="row" class="file-icon-row">
96
117
  <img src="/assets/images/file.png" alt="file" class="file-icon">
@@ -100,11 +121,7 @@ const renderFiles = (files) => {
100
121
  <td>
101
122
  <div class="download-format ">
102
123
  <select name="image-format" id="image-format">
103
- <option value="png">png</option>
104
- <option value="jpg">jpg</option>
105
- <option value="jpeg">jpeg</option>
106
- <option value="webp">webp</option>
107
-
124
+ ${renderFileTypesHtml}
108
125
  </select>
109
126
  </div>
110
127
 
@@ -121,94 +138,92 @@ const renderFiles = (files) => {
121
138
  </td>
122
139
  </tr>
123
140
  `
124
- }
125
- })
141
+ }
142
+ })
126
143
  }
127
144
 
128
-
129
145
  const handleFile = (file) => {
130
- showProcessingFiles.innerHTML = ""
131
- if (file) {
132
- for (let i = 0; i < file.length; i++) {
133
- files.push(file[i])
134
- stopLoading()
135
- workspace.style.display = 'block'
136
- document.querySelector('#file').style.display = "block"
137
- let listItem = document.createElement('li')
138
- listItem.style.listStyle = "none"
139
- let getFileSize = formatBytes(file[i].size)
140
- listItem.innerHTML = `${file[i].name} (${getFileSize})`
141
- // selectedFilesList.appendChild(listItem)
142
- }
146
+ showProcessingFiles.innerHTML = ''
147
+ if (file) {
148
+ for (let i = 0; i < file.length; i++) {
149
+ files.push(file[i])
150
+ stopLoading()
151
+ workspace.style.display = 'block'
152
+ document.querySelector('#file').style.display = 'block'
153
+ let listItem = document.createElement('li')
154
+ listItem.style.listStyle = 'none'
155
+ let getFileSize = formatBytes(file[i].size)
156
+ listItem.innerHTML = `${file[i].name} (${getFileSize})`
157
+ // selectedFilesList.appendChild(listItem)
143
158
  }
144
- renderFiles(files)
145
- submitButton.addEventListener("click", () => onSubmit(files))
159
+ }
160
+ renderFiles(files)
161
+ submitButton.addEventListener('click', () => onSubmit(files))
146
162
  }
147
163
  function formatBytes(bytes, decimals = 2) {
148
- if (bytes === 0) return '0 Bytes';
164
+ if (bytes === 0) return '0 Bytes'
149
165
 
150
- const k = 1024;
151
- const dm = decimals < 0 ? 0 : decimals;
152
- const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
166
+ const k = 1024
167
+ const dm = decimals < 0 ? 0 : decimals
168
+ const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
153
169
 
154
- const i = Math.floor(Math.log(bytes) / Math.log(k));
170
+ const i = Math.floor(Math.log(bytes) / Math.log(k))
155
171
 
156
- return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
172
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]
157
173
  }
158
174
  const handleDownload = (e) => {
159
- let find = blobList[Number(e.id.replace(/^\D+/g, ''))].blob
160
- let fileName = blobList[Number(e.id.replace(/^\D+/g, ''))].fileName.name
161
-
162
- let format = document.querySelector("#image-format").value
175
+ let find = blobList[Number(e.id.replace(/^\D+/g, ''))].blob
176
+ let fileName = blobList[Number(e.id.replace(/^\D+/g, ''))].fileName.name
163
177
 
178
+ let format = document.querySelector('#image-format').value
164
179
 
165
- switch (e.dataset.type) {
166
- case "image":
167
- let a = document.createElement('a')
168
- a.href = find
169
- a.download = `safeimagekit-batch-${fileName.split(".")[0]}.${format}`
170
- document.body.appendChild(a)
171
- a.click()
172
- break;
173
- default:
174
- break;
175
- }
180
+ switch (e.dataset.type) {
181
+ case 'image':
182
+ let a = document.createElement('a')
183
+ a.href = find
184
+ a.download = `safeimagekit-batch-${fileName.split('.')[0]}.${format}`
185
+ document.body.appendChild(a)
186
+ a.click()
187
+ break
188
+ default:
189
+ break
190
+ }
176
191
  }
177
192
  const showLoading = () => {
178
- document.querySelector('#file-loader').style.display = 'flex'
179
- document.querySelector('.file-input').style.display = 'none'
193
+ document.querySelector('#file-loader').style.display = 'flex'
194
+ document.querySelector('.file-input').style.display = 'none'
180
195
  }
181
196
  const stopLoading = () => {
182
- fileDropBox.style.display = 'none'
197
+ fileDropBox.style.display = 'none'
183
198
  }
184
199
  const showDropDown = document.querySelector('.file-pick-dropdown')
185
200
  const icon = document.querySelector('.arrow-sign')
186
201
  const dropDown = document.querySelector('.file-picker-dropdown')
187
202
  showDropDown.addEventListener('click', () => {
188
- addScripts()
189
- if (dropDown.style.display !== 'none') {
190
- dropDown.style.display = 'none'
191
- icon.classList.remove('fa-angle-up')
192
- icon.classList.add('fa-angle-down')
193
- } else {
194
- dropDown.style.display = 'block'
195
- icon.classList.remove('fa-angle-down')
196
- icon.classList.add('fa-angle-up')
197
- }
203
+ addScripts()
204
+ if (dropDown.style.display !== 'none') {
205
+ dropDown.style.display = 'none'
206
+ icon.classList.remove('fa-angle-up')
207
+ icon.classList.add('fa-angle-down')
208
+ } else {
209
+ dropDown.style.display = 'block'
210
+ icon.classList.remove('fa-angle-down')
211
+ icon.classList.add('fa-angle-up')
212
+ }
198
213
  })
199
214
 
200
215
  const getBase64String = (dataURL) => {
201
- const idx = dataURL.indexOf('base64,') + 'base64,'.length
202
- return dataURL.substring(idx)
216
+ const idx = dataURL.indexOf('base64,') + 'base64,'.length
217
+ return dataURL.substring(idx)
203
218
  }
204
219
  const dataURLtoBlob = (dataurl) => {
205
- let arr = dataurl.split(','),
206
- mime = arr[0].match(/:(.*?);/)[1],
207
- bstr = atob(arr[1]),
208
- n = bstr.length,
209
- u8arr = new Uint8Array(n)
210
- while (n--) {
211
- u8arr[n] = bstr.charCodeAt(n)
212
- }
213
- return new Blob([u8arr], { type: mime })
220
+ let arr = dataurl.split(','),
221
+ mime = arr[0].match(/:(.*?);/)[1],
222
+ bstr = atob(arr[1]),
223
+ n = bstr.length,
224
+ u8arr = new Uint8Array(n)
225
+ while (n--) {
226
+ u8arr[n] = bstr.charCodeAt(n)
227
+ }
228
+ return new Blob([u8arr], { type: mime })
214
229
  }
@@ -1,33 +1,33 @@
1
- [
2
- {
3
- "name": "together_forever",
4
- "effectImagePath": "/assets/images/together_forever.png",
5
- "elements": [
6
- {
7
- "type": "image",
8
- "filter": "",
9
- "perspective": "",
10
- "height": 300,
11
- "width": 300,
12
- "translate": {
13
- "x": -5,
14
- "y": -10
15
- },
16
- "x": 100,
17
- "y": 100,
18
- "id": "file-1"
19
- },
20
- {
21
- "type": "text",
22
- "x": "200",
23
- "y": "200",
24
- "color": "red",
25
- "fontFamily": "Calligraphy",
26
- "fontPath": "/assets/fonts/Calligraphy.ttf",
27
- "id": "text-1",
28
- "fontSize": 50,
29
- "fontSizeOption1": 10
30
- }
31
- ]
32
- }
1
+ [
2
+ {
3
+ "name": "together_forever",
4
+ "effectImagePath": "/assets/images/together_forever.png",
5
+ "elements": [
6
+ {
7
+ "type": "image",
8
+ "filter": "",
9
+ "perspective": "",
10
+ "height": 300,
11
+ "width": 300,
12
+ "translate": {
13
+ "x": -5,
14
+ "y": -10
15
+ },
16
+ "x": 100,
17
+ "y": 100,
18
+ "id": "file-1"
19
+ },
20
+ {
21
+ "type": "text",
22
+ "x": "200",
23
+ "y": "200",
24
+ "color": "red",
25
+ "fontFamily": "Calligraphy",
26
+ "fontPath": "/assets/fonts/Calligraphy.ttf",
27
+ "id": "text-1",
28
+ "fontSize": 50,
29
+ "fontSizeOption1": 10
30
+ }
31
+ ]
32
+ }
33
33
  ]
data/assets/js/theme.js CHANGED
@@ -1,27 +1,27 @@
1
- $(document).ready(function () {
2
- var safuiAlert = $('#safeui-alert')
3
- if (safuiAlert) {
4
- safuiAlert
5
- .first()
6
- .delay(10000)
7
- .slideUp(1000, function () {
8
- $(this).remove()
9
- })
10
- }
11
- })
12
- var removeNav = () => {
13
- let homeLink = document.getElementById('home-link')
14
- homeLink.style.marginRight = '10px'
15
- document.getElementById('h1-img-wrapper').prepend(homeLink)
16
- document
17
- .getElementById('h1-img-wrapper')
18
- .style.setProperty('align-items', 'unset', 'important')
19
- document.getElementById('header').style.display = 'none'
20
- document.getElementById('h1-img').style.display = 'none'
21
- document.getElementById('feature-h1').style.width = '100%'
22
- document.getElementById('feature-h2').style.display = 'none'
23
- let safeUiAlert = document.getElementById('safeui-alert')
24
- if (safeUiAlert) {
25
- safeUiAlert.style.display = 'none'
26
- }
27
- }
1
+ $(document).ready(function () {
2
+ var safuiAlert = $('#safeui-alert')
3
+ if (safuiAlert) {
4
+ safuiAlert
5
+ .first()
6
+ .delay(10000)
7
+ .slideUp(1000, function () {
8
+ $(this).remove()
9
+ })
10
+ }
11
+ })
12
+ var removeNav = () => {
13
+ let homeLink = document.getElementById('home-link')
14
+ homeLink.style.marginRight = '10px'
15
+ document.getElementById('h1-img-wrapper').prepend(homeLink)
16
+ document
17
+ .getElementById('h1-img-wrapper')
18
+ .style.setProperty('align-items', 'unset', 'important')
19
+ document.getElementById('header').style.display = 'none'
20
+ document.getElementById('h1-img').style.display = 'none'
21
+ document.getElementById('feature-h1').style.width = '100%'
22
+ document.getElementById('feature-h2').style.display = 'none'
23
+ let safeUiAlert = document.getElementById('safeui-alert')
24
+ if (safeUiAlert) {
25
+ safeUiAlert.style.display = 'none'
26
+ }
27
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appscms-tools-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.6
4
+ version: 2.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - vivek-appscms
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-21 00:00:00.000000000 Z
11
+ date: 2022-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '12.0'
55
- description:
55
+ description:
56
56
  email:
57
57
  - vivek@appscms.com
58
58
  executables: []
@@ -2662,7 +2662,7 @@ homepage: https://github.com/Appscms-com/appscms-tools-theme
2662
2662
  licenses:
2663
2663
  - MIT
2664
2664
  metadata: {}
2665
- post_install_message:
2665
+ post_install_message:
2666
2666
  rdoc_options: []
2667
2667
  require_paths:
2668
2668
  - lib
@@ -2677,8 +2677,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2677
2677
  - !ruby/object:Gem::Version
2678
2678
  version: '0'
2679
2679
  requirements: []
2680
- rubygems_version: 3.1.2
2681
- signing_key:
2680
+ rubygems_version: 3.1.6
2681
+ signing_key:
2682
2682
  specification_version: 4
2683
2683
  summary: Appscms theme for all tools
2684
2684
  test_files: []