appscms-tools-theme 5.1.9 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/_data/.DS_Store +0 -0
  3. data/_data/aitools/en/all-in-one-social-post.json +217 -0
  4. data/_data/aitools/en/amazon-product-bullet-points-generator.json +2 -0
  5. data/_data/aitools/en/amazon-product-description-generator.json +15 -0
  6. data/_data/aitools/en/blog-conclusion-generator.json +253 -0
  7. data/_data/aitools/en/blog-content-calendar.json +232 -0
  8. data/_data/aitools/en/blog-introduction-generator.json +246 -0
  9. data/_data/aitools/en/blog-outline-generator.json +232 -0
  10. data/_data/aitools/en/blog-section-generator.json +253 -0
  11. data/_data/aitools/en/blog-title-generator.json +232 -0
  12. data/_data/aitools/en/blog-topic-ideas.json +232 -0
  13. data/_data/aitools/en/caption-generator.json +271 -0
  14. data/_data/aitools/en/engagement-post-generator.json +251 -0
  15. data/_data/aitools/en/facebook-post.json +232 -0
  16. data/_data/aitools/en/hidden-fact-finder.json +232 -0
  17. data/_data/aitools/en/human-written-blog-post.json +232 -0
  18. data/_data/aitools/en/instagram-bio-generator.json +246 -0
  19. data/_data/aitools/en/instagram-caption.json +232 -0
  20. data/_data/aitools/en/instagram-carousel.json +250 -0
  21. data/_data/aitools/en/instagram-hashtag-generator.json +246 -0
  22. data/_data/aitools/en/instagram-name-generator.json +239 -0
  23. data/_data/aitools/en/instagram-threads-generator.json +239 -0
  24. data/_data/aitools/en/interactive-content-creator.json +252 -0
  25. data/_data/aitools/en/linkedin-hashtag-generator.json +239 -0
  26. data/_data/aitools/en/linkedin-post.json +232 -0
  27. data/_data/aitools/en/motivational-posts.json +239 -0
  28. data/_data/aitools/en/pinterest-pin.json +217 -0
  29. data/_data/aitools/en/platform-specific-content-generator.json +246 -0
  30. data/_data/aitools/en/quick-article-writer.json +253 -0
  31. data/_data/aitools/en/replies-for-facebook.json +239 -0
  32. data/_data/aitools/en/replies-for-instagram.json +239 -0
  33. data/_data/aitools/en/replies-for-linkedin.json +239 -0
  34. data/_data/aitools/en/replies-for-twitter.json +239 -0
  35. data/_data/aitools/en/rewrite-article-with-keywords.json +246 -0
  36. data/_data/aitools/en/script-for-instagram-reel.json +246 -0
  37. data/_data/aitools/en/script-for-tiktok-video.json +246 -0
  38. data/_data/aitools/en/seo-optimized-blog-post.json +239 -0
  39. data/_data/aitools/en/snapchat-caption-maker.json +245 -0
  40. data/_data/aitools/en/social-media-bio-creator.json +274 -0
  41. data/_data/aitools/en/social-media-bio-generator.json +246 -0
  42. data/_data/aitools/en/social-media-calendar.json +250 -0
  43. data/_data/aitools/en/tiktok-caption.json +232 -0
  44. data/_data/aitools/en/tiktok-username-generator.json +239 -0
  45. data/_data/aitools/en/twitter-poll-generator.json +250 -0
  46. data/_data/aitools/en/twitter-post.json +272 -0
  47. data/_data/contenttool/en/features.json +217 -10
  48. data/_includes/.DS_Store +0 -0
  49. data/_layouts/appscms-feature.html +1 -1
  50. data/_layouts/content-tool-ai.html +38 -156
  51. data/assets/.DS_Store +0 -0
  52. data/assets/css/content-tool-ai.css +42 -12
  53. metadata +44 -78
  54. data/_includes/aitools/ai-article-writer.html +0 -0
  55. data/_includes/aitools/amazon-product-bullet-points-generator.html +0 -0
  56. data/_includes/aitools/amazon-product-description-generator.html +0 -0
  57. data/_includes/aitools/brand-name-generator.html +0 -0
  58. data/_includes/aitools/product-description.html +0 -0
  59. data/assets/js/.DS_Store +0 -0
  60. data/assets/js/TopScroll.js +0 -8
  61. data/assets/js/adBlocker.js +0 -68
  62. data/assets/js/ads.js +0 -8
  63. data/assets/js/ai-article-writer.js +0 -0
  64. data/assets/js/amazon-product-bullet-points-generator.js +0 -464
  65. data/assets/js/amazon-product-bullet-points-generator3.js +0 -176
  66. data/assets/js/amazon-product-description-generator.js +0 -309
  67. data/assets/js/append-div.js +0 -10
  68. data/assets/js/appscms-infographics.js +0 -0
  69. data/assets/js/appscms-login.js +0 -447
  70. data/assets/js/appscms-search-home1.js +0 -136
  71. data/assets/js/appscms-search.js +0 -133
  72. data/assets/js/appscms-theme.js +0 -459
  73. data/assets/js/batch.js +0 -219
  74. data/assets/js/blog-topic-ideas.js +0 -57
  75. data/assets/js/brand-name-generator.js +0 -127
  76. data/assets/js/calculator-tooltip.js +0 -3
  77. data/assets/js/devtools.js +0 -82
  78. data/assets/js/face-api.js +0 -38064
  79. data/assets/js/face-detection.js +0 -303
  80. data/assets/js/faceSystem.js +0 -0
  81. data/assets/js/featureResult.js +0 -48
  82. data/assets/js/frame.js +0 -264
  83. data/assets/js/googledrive.js +0 -158
  84. data/assets/js/homeResult.js +0 -37
  85. data/assets/js/human-written-blog-post.js +0 -57
  86. data/assets/js/instagram-caption.js +0 -57
  87. data/assets/js/instagram-hashtag-generator.js +0 -10
  88. data/assets/js/instagram-name-generator.js +0 -61
  89. data/assets/js/manifest.json +0 -17
  90. data/assets/js/models/age_gender_model-shard1 +0 -0
  91. data/assets/js/models/age_gender_model-weights_manifest.json +0 -1
  92. data/assets/js/models/face_expression_model-shard1 +0 -0
  93. data/assets/js/models/face_expression_model-weights_manifest.json +0 -1
  94. data/assets/js/models/face_landmark_68_model-shard1 +0 -0
  95. data/assets/js/models/face_landmark_68_model-weights_manifest.json +0 -1
  96. data/assets/js/models/face_landmark_68_tiny_model-shard1 +0 -0
  97. data/assets/js/models/face_landmark_68_tiny_model-weights_manifest.json +0 -1
  98. data/assets/js/models/face_recognition_model-shard1 +0 -0
  99. data/assets/js/models/face_recognition_model-shard2 +0 -6
  100. data/assets/js/models/face_recognition_model-weights_manifest.json +0 -1
  101. data/assets/js/models/mtcnn_model-shard1 +0 -0
  102. data/assets/js/models/mtcnn_model-weights_manifest.json +0 -1
  103. data/assets/js/models/ssd_mobilenetv1_model-shard1 +0 -0
  104. data/assets/js/models/ssd_mobilenetv1_model-shard2 +8 -137
  105. data/assets/js/models/ssd_mobilenetv1_model-weights_manifest.json +0 -1
  106. data/assets/js/models/tiny_face_detector_model-shard1 +0 -0
  107. data/assets/js/models/tiny_face_detector_model-weights_manifest.json +0 -1
  108. data/assets/js/multiselect.js +0 -185
  109. data/assets/js/partytown/debug/partytown-atomics.js +0 -929
  110. data/assets/js/partytown/debug/partytown-media.js +0 -374
  111. data/assets/js/partytown/debug/partytown-sandbox-sw.js +0 -920
  112. data/assets/js/partytown/debug/partytown-sw.js +0 -59
  113. data/assets/js/partytown/debug/partytown-ww-atomics.js +0 -2699
  114. data/assets/js/partytown/debug/partytown-ww-sw.js +0 -2691
  115. data/assets/js/partytown/debug/partytown.js +0 -114
  116. data/assets/js/partytown/partytown-atomics.js +0 -600
  117. data/assets/js/partytown/partytown-media.js +0 -2
  118. data/assets/js/partytown/partytown-sw.js +0 -50
  119. data/assets/js/perspective.min.js +0 -182
  120. data/assets/js/photo-effects.json +0 -85
  121. data/assets/js/product-description.js +0 -299
  122. data/assets/js/redirectResult.js +0 -10
  123. data/assets/js/sharePage.js +0 -65
  124. data/assets/js/testing-batch.js +0 -39
  125. data/assets/js/theme.js +0 -104
  126. data/assets/js/usageTracking.js +0 -143
  127. data/assets/js/usageTrackingEvents.js +0 -6
  128. data/assets/js/userUsageCount.js +0 -0
  129. data/assets/js/webvitals.js +0 -5
