|
|
@ -415,6 +415,31 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<label for="" id="refreshEnd--${pageName}" class="parentGrid" hidden></label>
|
|
|
|
<label for="" id="refreshEnd--${pageName}" class="parentGrid" hidden></label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template id="imgRadioTemplate--${pageName}">
|
|
|
|
|
|
|
|
<label class='mx-1'>
|
|
|
|
|
|
|
|
<div style='display:relative;'>
|
|
|
|
|
|
|
|
<input type="radio" name="{name}" class="form-check-input" value="{value}" checked="" />
|
|
|
|
|
|
|
|
<img src="{src}" width='200' height='200' style='display:absolute;'
|
|
|
|
|
|
|
|
data-crdn-photo-id="{crdnPhotoId}"
|
|
|
|
|
|
|
|
data-mosaic="{mosaic}"
|
|
|
|
|
|
|
|
onload='fn_photoMask($("#photoMask--top").is(":checked"),this);' />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template id="imgCheckboxTemplate--${pageName}">
|
|
|
|
|
|
|
|
<label class='mx-1'>
|
|
|
|
|
|
|
|
<div style='display:relative;'>
|
|
|
|
|
|
|
|
<input type="checkbox" name="{name}" class="form-check-input" value="{value}" />
|
|
|
|
|
|
|
|
<img src="{src}" width='200' height='200' style='display:absolute;'
|
|
|
|
|
|
|
|
data-crdn-photo-id="{crdnPhotoId}"
|
|
|
|
|
|
|
|
data-mosaic="{mosaic}"
|
|
|
|
|
|
|
|
onload='fn_photoMask($("#photoMask--top").is(":checked"),this);' />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
/**************************************************************************
|
|
|
|
/**************************************************************************
|
|
|
|
* Global Variable
|
|
|
|
* Global Variable
|
|
|
@ -527,7 +552,10 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
|
|
$P.uploadSet.onDatasetChange = () => {
|
|
|
|
$P.uploadSet.onDatasetChange = () => {
|
|
|
|
var files = $P.uploadSet.getDataset();
|
|
|
|
var files = $P.uploadSet.getDataset();
|
|
|
|
files.forEach(item => $P.localUploadArr.push(item));
|
|
|
|
files.forEach(function(item){
|
|
|
|
|
|
|
|
item.mosaic = "";
|
|
|
|
|
|
|
|
$P.localUploadArr.push(item);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnDisplay(false);
|
|
|
|
$P.fnDisplay(false);
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -564,7 +592,7 @@ $(document).ready(function(){
|
|
|
|
* pageObject.function
|
|
|
|
* pageObject.function
|
|
|
|
**************************************************************************/
|
|
|
|
**************************************************************************/
|
|
|
|
$P.fnMakeImgForExistFile = (fileArr) => {
|
|
|
|
$P.fnMakeImgForExistFile = (fileArr) => {
|
|
|
|
var tagsText = "";
|
|
|
|
var tagsTextArr = [];
|
|
|
|
|
|
|
|
|
|
|
|
for(var index = 0, j = 0; index < fileArr.length; index++){
|
|
|
|
for(var index = 0, j = 0; index < fileArr.length; index++){
|
|
|
|
var item = fileArr[index];
|
|
|
|
var item = fileArr[index];
|
|
|
@ -573,44 +601,50 @@ $(document).ready(function(){
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tagsText += "<label class='mx-2'>";
|
|
|
|
var template = document.getElementById("imgRadioTemplate--${pageName}").innerHTML;
|
|
|
|
tagsText += "<input type='radio' name='existPhoto' class='form-check-input' value='"+item.FILE_ID +"' ";
|
|
|
|
template = template.replace(/{name}/gi, "existPhoto");
|
|
|
|
if(index == 0){
|
|
|
|
template = template.replace(/{value}/gi, item.FILE_ID);
|
|
|
|
tagsText += " checked='checked' ";
|
|
|
|
template = template.replace(/{src}/gi, item.URL);
|
|
|
|
|
|
|
|
if(index != 0){
|
|
|
|
|
|
|
|
template = template.replace("checked=\"\"", "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tagsText += " />";
|
|
|
|
template = template.replace(/{crdnPhotoId}/gi, "exist"+item.FILE_ID+"${pageName}");
|
|
|
|
tagsText += "<img src='"+ item.URL +"' width='200' height='200' />";
|
|
|
|
template = template.replace(/{mosaic}/gi, item.MOSAIC);
|
|
|
|
tagsText += "</label>";
|
|
|
|
|
|
|
|
|
|
|
|
tagsTextArr.push(template);
|
|
|
|
|
|
|
|
|
|
|
|
if(j % 2 == 1){
|
|
|
|
if(j % 2 == 1){
|
|
|
|
tagsText += "<br />";
|
|
|
|
tagsTextArr.push("<br />");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
j++;
|
|
|
|
j++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return tagsText;
|
|
|
|
return tagsTextArr.join();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnMakeImgForNewFile = (fileArr) => {
|
|
|
|
$P.fnMakeImgForNewFile = (fileArr) => {
|
|
|
|
var tagsText = "";
|
|
|
|
var tagsTextArr = [];
|
|
|
|
|
|
|
|
|
|
|
|
for(var index = 0; index < fileArr.length; index++){
|
|
|
|
for(var index = 0; index < fileArr.length; index++){
|
|
|
|
var item = fileArr[index];
|
|
|
|
var item = fileArr[index];
|
|
|
|
|
|
|
|
|
|
|
|
tagsText += "<label class='mx-2'>";
|
|
|
|
var template = document.getElementById("imgCheckboxTemplate--${pageName}").innerHTML;
|
|
|
|
tagsText += "<input type='checkbox' name='newPhoto' class='form-check-input' value='"+item.id +"' ";
|
|
|
|
template = template.replace(/{name}/gi, "newPhoto");
|
|
|
|
tagsText += " />";
|
|
|
|
template = template.replace(/{value}/gi, item.id);
|
|
|
|
tagsText += "<img src='"+ item.url +"' width='200' height='200' />";
|
|
|
|
template = template.replace(/{src}/gi, item.url);
|
|
|
|
tagsText += "</label>";
|
|
|
|
template = template.replace(/{crdnPhotoId}/gi, "new"+item.id+"${pageName}");
|
|
|
|
|
|
|
|
template = template.replace(/{mosaic}/gi, item.mosaic);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tagsTextArr.push(template);
|
|
|
|
|
|
|
|
|
|
|
|
if(index % 2 == 1){
|
|
|
|
if(index % 2 == 1){
|
|
|
|
tagsText += "<br />";
|
|
|
|
tagsTextArr.push("<br />");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return tagsText;
|
|
|
|
return tagsTextArr.join();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnDisplay = (isExist) => {
|
|
|
|
$P.fnDisplay = (isExist) => {
|
|
|
@ -714,6 +748,7 @@ $(document).ready(function(){
|
|
|
|
var file = new File([blob], "capture-"+identify+".png", {type: "image/png"});
|
|
|
|
var file = new File([blob], "capture-"+identify+".png", {type: "image/png"});
|
|
|
|
file.id = "file-" + identify;
|
|
|
|
file.id = "file-" + identify;
|
|
|
|
file.url = (window.URL || window.webkitURL).createObjectURL(file);
|
|
|
|
file.url = (window.URL || window.webkitURL).createObjectURL(file);
|
|
|
|
|
|
|
|
file.mosaic = "";
|
|
|
|
$P.captureFileArr.push(file);
|
|
|
|
$P.captureFileArr.push(file);
|
|
|
|
if(index === array.length - 1){
|
|
|
|
if(index === array.length - 1){
|
|
|
|
$P.fnDisplay(false);
|
|
|
|
$P.fnDisplay(false);
|
|
|
@ -729,6 +764,7 @@ $(document).ready(function(){
|
|
|
|
modifiedFile.url = (window.URL || window.webkitURL).createObjectURL(modifiedFile);
|
|
|
|
modifiedFile.url = (window.URL || window.webkitURL).createObjectURL(modifiedFile);
|
|
|
|
|
|
|
|
|
|
|
|
if(isNumberPlate){
|
|
|
|
if(isNumberPlate){
|
|
|
|
|
|
|
|
modifiedFile.mosaic = "";
|
|
|
|
$P.numberPlateArr.push(modifiedFile);
|
|
|
|
$P.numberPlateArr.push(modifiedFile);
|
|
|
|
$P.fnDisplay(false);
|
|
|
|
$P.fnDisplay(false);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -737,6 +773,7 @@ $(document).ready(function(){
|
|
|
|
modifiedFile.URL = modifiedFile.url;
|
|
|
|
modifiedFile.URL = modifiedFile.url;
|
|
|
|
modifiedFile.FILE_ID = originalFileInfo.FILE_ID;
|
|
|
|
modifiedFile.FILE_ID = originalFileInfo.FILE_ID;
|
|
|
|
modifiedFile.status = "modified";
|
|
|
|
modifiedFile.status = "modified";
|
|
|
|
|
|
|
|
modifiedFile.MOSAIC = originalFileInfo.MOSAIC;
|
|
|
|
$P.existFileArr.splice(index, 1, modifiedFile);
|
|
|
|
$P.existFileArr.splice(index, 1, modifiedFile);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|