This commit is contained in:
sriramphanib committed 2023-03-11 17:30:20 +00:00
commit b6c4e025bc
5124 files changed
+1153349

No files matched your search

@@ -0,0 +1,760 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Communications;
(function (Communications) {
let Events;
(function (Events) {
let Components;
(function (Components) {
class Gallery extends Unibase.Platform.Core.BaseComponent {
constructor() {
super();
this.filePath = [];
this.documentId = [];
this.hashMapFilePath = {};
this.galleryCurrentId = '';
this.displayFileTypeEl = '';
this.fileTypeDate = [];
this.statusid = '';
this.galleryPage = 0;
this.carousel = '';
this.inputParameters = [];
this.elName = '';
this.isPlaying = false;
this.isDoc = false;
this.isDocCall = false;
this.reportIdGallery = null;
this.nextClickHandler = (e) => {
let instance = this;
if ($('.carousel-item.active').next().length === 1) {
$('.carousel-control-prev').removeClass('d-none');
if ($('.carousel-item.active').next().next().length === 0) {
if (!instance.isDocCall && $('._bizgaze_popup_container').length === 1) {
instance.loadMoreGallery();
}
else {
$('.carousel-control-next').addClass('d-none');
}
}
let bannerliked = $('.carousel-item.active').next().find('img').attr('data-bannerliked');
if (bannerliked == "false" || bannerliked == '' || bannerliked == null ||
bannerliked == 'undefined') {
$('.modelgallery').removeClass("fa fa-heart text-danger").addClass("icon-heart");
}
else {
$('.modelgallery').removeClass("icon-heart").addClass("fa fa-heart text-danger");
}
}
};
this.navigationhelper = Unibase.Platform.Helpers.NavigationHelper.Instance();
}
cssFiles() {
return [];
}
jsFiles() {
return ["apps/communications/events/managers/gallerymanager.js", "apps/communications/events/components/shareimage.js"];
}
load(id, containerid, callback) {
let Instance = this;
Instance.displayImages();
if (Instance.isDocCall) {
this.displayFileType();
}
let imagegalleryheading = $('#div_App_DefaultWidget').find('.biz-header-main-text').text();
$('#imagegalleryheading').text(imagegalleryheading);
let ContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
$(`#${ContainerId}`).find('.carousel-control-prev').click(this.prevClickHandler);
$(`#${ContainerId}`).find('.carousel-control-next').click(this.nextClickHandler);
$('#modellikebtn').click(function (e) {
let bannerfileid = $('.carousel-item.active').find('img').attr('data-bannerfileid');
let checkclass = $('#modellikebtn').find("i").hasClass('icon-heart');
if (checkclass == true) {
Instance.likePhoto(bannerfileid, true);
}
else {
Instance.likePhoto(bannerfileid, false);
}
});
$('.carousel').on('slide.bs.carousel', function (e) {
if (Instance.isPlaying) {
if ($('.carousel-item.active').next().length > 0) {
$('.carousel-control-prev').removeClass('d-none');
if ($('.carousel-item.active').next().next().length == 0) {
$('.carousel-control-next').addClass('d-none');
}
}
}
});
$('#btn_autoplay').click(function (e) {
Instance.isPlaying = true;
if ($(e.target).find('.fa-pause').length != 0) {
$(e.target).find('.fa-pause').removeClass('fa-pause').addClass('fa-play');
$('.carousel').carousel('pause');
Instance.isPlaying = false;
}
else {
$('.carousel').carousel('cycle');
$(e.target).find('.fa-play').removeClass('fa-play').addClass('fa-pause');
}
});
$('#galleryimagedownloadbtn').click((e) => {
if (this.isDoc) {
let docIdNumber = $('.carousel-item.active').find('img').attr('data-liid');
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('platform/controls/filedragndrop/w_documentfiles.js', function () {
Unibase.Platform.Forms.Components.DocumentFiles.Instance().downloadDocument(docIdNumber);
});
}
else {
let bannerfileid = $('.carousel-item.active').find('img').attr('data-bannerfileid');
let bannerenable = $('.carousel-item.active').find('img').attr('data-bannerenable');
let idnumberDoc = $('.carousel-item.active').find('img').attr('data-idnumber');
if ($('#modellikebtn').hasClass('d-none')) {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('platform/controls/filedragndrop/w_documentfiles.js', function () { Unibase.Platform.Forms.Components.DocumentFiles.Instance().downloadDocument(idnumberDoc); });
}
else if (bannerenable == 'true') {
Instance.downloadImage(bannerfileid);
}
}
});
$('#shareimggallery').click(function (e) {
let galleryIdImg = $('.carousel-item.active').find('img').attr('data-liId');
let galleryDocId = $('.carousel-item.active').find('img').attr('data-documentfileidimg');
Instance.shareImage(galleryDocId, galleryIdImg);
});
}
prevClickHandler(e) {
if ($('.carousel-item.active').prev().length === 1) {
$('.carousel-control-next').removeClass('d-none');
if ($('.carousel-item.active').prev().prev().length === 0) {
$('.carousel-control-prev').addClass('d-none');
}
let bannerliked = $('.carousel-item.active').prev().find('img').attr('data-bannerliked');
if (bannerliked == "false" || bannerliked == '' || bannerliked == null ||
bannerliked == 'undefined') {
$('.modelgallery').removeClass("fa fa-heart text-danger").addClass("icon-heart");
}
else {
$('.modelgallery').removeClass("icon-heart").addClass("fa fa-heart text-danger");
}
}
}
loadMoreGallery() {
let instance = this;
var fromDate = "";
var toDate = "";
var cf_fromDate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate;
var cf_toDate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate;
if (cf_fromDate != null && cf_toDate != null) {
fromDate = cf_fromDate.toString();
toDate = cf_toDate.toString();
}
else {
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
}
let ContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 2];
instance.reportIdGallery = $(`#${ContainerId}`).find('#hf_ReportId').val();
let objPayload = {
ReportId: Number(instance.reportIdGallery),
page: instance.galleryPage,
Filter: [],
InputParameters: instance.inputParameters,
pageSize: 5,
SearchTerm: null,
FilterId: 0,
DateFilter: [],
IsEnableCount: true,
DisplayModeTypeId: 1,
FromDate: fromDate,
ToDate: toDate,
viewerTypeId: 2,
IsDynamicFilterApplied: undefined,
IsPortletWidget: true,
};
Unibase.Platform.Analytics.Viewers.TemplateViewer.Instance().reportManager.getReportInfo(objPayload).then(function (reportresponse) {
if (reportresponse.result == null) {
console.log('reportresponse.result == null');
$('.carousel-control-next').addClass('d-none');
return;
}
if (reportresponse.result.ReportJsonData.Result.Data === '') {
$('.carousel-control-next').addClass('d-none');
return;
}
;
let dataObj = JSON.parse(reportresponse.result.ReportJsonData.Result.Data);
let newFilePath = [];
dataObj.forEach((currentImg, index) => {
let ContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
let screenHeight = screen.height;
let heightHeader = $(`#${ContainerId}`).find('.modal-header').first().outerHeight(true);
let heightFooter = $(`#${ContainerId}`).find('.modal-footer').first().outerHeight(true);
let sumHeight = (screenHeight - (heightHeader + heightFooter));
let fileType = currentImg.documentfilepath.split('.')[1].toLowerCase() != 'mp4' ? 'img' : 'video';
let file = currentImg.documentfilepath.slice(1, currentImg.documentfilepath.length);
let id = currentImg.documentfilename;
let bannerenable = currentImg.enabledownload;
let liId = currentImg.documentfileid;
let bannerliked = currentImg.liked === null ? '' : currentImg.liked;
newFilePath.push({ fileType, file, id, bannerenable, liId, bannerfileid: liId, bannerliked });
let details = navigator.userAgent;
let regexp = /android|iphone|kindle|ipad/i;
let isMobileDevice = regexp.test(details);
let el = '';
el = `${instance.elName}`;
if (instance.isDoc == false) {
if (isMobileDevice) {
if (fileType === 'video') {
$('.carousel-inner').append(` <div style="max-height: ${sumHeight}px !important" class="h-100 carousel-item "><video playsinline muted data-bannerenable="${bannerenable}" src="${file}" type="video/mp4" data-liId="${liId}" data-bannerfileid="${+liId}" data-bannerliked="${bannerliked}" onerror="sanitizeURL(event)" data-dynamic="1" data-loaded="0" class="mh-100 mw-100 w-100" controls autoplay loop webkit-playsinline webkitRequestFullscreen msRequestFullscreen style="object-fit: cover; padding-top:5vh;"></video></div>`);
}
else if (fileType === 'img') {
$('.carousel-inner').append(`<div style="max-height: ${sumHeight}px !important" class="carousel-item ">
<img data-bannerenable="${bannerenable}" class="mh-100 mw-100 w-100" data-liId="${liId}" src="${file}" data-bannerfileid="${+liId}" data-bannerliked="${bannerliked}" alt="image not found" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`);
}
$('.carousel-inner').css('padding', 0);
}
else {
if (fileType === 'video') {
$('.carousel-inner').append(` <div style="max-height: ${sumHeight}px !important" class=" carousel-item "><video muted data-bannerenable="${bannerenable}" data-bannerfileid="${+liId}" data-bannerliked="${bannerliked}" data-liId="${liId}" playsinline src="${file}" type="video/mp4" onerror="sanitizeURL(event)" data-dynamic="1" data-loaded="0" class=" mh-100 mw-100" controls autoplay loop webkit-playsinline webkitRequestFullscreen msRequestFullscreen style="object-fit: cover;"></video></div>`);
}
else if (fileType === 'img') {
$('.carousel-inner').append(`<div style="text-align:center;" class="carousel-item" >
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${liId}" data-bannerenable="${bannerenable}" data-bannerfileid="${+liId}" data-bannerliked="${bannerliked}" src="${file}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0"">
</div>`);
}
}
}
if (instance.isDoc) {
if (isMobileDevice) {
if (currentImg.documenttypename === 'png' || currentImg.documenttypename === 'jpg' || currentImg.documenttypename === 'jpeg') {
$('.carousel-inner').append(`<div style="max-height: ${sumHeight}px !important" class="carousel-item ">
<img class="mh-100 mw-100 w-100" data-liId="${currentImg.documentfileid}" data-idnumber="${currentImg.documentfileid}" src="${currentImg.documentfilepath}" alt="image not found" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`);
}
else if (currentImg.documenttypename === 'pdf' || currentImg.documenttypename === 'word' || currentImg.documenttypename === 'excel' || currentImg.fileType != 'removeme') {
$('.carousel-inner').append(`<div style="max-height: ${sumHeight}px !important" class="carousel-item ">
<img class="mh-100 mw-100 w-100" data-liId="${currentImg.documentfileid}" data-idnumber="${currentImg.documentfileid}" src="/tenants/themes/compact/imgs/pdfimgdoc.png" alt="${currentImg.documenttypename}" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`);
}
$('.carousel-inner').css('padding', 0);
}
else {
if (currentImg.documenttypename === 'png' || currentImg.documenttypename === 'jpg' || currentImg.documenttypename === 'jpeg' || currentImg.fileType === 'svg') {
$('.carousel-inner').append(`<div style="text-align:center;" class="carousel-item">
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${currentImg.documentfileid}" data-idnumber="${currentImg.documentfileid}" src="${currentImg.documentfilepath}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0">
</div>`);
}
else if (currentImg.documenttypename === 'pdf' || currentImg.documenttypename === 'word' || currentImg.documenttypename === 'excel' || currentImg.fileType != 'removeme') {
$('.carousel-inner').append(`<div style="text-align:center;" class="carousel-item">
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
width:100px;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${currentImg.documentfileid}" data-idnumber="${currentImg.documentfileid}" src="/tenants/themes/compact/imgs/pdfimgdoc.png" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0">
</div>`);
}
}
}
$('.carousel-control-next').removeClass('d-none');
});
instance.galleryPage++;
});
let bannerliked = $('.carousel-item.active').next().find('img').attr('data-bannerliked');
if (bannerliked == "false" || bannerliked == '' || bannerliked == null ||
bannerliked == 'undefined') {
$('.modelgallery').removeClass("fa fa-heart text-danger").addClass("icon-heart");
}
else {
$('.modelgallery').removeClass("icon-heart").addClass("fa fa-heart text-danger");
}
}
init(containerid) {
}
html(id, containerid) {
let html = `
<div id="img-modal" class="modal-content h-100">
<div class="modal-header pa-10"> <strong class="modal-title biz-highlight-bg-color" id="imagegalleryheading">Gallery</strong>
<div class="d-flex align-items-center justify-content-between">
<div> <button type="button"
id="btn_autoplay"
class="btn btn-icon btn-icon-circle btn-warning btn-icon-style-3" ><span style="pointer-events:none" class="btn-icon-wrap"><i class="fa fa-play"></i></span></button> <button id="shareimggallery" class="btn btn-icon btn-icon-circle btn-warning btn-icon-style-3" href="javascript:;"
"><span class="btn-icon-wrap"><i class="fa fa-share-alt"></i></span></button> <button
class="btn btn-icon btn-icon-circle btn-success btn-icon-style-3" id="galleryimagedownloadbtn" href="javascript:;"><span
class="btn-icon-wrap"><i class="fa fa-download"></i></span></button> </div>
</div>
<div id="divEditFiltersErrMsg" class="form-error-message"></div>
</div>
<div class="modal-body simple-scroll-bar edit-filters-body py-0 bg-cyan-light-5">
<div class="d-flex" id="galleryheightmodel" style="gap: 10px;align-items: center;height:80vh">
<a style="opacity: 1; width:20px; " class="carousel-control-prev d-none position-static" href="#carouselExampleControls" role="button"
data-slide="prev"> <span style="background-image: none;" class="carousel-control-prev-icon"
aria-hidden="true"> <i class="fa fa-angle-double-left " style=" color: black; font-size: 34px; "></i>
</span> <span class="preImgHandler sr-only">Previous</span> </a>
<div class="card bg-transparent border-0 shadow-none" id="staticFiltersCard" style="
flex-grow: 1;
">
<div id="carouselExampleControls" data-interval="2000" class="carousel slide-fade" data-ride="carousel">
<div class="carousel-inner " style="padding:0px 100px "> </div>
</div>
</div>
<a style="opacity: 1;width: 20px;" class="carousel-control-next position-static" href="#carouselExampleControls" role="button"
data-slide="next"> <span style="background-image: none;" class="carousel-control-next-icon"
aria-hidden="true"> <i class="fa fa-angle-double-right" style=" color: black; font-size: 34px;"></i>
</span> <span class="sr-only ">Next</span> </a>
</div>
</div>
<div class="modal-footer pa-10"> <button type="button"
onclick="Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp()" id="btn_CloseForm_${id}"
class="btn btn-light btn-sm mr-auto">Close</button>
<div> <button id="modellikebtn" class="btn btn-icon btn-icon-circle btn-liked btn-danger btn-icon-style-3"
href="javascript:;"><span class="btn-icon-wrap"><i class="modelgallery icon-heart"></i></span></button> <a
class="badge badge-soft-info badge-pill align-items-center justify-content-center biz-highlight-text-color"
href="javascript:;" onclick="">1235 <i class="fa fa-thumbs-up ml-1"></i></a> </div>
</div>
</div>`;
return html;
}
openModalFile(currentElId) {
this.galleryPage = 2;
this.elName = '.documenttypegapCustom';
let Instance = this;
Instance.isDocCall = true;
this.displayFileTypeEl = currentElId;
let ContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
this.isDoc = true;
Instance.fileTypeDate = [];
let el = '';
if ($('._bizgaze_popup_container').length === 0) {
el = `.documenttypegapCustom`;
}
else {
el = `._bizgaze_popup_container .documenttypegapCustom`;
}
$(el).each(function (i, e) {
let fileType = $(e).find('[data-filetype]').val();
fileType = `${fileType}`.toLowerCase();
let documentfilepath = $(`#list-group-item-${$(e).find('[data-documentfileidCus]').val()}`).find('[data-documentfilepath]').val();
let id = $(e).find('[data-documentfileidCus]').val();
debugger;
Instance.fileTypeDate.push({
id,
fileType,
documentfilepath,
dataIdNumber: $(e).find('[data-documentfileidCus]').val()
});
});
}
displayFileType() {
let Instance = this;
let ContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
if (this.isDoc) {
$('#shareimggallery').addClass('d-none');
$('#modellikebtn').addClass('d-none');
$('.fa-thumbs-up').parent().addClass('d-none');
}
let screenHeight = screen.height;
let heightHeader = $(`#${ContainerId}`).find('.modal-header').first().outerHeight(true);
let heightFooter = $(`#${ContainerId}`).find('.modal-footer').first().outerHeight(true);
let sumHeight = (screenHeight - (heightHeader + heightFooter));
$('.carousel-inner').html('');
Instance.fileTypeDate.forEach(function (e, i) {
let active = '';
if (Instance.displayFileTypeEl == +e.id) {
active = 'active';
}
debugger;
let details = navigator.userAgent;
let regexp = /android|iphone|kindle|ipad/i;
let isMobileDevice = regexp.test(details);
if (isMobileDevice) {
if (e.fileType === 'png' || e.fileType === 'jpg' || e.fileType === 'jpeg') {
$('.carousel-inner').append(`<div style="max-height: ${sumHeight}px !important" class="carousel-item ${active} ">
<img class="mh-100 mw-100 w-100" data-liId="${e.dataIdNumber}" data-idnumber="${e.dataIdNumber}" src="${e.documentfilepath}" alt="image not found" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`);
}
else if (e.fileType === 'mp4') {
$('.carousel-inner').append(`<div style="max-height: ${sumHeight}px !important" class="carousel-item ${active} ">
<video class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${e.id}" data-idnumber="${e.dataIdNumber}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0" controls > <source src="${e.documentfilepath.replace('~/', '')}" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>`);
}
else if (e.fileType === 'txt' || e.fileType === 'pdf') {
$('.carousel-inner').append(`<div style="max-height: ${sumHeight}px !important" class="carousel-item ${active} ">
<iframe src='${e.documentfilepath.replace('~/', '')}' title="W3Schools Free Online Web Tutorials"></iframe>
</div>`);
}
else if (e.fileType === 'pdf' || e.fileType === 'word' || e.fileType === 'excel' || e.fileType != 'removeme') {
$('.carousel-inner').append(`<div data-pathsrc="${e.documentfilepath}" style="max-height: ${sumHeight}px !important" class="carousel-item ${active} ">
<img class="mh-100 mw-100 w-100" data-liId="${e.dataIdNumber}" data-idnumber="${e.dataIdNumber}" src="/tenants/themes/compact/imgs/pdfimgdoc.png" alt="image not found" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`);
}
$('.carousel-inner').css('padding', 0);
}
else {
if (e.fileType === 'png' || e.fileType === 'jpg' || e.fileType === 'jpeg' || e.fileType === 'svg') {
$('.carousel-inner').append(`<div style="text-align:center;" class="carousel-item ${active}">
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${e.id}" data-idnumber="${e.dataIdNumber}" src="${e.documentfilepath}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0">
</div>`);
}
else if (e.fileType === 'mp4') {
$('.carousel-inner').append(`<div style="text-align:center;" class="carousel-item ${active}">
<video style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${e.id}" data-idnumber="${e.dataIdNumber}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0" controls > <source src="${e.documentfilepath.replace('~/', '')}" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>`);
}
else if (e.fileType === 'txt' || e.fileType === 'pdf') {
$('.carousel-inner').append(`<div style="text-align:center;" data-pathsrc="${e.documentfilepath}" class="carousel-item ${active}">
<iframe style="
height: 80vh !important;
margin-top: 5vh;
width:100%;
" src='${e.documentfilepath.replace('~/', '')}' title="W3Schools Free Online Web Tutorials"></iframe>
</div>`);
}
else if (e.fileType === 'word' || e.fileType === 'excel' || e.fileType != 'removeme') {
$('.carousel-inner').append(`<div style="text-align:center;" data-pathsrc="${e.documentfilepath}" class="carousel-item ${active}">
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
width:100px;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${e.id}" data-idnumber="${e.dataIdNumber}" src="/tenants/themes/compact/imgs/pdfimgdoc.png" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0">
</div>`);
}
}
});
$('.carousel').carousel({
interval: 2000,
wrap: false,
});
$('.carousel').carousel('pause');
if ($('.carousel-item.active').next().length === 0) {
if ($('._bizgaze_popup_container').length === 1) {
$('.carousel-control-next').addClass('d-none');
Instance.loadMoreGallery();
}
}
else {
$('.carousel-control-next').removeClass('d-none');
}
if ($('.carousel-item.active').prev().length === 0) {
$('.carousel-control-prev').addClass('d-none');
}
else {
$('.carousel-control-prev').removeClass('d-none');
}
Instance.isDocCall = false;
}
filePathPush(galleryCurrentId) {
let Instance = this;
this.galleryCurrentId = galleryCurrentId;
let ContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[0];
Instance.galleryPage = 2;
Instance.elName = `.banner-media`;
Instance.filePath = [];
let el = '';
if ($('._bizgaze_popup_container').length === 0) {
el = `.banner-media`;
}
else {
el = `._bizgaze_popup_container .banner-media`;
}
$(el).each(function (i, e) {
let file = '';
let fileType = '';
let id = $(e).parents('.gallery-list').attr('data-documentfileidimg');
if (id == '') {
id = $(e).parents('.gallery-list').attr('data-otherid');
}
let liId = $(e).parents('.gallery-list').attr('id');
liId = liId.replace(/list-group-item-/g, '');
let bannerfileid = $(e).parents('.gallery-list').find('.bannerfileid').val();
let bannerliked = $(e).parents('.gallery-list').find('.bannerliked').val();
let bannerenable = $(e).parents('.gallery-list').find('.enabledownload').val();
if ($(this).find('img').length === 1) {
fileType = 'img';
file = $(this).find('img').attr('src');
}
else if ($(this).find('video').length === 1) {
fileType = 'video';
file = $(this).find('video').attr('src');
}
if (!Instance.hashMapFilePath[id]) {
Instance.hashMapFilePath[id] = true;
}
Instance.filePath.push({ fileType, file, id, bannerfileid, bannerliked, liId, bannerenable });
});
}
displayImages() {
let Instance = this;
let ContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
$('.carousel-inner').html('');
let screenHeight = screen.height;
let heightHeader = $(`#${ContainerId}`).find('.modal-header').first().outerHeight(true);
let heightFooter = $(`#${ContainerId}`).find('.modal-footer').first().outerHeight(true);
let sumHeight = (screenHeight - (heightHeader + heightFooter));
this.filePath.forEach(function (e, i) {
let active = '';
if (Instance.galleryCurrentId == e.id) {
active = 'active';
if (e.bannerliked == "false" || e.bannerliked == '' || e.bannerliked == null ||
e.bannerliked == 'undefined') {
$('.modelgallery').removeClass("fa fa-heart text-danger").addClass("icon-heart");
}
else {
$('.modelgallery').removeClass("icon-heart").addClass("fa fa-heart text-danger");
}
if (e.bannerenable == 'false') {
$('#galleryimagedownloadbtn').addClass('d-none');
}
}
let details = navigator.userAgent;
let regexp = /android|iphone|kindle|ipad/i;
let isMobileDevice = regexp.test(details);
if (isMobileDevice) {
if (e.fileType === 'video') {
$('.carousel-inner').append(` <div style="max-height: ${sumHeight}px !important" class="h-100 carousel-item ${active}"><video playsinline muted data-bannerenable="${e.bannerenable}" src="${e.file}" type="video/mp4" data-liId="${e.liId}" data-bannerfileid="${e.bannerfileid}" data-bannerliked="${e.bannerliked}" onerror="sanitizeURL(event)" data-dynamic="1" data-loaded="0" class="mh-100 mw-100 w-100" controls autoplay loop webkit-playsinline webkitRequestFullscreen msRequestFullscreen style="object-fit: cover; padding-top:5vh;"></video></div>`);
}
else if (e.fileType === 'img') {
$('.carousel-inner').append(`<div style="max-height: ${sumHeight}px !important" class="carousel-item ${active} ">
<img data-bannerenable="${e.bannerenable}" class="mh-100 mw-100 w-100" data-liId="${e.liId}" src="${e.file}" data-bannerfileid="${e.bannerfileid}" data-bannerliked="${e.bannerliked}" alt="image not found" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`);
}
$('.carousel-inner').css('padding', 0);
}
else {
if (e.fileType === 'video') {
$('.carousel-inner').append(` <div style="max-height: ${sumHeight}px !important" class=" carousel-item ${active}"><video muted data-bannerenable="${e.bannerenable}" data-bannerfileid="${e.bannerfileid}" data-bannerliked="${e.bannerliked}" data-liId="${e.liId}" playsinline src="${e.file}" type="video/mp4" onerror="sanitizeURL(event)" data-dynamic="1" data-loaded="0" class=" mh-100 mw-100" controls autoplay loop webkit-playsinline webkitRequestFullscreen msRequestFullscreen style="object-fit: cover;"></video></div>`);
}
else if (e.fileType === 'img') {
$('.carousel-inner').append(`<div style="text-align:center;" class="carousel-item ${active}">
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${e.liId}" data-bannerenable="${e.bannerenable}" data-bannerfileid="${e.bannerfileid}" data-bannerliked="${e.bannerliked}" src="${e.file}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0"">
</div>`);
}
}
});
$('.carousel').carousel({
wrap: false
});
$('.carousel').carousel('pause');
if ($('.carousel-item.active').next().length === 0) {
if (!Instance.isDoc && $('._bizgaze_popup_container').length === 1) {
Instance.loadMoreGallery();
}
else {
$('.carousel-control-next').addClass('d-none');
}
}
else {
$('.carousel-control-next').removeClass('d-none');
}
if ($('.carousel-item.active').prev().length === 0) {
$('.carousel-control-prev').addClass('d-none');
}
else {
$('.carousel-control-prev').removeClass('d-none');
}
}
likePhoto(documentfileId, isLiked) {
if (documentfileId != 0) {
var data = {
PhotoId: Number(documentfileId),
LikedBy: Unibase.Platform.Membership.Infos.Identity.currentUser.userId,
Liked: isLiked
};
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/communications/events/managers/gallerymanager.js", function () {
Bizgaze.Apps.Communications.Events.Managers.GalleryManager.Instance().changephotplike(data).then((responce) => {
if (responce.result != null) {
if (responce.result.Liked) {
$("gallery_liked_" + responce.result.PhotoId).closest(".gallery-list").addClass("liked-image");
$("#gallery_liked_" + responce.result.PhotoId).removeClass("icon-heart").addClass("fa fa-heart text-danger");
$(`[data-documentfileidimg="${responce.result.PhotoId}"]`).find('.bannerliked').attr('value', 'true');
$('#modellikebtn').find('i').removeClass("icon-heart").addClass("fa fa-heart text-danger");
}
else {
$("#gallery_liked_" + responce.result.PhotoId).removeClass("fa fa-heart text-danger").addClass("icon-heart");
$(`[data-documentfileidimg="${responce.result.PhotoId}"]`).find('.bannerliked').attr('value', 'false');
$('#modellikebtn').find('i').removeClass("fa fa-heart text-danger").addClass("icon-heart");
}
}
});
});
}
}
downloadImage(documentfileId, isTrue) {
if (isTrue) {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('platform/controls/ filedragndrop/w_documentfiles.js', function () {
Unibase.Platform.Forms.Components.DocumentFiles.Instance().downloadDocument(documentfileId);
});
return;
}
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/controls/filedragndrop/w_documentfiles.js", function () {
Unibase.Platform.Forms.Components.DocumentFiles.Instance().downloadDocument(documentfileId);
});
}
shareImage(documentfileId, galleryId) {
var instance = this;
instance.documentfileId = documentfileId;
instance.galleryId = galleryId;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/communications/events/components/shareimage.js", function () {
var obj = new Bizgaze.Apps.Communications.Events.Components.ShareImage;
instance.navigationHelper.popup(0, '', obj, null, Unibase.Platform.Helpers.Size.Large);
});
}
deleteImage(DocumentFileId, galleryId) {
var instance = this;
instance.documentfileId = DocumentFileId;
instance.galleryId = galleryId;
bootbox.confirm("Are you sure?", function (result) {
if (!result)
return;
instance.fileCacheHelper.loadJsFile("platform/files/managers/filemanager.js", function () {
Unibase.Platform.Files.Managers.FileManager.Instance().deleteDocumentFile(DocumentFileId).then(function (response) {
if (response.message == 'File Deleted Successfully') {
$('.photoidCustom[data-documentfileidimg="' + DocumentFileId + '"]').remove();
}
});
var detailobj = Unibase.Themes.Compact.Components.Details.Instance();
detailobj._recordId = Unibase.Themes.Providers.DetailHelper.recordId;
detailobj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
detailobj._containerId = $("._bizgaze_detail_container:visible").attr("id");
var idetailObj = detailobj;
detailobj.loadPortlets(idetailObj);
});
});
}
importPortability(containerid) {
var instance = this;
$('.sp_widget_create_' + containerid + '').find('#LinkButton').click(function () {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('platform/portability/components/portability.js', function () {
let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
let portabilityinstance = 'Unibase.Platform.Portability.Components.ImportAndExport.Instance()';
var jsinstance = eval(portabilityinstance);
var component = jsinstance;
var appSettingComponent = jsinstance;
if (appSettingComponent !== null && appSettingComponent !== undefined) {
appSettingComponent.appSettings.InstalledAppId = InstalledAppId;
}
if (component != null && component != undefined) {
instance.navigationhelper.popup(0, '', component, function () {
}, Unibase.Platform.Helpers.Size.Large);
}
});
});
}
predictedimages() {
var eventid = Unibase.Themes.Providers.Detail_Settings.instance.InputParameters.find(f => f.Key.endsWith('eventid')).Value;
this.navigationhelper.showLoading();
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/communications/events/managers/gallerymanager.js", function () {
bootbox.alert("Face Detection Initiated !<br> Sit back and relax", function () {
bootbox.alert("You will receive a notification once Face Recognition is completed.!<br>Sit back and relax !", function () {
Bizgaze.Apps.Communications.Events.Managers.GalleryManager.Instance().predictedImages().then((response) => {
if (response === 'ALL MATCH FOUND') {
this.navigationhelper.hideLoading();
bootbox.alert("Sucess");
}
else {
this.navigationhelper.hideLoading();
}
});
});
});
});
}
eventWisePrediction(eventId) {
var instance = this;
instance.eventid = eventId;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/communications/events/managers/gallerymanager.js", function () {
var imgbase64 = "~/tenants/themes/compact/imgs/alertimg.png";
bootbox.alert("The prediction has started", function () {
Bizgaze.Apps.Communications.Events.Managers.GalleryManager.Instance().eventWisePredictedImages(eventId).then((response) => {
if (response === 'ALL MATCH FOUND') {
instance.navigationhelper = Unibase.Platform.Helpers.NavigationHelper.Instance();
instance.navigationhelper.hideLoading();
bootbox.alert("Sucess");
$("#widgetconfig_Predict").show();
}
else {
instance.navigationhelper.hideLoading();
$("#widgetconfig_Predict").show();
}
});
});
});
}
aprovedImage(DocumentFileId, statusid) {
var instance = this;
instance.documentfileId = DocumentFileId;
instance.statusid = statusid;
instance.fileCacheHelper.loadJsFile("apps/communications/events/managers/gallerymanager.js", function () {
Bizgaze.Apps.Communications.Events.Managers.GalleryManager.Instance().approvedImage(DocumentFileId, statusid).then(function (response) {
});
var detailobj = Unibase.Themes.Compact.Components.Details.Instance();
detailobj._recordId = Unibase.Themes.Providers.DetailHelper.recordId;
detailobj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
detailobj._containerId = $("._bizgaze_detail_container:visible").attr("id");
var idetailObj = detailobj;
detailobj.loadPortlets(idetailObj);
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Gallery();
}
return this.instance;
}
}
Components.Gallery = Gallery;
})(Components = Events.Components || (Events.Components = {}));
})(Events = Communications.Events || (Communications.Events = {}));
})(Communications = Apps.Communications || (Apps.Communications = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["gallery.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAi7BhB;AAj7BD,WAAU,OAAO;IACb,IAAiB,IAAI,CA+6BpB;IA/6BD,WAAiB,IAAI;QACjB,IAAiB,cAAc,CA66B9B;QA76BD,WAAiB,cAAc;YAC3B,IAAiB,MAAM,CA26BtB;YA36BD,WAAiB,MAAM;gBACnB,IAAiB,UAAU,CAy6B1B;gBAz6BD,WAAiB,UAAU;oBACvB,MAAa,OAAQ,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa;wBAqB5D;4BACI,KAAK,EAAE,CAAC;4BArBZ,aAAQ,GAAG,EAAE,CAAC;4BACd,eAAU,GAAG,EAAE,CAAC;4BAChB,oBAAe,GAAG,EAAE,CAAC;4BACrB,qBAAgB,GAAG,EAAE,CAAC;4BACtB,sBAAiB,GAAQ,EAAE,CAAC;4BAC5B,iBAAY,GAAG,EAAE,CAAC;4BAClB,aAAQ,GAAQ,EAAE,CAAC;4BACnB,gBAAW,GAAG,CAAC,CAAC;4BAChB,aAAQ,GAAQ,EAAE,CAAC;4BAEnB,oBAAe,GAAe,EAAE,CAAC;4BAEjC,WAAM,GAAQ,EAAE,CAAC;4BACjB,cAAS,GAAY,KAAK,CAAC;4BAE3B,UAAK,GAAY,KAAK,CAAC;4BACvB,cAAS,GAAY,KAAK,CAAC;4BAC3B,oBAAe,GAAQ,IAAI,CAAC;4BAgV5B,qBAAgB,GAAG,CAAC,CA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,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,EAAE,CAALine truncated
+133
View File
@@ -0,0 +1,133 @@
var Bizgaze;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i extends Unibase.Platform.Core.BaseComponent{constructor(){super();this.filePath=[];this.documentId=[];this.hashMapFilePath={};this.galleryCurrentId="";this.displayFileTypeEl="";this.fileTypeDate=[];this.statusid="";this.galleryPage=0;this.carousel="";this.inputParameters=[];this.elName="";this.isPlaying=!1;this.isDoc=!1;this.isDocCall=!1;this.reportIdGallery=null;this.nextClickHandler=()=>{let n=this;if($(".carousel-item.active").next().length===1){$(".carousel-control-prev").removeClass("d-none");$(".carousel-item.active").next().next().length===0&&(n.isDocCall||$("._bizgaze_popup_container").length!==1?$(".carousel-control-next").addClass("d-none"):n.loadMoreGallery());let t=$(".carousel-item.active").next().find("img").attr("data-bannerliked");t=="false"||t==""||t==null||t=="undefined"?$(".modelgallery").removeClass("fa fa-heart text-danger").addClass("icon-heart"):$(".modelgallery").removeClass("icon-heart").addClass("fa fa-heart text-danger")}};this.navigationhelper=Unibase.Platform.Helpers.NavigationHelper.Instance()}cssFiles(){return[]}jsFiles(){return["apps/communications/events/managers/gallerymanager.js","apps/communications/events/components/shareimage.js"]}load(){let n=this;n.displayImages();n.isDocCall&&this.displayFileType();let i=$("#div_App_DefaultWidget").find(".biz-header-main-text").text();$("#imagegalleryheading").text(i);let t=Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length-1];$(`#${t}`).find(".carousel-control-prev").click(this.prevClickHandler);$(`#${t}`).find(".carousel-control-next").click(this.nextClickHandler);$("#modellikebtn").click(function(){let t=$(".carousel-item.active").find("img").attr("data-bannerfileid"),i=$("#modellikebtn").find("i").hasClass("icon-heart");i==!0?n.likePhoto(t,!0):n.likePhoto(t,!1)});$(".carousel").on("slide.bs.carousel",function(){n.isPlaying&&$(".carousel-item.active").next().length>0&&($(".carousel-control-prev").removeClass("d-none"),$(".carousel-item.active").next().next().length==0&&$(".carousel-control-next").addClass("d-none"))});$("#btn_autoplay").click(function(t){n.isPlaying=!0;$(t.target).find(".fa-pause").length!=0?($(t.target).find(".fa-pause").removeClass("fa-pause").addClass("fa-play"),$(".carousel").carousel("pause"),n.isPlaying=!1):($(".carousel").carousel("cycle"),$(t.target).find(".fa-play").removeClass("fa-play").addClass("fa-pause"))});$("#galleryimagedownloadbtn").click(()=>{if(this.isDoc){let n=$(".carousel-item.active").find("img").attr("data-liid");Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/controls/filedragndrop/w_documentfiles.js",function(){Unibase.Platform.Forms.Components.DocumentFiles.Instance().downloadDocument(n)})}else{let t=$(".carousel-item.active").find("img").attr("data-bannerfileid"),i=$(".carousel-item.active").find("img").attr("data-bannerenable"),r=$(".carousel-item.active").find("img").attr("data-idnumber");$("#modellikebtn").hasClass("d-none")?Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/controls/filedragndrop/w_documentfiles.js",function(){Unibase.Platform.Forms.Components.DocumentFiles.Instance().downloadDocument(r)}):i=="true"&&n.downloadImage(t)}});$("#shareimggallery").click(function(){let t=$(".carousel-item.active").find("img").attr("data-liId"),i=$(".carousel-item.active").find("img").attr("data-documentfileidimg");n.shareImage(i,t)})}prevClickHandler(){if($(".carousel-item.active").prev().length===1){$(".carousel-control-next").removeClass("d-none");$(".carousel-item.active").prev().prev().length===0&&$(".carousel-control-prev").addClass("d-none");let n=$(".carousel-item.active").prev().find("img").attr("data-bannerliked");n=="false"||n==""||n==null||n=="undefined"?$(".modelgallery").removeClass("fa fa-heart text-danger").addClass("icon-heart"):$(".modelgallery").removeClass("icon-heart").addClass("fa fa-heart text-danger")}}loadMoreGallery(){let n=this;var i="",r="",u=Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate,f=Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate;u!=null&&f!=null?(i=u.toString(),r=f.toString()):(i=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()),"YYYY/MM/DD"),r=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()),"YYYY/MM/DD"));let e=Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length-2];n.reportIdGallery=$(`#${e}`).find("#hf_ReportId").val();let o={ReportId:Number(n.reportIdGallery),page:n.galleryPage,Filter:[],InputParameters:n.inputParameters,pageSize:5,SearchTerm:null,FilterId:0,DateFilter:[],IsEnableCount:!0,DisplayModeTypeId:1,FromDate:i,ToLine truncated
<img data-bannerenable="${o}" class="mh-100 mw-100 w-100" data-liId="${i}" src="${e}" data-bannerfileid="${+i}" data-bannerliked="${s}" alt="image not found" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`),$(".carousel-inner").css("padding",0)):f==="video"?$(".carousel-inner").append(` <div style="max-height: ${u}px !important" class=" carousel-item "><video muted data-bannerenable="${o}" data-bannerfileid="${+i}" data-bannerliked="${s}" data-liId="${i}" playsinline src="${e}" type="video/mp4" onerror="sanitizeURL(event)" data-dynamic="1" data-loaded="0" class=" mh-100 mw-100" controls autoplay loop webkit-playsinline webkitRequestFullscreen msRequestFullscreen style="object-fit: cover;"></video></div>`):f==="img"&&$(".carousel-inner").append(`<div style="text-align:center;" class="carousel-item" >
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${i}" data-bannerenable="${o}" data-bannerfileid="${+i}" data-bannerliked="${s}" src="${e}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0"">
</div>`));n.isDoc&&(c?(t.documenttypename==="png"||t.documenttypename==="jpg"||t.documenttypename==="jpeg"?$(".carousel-inner").append(`<div style="max-height: ${u}px !important" class="carousel-item ">
<img class="mh-100 mw-100 w-100" data-liId="${t.documentfileid}" data-idnumber="${t.documentfileid}" src="${t.documentfilepath}" alt="image not found" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`):(t.documenttypename==="pdf"||t.documenttypename==="word"||t.documenttypename==="excel"||t.fileType!="removeme")&&$(".carousel-inner").append(`<div style="max-height: ${u}px !important" class="carousel-item ">
<img class="mh-100 mw-100 w-100" data-liId="${t.documentfileid}" data-idnumber="${t.documentfileid}" src="/tenants/themes/compact/imgs/pdfimgdoc.png" alt="${t.documenttypename}" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`),$(".carousel-inner").css("padding",0)):t.documenttypename==="png"||t.documenttypename==="jpg"||t.documenttypename==="jpeg"||t.fileType==="svg"?$(".carousel-inner").append(`<div style="text-align:center;" class="carousel-item">
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${t.documentfileid}" data-idnumber="${t.documentfileid}" src="${t.documentfilepath}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0">
</div>`):(t.documenttypename==="pdf"||t.documenttypename==="word"||t.documenttypename==="excel"||t.fileType!="removeme")&&$(".carousel-inner").append(`<div style="text-align:center;" class="carousel-item">
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
width:100px;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${t.documentfileid}" data-idnumber="${t.documentfileid}" src="/tenants/themes/compact/imgs/pdfimgdoc.png" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0">
</div>`));$(".carousel-control-next").removeClass("d-none")});n.galleryPage++});let t=$(".carousel-item.active").next().find("img").attr("data-bannerliked");t=="false"||t==""||t==null||t=="undefined"?$(".modelgallery").removeClass("fa fa-heart text-danger").addClass("icon-heart"):$(".modelgallery").removeClass("icon-heart").addClass("fa fa-heart text-danger")}init(){}html(n){return`
<div id="img-modal" class="modal-content h-100">
<div class="modal-header pa-10"> <strong class="modal-title biz-highlight-bg-color" id="imagegalleryheading">Gallery</strong>
<div class="d-flex align-items-center justify-content-between">
<div> <button type="button"
id="btn_autoplay"
class="btn btn-icon btn-icon-circle btn-warning btn-icon-style-3" ><span style="pointer-events:none" class="btn-icon-wrap"><i class="fa fa-play"></i></span></button> <button id="shareimggallery" class="btn btn-icon btn-icon-circle btn-warning btn-icon-style-3" href="javascript:;"
"><span class="btn-icon-wrap"><i class="fa fa-share-alt"></i></span></button> <button
class="btn btn-icon btn-icon-circle btn-success btn-icon-style-3" id="galleryimagedownloadbtn" href="javascript:;"><span
class="btn-icon-wrap"><i class="fa fa-download"></i></span></button> </div>
</div>
<div id="divEditFiltersErrMsg" class="form-error-message"></div>
</div>
<div class="modal-body simple-scroll-bar edit-filters-body py-0 bg-cyan-light-5">
<div class="d-flex" id="galleryheightmodel" style="gap: 10px;align-items: center;height:80vh">
<a style="opacity: 1; width:20px; " class="carousel-control-prev d-none position-static" href="#carouselExampleControls" role="button"
data-slide="prev"> <span style="background-image: none;" class="carousel-control-prev-icon"
aria-hidden="true"> <i class="fa fa-angle-double-left " style=" color: black; font-size: 34px; "></i>
</span> <span class="preImgHandler sr-only">Previous</span> </a>
<div class="card bg-transparent border-0 shadow-none" id="staticFiltersCard" style="
flex-grow: 1;
">
<div id="carouselExampleControls" data-interval="2000" class="carousel slide-fade" data-ride="carousel">
<div class="carousel-inner " style="padding:0px 100px "> </div>
</div>
</div>
<a style="opacity: 1;width: 20px;" class="carousel-control-next position-static" href="#carouselExampleControls" role="button"
data-slide="next"> <span style="background-image: none;" class="carousel-control-next-icon"
aria-hidden="true"> <i class="fa fa-angle-double-right" style=" color: black; font-size: 34px;"></i>
</span> <span class="sr-only ">Next</span> </a>
</div>
</div>
<div class="modal-footer pa-10"> <button type="button"
onclick="Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp()" id="btn_CloseForm_${n}"
class="btn btn-light btn-sm mr-auto">Close</button>
<div> <button id="modellikebtn" class="btn btn-icon btn-icon-circle btn-liked btn-danger btn-icon-style-3"
href="javascript:;"><span class="btn-icon-wrap"><i class="modelgallery icon-heart"></i></span></button> <a
class="badge badge-soft-info badge-pill align-items-center justify-content-center biz-highlight-text-color"
href="javascript:;" onclick="">1235 <i class="fa fa-thumbs-up ml-1"></i></a> </div>
</div>
</div>`}openModalFile(n){this.galleryPage=2;this.elName=".documenttypegapCustom";let t=this;t.isDocCall=!0;this.displayFileTypeEl=n;let r=Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length-1];this.isDoc=!0;t.fileTypeDate=[];let i="";i=$("._bizgaze_popup_container").length===0?`.documenttypegapCustom`:`._bizgaze_popup_container .documenttypegapCustom`;$(i).each(function(n,i){let r=$(i).find("[data-filetype]").val();r=`${r}`.toLowerCase();let u=$(`#list-group-item-${$(i).find("[data-documentfileidCus]").val()}`).find("[data-documentfilepath]").val(),f=$(i).find("[data-documentfileidCus]").val();t.fileTypeDate.push({id:f,fileType:r,documentfilepath:u,dataIdNumber:$(i).find("[data-documentfileidCus]").val()})})}displayFileType(){let n=this,i=Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length-1];this.isDoc&&($("#shareimggallery").addClass("d-none"),$("#modellikebtn").addClass("d-none"),$(".fa-thumbs-up").parent().addClass("d-none"));let r=screen.height,u=$(`#${i}`).find(".modal-header").first().outerHeight(!0),f=$(`#${i}`).find(".modal-footer").first().outerHeight(!0),t=r-(u+f);$(".carousel-inner").html("");n.fileTypeDate.forEach(function(i){let r="";n.displayFileTypeEl==+i.id&&(r="active");let u=navigator.userAgent,f=/android|iphone|kindle|ipad/i.test(u);f?(i.fileType==="png"||i.fileType==="jpg"||i.fileType==="jpeg"?$(".carousel-inner").append(`<div style="max-height: ${t}px !important" class="carousel-item ${r} ">
<img class="mh-100 mw-100 w-100" data-liId="${i.dataIdNumber}" data-idnumber="${i.dataIdNumber}" src="${i.documentfilepath}" alt="image not found" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`):i.fileType==="mp4"?$(".carousel-inner").append(`<div style="max-height: ${t}px !important" class="carousel-item ${r} ">
<video class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${i.id}" data-idnumber="${i.dataIdNumber}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0" controls > <source src="${i.documentfilepath.replace("~/","")}" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>`):i.fileType==="txt"||i.fileType==="pdf"?$(".carousel-inner").append(`<div style="max-height: ${t}px !important" class="carousel-item ${r} ">
<iframe src='${i.documentfilepath.replace("~/","")}' title="W3Schools Free Online Web Tutorials"></iframe>
</div>`):(i.fileType==="pdf"||i.fileType==="word"||i.fileType==="excel"||i.fileType!="removeme")&&$(".carousel-inner").append(`<div data-pathsrc="${i.documentfilepath}" style="max-height: ${t}px !important" class="carousel-item ${r} ">
<img class="mh-100 mw-100 w-100" data-liId="${i.dataIdNumber}" data-idnumber="${i.dataIdNumber}" src="/tenants/themes/compact/imgs/pdfimgdoc.png" alt="image not found" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`),$(".carousel-inner").css("padding",0)):i.fileType==="png"||i.fileType==="jpg"||i.fileType==="jpeg"||i.fileType==="svg"?$(".carousel-inner").append(`<div style="text-align:center;" class="carousel-item ${r}">
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${i.id}" data-idnumber="${i.dataIdNumber}" src="${i.documentfilepath}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0">
</div>`):i.fileType==="mp4"?$(".carousel-inner").append(`<div style="text-align:center;" class="carousel-item ${r}">
<video style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${i.id}" data-idnumber="${i.dataIdNumber}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0" controls > <source src="${i.documentfilepath.replace("~/","")}" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>`):i.fileType==="txt"||i.fileType==="pdf"?$(".carousel-inner").append(`<div style="text-align:center;" data-pathsrc="${i.documentfilepath}" class="carousel-item ${r}">
<iframe style="
height: 80vh !important;
margin-top: 5vh;
width:100%;
" src='${i.documentfilepath.replace("~/","")}' title="W3Schools Free Online Web Tutorials"></iframe>
</div>`):(i.fileType==="word"||i.fileType==="excel"||i.fileType!="removeme")&&$(".carousel-inner").append(`<div style="text-align:center;" data-pathsrc="${i.documentfilepath}" class="carousel-item ${r}">
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
width:100px;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${i.id}" data-idnumber="${i.dataIdNumber}" src="/tenants/themes/compact/imgs/pdfimgdoc.png" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0">
</div>`)});$(".carousel").carousel({interval:2e3,wrap:!1});$(".carousel").carousel("pause");$(".carousel-item.active").next().length===0?$("._bizgaze_popup_container").length===1&&($(".carousel-control-next").addClass("d-none"),n.loadMoreGallery()):$(".carousel-control-next").removeClass("d-none");$(".carousel-item.active").prev().length===0?$(".carousel-control-prev").addClass("d-none"):$(".carousel-control-prev").removeClass("d-none");n.isDocCall=!1}filePathPush(n){let t=this;this.galleryCurrentId=n;let r=Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[0];t.galleryPage=2;t.elName=`.banner-media`;t.filePath=[];let i="";i=$("._bizgaze_popup_container").length===0?`.banner-media`:`._bizgaze_popup_container .banner-media`;$(i).each(function(n,i){let u="",f="",r=$(i).parents(".gallery-list").attr("data-documentfileidimg");r==""&&(r=$(i).parents(".gallery-list").attr("data-otherid"));let e=$(i).parents(".gallery-list").attr("id");e=e.replace(/list-group-item-/g,"");let o=$(i).parents(".gallery-list").find(".bannerfileid").val(),s=$(i).parents(".gallery-list").find(".bannerliked").val(),h=$(i).parents(".gallery-list").find(".enabledownload").val();$(this).find("img").length===1?(f="img",u=$(this).find("img").attr("src")):$(this).find("video").length===1&&(f="video",u=$(this).find("video").attr("src"));t.hashMapFilePath[r]||(t.hashMapFilePath[r]=!0);t.filePath.push({fileType:f,file:u,id:r,bannerfileid:o,bannerliked:s,liId:e,bannerenable:h})})}displayImages(){let n=this,i=Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length-1];$(".carousel-inner").html("");let r=screen.height,u=$(`#${i}`).find(".modal-header").first().outerHeight(!0),f=$(`#${i}`).find(".modal-footer").first().outerHeight(!0),t=r-(u+f);this.filePath.forEach(function(i){let r="";n.galleryCurrentId==i.id&&(r="active",i.bannerliked=="false"||i.bannerliked==""||i.bannerliked==null||i.bannerliked=="undefined"?$(".modelgallery").removeClass("fa fa-heart text-danger").addClass("icon-heart"):$(".modelgallery").removeClass("icon-heart").addClass("fa fa-heart text-danger"),i.bannerenable=="false"&&$("#galleryimagedownloadbtn").addClass("d-none"));let u=navigator.userAgent,f=/android|iphone|kindle|ipad/i.test(u);f?(i.fileType==="video"?$(".carousel-inner").append(` <div style="max-height: ${t}px !important" class="h-100 carousel-item ${r}"><video playsinline muted data-bannerenable="${i.bannerenable}" src="${i.file}" type="video/mp4" data-liId="${i.liId}" data-bannerfileid="${i.bannerfileid}" data-bannerliked="${i.bannerliked}" onerror="sanitizeURL(event)" data-dynamic="1" data-loaded="0" class="mh-100 mw-100 w-100" controls autoplay loop webkit-playsinline webkitRequestFullscreen msRequestFullscreen style="object-fit: cover; padding-top:5vh;"></video></div>`):i.fileType==="img"&&$(".carousel-inner").append(`<div style="max-height: ${t}px !important" class="carousel-item ${r} ">
<img data-bannerenable="${i.bannerenable}" class="mh-100 mw-100 w-100" data-liId="${i.liId}" src="${i.file}" data-bannerfileid="${i.bannerfileid}" data-bannerliked="${i.bannerliked}" alt="image not found" onerror="ReloadImage(event)" style="
padding-top: 5vh;
" data-dynamic="1" data-loaded="0">
</div>`),$(".carousel-inner").css("padding",0)):i.fileType==="video"?$(".carousel-inner").append(` <div style="max-height: ${t}px !important" class=" carousel-item ${r}"><video muted data-bannerenable="${i.bannerenable}" data-bannerfileid="${i.bannerfileid}" data-bannerliked="${i.bannerliked}" data-liId="${i.liId}" playsinline src="${i.file}" type="video/mp4" onerror="sanitizeURL(event)" data-dynamic="1" data-loaded="0" class=" mh-100 mw-100" controls autoplay loop webkit-playsinline webkitRequestFullscreen msRequestFullscreen style="object-fit: cover;"></video></div>`):i.fileType==="img"&&$(".carousel-inner").append(`<div style="text-align:center;" class="carousel-item ${r}">
<img style="
height: auto !important;
max-height: 80vh !important;
margin-top: 5vh;
" class="d-block mh-100 mw-100 ml-auto mr-auto" data-liId="${i.liId}" data-bannerenable="${i.bannerenable}" data-bannerfileid="${i.bannerfileid}" data-bannerliked="${i.bannerliked}" src="${i.file}" alt="image not found" onerror="ReloadImage(event)" data-dynamic="1" data-loaded="0"">
</div>`)});$(".carousel").carousel({wrap:!1});$(".carousel").carousel("pause");$(".carousel-item.active").next().length===0?n.isDoc||$("._bizgaze_popup_container").length!==1?$(".carousel-control-next").addClass("d-none"):n.loadMoreGallery():$(".carousel-control-next").removeClass("d-none");$(".carousel-item.active").prev().length===0?$(".carousel-control-prev").addClass("d-none"):$(".carousel-control-prev").removeClass("d-none")}likePhoto(t,i){if(t!=0){var r={PhotoId:Number(t),LikedBy:Unibase.Platform.Membership.Infos.Identity.currentUser.userId,Liked:i};Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/communications/events/managers/gallerymanager.js",function(){n.Apps.Communications.Events.Managers.GalleryManager.Instance().changephotplike(r).then(n=>{n.result!=null&&(n.result.Liked?($("gallery_liked_"+n.result.PhotoId).closest(".gallery-list").addClass("liked-image"),$("#gallery_liked_"+n.result.PhotoId).removeClass("icon-heart").addClass("fa fa-heart text-danger"),$(`[data-documentfileidimg="${n.result.PhotoId}"]`).find(".bannerliked").attr("value","true"),$("#modellikebtn").find("i").removeClass("icon-heart").addClass("fa fa-heart text-danger")):($("#gallery_liked_"+n.result.PhotoId).removeClass("fa fa-heart text-danger").addClass("icon-heart"),$(`[data-documentfileidimg="${n.result.PhotoId}"]`).find(".bannerliked").attr("value","false"),$("#modellikebtn").find("i").removeClass("fa fa-heart text-danger").addClass("icon-heart")))})})}}downloadImage(n,t){if(t){Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/controls/ filedragndrop/w_documentfiles.js",function(){Unibase.Platform.Forms.Components.DocumentFiles.Instance().downloadDocument(n)});return}Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/controls/filedragndrop/w_documentfiles.js",function(){Unibase.Platform.Forms.Components.DocumentFiles.Instance().downloadDocument(n)})}shareImage(t,i){var r=this;r.documentfileId=t;r.galleryId=i;Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/communications/events/components/shareimage.js",function(){var t=new n.Apps.Communications.Events.Components.ShareImage;r.navigationHelper.popup(0,"",t,null,Unibase.Platform.Helpers.Size.Large)})}deleteImage(n,t){var i=this;i.documentfileId=n;i.galleryId=t;bootbox.confirm("Are you sure?",function(t){t&&i.fileCacheHelper.loadJsFile("platform/files/managers/filemanager.js",function(){var t,i;Unibase.Platform.Files.Managers.FileManager.Instance().deleteDocumentFile(n).then(function(t){t.message=="File Deleted Successfully"&&$('.photoidCustom[data-documentfileidimg="'+n+'"]').remove()});t=Unibase.Themes.Compact.Components.Details.Instance();t._recordId=Unibase.Themes.Providers.DetailHelper.recordId;t._installedAppId=Unibase.Themes.Providers.DetailHelper.installedAppId;t._containerId=$("._bizgaze_detail_container:visible").attr("id");i=t;t.loadPortlets(i)})})}importPortability(n){var t=this;$(".sp_widget_create_"+n+"").find("#LinkButton").click(function(){Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/portability/components/portability.js",function(){let u=Unibase.Themes.Providers.DetailHelper.installedAppId;var r=eval("Unibase.Platform.Portability.Components.ImportAndExport.Instance()"),n=r,i=r;i!==null&&i!==undefined&&(i.appSettings.InstalledAppId=u);n!=null&&n!=undefined&&t.navigationhelper.popup(0,"",n,function(){},Unibase.Platform.Helpers.Size.Large)})})}predictedimages(){var t=Unibase.Themes.Providers.Detail_Settings.instance.InputParameters.find(n=>n.Key.endsWith("eventid")).Value;this.navigationhelper.showLoading();Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/communications/events/managers/gallerymanager.js",function(){bootbox.alert("Face Detection Initiated !<br> Sit back and relax",function(){bootbox.alert("You will receive a notification once Face Recognition is completed.!<br>Sit back and relax !",function(){n.Apps.Communications.Events.Managers.GalleryManager.Instance().predictedImages().then(n=>{n==="ALL MATCH FOUND"?(this.navigationhelper.hideLoading(),bootbox.alert("Sucess")):this.navigationhelper.hideLoading()})})})})}eventWisePrediction(t){var i=this;i.eventid=t;Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/communications/events/managers/gallerymanager.js",function(){bootbox.alert("The prediction has started",function(){n.Apps.Communications.Events.Managers.GalleryManager.Instance().eventWisePredictedImages(t).then(n=>{n==="ALL MATCH FOUND"?(i.navigationhelper=Unibase.Platform.Helpers.NavigationHelper.Instance(),i.navigationhelper.hideLoading(),bootbox.alert("Sucess"),$("#widgetconfig_Predict").show()):(i.navigationhelper.hideLoading(),$("#widgetconfig_Predict").show())})})})}aprovedImage(t,i){var r=this;r.documentfileId=t;r.statusid=i;r.fileCacheHelper.loadJsFile("apps/communications/events/managers/gallerymanager.js",function(){var r,u;n.Apps.Communications.Events.ManageLine truncated
@@ -0,0 +1,125 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Communications;
(function (Communications) {
let Events;
(function (Events) {
let Components;
(function (Components) {
class ShareImage extends Unibase.Platform.Core.BaseComponent {
constructor() {
super();
this.gallery = Bizgaze.Apps.Communications.Events.Components.Gallery.Instance();
this.guestArray = [];
this.currentImg = '';
this.navigationhelper = Unibase.Platform.Helpers.NavigationHelper.Instance();
}
cssFiles() {
return [];
}
jsFiles() {
return ['apps/communications/events/managers/gallerymanager.js'];
}
html(id, containerid) {
var html = `<div class="modal-header pa-10">
<strong class="modal-title biz-highlight-bg-color">Share Images</strong>
<div id="divShareImageErrMsg" class="form-error-message"></div>
</div>
<div data-simplebar class="simple-scroll-bar modal-body">
<!--<div class="card" id="Share-Guest-photo">
<div class="card-header">Select Guest To Share</div>
<div class="card-body">
<select id="guestsMultiSelect" class="form-control guest-multiselect"></select>
</div>
</div>-->
<div class="card" id="Share-Guest-photo">
<div class="card-header">Select Apps To Share</div>
<div class="card-body">
<a href="https://www.facebook.com/sharer/sharer.php?u=" " target="_blank" class="btn btn-rounded mr-10 font-20 text-white shareEventFacebook" style="background-color:#1DA1F2;" title="facebook"> <i class="fa fa-facebook"></i></a>
<a href="https://twitter.com/intent/tweet?
url=@Url.Encode(Request.Url.ToString())&text=@Url.Encode(Title)" target="_blank" class="shareEventTwitter btn btn-rounded mr-10 font-20 text-white" style="background-color:#1DA1F2;" title="Tweet" >
<i class="fa fa-twitter"></i>
</a>
<a href="https://api.whatsapp.com/send/?text="
" target="_blank" class="btn btn-rounded mr-10 font-20 text-white shareEventWhatsapp " style="background-color:#25D366;" >
<i class="fa fa-whatsapp"></i>
</a>
<a href="https://www.linkedin.com/sharing/share-offsite/?url=" " target="_blank" class="btn btn-rounded mr-10 font-20 text-white shareEventLinkedin" style="background-color:#1DA1F2;" title="linkedin"> <i class="fa fa-linkedin"></i></a> </div>
</div>
</div>
<!--<div class="modal-footer pa-10">
<a href="javascript:;" id="shareImageCloseBtn" class="btn btn-light btn-sm mr-auto">Close</a>
<a href="javascript:;" class="btn btn-icon btn-icon-circle btn-primary btn-icon-style-2 btn-rounded" id="shareImages"><span class="btn-icon-wrap"><i class="fa fa-paper-plane"></i></span></a>
</div>-->`;
return html;
}
load(id, containerid, callback) {
var instance = this;
var html = "";
Bizgaze.Apps.Communications.Events.Managers.GalleryManager.Instance().getGuestUsers().then((response) => {
instance.guestArray = response.result;
const data = [];
response.result.forEach(function (obj) {
data.push({ id: obj.guestid, text: obj.guestname });
});
$('#guestsMultiSelect').select2({
placeholder: "Select Guests",
multiple: true,
data: data
});
});
$("#shareImages").click(function (e) {
e.preventDefault();
instance.shareImage(instance.gallery.documentfileId, instance.gallery.galleryId);
});
debugger;
let domainName = window.location.origin;
debugger;
let imageUrl = domainName + $(`[data-documentfileidimg="${Bizgaze.Apps.Communications.Events.Components.Gallery.Instance().documentfileId}"]`).find('.biz-bannerimg').attr('src');
$('.shareEventFacebook').attr('href', `https://www.facebook.com/sharer/sharer.php?u=${imageUrl}`);
$('.shareEventTwitter').attr('href', `http://twitter.com/share?text=&url=${imageUrl}`);
$('.shareEventWhatsapp').attr('href', `https://api.whatsapp.com/send/?text=${imageUrl}`);
$('.shareEventLinkedin').attr('href', `https://www.linkedin.com/sharing/share-offsite/?url==${imageUrl}`);
$('#shareImageCloseBtn').click(function () {
instance.navigationHelper.closePopUp();
});
}
shareImage(documentFileId, galleryId) {
debugger;
let selectedGuests = $('#guestsMultiSelect').val();
selectedGuests = selectedGuests.map(Number);
if (selectedGuests.length > 0) {
var data = {
UserIds: selectedGuests,
ImageId: documentFileId,
GalleryId: galleryId,
};
Bizgaze.Apps.Communications.Events.Managers.GalleryManager.Instance().shareImage(data).then((response) => {
if (response.status == Unibase.Data.Status.Error) {
MessageHelper.Instance().showError(response.message, "divShareImageErrMsg");
}
else {
MessageHelper.Instance().showSuccess(response.message, "divShareImageErrMsg");
Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp();
}
});
}
else {
MessageHelper.Instance().showError("Select Atleast One User", "divShareImageErrMsg");
}
}
static Instance() {
if (this.instance === undefined) {
this.instance = new ShareImage();
}
return this.instance;
}
}
Components.ShareImage = ShareImage;
})(Components = Events.Components || (Events.Components = {}));
})(Events = Communications.Events || (Communications.Events = {}));
})(Communications = Apps.Communications || (Apps.Communications = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"shareimage.js","sourceRoot":"","sources":["shareimage.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CA8JhB;AA9JD,WAAU,OAAO;IACb,IAAiB,IAAI,CA4JpB;IA5JD,WAAiB,IAAI;QACjB,IAAiB,cAAc,CA0J9B;QA1JD,WAAiB,cAAc;YAC3B,IAAiB,MAAM,CAwJtB;YAxJD,WAAiB,MAAM;gBACnB,IAAiB,UAAU,CAsJ1B;gBAtJD,WAAiB,UAAU;oBACvB,MAAa,UAAW,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa;wBAK/D;4BACI,KAAK,EAAE,CAAC;4BAJZ,YAAO,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;4BAC3E,eAAU,GAAG,EAAE,CAAC;4BAChB,eAAU,GAAW,EAAE,CAAC;4BAGpB,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC;wBACjF,CAAC;wBACD,QAAQ;4BACJ,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,OAAO;4BACH,OAAO,CAAC,uDAAuD,CAAC,CAAC;wBACrE,CAAC;wBACD,IAAI,CAAC,EAAE,EAAE,WAAW;4BAChB,IAAI,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA6BH,CAAC;4BAET,OAAO,IAAI,CAAC;wBAChB,CAAC;wBAED,IAAI,CAAC,EAAE,EAAE,WAAW,EAA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,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;qCAC/E;yCACI;wCACD,aAAa,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;wCAC9E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,CAAC;qCACrE;gCACL,CAAC,CAAC,CAAC;6BACN;iCAAM;gCACH,aAAa,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,yBAAyB,EAAE,qBAAqB,CAAC,CAAC;6BACxF;wBAEL,CAAC;wBAED,MAAM,CAAC,QAAQ;4BACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;gCAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,UAAU,EAAE,CAAC;6BACpC;4BACD,OAAO,IAAI,CAAC,QAAQ,CAAC;wBACzB,CAAC;qBACJ;oBApJY,qBAAU,aAoJtB,CAAA;gBACL,CAAC,EAtJgB,UAAU,GAAV,iBAAU,KAAV,iBAAU,QAsJ1B;YACL,CAAC,EAxJgB,MAAM,GAAN,qBAAM,KAAN,qBAAM,QAwJtB;QACL,CAAC,EA1JgB,cAAc,GAAd,mBAAc,KAAd,mBAAc,QA0J9B;IACL,CAAC,EA5JgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QA4JpB;AACL,CAAC,EA9JS,OAAO,KAAP,OAAO,QA8JhB"}
+30
View File
@@ -0,0 +1,30 @@
var Bizgaze;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i extends Unibase.Platform.Core.BaseComponent{constructor(){super();this.gallery=n.Apps.Communications.Events.Components.Gallery.Instance();this.guestArray=[];this.currentImg="";this.navigationhelper=Unibase.Platform.Helpers.NavigationHelper.Instance()}cssFiles(){return[]}jsFiles(){return["apps/communications/events/managers/gallerymanager.js"]}html(){return`<div class="modal-header pa-10">
<strong class="modal-title biz-highlight-bg-color">Share Images</strong>
<div id="divShareImageErrMsg" class="form-error-message"></div>
</div>
<div data-simplebar class="simple-scroll-bar modal-body">
<!--<div class="card" id="Share-Guest-photo">
<div class="card-header">Select Guest To Share</div>
<div class="card-body">
<select id="guestsMultiSelect" class="form-control guest-multiselect"></select>
</div>
</div>-->
<div class="card" id="Share-Guest-photo">
<div class="card-header">Select Apps To Share</div>
<div class="card-body">
<a href="https://www.facebook.com/sharer/sharer.php?u=" " target="_blank" class="btn btn-rounded mr-10 font-20 text-white shareEventFacebook" style="background-color:#1DA1F2;" title="facebook"> <i class="fa fa-facebook"></i></a>
<a href="https://twitter.com/intent/tweet?
url=@Url.Encode(Request.Url.ToString())&text=@Url.Encode(Title)" target="_blank" class="shareEventTwitter btn btn-rounded mr-10 font-20 text-white" style="background-color:#1DA1F2;" title="Tweet" >
<i class="fa fa-twitter"></i>
</a>
<a href="https://api.whatsapp.com/send/?text="
" target="_blank" class="btn btn-rounded mr-10 font-20 text-white shareEventWhatsapp " style="background-color:#25D366;" >
<i class="fa fa-whatsapp"></i>
</a>
<a href="https://www.linkedin.com/sharing/share-offsite/?url=" " target="_blank" class="btn btn-rounded mr-10 font-20 text-white shareEventLinkedin" style="background-color:#1DA1F2;" title="linkedin"> <i class="fa fa-linkedin"></i></a> </div>
</div>
</div>
<!--<div class="modal-footer pa-10">
<a href="javascript:;" id="shareImageCloseBtn" class="btn btn-light btn-sm mr-auto">Close</a>
<a href="javascript:;" class="btn btn-icon btn-icon-circle btn-primary btn-icon-style-2 btn-rounded" id="shareImages"><span class="btn-icon-wrap"><i class="fa fa-paper-plane"></i></span></a>
</div>-->`}load(){var t=this;n.Apps.Communications.Events.Managers.GalleryManager.Instance().getGuestUsers().then(n=>{t.guestArray=n.result;const i=[];n.result.forEach(function(n){i.push({id:n.guestid,text:n.guestname})});$("#guestsMultiSelect").select2({placeholder:"Select Guests",multiple:!0,data:i})});$("#shareImages").click(function(n){n.preventDefault();t.shareImage(t.gallery.documentfileId,t.gallery.galleryId)});let r=window.location.origin;let i=r+$(`[data-documentfileidimg="${n.Apps.Communications.Events.Components.Gallery.Instance().documentfileId}"]`).find(".biz-bannerimg").attr("src");$(".shareEventFacebook").attr("href",`https://www.facebook.com/sharer/sharer.php?u=${i}`);$(".shareEventTwitter").attr("href",`http://twitter.com/share?text=&url=${i}`);$(".shareEventWhatsapp").attr("href",`https://api.whatsapp.com/send/?text=${i}`);$(".shareEventLinkedin").attr("href",`https://www.linkedin.com/sharing/share-offsite/?url==${i}`);$("#shareImageCloseBtn").click(function(){t.navigationHelper.closePopUp()})}shareImage(t,i){let r=$("#guestsMultiSelect").val();if(r=r.map(Number),r.length>0){var u={UserIds:r,ImageId:t,GalleryId:i};n.Apps.Communications.Events.Managers.GalleryManager.Instance().shareImage(u).then(n=>{n.status==Unibase.Data.Status.Error?MessageHelper.Instance().showError(n.message,"divShareImageErrMsg"):(MessageHelper.Instance().showSuccess(n.message,"divShareImageErrMsg"),Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp())})}else MessageHelper.Instance().showError("Select Atleast One User","divShareImageErrMsg")}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.ShareImage=i})(i=t.Components||(t.Components={}))})(i=t.Events||(t.Events={}))})(i=t.Communications||(t.Communications={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));