|
|
@ -1,4 +1,37 @@
|
|
|
|
/* Download an img */
|
|
|
|
/* Download an img */
|
|
|
|
|
|
|
|
function imgDownload(cmmFileDtls, appendElementId) {
|
|
|
|
|
|
|
|
const url = '<c:url value="/framework/biz/cmm/file/download.do"/>';
|
|
|
|
|
|
|
|
cmmFileDtls.forEach((dtl, idx) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fetch(
|
|
|
|
|
|
|
|
url
|
|
|
|
|
|
|
|
, {
|
|
|
|
|
|
|
|
method: 'post'
|
|
|
|
|
|
|
|
, body: JSON.stringify(dtl)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.then((response) => response.blob())
|
|
|
|
|
|
|
|
.then((blob) => {
|
|
|
|
|
|
|
|
const url = URL.createObjectURL(blob);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var x = document.createElement("img");
|
|
|
|
|
|
|
|
x.setAttribute("src", url);
|
|
|
|
|
|
|
|
//x.style = 'width:150px; display: block;';
|
|
|
|
|
|
|
|
x.style = 'height:150px;';
|
|
|
|
|
|
|
|
//x.setAttribute("width", "304");
|
|
|
|
|
|
|
|
//x.setAttribute("height", "228");
|
|
|
|
|
|
|
|
x.setAttribute("title", dtl.orginlFileNm);
|
|
|
|
|
|
|
|
x.setAttribute("alt", dtl.orginlFileNm);
|
|
|
|
|
|
|
|
document.querySelector(appendElementId).appendChild(x);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Revoke Blob URL after DOM updates..
|
|
|
|
|
|
|
|
//window.URL.revokeObjectURL(objectURL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function download(img) {
|
|
|
|
function download(img) {
|
|
|
|
var link = document.createElement("a");
|
|
|
|
var link = document.createElement("a");
|
|
|
|
link.href = img.src;
|
|
|
|
link.href = img.src;
|
|
|
@ -61,9 +94,8 @@ function addDownloadBtn() {
|
|
|
|
btn.style.top = btn.style.left = "0px";
|
|
|
|
btn.style.top = btn.style.left = "0px";
|
|
|
|
document.body.appendChild(btn);
|
|
|
|
document.body.appendChild(btn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
addDownloadBtn();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addDownloadBtn();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
images = document.querySelectorAll("img");
|
|
|
|
images = document.querySelectorAll("img");
|
|
|
@ -89,8 +121,6 @@ for (i of images) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 1; i < 35; i++) {
|
|
|
|
for (let i = 1; i < 35; i++) {
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
fetch(`https://testing-images/images-${i}.jpg`)
|
|
|
|
fetch(`https://testing-images/images-${i}.jpg`)
|
|
|
@ -111,7 +141,6 @@ for(let i=1; i<35; i++){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
urls.forEach(function (e) {
|
|
|
|
urls.forEach(function (e) {
|
|
|
|
fetch(e.download)
|
|
|
|
fetch(e.download)
|
|
|
|
.then(res => res.blob())
|
|
|
|
.then(res => res.blob())
|
|
|
@ -121,15 +150,9 @@ urls.forEach(function (e) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="tui-image-editor-container"></div>
|
|
|
|
<div id="tui-image-editor-container"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link
|
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
rel="stylesheet"
|
|
|
|
href="/resources/3rd-party/tui/image-editor-3.15.3/tui-image-editor.css"
|
|
|
|
href="/resources/3rd-party/tui/image-editor-3.15.3/tui-image-editor.css"
|
|
|
@ -137,14 +160,12 @@ urls.forEach(function (e) {
|
|
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.0/fabric.js"></script>
|
|
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.0/fabric.js"></script>
|
|
|
|
<script type="text/javascript" src="https://uicdn.toast.com/tui.code-snippet/v1.5.0/tui-code-snippet.min.js"></script>
|
|
|
|
<script type="text/javascript" src="https://uicdn.toast.com/tui.code-snippet/v1.5.0/tui-code-snippet.min.js"></script>
|
|
|
|
<script type="text/javascript" src="https://uicdn.toast.com/tui-color-picker/v2.2.6/tui-color-picker.js"></script>
|
|
|
|
<script type="text/javascript" src="https://uicdn.toast.com/tui-color-picker/v2.2.6/tui-color-picker.js"></script>
|
|
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.3/FileSaver.min.js"></script>
|
|
|
|
<script type="text/javascript"
|
|
|
|
|
|
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.3/FileSaver.min.js"></script>
|
|
|
|
<script type="text/javascript" src="/resources/3rd-party/tui/image-editor-3.15.3/tui-image-editor.js"></script>
|
|
|
|
<script type="text/javascript" src="/resources/3rd-party/tui/image-editor-3.15.3/tui-image-editor.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const options = {
|
|
|
|
const options = {
|
|
|
|
includeUI: {
|
|
|
|
includeUI: {
|
|
|
|
loadImage: {
|
|
|
|
loadImage: {
|
|
|
@ -163,7 +184,9 @@ const options = {
|
|
|
|
rotatingPointOffset: 70,
|
|
|
|
rotatingPointOffset: 70,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const imageEditor = new tui.ImageEditor(document.querySelector('#tui-image-editor-container'), options);
|
|
|
|
const imageEditor = new tui.ImageEditor(document.querySelector('#tui-image-editor-container'), options
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
;
|
|
|
|
tui.usageStatistics = false;
|
|
|
|
tui.usageStatistics = false;
|
|
|
|
// window.onresize = function () {
|
|
|
|
// window.onresize = function () {
|
|
|
|
// imageEditor.ui.resizeEditor();
|
|
|
|
// imageEditor.ui.resizeEditor();
|
|
|
|