data/assets/js/batch.js DELETED
@@ -1,219 +0,0 @@
1
- const getScript = document.currentScript;
2
- const pageTool = getScript.dataset.tool;
3
- const lang = getScript.dataset.lang;
4
- const inputBox = document.querySelector(".upload-btn");
5
- const addFiles = document.querySelector(".add-more-files");
6
- const fileDropBox = document.querySelector(".box");
7
- const workspace = document.querySelector(".workspace");
8
- const selectedFilesList = document.querySelector(".selectedFilesList");
9
- const downloadButton = document.querySelector("#download-button");
10
- const submitButton = document.querySelector("#submit-button");
11
- const showProcessingFiles = document.querySelector(".files-processing-list");
12
- let zipFileType = null;
13
- let renderFileTypes = null;
14
-
15
- const showLoader = () => {
16
- showLoading();
17
- };
18
- const closeLoader = () => {};
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
- let 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(
50
- `#loader-${index}`
51
- ).innerHTML = `<span class="processing">processing</span>
52
- <div class="spinner-border" role="status"><span class="sr-only">Loading...</span></div>`;
53
- return new Promise((resolve, reject) => {
54
- batchConversion(item, index).then(([indexValue, blob, type]) => {
55
- blobList.push({ blob: blob, fileName: item });
56
- document.querySelector(
57
- `#loader-${indexValue}`
58
- ).innerHTML = `<span class="done">finished</span>`;
59
- document.querySelector(`#download-${indexValue}`).style.display =
60
- "inline-block";
61
- resolve();
62
- });
63
- }).catch((error) => {
64
- console.log(error);
65
- });
66
- })
67
- ).then(() => {
68
- document.querySelector(".bottom-section-container").style.display = "flex";
69
- document.querySelector(".bottom-section-container").style.padding =
70
- "20px .75rem";
71
- document.querySelector("#download-zip").style.display = "block";
72
- let zip = new JSZip();
73
- let zipFiles = zip.folder(`safeimagekit-batch-images`);
74
- blobList.map((item) => {
75
- zipFiles.file(
76
- `safeimagekit-batch-${item.fileName.name.split(".")[0]}.${
77
- zipFileType ? zipFileType : "png"
78
- }`,
79
- getBase64String(item.blob),
80
- { base64: true }
81
- );
82
- });
83
-
84
- document.querySelector("#download-zip").addEventListener("click", () => {
85
- zip.generateAsync({ type: "blob" }).then(function (content) {
86
- saveAs(content, `safeimagekit-batch-conversion.zip`);
87
- if (lang === "en") {
88
- window.location.href = `/download?tool=${pageTool}`;
89
- } else {
90
- window.location.href = `/${lang}/download?tool=${pageTool}`;
91
- }
92
- });
93
- });
94
- });
95
- };
96
- let renderFileTypesHtml = ` <option value="png">png</option>
97
- <option value="jpg">jpg</option>
98
- <option value="jpeg">jpeg</option>
99
- <option value="webp">webp</option>
100
- `;
101
-
102
- const renderFiles = (files) => {
103
- if (renderFileTypes !== null) {
104
- renderFileTypesHtml = "";
105
- renderFileTypes.map((i) => {
106
- renderFileTypesHtml += `<option value="${i}">${i}</option>`;
107
- });
108
- }
109
- files.map((file, index) => {
110
- if (file) {
111
- let filename = file.name;
112
- if (file.name.split(".")[0].length > 10) {
113
- let fName = file.name.split(".")[0];
114
- let fExtention = file.name.split(".")[1];
115
- filename =
116
- fName.substr(0, 9) + "..." + fName.substr(-3) + "." + fExtention;
117
- }
118
- let loader = "Ready";
119
- showProcessingFiles.innerHTML += `
120
- <tr>
121
- <th scope="row" class="file-icon-row">
122
- <img src="/assets/images/file.png" alt="file" class="file-icon">
123
- </th>
124
- <td class="fileName">${filename}</td>
125
- <td id=loader-${index} class="file-processing"><span class="ready">${loader}</span></td>
126
- <td>
127
- <div class="download-format ">
128
- <select name="image-format" id="image-format">
129
- ${renderFileTypesHtml}
130
- </select>
131
- </div>
132
-
133
- </td>
134
- <td class="file-download-button text-right">
135
- <button style="display:none;" id=download-${index} data-type="image" onclick="handleDownload(this)" class="btn download-file-btn">
136
- <svg class="download-icon" width="16px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"
137
- fill="currentColor">
138
- <path
139
- d="M18 20H5V15H6V19H17V15H18V20ZM12 4V15.19L14.3 13L15 13.6667L11.5 17L8 13.6667L8.7 13L11 15.19V4H12Z">
140
- </path>
141
- </svg> Download
142
- </button>
143
- </td>
144
- </tr>
145
- `;
146
- }
147
- });
148
- };
149
-
150
- const handleFile = (file) => {
151
- showProcessingFiles.innerHTML = "";
152
- if (file) {
153
- for (let i = 0; i < file.length; i++) {
154
- files.push(file[i]);
155
- stopLoading();
156
- workspace.style.display = "block";
157
- document.querySelector("#file").style.display = "block";
158
- let listItem = document.createElement("li");
159
- listItem.style.listStyle = "none";
160
- let getFileSize = formatBytes(file[i].size);
161
- listItem.innerHTML = `${file[i].name} (${getFileSize})`;
162
- // selectedFilesList.appendChild(listItem)
163
- }
164
- }
165
- renderFiles(files);
166
- submitButton.addEventListener("click", () => onSubmit(files));
167
- };
168
- const formatBytes = (bytes, decimals = 2) => {
169
- if (bytes === 0) return "0 Bytes";
170
-
171
- const k = 1024;
172
- const dm = decimals < 0 ? 0 : decimals;
173
- const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
174
-
175
- const i = Math.floor(Math.log(bytes) / Math.log(k));
176
-
177
- return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
178
- };
179
- const handleDownload = (e) => {
180
- let find = blobList[Number(e.id.replace(/^\D+/g, ""))].blob;
181
- let fileName = blobList[Number(e.id.replace(/^\D+/g, ""))].fileName.name;
182
-
183
- let format = document.querySelector("#image-format").value;
184
-
185
- switch (e.dataset.type) {
186
- case "image":
187
- let a = document.createElement("a");
188
- a.href = find;
189
- a.download = `safeimagekit-batch-${fileName.split(".")[0]}.${format}`;
190
- document.body.appendChild(a);
191
- a.click();
192
- break;
193
- default:
194
- break;
195
- }
196
- };
197
- const showLoading = () => {
198
- document.querySelector("#file-loader").style.display = "flex";
199
- document.querySelector(".file-input").style.display = "none";
200
- };
201
- const stopLoading = () => {
202
- fileDropBox.style.display = "none";
203
- };
204
-
205
- const getBase64String = (dataURL) => {
206
- const idx = dataURL.indexOf("base64,") + "base64,".length;
207
- return dataURL.substring(idx);
208
- };
209
- const dataURLtoBlob = (dataurl) => {
210
- let arr = dataurl.split(","),
211
- mime = arr[0].match(/:(.*?);/)[1],
212
- bstr = atob(arr[1]),
213
- n = bstr.length,
214
- u8arr = new Uint8Array(n);
215
- while (n--) {
216
- u8arr[n] = bstr.charCodeAt(n);
217
- }
218
- return new Blob([u8arr], { type: mime });
219
- };
@@ -1,57 +0,0 @@
1
- // Auto-generated JS for Blog Topic Ideas
2
- document.addEventListener("DOMContentLoaded", function () {
3
- const form = document.getElementById("contentToolForm");
4
- const editor = document.querySelector("#editor .ql-editor");
5
-
6
- const tool = "blog-topic-ideas";
7
-
8
- let input0 = form.querySelector('[name="input0"]');
9
- let language = form.querySelector('[name="language"]');
10
- let tone = form.querySelector('[name="tone"]');
11
-
12
- form.addEventListener("submit", async function (e) {
13
- e.preventDefault();
14
-
15
- const formData = new FormData(form);
16
- const options = {};
17
- let inputIndex = 0;
18
-
19
- for (const [key, value] of formData.entries()) {
20
- if (key === "language" || key === "tone") {
21
- options[key] = value;
22
- } else {
23
- options[`input[${inputIndex}]`] = value;
24
- inputIndex++;
25
- }
26
- }
27
-
28
- const body = {
29
- tool: tool,
30
- llm: "gemini",
31
- model_name: "gemini-2.0-flash",
32
- options: options
33
- };
34
-
35
- try {
36
- const response = await fetch(`http://localhost:8000/api/v1/name-and-title-tools/${tool}`, {
37
- method: "POST",
38
- headers: {
39
- "Content-Type": "application/json"
40
- },
41
- body: JSON.stringify(body)
42
- });
43
-
44
- const data = await response.json();
45
-
46
- if (data.output && editor) {
47
- editor.innerHTML += "<p>" + data.output + "</p>";
48
- } else {
49
- editor.innerHTML += "<p><em>No output received from server.</em></p>";
50
- }
51
-
52
- } catch (err) {
53
- console.error("❌ API Error:", err);
54
- editor.innerHTML += "<p style='color:red;'>Error: " + err.message + "</p>";
55
- }
56
- });
57
- });
@@ -1,127 +0,0 @@
1
- // Auto-generated JS for Brand Name Generator
2
- document.addEventListener("DOMContentLoaded", function () {
3
- const form = document.getElementById("contentToolForm");
4
- const tool = "brand_name_generator";
5
-
6
- // Wait for Quill to be initialized
7
- let quill;
8
- const checkQuill = setInterval(() => {
9
- if (window.quill) {
10
- quill = window.quill;
11
- clearInterval(checkQuill);
12
- }
13
- }, 100);
14
-
15
- let input0 = form.querySelector('[name="input0"]');
16
- let language = form.querySelector('[name="language"]');
17
- let tone = form.querySelector('[name="tone"]');
18
-
19
- form.addEventListener("submit", async function (e) {
20
- e.preventDefault();
21
-
22
- // Check if Quill is available
23
- if (!quill) {
24
- console.error("Quill editor not found");
25
- return;
26
- }
27
-
28
- // Show loading state
29
- const submitButton = form.querySelector('button[type="submit"]');
30
- const originalText = submitButton ? submitButton.textContent : '';
31
- if (submitButton) {
32
- submitButton.textContent = 'Generating...';
33
- submitButton.disabled = true;
34
- }
35
-
36
- const options = {};
37
-
38
- options["input[0]"] = input0.value;
39
- options["language"] = language.value;
40
- options["tone"] = tone.value;
41
-
42
- const body = {
43
- tool: tool,
44
- llm: "gemini",
45
- model_name: "gemini-2.0-flash",
46
- options: options
47
- };
48
-
49
- try {
50
- const response = await fetch("http://localhost:8000/api/v1/name-and-title-tools/brand-name-generator", {
51
- method: "POST",
52
- headers: {
53
- "Content-Type": "application/json"
54
- },
55
- body: JSON.stringify(body)
56
- });
57
-
58
- const data = await response.json();
59
-
60
- if (data.result) {
61
- // Clear the editor first
62
- quill.setText('');
63
-
64
- // Insert the content as plain text first
65
- quill.insertText(0, data.result);
66
-
67
- // Format the content for better readability
68
- const content = quill.getText();
69
- quill.setText('');
70
-
71
- // Parse and format the content
72
- const lines = content.split('\n');
73
- let index = 0;
74
-
75
- lines.forEach((line, i) => {
76
- if (line.trim()) {
77
- // Check if line starts with a number (like "1. ", "2. ", etc.)
78
- const isNumberedItem = /^\d+\./.test(line.trim());
79
-
80
- if (isNumberedItem) {
81
- // Split the numbered item into number and content
82
- const parts = line.trim().split(/^(\d+\.)\s*/);
83
- if (parts.length >= 3) {
84
- const number = parts[1];
85
- const content = parts[2];
86
-
87
- // Insert number in bold
88
- quill.insertText(index, number + ' ', { 'bold': true });
89
- index += number.length + 1;
90
-
91
- // Insert content in normal text
92
- quill.insertText(index, content);
93
- index += content.length;
94
- } else {
95
- quill.insertText(index, line);
96
- index += line.length;
97
- }
98
- } else {
99
- // Regular text
100
- quill.insertText(index, line);
101
- index += line.length;
102
- }
103
-
104
- // Add line break if not the last line
105
- if (i < lines.length - 1) {
106
- quill.insertText(index, '\n');
107
- index += 1;
108
- }
109
- }
110
- });
111
-
112
- console.log("✅ Content generated successfully");
113
- } else {
114
- quill.setText("No output received from server.");
115
- }
116
- } catch (err) {
117
- console.error("❌ API Error:", err);
118
- quill.setText("Error: " + err.message);
119
- } finally {
120
- // Reset button state
121
- if (submitButton) {
122
- submitButton.textContent = originalText;
123
- submitButton.disabled = false;
124
- }
125
- }
126
- });
127
- });
@@ -1,3 +0,0 @@
1
- $(function () {
2
- $('[data-toggle="tooltip"]').tooltip()
3
- })
@@ -1,82 +0,0 @@
1
- let input_editor, output_editor, data;
2
- output_editor = ace.edit("output_editor");
3
- output_editor.setReadOnly(true)
4
- output_editor.session.setMode("ace/mode/json");
5
- input_editor = ace.edit("input_editor");
6
- input_editor.session.setMode("ace/mode/json");
7
- let upload_div_inner = document.getElementById("upload_div_inner")
8
- let file_upload = document.getElementById("file_upload")
9
- let format_btn = document.getElementById("format_btn")
10
- let inputcopyButton = document.querySelector("#inputcopy");
11
- let outputcopyButton = document.querySelector("#outputcopy");
12
- let deleteEditorInputTxt = document.querySelector(".input_editor_bar .cross_icon");
13
- let deleteEditorOuputTxt = document.querySelector(".output_editor_bar .cross_icon");
14
- const siteName = file_upload.dataset.sitename
15
- let selectedFile
16
-
17
- upload_div_inner.onclick = function () {
18
- document.querySelector("#file_upload").click();
19
- };
20
- file_upload.onchange = function (e) {
21
- var input = e.target.files[0];
22
- selectedFile = input
23
- input_editor = ace.edit("input_editor");
24
- input_editor.session.setMode("ace/mode/json");
25
- var reader = new FileReader();
26
- reader.onload = function () {
27
- input_editor.setValue(reader.result);
28
- }
29
- reader.readAsText(input);
30
- };
31
- document.querySelector("#input_editor_bar .save_icon").onclick = function () {
32
- file_saving_decision(1);
33
- };
34
- editorActions();
35
- function editorActions() {
36
- deleteEditorInputTxt.onclick = function () {
37
- input_editor.setValue("");
38
- }
39
- deleteEditorOuputTxt.onclick = function () {
40
- output_editor.setValue("");
41
- }
42
- inputcopyButton.addEventListener("click", (e) => {
43
- const el = document.createElement("textarea");
44
- el.value = input_editor.getValue();
45
- document.body.appendChild(el);
46
- el.select();
47
- document.execCommand("copy");
48
- e.target.setAttribute('data-original-title', 'Copied !')
49
- })
50
- outputcopyButton.addEventListener("click", (e) => {
51
- const el = document.createElement("textarea");
52
- el.value = output_editor.getValue();
53
- document.body.appendChild(el);
54
- el.select();
55
- document.execCommand("copy");
56
- e.target.setAttribute('data-original-title', 'Copied !')
57
- })
58
- }
59
- function file_saving_decision(flag) {
60
- if (flag == 1) {
61
- if (input_editor.getValue == "" || input_editor.getValue == undefined) {
62
- return false;
63
- } else {
64
- file_download(input_editor.getValue(), "application/json", "json");
65
- }
66
- } else if (flag == 0) {
67
- if (output_editor.getValue == "" || output_editor.getValue == undefined) {
68
- return false;
69
- } else {
70
- file_download(output_editor.getValue(), "text/plain", "txt");
71
- }
72
- }
73
- }
74
- function file_download(code, mimetype, extension) {
75
- var a = document.createElement("a");
76
- var data = new Blob([code], {
77
- type: mimetype,
78
- });
79
- a.href = window.URL.createObjectURL(data);
80
- a.download = `${siteName}.` + extension;
81
- a.click();
82
- }