zet-lib 1.2.90 → 1.2.92
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.
- package/lib/Util.js +1 -1
- package/lib/zRoute.js +21 -1
- package/package.json +1 -1
package/lib/Util.js
CHANGED
|
@@ -1007,7 +1007,7 @@ Util.regexCode = (lengthMin, lengthMax) => {
|
|
|
1007
1007
|
}
|
|
1008
1008
|
|
|
1009
1009
|
Util.imageProfile = function (image = '') {
|
|
1010
|
-
return image ? (image.indexOf('http') > -1 ? image : '/uploads/
|
|
1010
|
+
return image ? (image.indexOf('http') > -1 ? image : '/uploads/zuser/' + image) : '/img/user.png'
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
1013
|
/*
|
package/lib/zRoute.js
CHANGED
|
@@ -2598,7 +2598,7 @@ zRoute.viewFormsSync = async (req, res, MYMODEL, data = {}) => {
|
|
|
2598
2598
|
<div class="ps-lg-4 my-5 text-lg-start col-lg-3 mb-3 float-end divhistory"><button title="History" class="btn btn-success image-button btn-rounded dimens2x" style="position: fixed;bottom: 100px;right: -40px; transform: rotate(90deg);" data-bs-toggle="modal" data-bs-target="#modal-history"><img src="/assets/icons/history.svg" class="icons-bg-white" alt="Delete"> <span>History Data</span></button></div>
|
|
2599
2599
|
|
|
2600
2600
|
`
|
|
2601
|
-
|
|
2601
|
+
moduleLib.slugHTML(req, res, contentModal)
|
|
2602
2602
|
let contentScript = `$(function(){
|
|
2603
2603
|
ajaxPost("/zhistory-data",{id:${data.id},table:"${MYMODEL.table}"},(data) => {$("#modal-body-history").html(data); if(data == "") {$(".divhistory").remove()}});
|
|
2604
2604
|
$("#${MYMODEL.table}-delete").on("click", (() => {
|
|
@@ -3261,6 +3261,26 @@ zRoute.generateJS = (req, res, MYMODEL, relations, zForms = '', data = {}) => {
|
|
|
3261
3261
|
dz.options.addedfile.call(dz, mockFile);
|
|
3262
3262
|
dz.options.thumbnail.call(dz, mockFile, "${process.env.APP_URL}/uploads/${MYMODEL.table}/${item}/"+item.fileName);
|
|
3263
3263
|
})
|
|
3264
|
+
setTimeout(function(){
|
|
3265
|
+
$(".dz-image-preview").each(function(){
|
|
3266
|
+
let src = $(this).find("img").attr("src");
|
|
3267
|
+
let ext = src.split('.').pop();
|
|
3268
|
+
ext = ext.toLowerCase();
|
|
3269
|
+
if(imagesTypeArray.includes(ext)) {
|
|
3270
|
+
$(this).on("click", function() {
|
|
3271
|
+
$(".zimage-modal").attr('src', src);
|
|
3272
|
+
$("#zmodal-image").modal("show");
|
|
3273
|
+
})
|
|
3274
|
+
} else {
|
|
3275
|
+
let mysrc = nonImagesTypeObject.hasOwnProperty(ext) ? nonImagesTypeObject[ext] : 'file.png';
|
|
3276
|
+
$(this).find("img").attr("src","/img/"+mysrc);
|
|
3277
|
+
$(this).on("click", function(){
|
|
3278
|
+
window.open(src, '_blank');
|
|
3279
|
+
})
|
|
3280
|
+
}
|
|
3281
|
+
|
|
3282
|
+
})
|
|
3283
|
+
},1000)
|
|
3264
3284
|
};
|
|
3265
3285
|
}
|
|
3266
3286
|
}); `
|