This commit is contained in:
2023-03-11 17:30:20 +00:00
commit b6c4e025bc
5124 changed files with 1153349 additions and 0 deletions
@@ -0,0 +1,698 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let Common;
(function (Common) {
class Download extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.requestId = 0;
this.actionsWhileCreatingNewFile = [];
}
downloadDocumentFile(FileId, documentGroup, documnetfilename, savetype, documentContainer) {
if (documentGroup == "Word") {
this.fileCacheHelper.loadJsFile("platform/analytics/components/chartviewer/chartviewer.js", () => __awaiter(this, void 0, void 0, function* () {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(FileId).then((response) => {
var result = response.result;
var fileName = result.FileTitle;
var filetype = result.FileType;
documentContainer.save(fileName, savetype);
});
}));
}
else if (documentGroup == "Excel") {
let instance = document.getElementById('DocumentViewer').ej2_instances[0];
instance.saveAsJson().then((res) => {
this.dataForJson = res;
var JSONData = JSON.stringify(this.dataForJson.jsonObject.Workbook);
var sheetIndex = Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().ssObj.activeSheetIndex;
this.data = {
FileId: FileId,
SaveTypeID: savetype,
SheetIndex: sheetIndex,
};
Unibase.Apps.Collaboration.DocumentManager.Instance().spreadSheetDownload(this.data).then((response) => {
this.fileCacheHelper.loadJsFile("tenants/themes/compact/components/notifications/notification.js", () => __awaiter(this, void 0, void 0, function* () {
var path = encodeURIComponent(response.result);
Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(path);
}));
});
});
}
}
saveDocumentFile(FileId, documentGroup, documentContainer, args, sheetBaseIns) {
return __awaiter(this, void 0, void 0, function* () {
document.getElementsByClassName('biz-ss-saving')[0].style.display = 'inline-block';
if (document.getElementsByClassName("biz-ss-saveicon")[0].classList.contains("biz-ss-cloudsave")) {
document.getElementsByClassName("biz-ss-saveicon")[0].style.display = 'none';
document.getElementsByClassName("biz-ss-cloudloading")[0].style.display = 'inline-block';
}
if (documentGroup == "Word") {
this.data = {
Content: documentContainer.serialize(),
FileId: FileId
};
yield Unibase.Apps.Collaboration.DocumentManager.Instance().saveWord(this.data).then((response) => {
var result = response;
Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance().editDetails();
});
}
else if (documentGroup == "Excel") {
this.ssAutoSave(args, sheetBaseIns, true);
}
setTimeout(function () {
return __awaiter(this, void 0, void 0, function* () {
if (document.getElementsByClassName("biz-ss-saveicon")[0].classList.contains("biz-ss-cloudsave")) {
document.getElementsByClassName("biz-ss-saveicon")[0].style.display = 'inline-block';
document.getElementsByClassName("biz-ss-cloudloading")[0].style.display = 'none';
document.getElementsByClassName('biz-ss-saving')[0].style.display = 'none';
}
});
}, 1000);
});
}
getCellWithRowAndColByRange(range, sheet) {
let idx = ej.spreadsheet.getIndexesFromAddress(range);
return { SheetIndex: this.baseIns.ssObj.biz.getSheetIndexByname(sheet.name), row: idx[0], cell: idx[1], cellInfo: this.baseIns.ssObj.biz.getCell(idx[0], idx[1], sheet) };
}
ssAutoSave(args, base, saveversion, callback) {
if (base.permissionLevel !== Unibase.Apps.Collaboration.Enums.Share.Viewer) {
this.requestId++;
let refId;
let action = args.action;
let data;
this.baseIns = base;
let indexes = base.ssObj.biz.getIndexes();
let sheet = base.ssObj.biz.getActiveSheet();
let sheetIdx = base.getSheetIndex();
let saveType = "cell";
let isCreateNewFile = false;
let changedValue = [];
let isCut = false;
console.log("Save start " + action + " " + Date());
if (args.action == "resize") {
(args.eventArgs.isCol) ? action = "colResize" : action = "rowResize";
}
;
(args.eventArgs) && (args.eventArgs.modelType) && (args.eventArgs.modelType == "Sheet" && action == "insert") && (action = "insertSheet");
(args.action == "delete") && (args.eventArgs.modelType == "Row") && (action = "deleteRow");
(args.action == "delete") && (args.eventArgs.modelType == "Column") && (action = "deleteCol");
if (args.action == "insertshiftright" || args.action == "deleteshiftleft") {
action = "shiftright&left";
}
if (args.action == "insertshiftdown" || args.action == "deleteshiftup") {
action = "shiftup&down";
}
if (args.action != "import" && args.action != "gotoSheet" && !this.baseIns.isCreatingNewFile) {
!(base.FileId) && (isCreateNewFile = true, this.baseIns.isCreatingNewFile = true, refId = Unibase.Themes.Providers.DetailHelper.recordId);
switch (action) {
case "cellSave":
indexes = this.baseIns.getIndexesFromAddress(args.eventArgs.address.split("!")[1]);
changedValue = [{ Row: indexes[0], Cell: indexes[3], CellInfo: sheet.rows[indexes[0]].cells[indexes[3]] }];
data = {
changedvalues: changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
requestId: this.requestId,
};
break;
case "format":
case "validation":
case "shortcuts":
case "autofill":
case "removeDuplicates":
case "trim":
for (var i = indexes[0]; i <= indexes[2]; i++) {
for (var j = indexes[1]; j <= indexes[3]; j++) {
var cellInfo = ej.spreadsheet.getCell(i, j, sheet);
let obj = { Row: i, cell: j, CellInfo: cellInfo };
(obj.CellInfo) && (obj.CellInfo.validation) && (obj.CellInfo.validation.inCellDropDown == null) && (obj.CellInfo.validation.inCellDropDown = false);
changedValue.push(obj);
}
}
data = {
changedvalues: changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
modelType: (args.eventArgs) ? args.eventArgs.modelType : null,
requestId: this.requestId,
saveversions: saveversion,
};
break;
case "insertImage":
case "deleteChart":
case "cellDelete":
case "insertChart":
case "multipleCells":
setTimeout(() => {
(action == "deleteChart") && (indexes = base.getIndexesFromAddress(args.eventArgs.range.split("!")[1]));
for (var i = indexes[0]; i <= indexes[2]; i++) {
for (var j = indexes[1]; j <= indexes[3]; j++) {
var cellInfo = ej.spreadsheet.getCell(i, j, sheet);
let obj = { Row: i, cell: j, CellInfo: cellInfo };
(action == "deleteChart") && (cellInfo.chart) && (cellInfo.chart.pop(cellInfo.chart.find(x => x.id = args.eventArgs.id))) && (cellInfo.chart.length == 0) && (cellInfo.chart = null);
(obj.CellInfo) && (obj.CellInfo.validation) && (obj.CellInfo.validation.inCellDropDown == null) && (obj.CellInfo.validation.inCellDropDown = false);
if (action == "insertImage") {
cellInfo.image.forEach(image => {
image.left = parseInt(image.left);
image.height = parseInt(image.height);
image.top = parseInt(image.top);
image.width = parseInt(image.width);
});
}
else if (action == "cellDelete" && cellInfo && cellInfo.image && cellInfo.image[0] && cellInfo.image.findIndex(x => x.id.startsWith("biz_image_in_cell")) !== -1) {
let index = cellInfo.image.findIndex(x => x.id.startsWith("biz_image_in_cell"));
cellInfo.image.splice(index, 1);
}
changedValue.push(obj);
}
}
data = {
changedvalues: changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
saveversions: saveversion,
autosavetype: saveType,
modelType: (args.eventArgs) ? args.eventArgs.modelType : null,
requestId: this.requestId,
};
(isCreateNewFile) && (data["folderId"] = this.baseIns.folderId);
(data) && Unibase.Apps.Collaboration.DocumentManager.Instance().ssAutoSave(data);
}, 10);
break;
case "imageRefresh":
data = {
changedvalues: args.changedValues,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
};
break;
case "insert":
saveType = "addRowsAndColumn";
data = {
Indexes: this.baseIns.ssObj.biz.getIndexes(),
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheet.index,
autosavetype: saveType,
modelType: args.eventArgs.modelType,
saveversions: saveversion,
requestId: this.requestId,
RowIndex: args.eventArgs.index,
InsertType: args.eventArgs.insertType,
};
break;
case "moveSheet":
saveType = "moveSheet";
data = {
FileId: base.FileId,
sheetIndex: sheet.index,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
Indexes: [args.sheetIndexes.pop(), args.position],
};
break;
case "deleteRow":
saveType = "deleteRow";
data = {
Indexes: [args.eventArgs.startIndex, args.eventArgs.endIndex - args.eventArgs.startIndex + 1],
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
saveversions: saveversion,
sheetIndex: sheetIdx,
autosavetype: saveType,
requestId: this.requestId,
};
break;
case "deleteCol":
saveType = "deleteColumn";
var usedrangeindex = [];
var usedrange = this.baseIns.ssObj.getActiveSheet().usedRange;
usedrangeindex.push(usedrange.colIndex);
usedrangeindex.push(usedrange.rowIndex);
data = {
Indexes: [args.eventArgs.startIndex, args.eventArgs.endIndex - args.eventArgs.startIndex + 1],
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
RowIndex: args.eventArgs.index,
};
break;
case "shiftright&left":
saveType = "shiftright&left";
data = {
Indexes: this.baseIns.ssObj.biz.getIndexes(),
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
Action: args.action,
UsedRange: usedrangeindex,
};
break;
case "shiftup&down":
setTimeout(() => {
saveType = "shiftup&down";
var usedrangeindex = [];
var usedrange = this.baseIns.ssObj.getActiveSheet().usedRange;
usedrangeindex.push(usedrange.rowIndex);
usedrangeindex.push(usedrange.colIndex);
data = {
Indexes: this.baseIns.ssObj.biz.getIndexes(),
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
Action: args.action,
UsedRange: usedrangeindex,
};
(isCreateNewFile) && (data["folderId"] = this.baseIns.folderId);
(data) && Unibase.Apps.Collaboration.DocumentManager.Instance().ssAutoSave(data);
}, 0);
break;
case "headers":
saveType = "headers";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
sheetIndex: args.eventArgs.sheetIdx,
showHeader: args.eventArgs.isShow,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "gridLines":
saveType = "gridlines";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
sheetIndex: args.eventArgs.sheetIdx,
showGridlines: args.eventArgs.isShow,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "freezePanes":
saveType = "freezepanes";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
sheetIndex: args.eventArgs.sheetIdx,
freezeRow: args.eventArgs.row,
freezeColumn: args.eventArgs.column,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "insertCell":
saveType = "selectedRows";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
sheetIndex: sheetIdx,
autosavetype: saveType,
rowInfo: sheet.rows[indexes[0]],
indexes: indexes,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "conditionalFormat":
saveType = "conditionalFormat";
changedValue = [{ Row: indexes[0], Cell: indexes[3], ConditionalFormat: sheet.conditionalFormats }];
data = {
changedvalues: changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "clipboard":
if (args.eventArgs && args.eventArgs.copiedInfo && args.eventArgs.copiedInfo.isCut == true) {
isCut = true;
var cutSheetIndex = base.ssObj.biz.getSheetIndexByname(args.eventArgs.copiedRange.split("!")[0]);
var cutCellIndexes = base.swapRange(ej.spreadsheet.getIndexesFromAddress(args.eventArgs.copiedRange.split("!")[1]));
}
for (var i = indexes[0]; i <= indexes[2]; i++) {
for (var j = indexes[1]; j <= indexes[3]; j++) {
var cellInfo = ej.spreadsheet.getCell(i, j, sheet);
let obj = { Row: i, cell: j, CellInfo: cellInfo };
changedValue.push(obj);
}
}
data = {
changedvalues: changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: args.eventArgs.pasteSheetIndex,
autosavetype: saveType,
cutSheetIndex: cutSheetIndex,
cutCellIndexes: cutCellIndexes,
isCut: isCut,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "cellDrag":
data = {
changedvalues: args.changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
cutSheetIndex: sheetIdx,
cutCellIndexes: args.cutCellIdxs,
isCut: true,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "newspreadsheet":
saveType = "newspreadsheet";
data = {
FileId: 0,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
};
break;
case "replaceAll":
case "replace":
saveType = "replaceAll";
if (action == "replaceAll") {
args.eventArgs.addressCollection.forEach((e) => {
let sheet = this.baseIns.ssObj.biz.getSheetByName(e.split("!")[0]);
changedValue.push(this.getCellWithRowAndColByRange(e.split("!")[1], sheet));
});
}
else {
let sheet = this.baseIns.ssObj.biz.getSheetByName(args.eventArgs.address.split("!")[0]);
changedValue.push(this.getCellWithRowAndColByRange(args.eventArgs.address.split("!")[1], sheet));
}
data = {
changedvalues: changedValue,
FileId: base.FileId,
sheetIndex: args.eventArgs.pasteSheetIndex,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "insertSheet":
let sheetIndex = args.eventArgs.index;
sheet = base.ssObj.sheets[sheetIndex];
saveType = "insertsheet";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
sheet: sheet,
sheetIndex: sheetIndex,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "removeSheet":
saveType = "removeSheet";
data = {
FileId: base.FileId,
autosavetype: saveType,
sheetIndex: args.sheetIndex,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "applyFilter":
saveType = "applyFilter";
data = {
FileId: base.FileId,
autosavetype: saveType,
filter: args.collection,
requestId: this.requestId,
};
break;
case "removeFilter":
saveType = "removeFilter";
data = {
FileId: base.FileId,
autosavetype: saveType,
sheetIndex: args.sheetIndex,
requestId: this.requestId,
};
break;
case "updateFilter":
saveType = "updateFilter";
data = {
FileId: base.FileId,
autosavetype: saveType,
filter: args.collection,
requestId: this.requestId,
sheetIndex: sheetIdx,
};
break;
case "renameSheet":
saveType = "renameSheet";
data = {
FileId: base.FileId,
autosavetype: saveType,
SheetIndex: sheetIdx,
SheetName: args.eventArgs.value,
requestId: this.requestId,
};
break;
case 'destroy':
var contId = $("._bizgaze_popup_container:visible").attr("id");
$('#' + contId).modal('hide');
$('#' + contId).remove();
window.close();
break;
case "copytonewspreadsheet":
saveType = "newwbsheets";
let currentSheet = base.ssObj.workbookSaveModule.getStringifyObject(base.ssObj.sheets[sheetIdx]);
let sheetName = base.FileName;
data = {
FileId: 0,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
sheet: currentSheet,
requestId: this.requestId,
saveversions: saveversion,
sheetName: sheetName,
};
break;
case "colResize":
setTimeout(() => {
saveType = "colResize";
if (args.eventArgs.index && !args.indexes)
args['indexes'] = [0, args.eventArgs.index, 0, args.eventArgs.index];
else if (!(args.indexes && args.eventArgs.index))
args['indexes'] = this.baseIns.ssObj.biz.getIndexes();
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
sheetIndex: sheetIdx,
requestId: this.requestId,
width: parseInt(args.eventArgs.width),
saveversions: saveversion,
indexes: args.indexes,
};
(isCreateNewFile) && (data["folderId"] = this.baseIns.folderId);
(data) && Unibase.Apps.Collaboration.DocumentManager.Instance().ssAutoSave(data);
}, 100);
break;
case "rowResize":
setTimeout(() => {
saveType = "rowResize";
if (args.eventArgs.index && !args.indexes)
args['indexes'] = [args.eventArgs.index, 0, args.eventArgs.index, 0];
else if (!(args.indexes && args.eventArgs.index))
args['indexes'] = this.baseIns.ssObj.biz.getIndexes();
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
sheetIndex: sheetIdx,
requestId: this.requestId,
height: parseInt(args.eventArgs.height),
indexes: args.indexes,
saveversions: saveversion,
};
(isCreateNewFile) && (data["folderId"] = this.baseIns.folderId);
(data) && Unibase.Apps.Collaboration.DocumentManager.Instance().ssAutoSave(data);
}, 100);
break;
case "imageincell":
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
requestId: this.requestId,
sheetIndex: sheetIdx,
saveversions: saveversion,
changedvalues: args.changedValues,
};
break;
case "createNewSpreadsheet":
isCreateNewFile = true;
saveType = "createNewSpreadsheet";
data = {
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
requestId: this.requestId,
sheetname: document.getElementsByClassName("biz-ss-filename")[0].value
};
break;
case "headerResize":
saveType = "headerResize";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
requestId: this.requestId,
sheetIndex: sheetIdx,
saveversions: saveversion,
multipleheaderresize: args.resizedHeaders
};
break;
case "duplicateSheet":
saveType = "duplicateSheet";
data = {
FileId: base.FileId,
autosavetype: saveType,
requestId: this.requestId,
sheetIndex: args.sheetIndex,
saveversions: saveversion,
};
break;
case "deleteImage":
saveType = "deleteImage";
data = {
FileId: base.FileId,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
sheetIndex: sheetIdx,
imageId: args.id,
imageSource: args.src,
};
break;
case "resizeToAutoFitColumn":
saveType = "resizeToAutoFitColumn";
data = {
FileId: base.FileId,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
sheetIndex: sheetIdx,
indexes: args.eventArgs.selectedRange,
ColumnWidth: args.eventArgs.columns,
};
break;
case "resizeToAutoFitRow":
saveType = "resizeToAutoFitRow";
data = {
FileId: base.FileId,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
sheetIndex: sheetIdx,
indexes: args.eventArgs.selectedRange,
RowHeight: args.eventArgs.rows,
};
break;
case "wrap":
saveType = "wrap";
let indxs = ej.spreadsheet.getIndexesFromAddress(args.eventArgs.address.split("!")[1]);
data = {
FileId: base.FileId,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
sheetIndex: sheetIdx,
indexes: indxs,
wrap: args.eventArgs.wrap,
};
break;
}
(isCreateNewFile) && (data["folderId"] = this.baseIns.folderId);
(data) && Unibase.Apps.Collaboration.DocumentManager.Instance().ssAutoSave(data).then((response) => {
this.baseIns.editDetails();
console.log("Save end " + action + " " + Date());
if (action === "insertSheet" || action === "removeSheet") {
Unibase.Apps.Collaboration.DocumentManager.Instance().getCustomJsonData(base.FileId).then((res) => {
base.customresult = res.result.tabcolors;
});
}
else if (response.message == "New spreadsheet has been created" && action !== "copytonewspreadsheet") {
this.baseIns.FileId = response.result.FileId;
this.baseIns.fileurl = response.result.FileUrl;
this.baseIns.FileName = response.result.FileTitle;
this.baseIns.isCreatingNewFile = false;
for (var i = 0; i < this.actionsWhileCreatingNewFile.length; i++) {
this.ssAutoSave(this.actionsWhileCreatingNewFile[i], this.baseIns, true);
}
}
else if ((action === "copytonewspreadsheet" && response.message === "New spreadsheet has been created")) {
if (callback != null) {
callback();
}
}
});
}
else {
this.actionsWhileCreatingNewFile.push(args);
}
}
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Download();
}
return this.instance;
}
}
Common.Download = Download;
})(Common = Components.Common || (Components.Common = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"version":3,"file":"import.js","sourceRoot":"","sources":["import.ts"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let Common;
(function (Common) {
class Util {
createElement(tagName, attType, attValue) {
let ele = document.createElement(tagName);
ele.setAttribute(attType, attValue);
return ele;
}
appendChildren(parent, classIndex, ...eleArray) {
let parentTag = document.getElementsByClassName(parent)[classIndex];
for (let i = 0; i < eleArray.length; i++) {
parentTag.appendChild(eleArray[i]);
}
}
addAttributes(htmlElement, attrJson) {
for (var attr in attrJson) {
htmlElement.setAttribute(attr, attrJson[attr]);
}
}
getCellValues(cellInfo) {
var val = {};
cellInfo.value && (val["value"] = cellInfo.value.toString().trim());
cellInfo.formula && (val["formula"] = cellInfo.formula);
cellInfo.format ? (val["format"] = cellInfo.format) : (val["format"] = "General");
cellInfo.hyperlink && (val["hyperlink"] = cellInfo.hyperlink);
return val;
}
colorHash(str) {
var sum = 0;
for (var i in str) {
sum += str.charCodeAt(i);
}
let r = ~~(('0.' + Math.sin(sum + 1).toString().substr(6)) * 256);
let g = ~~(('0.' + Math.sin(sum + 2).toString().substr(6)) * 256);
let b = ~~(('0.' + Math.sin(sum + 3).toString().substr(6)) * 256);
let rgb = "rgb(" + r + ", " + g + ", " + b + ")";
let hex = "#";
hex += ("00" + r.toString(16)).substr(-2, 2).toUpperCase();
hex += ("00" + g.toString(16)).substr(-2, 2).toUpperCase();
hex += ("00" + b.toString(16)).substr(-2, 2).toUpperCase();
return {
r: r,
g: g,
b: b,
rgb: rgb,
hex: hex
};
}
makeid(length) {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() *
charactersLength));
}
return result;
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Util();
}
return this.instance;
}
}
Common.Util = Util;
})(Common = Components.Common || (Components.Common = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":"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"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{createElement(n,t,i){let r=document.createElement(n);return r.setAttribute(t,i),r}appendChildren(n,t,...i){let r=document.getElementsByClassName(n)[t];for(let n=0;n<i.length;n++)r.appendChild(i[n])}addAttributes(n,t){for(var i in t)n.setAttribute(i,t[i])}getCellValues(n){var t={};return n.value&&(t.value=n.value.toString().trim()),n.formula&&(t.formula=n.formula),t.format=n.format?n.format:"General",n.hyperlink&&(t.hyperlink=n.hyperlink),t}colorHash(n){var t=0;for(var e in n)t+=n.charCodeAt(e);let r=~~(("0."+Math.sin(t+1).toString().substr(6))*256),u=~~(("0."+Math.sin(t+2).toString().substr(6))*256),f=~~(("0."+Math.sin(t+3).toString().substr(6))*256),o="rgb("+r+", "+u+", "+f+")",i="#";return i+=("00"+r.toString(16)).substr(-2,2).toUpperCase(),i+=("00"+u.toString(16)).substr(-2,2).toUpperCase(),i+=("00"+f.toString(16)).substr(-2,2).toUpperCase(),{r:r,g:u,b:f,rgb:o,hex:i}}makeid(n){for(var t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",u=i.length,r=0;r<n;r++)t+=i.charAt(Math.floor(Math.random()*u));return t}static Instance(){return this.instance===undefined&&(this.instance=new t),this.instance}}n.Util=t})(t=n.Common||(n.Common={}))})(t=n.Components||(n.Components={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,187 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
class DocConnector {
constructor() {
this.methods = {
connectedUsers: function (FileUsers, DocumentGroup) {
console.log('connectedUsers is Connected !');
if (DocumentGroup == 'Excel') {
setTimeout(() => { Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().activeUsers(FileUsers); }, 1000);
}
else if (DocumentGroup == 'Word') {
Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance().activeUsers(FileUsers);
}
},
FileDisconnect: function (user, DocumentGroup) {
if (DocumentGroup == 'Excel') {
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().activeUsers(user);
}
else if (DocumentGroup == 'Word') {
Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance().activeUsers(user);
}
}
};
DocConnector._isRegistered = false;
}
init(fileid, documentgroup) {
this.connection = Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url());
var fileId = parseInt(fileid);
this.start(fileId, documentgroup);
}
closeDoc() {
Unibase.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().stop();
}
ChangeDoc(username, args) {
Unibase.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().invoke("ChangeDoc", username, JSON.stringify(args));
}
getClientMethods() {
return [
{ MethodName: "connectedUsers", Method: this.methods.connectedUsers },
{ MethodName: "filedisconnect", Method: this.methods.FileDisconnect },
];
}
registerClientMethods() {
let _methods = this.getClientMethods();
if (_methods)
for (var i = 0; i < _methods.length; i++) {
this.connection.register(_methods[i].MethodName, _methods[i].Method);
}
}
connectedUsers(FileUsers) {
let ssObj = Unibase.Apps.Collaboration.Components.Documents.Instance()._openedfile;
let stCls = Unibase.Apps.Collaboration.Components.Sheets;
ssObj.signalrData = FileUsers;
var args = JSON.parse(FileUsers);
}
start(fileId, documentgroup) {
return __awaiter(this, void 0, void 0, function* () {
this.registerClientMethods();
try {
if (!DocConnector._isRegistered) {
DocConnector._isRegistered = true;
this.connection.register("changedocument", function (docData) {
let ssObj = Unibase.Apps.Collaboration.Components.Documents.Instance()._openedfile;
let stCls = Unibase.Apps.Collaboration.Components.Sheets;
ssObj.signalrData = docData;
var args = JSON.parse(docData);
try {
if (args.origin === 'biz') {
Unibase.Apps.Collaboration.Components.Documents.Instance()._openedfile.biz.sheetIndex = args.sheetIndex;
switch (args.action) {
case 'trim':
stCls.Ribbon.Instance().processTrim(args.range);
break;
case 'removeDuplicates':
stCls.Dialogue.Instance().removeDuplicate(args.range, args.header, args.colSelected);
break;
case 'autofill':
stCls.Autofill.Instance().applyAutofill(args.options, args.direction);
break;
case 'formatpaint':
stCls.FormatPainter.Instance().applyFormatPaint(args.srcRange, args.destRange, args.srcSheetIndex);
break;
case 'splittext':
stCls.FormatPainter.Instance().applySplitText(args.range, args.stValues);
break;
case 'shiftrows':
stCls.FormatPainter.Instance().applyShiftRows(args.dropIdx, args.rngIndexes, args.direction, false);
break;
case 'shiftcols':
stCls.FormatPainter.Instance().applyShiftCols(args.dropIdx, args.rngIndexes, args.direction, false);
break;
case 'deleteshiftup':
stCls.FormatPainter.Instance().applyDeleteShiftUp(args.range);
break;
case 'deleteshiftleft':
stCls.FormatPainter.Instance().applyDeleteShiftLeft(args.range);
break;
case 'insertshiftdown':
stCls.FormatPainter.Instance().applyInsertShiftDown(args.range);
break;
case 'insertshiftright':
stCls.FormatPainter.Instance().applyInsertShiftRight(args.range);
break;
case 'shiftcells':
stCls.FormatPainter.Instance().applyShiftCells(args.rowIdx, args.colIdx, args.ranges);
break;
case 'spellcheck':
stCls.SpellChecker.Instance().applySpellValue(args.rowIdx, args.colIdx, args.value);
break;
case 'selection':
stCls.FormatPainter.Instance().applyUserSelection(args.range, args.userName);
break;
case 'undoredo':
stCls.Base.Instance().performBizUndoRedo(args);
break;
case 'insertimage':
stCls.Base.Instance().actionInsertImage(args);
break;
case 'colorchange':
stCls.Base.Instance().sheetColorRender();
break;
case 'resize':
stCls.Base.Instance().adjustRowsAndColumnWidth(args);
break;
case 'importReplace':
location.reload();
break;
}
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().editDetails();
Unibase.Apps.Collaboration.Components.Documents.Instance()._openedfile.biz.sheetIndex = -1;
}
else {
Unibase.Apps.Collaboration.Components.Documents.Instance()._openedfile.updateAction(JSON.parse(docData));
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().editDetails();
}
}
catch (e) {
}
});
}
this.connection.connect(function () {
let identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
let UnibaseId = identity.unibaseId;
let FileId = fileId;
let FirstName = identity.name;
let SessionId = identity.sessionId;
let TenantId = identity.tenantId;
console.log("connection started");
Unibase.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().invoke("Connect", FileId, UnibaseId, FirstName, documentgroup, SessionId, TenantId).catch(function (err) {
return console.error(err.toString());
});
});
}
catch (err) {
console.log(err);
setTimeout(this.start, 5000);
}
});
}
;
static Instance() {
if (this.instance === undefined) {
this.instance = new DocConnector();
}
return this.instance;
}
}
Components.DocConnector = DocConnector;
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(i){class r{constructor(){this.methods={connectedUsers:function(t,i){console.log("connectedUsers is Connected !");i=="Excel"?setTimeout(()=>{n.Apps.Collaboration.Components.Sheets.Base.Instance().activeUsers(t)},1e3):i=="Word"&&n.Apps.Collaboration.Components.DocEditor.Base.Instance().activeUsers(t)},FileDisconnect:function(t,i){i=="Excel"?n.Apps.Collaboration.Components.Sheets.Base.Instance().activeUsers(t):i=="Word"&&n.Apps.Collaboration.Components.DocEditor.Base.Instance().activeUsers(t)}};r._isRegistered=!1}init(n,i){this.connection=t.Hubs.UniDocHub.Instance(_appsettings.dochub_url());var r=parseInt(n);this.start(r,i)}closeDoc(){n.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().stop()}ChangeDoc(t,i){n.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().invoke("ChangeDoc",t,JSON.stringify(i))}getClientMethods(){return[{MethodName:"connectedUsers",Method:this.methods.connectedUsers},{MethodName:"filedisconnect",Method:this.methods.FileDisconnect},]}registerClientMethods(){let n=this.getClientMethods();if(n)for(var t=0;t<n.length;t++)this.connection.register(n[t].MethodName,n[t].Method)}connectedUsers(t){let i=n.Apps.Collaboration.Components.Documents.Instance()._openedfile,r=n.Apps.Collaboration.Components.Sheets;i.signalrData=t;var u=JSON.parse(t)}start(t,i){return __awaiter(this,void 0,void 0,function*(){this.registerClientMethods();try{r._isRegistered||(r._isRegistered=!0,this.connection.register("changedocument",function(t){let u=n.Apps.Collaboration.Components.Documents.Instance()._openedfile,r=n.Apps.Collaboration.Components.Sheets;u.signalrData=t;var i=JSON.parse(t);try{if(i.origin==="biz"){n.Apps.Collaboration.Components.Documents.Instance()._openedfile.biz.sheetIndex=i.sheetIndex;switch(i.action){case"trim":r.Ribbon.Instance().processTrim(i.range);break;case"removeDuplicates":r.Dialogue.Instance().removeDuplicate(i.range,i.header,i.colSelected);break;case"autofill":r.Autofill.Instance().applyAutofill(i.options,i.direction);break;case"formatpaint":r.FormatPainter.Instance().applyFormatPaint(i.srcRange,i.destRange,i.srcSheetIndex);break;case"splittext":r.FormatPainter.Instance().applySplitText(i.range,i.stValues);break;case"shiftrows":r.FormatPainter.Instance().applyShiftRows(i.dropIdx,i.rngIndexes,i.direction,!1);break;case"shiftcols":r.FormatPainter.Instance().applyShiftCols(i.dropIdx,i.rngIndexes,i.direction,!1);break;case"deleteshiftup":r.FormatPainter.Instance().applyDeleteShiftUp(i.range);break;case"deleteshiftleft":r.FormatPainter.Instance().applyDeleteShiftLeft(i.range);break;case"insertshiftdown":r.FormatPainter.Instance().applyInsertShiftDown(i.range);break;case"insertshiftright":r.FormatPainter.Instance().applyInsertShiftRight(i.range);break;case"shiftcells":r.FormatPainter.Instance().applyShiftCells(i.rowIdx,i.colIdx,i.ranges);break;case"spellcheck":r.SpellChecker.Instance().applySpellValue(i.rowIdx,i.colIdx,i.value);break;case"selection":r.FormatPainter.Instance().applyUserSelection(i.range,i.userName);break;case"undoredo":r.Base.Instance().performBizUndoRedo(i);break;case"insertimage":r.Base.Instance().actionInsertImage(i);break;case"colorchange":r.Base.Instance().sheetColorRender();break;case"resize":r.Base.Instance().adjustRowsAndColumnWidth(i);break;case"importReplace":location.reload()}n.Apps.Collaboration.Components.Sheets.Base.Instance().editDetails();n.Apps.Collaboration.Components.Documents.Instance()._openedfile.biz.sheetIndex=-1}else n.Apps.Collaboration.Components.Documents.Instance()._openedfile.updateAction(JSON.parse(t)),n.Apps.Collaboration.Components.Sheets.Base.Instance().editDetails()}catch(f){}}));this.connection.connect(function(){let r=n.Platform.Membership.Infos.Identity.getCurrentUser(),u=r.unibaseId,f=t,e=r.name,o=r.sessionId,s=r.tenantId;console.log("connection started");n.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().invoke("Connect",f,u,e,i,o,s).catch(function(n){return console.error(n.toString())})})}catch(u){console.log(u);setTimeout(this.start,5e3)}})}static Instance(){return this.instance===undefined&&(this.instance=new r),this.instance}}i.DocConnector=r})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,529 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let DocEditor;
(function (DocEditor) {
class Base {
init(response, res, callback) {
this.result = response.result;
this.documentGroup = this.result.DocumentGroup;
this.filedata = res.result;
this.FileName = response.result.FileTitle;
this.FileId = response.result.FileId;
this.sourceFileId = response.result.SourceFileId;
this.Priority = response.result.Priority;
this.lastEditedTime = response.result.LastUpdateTime;
this.timePeriod = response.result.TimePeriod;
this.username = response.result.LastUpdateByName;
this.Priority = response.result.Priority;
this.newUpload = response.result.NewUpload;
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
this.NewDocument = response.result.NewDocument;
this.render();
if (callback != null) {
callback();
}
}
unwireBootStrapKeyEvent() {
let popup = document.body.getElementsByClassName('_bizgaze_popup_container');
let events = $._data($(popup)[0], "events");
if (events && events.keydown) {
$(popup).off('keydown.dismiss.bs.modal', events.keydown[0].handler);
}
}
render() {
this.renderPopup();
this.updateProps();
this.renderMenuBar();
this.refreshHeight();
this.wordDocumentRender();
this.ribbon.init(this.wordDocumentObj, this.result);
this.priorityRender();
this.initSetInterval();
this.eventListeners();
this.unwireBootStrapKeyEvent();
if (!this.NewDocument) {
this.connectHub(this.FileId, this.documentGroup);
}
}
connectHub(fileId, documentgroup) {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/collaboration/components/docconnector.js", "apps/collaboration/components/unidochub.js"], function () {
Unibase.Apps.Collaboration.Components.DocConnector.Instance().init(fileId, documentgroup);
});
}
priorityRender() {
if (this.Priority) {
$(".biz_doc_star_icon_" + this.FileId).removeClass("fa-star-o");
$(".biz_doc_star_icon_" + this.FileId).addClass("fa-star");
$(".biz_doc_star_icon_" + this.FileId).removeClass("text-light");
$(".biz_doc_star_icon_" + this.FileId).css("color", "orange");
}
}
eventListeners() {
try {
document.body.addEventListener("keydown", this.keyDown.bind(this));
document.body.addEventListener("mousedown", this.mouseDown.bind(this));
document.getElementsByClassName("biz-doc-starred")[0].addEventListener('click', (event) => {
});
document.getElementsByClassName("biz-doc-filename")[0].addEventListener('focusout', (event) => {
this.fileNameChange();
});
(document.getElementsByClassName('e-de-text-target')[0].contentWindow.document).addEventListener("keydown", (ele) => {
if (ele.keyCode == 122) {
event.preventDefault();
this.openFullscreen(this.container);
}
});
(document.getElementsByClassName('e-de-text-target')[0].contentWindow.document).addEventListener("keyup", (ele) => {
this.editorkeyUp(ele);
});
(document.getElementsByClassName('e-de-text-target')[0].contentWindow.document).addEventListener("mousedown", (ele) => {
this.editorMouseDown(ele);
});
this.container.addEventListener("fullscreenchange", () => {
this.fullscreenHandler(this.container);
});
this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.addEventListener("beforeOpen", this.cmenuBfOpen.bind(this));
this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.addEventListener("beforeItemRender", this.cmenuBfItemRndr.bind(this));
this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.addEventListener("select", this.cmenuSelect.bind(this));
}
catch (e) {
}
}
keyDown(ele) {
if (ele.keyCode == 122) {
event.preventDefault();
setTimeout(() => { this.openFullscreen(this.container); }, 0);
}
if (ele.target.classList.contains("biz-doc-fileshare-btn")) {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('apps/collaboration/components/unicloud.js', () => {
Unibase.Apps.Collaboration.Components.UniCloud.Instance().share(this.sourceFileId, "File", 0);
});
}
}
editorkeyUp(e) {
this.updateUndoRedo();
}
updateUndoRedo() {
let undoOverley = document.getElementById("DocumentViewer_toolbar_undo").parentElement.classList.contains("e-overlay");
let redoOverley = document.getElementById("DocumentViewer_toolbar_redo").parentElement.classList.contains("e-overlay");
let undobtn = document.getElementsByClassName("biz-doc-undo")[0];
let redobtn = document.getElementsByClassName("biz-doc-redo")[0];
this.enableOrDisableIcon(undoOverley, undobtn);
this.enableOrDisableIcon(redoOverley, redobtn);
}
editorMouseDown(e) {
let undo = e.target.closest(".biz-doc-undo");
let redo = e.target.closest(".biz-doc-redo");
(undo) && document.getElementById("DocumentViewer_toolbar_undo").click();
(redo) && document.getElementById("DocumentViewer_toolbar_redo").click();
this.updateUndoRedo();
}
mouseDown(e) {
if (e.target.id == "biz_doc_undobtn" || e.target.classList.contains("biz-doc-undo-icon")) {
document.getElementById("DocumentViewer_toolbar_undo").click();
}
else if (e.target.id == "biz_doc_redobtn" || e.target.classList.contains("biz-doc-redo-icon")) {
document.getElementById("DocumentViewer_toolbar_redo").click();
}
this.updateUndoRedo();
}
enableOrDisableIcon(undoOverley, btn) {
if (undoOverley) {
if (!btn.classList.contains("e-disabled"))
btn.classList.add("e-disabled");
}
else {
if (btn.classList.contains("e-disabled"))
btn.classList.remove("e-disabled");
}
}
openFullscreen(elem) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
}
else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen();
}
else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
}
fullscreenHandler(container) {
setTimeout(() => {
if (document.fullscreenElement) {
this.fullscreenChange(container);
}
else {
this.fullscreenChange(container);
}
}, 100);
}
fullscreenChange(ele) {
let ribbonHeight = this.ribbonElem.offsetHeight;
let toolbarHeight = document.getElementsByClassName("biz-doc-bottomtoolbar")[0].offsetHeight;
let footerHeight = this.element.parentElement.nextElementSibling.offsetHeight;
var totalHeight = window.innerHeight - ribbonHeight - toolbarHeight - footerHeight;
this.element.parentElement.style.height = totalHeight + 'px';
this.wordDocumentObj.height = totalHeight + 'px';
}
wordDocumentRender() {
var instance = this;
this.wordDocumentObj = new ej.documenteditor.DocumentEditorContainer({
height: "100%",
enableEditor: true,
enableEditorHistory: true,
enableSelection: true,
enableSearch: true,
created: () => {
setTimeout(() => {
let updateTextPositionFn = this.wordDocumentObj.documentEditor.selectionModule.updateTextPosition.bind(this.wordDocumentObj.documentEditor.selectionModule);
this.wordDocumentObj.documentEditor.selectionModule.updateTextPosition = (a1, a2) => {
updateTextPositionFn(a1, a2);
let result = this.wordDocumentObj.documentEditor.selectionModule.updateTextPositionIn(a1, undefined, 0, a2, false);
this.formatInfo = result;
return result;
};
}, 800);
},
});
setInterval(() => {
var instance = this;
if (instance.contentChanged) {
this.onlineStatus = (window.navigator.onLine ? 'on' : 'off') + 'line';
window.addEventListener('online', () => document.getElementsByClassName('biz-ss-cloudsave')[0].style.display = 'inline-block');
window.addEventListener('online', () => document.getElementsByClassName("biz-ss-cloudoff")[0].style.display = "none");
window.addEventListener('offline', () => document.getElementsByClassName('biz-ss-cloudsave')[0].style.display = 'none');
window.addEventListener('offline', () => document.getElementsByClassName("biz-ss-cloudoff")[0].style.display = "inline-block");
if (this.onlineStatus == "online") {
Unibase.Apps.Collaboration.Components.Common.Download.Instance().saveDocumentFile(instance.FileId, instance.documentGroup, instance.documentContainer).then(function () {
});
}
instance.contentChanged = false;
}
}, 3000);
this.wordDocumentObj.appendTo('.DocumentViewer');
(this.filedata) && this.wordDocumentObj.documentEditor.open(this.filedata);
this.wordDocumentObj.documentEditor.enableSfdtExport = true;
this.wordDocumentObj.documentEditor.enableWordExport = true;
this.wordDocumentObj.documentEditor.enableTextExport = true;
this.wordDocumentObj.documentEditor.enableSelection = true;
this.wordDocumentObj.documentEditor.enableEditor = true;
this.wordDocumentObj.documentEditor.isReadOnly = false;
this.wordDocumentObj.documentEditor.enableLocalPaste = false;
var xyz = $("#DocumentViewer_editor")[0];
this.documentContainer = xyz.ej2_instances[0];
}
cmenuBfOpen(args) {
let cmenuModule = this.wordDocumentObj.documentEditor.contextMenuModule;
let items = this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.items;
if (items.find(x => x.id == this.wordDocumentObj.element.id + "_cmenu_delete") == undefined) {
items.splice(5, 0, {
text: "Delete", iconCss: "e-icons MT_Delete", id: this.wordDocumentObj.element.id + "_cmenu_delete"
});
items.push({ text: "Clear Formatting", iconCss: "e-icons MT_ClearFormat", id: this.wordDocumentObj.element.id + "_cmenu_clear_formatting" });
}
this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.items = items;
this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.dataBind();
cmenuModule.showHideElements(cmenuModule.documentHelper.selection);
}
cmenuBfItemRndr(e) {
if (e.item.id == this.wordDocumentObj.element.id + "_cmenu_delete") {
let selectedText = this.wordDocumentObj.documentEditor.editor.selection.text;
if (selectedText.length == 0) {
e.element.classList.add("e-disabled");
}
}
}
cmenuSelect(args) {
if (args.item.id == this.wordDocumentObj.element.id + "_cmenu_delete") {
this.wordDocumentObj.documentEditor.editor.delete();
}
else if (args.item.id == this.wordDocumentObj.element.id + "_cmenu_clear_formatting") {
this.wordDocumentObj.documentEditor.editor.clearFormatting();
}
}
updateProps() {
this.element = document.getElementById('DocumentViewer');
this.fileName = this.result.FileName + "." + this.result.FileType;
this.ribbon = Unibase.Apps.Collaboration.Components.DocEditor.Ribbon.Instance();
this.util = Unibase.Apps.Collaboration.Components.Common.Util.Instance();
}
refreshHeight() {
var toolbarHeight = this.element.parentElement.previousElementSibling.offsetHeight;
var rootHeight = this.element.parentElement.parentElement.offsetHeight;
var rbnHeight = document.body.getElementsByClassName('biz-doc-ribbon')[0].offsetHeight;
this.element.parentElement.style.height = (rootHeight - rbnHeight - toolbarHeight) + 'px';
}
initSetInterval() {
if (this.timePeriod === "Minutes" || this.timePeriod === "Minute") {
this.intr = setInterval(() => {
this.lastEditedTime = this.lastEditedTime + 1;
this.username = this.username;
this.timePeriod = this.timePeriod;
if (this.lastEditedTime != 1) {
if (this.lastEditedTime >= 59 && this.timePeriod === "Minutes") {
Unibase.Apps.Collaboration.DocumentManager.Instance().lastEdit(this.FileId).then((response) => {
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
this.lastEditedTime = response.result.Lastedittime;
this.username = response.result.LastUpdatedByName;
this.timePeriod = response.result.TimePeriod;
if (this.unibaseusername === this.username) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago";
}
else {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago by " + this.username;
}
});
}
else {
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
if (this.unibaseusername === this.username) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago";
}
else {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago by " + this.username;
}
}
}
}, 60000);
}
else if (this.timePeriod === "Hour" || this.timePeriod === "Hours") {
this.intrhour = setInterval(() => {
this.lastEditedTime = this.lastEditedTime + 1;
this.username = this.username;
this.timePeriod = this.timePeriod;
if (this.lastEditedTime >= 23 && this.timePeriod === "Hours") {
Unibase.Apps.Collaboration.DocumentManager.Instance().lastEdit(this.FileId).then((response) => {
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
this.lastEditedTime = response.result.Lastedittime;
this.username = response.result.LastUpdatedByName;
this.timePeriod = response.result.TimePeriod;
if (this.unibaseusername === this.username) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago";
}
else {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago by " + this.username;
}
});
}
else {
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
if (this.unibaseusername === this.username) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago";
}
else {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago by " + this.username;
}
}
}, 3600000);
}
}
fileNameChange() {
var tempfilename = $(".biz-doc-filename").val();
var data = {
FileTitle: tempfilename,
FileId: this.FileId
};
Unibase.Apps.Collaboration.DocumentManager.Instance().renameFileTitle(data);
}
activeUsers(FileUsers) {
var connecteduser = [];
for (var v in FileUsers) {
let identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
let unibaseId = identity.unibaseId;
if (unibaseId != FileUsers[v].unibaseId) {
connecteduser.push(FileUsers[v].firstName);
}
}
this.connecteduserfirstName = connecteduser;
console.log(this.connecteduserfirstName);
this.showActiveUsers(FileUsers);
return this.connecteduserfirstName;
}
showActiveUsers(FileUsers) {
var onlineusername = document.getElementsByClassName("biz-doc-onlineusersintials")[0];
let identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
let unibaseId = identity.unibaseId;
var connectedUsersFirstChar = [];
for (var user in this.connecteduserfirstName) {
connectedUsersFirstChar.push(this.connecteduserfirstName[user].trim().charAt(0));
}
var element = document.getElementById('biz-doc-connected_users_container');
if (typeof (element) != 'undefined' && element != null) {
element.remove();
}
let html = "";
let html1 = `<div id="biz-doc-connected_users_container"></div>`;
$(".biz-doc-onlineusersintials").append(html1);
let usersHtml = '', randomColor;
let colorPalette = ['#6640b2', '#3a55b1', '#0092ee', '#00acf0', '#1ebccd', '#009b84', '#22af47', '#88c241', '#d0d962', '#fde335', '#ffbf36', '#ff9528', '#ff6028', '#7a5449', '#c1993f', '#9e9e9e', '#5e7d8a', '#324148', '#f5f5f6', '#f95851', '#ef3975', '#b642b5', '#7a59bc', '#536bbb', '#21a0f0', '#21b7f2'];
for (let i = 0; i < this.connecteduserfirstName.length; i++) {
randomColor = colorPalette[Math.floor(Math.random() * colorPalette.length)];
html = `<div id="biz-doc-connecteduser-` + unibaseId + `" class="d-flex flex-row border rounded-circle w-35p h-35p biz-doc-users-` + i + `" style="margin-right:-8px; background-color:` + randomColor + `">
<div id="biz-doc-connecteduser_` + unibaseId + `" class="biz-doc-connectedusersfirstletter m-auto" data-toggle="popover" data-placement="top" title = "` + this.connecteduserfirstName[i] + `">` + connectedUsersFirstChar[i] + `</div></div>`;
if (i <= 5) {
$("#biz-doc-connected_users_container").append(html);
}
usersHtml += '<a class="dropdown-item d-flex flex-row align-items-center p-1 my-1" href="javascript:void(0)"><div class="biz-doc-connectedusersfirstletter border mr-2 px-2 rounded-circle text-white" style="background-color:#' + randomColor + '" title = "' + this.connecteduserfirstName[i] + '">' + connectedUsersFirstChar[i] + '</div><span class="font-13 font-weight-500">' + FileUsers[i].firstName + '</span></a>';
if (i > 5) {
$("#biz-doc-connected_users_container").children().last().remove();
$("#biz-doc-connected_users_container").append('<div class="users-dropdown"><a href="javascript:void(0);" class="d-flex flex-row border rounded-circle w-35p h-35p text-dark biz-doc-users-' + i + '" role="button" id="biz-doc-connecteduser-' + unibaseId + '" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style=" background-color:lightgray;margin-right:-8px"><span class="m-auto font-14 font-weight-500"><span class="font-12 text-muted"><i class="la la-plus"></i></span>' + [i - 4] + '</span></a><div class="dropdown-menu z-index-10 position-absolute bg-white h-275p scroll-bar" aria-labelledby="biz-doc-connecteduser-' + unibaseId + '"></div>');
$('.users-dropdown .dropdown-menu').append(usersHtml);
}
}
}
renderPopup() {
Unibase.Apps.Collaboration.Components.Documents.Instance().loadForm(0, this.FileId, 0, null, this.documentGroup);
}
renderMenuBar() {
let containers = document.body.getElementsByClassName('_bizgaze_popup_container');
this.container = containers[containers.length - 1];
this.container.insertBefore(this.util.createElement("div", 'class', 'biz-doc-ribbon'), document.body.getElementsByClassName('_bizgaze_popup_container')[0].firstElementChild);
this.util.appendChildren('biz-doc-ribbon', 0, this.util.createElement("div", 'class', 'biz-doc-docxlogo'), this.util.createElement("div", 'class', 'biz-doc-tooolbar'), this.util.createElement("div", 'class', 'biz-doc-userdetails'));
this.util.appendChildren('biz-doc-docxlogo', 0, this.util.createElement("img", 'class', 'biz-doc-logo'));
this.util.appendChildren('biz-doc-tooolbar', 0, this.util.createElement("div", 'class', 'biz-doc-fileinfo'), this.util.createElement("div", 'class', 'biz-doc-fileshare-wrapper'), this.util.createElement("div", 'class', 'biz-doc-onlineusers'), this.util.createElement("div", 'class', 'biz-doc-toolbarmenu'));
this.util.appendChildren('biz-doc-fileinfo', 0, this.util.createElement("input", 'class', 'biz-doc-filename'), this.util.createElement('div', 'class', 'biz-doc-starred'), this.util.createElement('div', 'class', 'biz-ss-autosave'));
this.util.appendChildren('biz-doc-starred', 0, this.util.createElement("span", 'id', 'biz-doc-star'), this.util.createElement("i", 'class', 'fa fa-star-o text-light font-7 biz_doc_star_icon_' + this.FileId));
this.util.appendChildren('biz-ss-autosave', 0, this.util.createElement("img", 'class', 'biz-ss-saveicon biz-ss-cloudsave'), this.util.createElement("img", 'class', 'biz-ss-saveicon biz-ss-cloudoff'), this.util.createElement("div", 'class', 'biz-ss-cloudloading e-icons'), this.util.createElement('div', 'class', 'biz-ss-saving'));
this.util.appendChildren('biz-doc-fileshare-wrapper', 0, this.util.createElement("div", 'class', 'biz-doc-fileshare'));
this.util.appendChildren('biz-doc-onlineusers', 0, this.util.createElement("div", 'class', 'biz-doc-onlineusersintials d-flex flex-row text-white mx-35 pull-right'));
this.util.appendChildren('biz-doc-fileshare', 0, this.util.createElement("button", 'class', 'biz-doc-fileshare-btn'));
this.util.appendChildren('biz-doc-userdetails', 0, this.util.createElement("div", 'class', 'biz-doc-userinitial'));
this.util.appendChildren('biz-doc-toolbarmenu', 0, this.util.createElement("ul", 'id', 'menu'), this.util.createElement("input", 'class', 'biz-doc-lastedited'));
document.getElementsByClassName("biz-doc-ribbon")[0].after(this.util.createElement("div", 'class', 'biz-doc-bottomtoolbar e-toolbar'));
this.util.appendChildren('biz-doc-bottomtoolbar', 0, this.util.createElement("div", 'class', 'biz-doc-toolbar-wrapper'));
this.util.appendChildren('biz-doc-toolbar-wrapper', 0, this.util.createElement("div", 'class', 'biz-doc-bottomtoolbar-undoredo e-toolbar-items'), this.util.createElement("div", 'class', 'biz-doc-bottomtoolbar-text e-toolbar-items'), this.util.createElement("div", 'class', 'biz-doc-bottomtoolbar-paragraph e-toolbar-items'), this.util.createElement("div", 'class', 'biz-doc-bottomtoolbar-indent e-toolbar-items'));
this.userInitial = document.getElementsByClassName("biz-doc-userinitial")[0];
let identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
if (!identity.photoUrl) {
this.userInitial.textContent += identity.name.trim().slice(0, 1);
this.userInitial.classList.add('biz-doc-initial-text');
}
else {
this.userInitial.classList.add('biz-doc-initial-img');
this.userInitial.style.backgroundImage = "url(" + identity.photoUrl + ")";
}
document.getElementsByClassName("biz-doc-logo")[0].setAttribute('src', 'imgs/BizgazeDocsIcon.svg');
document.getElementsByClassName("biz-ss-cloudsave")[0].setAttribute('src', 'imgs/cloud-computing.svg');
document.getElementsByClassName("biz-ss-cloudoff")[0].setAttribute('src', 'imgs/cloud-off.svg');
document.getElementsByClassName("biz-ss-cloudoff")[0].style.display = "none";
let attributes = {
'value': this.FileName,
'type': 'text'
};
document.getElementsByClassName("biz-doc-fileshare-btn")[0].style.backgroundColor = "#049503";
var shareBtn = new ej.buttons.Button({ cssClass: `e-primary`, content: `Share`, iconCss: 'biz-doc-fileshare-icon icon-doc-lockopen' });
shareBtn.appendTo(".biz-doc-fileshare-btn");
document.getElementsByClassName("biz-doc-userinitial")[0].setAttribute("title", identity.name.trim());
let color = this.util.colorHash(identity.name.trim());
document.getElementsByClassName("biz-doc-userinitial")[0].style.backgroundColor = color.hex;
if (!this.newUpload) {
debugger;
if (this.lastEditedTime != 0) {
if (this.unibaseusername === this.username) {
let htmlelementlastedited = document.getElementsByClassName('biz-doc-lastedited')[0];
this.util.addAttributes(htmlelementlastedited, {
'value': 'last edit was made ' + this.lastEditedTime + ' ' + this.timePeriod + ' ago',
'type': 'span'
});
}
else {
let htmlelementlastedited = document.getElementsByClassName('biz-doc-lastedited')[0];
this.util.addAttributes(htmlelementlastedited, {
'value': 'last edit was made ' + this.lastEditedTime + ' ' + this.timePeriod + ' ago by ' + this.username,
'type': 'span'
});
}
}
else {
if (this.unibaseusername === this.username) {
let htmlelementlastedited = document.getElementsByClassName('biz-doc-lastedited')[0];
this.util.addAttributes(htmlelementlastedited, {
'value': 'last edit was made seconds ago ',
'type': 'span'
});
}
else {
let htmlelementlastedited = document.getElementsByClassName('biz-doc-lastedited')[0];
this.util.addAttributes(htmlelementlastedited, {
'value': 'last edit was made seconds ago by ' + this.username,
'type': 'span'
});
}
}
}
let htmlelement = document.getElementsByClassName('biz-doc-filename')[0];
this.util.addAttributes(htmlelement, attributes);
let attributesforautosave = {
'type': 'text'
};
let htmlelementforautosave = document.getElementsByClassName('biz-ss-saving')[0];
this.util.addAttributes(htmlelementforautosave, attributesforautosave);
document.getElementsByClassName('biz-ss-saving')[0].style.display = 'none';
document.getElementsByClassName('biz-doc-lastedited')[0].setAttribute('disabled', "");
document.getElementsByClassName('biz-ss-saving')[0].innerText = 'Saving...';
this.ribbonElem = document.body.getElementsByClassName('biz-doc-ribbon')[0];
}
editDetails() {
if (this.FileId != 0) {
Unibase.Apps.Collaboration.DocumentManager.Instance().lastEdit(this.FileId).then((response) => {
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
this.lastEditedTime = response.result.Lastedittime;
this.username = response.result.LastUpdatedByName;
this.timePeriod = response.result.TimePeriod;
if (this.unibaseusername === this.username && this.lastEditedTime === 0) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made seconds ago";
}
else if (this.unibaseusername === this.username && this.lastEditedTime !== 0) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago";
}
else {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made seconds ago by " + this.username;
}
});
}
clearInterval(this.intr);
clearInterval(this.intrhour);
this.initSetInterval();
}
convertDocsToPdfDownload(FileId) {
Unibase.Apps.Collaboration.DocumentManager.Instance().ConvertDocstoPdfDownload(FileId).then((response) => {
Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(response.result);
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Base();
}
return this.instance;
}
}
DocEditor.Base = Base;
})(DocEditor = Components.DocEditor || (Components.DocEditor = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,832 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let DocEditor;
(function (DocEditor) {
class Ribbon {
init(docobj, result) {
this.FileName = result.FileName;
this.FileId = result.FileId;
this.documentGroup = result.DocumentGroup;
this.wordDocumentObj = docobj;
this.docBase = Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance();
this.fileDownload = Unibase.Apps.Collaboration.Components.Common.Download.Instance();
this.util = Unibase.Apps.Collaboration.Components.Common.Util.Instance();
this.render();
}
render() {
this.wordDocumentMenubar(this.FileId, this.documentGroup, this.FileName);
this.appendToolbarElements();
this.createResponsiveToolbar();
this.updateProp();
}
updateProp() {
this.fontSize = document.getElementById("DocumentViewer_editor_font_properties_fontSize").ej2_instances[0];
}
setFontSize(size) {
this.wordDocumentObj.textProperties.text.isRetrieving = false;
this.fontSize.value = size;
}
wordDocumentMenubar(FileId, documentGroup, FileName) {
var instance = this;
var menuItems = [
{
text: 'File',
items: [
{ text: 'New', iconCss: 'e-icons add-new' },
{ text: 'Open', iconCss: 'e-icons e-open' },
{ text: 'Make a copy', iconCss: 'e-icons biz_make_a_copy' },
{
text: 'Download', iconCss: 'e-icons e-save',
items: [
{ text: 'Microsoft Word Document (.docx)', iconCss: 'e-icons' },
{ text: 'Portable Document Format (.pdf)', iconCss: 'e-icons Pdf_Export' },
{ text: 'Text Document (.txt)', iconCss: 'e-icons' }
]
},
{ text: 'Close', iconCss: 'e-icons cross-close' },
]
},
{
text: 'Edit',
items: [
{ text: 'Undo', iconCss: 'e-icons biz-doc-undo-icon' },
{ text: 'Redo', iconCss: 'e-icons biz-doc-redo-icon' },
{ separator: true },
{ text: 'Cut', iconCss: 'e-icons biz-doc-cut-icon' },
{ text: 'Copy', iconCss: 'e-icons biz-doc-copy-icon' },
{ text: 'Paste', iconCss: 'e-icons biz-doc-paste-icon' },
{
text: 'Special paste', iconCss: 'e-icons biz-doc-paste-icon', items: [
{ text: "Keep source formatting", iconCss: 'e-icons MT_PasteStyle' },
{ text: "Match destination formatting", iconCss: 'e-icons M_MergeFormatting' },
{ text: "Text only", iconCss: 'e-icons MT_PasteTextonly' },
]
},
{ separator: true },
{ text: 'Delete', iconCss: 'e-icons MT_Delete' },
{ text: 'Select all', iconCss: 'e-icons MT_SelectAll' },
{ text: 'Search', iconCss: 'e-icons MT_Search' },
]
},
{
text: 'View',
items: [
{ text: 'Page Setup', iconCss: 'e-icons M_PageSetup' },
{ text: 'Page Number', iconCss: 'e-icons M_PageNumber' },
{
text: 'Mode', iconCss: 'e-icons MT_Preview',
items: [
{ text: 'Editing', iconCss: 'e-icons biz_edit_icon' },
{ text: 'View only', iconCss: 'e-icons MT_Preview' },
]
},
{
text: 'Break', iconCss: 'e-icons M_Break',
items: [
{ text: 'Page Break', iconCss: 'e-icons M_PageBreak' },
{ text: 'Section Break', iconCss: 'e-icons M_SectionBreak' },
]
},
{ separator: true },
{ text: 'Full screen', iconCss: 'e-icons biz-enterfullscreen' },
]
},
{
text: 'Insert',
items: [
{ text: 'Header', iconCss: 'e-icons M_Header' },
{ text: 'Footer', iconCss: 'e-icons M_Footer' },
{ separator: true },
{ text: 'Image', iconCss: 'e-icons B_Image' },
{ text: 'Table', iconCss: 'e-icons table-02' },
{ text: 'Link', iconCss: 'e-icons e-Hyperlink' },
{ text: 'Bookmark', iconCss: 'e-icons M_Bookmark' },
{ text: 'Table Of Contents', iconCss: 'e-icons M_TableOfContent' },
{ separator: true },
{ text: 'Footnote', iconCss: 'e-icons M_Footnote' },
{ text: 'Endnote', iconCss: 'e-icons M_Endnote' },
]
},
{
text: 'Format',
items: [
{
text: 'Text', iconCss: 'e-icons ',
items: [
{ text: 'Bold', iconCss: 'e-icons ' },
{ text: 'Italic', iconCss: 'e-icons ' },
{ text: 'Underline', iconCss: 'e-icons ' },
{ text: 'Strikethrough', iconCss: 'e-icons ' },
{ text: 'Superscript', iconCss: 'e-icons ' },
{ text: 'Subscript', iconCss: 'e-icons ' },
]
},
{
text: 'Font size', iconCss: 'e-icons ',
items: [
{ text: '8', iconCss: 'e-icons ' },
{ text: '9', iconCss: 'e-icons ' },
{ text: '10', iconCss: 'e-icons ' },
{ text: '11', iconCss: 'e-icons ' },
{ text: '12', iconCss: 'e-icons ' },
{ text: '14', iconCss: 'e-icons ' },
{ text: '16', iconCss: 'e-icons ' },
{ text: '18', iconCss: 'e-icons ' },
{ text: '20', iconCss: 'e-icons ' },
{ text: '22', iconCss: 'e-icons ' },
{ text: '24', iconCss: 'e-icons ' },
{ text: '26', iconCss: 'e-icons ' },
{ text: '28', iconCss: 'e-icons ' },
{ text: '36', iconCss: 'e-icons ' },
{ text: '48', iconCss: 'e-icons ' },
{ text: '72', iconCss: 'e-icons ' },
{ text: '96', iconCss: 'e-icons ' },
]
},
{
text: 'Paragraph styles', iconCss: 'e-icons ',
items: [
{ text: 'Normal', iconCss: 'e-icons ' },
{ text: 'Heading 1', iconCss: 'e-icons ' },
{ text: 'Heading 2', iconCss: 'e-icons ' },
{ text: 'Heading 3', iconCss: 'e-icons ' },
{ text: 'Heading 4', iconCss: 'e-icons ' },
{ text: 'Heading 5', iconCss: 'e-icons ' },
{ text: 'Heading 6', iconCss: 'e-icons ' },
]
},
{
text: 'Align & indent', iconCss: 'e-icons ',
items: [
{ text: 'Left', iconCss: 'e-icons ' },
{ text: 'Center', iconCss: 'e-icons ' },
{ text: 'Right', iconCss: 'e-icons ' },
{ text: 'Justified', iconCss: 'e-icons ' },
{ separator: true },
{ text: 'Increase indent', iconCss: 'e-icons ' },
{ text: 'Decrease indent', iconCss: 'e-icons ' },
]
},
{
text: 'Line spacing', iconCss: 'e-icons ',
items: [
{ text: 'Single' },
{ text: '1.15' },
{ text: '1.5' },
{ text: 'Double' },
]
},
{
text: 'Bulletes & numbering', iconCss: 'e-icons ', items: [
{
text: 'Bullets',
items: [
{ text: 'None' },
{ text: 'Bullet dot' },
{ text: 'Bullet circle' },
{ text: 'Bullet square' },
{ text: 'Bullet flower' },
{ text: 'Bullet arrow' },
{ text: 'Bullet tick' },
]
},
{
text: 'Numbering', items: [
{ text: 'No numbering' },
{ text: 'Numbers' },
{ text: 'Lower case' },
{ text: 'Upper case' },
{ text: 'roman' },
{ text: 'roman two' },
]
},
]
},
{ separator: true },
{ text: 'Clear formatting', iconCss: 'e-icons ' },
]
},
{
text: 'Tools',
items: [
{ text: 'Comments', iconCss: 'e-icons AddComment' },
{ text: 'Track Changes', iconCss: 'e-icons M_TrackChanges' },
{ text: 'Local ClipBoard', iconCss: 'e-icons MT_Paste' },
{ text: 'Restrict Editing', iconCss: 'e-icons M_Lock', items: [{ text: "Read Only" }, { text: "Protections" }] },
]
},
{
text: 'Add-ons',
items: [
{
text: 'Form Fields', iconCss: 'e-icons M_FormField', items: [{ text: "Text Form", iconCss: 'e-icons M_Textform' },
{ text: "Check Box", iconCss: 'e-icons M_CheckBox' }, { text: "Drop-Down", iconCss: 'e-icons M_Dropdown' }]
},
{ text: 'Update Fields', iconCss: 'e-icons M_UpdateField' },
]
}
];
if (!this.wordDocumentMenubarObj) {
let menubaritems = ["File", "Edit", "View", "Insert", "Format", "Tools", "Add-ons"];
this.wordDocumentMenubarObj = new ej.navigations.Menu({
cssClass: 'biz-doc-menu',
showItemOnClick: true,
beforeItemRender: (e) => {
let popupitems = ["Text", "Font size", "Paragraph styles", "Align & indent", "Line spacing",
"Bullets & numbering", "Bold", "Italic", "Underline", "Strikethrough", "Superscript",
"Subscript", "Normal", "Heading 1", "Heading 2", "Heading 3", "Heading 4", "Heading 5",
"Heading 6", "8", "9", "10", "11", "12", "16", "14", "18", "20", "22", "24", "26", "48", "28", "36", "72", "96"];
if (popupitems.includes(e.item.text)) {
if (this.docBase.formatInfo && this.docBase.formatInfo.element && this.docBase.formatInfo.element.characterFormat) {
(this.docBase.formatInfo.element.characterFormat.bold) && (e.item.text == "Bold") && (this.addOrRemoveSelectIcon(e));
(this.docBase.formatInfo.element.characterFormat.italic) && (e.item.text == "Italic") && (this.addOrRemoveSelectIcon(e));
(this.docBase.formatInfo.element.characterFormat.baselineAlignment == e.item.text) && (this.addOrRemoveSelectIcon(e));
(e.item.text == "Underline") && (this.docBase.formatInfo.element.characterFormat.underline == "Single") && (this.addOrRemoveSelectIcon(e));
(e.item.text == "Strikethrough") && (this.docBase.formatInfo.element.characterFormat.strikethrough == "SingleStrike") && (this.addOrRemoveSelectIcon(e));
(e.item.text == "Text") && ((this.docBase.formatInfo.element.characterFormat.bold) || (this.docBase.formatInfo.element.characterFormat.italic) ||
(this.docBase.formatInfo.element.characterFormat.baselineAlignment == e.item.text) ||
(this.docBase.formatInfo.element.characterFormat.underline == "Single") ||
(this.docBase.formatInfo.element.characterFormat.strikethrough == "SingleStrike")) && (this.addOrRemoveSelectIcon(e));
(this.docBase.formatInfo.element.characterFormat.fontSize == e.item.text) && (this.addOrRemoveSelectIcon(e));
if (this.docBase.formatInfo.element.characterFormat.baseCharStyle) {
((this.docBase.formatInfo.element.characterFormat.baseCharStyle.name).slice(0, -5) == e.item.text) && (this.addOrRemoveSelectIcon(e));
}
else {
(e.item.text == "Normal") && (this.addOrRemoveSelectIcon(e));
}
(e.item.text == "Paragraph styles") && (this.addOrRemoveSelectIcon(e));
var fontsizes = ["8", "9", "10", "11", "12", "16", "14", "18", "20", "22", "24", "26", "48", "28", "36", "72", "96"];
(e.item.text == "Font size") && (fontsizes.includes(this.docBase.formatInfo.element.characterFormat.fontSize.toString())) && (this.addOrRemoveSelectIcon(e));
}
}
},
beforeClose: e => {
if (menubaritems.indexOf(e.parentItem.text) > -1) {
this.wordDocumentMenubarObj.showItemOnClick = true;
}
},
beforeOpen: (e) => {
if (menubaritems.indexOf(e.parentItem.text) > -1) {
this.wordDocumentMenubarObj.showItemOnClick = false;
}
let editItems = ["Undo", "Redo", "Paste", "Special paste"];
if (e.items.find(x => x.text == "Undo") != null) {
let undoOverley = document.getElementById("DocumentViewer_toolbar_undo").parentElement.classList.contains("e-overlay");
if (undoOverley) {
this.wordDocumentMenubarObj.enableItems(["Undo"], false);
}
}
if (e.items.find(x => x.text == "Redo") != null) {
let redoOverley = document.getElementById("DocumentViewer_toolbar_redo").parentElement.classList.contains("e-overlay");
if (redoOverley) {
this.wordDocumentMenubarObj.enableItems(["Redo"], false);
}
}
},
select: (e) => {
var lineHeight = document.getElementById("DocumentViewer_editor_font_properties_lineHeight").ej2_instances[0];
var bullets = document.getElementById("DocumentViewer_editor_font_properties_bullet_dropdownbtn").ej2_instances[0];
console.log(e);
switch (e.item.text) {
case "New":
this.processNewWord();
break;
case "Microsoft Word Document (.docx)":
this.fileDownload.downloadDocumentFile(FileId, documentGroup, FileName, 'Docx', instance.docBase.documentContainer);
break;
case "Portable Document Format (.pdf)":
this.docBase.convertDocsToPdfDownload(FileId);
break;
case "Text Document (.txt)":
this.fileDownload.downloadDocumentFile(FileId, documentGroup, FileName, 'Txt', instance.docBase.documentContainer);
break;
case "Open":
this.renderOpenNewDialogue();
break;
case "Close":
this.closePopup();
break;
case "Undo":
document.getElementById("DocumentViewer_toolbar_undo").click();
break;
case "Redo":
document.getElementById("DocumentViewer_toolbar_redo").click();
break;
case "Cut":
this.docBase.wordDocumentObj.documentEditor.editor.cut();
break;
case "Copy":
this.docBase.wordDocumentObj.documentEditor.selection.copy();
break;
case "Paste":
this.docBase.wordDocumentObj.documentEditor.editor.paste();
break;
case "Match destination formatting":
this.closePopup();
break;
case "Text only":
this.closePopup();
break;
case "Keep source formatting":
this.closePopup();
break;
case "Delete":
this.docBase.wordDocumentObj.documentEditor.editor.delete();
break;
case "Select all":
this.docBase.wordDocumentObj.documentEditor.selection.selectAll();
break;
case "Search":
this.docBase.wordDocumentObj.documentEditor.showOptionsPane();
break;
case "View only":
this.docBase.wordDocumentObj.documentEditor.isReadOnly = true;
break;
case "Editing":
this.docBase.wordDocumentObj.documentEditor.isReadOnly = false;
break;
case "Header":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_header" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Footer":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_footer" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Page Setup":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_page_setup" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Page Number":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_page_number" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Page Break":
this.wordDocumentObj.toolbarModule.container.documentEditor.editorModule.insertPageBreak();
break;
case "Section Break":
this.wordDocumentObj.toolbarModule.container.documentEditor.editorModule.insertSectionBreak();
break;
case "Footnote":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_footnote" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Endnote":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_endnote" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Full screen":
Unibase.Apps.Collaboration.Components.Fullscreen.Instance().refreshWordDocumentHeight(this.wordDocumentObj);
break;
case "Image":
this.wordDocumentObj.toolbarModule.imagePicker.value = "";
this.wordDocumentObj.toolbarModule.imagePicker.click();
setTimeout(() => { this.wordDocumentObj.toolbarModule.documentEditor.focusIn(); }, 30);
break;
case "Table":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_table" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Link":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_link" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Bookmark":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_bookmark" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Table Of Contents":
this.wordDocumentObj.documentEditor.showDialog('TableOfContents');
break;
case "Bold":
document.getElementById("DocumentViewer_editor_font_properties_bold").click();
break;
case "Italic":
document.getElementById("DocumentViewer_editor_font_properties_italic").click();
break;
case "Underline":
document.getElementById("DocumentViewer_editor_font_properties_underline").click();
break;
case "Strikethrough":
document.getElementById("DocumentViewer_editor_font_properties_strikethrough").click();
break;
case "Superscript":
document.getElementById("DocumentViewer_editor_font_properties_superscript").click();
break;
case "Subscript":
document.getElementById("DocumentViewer_editor_font_properties_subscript").click();
break;
case "Clear formatting":
document.getElementById("DocumentViewer_editor_font_properties_clearFormat").click();
break;
case "Left":
document.getElementById("DocumentViewer_editor_font_properties_leftIndent").click();
break;
case "Center":
document.getElementById("DocumentViewer_editor_font_properties_centerIndent").click();
break;
case "Right":
document.getElementById("DocumentViewer_editor_font_properties_rightIndent").click();
break;
case "Justified":
document.getElementById("DocumentViewer_editor_font_properties_justify").click();
break;
case "Increase indent":
document.getElementById("DocumentViewer_editor_font_properties_increaseIndent").click();
break;
case "Decrease indent":
document.getElementById("DocumentViewer_editor_font_properties_decreaseIndent").click();
break;
case "Single":
lineHeight.trigger('select', { item: lineHeight.items[0] });
break;
case "1.15":
lineHeight.trigger('select', { item: lineHeight.items[1] });
break;
case "1.5":
lineHeight.trigger('select', { item: lineHeight.items[2] });
break;
case "Double":
lineHeight.trigger('select', { item: lineHeight.items[3] });
break;
case "None":
this.wordDocumentObj.textProperties.paragraph.numberedNoneClick();
break;
case "Bullet dot":
this.wordDocumentObj.textProperties.paragraph.bulletDotClick();
break;
case "Bullet circle":
this.wordDocumentObj.textProperties.paragraph.bulletCircleClick();
break;
case "Bullet square":
this.wordDocumentObj.textProperties.paragraph.bulletSquareClick();
break;
case "Bullet flower":
this.wordDocumentObj.textProperties.paragraph.bulletFlowerClick();
break;
case "Bullet arrow":
this.wordDocumentObj.textProperties.paragraph.bulletArrowClick();
break;
case "Bullet tick":
this.wordDocumentObj.textProperties.paragraph.bulletTickClick();
break;
case "Numbers":
this.wordDocumentObj.textProperties.paragraph.numberedNumberDotClick();
break;
case "Lower case":
this.wordDocumentObj.textProperties.paragraph.numberedLowLetterClick();
break;
case "Upper case":
this.wordDocumentObj.textProperties.paragraph.numberedUpLetterClick();
break;
case "roman":
this.wordDocumentObj.textProperties.paragraph.numberedLowRomanClick();
break;
case "roman two":
this.wordDocumentObj.textProperties.paragraph.numberedUpRomanClick();
break;
case "No numbering":
this.wordDocumentObj.textProperties.paragraph.numberedNoneClick();
break;
case "Normal":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Normal', true);
break;
case "Heading 1":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 1', true);
break;
case "Heading 2":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 2', true);
break;
case "Heading 3":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 3', true);
break;
case "Heading 4":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 4', true);
break;
case "Heading 5":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 5', true);
break;
case "Heading 6":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 6', true);
break;
case "8":
this.setFontSize('8');
break;
case "9":
this.setFontSize('9');
break;
case "10":
this.setFontSize('10');
break;
case "11":
this.setFontSize('11');
break;
case "12":
this.setFontSize('12');
break;
case "14":
this.setFontSize('14');
break;
case "16":
this.setFontSize('16');
break;
case "18":
this.setFontSize('18');
break;
case "20":
this.setFontSize('20');
break;
case "22":
this.setFontSize('22');
break;
case "24":
this.setFontSize('24');
break;
case "36":
this.setFontSize('36');
break;
case "Find":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_find" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Comments":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_comment" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Track Changes":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_track" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Local ClipBoard":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_use_local_clipboard" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Read Only":
var ele = $('li[aria-label="Read Only"]').children('span').toggleClass('Selection');
const value = 12;
this.wordDocumentObj.toolbarModule.toggleEditing();
break;
case "Protections":
this.wordDocumentObj.toolbarModule.documentEditor.documentHelper.restrictEditingPane.showHideRestrictPane(true);
break;
case "Text Form":
this.wordDocumentObj.toolbarModule.documentEditor.editor.insertFormField('Text');
break;
case "Check Box":
this.wordDocumentObj.toolbarModule.documentEditor.editor.insertFormField('CheckBox');
break;
case "Drop-Down":
this.wordDocumentObj.toolbarModule.documentEditor.editor.insertFormField('DropDown');
break;
case "Update Fields":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_update_fields" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
}
},
items: menuItems,
}, '#menu');
}
}
addOrRemoveSelectIcon(ele) {
if (!ele.element.firstElementChild.classList.contains("biz-ss-selecticon")) {
ele.element.firstElementChild.classList.add("biz-ss-selecticon");
}
}
processNewWord() {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/components/common/util.js", () => {
let urlStr = Unibase.Apps.Collaboration.Components.Common.Util.Instance().makeid(40);
window.open(window.origin + "#/documents/" + urlStr + "/newword/0");
});
}
renderOpenNewDialogue() {
this.OpenSelectButton = new ej.buttons.Button({ cssClass: `e-flat` });
this.OpenCancelButton = new ej.buttons.Button({ cssClass: `e-flat` });
var elem = document.getElementById("opendocfile");
if (elem == null) {
this.docOpenDialougObj = new ej.popups.Dialog({
isModal: true,
header: 'Open File',
content: `<div id='tabobjforopendoc'></div>`,
target: document.getElementById("container"),
width: '470px',
height: '330px',
animationSettings: { effect: 'Zoom' },
cssClass: "biz-doc-importopen-dialog"
});
this.docOpenDialougObj.appendTo('#dialog');
var tabObjForOpen = new ej.navigations.Tab({
items: [{
header: { 'text': 'Upload' },
content: `<div id="opendocfile-wrapper">
<h2 style="color: #ccc">Drag a file...</h2>
<label id='opendocfilelable'>
select file from device
<br>
<input type="file" name="" id="opendocfile" accept=".doc, .docx, .txt , .rtf" placeholder="select a file from your device" >
</label>
<div id="filename"></div>
</div>
</div>
<button id='opendocfile-select-btn' class='e-disabled'>select</button>
<button id='opendocfile-cancel-btn'>cancel</button>`
}]
});
tabObjForOpen.appendTo('#tabobjforopendoc');
}
else {
this.docOpenDialougObj.show();
}
this.importOpenDialogcreated();
}
importOpenDialogcreated() {
document.getElementById('opendocfile-select-btn').setAttribute("disabled", 'true');
document.getElementById('opendocfile-select-btn').addEventListener('click', () => {
this.openWordDocument();
this.docOpenDialougObj.hide();
});
document.getElementById('opendocfile-cancel-btn').addEventListener('click', () => {
this.docOpenDialougObj.hide();
document.getElementById('opendocfile-select-btn').classList.add('e-disabled');
document.getElementById('filename').innerHTML = "";
this.importedFile.value = null;
if (this.docOpenDialougObj) {
this.docOpenDialougObj.destroy();
}
});
this.OpenSelectButton.appendTo('#opendocfile-select-btn');
this.OpenCancelButton.appendTo('#opendocfile-cancel-btn');
document.body.addEventListener('dragover', (e) => {
e.preventDefault();
});
document.getElementsByClassName('biz-doc-importopen-dialog')[0].addEventListener('dragover', (e) => {
e.preventDefault();
});
document.getElementsByClassName('biz-doc-importopen-dialog')[0].addEventListener("drop", (e) => {
e.preventDefault();
document.getElementById('opendocfile').files = e.dataTransfer.files;
var ele = { target: { files: e.dataTransfer.files } };
this.fileSelected(ele);
});
document.getElementById('opendocfile').addEventListener('change', (e) => {
debugger;
this.fileSelected(e);
});
}
fileSelected(e) {
document.getElementById('opendocfile-select-btn').removeAttribute('disabled');
document.getElementById('opendocfile-select-btn').classList.remove('e-disabled');
this.importedFile = document.getElementById('opendocfile');
document.getElementById('filename').innerHTML = this.importedFile.files[0].name;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('platform/core/helpers/file/filehelper.js', () => {
Unibase.Platform.Helpers.FileHelper.Instance().getBase64(e).then((response) => {
if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.length != 0) {
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
var refId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_recordid").Value);
if (refId != 0 && refId != null && refId != undefined) {
}
}
var fileobject = {
filedata: response.FileData,
filename: response.FileName,
filetype: response.FileType,
RefId: refId,
FileId: this.FileId,
};
this.documentOpenFileData = fileobject;
});
});
}
openWordDocument() {
Unibase.Apps.Collaboration.DocumentManager.Instance().importCreateSpreadSheet(this.documentOpenFileData).then((response) => {
var result = response.result;
});
}
closePopup() {
if (!this.docBase.NewDocument) {
Unibase.Apps.Collaboration.Components.DocConnector.Instance().closeDoc();
}
window.close();
}
appendToolbarElements() {
let sideBarElementsText = [];
let sideBarElementsIndent = [];
let sideBarElementsParagraph = [];
var idsText = ['DocumentViewer_editor_font_properties_fontFamilyDiv', 'DocumentViewer_editor_font_properties_fontSizeDiv', 'DocumentViewer_editor_font_properties_leftDiv',
'DocumentViewer_editor_font_properties_rightDiv'];
let idsParagraph = ['DocumentViewer_editor_font_properties_color', 'DocumentViewer_editor_font_properties_styleDiv'];
var idsIndent = ['DocumentViewer_editor_font_properties_leftIndent', 'DocumentViewer_editor_font_properties_centerIndent', 'DocumentViewer_editor_font_properties_rightIndent', 'DocumentViewer_editor_font_properties_justify',
'DocumentViewer_editor_font_properties_decreaseIndent', 'DocumentViewer_editor_font_properties_increaseIndent', 'DocumentViewer_editor_font_properties_lineHeight',
'DocumentViewer_editor_font_properties_listDropDiv'];
idsText.forEach(element => {
sideBarElementsText.push(document.getElementById(element));
});
idsIndent.forEach(element => {
sideBarElementsIndent.push(document.getElementById(element));
});
idsParagraph.forEach(element => {
sideBarElementsParagraph.push(document.getElementById(element));
});
sideBarElementsText.forEach(element => {
this.util.appendChildren('biz-doc-bottomtoolbar-text', 0, element);
});
sideBarElementsIndent.forEach(element => {
this.util.appendChildren('biz-doc-bottomtoolbar-indent', 0, element);
});
sideBarElementsParagraph.forEach(element => {
this.util.appendChildren('biz-doc-bottomtoolbar-paragraph', 0, element);
});
this.docBase.bottomtoolbartext = document.getElementsByClassName('biz-doc-bottomtoolbar-text')[0];
this.util.appendChildren('biz-doc-bottomtoolbar-undoredo', 0, this.util.createElement("button", 'class', 'biz-doc-undo e-disabled e-btn e-lib'));
this.util.appendChildren('biz-doc-undo', 0, this.util.createElement("span", 'class', 'e-icons e-icon-left biz-doc-undo-icon e-btn-icon'));
this.util.appendChildren('biz-doc-bottomtoolbar-undoredo', 0, this.util.createElement("button", 'class', 'biz-doc-redo e-disabled e-btn e-lib'));
this.util.appendChildren('biz-doc-redo', 0, this.util.createElement("span", 'class', 'e-icons e-icon-left biz-doc-redo-icon e-btn-icon'));
document.getElementsByClassName("biz-doc-undo")[0].id = "biz_doc_undobtn";
document.getElementsByClassName("biz-doc-redo")[0].id = "biz_doc_redobtn";
this.docBase.bottomtoolbartext.insertBefore(this.util.createElement('div', 'class', 'biz-doc-toobarspace'), document.getElementsByClassName('biz-doc-bottomtoolbar-text')[0].childNodes[0]);
this.docBase.bottomtoolbartext.insertBefore(this.util.createElement('div', 'class', 'biz-doc-toobarspace'), document.getElementsByClassName('biz-doc-bottomtoolbar-text')[0].childNodes[2]);
document.getElementsByClassName('biz-doc-bottomtoolbar-indent')[0].insertBefore(this.util.createElement('div', 'class', 'biz-doc-toobarspace'), document.getElementsByClassName('biz-doc-bottomtoolbar-indent')[0].childNodes[0]);
document.getElementById('biz_doc_undobtn').insertBefore(this.util.createElement('div', 'class', 'biz-doc-toobarspace'), document.getElementById('biz_doc_undobtn').childNodes[0]);
document.getElementById('DocumentViewer_editor_font_properties_increaseIndent').after(this.util.createElement('div', 'class', 'biz-doc-toobarspace'));
document.getElementById('DocumentViewer_editor_font_properties_clearFormat').after(this.util.createElement('div', 'class', 'biz-doc-toobarspace'));
document.getElementById('DocumentViewer_editor_font_properties_fontSizeDiv').after(this.util.createElement('div', 'class', 'e-toolbar-item e-separator biz-doc-seperator'));
document.getElementById('DocumentViewer_editor_font_properties_rightDiv').after(this.util.createElement('div', 'class', 'e-toolbar-item e-separator biz-doc-seperator'));
document.getElementById('DocumentViewer_editor_font_properties_styleDiv').after(this.util.createElement('div', 'class', 'e-toolbar-item e-separator biz-doc-seperator'));
document.getElementById('DocumentViewer_editor_font_properties_lineHeight').after(this.util.createElement('div', 'class', 'e-toolbar-item e-separator biz-doc-seperator'));
document.getElementById('DocumentViewer_editor_font_properties_color').getElementsByClassName("e-colorpicker-wrapper")[0].after(this.util.createElement('div', 'class', 'e-toolbar-item e-separator biz-doc-seperator'));
this.util.appendChildren('biz-doc-bottomtoolbar-undoredo', 0, this.util.createElement("button", 'class', 'biz-doc-undo e-disabled e-btn e-lib'));
this.util.appendChildren('biz-doc-undo', 0, this.util.createElement("span", 'class', 'e-icons e-icon-left biz-doc-undo-icon e-btn-icon'));
this.util.appendChildren('biz-doc-bottomtoolbar-undoredo', 0, this.util.createElement("button", 'class', 'biz-doc-redo e-disabled e-btn e-lib'));
this.util.appendChildren('biz-doc-redo', 0, this.util.createElement("span", 'class', 'e-icons e-icon-left biz-doc-redo-icon e-btn-icon'));
this.docBase.toolbarWidth = document.querySelector('.biz-doc-bottomtoolbar-undoredo').getBoundingClientRect().width + document.querySelector('.biz-doc-bottomtoolbar-text').getBoundingClientRect().width + document.querySelector('.biz-doc-bottomtoolbar-paragraph').getBoundingClientRect().width + document.querySelector('.biz-doc-bottomtoolbar-indent').getBoundingClientRect().width;
}
createResponsiveToolbar() {
var instance = this;
document.getElementsByClassName('biz-doc-bottomtoolbar')[0].insertBefore(this.util.createElement('div', 'class', 'leftarrow-wrapper'), document.getElementsByClassName('biz-doc-bottomtoolbar')[0].childNodes[0]);
document.getElementsByClassName('biz-doc-bottomtoolbar')[0].appendChild(this.util.createElement('div', 'class', 'rightarrow-wrapper'));
document.getElementsByClassName('leftarrow-wrapper')[0].appendChild(this.util.createElement('button', 'id', 'leftarrow-btn'));
document.getElementsByClassName('rightarrow-wrapper')[0].appendChild(this.util.createElement('button', 'id', 'rightarrow-btn'));
this.docBase.rightArrowBtn = document.getElementById('rightarrow-btn');
this.docBase.leftArrowBtn = document.getElementById('leftarrow-btn');
this.docBase.leftArrowWrapper = document.getElementsByClassName('leftarrow-wrapper')[0];
this.docBase.rightArrowWrapper = document.getElementsByClassName('rightarrow-wrapper')[0];
this.docBase.toolbarWrapper = document.getElementsByClassName('biz-doc-toolbar-wrapper')[0];
this.docBase.rightArrowBtn.classList.add('e-icons');
this.docBase.rightArrowBtn.classList.add('biz_right_arrow');
this.docBase.leftArrowBtn.classList.add('e-icons');
this.docBase.leftArrowBtn.classList.add('biz_left_arrow');
this.docBase.leftArrowBtn.classList.add('e-disabled');
this.docBase.leftArrowWrapper.style.display = 'none';
this.docBase.rightArrowWrapper.style.display = 'none';
this.setToolbarWidth();
this.docBase.rightArrowBtn.addEventListener('click', () => {
this.docBase.toolbarWrapper.scrollBy({
top: 0,
left: 300,
behavior: "smooth"
});
this.docBase.leftArrowBtn.classList.remove('e-disabled');
});
this.docBase.leftArrowBtn.addEventListener('click', () => {
this.docBase.toolbarWrapper.scrollBy({
top: 0,
left: -300,
behavior: "smooth"
});
this.docBase.rightArrowBtn.classList.remove('e-disabled');
});
this.docBase.toolbarWrapper.addEventListener('scroll', () => {
if (this.docBase.toolbarWrapper.scrollWidth - this.docBase.toolbarWrapper.scrollLeft - this.docBase.toolbarWrapper.clientWidth < 1) {
this.docBase.rightArrowBtn.classList.add("e-disabled");
}
else if (this.docBase.toolbarWrapper.scrollLeft == 0) {
this.docBase.leftArrowBtn.classList.add("e-disabled");
}
});
window.addEventListener('resize', () => {
this.setToolbarWidth();
});
}
setDisplay(value) {
this.docBase.leftArrowWrapper.style.display = value;
this.docBase.rightArrowWrapper.style.display = value;
}
getBtnsWidth() {
return document.getElementsByClassName('leftarrow-wrapper')[0].getBoundingClientRect().width + document.getElementsByClassName('rightarrow-wrapper')[0].getBoundingClientRect().width;
}
setToolbarWidth() {
if (window.innerWidth <= this.docBase.toolbarWidth + this.getBtnsWidth()) {
this.setDisplay('');
this.docBase.toolbarWrapper.style.width = 'calc(100% - 72px)';
}
else {
this.setDisplay('none');
this.docBase.toolbarWrapper.style.width = this.docBase.toolbarWidth + 3 + 'px';
}
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Ribbon();
}
return this.instance;
}
}
DocEditor.Ribbon = Ribbon;
})(DocEditor = Components.DocEditor || (Components.DocEditor = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,229 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
class Documents extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.ej2Source = {
Excel: ['libs/syncfusion/excel/ej2-excel.min.js'],
Pdf: ['libs/syncfusion/pdf/ej2-pdf.min.js'],
Word: ['libs/syncfusion/word/ej2-word.min.js'],
};
}
jsFiles() {
return ["apps/collaboration/managers/documentmanager.js"];
}
cssFiles() {
return [];
}
loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
var instance = this;
instance.navigationHelper.popup(Pk_Value, '', Unibase.Apps.Collaboration.Components.Documents.Instance(), function (container) {
var documentGroup = ElementId;
if (Callback != null) {
Callback();
}
}, Unibase.Platform.Helpers.Size.ExtraLarge);
}
html(id, containerid) {
var html = `<div><div id="DocumentViewer" style="width: 100%;height: 100%" class="DocumentViewer"></div></div>
<div id="dialog-container">
<div id="dialog"></div>
<div id="see-document-status"></div>
<div id="dlgContent" class="dialogContent"></div>
</div><div id="importfile-container"></div>
<div id="copydocument-container"> </div><div id="spreadsheettrim-container">
<div id="removeduplicates"></div><div id="biz-ss-menubar-fullscreendialog"></div><div id="biz-ss-resizetofit-dialog"></div></div>`;
return html;
}
load(formId, containerid, callback) {
var instance = this;
instance._containerid = containerid;
}
convertDocsToPdfDownload(documentFileId) {
Unibase.Apps.Collaboration.DocumentManager.Instance().ConvertDocstoPdfDownload(documentFileId).then(function (response) {
Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(response.result);
});
}
previewSpreadSheet(fileurl, userid) {
let docManger = Unibase.Apps.Collaboration.DocumentManager.Instance();
docManger.getDocumentFileInfo(fileurl).then((response) => {
docManger.getJsonData(response.result.FileId).then((res) => {
docManger.getCustomJsonData(response.result.FileId).then((customresponse) => {
Unibase.Apps.Collaboration.Components.Documents.Instance()._documentId = response.result.FileId;
Unibase.Apps.Collaboration.Components.DocConnector.Instance().init(response.result.FileId, response.result.DocumentGroup);
this.fileCacheHelper.loadJsFiles(["apps/collaboration/components/sheets/formatpainter.js", "apps/collaboration/components/unicloud.js", "apps/collaboration/components/sheets/spellcheck.js", "apps/collaboration/components/sheets/spellcheck.js", "apps/collaboration/components/sheets/autofill.js", "apps/collaboration/components/sheets/ribbon.js", "apps/collaboration/components/sheets/dialogue.js", "apps/collaboration/components/sheets/base.js", 'apps/collaboration/components/common/download.js', 'apps/collaboration/enums/enum.js'], () => {
let sheets = Unibase.Apps.Collaboration.Components.Sheets.Base.Instance();
console.log(response);
if (res.result != null && res.result != "") {
sheets.init(response, res, customresponse);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
}
else {
}
});
});
});
});
}
;
previewWordDocument(Fileurl) {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(Fileurl).then((response) => {
Unibase.Apps.Collaboration.DocumentManager.Instance().getJsonData(response.result.FileId).then((res) => {
this.fileCacheHelper.loadJsFiles(['apps/collaboration/components/doceditor/base.js', 'platform/core/helpers/file/filehelper.js', 'apps/collaboration/components/sheets/base.js', 'apps/collaboration/components/unicloud.js', 'apps/collaboration/components/doceditor/ribbon.js', 'apps/collaboration/components/common/download.js'], () => {
let bizDoc = Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance();
bizDoc.init(response, res);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
});
});
}
previewPdf(FileId) {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(FileId).then((response) => {
this.fileCacheHelper.loadJsFiles(['apps/collaboration/components/pdfviewer/base.js'], () => {
let bizPfd = Unibase.Apps.Collaboration.Components.PdfViewer.Base.Instance();
bizPfd.init(response);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
});
}
previewImage(documentFileId) {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(documentFileId).then(function (response) {
var result = response.result;
var fileName = result.DocumentFileName + "." + result.FileType;
var byteCharacters = atob(result.FileData);
var byteNumbers = new Array(byteCharacters.length);
for (var i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
var byteArray = new Uint8Array(byteNumbers);
var file = new Blob([byteArray], { type: result.DocumentGroup + '/' + result.FileType + ';base64' });
var fileURL = URL.createObjectURL(file);
window.open(fileURL, fileName, "width=600,height=600,scrollbars=yes");
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
}
previewDocument(documentFileId, documentGroup, userid) {
this.documentfileid = documentFileId;
this.documentGroup = documentGroup;
$(".unibase_modal_backdrop").removeAttr('style');
$(".preloader-it").fadeIn();
this.fileCacheHelper.loadJsFiles(["apps/collaboration/managers/documentmanager.js", "apps/collaboration/managers/filemanager.js", "apps/collaboration/components/sheets/spellcheck.js", "apps/collaboration/components/docconnector.js", "apps/collaboration/components/unidochub.js", "apps/collaboration/components/common/util.js", 'libs/syncfusion/ej2.min.js', 'apps/collaboration/components/fullscreen.js'], () => {
this.fileCacheHelper.loadCssFiles(['libs/syncfusion/material.css', 'libs/syncfusion/custom-css.css', 'libs/syncfusion/docx.css', 'libs/syncfusion/spreadsheet-custom.css', 'libs/syncfusion/pdf.css'], () => {
if (documentGroup == "Image") {
this.previewImage(documentFileId);
}
else if (documentGroup == "Excel") {
this.previewSpreadSheet(documentFileId, userid);
}
else if (documentGroup == "Word") {
this.previewWordDocument(documentFileId);
}
else if (documentGroup == "Pdf") {
this.previewPdf(documentFileId);
}
});
});
}
downloadDocument(FileId, documentGroup) {
if (documentGroup == "Excel") {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/documentmanager.js", function () {
var data = {
FileId: FileId
};
Unibase.Apps.Collaboration.DocumentManager.Instance().spreadSheetDownload(data).then(function (response) {
var filepath = response.result;
filepath = encodeURIComponent(filepath);
Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(filepath);
});
});
}
else if (documentGroup == "Word") {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/documentmanager.js", function () {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(FileId).then(function (response) {
var filepath = response.result.DocumentFilePath;
filepath = encodeURIComponent(filepath);
Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(filepath);
});
});
}
else {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/documentmanager.js", function () {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(FileId).then(function (response) {
var a = document.createElement("a");
a.href = "data:" + response.result.FileType + ";base64," + response.result.FileData;
a.download = response.result.FileTitle + "." + response.result.FileType;
a.click();
});
});
}
}
deleteDocumentFile(DocumentFileId) {
bootbox.confirm("Do you want to Delete this File ?", function (result) {
if (result == true) {
Unibase.Platform.Files.Managers.FileManager.Instance().deleteDocumentFile(DocumentFileId).then(function (response) {
MessageHelper.Instance().showSuccess("Document File Deleted Successfully.", "");
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);
});
}
});
}
newWordDoc(callback) {
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
this.fileCacheHelper.loadJsFiles(this.ej2Source["Word"].concat(["apps/collaboration/managers/documentmanager.js", "apps/collaboration/components/sheets/spellcheck.js", "apps/collaboration/components/docconnector.js", "apps/collaboration/components/unidochub.js", "apps/collaboration/components/common/util.js", 'apps/collaboration/components/fullscreen.js', 'apps/collaboration/components/sheets/base.js', 'apps/collaboration/components/doceditor/base.js', 'apps/collaboration/components/doceditor/ribbon.js', 'apps/collaboration/components/common/download.js', 'apps/collaboration/enums/enum.js']), () => {
this.fileCacheHelper.loadCssFiles(['libs/syncfusion/material.css', 'libs/syncfusion/custom-css.css', 'libs/syncfusion/docx.css', 'libs/syncfusion/spreadsheet-custom.css', 'libs/syncfusion/pdf.css'], () => {
var response = {
result: { FileTitle: "Untitled Document", NewDocument: true, NewUpload: true }
};
var res = { result: "" };
let bizDoc = Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance();
bizDoc.init(response, res, callback);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
});
}
newExcel(type, callback) {
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
this.fileCacheHelper.loadJsFiles(["apps/collaboration/components/sheets/formatpainter.js", "apps/collaboration/components/unicloud.js", "apps/collaboration/components/docconnector.js", 'libs/syncfusion/ej2.min.js', "apps/collaboration/components/fullscreen.js", "apps/collaboration/components/sheets/spellcheck.js", "apps/collaboration/components/sheets/autofill.js", "apps/collaboration/components/sheets/ribbon.js", "apps/collaboration/components/sheets/dialogue.js", "apps/collaboration/components/sheets/base.js", 'apps/collaboration/components/common/download.js', 'apps/collaboration/components/common/util.js', 'apps/collaboration/enums/enum.js'], () => {
this.fileCacheHelper.loadCssFiles(['libs/syncfusion/material.css', 'libs/syncfusion/custom-css.css', 'libs/syncfusion/docx.css', 'libs/syncfusion/spreadsheet-custom.css', 'libs/syncfusion/pdf.css'], () => {
var folderId;
var res = { result: "" };
var customres = { result: "" };
var response = { result: { FileTitle: "Untitled Spreadsheet", NewDocument: true, NewUpload: true, folderId: folderId } };
if (type != 0 && type != undefined) {
folderId = parseInt(atob(type));
}
else {
folderId = 0;
}
var sheets = Unibase.Apps.Collaboration.Components.Sheets.Base.Instance();
sheets.init(response, res, customres, callback);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Documents();
}
return this.instance;
}
}
Components.Documents = Documents;
class sfdtexport {
}
Components.sfdtexport = sfdtexport;
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,89 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
class Fullscreen {
constructor() {
this.ssMenuBarFullScreen = false;
this.isDocFullscreen = false;
}
refreshWordDocumentHeight(docObj) {
this.docBase = Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance();
let fullscreenElement = docObj.element;
this.wordDocRibbon = document.getElementsByClassName('biz-doc-ribbon')[0];
this.wordDocToolbar = document.getElementsByClassName('biz-doc-bottomtoolbar')[0];
this.wordDocFooter = fullscreenElement.parentElement.nextElementSibling;
this.wordDocFooter.style.display = "none";
this.wordDocRibbon.style.display = 'none';
this.wordDocToolbar.style.display = 'none';
docObj.height = window.innerHeight + 'px';
document.getElementsByClassName('e-de-text-target')[0].contentWindow.document.addEventListener("keyup", (e) => {
this.refreshDocumentHeightProps(fullscreenElement);
event.preventDefault();
this.exitFullscreenEsc(e, docObj);
if (e.keyCode == 122) {
if (!this.isDocFullscreen) {
this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight;
docObj.height = this.totalHeight + 'px';
this.isDocFullscreen = true;
}
else {
this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight;
docObj.height = this.totalHeight + 'px';
this.isDocFullscreen = false;
}
}
});
document.body.addEventListener("keyup", (e) => {
this.exitFullscreenEsc(e, this.docBase.wordDocumentObj);
});
}
refreshDocumentHeightProps(fullscreenElement) {
this.ribbonHeight = document.getElementsByClassName("biz-doc-ribbon")[0].offsetHeight;
this.toolbarHeight = document.getElementsByClassName("biz-doc-bottomtoolbar")[0].offsetHeight;
this.footerHeight = fullscreenElement.parentElement.nextElementSibling.offsetHeight;
}
exitFullscreenEsc(e, docObj) {
if (e.keyCode == 27) {
this.refreshDocumentHeightProps(docObj.element);
this.wordDocRibbon.style.display = '';
this.wordDocToolbar.style.display = '';
this.wordDocFooter.style.display = "";
this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight;
docObj.height = this.totalHeight + 'px';
}
}
refreshSpreadsheetHeight(ssObj) {
this.sheetBase = Unibase.Apps.Collaboration.Components.Sheets.Base.Instance();
this.dialog = Unibase.Apps.Collaboration.Components.Sheets.Dialogue.Instance();
this.ssMenuBarFullScreen = true;
let fullscreenElement = ssObj.element;
let sheetPannelElement = document.getElementById("DocumentViewer_sheet_panel");
fullscreenElement.parentElement.nextElementSibling.style.display = "none";
fullscreenElement.parentElement.previousElementSibling.style.display = "none";
document.getElementById('DocumentViewer_ribbon').style.display = 'none';
var footerHeight = sheetPannelElement.nextElementSibling.offsetHeight;
var headerHeight = sheetPannelElement.previousElementSibling.offsetHeight;
sheetPannelElement.style.height = window.innerHeight - footerHeight - headerHeight + "px";
this.dialog.renderMenubarFullscreenDialog();
}
inintEvents() {
}
removeEvetns() {
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Fullscreen();
}
return this.instance;
}
}
Components.Fullscreen = Fullscreen;
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"fullscreen.js","sourceRoot":"","sources":["fullscreen.ts"],"names":[],"mappings":"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"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.ssMenuBarFullScreen=!1;this.isDocFullscreen=!1}refreshWordDocumentHeight(t){this.docBase=n.Apps.Collaboration.Components.DocEditor.Base.Instance();let i=t.element;this.wordDocRibbon=document.getElementsByClassName("biz-doc-ribbon")[0];this.wordDocToolbar=document.getElementsByClassName("biz-doc-bottomtoolbar")[0];this.wordDocFooter=i.parentElement.nextElementSibling;this.wordDocFooter.style.display="none";this.wordDocRibbon.style.display="none";this.wordDocToolbar.style.display="none";t.height=window.innerHeight+"px";document.getElementsByClassName("e-de-text-target")[0].contentWindow.document.addEventListener("keyup",n=>{this.refreshDocumentHeightProps(i),event.preventDefault(),this.exitFullscreenEsc(n,t),n.keyCode==122&&(this.isDocFullscreen?(this.totalHeight=window.innerHeight-this.ribbonHeight-this.toolbarHeight-this.footerHeight,t.height=this.totalHeight+"px",this.isDocFullscreen=!1):(this.totalHeight=window.innerHeight-this.ribbonHeight-this.toolbarHeight-this.footerHeight,t.height=this.totalHeight+"px",this.isDocFullscreen=!0))});document.body.addEventListener("keyup",n=>{this.exitFullscreenEsc(n,this.docBase.wordDocumentObj)})}refreshDocumentHeightProps(n){this.ribbonHeight=document.getElementsByClassName("biz-doc-ribbon")[0].offsetHeight;this.toolbarHeight=document.getElementsByClassName("biz-doc-bottomtoolbar")[0].offsetHeight;this.footerHeight=n.parentElement.nextElementSibling.offsetHeight}exitFullscreenEsc(n,t){n.keyCode==27&&(this.refreshDocumentHeightProps(t.element),this.wordDocRibbon.style.display="",this.wordDocToolbar.style.display="",this.wordDocFooter.style.display="",this.totalHeight=window.innerHeight-this.ribbonHeight-this.toolbarHeight-this.footerHeight,t.height=this.totalHeight+"px")}refreshSpreadsheetHeight(t){this.sheetBase=n.Apps.Collaboration.Components.Sheets.Base.Instance();this.dialog=n.Apps.Collaboration.Components.Sheets.Dialogue.Instance();this.ssMenuBarFullScreen=!0;let r=t.element,i=document.getElementById("DocumentViewer_sheet_panel");r.parentElement.nextElementSibling.style.display="none";r.parentElement.previousElementSibling.style.display="none";document.getElementById("DocumentViewer_ribbon").style.display="none";var u=i.nextElementSibling.offsetHeight,f=i.previousElementSibling.offsetHeight;i.style.height=window.innerHeight-u-f+"px";this.dialog.renderMenubarFullscreenDialog()}inintEvents(){}removeEvetns(){}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.Fullscreen=i})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,157 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let PdfViewer;
(function (PdfViewer) {
class Base {
constructor() {
this.isFullscreen = false;
}
init(response) {
this.result = response.result;
this.documentGroup = this.result.DocumentGroup;
this.documentFileName = this.result.DocumentFileName;
this.documentFileId = this.result.DocumentFileId;
this.filePath = this.result.DocumentFilePath;
this.render();
}
unwireBootStrapKeyEvent() {
let popup = document.body.getElementsByClassName('_bizgaze_popup_container');
let events = $._data($(popup)[0], "events");
if (events && events.keydown) {
$(popup).off('keydown.dismiss.bs.modal', events.keydown[0].handler);
}
}
render() {
this.renderPopup();
this.renderMenuBar();
this.renderPdf();
this.updateProps();
this.refreshHeight();
this.addEventListeners();
this.unwireBootStrapKeyEvent();
}
addEventListeners() {
this.fullscreenBtn.addEventListener('click', () => {
this.openFullscreen();
});
this.popupElement.addEventListener('fullscreenchange', () => {
setTimeout(() => {
this.setHeigthOnFullscreenChange();
}, 0);
if (this.isFullscreen) {
this.fullscreenBtn.classList.remove('biz-enterfullscreen');
this.fullscreenBtn.classList.add('biz-exitfullscreen');
this.isFullscreen = true;
}
else {
this.fullscreenBtn.classList.remove('biz-exitfullscreen');
this.fullscreenBtn.classList.add('biz-enterfullscreen');
this.isFullscreen = false;
}
;
});
document.addEventListener('fullscreenchange', () => {
this.setHeigthOnFullscreenChange();
});
window.addEventListener('keyup', (e) => {
if (e.keyCode == 122) {
e.preventDefault();
this.openFullscreen();
this.setHeigthOnFullscreenChange();
}
});
this.exitPdf.addEventListener('click', () => {
this.closePopup();
});
}
openFullscreen() {
let elem = this.popupElement;
if (!this.isFullscreen) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
}
else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen();
}
else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
this.isFullscreen = true;
}
else {
if (document.exitFullscreen) {
document.exitFullscreen();
}
else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
this.isFullscreen = false;
}
}
setHeigthOnFullscreenChange() {
var footerHeight = this.element.parentElement.nextElementSibling.offsetHeight;
this.element.parentElement.style.height = window.innerHeight - footerHeight + 'px';
this.pdfViewer.height = '100%';
}
renderPdf() {
this.pdfViewer = new ej.pdfviewer.PdfViewer({
created: this.pdfCreated.bind(this),
documentPath: this.filePath,
serviceUrl: 'http://localhost:3088/pdfviewer'
});
ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation);
this.pdfViewer.appendTo('#DocumentViewer');
}
updateProps() {
this.popupElement = document.getElementsByClassName('_bizgaze_popup_container')[0];
this.element = document.getElementById('DocumentViewer');
this.fullscreenBtn = document.getElementsByClassName('biz-pdf-fullscreen-btn')[0];
this.exitPdf = document.getElementsByClassName('biz-pdf-exitpdf-btn')[0];
}
pdfCreated() {
var util = Unibase.Apps.Collaboration.Components.Common.Util.Instance();
document.getElementById("DocumentViewer_zoomDropDownContainer").after(util.createElement('div', 'class', 'biz-pdf-fullscreen'));
util.appendChildren('biz-pdf-fullscreen', 0, util.createElement('button', 'class', 'e-icons biz-pdf-fullscreen-btn biz-enterfullscreen'));
document.getElementById("DocumentViewer_downloadContainer").after(util.createElement('div', 'class', 'biz-pdf-exitpdf'));
util.appendChildren('biz-pdf-exitpdf', 0, util.createElement('button', 'class', 'e-icons biz-pdf-exitpdf-btn'));
}
actionComplete() {
}
closePopup() {
Unibase.Apps.Collaboration.Components.DocConnector.Instance().closeDoc();
var contId = $("._bizgaze_popup_container:visible").attr("id");
$('#' + contId).modal('hide');
$('#' + contId).remove();
}
refreshHeight() {
var footerHeight = this.element.parentElement.nextElementSibling.offsetHeight;
var rootHeight = this.element.parentElement.parentElement.offsetHeight;
this.element.parentElement.style.height = (rootHeight - footerHeight) + 'px';
}
renderPopup() {
Unibase.Apps.Collaboration.Components.Documents.Instance().loadForm(0, this.documentFileId, 0, null, this.documentGroup);
}
renderMenuBar() {
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Base();
}
return this.instance;
}
}
PdfViewer.Base = Base;
})(PdfViewer = Components.PdfViewer || (Components.PdfViewer = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.isFullscreen=!1}init(n){this.result=n.result;this.documentGroup=this.result.DocumentGroup;this.documentFileName=this.result.DocumentFileName;this.documentFileId=this.result.DocumentFileId;this.filePath=this.result.DocumentFilePath;this.render()}unwireBootStrapKeyEvent(){let t=document.body.getElementsByClassName("_bizgaze_popup_container"),n=$._data($(t)[0],"events");n&&n.keydown&&$(t).off("keydown.dismiss.bs.modal",n.keydown[0].handler)}render(){this.renderPopup();this.renderMenuBar();this.renderPdf();this.updateProps();this.refreshHeight();this.addEventListeners();this.unwireBootStrapKeyEvent()}addEventListeners(){this.fullscreenBtn.addEventListener("click",()=>{this.openFullscreen()});this.popupElement.addEventListener("fullscreenchange",()=>{setTimeout(()=>{this.setHeigthOnFullscreenChange()},0),this.isFullscreen?(this.fullscreenBtn.classList.remove("biz-enterfullscreen"),this.fullscreenBtn.classList.add("biz-exitfullscreen"),this.isFullscreen=!0):(this.fullscreenBtn.classList.remove("biz-exitfullscreen"),this.fullscreenBtn.classList.add("biz-enterfullscreen"),this.isFullscreen=!1)});document.addEventListener("fullscreenchange",()=>{this.setHeigthOnFullscreenChange()});window.addEventListener("keyup",n=>{n.keyCode==122&&(n.preventDefault(),this.openFullscreen(),this.setHeigthOnFullscreenChange())});this.exitPdf.addEventListener("click",()=>{this.closePopup()})}openFullscreen(){let n=this.popupElement;this.isFullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),this.isFullscreen=!1):(n.requestFullscreen?n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen():n.msRequestFullscreen&&n.msRequestFullscreen(),this.isFullscreen=!0)}setHeigthOnFullscreenChange(){var n=this.element.parentElement.nextElementSibling.offsetHeight;this.element.parentElement.style.height=window.innerHeight-n+"px";this.pdfViewer.height="100%"}renderPdf(){this.pdfViewer=new ej.pdfviewer.PdfViewer({created:this.pdfCreated.bind(this),documentPath:this.filePath,serviceUrl:"http://localhost:3088/pdfviewer"});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection,ej.pdfviewer.TextSearch,ej.pdfviewer.Print,ej.pdfviewer.Navigation);this.pdfViewer.appendTo("#DocumentViewer")}updateProps(){this.popupElement=document.getElementsByClassName("_bizgaze_popup_container")[0];this.element=document.getElementById("DocumentViewer");this.fullscreenBtn=document.getElementsByClassName("biz-pdf-fullscreen-btn")[0];this.exitPdf=document.getElementsByClassName("biz-pdf-exitpdf-btn")[0]}pdfCreated(){var t=n.Apps.Collaboration.Components.Common.Util.Instance();document.getElementById("DocumentViewer_zoomDropDownContainer").after(t.createElement("div","class","biz-pdf-fullscreen"));t.appendChildren("biz-pdf-fullscreen",0,t.createElement("button","class","e-icons biz-pdf-fullscreen-btn biz-enterfullscreen"));document.getElementById("DocumentViewer_downloadContainer").after(t.createElement("div","class","biz-pdf-exitpdf"));t.appendChildren("biz-pdf-exitpdf",0,t.createElement("button","class","e-icons biz-pdf-exitpdf-btn"))}actionComplete(){}closePopup(){n.Apps.Collaboration.Components.DocConnector.Instance().closeDoc();var t=$("._bizgaze_popup_container:visible").attr("id");$("#"+t).modal("hide");$("#"+t).remove()}refreshHeight(){var n=this.element.parentElement.nextElementSibling.offsetHeight,t=this.element.parentElement.parentElement.offsetHeight;this.element.parentElement.style.height=t-n+"px"}renderPopup(){n.Apps.Collaboration.Components.Documents.Instance().loadForm(0,this.documentFileId,0,null,this.documentGroup)}renderMenuBar(){}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.Base=i})(i=t.PdfViewer||(t.PdfViewer={}))})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,15 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Requests;
(function (Requests) {
class File {
}
Requests.File = File;
})(Requests = Collaboration.Requests || (Collaboration.Requests = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"file.js","sourceRoot":"","sources":["file.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAkBhB;AAlBD,WAAU,OAAO;IACb,IAAiB,IAAI,CAgBpB;IAhBD,WAAiB,IAAI;QACjB,IAAkB,aAAa,CAc9B;QAdD,WAAkB,aAAa;YAC3B,IAAiB,QAAQ,CAYxB;YAZD,WAAiB,QAAQ;gBAGrB,MAAa,IAAI;iBAOhB;gBAPY,aAAI,OAOhB,CAAA;YAEL,CAAC,EAZgB,QAAQ,GAAR,sBAAQ,KAAR,sBAAQ,QAYxB;QACL,CAAC,EAdiB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAc9B;IACL,CAAC,EAhBgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAgBpB;AACL,CAAC,EAlBS,OAAO,KAAP,OAAO,QAkBhB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{}n.File=t})(t=n.Requests||(n.Requests={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,538 @@
.biz-share-modal.modal {
overflow-y: auto !important;
}
.biz-share-modal .modal-dialog {
max-width: 640px;
}
.biz-share-modal .modal-content {
max-width: 100%;
max-height: 100%;
}
.biz-share-accordion .share-text-dark {
color: #202124;
}
.biz-share-accordion .card {
border: 0;
border-radius: 10px !important;
}
.biz-share-accordion .card .card-header {
display: flex;
justify-content: center;
padding: 20px 24px 15px 24px;
border: 0;
}
.biz-share-accordion .card .card-header > a {
padding-bottom: 0;
background-color: #fff;
color: #202124;
padding: 0rem 0rem 0.75rem 0rem;
font-weight: 400;
}
.biz-share-accordion .card .card-header > a::before,
.biz-share-accordion .card .card-header > a.collapsed:before {
content: '';
}
.biz-share-accordion .card .card-header .header-icon-wrapper {
display: flex;
align-items: center;
}
.biz-share-accordion .card .card-header .header-icon-wrapper .btn {
border-radius: 50% !important;
margin-right: 10px;
cursor: default;
}
.biz-share-accordion .card .header-icon-wrapper .notifyBackBtn {
cursor: pointer !important;
}
.biz-share-accordion .card .collapse-btn[data-expanded='true'] {
cursor: default;
}
.biz-share-accordion .card .card-header .header-title {
font-size: 22px;
}
.biz-share-accordion .card .card-header .shared-users {
padding: 9px 0 4px;
display: block;
color: #5f6368;
font-size: 14px;
}
.biz-share-accordion .card .card-header.activestate .shared-users {
display: none;
}
.biz-share-accordion .card .card-header > a.collapsed .shared-users {
display: block;
}
.biz-share-accordion .card .card-footer {
display: flex;
justify-content: space-between;
align-items: center;
}
.biz-share-accordion .add-people-wrapper {
padding: 15px 24px 0px 24px;
}
.biz-share-accordion .people-select2-wrapper {
width: 100%;
}
.biz-share-accordion .people-select2-wrapper .select2-selection--multiple {
border: none;
border-bottom: 1px solid #000 !important;
border-radius: 6px 6px 0 0 !important;
background-color: #f8f9fa;
padding: 0 .75em;
min-height: 3em;
display: flex;
align-items: center;
}
.biz-share-accordion .people-select2-wrapper .select2-selection--multiple:hover {
background-color: #f1f3f4;
}
.biz-share-accordion .people-select2-wrapper .select2-selection--multiple .select2-selection__rendered {
padding: 0 .125em 0 .25em;
}
.biz-share-accordion .people-select2-wrapper .select2-selection__rendered .select2-search__field {
margin-top: 0px;
}
.biz-share-accordion .people-select2-wrapper .select2-search__field {
margin-top: 0px;
}
.biz-share-accordion .people-select2-wrapper .select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
background: #f1f3f4;
border-bottom: 2px solid #1a73e8 !important;
}
#select2-user_select2-results {
padding-top: 4px;
padding-bottom: 4px;
}
#select2-user_select2-results .select2-results__option--highlighted[aria-selected] {
background-color: #f5f5f5 !important;
color: #202124 !important;
}
.biz-share-accordion .people-select2-wrapper .select2-selection__rendered .select2-selection__choice {
font-size: 14px;
background-color: #fff;
color: #5f6368;
border: 1px solid #dadce0;
border-radius: 16px;
padding-left: 10px;
padding-right: 5px;
margin: 4px;
}
.biz-share-accordion .people-select2-wrapper .select2-selection__rendered .select2-selection__choice:hover, .biz-share-accordion .people-select2-wrapper .select2-selection__rendered .select2-selection__choice:hover .select2-selection__choice__remove {
color: #000;
}
.biz-share-accordion .people-select2-wrapper .select2-selection__choice .select2-selection__choice__remove {
color: #5f6368;
font-size: 18px;
font-weight: 600;
margin-left: 6px;
float: right;
opacity: 1;
padding-top: 0px;
height: 0;
position: relative;
top: -4px;
}
.biz-share-accordion .shared-people-list {
max-height: 33vh;
overflow-x: auto;
margin-top: 8px;
padding: 1px 0px 1px 20px;
}
.biz-share-accordion .people-list-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px 8px;
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
}
.biz-share-accordion .people-list-item:hover {
background-color: #f1f3f4;
}
.biz-share-accordion .user-role-wrapper {
padding-right: 20px;
}
.biz-share-accordion .user-detail-wrapper {
display: flex;
align-items: center;
}
.biz-share-accordion .user-role-wrapper .dropdown-toggle {
background-color: transparent;
font-weight: 500;
color: #5f6368;
font-size: 14px;
}
.biz-share-accordion .user-role-wrapper .dropdown-toggle:hover {
background-color: #ecedee;
font-weight: 500;
color: #202124;
}
.biz-share-accordion .user-role-wrapper .dropdown-item {
padding: 8px 40px;
color: #202124;
position: relative;
}
.biz-share-accordion .user-role-wrapper .dropdown-item .dropdown-icon {
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
color: #1a73e8;
font-size: 20px;
}
.biz-share-accordion .user-role-wrapper .dropdown-item .temp-span {
display: block;
font-size: 14px;
color: rgba(0, 0, 0, 0.54);
}
.biz-share-accordion .user-role-wrapper .owner-span {
padding: 0.25rem 0.7rem;
color: rgba(60, 64, 67, 0.38);
font-style: italic;
font-weight: 500;
font-size: 14px;
}
.biz-share-accordion .user-name-email-wrapper .user-name {
font-weight: 500;
color: #202124;
}
.biz-share-accordion .card-footer {
padding: 8px 24px;
}
.biz-share-accordion .card-footer .btn {
padding: 5px 24px 5px 24px;
}
.biz-share-accordion .card-footer .feedback-link {
font-size: 12px;
text-decoration: underline;
color: #1a73e8;
}
.biz-share-accordion .card-footer .feedback-link:hover {
background-color: #f6fafe;
}
.biz-share-accordion .people-notification-area {
margin: 0 24px;
}
.biz-share-accordion .shared-file-btn {
display: flex;
align-items: center;
cursor: pointer;
margin-bottom: 8px;
padding-left: 10px;
padding-right: 10px;
max-width: 100%;
background-color: #fff;
border: 1px #dadce0 solid;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: #3c4043;
height: 32px;
border-radius: 16px;
font-size: 14px;
font-weight: 500;
letter-spacing: .25px;
outline: none;
}
.biz-share-accordion .shared-file-btn .file-icon {
height: 20px;
width: 20px;
}
.biz-share-accordion .shared-file-btn .file-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-left: 10px;
}
.biz-share-accordion .message-textarea {
height: 96px;
max-height: 30vh;
width: 100%;
position: relative;
margin-bottom: 14px;
background-color: #f1f3f4;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
flex-grow: 1;
flex-shrink: 1;
font-size: 16px;
font-weight: 400;
letter-spacing: .1px;
line-height: 24px;
border: none;
outline: none;
overflow-y: visible;
overflow-x: hidden;
padding: 16px;
resize: none;
white-space: pre-wrap;
word-wrap: break-word;
z-index: 1;
}
.biz-share-accordion .message-textarea:hover {
background-color: #f1f3f4;
}
.biz-share-accordion .message-textarea:after {
background: none repeat scroll 0 0 transparent;
bottom: 0;
content: "";
display: block;
height: 2px;
left: 50%;
position: absolute;
background-color: #1a73e8;
transition: width 0.3s ease 0s, left 0.3s ease 0s;
width: 0;
}
.biz-share-accordion .message-textarea:focus:after {
width: 100%;
left: 0;
}
.biz-share-accordion .custom-share-checkbox {
display: inline-block;
padding: 10px 0px;
}
.biz-share-accordion .custom-share-checkbox input {
padding: 0;
height: initial;
width: initial;
margin-bottom: 0;
display: none;
cursor: pointer;
}
.biz-share-accordion .custom-share-checkbox label {
display: flex;
align-items: center;
position: relative;
cursor: pointer;
margin-bottom: 0px;
font-size: 14px;
color: rgba(0,0,0,0.87);
}
.biz-share-accordion .custom-share-checkbox label:before {
content: '';
-webkit-appearance: none;
background-color: #1a73e8;
border: 2px solid #1a73e8;
border-radius: 2px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05);
width: 18px;
height: 18px;
display: inline-block;
position: relative;
vertical-align: middle;
cursor: pointer;
margin-right: 10px;
}
.biz-share-accordion .custom-share-checkbox input:checked + label:after {
content: '';
display: block;
position: absolute;
top: 2px;
left: 6px;
width: 6px;
height: 14px;
border: solid #fff;
border-width: 0 2px 2px 0;
transform: rotate( 45deg);
}
.biz-share-accordion .custom-share-checkbox.unchecked label:before {
background-color: unset;
border-color: #5f6368;
}
.biz-share-accordion .user-owner {
padding-right: 20px;
}
.biz-share-accordion .external-dropdown {
position: relative
}
.biz-share-accordion .external-dropdown .dropdown, .biz-share-accordion .external-dropdown .dropup {
position: static;
}
.biz-share-accordion .external-dropdown .dropdown-menu {
left: 95%;
margin-top: 0;
}
.biz-share-accordion .permissionsMenu {
margin-top: 40px;
}
#select2-user_select2-results .select2-results__option[aria-selected=true] {
display: none;
}
.biz-share-accordion .activestate .btn-icon,
.biz-share-accordion .activestate a.bg-secondary:hover,
.biz-share-accordion .activestate button.bg-secondary:hover {
background-color: rgb(0, 109, 119) !important;
color: rgb(255, 255, 255) !important;
border-color: rgb(0, 109, 119) !important;
}
.biz-share-accordion .card-header .bg-secondary:hover {
background-color: #9e9e9e !important;
}
.biz-share-accordion .external-dropdown .avatar.avatar-sm {
width: 2.25rem;
height: 2.25rem;
}
.collapse-getlink .search-wrapper, #ul_link {
padding: 0 24px 20px 24px;
}
#txt_link {
height: 36px;
}
#txt_link:focus {
outline: none;
}
#collapse_getlink .people-list-item:hover .btn-icon {
background-color: #fff !important;
}
.biz-share-modal {
z-index: 1060;
}
#discardModal {
z-index: 1060;
}
.biz-share-accordion .people-select2-wrapper .select2-search input:active {
background-color: #f1f3f4 !important;
}
#collapseGetLinkBtn .get_link_icon {
transform: scaleX(-1);
}
#get-link-card .copy-link-btn:hover {
background-color: #EAF4FF;
}
.get-link-card-loader {
width: 98%;
margin: 0 auto;
border: 0 solid transparent;
position: relative;
padding: 1px;
border-radius: 10px;
}
.get-link-card-loader:before {
content: '';
background-color: lightgray;
position: absolute;
top: 0;
right: 0;
bottom: -2px;
left: 0;
border-radius: 10px;
}
.get-link-card-loader .get-link-card-loaderBar {
position: absolute;
padding: 2px;
top: 0;
right: 100%;
bottom: 0;
left: 0;
background: #298DFF;
width: 0;
animation: borealisBar 1s linear infinite;
}
@keyframes borealisBar {
0% {
left: 0%;
right: 100%;
width: 0%;
}
10% {
left: 0%;
right: 50%;
width: 50%;
}
90% {
right: 0%;
left: 50%;
width: 50%;
}
100% {
left: 100%;
right: 0%;
width: 0%;
}
}
@@ -0,0 +1,846 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let Sheets;
(function (Sheets) {
class Autofill {
constructor() {
this.hederText = {};
this.colType = { String: "string", Number: "number", Custom: "custom", Formula: "formula", Time: "time", LongDate: "longdate", ShortDate: "shortdate", Scientific: "scientific", Fraction: "fraction", Text: "text", General: "general", Accounting: "accounting", Currency: "currency", Percentage: "percentage", Date: "date", DateTime: "datetime" };
this.customList = [
["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
];
this.UC = {
uniqueOBracket: String.fromCharCode(129),
uniqueCBracket: String.fromCharCode(130),
uniqueCSeparator: String.fromCharCode(131),
uniqueCOperator: String.fromCharCode(132),
uniquePOperator: String.fromCharCode(133),
uniqueSOperator: String.fromCharCode(134),
uniqueMOperator: String.fromCharCode(135),
uniqueDOperator: String.fromCharCode(136),
uniqueModOperator: String.fromCharCode(137),
uniqueConcateOperator: String.fromCharCode(138),
uniqueEqualOperator: String.fromCharCode(139),
uniqueExpOperator: String.fromCharCode(140),
uniqueGTOperator: String.fromCharCode(141),
uniqueLTOperator: String.fromCharCode(142)
};
}
init(base) {
this.base = base;
this.ssObj = base.ssObj;
this.initProp();
}
initProp() {
this.beforeSelectFn = this.beforeSelect.bind(this);
this.base.ssObj.addEventListener("beforeSelect", this.beforeSelectFn);
this.selectFn = this.selected.bind(this);
this.base.ssObj.addEventListener("select", this.selectFn);
this.actionCompleteFn = this.updateAutofill.bind(this);
this.base.ssObj.addEventListener("actionComplete", this.actionCompleteFn);
this.createdFn = this.created.bind(this);
this.base.ssObj.addEventListener("created", this.createdFn);
this.dataBoundFn = this.dataBound.bind(this);
this.base.ssObj.addEventListener("dataBound", this.dataBoundFn);
this.cellEditFn = this.cellEdit.bind(this);
this.base.ssObj.addEventListener("cellEditing", this.cellEditFn);
this.cellSaveFn = this.cellSave.bind(this);
this.base.ssObj.addEventListener("cellSave", this.cellSaveFn);
this.base.ssObj.on("activeSheetChanged", this.updateAutofill, this);
this.base.ssObj.on("mouseDown", this.mouseDown, this);
}
destroy() {
this.base.ssObj.removeEventListener("beforeSelect", this.beforeSelectFn);
this.base.ssObj.removeEventListener("select", this.selectFn);
this.base.ssObj.removeEventListener("actionComplete", this.actionCompleteFn);
this.base.ssObj.removeEventListener("created", this.createdFn);
this.base.ssObj.removeEventListener("dataBound", this.dataBoundFn);
this.base.ssObj.removeEventListener("cellEditing", this.cellEditFn);
this.base.ssObj.removeEventListener("cellSave", this.cellSaveFn);
this.base.ssObj.off("activeSheetChanged", this.updateAutofill);
this.base.ssObj.on("mouseDown", this.mouseDown, this);
ej.base.EventHandler.remove(this.base.ssObj.element, 'mouseup', this.mouseUp);
ej.base.EventHandler.remove(this.base.ssObj.element, 'keydown', this.keypress);
ej.base.EventHandler.remove(this.base.ssObj.element, 'dblclick', this.dblClick);
}
cellEdit() {
this.hideAutofill();
}
cellSave() {
this.updateAutofill();
}
dataBound() {
this.updateAutofill();
}
createBorders() {
if (!this.base.ssObj.element.getElementsByClassName('biz-af-bdr')[0]) {
let content = this.base.ssObj.element.getElementsByClassName('e-sheet-content')[0];
this.bdrAF = content.appendChild(ej.base.createElement('div', { className: 'biz-af-bdr' }));
}
}
hideBorders() {
if (this.bdrAF) {
this.bdrAF.style.display = 'none';
}
}
showBorders() {
if (this.bdrAF) {
this.bdrAF.style.display = '';
}
}
updateBorderDirection(hideDirecton) {
this.bdrAF.style.borderRightWidth = '1px';
this.bdrAF.style.borderLeftWidth = '1px';
this.bdrAF.style.borderTopWidth = '1px';
this.bdrAF.style.borderBottomWidth = '1px';
this.bdrAF.style["border" + hideDirecton + "Width"] = '0px';
}
mouseDown(e) {
if (e.target.classList.contains('biz-autofill')) {
this.isDrag = true;
ej.base.EventHandler.add(this.base.ssObj.element, 'mousemove', this.mouseMoveHandler, this);
this.x = e.clientX;
this.y = e.clientY;
this.indexes = this.base.ssObj.biz.getIndexes();
this.createBorders();
let sel = this.base.ssObj.element.getElementsByClassName('e-selection')[0];
let activecell = this.base.ssObj.element.getElementsByClassName('e-active-cell')[0];
this.selection = sel.classList.contains('e-hide') ? activecell : sel;
this.selOffset = this.selection.getBoundingClientRect();
this.parentOffset = this.selection.offsetParent.getBoundingClientRect();
this.left = parseInt(this.selection.style.left);
this.top = parseInt(this.selection.style.top);
}
}
mouseUp(e) {
this.isDrag = false;
ej.base.EventHandler.remove(this.base.ssObj.element, 'mousemove', this.mouseMoveHandler);
if (this.direction != undefined) {
this.autoFill();
}
this.direction = undefined;
this.hideBorders();
this.isDragged = false;
this.prevTarget = undefined;
}
createAutofill() {
if (!this.base.ssObj.element.getElementsByClassName('biz-autofill')[0]) {
this.element = document.createElement('div');
this.element.classList.add('biz-autofill');
let content = this.base.ssObj.element.getElementsByClassName('e-sheet-content')[0];
content && content.appendChild(this.element);
}
this.element.classList.remove('biz-hide');
}
updateAutofill() {
if (!this.base.ssObj.isEdit) {
this.positionAutofill();
}
else {
this.hideAutofill();
}
}
dblClick() {
setTimeout(() => {
this.hideAutofill();
}, 1);
}
positionAutofill() {
setTimeout(() => {
this.createAutofill();
let selection = this.base.ssObj.element.getElementsByClassName('e-selection')[0];
let activecell = this.base.ssObj.element.getElementsByClassName('e-active-cell')[0];
if (selection && !selection.classList.contains('e-hide')) {
activecell = selection;
}
(this.element && activecell) && (this.element.style.top = parseInt(activecell.style.top) + parseInt(activecell.style.height) - 6 + 'px');
(this.element && activecell) && (this.element.style.left = parseInt(activecell.style.left) + parseInt(activecell.style.width) + -5 + 'px');
}, 10);
}
hideAutofill() {
let ele = this.base.ssObj.element.getElementsByClassName('biz-autofill')[0];
if (ele) {
ele.classList.add('biz-hide');
}
}
mouseMoveHandler(e) {
e.preventDefault();
let x = e.clientX;
let y = e.clientY;
if (e.target === this.prevTarget) {
return;
}
let tr = ej.base.closest(e.target, 'tr');
let td = ej.base.closest(e.target, '.e-cell');
if (!this.isDragged) {
this.showBorders();
}
this.isDragged = true;
if (!tr || !td) {
return;
}
let colIdx = parseInt(td.getAttribute('aria-colindex')) - 1;
let rowIdx = parseInt(tr.getAttribute('aria-rowindex')) - 1;
if (this.indexes[0] <= rowIdx && this.indexes[2] >= rowIdx && this.indexes[1] <= colIdx && this.indexes[3] >= colIdx) {
this.hideBorders();
return;
}
let tdOffset = td.getBoundingClientRect();
let px = 'px';
this.showBorders();
let sheet = this.base.ssObj.biz.getActiveSheet();
let freezeRow = this.base.ssObj.frozenRowCount(sheet);
let freezeCol = this.base.ssObj.frozenColCount(sheet);
let left;
let width;
let top;
let height;
switch (true) {
case this.indexes[3] < colIdx && this.indexes[0] - rowIdx < colIdx - this.indexes[3] && rowIdx - this.indexes[2] < colIdx - this.indexes[3]:
this.direction = "right";
left = this.left + this.selOffset.width;
width = ej.spreadsheet.getCellPosition(sheet, [rowIdx - 1, colIdx + 1], freezeRow, freezeCol).left - (this.left + this.selOffset.width);
this.updateBorderDirection('Left');
this.bdrAF.style.top = this.top + px;
this.bdrAF.style.left = left + px;
this.bdrAF.style.height = this.selOffset.height + px;
this.bdrAF.style.width = width + px;
this.fIndexes = [this.indexes[0], this.indexes[3] + 1, this.indexes[2], colIdx];
this.startCell = { rowIndex: this.indexes[0], colIndex: this.indexes[1] };
this.endCell = { rowIndex: this.indexes[2], colIndex: colIdx };
break;
case this.indexes[1] > colIdx && this.indexes[0] - rowIdx <= this.indexes[1] - colIdx && rowIdx - this.indexes[2] < this.indexes[1] - colIdx:
this.direction = "left";
left = ej.spreadsheet.getCellPosition(sheet, [rowIdx - 1, colIdx], freezeRow, freezeCol).left;
width = this.left - left;
this.updateBorderDirection('Right');
this.bdrAF.style.top = this.top + px;
this.bdrAF.style.left = left + px;
this.bdrAF.style.height = this.selOffset.height + px;
this.bdrAF.style.width = width + px;
this.fIndexes = [this.indexes[0], colIdx, this.indexes[2], this.indexes[3] - 1];
this.startCell = { rowIndex: this.indexes[0], colIndex: colIdx };
this.endCell = { rowIndex: this.indexes[2], colIndex: this.indexes[3] };
break;
case this.indexes[0] > rowIdx:
this.direction = "up";
top = ej.spreadsheet.getCellPosition(sheet, [rowIdx, colIdx - 1], freezeRow, freezeCol).top;
height = this.top - top;
this.updateBorderDirection('Bottom');
this.bdrAF.style.top = top + px;
this.bdrAF.style.left = this.left + px;
this.bdrAF.style.height = height + px;
this.bdrAF.style.width = this.selOffset.width + px;
this.fIndexes = [rowIdx, this.indexes[1], this.indexes[0] - 1, this.indexes[3]];
this.startCell = { rowIndex: rowIdx, colIndex: this.indexes[1] };
this.endCell = { rowIndex: this.indexes[2], colIndex: this.indexes[3] };
break;
case this.indexes[2] < rowIdx:
this.direction = "down";
top = this.top + this.selOffset.height;
height = ej.spreadsheet.getCellPosition(sheet, [rowIdx + 1, colIdx - 1], freezeRow, freezeCol).top - (this.top + this.selOffset.height);
this.updateBorderDirection('Top');
this.bdrAF.style.top = top + px;
this.bdrAF.style.left = this.left + px;
this.bdrAF.style.height = height + px;
this.bdrAF.style.width = this.selOffset.width + px;
this.fIndexes = [this.indexes[2] + 1, this.indexes[1], rowIdx, this.indexes[3]];
this.startCell = { rowIndex: this.indexes[0], colIndex: this.indexes[1] };
this.endCell = { rowIndex: rowIdx, colIndex: this.indexes[3] };
break;
default:
this.direction = undefined;
break;
}
this.prevTarget = e.target;
this.drawAutoFill(e);
}
drawAutoFill(e) {
}
selected(e) {
this.range = e.range;
this.updateAutofill();
}
beforeSelect(e) {
if (this.isDrag) {
e.cancel = true;
}
this.hideAutofill();
}
created() {
ej.base.EventHandler.add(this.base.ssObj.element, 'mouseup', this.mouseUp, this);
ej.base.EventHandler.add(this.base.ssObj.element, 'keydown', this.keypress, this);
ej.base.EventHandler.add(this.base.ssObj.element, 'dblclick', this.dblClick, this);
}
keypress() {
this.updateAutofill();
}
autoFill() {
let options = {};
let sheetIdx = this.base.getSheetIndex();
options.sheetIdx = sheetIdx;
options.dataRange = this.indexes;
options.fillRange = this.fIndexes;
this.base.ssObj.updateUndoRedoCollection({ name: 'bizAction', args: { action: 'autofill', options: options, direction: this.direction, oldCells: this.base.getCellsFromIndexes(options.fillRange) } });
this.applyValues(options);
this.base.ssObj.selectRange(this.base.generateHeaderText(this.startCell.colIndex + 1) + (this.startCell.rowIndex + 1) + ':' + this.base.generateHeaderText(this.endCell.colIndex + 1) + (this.endCell.rowIndex + 1));
let args = { action: "autofill" };
Unibase.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave(args, this.base, true);
this.updateAutofill();
}
applyAutofill(options, direction) {
this.direction = direction;
this.applyValues(options);
this.direction = undefined;
}
applyValues(options) {
let pos = { Down: 'down', Up: 'up', Left: 'left', Right: 'right' };
let val, plen, patterns, patrn, pRanges, patrnRange, fillRange, cellObjs, data, temp, dlen, j, k, l, tlen, tot, hasRef, format, formats, cells, clen, cellIdx, cellProps, i = 0, dataObj = {};
let drSR = options.dataRange[0];
let drSC = options.dataRange[1];
let drER = options.dataRange[2];
let drEC = options.dataRange[3];
let frSR = options.fillRange[0];
let frSC = options.fillRange[1];
let frER = options.fillRange[2];
let frEC = options.fillRange[3];
let isVFill = [pos.Down, pos.Up].indexOf(this.direction) > -1;
let isRFill = [pos.Up, pos.Left].indexOf(this.direction) > -1;
let sheet = this.base.ssObj.biz.getActiveSheet();
let len = isVFill ? drEC - drSC : drER - drSR;
while (i <= len) {
pRanges = this.updateFillValues(isVFill, drSR, drSC, drER, drEC, frSR, frSC, frER, frEC, i);
patrnRange = pRanges.patrnRange;
fillRange = pRanges.fillRange;
patterns = this.createPattern(patrnRange, { isRFill: isRFill, isVFill: isVFill });
cellObjs = this.getData(patrnRange);
data = this.getRawData(cellObjs);
dlen = data.length;
if (!patterns)
return;
plen = patterns.length;
cells = this.getSelectedRange({ rowIndex: fillRange[0], colIndex: fillRange[1] }, { rowIndex: fillRange[2], colIndex: fillRange[3] });
clen = cells.length;
if (isRFill) {
cells = cells.reverse();
patterns = patterns.reverse();
patterns = this.ensurePattern(patterns);
cellObjs = cellObjs.reverse();
data = data.reverse();
}
j = 0;
while (j < clen) {
dataObj = {};
cellIdx = cells[j];
patrn = patterns[j % plen];
if (this.isNumber(patrn))
patrn = patterns[patrn];
switch (patrn.type) {
case this.colType.Number:
val = this.round(patrn.regVal.a + (patrn.regVal.b * patrn.i), 5);
if (isRFill)
patrn.i--;
else
patrn.i++;
break;
case this.colType.String:
val = patrn.val[patrn.i % patrn.val.length];
patrn.i++;
break;
case this.colType.Formula:
hasRef = false;
val = "=";
k = 0;
tlen = patrn.val.length;
while (k < tlen) {
temp = patrn.val[k];
if (this.isObject(temp)) {
hasRef = true;
tot = this.round(temp.a + (temp.b * patrn.i), 0);
if (tot < 1)
val += "#REF!";
else
val += isVFill ? temp.c + (temp.b ? tot : '$' + tot) : (temp.b ? this.base.generateHeaderText(tot) : '$' + this.base.generateHeaderText(tot)) + temp.c;
}
else
val += temp;
k++;
}
if (hasRef && isRFill)
patrn.i--;
else
patrn.i++;
break;
case this.colType.Custom:
val = this.round(patrn.regVal.a + (patrn.regVal.b * patrn.i), 0);
if (val < 0)
val = (val % patrn.len) + patrn.len;
if (val >= patrn.len)
val = val % patrn.len;
val = patrn.val[val];
if (isRFill)
patrn.i--;
else
patrn.i++;
break;
}
l = j % dlen;
let cell = ej.spreadsheet.getCell(cellIdx.rowIndex, cellIdx.colIndex, sheet);
if (cellObjs[l]) {
cell = this.formObjFromValues(cellObjs[l], ['style', 'format', 'wrap', 'isLocked', 'validation', 'hyperlink',]);
cell['value'] = val;
}
else {
cell = {};
}
this.base.ssObj.biz.setCell(cellIdx.rowIndex, cellIdx.colIndex, sheet, cell);
if (cell.validation && cell.validation.isHighlighted) {
this.base.ssObj.addInvalidHighlight(this.base.generateHeaderText(cellIdx.colIndex + 1) + (cellIdx.rowIndex + 1));
}
j++;
}
i++;
}
let args = { options: options, direction: this.direction, action: 'autofill', origin: 'biz', sheetIndex: this.base.getSheetIndex() };
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(args);
}
formObjFromValues(cellObj, props) {
let obj = {};
for (let i = 0; i < props.length; i++) {
if (cellObj[props[i]]) {
obj[props[i]] = cellObj[props[i]];
}
}
return obj;
}
updateFillValues(isVFill, drSR, drSC, drER, drEC, frSR, frSC, frER, frEC, i) {
let pStart, pEnd, fStart, fEnd, patrnRange, fillRange;
if (isVFill) {
pStart = { rowIndex: drSR, colIndex: drSC + i };
pEnd = { rowIndex: drER, colIndex: drSC + i };
fStart = { rowIndex: frSR, colIndex: frSC + i };
fEnd = { rowIndex: frER, colIndex: frSC + i };
}
else {
pStart = { rowIndex: drSR + i, colIndex: drSC };
pEnd = { rowIndex: drSR + i, colIndex: drEC };
fStart = { rowIndex: frSR + i, colIndex: frSC };
fEnd = { rowIndex: frSR + i, colIndex: frEC };
}
patrnRange = [pStart.rowIndex, pStart.colIndex, pEnd.rowIndex, pEnd.colIndex];
fillRange = [fStart.rowIndex, fStart.colIndex, fEnd.rowIndex, fEnd.colIndex];
return { patrnRange: patrnRange, fillRange: fillRange };
}
createPattern(range, options) {
let j, idx, temp, regVal, custColl, lCaseColl, lCaseVal, isLCase, diff, len, i = 0, pattern = [];
let patrns = this.createDataPattern(range);
let plen = patrns.length;
let patrn;
if (patrns) {
while (i < plen) {
patrn = patrns[i];
switch (patrn.type) {
case this.colType.Number:
idx = pattern.length;
len = patrn.val.length;
diff = options.isRFill ? -1 : len;
if (len === 1)
patrn.val.push(patrn.val[0] + 1);
regVal = this.getPredictionValue(patrn.val);
temp = { regVal: regVal, type: patrn.type, i: diff };
pattern.push(temp);
j = 1;
while (j < len) {
pattern.push(idx);
j++;
}
break;
case this.colType.String:
idx = pattern.length;
temp = { val: patrn.val, type: patrn.type, i: 0 };
pattern.push(temp);
j = 1;
len = patrn.val.length;
while (j < len) {
pattern.push(idx);
j++;
}
break;
case this.colType.Formula:
len = patrn.val.length;
patrn = this.createFormulaPattern(patrn.val, options);
diff = options.isRFill ? -1 : len;
if (patrn.isInPattern) {
idx = pattern.length;
temp = { val: patrn.val, type: this.colType.Formula, i: diff };
pattern.push(temp);
j = 1;
while (j < len) {
pattern.push(idx);
j++;
}
}
else {
j = 0;
diff = options.isRFill ? -1 : 1;
while (j < len) {
pattern.push({ val: patrn.val[j], type: this.colType.Formula, i: diff });
j++;
}
}
break;
}
i++;
}
return pattern;
}
}
createDataPattern(range) {
let val, type, i = 0;
let obj = {};
let patrn = [];
let cellObjs;
cellObjs = this.getData(range);
let data = this.getRawData(cellObjs);
let dlen = data.length;
if (dlen) {
while (i < dlen) {
val = data[i];
type = this.getType(val);
if (i === 0)
obj = { val: [val], type: type };
else if (type === obj.type)
obj.val.push(val);
else {
patrn.push(obj);
obj = { val: [val], type: type };
}
i++;
}
patrn.push(obj);
return patrn;
}
}
createFormulaPattern(data, options) {
let patrn, j, temp, isInPatrn, patrns = [], i = 0, len = data.length, cRfrType;
while (i < len) {
patrns.push(this.parseFormula(data[i]));
i++;
}
isInPatrn = this.isInPattern(patrns, options.isVFill);
if (isInPatrn) {
patrn = patrns[0];
i = patrn.length;
while (i--) {
temp = patrn[i];
cRfrType = this.isCellReference(temp);
if (cRfrType && (cRfrType !== "absolute"))
patrn[i] = this.getCellRefPrediction(temp, options, null, cRfrType);
}
return { isInPattern: isInPatrn, val: patrn };
}
else {
i = 0;
while (i < len) {
patrn = patrns[i];
j = patrn.length;
while (j--) {
temp = patrn[j];
cRfrType = this.isCellReference(temp);
if (cRfrType && (cRfrType !== "absolute"))
patrns[i][j] = this.getCellRefPrediction(temp, options, len, cRfrType);
}
i++;
}
return { isInPattern: isInPatrn, val: patrns };
}
}
parseFormula(formula) {
var temp, str, len, i = 0, arr = [];
formula = this.markSpecialChar(formula.replace("=", ""));
formula = formula.split(/\(|\)|=|\^|>|<|,|:|\+|-|\*|\/|%|&/g);
len = formula.length;
while (i < len) {
temp = formula[i];
if (!temp) {
i++;
continue;
}
if (temp.length === 1)
arr.push(this.isUniqueChar(temp) ? this.getUniqueCharVal(temp) : temp);
else {
str = temp[0];
if (temp.indexOf('!') > 0) {
if (this.isUniqueChar(str)) {
arr.push(this.getUniqueCharVal(str));
temp = temp.substr(1);
}
str = temp.indexOf('!') + 1;
arr.push(temp.substr(0, str));
arr.push(temp.substr(str));
}
else if (this.isUniqueChar(str)) {
arr.push(this.getUniqueCharVal(str));
arr.push(temp.substr(1));
}
else
arr.push(temp);
}
i++;
}
return arr;
}
getUniqueCharVal(str) {
switch (str) {
case this.UC.uniqueOBracket:
return "(";
case this.UC.uniqueCBracket:
return ")";
case this.UC.uniqueCSeparator:
return ",";
case this.UC.uniqueCOperator:
return ':';
case this.UC.uniquePOperator:
return "+";
case this.UC.uniqueSOperator:
return "-";
case this.UC.uniqueMOperator:
return "*";
case this.UC.uniqueDOperator:
return "/";
case this.UC.uniqueModOperator:
return "%";
case this.UC.uniqueConcateOperator:
return "&";
case this.UC.uniqueEqualOperator:
return "=";
case this.UC.uniqueExpOperator:
return "^";
case this.UC.uniqueGTOperator:
return ">";
case this.UC.uniqueLTOperator:
return "<";
}
return "";
}
isUniqueChar(str) {
var code = str.charCodeAt(str);
return code >= 129 && code <= 142;
}
markSpecialChar(formula) {
formula = formula.replace(/\(/g, "(" + this.UC.uniqueOBracket).replace(/\)/g, ")" + this.UC.uniqueCBracket);
formula = formula.replace(/,/g, "," + this.UC.uniqueCSeparator).replace(/:/g, ":" + this.UC.uniqueCOperator);
formula = formula.replace(/\+/g, "+" + this.UC.uniquePOperator).replace(/-/g, "-" + this.UC.uniqueSOperator);
formula = formula.replace(/\*/g, "*" + this.UC.uniqueMOperator).replace(/\//g, "/" + this.UC.uniqueDOperator);
formula = formula.replace(/&/g, "&" + this.UC.uniqueConcateOperator);
formula = formula.replace(/=/g, "=" + this.UC.uniqueEqualOperator);
formula = formula.replace(/\^/g, "^" + this.UC.uniqueExpOperator);
formula = formula.replace(/>/g, ">" + this.UC.uniqueGTOperator).replace(/</g, "<" + this.UC.uniqueLTOperator);
return formula.replace(/%/g, "%" + this.UC.uniqueModOperator);
}
isInPattern(patrn, isVFill) {
var oldPatrn, olen, newPatrn, nlen, oldStr, newStr, oldInt, newInt, eStr = "", i = 0, j = 1, plen = patrn.length, nregx = new RegExp("[0-9$]", "g"), aregx = new RegExp("[a-z$]", "gi");
if (plen === 1)
return false;
while (j < plen) {
oldPatrn = patrn[i];
newPatrn = patrn[j];
olen = oldPatrn.length;
nlen = newPatrn.length;
if (olen !== nlen)
return false;
else {
while (olen--) {
oldStr = oldPatrn[olen];
newStr = newPatrn[olen];
if (this.isCellReference(oldStr) === this.isCellReference(newStr)) {
if (isVFill) {
oldInt = Number(oldStr.replace(aregx, eStr));
newInt = Number(newStr.replace(aregx, eStr));
}
else {
oldInt = this.generateColCount(oldStr.replace(nregx, eStr));
newInt = this.generateColCount(newStr.replace(nregx, eStr));
}
if (oldInt !== newInt - 1)
return false;
}
else if (oldStr !== newStr)
return false;
}
}
i++;
j++;
}
return true;
}
generateColCount(text) {
var colCount = 0;
text = text.split('').reverse().join('');
for (var i = text.length - 1; i >= 0; i--) {
colCount += (text[i].charCodeAt(text[i]) - 64) * (Math.pow(26, i));
}
return colCount;
}
getData(range) {
let sheet = this.base.ssObj.biz.getActiveSheet();
let data = [];
let obj;
let newRange = this.base.swapRange(range);
for (let i = newRange[0]; i <= newRange[2]; i++) {
for (let j = newRange[1]; j <= newRange[3]; j++) {
obj = sheet.rows[i] ? sheet.rows[i].cells[j] : undefined;
data.push(obj);
}
}
return data;
}
getRawData(arr) {
let len = arr.length;
let newArr = [];
for (let i = 0; i < len; i++) {
if (!arr[i] || !arr[i].value || arr[i].value.length === 0) {
newArr.push('');
}
else if (arr[i].formula) {
newArr.push(arr[i].formula);
}
else if (arr[i].value) {
newArr.push(arr[i].value);
}
}
return newArr;
}
isCellReference(text) {
return /^[a-z]{1,3}\d{1,7}$/gi.test(text) ? "relative" : (/^\$[a-z]{1,3}\$\d{1,7}$/gi.test(text) ? "absolute" : (/^((\$[a-z]{1,3})\d{1,7}|[a-z]{1,3}(\$\d{1,7}))$/gi.test(text) ? "mixed" : false));
}
getCellRefPrediction(text, options, length, rfrType) {
text = text.toUpperCase();
var eStr = "", aRegx = new RegExp("[a-z$]", "gi"), nRegx = new RegExp("[0-9$]", "g"), str = options.isVFill ? text.replace(nRegx, eStr) : text.replace(aRegx, eStr);
let temp = options.isVFill ? Number(text.replace(aRegx, eStr)) : this.generateColCount(text.replace(nRegx, eStr)), arr = [temp], isColAbslt = text[0] === '$';
if (length && length !== 1)
arr.push(temp + length);
else
arr.push(temp + 1);
temp = this.getPredictionValue(arr);
if (rfrType && (rfrType === "mixed")) {
if (isColAbslt === options.isVFill)
str = '$' + str;
else
temp.b = 0;
}
temp.c = str;
return temp;
}
getType(val) {
let type1;
let type = this.isCustomType(val);
if (type)
type1 = type;
else if (this.isFormula(val))
type1 = this.colType.Formula;
else if (this.isNumber(val))
type1 = this.colType.Number;
return type1 || this.colType.String;
}
isCustomType(val) {
val = val + "";
val = val.toLowerCase();
let i = this.customList.length;
while (i--) {
if (this.toArrayLowerCase(this.customList[i].slice(0)).indexOf(val) > -1)
return this.colType.Custom + i;
}
return false;
}
toArrayLowerCase(args) {
for (let i = 0; i < args.length; i++)
args[i] = args[i].toString().toLowerCase();
return args;
}
isFormula(formula) {
let obrackets, cbrackets;
if (formula) {
if (!formula.toString().indexOf("=") && formula.length > 1) {
obrackets = formula.split("(").length - 1;
cbrackets = formula.split(")").length - 1;
return obrackets === cbrackets;
}
}
return false;
}
isNumber(val) {
return val - parseFloat(val) >= 0;
}
round(val, digits) {
let str = val + 'e' + digits;
let str1 = 'e-' + digits;
return Number(Math.round(str) + str1);
}
getPredictionValue(args) {
let i = 0, sumx = 0, sumy = 0, sumxy = 0, sumxx = 0, n = args.length;
while (i < n) {
sumx = sumx + i;
sumy = sumy + Number(args[i]);
sumxy = sumxy + (i * Number(args[i]));
sumxx = sumxx + (i * i);
i++;
}
let a = this.round(((sumy * sumxx) - (sumx * sumxy)) / ((n * sumxx) - (sumx * sumx)), 5), b = this.round(((n * sumxy) - (sumx * sumy)) / ((n * sumxx) - (sumx * sumx)), 5);
return { a: a, b: b };
}
ensurePattern(patterns) {
let patrn, idx = -1, i = patterns.length;
while (i--) {
patrn = patterns[i];
if (this.isObject(patrn)) {
idx = i;
if (patrn.type === this.colType.String)
patrn.val = patrn.val.reverse();
}
else
patterns[i] = idx;
}
return patterns;
}
isObject(obj) {
if (typeof obj !== "object")
return false;
return Object.prototype.toString.call(obj) === "[object Object]";
}
getSelectedRange(startcell, endcell) {
let i, j, k, l, arr = [], range = this.base.swapRange([startcell.rowIndex, startcell.colIndex, endcell.rowIndex, endcell.colIndex]);
i = range[0], j = range[2];
while (i <= j) {
k = range[1];
l = range[3];
while (k <= l) {
arr.push({ rowIndex: i, colIndex: k });
k++;
}
i++;
}
return arr;
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Autofill();
}
return this.instance;
}
}
Sheets.Autofill = Autofill;
})(Sheets = Components.Sheets || (Components.Sheets = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,489 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let Sheets;
(function (Sheets) {
class Dialogue {
constructor() {
this.hederText = {};
this.hasHeader = false;
}
init(base) {
this.base = base;
this.base.mouseDownHandlers.push(this.mouseDown.bind(this));
this.util = Unibase.Apps.Collaboration.Components.Common.Util.Instance();
}
mouseDown(e) {
if (this.rdDailouge) {
let cbox = ej.base.closest(e.target, '.e-checkbox-wrapper');
if (cbox) {
let tickicon = cbox.firstElementChild;
tickicon.classList.contains('e-check') ? tickicon.classList.remove('e-check') : tickicon.classList.add('e-check');
if (cbox.classList.contains('rd-selectAll')) {
var cboxes = this.rdDailouge.element.querySelector('#rd-checkboxes-container').querySelectorAll('.e-frame');
if (cbox.firstElementChild.classList.contains('e-check')) {
cbox.firstElementChild.classList.remove('e-stop');
cboxes.forEach((e) => { e.classList.add('e-check'); });
document.getElementsByClassName("rd-btn")[0].classList.remove("e-disabled");
document.getElementsByClassName("rd-btn")[0].removeAttribute("disabled");
}
else {
cbox.firstElementChild.classList.add('e-stop');
cboxes.forEach((e) => { e.classList.remove('e-check'); });
document.getElementsByClassName("rd-btn")[0].classList.add("e-disabled");
document.getElementsByClassName("rd-btn")[0].setAttribute("disabled", "true");
}
}
if (cbox.classList.contains('rd-colCheckbox')) {
var cboxes = this.rdDailouge.element.querySelector('#rd-checkboxes').querySelectorAll('.e-frame');
var eCheckCount = this.rdDailouge.element.querySelector('#rd-checkboxes').querySelectorAll('.e-check').length;
eCheckCount === 0 ? (document.getElementsByClassName("rd-btn")[0].classList.add("e-disabled"),
document.getElementsByClassName("rd-btn")[0].setAttribute("disabled", "true")) :
(document.getElementsByClassName("rd-btn")[0].removeAttribute("disabled"),
document.getElementsByClassName("rd-btn")[0].classList.remove("e-disabled"));
eCheckCount < cboxes.length ?
(document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.remove("e-check"),
document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.add("e-stop")) :
(document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.add("e-check"),
document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.remove("e-stop"));
}
}
}
}
removeDuplicate(range, header, colSelected) {
this.obj = {};
let sheet = this.base.ssObj.biz.getActiveSheet();
this.rngIndexes = this.base.getIndexesFromAddress(range);
this.hasHeader = header;
(header) ? this.rowStartCell = this.rngIndexes[0] + 1 : this.rowStartCell = this.rngIndexes[0];
this.columnStartCell = this.rngIndexes[1];
this.rowEndCell = this.rngIndexes[2];
this.columnEndCell = this.rngIndexes[3];
this.selected = colSelected;
for (let i = this.rowStartCell; i <= this.rowEndCell; i++) {
let wholeRow = [];
for (let j = this.columnStartCell; j <= this.columnEndCell; j++) {
if (this.selected[j] == undefined) {
var isColChecked = document.querySelector("#rd-checkboxes").querySelector('div[value="' + j + '"]').firstElementChild.classList.contains('e-check');
this.selected[j] = isColChecked;
}
if (!this.selected[j]) {
continue;
}
let cellInfo = ej.spreadsheet.getCell(i, j, sheet);
if (!cellInfo) {
wholeRow.push(null);
}
else {
wholeRow.push(this.util.getCellValues(cellInfo));
}
if (cellInfo) {
this.base.ssObj.biz.setCell(i, j, sheet, {});
delete sheet.rows[i].cells[j];
}
}
if (wholeRow) {
this.addToObj(JSON.stringify(wholeRow));
}
}
var k = 0;
var cellValue;
var keys = Object.keys(this.obj);
for (let i = this.rowStartCell; i <= this.rowEndCell; i++) {
var row;
(keys[k]) ? row = JSON.parse(keys[k]) : row = undefined;
var l = 0;
for (let j = this.columnStartCell; j <= this.columnEndCell; j++) {
if (!this.selected[j]) {
continue;
}
(row) ? cellValue = row[l] : cellValue = undefined;
if (cellValue) {
if (!(cellValue.value === undefined)) {
this.base.ssObj.biz.setCell(i, j, sheet, cellValue);
}
}
l++;
}
k++;
}
var duplicateCount = this.selectedRow - Object.keys(this.obj).length;
Unibase.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave({ action: 'removeDuplicates' }, this.base, true);
if (this.base.getSheetIndex() >= 0) {
if (!this.hasHeader) {
this.base.ssObj.selectRange(this.base.generateHeaderText(this.columnStartCell + 1) + (this.rowStartCell + 1) + ":" + this.base.generateHeaderText(this.columnEndCell + 1) + (this.rowEndCell - duplicateCount + 1));
}
else {
this.base.ssObj.selectRange(this.base.generateHeaderText(this.columnStartCell + 1) + (this.rowStartCell) + ":" + this.base.generateHeaderText(this.columnEndCell + 1) + (this.rowEndCell - duplicateCount + 2));
}
}
this.rdDailouge.destroy();
}
RDshowUniqueDailog() {
var keys = Object.keys(this.obj);
var duplicateCount;
this.hasHeader ? duplicateCount = this.selectedRow - keys.length - 1 : duplicateCount = this.selectedRow - keys.length;
if (duplicateCount == 0) {
var duplicateValuesText = "No duplicate rows were found.";
}
else if (duplicateCount == 1) {
var duplicateValuesText = "1 duplicate row were found and removed.";
}
else {
var duplicateValuesText = `${duplicateCount} duplicate rows were found and removed.`;
}
if (keys.length == 1) {
var uniqueValuesText = `1 unique row remains.`;
}
else {
var uniqueValuesText = `${keys.length} unique rows remains.`;
}
this.rdDailouge = new ej.popups.Dialog({
isModal: true,
header: 'Remove Duplicates',
content: `<div id='removedup-container'>
<div id='rd-duplicatevaluetxt'></div>
<br/>
<div id='rd-uniquevaluetxt'></div>
</div>`,
width: '470px',
height: '180px',
buttons: [{
click: this.hideRdDailouge.bind(this),
buttonModel: { content: 'Ok', isPrimary: true }
}]
});
this.rdDailouge.appendTo("#removeduplicates");
document.getElementById("rd-duplicatevaluetxt").append(duplicateValuesText);
document.getElementById("rd-uniquevaluetxt").append(uniqueValuesText);
}
;
addToObj(param) {
if (!this.obj[param]) {
this.obj[param] = 1;
}
}
renderDuplicateDailouge() {
this.range = this.base.ssObj.biz.getRange();
this.rngIndexes = this.base.getIndexesFromAddress(this.range);
this.selectedCol = this.rngIndexes[3] - this.rngIndexes[1] + 1;
this.selectedRow = this.rngIndexes[2] - this.rngIndexes[0] + 1;
this.rowStartCell = this.rngIndexes[0];
this.columnStartCell = this.rngIndexes[1];
this.rowEndCell = this.rngIndexes[2];
this.columnEndCell = this.rngIndexes[3];
if (!(this.rowStartCell - this.rowEndCell == 0 && this.columnStartCell - this.columnEndCell == 0)) {
if (this.selectedCol > 1 && this.selectedRow > 1) {
var selectedcolrowtext = `${this.selectedCol} columns and ${this.selectedRow} rows selected`;
}
else if (this.selectedCol > 1 && this.selectedRow == 1) {
var selectedcolrowtext = `${this.selectedCol} columns and ${this.selectedRow} row selected`;
}
else if (this.selectedCol == 1 && this.selectedRow > 1) {
var selectedcolrowtext = `${this.selectedCol} column and ${this.selectedRow} rows selected`;
}
var checkboxes = [];
if (this.selectedCol > 0) {
for (let i = this.columnStartCell; i <= this.columnEndCell; i++) {
var colName = this.base.generateHeaderText(i + 1);
var cbox = ej.buttons.createCheckBox(this.base.ssObj.createElement, false, { checked: true, label: 'Columns ' + colName, cssClass: 'rd-colCheckbox' });
cbox.setAttribute('value', i);
checkboxes.push(cbox);
}
}
var elem = document.getElementById("removedup-container");
if (!elem) {
var hasHeader = ej.buttons.createCheckBox(this.base.ssObj.createElement, false, { checked: false, cssClass: 'rd-hasHeader' });
var selectAll = ej.buttons.createCheckBox(this.base.ssObj.createElement, false, { checked: true, label: 'Select all', cssClass: 'rd-selectAll' });
this.rdDailouge = new ej.popups.Dialog({
isModal: true,
header: 'Remove Duplicates',
content: `<div id='removedup-container'>
<div id='rd-selectedColumns-container'>
<div id="rd-selectedColumns-title-data"></div>
<div id="rd-hasHeader-checkbox"></div>
<span id="rd-hasHeader-content">Data has header row</span>
</div>
<div id="rd-selectedColumns-info-wrapper">
<div id="rd-selectedColumns-info-analyze">Select Columns to analyze</div>
<div id="rd-checkboxes-container">
<div id="rd-selectAll"> </div>
<div id="rd-checkboxes"></div>
</div></div>
</div>`,
showCloseIcon: false,
created: () => {
document.getElementById("rd-hasHeader-checkbox").appendChild(hasHeader);
document.getElementById("rd-selectAll").appendChild(selectAll);
document.getElementById("rd-selectedColumns-title-data").append(selectedcolrowtext);
checkboxes.forEach(element => {
document.getElementById("rd-checkboxes").appendChild(element);
});
setTimeout(() => {
if (document.getElementById("rd-checkboxes-container").offsetHeight < 250) {
document.getElementById("rd-checkboxes-container").style.overflowY = 'hidden';
}
else {
document.getElementById("rd-checkboxes").style.overflowY = "";
}
}, 0);
},
open: () => {
},
width: '350px',
height: 'auto',
closeOnEscape: false,
buttons: [{
click: this.hideRdDailouge.bind(this),
buttonModel: { content: 'Cancel' }
},
{
click: this.processDup.bind(this),
buttonModel: { content: 'Remove Duplicates', isPrimary: true, cssClass: "rd-btn" }
}],
});
this.rdDailouge.appendTo("#removeduplicates");
}
else {
document.getElementById("rd-selectedColumns-title-data").innerHTML = "";
document.getElementById("rd-selectedColumns-title-data").innerHTML = selectedcolrowtext;
this.rdDailouge.show();
}
}
else {
this.rdDailouge = new ej.popups.Dialog({
isModal: true,
header: 'Remove Duplicates',
content: `<div id='removedup-container'>Please select a range of cells containing values.</div>`,
width: '470px',
height: '130px',
created: () => {
document.getElementById("removeduplicates_dialog-content").style.overflowY = 'hidden';
},
buttons: [{
click: this.hideRdDailouge.bind(this),
buttonModel: { content: 'Ok', isPrimary: true }
}]
});
this.rdDailouge.appendTo("#removeduplicates");
}
}
hideRdDailouge() {
this.rdDailouge.element.removeEventListener("mousedown", (e) => { });
this.rdDailouge.hide();
this.rdDailouge.destroy();
}
processDup() {
let header = false;
if (document.getElementsByClassName("rd-hasHeader")[0].firstElementChild.classList.contains("e-check")) {
header = true;
}
let range = this.base.ssObj.biz.getRange();
let indexes = this.base.ssObj.biz.getIndexes();
let args = { range: range, indexes: indexes, sheetIndex: this.base.getSheetIndex(), header: header, action: 'removeDuplicates', origin: 'biz' };
this.base.ssObj.updateUndoRedoCollection({ name: 'bizAction', args: { action: 'removeDuplicates', options: args, oldCells: this.base.getCellsFromIndexes(indexes) } });
this.removeDuplicate(range, header, {});
this.base.removeCopyIndicator();
args['colSelected'] = this.selected;
this.RDshowUniqueDailog();
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(args);
}
renderMenubarFullscreenDialog() {
if (!this.menubarFullscreenDialogObj) {
this.menubarFullscreenDialogObj = new ej.popups.Dialog({
content: `<div id='menubar-fullscreen-container'>
<div id='menubar-fullscreenf11-message'>
Press <span class= "menubar-esc">Esc</span> to exit full screen <span class="biz-ss-menubarfullscreen-dismiss"> Dismiss </span></div>
</div>`,
width: '470px',
height: '45px',
position: { X: 'center', Y: 14 },
animationSettings: { effect: 'None' },
closeOnEscape: true,
cssClass: "biz-ss-menubar-fullscreen",
Close: this.hideSsMenubarFullscreenDialog.bind(this),
});
this.menubarFullscreenDialogObj.appendTo("#biz-ss-menubar-fullscreendialog");
}
else {
this.menubarFullscreenDialogObj.show();
}
}
hideSsMenubarFullscreenDialog() {
this.menubarFullscreenDialogObj.destroy();
if (document.getElementById("menubar-fullscreen-container"))
document.getElementById("menubar-fullscreen-container").parentElement.remove();
setTimeout(() => {
this.menubarFullscreenDialogObj = null;
}, 1000);
}
renderResizeDialog() {
let sheet = this.base.ssObj.biz.getActiveSheet();
let indexes = this.base.ssObj.biz.getIndexes();
let isRowsSelected = this.base.ssObj.biz.isRowsSelected(indexes);
let row = (indexes[2] - indexes[0] + 1);
let col = (indexes[3] - indexes[1] + 1);
let heading = "";
let radio1Text = "";
let inputValue;
if (isRowsSelected) {
if (row == 1)
heading = "Resize row " + (indexes[0] + 1);
else
heading = "Resize rows " + (indexes[0] + 1) + " - " + (indexes[2] + 1);
radio1Text = "Specify row height in pixels: (Default 18)";
inputValue = sheet.rows[indexes[0]] && sheet.rows[indexes[0]].height || 18.5;
}
else {
if (col == 1)
heading = "Resize column " + (this.base.generateHeaderText(indexes[0] + 1));
else
heading = "Resize columns " + this.base.generateHeaderText(indexes[1] + 1) + " - " + this.base.generateHeaderText(indexes[3] + 1);
radio1Text = "Specify column width in pixels: (Default 64)";
inputValue = sheet.columns[indexes[1]] && sheet.columns[indexes[1]].width || 64;
}
if (inputValue == undefined)
inputValue = '';
this.radiobutton = new ej.buttons.RadioButton({ label: radio1Text, name: 'resizetofit', checked: true, value: "resizeroworcol" });
this.resizeDialogObj = new ej.popups.Dialog({
content: `<div id='resize-dialog-container'>
<div id='resize-dialog-content'>
<ul>
<li><input type="radio" id="header-checkbox"></li>
<div class="e-input-group resize-input-div">
<input class="e-input" name='input' type="text" value="${inputValue}" id="resize-input" />
</div>
<li><input type="radio" id="resizetofit-checkbox"></li>
</ul>
</div>
</div>`,
width: '470px',
height: 'auto',
header: heading,
animationSettings: { effect: 'None' },
showCloseIcon: true,
closeOnEscape: true,
target: document.body.querySelectorAll('._bizgaze_popup_container')[document.body.querySelectorAll('._bizgaze_popup_container').length - 1],
created: this.resizeDialogCreated.bind(this),
cssClass: "biz-ss-resizetofit",
buttons: [
{
click: this.hideResizeDialog.bind(this),
buttonModel: { content: 'Cancel' }
},
{
click: this.processResize.bind(this),
buttonModel: { content: 'Ok', isPrimary: true }
}
],
Close: this.hideResizeDialog.bind(this),
});
this.resizeDialogObj.appendTo("#biz-ss-resizetofit-dialog");
}
resizeDialogCreated() {
this.radiobutton.appendTo('#header-checkbox');
this.radiobutton = new ej.buttons.RadioButton({ label: 'Resize to fit', name: 'resizetofit', value: "resizetofit" });
this.radiobutton.appendTo('#resizetofit-checkbox');
document.getElementsByClassName("biz-ss-resizetofit")[0].style.maxHeight = "";
}
hideResizeDialog() {
if (this.resizeDialogObj) {
this.resizeDialogObj.destroy();
setTimeout(() => {
this.resizeDialogObj = null;
});
}
}
processResize() {
return __awaiter(this, void 0, void 0, function* () {
let range = this.base.ssObj.biz.getRange();
let resizedHeaders = [];
let changedValues = [];
let resizeValue = Number(document.getElementById("resize-input").value);
let ranges = range.split(" ");
for (var i = 0; i < ranges.length; i++) {
let currentIndexes = this.base.swapRange(ej.spreadsheet.getIndexesFromAddress(ranges[i]));
yield this.resizeHeaders(currentIndexes, resizeValue, ranges[i]).then((response) => {
changedValues = changedValues.concat(response.changedValues);
resizedHeaders = resizedHeaders.concat(response.resizedHeaders);
});
}
this.hideResizeDialog();
this.base.focusDocumentViewer();
(changedValues.length > 0) && this.base.download.ssAutoSave({ action: "imageincell", changedValues: changedValues }, this.base, true);
(resizedHeaders.length > 0) && this.base.download.ssAutoSave({ action: "headerResize", resizedHeaders: resizedHeaders }, this.base, true);
});
}
resizeHeaders(indexes, resizeValue, range) {
return __awaiter(this, void 0, void 0, function* () {
let resizedHeaders = [];
let changedValues = [];
let sheetIdx = this.base.getSheetIndex();
let isRowsSelected = this.base.ssObj.biz.isRowsSelected(indexes);
let selectedRadio = document.querySelector('input[name="resizetofit"]:checked').value;
if (selectedRadio == "resizeroworcol") {
if (isRowsSelected) {
for (var i = indexes[0]; i <= indexes[2]; i++) {
yield this.setRowHeight(resizeValue, i);
resizedHeaders.push({ rowIndex: i, height: resizeValue, sheetIndex: sheetIdx, resizeType: "row" });
}
changedValues = changedValues.concat(this.base.setRowIncellImageSize(range));
}
else {
for (var i = indexes[1]; i <= indexes[3]; i++) {
yield this.setColWidth(resizeValue, i);
resizedHeaders.push({ colIndex: i, width: resizeValue, sheetIndex: sheetIdx, resizeType: "col" });
}
changedValues = changedValues.concat(this.base.setColumnIncellImageSize(range));
}
}
else {
this.base.ssObj.autoFit(range);
if (isRowsSelected)
changedValues = changedValues.concat(this.base.setRowIncellImageSize(range));
else
changedValues = changedValues.concat(this.base.setColumnIncellImageSize(range));
}
return {
changedValues: changedValues, resizedHeaders: resizedHeaders
};
});
}
setRowHeight(resizeValue, rowIdx) {
return __awaiter(this, void 0, void 0, function* () {
yield this.base.ssObj.setRowHeight(resizeValue + "px", rowIdx);
});
}
setColWidth(resizeValue, colIdx) {
return __awaiter(this, void 0, void 0, function* () {
yield this.base.ssObj.setColWidth(resizeValue + "px", colIdx);
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Dialogue();
}
return this.instance;
}
}
Sheets.Dialogue = Dialogue;
})(Sheets = Components.Sheets || (Components.Sheets = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
+31
View File
@@ -0,0 +1,31 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.hederText={};this.hasHeader=!1}init(t){this.base=t;this.base.mouseDownHandlers.push(this.mouseDown.bind(this));this.util=n.Apps.Collaboration.Components.Common.Util.Instance()}mouseDown(n){var t,i;if(this.rdDailouge){let r=ej.base.closest(n.target,".e-checkbox-wrapper");if(r){let n=r.firstElementChild;n.classList.contains("e-check")?n.classList.remove("e-check"):n.classList.add("e-check");r.classList.contains("rd-selectAll")&&(t=this.rdDailouge.element.querySelector("#rd-checkboxes-container").querySelectorAll(".e-frame"),r.firstElementChild.classList.contains("e-check")?(r.firstElementChild.classList.remove("e-stop"),t.forEach(n=>{n.classList.add("e-check")}),document.getElementsByClassName("rd-btn")[0].classList.remove("e-disabled"),document.getElementsByClassName("rd-btn")[0].removeAttribute("disabled")):(r.firstElementChild.classList.add("e-stop"),t.forEach(n=>{n.classList.remove("e-check")}),document.getElementsByClassName("rd-btn")[0].classList.add("e-disabled"),document.getElementsByClassName("rd-btn")[0].setAttribute("disabled","true")));r.classList.contains("rd-colCheckbox")&&(t=this.rdDailouge.element.querySelector("#rd-checkboxes").querySelectorAll(".e-frame"),i=this.rdDailouge.element.querySelector("#rd-checkboxes").querySelectorAll(".e-check").length,i===0?(document.getElementsByClassName("rd-btn")[0].classList.add("e-disabled"),document.getElementsByClassName("rd-btn")[0].setAttribute("disabled","true")):(document.getElementsByClassName("rd-btn")[0].removeAttribute("disabled"),document.getElementsByClassName("rd-btn")[0].classList.remove("e-disabled")),i<t.length?(document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.remove("e-check"),document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.add("e-stop")):(document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.add("e-check"),document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.remove("e-stop")))}}}removeDuplicate(t,i,r){var l,e,u,s,o,h,c;this.obj={};let f=this.base.ssObj.biz.getActiveSheet();this.rngIndexes=this.base.getIndexesFromAddress(t);this.hasHeader=i;this.rowStartCell=i?this.rngIndexes[0]+1:this.rngIndexes[0];this.columnStartCell=this.rngIndexes[1];this.rowEndCell=this.rngIndexes[2];this.columnEndCell=this.rngIndexes[3];this.selected=r;for(let n=this.rowStartCell;n<=this.rowEndCell;n++){let t=[];for(let i=this.columnStartCell;i<=this.columnEndCell;i++)if(this.selected[i]==undefined&&(l=document.querySelector("#rd-checkboxes").querySelector('div[value="'+i+'"]').firstElementChild.classList.contains("e-check"),this.selected[i]=l),this.selected[i]){let r=ej.spreadsheet.getCell(n,i,f);r?t.push(this.util.getCellValues(r)):t.push(null);r&&(this.base.ssObj.biz.setCell(n,i,f,{}),delete f.rows[n].cells[i])}t&&this.addToObj(JSON.stringify(t))}e=0;s=Object.keys(this.obj);for(let n=this.rowStartCell;n<=this.rowEndCell;n++){o=s[e]?JSON.parse(s[e]):undefined;h=0;for(let t=this.columnStartCell;t<=this.columnEndCell;t++)this.selected[t]&&(u=o?o[h]:undefined,u&&(u.value===undefined||this.base.ssObj.biz.setCell(n,t,f,u)),h++);e++}c=this.selectedRow-Object.keys(this.obj).length;n.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave({action:"removeDuplicates"},this.base,!0);this.base.getSheetIndex()>=0&&(this.hasHeader?this.base.ssObj.selectRange(this.base.generateHeaderText(this.columnStartCell+1)+this.rowStartCell+":"+this.base.generateHeaderText(this.columnEndCell+1)+(this.rowEndCell-c+2)):this.base.ssObj.selectRange(this.base.generateHeaderText(this.columnStartCell+1)+(this.rowStartCell+1)+":"+this.base.generateHeaderText(this.columnEndCell+1)+(this.rowEndCell-c+1)));this.rdDailouge.destroy()}RDshowUniqueDailog(){var n=Object.keys(this.obj),t,i,r;t=this.hasHeader?this.selectedRow-n.length-1:this.selectedRow-n.length;i=t==0?"No duplicate rows were found.":t==1?"1 duplicate row were found and removed.":`${t} duplicate rows were found and removed.`;r=n.length==1?`1 unique row remains.`:`${n.length} unique rows remains.`;this.rdDailouge=new ej.popups.Dialog({isModal:!0,header:"Remove Duplicates",content:`<div id='removedup-container'>
<div id='rd-duplicatevaluetxt'></div>
<br/>
<div id='rd-uniquevaluetxt'></div>
</div>`,width:"470px",height:"180px",buttons:[{click:this.hideRdDailouge.bind(this),buttonModel:{content:"Ok",isPrimary:!0}}]});this.rdDailouge.appendTo("#removeduplicates");document.getElementById("rd-duplicatevaluetxt").append(i);document.getElementById("rd-uniquevaluetxt").append(r)}addToObj(n){this.obj[n]||(this.obj[n]=1)}renderDuplicateDailouge(){var n,t,r,i,u,f,e;if(this.range=this.base.ssObj.biz.getRange(),this.rngIndexes=this.base.getIndexesFromAddress(this.range),this.selectedCol=this.rngIndexes[3]-this.rngIndexes[1]+1,this.selectedRow=this.rngIndexes[2]-this.rngIndexes[0]+1,this.rowStartCell=this.rngIndexes[0],this.columnStartCell=this.rngIndexes[1],this.rowEndCell=this.rngIndexes[2],this.columnEndCell=this.rngIndexes[3],this.rowStartCell-this.rowEndCell==0&&this.columnStartCell-this.columnEndCell==0)this.rdDailouge=new ej.popups.Dialog({isModal:!0,header:"Remove Duplicates",content:`<div id='removedup-container'>Please select a range of cells containing values.</div>`,width:"470px",height:"130px",created:()=>{document.getElementById("removeduplicates_dialog-content").style.overflowY="hidden"},buttons:[{click:this.hideRdDailouge.bind(this),buttonModel:{content:"Ok",isPrimary:!0}}]}),this.rdDailouge.appendTo("#removeduplicates");else{if(this.selectedCol>1&&this.selectedRow>1?n=`${this.selectedCol} columns and ${this.selectedRow} rows selected`:this.selectedCol>1&&this.selectedRow==1?n=`${this.selectedCol} columns and ${this.selectedRow} row selected`:this.selectedCol==1&&this.selectedRow>1&&(n=`${this.selectedCol} column and ${this.selectedRow} rows selected`),t=[],this.selectedCol>0)for(let n=this.columnStartCell;n<=this.columnEndCell;n++)r=this.base.generateHeaderText(n+1),i=ej.buttons.createCheckBox(this.base.ssObj.createElement,!1,{checked:!0,label:"Columns "+r,cssClass:"rd-colCheckbox"}),i.setAttribute("value",n),t.push(i);u=document.getElementById("removedup-container");u?(document.getElementById("rd-selectedColumns-title-data").innerHTML="",document.getElementById("rd-selectedColumns-title-data").innerHTML=n,this.rdDailouge.show()):(f=ej.buttons.createCheckBox(this.base.ssObj.createElement,!1,{checked:!1,cssClass:"rd-hasHeader"}),e=ej.buttons.createCheckBox(this.base.ssObj.createElement,!1,{checked:!0,label:"Select all",cssClass:"rd-selectAll"}),this.rdDailouge=new ej.popups.Dialog({isModal:!0,header:"Remove Duplicates",content:`<div id='removedup-container'>
<div id='rd-selectedColumns-container'>
<div id="rd-selectedColumns-title-data"></div>
<div id="rd-hasHeader-checkbox"></div>
<span id="rd-hasHeader-content">Data has header row</span>
</div>
<div id="rd-selectedColumns-info-wrapper">
<div id="rd-selectedColumns-info-analyze">Select Columns to analyze</div>
<div id="rd-checkboxes-container">
<div id="rd-selectAll"> </div>
<div id="rd-checkboxes"></div>
</div></div>
</div>`,showCloseIcon:!1,created:()=>{document.getElementById("rd-hasHeader-checkbox").appendChild(f),document.getElementById("rd-selectAll").appendChild(e),document.getElementById("rd-selectedColumns-title-data").append(n),t.forEach(n=>{document.getElementById("rd-checkboxes").appendChild(n)}),setTimeout(()=>{document.getElementById("rd-checkboxes-container").offsetHeight<250?document.getElementById("rd-checkboxes-container").style.overflowY="hidden":document.getElementById("rd-checkboxes").style.overflowY=""},0)},open:()=>{},width:"350px",height:"auto",closeOnEscape:!1,buttons:[{click:this.hideRdDailouge.bind(this),buttonModel:{content:"Cancel"}},{click:this.processDup.bind(this),buttonModel:{content:"Remove Duplicates",isPrimary:!0,cssClass:"rd-btn"}}]}),this.rdDailouge.appendTo("#removeduplicates"))}}hideRdDailouge(){this.rdDailouge.element.removeEventListener("mousedown",()=>{});this.rdDailouge.hide();this.rdDailouge.destroy()}processDup(){let t=!1;document.getElementsByClassName("rd-hasHeader")[0].firstElementChild.classList.contains("e-check")&&(t=!0);let r=this.base.ssObj.biz.getRange(),u=this.base.ssObj.biz.getIndexes(),i={range:r,indexes:u,sheetIndex:this.base.getSheetIndex(),header:t,action:"removeDuplicates",origin:"biz"};this.base.ssObj.updateUndoRedoCollection({name:"bizAction",args:{action:"removeDuplicates",options:i,oldCells:this.base.getCellsFromIndexes(u)}});this.removeDuplicate(r,t,{});this.base.removeCopyIndicator();i.colSelected=this.selected;this.RDshowUniqueDailog();n.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(i)}renderMenubarFullscreenDialog(){this.menubarFullscreenDialogObj?this.menubarFullscreenDialogObj.show():(this.menubarFullscreenDialogObj=new ej.popups.Dialog({content:`<div id='menubar-fullscreen-container'>
<div id='menubar-fullscreenf11-message'>
Press <span class= "menubar-esc">Esc</span> to exit full screen <span class="biz-ss-menubarfullscreen-dismiss"> Dismiss </span></div>
</div>`,width:"470px",height:"45px",position:{X:"center",Y:14},animationSettings:{effect:"None"},closeOnEscape:!0,cssClass:"biz-ss-menubar-fullscreen",Close:this.hideSsMenubarFullscreenDialog.bind(this)}),this.menubarFullscreenDialogObj.appendTo("#biz-ss-menubar-fullscreendialog"))}hideSsMenubarFullscreenDialog(){this.menubarFullscreenDialogObj.destroy();document.getElementById("menubar-fullscreen-container")&&document.getElementById("menubar-fullscreen-container").parentElement.remove();setTimeout(()=>{this.menubarFullscreenDialogObj=null},1e3)}renderResizeDialog(){let i=this.base.ssObj.biz.getActiveSheet(),n=this.base.ssObj.biz.getIndexes(),f=this.base.ssObj.biz.isRowsSelected(n),e=n[2]-n[0]+1,o=n[3]-n[1]+1,r="",u="",t;f?(r=e==1?"Resize row "+(n[0]+1):"Resize rows "+(n[0]+1)+" - "+(n[2]+1),u="Specify row height in pixels: (Default 18)",t=i.rows[n[0]]&&i.rows[n[0]].height||18.5):(r=o==1?"Resize column "+this.base.generateHeaderText(n[0]+1):"Resize columns "+this.base.generateHeaderText(n[1]+1)+" - "+this.base.generateHeaderText(n[3]+1),u="Specify column width in pixels: (Default 64)",t=i.columns[n[1]]&&i.columns[n[1]].width||64);t==undefined&&(t="");this.radiobutton=new ej.buttons.RadioButton({label:u,name:"resizetofit",checked:!0,value:"resizeroworcol"});this.resizeDialogObj=new ej.popups.Dialog({content:`<div id='resize-dialog-container'>
<div id='resize-dialog-content'>
<ul>
<li><input type="radio" id="header-checkbox"></li>
<div class="e-input-group resize-input-div">
<input class="e-input" name='input' type="text" value="${t}" id="resize-input" />
</div>
<li><input type="radio" id="resizetofit-checkbox"></li>
</ul>
</div>
</div>`,width:"470px",height:"auto",header:r,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,target:document.body.querySelectorAll("._bizgaze_popup_container")[document.body.querySelectorAll("._bizgaze_popup_container").length-1],created:this.resizeDialogCreated.bind(this),cssClass:"biz-ss-resizetofit",buttons:[{click:this.hideResizeDialog.bind(this),buttonModel:{content:"Cancel"}},{click:this.processResize.bind(this),buttonModel:{content:"Ok",isPrimary:!0}}],Close:this.hideResizeDialog.bind(this)});this.resizeDialogObj.appendTo("#biz-ss-resizetofit-dialog")}resizeDialogCreated(){this.radiobutton.appendTo("#header-checkbox");this.radiobutton=new ej.buttons.RadioButton({label:"Resize to fit",name:"resizetofit",value:"resizetofit"});this.radiobutton.appendTo("#resizetofit-checkbox");document.getElementsByClassName("biz-ss-resizetofit")[0].style.maxHeight=""}hideResizeDialog(){this.resizeDialogObj&&(this.resizeDialogObj.destroy(),setTimeout(()=>{this.resizeDialogObj=null}))}processResize(){return __awaiter(this,void 0,void 0,function*(){let u=this.base.ssObj.biz.getRange(),n=[],t=[],f=Number(document.getElementById("resize-input").value),r=u.split(" ");for(var i=0;i<r.length;i++){let u=this.base.swapRange(ej.spreadsheet.getIndexesFromAddress(r[i]));yield this.resizeHeaders(u,f,r[i]).then(i=>{t=t.concat(i.changedValues),n=n.concat(i.resizedHeaders)})}this.hideResizeDialog();this.base.focusDocumentViewer();t.length>0&&this.base.download.ssAutoSave({action:"imageincell",changedValues:t},this.base,!0);n.length>0&&this.base.download.ssAutoSave({action:"headerResize",resizedHeaders:n},this.base,!0)})}resizeHeaders(n,t,i){return __awaiter(this,void 0,void 0,function*(){var r;let f=[],u=[],e=this.base.getSheetIndex(),o=this.base.ssObj.biz.isRowsSelected(n),s=document.querySelector('input[name="resizetofit"]:checked').value;if(s=="resizeroworcol")if(o){for(r=n[0];r<=n[2];r++)yield this.setRowHeight(t,r),f.push({rowIndex:r,height:t,sheetIndex:e,resizeType:"row"});u=u.concat(this.base.setRowIncellImageSize(i))}else{for(r=n[1];r<=n[3];r++)yield this.setColWidth(t,r),f.push({colIndex:r,width:t,sheetIndex:e,resizeType:"col"});u=u.concat(this.base.setColumnIncellImageSize(i))}else this.base.ssObj.autoFit(i),u=o?u.concat(this.base.setRowIncellImageSize(i)):u.concat(this.base.setColumnIncellImageSize(i));return{changedValues:u,resizedHeaders:f}})}setRowHeight(n,t){return __awaiter(this,void 0,void 0,function*(){yield this.base.ssObj.setRowHeight(n+"px",t)})}setColWidth(n,t){return __awaiter(this,void 0,void 0,function*(){yield this.base.ssObj.setColWidth(n+"px",t)})}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.Dialogue=i})(i=t.Sheets||(t.Sheets={}))})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,210 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let Sheets;
(function (Sheets) {
class SpellChecker {
constructor() {
this.dic = {};
this.hederText = {};
}
init(base) {
this.base = base;
this.ssObj = this.base.ssObj;
}
processWords() {
this.dic = {};
this.words = '';
let sheet = this.ssObj.biz.getActiveSheet();
let rngIndexes = this.base.getIndexesFromAddress(sheet.selectedRange);
for (let i = rngIndexes[0]; i <= rngIndexes[2]; i++) {
if (!this.ssObj.biz.isRowAvailable(i, sheet)) {
continue;
}
for (let j = rngIndexes[1]; j <= rngIndexes[3]; j++) {
let cellObj = ej.spreadsheet.getCell(i, j, sheet);
if (cellObj && cellObj.value && typeof cellObj.value !== 'number') {
let value = cellObj.value.toString();
let temp = value.split(' ');
let values = [];
for (let k = 0; k < temp.length; k++) {
let val = temp[k];
if (!this.dic[val]) {
this.dic[val.trim()] = [{ rowIndex: i, colIndex: j }];
values.push(val.trim());
}
else {
this.dic[val.trim()].push({ rowIndex: i, colIndex: j });
}
}
values.length && (this.words = this.words + ' ' + values.toString().replaceAll(',', ' '));
}
}
}
this.splitWords = this.words.trim().split(' ').reverse();
this.requestServer();
}
requestServer() {
var data = {
LanguageID: 1033,
TexttoCheck: this.words.trim(),
CheckSpelling: true,
CheckSuggestion: true,
AddWord: false,
};
Unibase.Apps.Collaboration.DocumentManager.Instance().spellCheck(data).then((res) => { this.successCallback(res); });
}
successCallback(result) {
this.ssObj.allowEditing = false;
for (var i = 0; i < result.length; i++) {
result[i] = JSON.parse(result[i]);
}
this.result = result.reverse();
ej.popups.hideSpinner(this.dlgObj.element);
this.dlgObj.content = `<div>
<span class="biz-sc-info"></span>
<div style="padding-top: 10px">
<input class="biz-sc-value" type="text"/>
<input type="text" class='biz-sc-sugg'/>
</div>
<div style="padding-top: 10px">
<button type="text" class='biz-sc-change'>Change</button>
<button type="text" class='biz-sc-ignore'>Ignore</button>
</div>
</div>`;
this.dlgObj.dataBind();
this.dlgObj.element.querySelector('.e-footer-content').classList.add('biz-hide');
this.infoElem = this.dlgObj.element.querySelector('.biz-sc-info');
this.textObj = new ej.inputs.TextBox({}, this.dlgObj.element.querySelector('.biz-sc-value'));
this.ddSug = new ej.dropdowns.DropDownList({
dataSource: [], select: (e) => {
this.textObj.value = e.itemData.value;
}
}, this.dlgObj.element.querySelector('.biz-sc-sugg'));
let items = [
{
text: 'Change all',
}
];
this.spanElem = this.dlgObj.element.querySelector('.biz-sc-info');
this.ddChange = new ej.splitbuttons.SplitButton({ items: items, click: (e) => { this.change(); }, select: (e) => { this.changeAll(); } }, this.dlgObj.element.querySelector('.biz-sc-change'));
items = [
{
text: 'Ignore all',
}
];
this.ddIgnore = new ej.splitbuttons.SplitButton({ items: items, click: (e) => { this.ignore(); }, select: (e) => { this.ignoreAll(); } }, this.dlgObj.element.querySelector('.biz-sc-ignore'));
this.moveNext();
}
convertAsItemModel(items) {
for (let i = 0; i < items.length; i++) {
items[i] = { text: items[i] };
}
}
moveNext(skipPop) {
if (!this.splitWords.length) {
this.dlgObj.content = 'No spelling errors';
this.dlgObj.height = '95px';
this.dlgObj.dataBind();
this.dlgObj.element.querySelector('.e-footer-content').classList.remove('biz-hide');
this.ssObj.allowEditing = true;
setTimeout(() => {
this.destroySpellDialog();
}, 3000);
return;
}
if (!skipPop) {
this.value = this.splitWords.pop();
this.spellObj = this.result.pop();
this.spanElem.innerHTML = "Change <b>" + this.value + "</b> to:";
}
let addr = this.dic[this.value];
if (this.spellObj['Suggestions'] && this.spellObj['Suggestions'].length && addr.length) {
this.ssObj.selectRange(this.base.generateHeaderText(addr[0].colIndex + 1) + (addr[0].rowIndex + 1));
this.ddSug.dataSource = this.spellObj['Suggestions'];
this.ddSug.value = this.spellObj['Suggestions'][0];
this.textObj.value = this.spellObj['Suggestions'][0];
}
else {
delete this.dic[this.value];
this.moveNext();
}
}
change() {
let addr = this.dic[this.value];
let sheet = this.ssObj.biz.getActiveSheet();
let cellObj = ej.spreadsheet.getCell(addr[0].rowIndex, addr[0].colIndex, sheet);
let value = cellObj.value === this.value ? this.textObj.value : cellObj.value.replace(this.value, this.textObj.value);
let args = { rowIdx: addr[0].rowIndex, colIdx: addr[0].colIndex, value: value, action: 'spellcheck', origin: 'biz', sheetIndex: this.base.getSheetIndex() };
this.applySpellValue(addr[0].rowIndex, addr[0].colIndex, value);
this.ignore();
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(args);
}
applySpellValue(rowIdx, colIdx, value) {
let sheet = this.ssObj.biz.getActiveSheet();
let cellObj = ej.spreadsheet.getCell(rowIdx, colIdx, sheet);
cellObj.value = value;
this.ssObj.biz.setCell(rowIdx, colIdx, sheet, cellObj);
Unibase.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave({ action: "cellSave", eventArgs: { address: "sheet!" + this.base.ssObj.biz.getRange() } }, this.base, true);
}
changeAll() {
let len = this.dic[this.value].length;
for (let i = 0; i < len; i++) {
this.change();
}
}
ignore() {
this.dic[this.value].shift();
this.moveNext(true);
}
ignoreAll() {
delete this.dic[this.value];
this.moveNext();
}
renderSpellDialog() {
let div = this.ssObj.element.querySelector('.biz-spelldlg') || ej.base.createElement('div', { className: 'biz-spelldlg' });
this.ssObj.element.querySelector('.e-sheet-panel').appendChild(div);
this.dlgObj = new ej.popups.Dialog({
target: this.ssObj.element.querySelector('.e-sheet-panel'),
content: '',
width: '350px',
height: '170px',
position: { X: 'right', Y: 'top' },
animationSettings: { effect: 'None' },
showCloseIcon: false,
buttons: [{
click: this.destroySpellDialog.bind(this),
buttonModel: { content: 'Close' }
}],
open: () => {
ej.popups.createSpinner({ target: this.dlgObj.element });
ej.popups.showSpinner(this.dlgObj.element);
},
});
this.dlgObj.appendTo(div);
this.processWords();
}
destroySpellDialog() {
this.ddSug.destroy();
this.ddChange.destroy();
this.ddIgnore.destroy();
this.dlgObj.destroy();
}
static Instance() {
if (this.instance === undefined) {
this.instance = new SpellChecker();
}
return this.instance;
}
}
Sheets.SpellChecker = SpellChecker;
})(Sheets = Components.Sheets || (Components.Sheets = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
+11
View File
@@ -0,0 +1,11 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.dic={};this.hederText={}}init(n){this.base=n;this.ssObj=this.base.ssObj}processWords(){this.dic={};this.words="";let t=this.ssObj.biz.getActiveSheet(),n=this.base.getIndexesFromAddress(t.selectedRange);for(let i=n[0];i<=n[2];i++)if(this.ssObj.biz.isRowAvailable(i,t))for(let r=n[1];r<=n[3];r++){let n=ej.spreadsheet.getCell(i,r,t);if(n&&n.value&&typeof n.value!="number"){let f=n.value.toString(),u=f.split(" "),t=[];for(let n=0;n<u.length;n++){let f=u[n];this.dic[f]?this.dic[f.trim()].push({rowIndex:i,colIndex:r}):(this.dic[f.trim()]=[{rowIndex:i,colIndex:r}],t.push(f.trim()))}t.length&&(this.words=this.words+" "+t.toString().replaceAll(","," "))}}this.splitWords=this.words.trim().split(" ").reverse();this.requestServer()}requestServer(){var t={LanguageID:1033,TexttoCheck:this.words.trim(),CheckSpelling:!0,CheckSuggestion:!0,AddWord:!1};n.Apps.Collaboration.DocumentManager.Instance().spellCheck(t).then(n=>{this.successCallback(n)})}successCallback(n){this.ssObj.allowEditing=!1;for(var t=0;t<n.length;t++)n[t]=JSON.parse(n[t]);this.result=n.reverse();ej.popups.hideSpinner(this.dlgObj.element);this.dlgObj.content=`<div>
<span class="biz-sc-info"></span>
<div style="padding-top: 10px">
<input class="biz-sc-value" type="text"/>
<input type="text" class='biz-sc-sugg'/>
</div>
<div style="padding-top: 10px">
<button type="text" class='biz-sc-change'>Change</button>
<button type="text" class='biz-sc-ignore'>Ignore</button>
</div>
</div>`;this.dlgObj.dataBind();this.dlgObj.element.querySelector(".e-footer-content").classList.add("biz-hide");this.infoElem=this.dlgObj.element.querySelector(".biz-sc-info");this.textObj=new ej.inputs.TextBox({},this.dlgObj.element.querySelector(".biz-sc-value"));this.ddSug=new ej.dropdowns.DropDownList({dataSource:[],select:n=>{this.textObj.value=n.itemData.value}},this.dlgObj.element.querySelector(".biz-sc-sugg"));let i=[{text:"Change all"}];this.spanElem=this.dlgObj.element.querySelector(".biz-sc-info");this.ddChange=new ej.splitbuttons.SplitButton({items:i,click:()=>{this.change()},select:()=>{this.changeAll()}},this.dlgObj.element.querySelector(".biz-sc-change"));i=[{text:"Ignore all"}];this.ddIgnore=new ej.splitbuttons.SplitButton({items:i,click:()=>{this.ignore()},select:()=>{this.ignoreAll()}},this.dlgObj.element.querySelector(".biz-sc-ignore"));this.moveNext()}convertAsItemModel(n){for(let t=0;t<n.length;t++)n[t]={text:n[t]}}moveNext(n){if(!this.splitWords.length){this.dlgObj.content="No spelling errors";this.dlgObj.height="95px";this.dlgObj.dataBind();this.dlgObj.element.querySelector(".e-footer-content").classList.remove("biz-hide");this.ssObj.allowEditing=!0;setTimeout(()=>{this.destroySpellDialog()},3e3);return}n||(this.value=this.splitWords.pop(),this.spellObj=this.result.pop(),this.spanElem.innerHTML="Change <b>"+this.value+"<\/b> to:");let t=this.dic[this.value];this.spellObj.Suggestions&&this.spellObj.Suggestions.length&&t.length?(this.ssObj.selectRange(this.base.generateHeaderText(t[0].colIndex+1)+(t[0].rowIndex+1)),this.ddSug.dataSource=this.spellObj.Suggestions,this.ddSug.value=this.spellObj.Suggestions[0],this.textObj.value=this.spellObj.Suggestions[0]):(delete this.dic[this.value],this.moveNext())}change(){let t=this.dic[this.value],u=this.ssObj.biz.getActiveSheet(),i=ej.spreadsheet.getCell(t[0].rowIndex,t[0].colIndex,u),r=i.value===this.value?this.textObj.value:i.value.replace(this.value,this.textObj.value),f={rowIdx:t[0].rowIndex,colIdx:t[0].colIndex,value:r,action:"spellcheck",origin:"biz",sheetIndex:this.base.getSheetIndex()};this.applySpellValue(t[0].rowIndex,t[0].colIndex,r);this.ignore();n.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(f)}applySpellValue(t,i,r){let u=this.ssObj.biz.getActiveSheet(),f=ej.spreadsheet.getCell(t,i,u);f.value=r;this.ssObj.biz.setCell(t,i,u,f);n.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave({action:"cellSave",eventArgs:{address:"sheet!"+this.base.ssObj.biz.getRange()}},this.base,!0)}changeAll(){let n=this.dic[this.value].length;for(let t=0;t<n;t++)this.change()}ignore(){this.dic[this.value].shift();this.moveNext(!0)}ignoreAll(){delete this.dic[this.value];this.moveNext()}renderSpellDialog(){let n=this.ssObj.element.querySelector(".biz-spelldlg")||ej.base.createElement("div",{className:"biz-spelldlg"});this.ssObj.element.querySelector(".e-sheet-panel").appendChild(n);this.dlgObj=new ej.popups.Dialog({target:this.ssObj.element.querySelector(".e-sheet-panel"),content:"",width:"350px",height:"170px",position:{X:"right",Y:"top"},animationSettings:{effect:"None"},showCloseIcon:!1,buttons:[{click:this.destroySpellDialog.bind(this),buttonModel:{content:"Close"}}],open:()=>{ej.popups.createSpinner({target:this.dlgObj.element}),ej.popups.showSpinner(this.dlgObj.element)}});this.dlgObj.appendTo(n);this.processWords()}destroySpellDialog(){this.ddSug.destroy();this.ddChange.destroy();this.ddIgnore.destroy();this.dlgObj.destroy()}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.SpellChecker=i})(i=t.Sheets||(t.Sheets={}))})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,41 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Hubs;
(function (Hubs) {
class UniDocHub {
constructor(huburl) {
this.huburl = huburl;
this.connection = new window['signalR'].HubConnectionBuilder()
.withUrl(this.huburl).withAutomaticReconnect()
.build();
}
getConnection() {
return this.connection;
}
connect(callback) {
this.getConnection().start().then(function () {
callback();
});
}
register(eventname, actionmethod) {
this.getConnection().on(eventname, actionmethod);
}
invoke(methodname, params) {
this.getConnection().invoke(methodname, params);
}
static Instance(huburl) {
if (this.instance === undefined) {
this.instance = new UniDocHub(huburl);
}
return this.instance;
}
}
Hubs.UniDocHub = UniDocHub;
})(Hubs = Collaboration.Hubs || (Collaboration.Hubs = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"unidochub.js","sourceRoot":"","sources":["unidochub.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAkDhB;AAlDD,WAAU,OAAO;IACb,IAAiB,IAAI,CAgDpB;IAhDD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CA8C7B;QA9CD,WAAiB,aAAa;YAC1B,IAAiB,IAAI,CA4CpB;YA5CD,WAAiB,IAAI;gBACjB,MAAa,SAAS;oBAIlB,YAAY,MAAc;wBACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;wBACrB,IAAI,CAAC,UAAU,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,oBAAoB,EAAE;6BACzD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,sBAAsB,EAAE;6BAC7C,KAAK,EAAE,CAAC;oBACjB,CAAC;oBAED,aAAa;wBAKT,OAAO,IAAI,CAAC,UAAU,CAAC;oBAC3B,CAAC;oBAED,OAAO,CAAC,QAAkB;wBACtB,IAAI,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC;4BAC9B,QAAQ,EAAE,CAAC;wBACf,CAAC,CAAC,CAAC;oBACP,CAAC;oBAED,QAAQ,CAAC,SAAiB,EAAE,YAAsB;wBAE9C,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;oBACrD,CAAC;oBAED,MAAM,CAAC,UAAkB,EAAE,MAAuB;wBAC9C,IAAI,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;oBACnD,CAAC;oBAID,MAAM,CAAC,QAAQ,CAAC,MAAc;wBAC1B,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;yBACzC;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA1CY,cAAS,YA0CrB,CAAA;YACL,CAAC,EA5CgB,IAAI,GAAJ,kBAAI,KAAJ,kBAAI,QA4CpB;QACL,CAAC,EA9CgB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QA8C7B;IACL,CAAC,EAhDgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAgDpB;AACL,CAAC,EAlDS,OAAO,KAAP,OAAO,QAkDhB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{constructor(n){this.huburl=n;this.connection=(new window.signalR.HubConnectionBuilder).withUrl(this.huburl).withAutomaticReconnect().build()}getConnection(){return this.connection}connect(n){this.getConnection().start().then(function(){n()})}register(n,t){this.getConnection().on(n,t)}invoke(n,t){this.getConnection().invoke(n,t)}static Instance(n){return this.instance===undefined&&(this.instance=new t(n)),this.instance}}n.UniDocHub=t})(t=n.Hubs||(n.Hubs={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,127 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Controls;
(function (Controls) {
class UserSelect2 extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.data = [];
}
init(formpropertyid, prop, callback) {
var instance = UserSelect2.Instance();
var container = $(".select2_" + prop.FormPropertyId);
Unibase.Apps.Collaboration.Controls.UserSelect2.Instance().loadControlSettings(container, null).then(function () {
if (callback != null)
callback();
});
}
loadControl(containerid, prop) {
var instance = this;
var IsTagSelect = false;
var text;
debugger;
if (prop.ControlJsonText != "" && prop.ControlJsonText != null && prop.ControlJsonText != undefined) {
var text = JSON.parse(prop.ControlJsonText);
if (text["IsTagSelect"] == true) {
IsTagSelect = true;
}
}
var html = '<div id="div_' + prop.DocPropertyName + '" class="floating-label-form-group-with-value floating-validate" style="border-bottom:0;"><label for= "lbl" id = "lbl_' + prop.DocPropertyName + '" >' + prop.LabelName + '<span class="text-danger hide " id="spnIsRequired_' + prop.DocPropertyName + '"> *</span></label >' +
'<input type="hidden" id="hdnselect2_' + prop.FormPropertyId + '" class="" value="0">' +
'<select id="select2_' + prop.FormPropertyId + '" class="value-control select2_' + prop.FormPropertyId + ' type-control select2_' + prop.DocPropertyName + ' form-control text-control " multiple="multiple" data-isdynamic="' + prop.IsDefault + '" data-istagselect="' + IsTagSelect + '" style="width:100%;" data-propdoctypename="' + prop.DocTypeName + '" data-propertyid="' + prop.DocPropertyId + '" data-propertyname="' + prop.DocPropertyName + '" data-formpropertyid="' + prop.FormPropertyId + '" data-regularexp="" data-validatemsg="" data-textformpropertyid=""><option>Select</option></select>' +
'</div>';
$("#" + containerid).html(html);
}
loadControlSettings(Container, Parameters) {
return __awaiter(this, void 0, void 0, function* () {
var ColumnName = "0";
var Value = "0";
var DocPropertyId = Container.data('propertyid');
var DocPropertyName = Container.data('propertyname');
var FormPropertyId = Container.data('formpropertyid');
if (Parameters != null && Parameters != "") {
ColumnName = Parameters.map(function (item) { return item.ColumnName; }).toString();
Value = Parameters.map(function (item) { return item.Value + "|"; }).toString();
}
var userinfo = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/membership/getallusers';
var data = UserSelect2.instance.data.find(x => x.formpropertyid == FormPropertyId);
$(".select2_" + FormPropertyId).select2({
tags: true,
multiple: true,
allowClear: false,
data: UserSelect2.instance.data,
placeholder: 'Select',
ajax: {
url: function (request) {
var reqUrl = url;
var term = request.term;
if (term == undefined || term == "")
reqUrl = reqUrl + "/term/" + term + "/authtoken/" + userinfo.sessionId;
else
reqUrl = reqUrl + "/term/" + term + "/authtoken/" + userinfo.sessionId;
return reqUrl;
},
contentType: 'application/json',
type: "GET",
delay: 250,
data: function (params) {
var query = {
term: params.term,
type: 'GET'
};
return query;
},
beforeSend: function (xhr) {
if (userinfo !== undefined && userinfo !== null) {
xhr.setRequestHeader("Authorization", "Basic " + userinfo.sessionId);
xhr.setRequestHeader('geoposition', userinfo.latd + ':' + userinfo.lgId);
}
},
processResults: function (data, params) {
return {
results: jQuery.map(JSON.parse(data.result), function (item) {
return {
id: item.Value,
text: item.DisplayText
};
})
};
}
},
templateResult: function (item) { debugger; return item.text; },
templateSelection: function (item) { return item.text; },
});
});
}
loadPropertySettings(propertysettings, formpropertyid) {
return ``;
}
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
return ``;
}
static Instance() {
if (this.instance === undefined) {
this.instance = new UserSelect2();
}
return this.instance;
}
}
Controls.UserSelect2 = UserSelect2;
})(Controls = Collaboration.Controls || (Collaboration.Controls = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"userselect2.component.js","sourceRoot":"","sources":["userselect2.component.ts"],"names":[],"mappings":"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"}
+1
View File
@@ -0,0 +1 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseComponent{constructor(){super(...arguments);this.data=[]}init(t,r,u){var e=i.Instance(),f=$(".select2_"+r.FormPropertyId);n.Apps.Collaboration.Controls.UserSelect2.Instance().loadControlSettings(f,null).then(function(){u!=null&&u()})}loadControl(n,t){var f=this,i=!1,r,u;t.ControlJsonText!=""&&t.ControlJsonText!=null&&t.ControlJsonText!=undefined&&(r=JSON.parse(t.ControlJsonText),r.IsTagSelect==!0&&(i=!0));u='<div id="div_'+t.DocPropertyName+'" class="floating-label-form-group-with-value floating-validate" style="border-bottom:0;"><label for= "lbl" id = "lbl_'+t.DocPropertyName+'" >'+t.LabelName+'<span class="text-danger hide " id="spnIsRequired_'+t.DocPropertyName+'"> *<\/span><\/label ><input type="hidden" id="hdnselect2_'+t.FormPropertyId+'" class="" value="0"><select id="select2_'+t.FormPropertyId+'" class="value-control select2_'+t.FormPropertyId+" type-control select2_"+t.DocPropertyName+' form-control text-control " multiple="multiple" data-isdynamic="'+t.IsDefault+'" data-istagselect="'+i+'" style="width:100%;" data-propdoctypename="'+t.DocTypeName+'" data-propertyid="'+t.DocPropertyId+'" data-propertyname="'+t.DocPropertyName+'" data-formpropertyid="'+t.FormPropertyId+'" data-regularexp="" data-validatemsg="" data-textformpropertyid=""><option>Select<\/option><\/select><\/div>';$("#"+n).html(u)}loadControlSettings(t,r){return __awaiter(this,void 0,void 0,function*(){var e="0",o="0",h=t.data("propertyid"),c=t.data("propertyname"),f=t.data("formpropertyid");r!=null&&r!=""&&(e=r.map(function(n){return n.ColumnName}).toString(),o=r.map(function(n){return n.Value+"|"}).toString());var u=n.Platform.Membership.Infos.Identity.getCurrentUser(),s=_appsettings.server_url()+"/apis/v4/unibase/platform/membership/getallusers",l=i.instance.data.find(n=>n.formpropertyid==f);$(".select2_"+f).select2({tags:!0,multiple:!0,allowClear:!1,data:i.instance.data,placeholder:"Select",ajax:{url:function(n){var i=s,t=n.term;return t==undefined||t==""?i+"/term/"+t+"/authtoken/"+u.sessionId:i+"/term/"+t+"/authtoken/"+u.sessionId},contentType:"application/json",type:"GET",delay:250,data:function(n){return{term:n.term,type:"GET"}},beforeSend:function(n){u!==undefined&&u!==null&&(n.setRequestHeader("Authorization","Basic "+u.sessionId),n.setRequestHeader("geoposition",u.latd+":"+u.lgId))},processResults:function(n){return{results:jQuery.map(JSON.parse(n.result),function(n){return{id:n.Value,text:n.DisplayText}})}}},templateResult:function(n){return n.text},templateSelection:function(n){return n.text}})})}loadPropertySettings(){return``}bindEditFormDetails(){return``}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.UserSelect2=i})(i=t.Controls||(t.Controls={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,38 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Controls;
(function (Controls) {
class userselect2_settings {
loadSettingHtml() {
return ``;
}
bindControlData(controldatajson) {
return "";
}
SaveControlData(controldatajson) {
return "";
}
loadControlPropertiesHtml(Container) {
return "";
}
bindPropertySettings(prop) {
return "";
}
savePropertySettings(prop) {
return "";
}
static Instance() {
if (this._instance === undefined)
this._instance = new userselect2_settings();
return this._instance;
}
}
Controls.userselect2_settings = userselect2_settings;
})(Controls = Collaboration.Controls || (Collaboration.Controls = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"userselect2.settings.js","sourceRoot":"","sources":["userselect2.settings.ts"],"names":[],"mappings":"AAIA,IAAU,OAAO,CA0ChB;AA1CD,WAAU,OAAO;IACb,IAAiB,IAAI,CAwCpB;IAxCD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAsC7B;QAtCD,WAAiB,aAAa;YAC1B,IAAiB,QAAQ,CAoCxB;YApCD,WAAiB,QAAQ;gBACrB,MAAa,oBAAoB;oBAC7B,eAAe;wBACX,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,yBAAyB,CAAC,SAAS;wBAS/B,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,OAAO,EAAE,CAAC;oBACd,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;wBAChD,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBAlCY,6BAAoB,uBAkChC,CAAA;YACL,CAAC,EApCgB,QAAQ,GAAR,sBAAQ,KAAR,sBAAQ,QAoCxB;QACL,CAAC,EAtCgB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAsC7B;IACL,CAAC,EAxCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAwCpB;AACL,CAAC,EA1CS,OAAO,KAAP,OAAO,QA0ChB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{loadSettingHtml(){return``}bindControlData(){return""}SaveControlData(){return""}loadControlPropertiesHtml(){return""}bindPropertySettings(){return""}savePropertySettings(){return""}static Instance(){return this._instance===undefined&&(this._instance=new t),this._instance}}n.userselect2_settings=t})(t=n.Controls||(n.Controls={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
+23
View File
@@ -0,0 +1,23 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Enums;
(function (Enums) {
let Share;
(function (Share) {
Share[Share["Viewer"] = 1] = "Viewer";
Share[Share["Editor"] = 2] = "Editor";
Share[Share["Commentor"] = 3] = "Commentor";
Share[Share["Ristrict"] = 4] = "Ristrict";
Share[Share["AnyoneWithLink"] = 5] = "AnyoneWithLink";
Share[Share["TenantId"] = 6] = "TenantId";
Share[Share["NotAllowed"] = 7] = "NotAllowed";
})(Share = Enums.Share || (Enums.Share = {}));
;
})(Enums = Collaboration.Enums || (Collaboration.Enums = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"enum.js","sourceRoot":"","sources":["enum.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAUhB;AAVD,WAAU,OAAO;IACb,IAAiB,IAAI,CAQpB;IARD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAM7B;QAND,WAAiB,aAAa;YAC1B,IAAiB,KAAK,CAIrB;YAJD,WAAiB,KAAK;gBAClB,IAAY,KAEX;gBAFD,WAAY,KAAK;oBACb,qCAAU,CAAA;oBAAE,qCAAM,CAAA;oBAAE,2CAAS,CAAA;oBAAE,yCAAQ,CAAA;oBAAE,qDAAc,CAAA;oBAAE,yCAAQ,CAAA;oBAAE,6CAAU,CAAA;gBACjF,CAAC,EAFW,KAAK,GAAL,WAAK,KAAL,WAAK,QAEhB;gBAAA,CAAC;YACN,CAAC,EAJgB,KAAK,GAAL,mBAAK,KAAL,mBAAK,QAIrB;QACL,CAAC,EANgB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAM7B;IACL,CAAC,EARgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAQpB;AACL,CAAC,EAVS,OAAO,KAAP,OAAO,QAUhB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){n[n.Viewer=1]="Viewer";n[n.Editor=2]="Editor";n[n.Commentor=3]="Commentor";n[n.Ristrict=4]="Ristrict";n[n.AnyoneWithLink=5]="AnyoneWithLink";n[n.TenantId=6]="TenantId";n[n.NotAllowed=7]="NotAllowed"})(t=n.Share||(n.Share={}))})(t=n.Enums||(n.Enums={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,287 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
class DocumentManager extends Unibase.Platform.Core.BaseManager {
getDocumentFileInfo(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getdocumentfile/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getJsonData(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getjsondata/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
toJsonData(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/tojsondata/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
spreadSheetDownload(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/downloadspreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
saveWord(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = '/apis/v4/collaboration/unicloud/files/saveword';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
saveSpreadSheet(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = '/apis/v4/collaboration/unicloud/files/savespreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
ConvertDocstoPdfDownload(id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/downloadpdffromword/id/' + id;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDocumentBase64FileDownload(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/files/getebase64documentfile/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
importCreateSpreadSheet(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/createnewspreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
importReplaceSpreadSheet(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/replacespreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
insertNewSpreadsheet(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/insertnewspreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
copyOfCurrentDocument(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/copyspreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
renameFileTitle(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/replacefiletitle';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
spellCheck(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'https://plugins.spellcheck.bizgaze.com/api/documenteditor/SpellCheck';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response !== null)
response = JSON.parse(response);
return response;
});
});
}
ssAutoSave(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = '/apis/v4/collaboration/unicloud/files/spreadsheetautosave';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
CopySheetInToExistingWorkbook(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = '/apis/v4/collaboration/unicloud/files/copysheetintoexistingworkbook/';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
CopySheetToNewSpreadsheet(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/copysheettonewspreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
lastEdit(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getversiondetails/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
rollBackFileData(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/restorejsondatatofiledata/id/' + Id;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
ConvertSpreadsheettoOdsDownload(id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/downloadodsfromExcel/id/' + id;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getPermissionLevel(fileId, uid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getpermissionlevel/id/' + fileId + "/uid/" + uid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getCustomJsonData(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getcustomjsondata/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
saveSheetColor(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/savesheetcolor';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(JSON.parse(response.result));
return response;
});
});
}
updateSheetColorIndex(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/updatesheetindex';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(JSON.parse(response.result));
return response;
});
});
}
getRecentViews(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = '/apis/v4/collaboration/unicloud/files/getrecentviews/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getLinkInfo(fileid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/linkinfo/id/' + fileid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new DocumentManager();
}
return this.instance;
}
}
Collaboration.DocumentManager = DocumentManager;
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,368 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
class FileManager extends Unibase.Platform.Core.BaseManager {
downloadfile(id) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/files/downloadfile/DocumentFileId/' + id;
return yield this.dataHelper().getAsync(url).then(function (response) {
debugger;
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
downloadfolder(id) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/folder/downloadfolder/id/' + id;
return yield this.dataHelper().postAsync(url, id).then(function (response) {
debugger;
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
deleteFILE(id) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/files/deletefiles/DocumentFileId/' + id;
return yield this.dataHelper().postAsync(url, id).then(function (response) {
debugger;
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
deletefolder(id) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/folder/deletefolder/folderid/' + id;
return yield this.dataHelper().postAsync(url, id).then(function (response) {
debugger;
if (id == null) {
id = 0;
}
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
createnewsheet(templateid, folderid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/file/createnewfile/templateid/' + templateid + '/folderid/' + folderid;
return yield this.dataHelper().postAsync(url, templateid).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
movefiles(fileid, folderid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
var data = {
Filedid: fileid,
folderid: folderid
};
const url = 'apis/v4/collaboration/unicloud/file/movefiles/fileid/' + fileid + '/folderid/' + folderid;
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
movefolders(sourcefolderid, folderid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/file/movefolders/sourcefolderid/' + sourcefolderid + '/folderid/' + folderid;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
GetFolderList(id) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/folder/getfolderlist/folderId/' + id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
createfolder(Id, foldername) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
var data = {
Filedid: Id,
foldername: foldername
};
const url = 'apis/v4/collaboration/unicloud/folder/createfolder/folderid/' + Id + '/foldername/' + foldername;
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getfileprovider(id, fileproviderid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/folder/getFileProvider/documentfileid/' + id + '/fileproviderid/' + fileproviderid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
uploadfilesbyproviders(providerid, documentfileid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
var data = {
Providerid: providerid,
Documentfileid: documentfileid,
};
const url = 'apis/v4/collaboration/unicloud/folder/uploadfilesbyproviders/providerid/' + providerid + '/documentfileid/' + documentfileid;
debugger;
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
refreshApps() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/files/refreshfileproviders/np';
return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
if (response.result != null) {
response.result = JSON.parse(response.result);
}
alert(response.message);
return response;
});
});
}
getFolder(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/getfolder/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFile(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/file/getfile/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
copyFile(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/copyfile';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFileUrl(Id, type) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getlink/id/' + Id + '/type/' + type;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = response.result;
return response;
});
});
}
folderDownload(id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/downloadfolder/id/' + id;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFolders() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/getfolders';
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getAll(parentid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/getAll/parentid/' + parentid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFiles(folderId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/getfolderItems/folderid/' + folderId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFilesByParent(parentId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/getfoldersbyparent/parentid/' + parentId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFileByUrl(Url) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getfilebyurl/Url/' + Url;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getShareUsers(fileid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getshareusers/fileid/' + fileid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
share(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/share';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
return response;
});
});
}
updatepermission(data) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/folder/saveshareusers';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
return response;
});
});
}
removeshareuser(shareuserid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/removeshareuser/shareuserid/' + shareuserid;
return yield this.dataHelper().postAsync(url, shareuserid).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getUsers(userid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/files/getshareusersbyfileid/fileid/' + userid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
savelinkpermission(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/savelinkpermission/';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result != null) {
response.result = JSON.parse(response.result);
}
return response;
});
});
}
getLinkInfo(fileid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/linkinfo/id/' + fileid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
updateLink(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/savelinkpermission';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFileProvidersAutoComplete() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/files/getfileprovidersAutoComplete';
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new FileManager();
}
return this.instance;
}
}
Collaboration.FileManager = FileManager;
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,18 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Requests;
(function (Requests) {
class Share {
}
Requests.Share = Share;
class ShareUsers {
}
Requests.ShareUsers = ShareUsers;
})(Requests = Collaboration.Requests || (Collaboration.Requests = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"share.js","sourceRoot":"","sources":["share.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CA6BhB;AA7BD,WAAU,OAAO;IACb,IAAiB,IAAI,CA2BpB;IA3BD,WAAiB,IAAI;QACjB,IAAkB,aAAa,CAyB9B;QAzBD,WAAkB,aAAa;YAC3B,IAAiB,QAAQ,CAuBxB;YAvBD,WAAiB,QAAQ;gBAGrB,MAAa,KAAK;iBAWjB;gBAXY,cAAK,QAWjB,CAAA;gBACD,MAAa,UAAU;iBAOtB;gBAPY,mBAAU,aAOtB,CAAA;YACL,CAAC,EAvBgB,QAAQ,GAAR,sBAAQ,KAAR,sBAAQ,QAuBxB;QACL,CAAC,EAzBiB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAyB9B;IACL,CAAC,EA3BgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QA2BpB;AACL,CAAC,EA7BS,OAAO,KAAP,OAAO,QA6BhB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{}n.Share=t;class i{}n.ShareUsers=i})(t=n.Requests||(n.Requests={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,584 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Communications;
(function (Communications) {
let AI;
(function (AI) {
let Components;
(function (Components) {
class BusinessCards extends Unibase.Platform.Core.BaseComponent {
constructor() {
super();
this.inputParameters = [];
this.reportIdGallery = null;
this.fileValue = null;
this.reqType = 1;
this.resumeType = ['pdf', 'doc', 'docx'];
this.businessCardsType = ['png', 'jpg', 'jpeg', 'JPEG', 'pdf'];
this.salesInvoiceType = ['pdf'];
this.currFile = '';
this.moreFiles = [];
this.lastLength = 0;
this.contid = '';
this.navigationhelper = Unibase.Platform.Helpers.NavigationHelper.Instance();
}
cssFiles() {
return [];
}
jsFiles() {
return ["apps/communications/events/managers/gallerymanager.js", "apps/communications/ai/components/resumeparsingmanager.js"];
}
getMulupleBase64(event) {
return __awaiter(this, void 0, void 0, function* () {
let file = event.target.files;
const promisesArr = [];
for (let i = 0; i < file.length; i++) {
const currFile = file[i];
const currp = new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(currFile);
reader.onloadend = function () {
var base64String = reader.result.toString().replace(/^data:.+;base64,/, '');
var fileReq = {
FileData: base64String,
FileName: currFile.name.split('.').slice(0, -1).join('.'),
FileType: currFile.name.split('.').pop(),
FilePath: ''
};
resolve(fileReq);
};
reader.onerror = function (e) {
reject(e);
};
});
promisesArr.push(currp);
}
const ans = yield Promise.all(promisesArr);
return ans;
});
}
getCompressFiles(e) {
return __awaiter(this, void 0, void 0, function* () {
let instance = this;
const compressArr = [];
for (let i = 0; i < e.target.files.length; i++) {
const currFile = e.target.files[i];
console.log(currFile);
let baseString = yield instance.compressImgInputMoreHandler(currFile);
compressArr.push(baseString);
}
let cardsBox = '';
return compressArr;
});
}
generateCardsHTML() {
let instance = this;
let cards = instance.moreFiles;
if ($('.childContainerBusinessCard').length === 0) {
$('.containerBusinessCards').append('<div style="gap:20px; display:grid; align-items: start; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-content: flex-start;" class="childContainerBusinessCard w-100 h-100 py-4"></div>');
}
let cardsHTML = '';
for (let i = instance.lastLength; i < cards.length; i++) {
const currItem = cards[i];
cardsHTML += instance.cardbox(`data:image/png;base64, ${currItem.FileData}`, currItem.FileName, currItem.FileType);
}
$('.addMoreFiles').remove();
cardsHTML += instance.addMoreFileHTML();
$('.childContainerBusinessCard').append(cardsHTML);
$('.deleteBcard').each(function (i, evt) {
$(evt).off().click(function (el) {
const elId = $(el.target).parents('.businessCardbox').data('id');
const newFilterArr = instance.moreFiles.filter((e) => {
return e.FileName != elId;
});
instance.moreFiles = newFilterArr;
$(el.target).parents('.businessCardbox').remove();
if ($('.deleteBcard').length === 0) {
$('.containerBusinessCards').html('');
$('.containerBusinessCards').append($(instance.getChildHTML()));
instance.moreFiles = [];
instance.loadEvents(instance);
}
});
});
instance.loadEvents(instance);
}
load(id, containerid, callback) {
let instance = this;
instance.contid = containerid;
instance.loadEvents(instance);
let isMoblie = !(Unibase.Themes.Compact.Components.Index.Instance().desktopMode == true);
let addHTMLMOBILE = `<div class="text-center"><label for="formImgInput"><button class="w-150p btn btn-primary btn-sm clickEventDisabled">Browse Images</button></label></div>`;
if (!isMoblie) {
addHTMLMOBILE = '';
}
$('.onlyValuesDisplayAI').append(addHTMLMOBILE);
}
checkAllValidition(uploadedFiles) {
let files = uploadedFiles;
for (let i = 0; i < files.length; i++) {
const currFile = files[i];
if (this.checkIsValidFile(this.businessCardsType, currFile.FileType) === false) {
return true;
}
}
return false;
}
addMoreFileHTML() {
let isMoblie = !(Unibase.Themes.Compact.Components.Index.Instance().desktopMode == true);
let html = ``;
if (isMoblie) {
return `
<div data-name="addmore" class="addMoreFiles d-flex justify-content-end align-items-center border p-4 overflow-hide position-relative" style="min-height:100%;max-height:max-content;">
<div class="w-sm-100p h-100p p-2 text-center d-flex justify-content-end align-items-center flex-column" >
<input multiple id="addMoreFilesAfter" type="file" class="d-none" />
<label for="addMoreFilesAfter" class="d-flex flex-center flex-column w-100p btn btn-primary">
Files
</label>
<input id="formImgInputMobile" multiple class="m-0 d-none" accept="image/*" type="file">
<label for="formImgInputMobile" class="btn bg-primary w-100p text-white">Images</label>
</div>
</div>
`;
}
else {
return `
<div data-name="addmore" class="addMoreFiles border p-4 overflow-hide position-relative d-flex justify-content-center align-items-center" style="min-height:100%;max-height:max-content;">
<div class="w-sm-100p h-100p p-2 text-center" >
<input multiple id="addMoreFilesAfter" type="file" class="d-none" />
<label for="addMoreFilesAfter" class="d-flex flex-center flex-column">
<span class="font-50 cursor-pointer"> <i class="fa fa-paperclip"> </i></span >
<span>Add more </span>
</label>
</div>
</div>
`;
}
}
getErrorHTML(message) {
return `<div class="errorDiv py-10 d-flex justify-content-center align-items-center" style="
background: #ff000024;
"><span class="fa fa-info-circle pr-1 pt-1 text-danger"></span><span> ${message} </span></div>`;
}
setErrorRes(mess) {
$('.errorDivPlaceHere').removeClass('d-none');
let errorHTML = this.getErrorHTML(mess);
$('.errorDivPlaceHere').html(errorHTML);
document.querySelector('.errorDivPlaceHere').scrollIntoView();
}
loadEvents(instance) {
$('#businesscardInput, #addMoreFilesAfter,#formImgInputMobile,#formImgInput,#formAIInputId').off().change(function (e) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
if (e.currentTarget.files.length === 0) {
return;
}
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
const uploadedFiles = yield instance.getMulupleBase64(e);
if (instance.checkAllValidition(uploadedFiles)) {
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
$('.errorDivPlaceHere').removeClass('d-none');
let errorHTML = instance.getErrorHTML('File Not Supported');
$('.errorDivPlaceHere').html(errorHTML);
console.log(instance.moreFiles);
return;
}
instance.lastLength = instance.moreFiles.length - 1 === -1 ? 0 : instance.moreFiles.length;
instance.moreFiles = [...instance.moreFiles, ...uploadedFiles];
const compressFiles = yield instance.getCompressFiles(e);
let j = 0;
for (let i = instance.lastLength; i < instance.moreFiles.length; i++) {
instance.moreFiles[i]['FileData'] = compressFiles[j++];
}
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
if ($('.childContainerBusinessCard').length === 0) {
$('.containerBusinessCards').html('');
}
instance.generateCardsHTML();
$('#businesscardInput').val('');
$('#formAIInputId').val('');
$('#formImgInput').val('');
$('#formImgInputMobile').val('');
$('#addMoreFilesAfter').val('');
});
});
$('.resumeParsingButtonDelete').off().click(function (e) {
});
$('.resumeParsingButton').off().click(function (e) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
let res = null;
console.log(instance.moreFiles);
try {
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
res = yield instance.postBusinessCard(instance.moreFiles);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
instance.moreFiles = [];
}
catch (err) {
console.log(err);
$('.errorDivPlaceHere').removeClass('d-none');
const responseText = JSON.parse(err.responseText);
instance.setErrorRes(responseText.title);
return;
}
if (res === null) {
instance.setErrorRes('Something Went wrong');
return;
}
if (res.code != '0') {
instance.setErrorRes(res.message);
return;
}
if (res.message == 'Email Already Exists, Mobile Number Already Exists' || res.message == 'Phone Number Already Exists, Email Already Exists') {
instance.setErrorRes(res.message);
return;
}
if (res.result === 'Invalid image') {
instance.setErrorRes('Invalid image');
return;
}
$('#' + instance.contid).modal('hide');
$('#' + instance.contid).remove();
Unibase.Platform.Helpers.NavigationHelper.Instance().loadList(Unibase.Platform.Helpers.NavigationHelper.installedAppId, null);
Unibase.Platform.Helpers.NavigationHelper.IsListRefresh = true;
});
});
$('.labelInputWhite').off();
$('.labelInputWhite').on('dragstart', function (e) {
debugger;
$('.onlyValuesDisplayAI').addClass('.clickEventDisabled');
});
$('.labelInputWhite').on('dragenter', function (e) {
e.stopPropagation();
e.preventDefault();
debugger;
$('.labelInputWhite').addClass('dragEnterResume');
$('.onlyValuesDisplayAI').addClass('clickEventDisabled');
});
$('.labelInputWhite').on('dragleave', function (e) {
e.stopPropagation();
e.preventDefault();
$('.labelInputWhite').removeClass('dragEnterResume');
});
$('.labelInputWhite').on('dragstop', function (e) {
$('.labelInputWhite').removeClass('dragEnterResume');
$('.onlyValuesDisplayAI').removeClass('.clickEventDisabled');
});
$('.labelInputWhite').on('dragover', function (e) {
e.stopPropagation();
e.preventDefault();
});
$('.labelInputWhite').on('drop', function (e) {
return __awaiter(this, void 0, void 0, function* () {
e.stopPropagation();
e.preventDefault();
try {
$('.labelInputWhite').removeClass('dragEnterResume');
debugger;
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
let event = {
target: {
files: e.originalEvent.dataTransfer.files
}
};
const uploadedFiles = yield instance.getMulupleBase64(event);
if (instance.checkAllValidition(uploadedFiles)) {
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
$('.errorDivPlaceHere').removeClass('d-none');
let errorHTML = instance.getErrorHTML('File Not Supported');
$('.errorDivPlaceHere').html(errorHTML);
console.log(instance.moreFiles);
return;
}
instance.lastLength = instance.moreFiles.length - 1 === -1 ? 0 : instance.moreFiles.length;
instance.moreFiles = [...instance.moreFiles, ...uploadedFiles];
const compressFiles = yield instance.getCompressFiles(event);
let j = 0;
for (let i = instance.lastLength; i < instance.moreFiles.length; i++) {
instance.moreFiles[i]['FileData'] = compressFiles[j++];
}
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
if ($('.childContainerBusinessCard').length === 0) {
$('.containerBusinessCards').html('');
}
instance.generateCardsHTML();
}
catch (err) {
console.log(err);
}
});
});
$('.bsClose').off().click(function () {
instance.moreFiles = [];
Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp();
});
}
cardbox(img, filename, filetype) {
if (filetype === 'pdf') {
img = '/tenants/themes/compact/imgs/pdfimgdoc.png';
}
return `
<div data-id="${filename}" data-name="${filename}_bcards" class="businessCardbox border h-100 p-4 overflow-hide position-relative" style="height:min-content;">
<div class="position-absolute" style="top:10px;right:10px;"><span class="w-30p bg-white cursor-pointer deleteBcard"><i style="pointer-events:none;" class="fa fa-trash-o text-danger font-18"></i> </span> </div>
<div class="w-sm-100p w-md-100 h-100p p-2" >
<img class="w-100 h-100" src="${img}" alt="${filename}"/>
</div>
<div class="word-break text-center">
${filename}
</div>
</div>
`;
}
createLead() {
let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_stagename").Value != "Lead") {
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_ConvertToLead').click(function () {
if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_stagename").Value != "Lead") {
var postData = {
CONTACTPERSONNAME: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_contactpersonname").Value,
Designation: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_designation").Value,
PhoneNumber: Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_phonenumber").Value),
Email: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_email").Value,
ADDRESS: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_address").Value,
PinCode1: Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_pincode1").Value),
country_code: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_countrycode").Value,
LandMark1: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_landmark1").Value,
state_name: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_statename").Value,
state_code: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_statecode").Value,
CityName1: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_cityname1").Value,
Urls: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_urls").Value,
OrganizationName: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_organizationname").Value,
OrganizationNumber: Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_organizationnumber").Value),
OrganizationEmail: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_organizationemail").Value
};
var installedappid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_installedappid").Value;
Unibase.Apps.Collaboration.ResumeParsingManager.Instance().createLead(postData).then(function (res) {
if (res.message == "Lead Saved Successfully") {
Unibase.Platform.Apps.Managers.StageManager.Instance().getStageByStageName(installedappid, "Lead").then(function (response) {
Unibase.Themes.Compact.Components.Details.Instance().change(response.result.StageId, installedappid);
$('.li_DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_ConvertToLead').hide();
});
MessageHelper.Instance().showSuccess(res.message, "Unibase_ValidationSummary");
}
else
$('.li_DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_ConvertToLead').show();
MessageHelper.Instance().showSuccess(res.message, "Unibase_ValidationSummary");
});
}
else
$("#div_App_DefaultWidgetSettings").hide();
});
}
else
$("#div_App_DefaultWidgetSettings").hide();
}
postBusinessCard(payload) {
return __awaiter(this, void 0, void 0, function* () {
let res = yield Unibase.Apps.Collaboration.ResumeParsingManager.Instance().postbusinessCard(payload);
return res;
});
}
compressImgInputMoreHandler(doc) {
let instance = this;
let imageFormat = 'jpeg';
return new Promise((reslove, reject) => {
const MAX_WIDTH = 1000;
const MAX_HEIGHT = 1000;
const MIME_TYPE = 'image/' + imageFormat;
const QUALITY = 1;
const file = doc;
const blobURL = URL.createObjectURL(file);
const img = new Image();
img.src = blobURL;
img.onerror = function () {
reject("Cannot load image");
URL.revokeObjectURL(this.src);
console.log("Cannot load image");
};
img.onload = function () {
const [newWidth, newHeight] = instance.calculateSize(img, MAX_WIDTH, MAX_HEIGHT);
const canvas = document.createElement("canvas");
canvas.width = newWidth;
canvas.height = newHeight;
const ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0, newWidth, newHeight);
canvas.toBlob((blob) => {
const formData = new FormData();
formData.append('file', blob);
for (let [name, value] of formData) {
if (name === 'file') {
let reader = new FileReader();
reader.onloadend = function () {
let base64String = `${reader.result}`.replace(/^data:.+;base64,/, "");
reslove(base64String);
};
reader.readAsDataURL(blob);
}
}
}, MIME_TYPE, QUALITY);
};
});
}
compressImgInputHandler(ev) {
let instance = this;
let imageFormat = 'jpeg';
return new Promise((reslove, reject) => {
const MAX_WIDTH = 1000;
const MAX_HEIGHT = 1000;
const MIME_TYPE = 'image/' + imageFormat;
const QUALITY = 1;
const file = ev.target.files[0];
const blobURL = URL.createObjectURL(file);
const img = new Image();
img.src = blobURL;
img.onerror = function () {
reject("Cannot load image");
URL.revokeObjectURL(this.src);
console.log("Cannot load image");
};
img.onload = function () {
const [newWidth, newHeight] = instance.calculateSize(img, MAX_WIDTH, MAX_HEIGHT);
const canvas = document.createElement("canvas");
canvas.width = newWidth;
canvas.height = newHeight;
const ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0, newWidth, newHeight);
canvas.toBlob((blob) => {
const formData = new FormData();
formData.append('file', blob);
for (let [name, value] of formData) {
if (name === 'file') {
let reader = new FileReader();
reader.onloadend = function () {
let base64String = `${reader.result}`.replace(/^data:.+;base64,/, "");
reslove(base64String);
};
reader.readAsDataURL(blob);
}
}
}, MIME_TYPE, QUALITY);
};
});
}
calculateSize(img, maxWidth, maxHeight) {
let width = img.width;
let height = img.height;
if (width > height) {
if (width > maxWidth) {
height = Math.round((height * maxWidth) / width);
width = maxWidth;
}
}
else {
if (height > maxHeight) {
width = Math.round((width * maxHeight) / height);
height = maxHeight;
}
}
return [width, height];
}
checkIsValidFile(values, type) {
const twoLower = type.toLowerCase();
for (let i = 0; i < values.length; i++) {
if (twoLower == values[i]) {
return true;
}
}
return false;
}
init(containerid) {
}
getChildHTML() {
return `<div class="parsingForm m-0 p-0 w-400p h-450p w-md-500p justify-content-center align-items-center py-5 border-dashed d-flex flex-column"
style="border: 4px #beccd6;">
<div class="resumeParsingButtonDelete d-none"> <i class="fa fa-trash-o text-danger font-18"></i> </div>
<div class="resumeDivImg d-none my-2 rounded overflow-hide">
<img class="w-100 h-100" src="" />
</div>
<div for="formAIInputId"
class=" d-flex flex-column align-items-center m-0 labelInputWhite h-100 w-100 rounded-10">
<div class="d-flex flex-column justify-content-center align-items-center h-100 w-100">
<div class="font-50 w-100p text-center clickEventDisabled">
<img class="w-100" src="/tenants/themes/compact/imgs/cloudresume.png" />
</div>
<div class="onlyValuesDisplayAI ">
<span>Click To Browse PDF, PNG, JPEJ, JPG to Upload</span>
<div class="text-center">
<input type="file" multiple id="businesscardInput" class="d-none" />
<label for="businesscardInput" class="btn bg-primary w-150p text-white">Upload</label>
</div>
</div>
<input id="formAIInputId" multiple class="resumeParsingInput m-0 d-none" type="file">
<input id="formImgInput" multiple class="m-0 d-none" accept="image/*" type="file">
</div>
</div>
</div>
<div class="text-center py-30 d-none fileMessageDisplay"></div>`;
}
html(id, containerid) {
let html = `
<div id="img-modal" class="modal-content h-100">
<div class="modal-body bg-white simple-scroll-bar edit-filters-body py-0 bg-cyan-light-5">
<div class="text-danger errorDivPlaceHere d-none p-10"></div>
<div
class="align-items-center d-flex flex-column d-flex h-100 justify-content-center w-100 containerBusinessCards">
${this.getChildHTML()}
</div>
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<div class="modal-footer pa-10"> <button type="button" id="btn_CloseForm_${id}"
class="btn btn-light btn-sm mr-auto bsClose">Close</button>
<button class="btn btn-primary resumeParsingButton btn-sm" type="button">Submit</button>
</div>
</div>`;
return html;
}
callBusinessCards() {
let instances = this;
instances.navigationHelper.popup(0, '', this, null, Unibase.Platform.Helpers.Size.Medium);
}
static Instance() {
if (this.instance === undefined) {
this.instance = new BusinessCards();
}
return this.instance;
}
}
Components.BusinessCards = BusinessCards;
})(Components = AI.Components || (AI.Components = {}));
})(AI = Communications.AI || (Communications.AI = {}));
})(Communications = Apps.Communications || (Apps.Communications = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,507 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Communications;
(function (Communications) {
let AI;
(function (AI) {
let Components;
(function (Components) {
class ResumeParsing extends Unibase.Platform.Core.BaseComponent {
constructor() {
super();
this.inputParameters = [];
this.reportIdGallery = null;
this.fileValue = null;
this.reqType = 1;
this.resumeType = ['PDF', 'doc', 'docx'];
this.businessCardsType = ['png', 'jpg', 'jpeg', 'JPEG', 'pdf'];
this.salesInvoiceType = ['pdf'];
this.currFile = '';
this.navigationhelper = Unibase.Platform.Helpers.NavigationHelper.Instance();
}
cssFiles() {
return [];
}
jsFiles() {
return ["apps/communications/events/managers/gallerymanager.js", "apps/communications/ai/components/resumeparsingmanager.js"];
}
load(id, containerid, callback) {
let instance = this;
$('.resumeParsingInput, #formImgInput').change(function (e) {
return __awaiter(this, void 0, void 0, function* () {
if (e.currentTarget.files.length === 0) {
return;
}
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
let file = yield Unibase.Platform.Helpers.FileHelper.Instance().getBase64(e);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
let whichType = [];
if (instance.reqType == 1) {
whichType = instance.resumeType;
}
else if (instance.reqType == 2) {
whichType = instance.businessCardsType;
}
else if (instance.reqType == 3) {
whichType = instance.salesInvoiceType;
}
$('.fileMessageDisplay').removeClass('d-none');
$('.fileMessageDisplay').html(`<span><span class="font-weight-700">File Name: </span><span>${file.FileName} </span></span>`);
const lowercaseWords = whichType.map(word => word.toLowerCase());
if (instance.checkIsValidFile(lowercaseWords, file.FileType.toLowerCase()) === false) {
$('.resumeParsingButton').prop('disabled', true);
let idGen = Math.random() * 999;
idGen = `${idGen}_selectedFile`;
$('.fileMessageDisplay').html(`<span class="${idGen} text-danger">Wrong File Selected</span>`);
$('#formAIInputId').val('');
$('#formImgInput').val('');
setTimeout(function () {
$('.fileMessageDisplay').addClass('d-none');
$('.fileMessageDisplay').html('');
}, 3000);
return;
}
$('.resumeParsingButton').prop('disabled', false);
$('.resumeParsingButtonDelete').removeClass('d-none');
$(`.resumeDivImg`).removeClass('d-none');
if (instance.reqType === 2) {
if (file.FileType == 'pdf') {
$(`.resumeDivImg img`).attr('src', `/tenants/themes/compact/imgs/fileuploaded.png`);
}
else {
let baseString = yield instance.compressImgInputHandler(e);
$(`.resumeDivImg img`).attr('src', `data:image/png;base64, ${file.FileData}`);
file.FileData = `${baseString}`;
}
}
else {
$(`.resumeDivImg img`).attr('src', `/tenants/themes/compact/imgs/fileuploaded.png`);
}
$('.labelInputWhite').removeClass('d-flex').addClass('d-none');
instance.fileValue = file;
});
});
$('.resumeParsingButtonDelete').click(function (e) {
$('.resumeParsingButtonDelete').addClass('d-none');
$('.labelInputWhite').addClass('d-flex').removeClass('d-none');
$(`.resumeDivImg`).addClass('d-none');
$('.fileMessageDisplay').html('');
$('.fileMessageDisplay').addClass('d-none');
$('#formAIInputId').val('');
$('#formImgInput').val('');
});
$('.resumeParsingButton').click(function (e) {
return __awaiter(this, void 0, void 0, function* () {
e.preventDefault();
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
if (instance.fileValue === null) {
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
return;
}
;
let file = instance.fileValue;
let payload = {
"FileData": file.FileData,
"FileName": file.FileName,
"FilePath": "test",
"FileType": instance.fileValue.FileType
};
let message = '';
$('.fileMessageDisplay').removeClass('d-none');
$('.fileMessageDisplay').html(file.FileName);
try {
if (instance.reqType == 1) {
message = yield instance.postResume(payload);
}
else if (instance.reqType == 2) {
message = yield instance.postBusinessCard(payload);
}
}
catch (err) {
console.log(err);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
MessageHelper.Instance().showError(err === null || err === void 0 ? void 0 : err.message, "div_message");
return;
}
let res = JSON.parse(message.result);
if (message.result === 'Invalid image') {
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
MessageHelper.Instance().showError("Invalid image", "div_message");
return;
}
if (res.status == 0) {
$('.fileMessageDisplay').removeClass('d-none');
$('.fileMessageDisplay').html(`<span class="text-success">Upload Successs</span>`);
}
else {
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
MessageHelper.Instance().showError(res.message, "div_message");
return;
}
if (message.message == 'Email Already Exists, Mobile Number Already Exists' || message.message == 'Phone Number Already Exists, Email Already Exists') {
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
MessageHelper.Instance().showError(message.message, "div_message");
return;
}
if (message.code != '0') {
$('.fileMessageDisplay').removeClass('d-none');
if ((message === null || message === void 0 ? void 0 : message.message) == '') {
$('.fileMessageDisplay').html(`<span class="text-danger">${message === null || message === void 0 ? void 0 : message.code}</span>`);
}
else {
$('.fileMessageDisplay').html(`<span class="text-danger">${message === null || message === void 0 ? void 0 : message.message}</span>`);
}
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
setTimeout(function () {
$('.fileMessageDisplay').addClass('d-none');
$('.fileMessageDisplay').html('');
}, 3000);
return;
}
if (res === null) {
$('.fileMessageDisplay').removeClass('d-none');
if ((message === null || message === void 0 ? void 0 : message.message) == '') {
$('.fileMessageDisplay').html(`<span class="text-danger">${message === null || message === void 0 ? void 0 : message.code}</span>`);
}
else {
$('.fileMessageDisplay').html(`<span class="text-danger">${message === null || message === void 0 ? void 0 : message.message}</span>`);
}
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
setTimeout(function () {
$('.fileMessageDisplay').addClass('d-none');
$('.fileMessageDisplay').html('');
}, 3000);
return;
}
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
$('.fileMessageDisplay').removeClass('d-none');
$('.fileMessageDisplay').html('');
$('#' + containerid).modal('hide');
$('#' + containerid).remove();
Unibase.Platform.Helpers.NavigationHelper.Instance().loadDetail(Number(res.result), Unibase.Platform.Helpers.NavigationHelper.installedAppId, null);
Unibase.Platform.Helpers.NavigationHelper.IsListRefresh = true;
});
});
if (instance.reqType == 1) {
let htmlstr = instance.appendTextValuesValid(instance.resumeType);
let isMoblie = !(Unibase.Themes.Compact.Components.Index.Instance().desktopMode == true);
let addHTMLMOBILE = `<label for="formAIInputId"><button class="btn btn-primary btn-sm clickEventDisabled">${htmlstr}</button></label>`;
let str = addHTMLMOBILE;
$('.onlyValuesDisplayAI').html(str);
}
else if (instance.reqType == 2) {
let isMoblie = !(Unibase.Themes.Compact.Components.Index.Instance().desktopMode == true);
let addHTMLMOBILE = `<label for="formImgInput"><button class="btn btn-primary btn-sm clickEventDisabled">Browse Images</button></label>`;
if (!isMoblie) {
addHTMLMOBILE = '';
}
let str = `<div class="">
<div class="font-14 text-light-60">Drag & Drop files here</div>
<div class="text-light-60 text-center my-2">or</div>
<div class="text-center"><div><label for="formAIInputId"><button class="btn btn-primary btn-sm clickEventDisabled">Browse Files</button></label></div><div class="mobilemodeInput">
${addHTMLMOBILE}
</div></div>
</div>`;
$('.onlyValuesDisplayAI').html(str);
}
$('.labelInputWhite').on('dragenter', function (e) {
e.stopPropagation();
e.preventDefault();
$('.labelInputWhite').addClass('dragEnterResume');
});
$('.labelInputWhite').on('dragleave', function (e) {
e.stopPropagation();
e.preventDefault();
$('.labelInputWhite').removeClass('dragEnterResume');
});
$('.labelInputWhite').on('dragstop', function (e) {
$('.labelInputWhite').removeClass('dragEnterResume');
});
$('.labelInputWhite').on('dragover', function (e) {
e.stopPropagation();
e.preventDefault();
});
$('.labelInputWhite').on('drop', function (e) {
return __awaiter(this, void 0, void 0, function* () {
e.stopPropagation();
e.preventDefault();
$('.labelInputWhite').removeClass('dragEnterResume');
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
let event = {
target: {
files: e.originalEvent.dataTransfer.files
}
};
let file = yield Unibase.Platform.Helpers.FileHelper.Instance().getBase64(event);
let whichType = [];
if (instance.reqType == 1) {
whichType = instance.resumeType;
}
else if (instance.reqType == 2) {
whichType = instance.businessCardsType;
}
else if (instance.reqType == 3) {
whichType = instance.salesInvoiceType;
}
if (instance.checkIsValidFile(whichType, file.FileType) === false) {
$('.resumeParsingButton').prop('disabled', true);
let idGen = Math.random() * 999;
idGen = `${idGen}_selectedFile`;
$('.fileMessageDisplay').removeClass('d-none');
$('.fileMessageDisplay').html(`<span class="${idGen} text-danger">Wrong File Selected</span>`);
$('#formAIInputId').val('');
$('#formImgInput').val('');
setTimeout(function () {
$('.fileMessageDisplay').addClass('d-none');
$('.fileMessageDisplay').html('');
}, 5000);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
return;
}
if (instance.reqType === 2) {
$(`.resumeDivImg img`).attr('src', `data:image/png;base64, ${file.FileData}`);
let baseString = yield instance.compressImgInputHandler(e);
file.FileData = `${baseString}`;
}
else {
$(`.resumeDivImg img`).attr('src', `/tenants/themes/compact/imgs/fileuploaded.png`);
}
$('.labelInputWhite').addClass('d-none').removeClass('d-flex');
$(`.resumeDivImg`).removeClass('d-none');
$('.resumeParsingButton').prop('disabled', false);
$('.resumeParsingButtonDelete').removeClass('d-none');
$('.fileMessageDisplay').removeClass('d-none');
$('.fileMessageDisplay').html(`<span><span class="font-w700">File Name: </span><span class="">${file.FileName} </span></span>`);
instance.fileValue = file;
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
});
}
createLead() {
let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_stagename").Value != "Lead") {
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_ConvertToLead').click(function () {
if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_stagename").Value != "Lead") {
var postData = {
CONTACTPERSONNAME: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_contactpersonname").Value,
Designation: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_designation").Value,
PhoneNumber: Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_phonenumber").Value),
Email: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_email").Value,
ADDRESS: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_address").Value,
PinCode1: Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_pincode1").Value),
country_code: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_countrycode").Value,
LandMark1: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_landmark1").Value,
state_name: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_statename").Value,
state_code: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_statecode").Value,
CityName1: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_cityname1").Value,
Urls: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_urls").Value,
OrganizationName: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_organizationname").Value,
OrganizationNumber: Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_organizationnumber").Value),
OrganizationEmail: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_organizationemail").Value
};
var installedappid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_installedappid").Value;
Unibase.Apps.Collaboration.ResumeParsingManager.Instance().createLead(postData).then(function (res) {
if (res.message == "Lead Saved Successfully") {
Unibase.Platform.Apps.Managers.StageManager.Instance().getStageByStageName(installedappid, "Lead").then(function (response) {
Unibase.Themes.Compact.Components.Details.Instance().change(response.result.StageId, installedappid);
$('.li_DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_ConvertToLead').hide();
});
MessageHelper.Instance().showSuccess(res.message, "Unibase_ValidationSummary");
}
else
$('.li_DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_ConvertToLead').show();
MessageHelper.Instance().showSuccess(res.message, "Unibase_ValidationSummary");
});
}
else
$("#div_App_DefaultWidgetSettings").hide();
});
}
else
$("#div_App_DefaultWidgetSettings").hide();
}
postResume(payload) {
return __awaiter(this, void 0, void 0, function* () {
let instance = this;
let res = yield Unibase.Apps.Collaboration.ResumeParsingManager.Instance().postResume(payload);
return res;
});
}
postBusinessCard(payload) {
return __awaiter(this, void 0, void 0, function* () {
let res = yield Unibase.Apps.Collaboration.ResumeParsingManager.Instance().postbusinessCard(payload);
return res;
});
}
compressImgInputHandler(ev) {
let instance = this;
let imageFormat = 'jpeg';
return new Promise((reslove, reject) => {
const MAX_WIDTH = 1000;
const MAX_HEIGHT = 1000;
const MIME_TYPE = 'image/' + imageFormat;
const QUALITY = 1;
const file = ev.target.files[0];
const blobURL = URL.createObjectURL(file);
const img = new Image();
img.src = blobURL;
img.onerror = function () {
reject("Cannot load image");
URL.revokeObjectURL(this.src);
console.log("Cannot load image");
};
img.onload = function () {
const [newWidth, newHeight] = instance.calculateSize(img, MAX_WIDTH, MAX_HEIGHT);
const canvas = document.createElement("canvas");
canvas.width = newWidth;
canvas.height = newHeight;
const ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0, newWidth, newHeight);
canvas.toBlob((blob) => {
const formData = new FormData();
formData.append('file', blob);
for (let [name, value] of formData) {
if (name === 'file') {
let reader = new FileReader();
reader.onloadend = function () {
let base64String = `${reader.result}`.replace(/^data:.+;base64,/, "");
reslove(base64String);
};
reader.readAsDataURL(blob);
}
}
}, MIME_TYPE, QUALITY);
};
});
}
calculateSize(img, maxWidth, maxHeight) {
let width = img.width;
let height = img.height;
if (width > height) {
if (width > maxWidth) {
height = Math.round((height * maxWidth) / width);
width = maxWidth;
}
}
else {
if (height > maxHeight) {
width = Math.round((width * maxHeight) / height);
height = maxHeight;
}
}
return [width, height];
}
appendTextValuesValid(arr) {
let values = '';
for (let i = 0; i < arr.length; i++) {
if (i != arr.length - 1) {
values = values + `${arr[i]},`;
}
else {
values = values + arr[i];
}
}
let str = `Click To Browse <span class="font-weight-700">${values}</span> to Upload`;
return str;
}
getLabelHTML() {
return `<label for="formAIInputId" class="p-5 d-flex flex-column bg-white rounded-10">
<div class="font-50 text-center">
<img src="/tenants/themes/compact/imgs/scanai.png" />
</div>
<div class="onlyValuesDisplayAI">
Click To Browse PDF to Upload
</div>
<input id="formAIInputId" class="resumeParsingInput d-none" type="file">
</label>`;
}
checkIsValidFile(values, type) {
const twoLower = type.toLowerCase();
for (let i = 0; i < values.length; i++) {
if (twoLower == values[i]) {
return true;
}
}
return false;
}
init(containerid) {
}
html(id, containerid) {
let html = `
<div id="img-modal" class="modal-content h-100">
<div id="div_message" class="clear"></div>
<div class="modal-body bg-white simple-scroll-bar edit-filters-body py-0 bg-cyan-light-5">
<div class="align-items-center d-flex flex-column d-flex h-100 justify-content-center w-100">
<div class="parsingForm m-0 p-0 w-400p h-450p w-md-500p justify-content-center align-items-center py-5 border-dashed d-flex flex-column" style="border: 4px #beccd6;">
<div class="resumeParsingButtonDelete d-none"> <i class="fa fa-trash-o text-danger font-18"></i> </div>
<div class="resumeDivImg d-none my-2 rounded overflow-hide" >
<img class="w-100 h-100" src="" />
</div>
<div for="formAIInputId" class=" d-flex flex-column align-items-center m-0 labelInputWhite h-100 w-100 rounded-10">
<div class="d-flex flex-column justify-content-center align-items-center h-100 w-100">
<div class="font-50 w-100p text-center clickEventDisabled">
<img class="w-100" src="/tenants/themes/compact/imgs/cloudresume.png" />
</div>
<div class="onlyValuesDisplayAI ">
Click To Browse PDF to Upload
</div>
<input id="formAIInputId" class="resumeParsingInput m-0 d-none" type="file">
<input id="formImgInput" class="m-0 d-none" accept="image/*" type="file">
</div>
</div>
</div>
<div class="mt-20">
</div>
<div class="text-center py-30 d-none fileMessageDisplay"></div>
</div>
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</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>
<button disabled class="btn btn-primary resumeParsingButton btn-sm" type="button">Submit</button>
</div>
</div>`;
return html;
}
callResumeParsing(type = 1) {
let instances = this;
instances.reqType = type;
instances.navigationHelper.popup(0, '', this, null, Unibase.Platform.Helpers.Size.Medium);
}
static Instance() {
if (this.instance === undefined) {
this.instance = new ResumeParsing();
}
return this.instance;
}
}
Components.ResumeParsing = ResumeParsing;
})(Components = AI.Components || (AI.Components = {}));
})(AI = Communications.AI || (Communications.AI = {}));
})(Communications = Apps.Communications || (Apps.Communications = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,70 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
class ResumeParsingManager extends Unibase.Platform.Core.BaseManager {
createLead(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/integrations/businesscards/createlead';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result != null) {
response.result = JSON.parse(response.result);
}
return response;
});
});
}
postResume(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/integrations/ai/uploadresume';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
return response;
});
});
}
postUserRegister(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/integrations/facerecognization/register';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
return response;
});
});
}
postUserDetect(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/integrations/facerecognization/detect';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
return response;
});
});
}
postbusinessCard(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/integrations/ai/uploadbusinesscards/list';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
return response;
});
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new ResumeParsingManager();
}
return this.instance;
}
}
Collaboration.ResumeParsingManager = ResumeParsingManager;
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"resumeparsingmanager.js","sourceRoot":"","sources":["resumeparsingmanager.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAU,OAAO,CAkEhB;AAlED,WAAU,OAAO;IACb,IAAiB,IAAI,CAgEpB;IAhED,WAAiB,IAAI;QACjB,IAAiB,aAAa,CA6D7B;QA7DD,WAAiB,aAAa;YAE1B,MAAa,oBAAqB,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW;gBAEjE,UAAU,CAAC,GAAG;;wBAChB,MAAM,GAAG,GAAG,0CAA0C,CAAC;wBACvD,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;4BACtE,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE;gCACzB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;6BACjD;4BACD,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC;iBAAA;gBAEK,UAAU,CAAC,IAAS;;wBAEtB,MAAM,GAAG,GAAG,8CAA8C,CAAC;wBAC3D,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;4BAIvE,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBAEP,CAAC;iBAAA;gBAEK,gBAAgB,CAAC,IAAS;;wBAC5B,MAAM,GAAG,GAAG,yDAAyD,CAAC;wBACtE,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;4BACvE,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC;iBAAA;gBAEK,cAAc,CAAC,IAAS;;wBAC1B,MAAM,GAAG,GAAG,uDAAuD,CAAC;wBACpE,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;4BACvE,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC;iBAAA;gBAGK,gBAAgB,CAAC,IAAS;;wBAE5B,MAAM,GAAG,GAAG,0DAA0D,CAAC;wBACvE,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;4BAIvE,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBAEP,CAAC;iBAAA;gBAGD,MAAM,CAAC,QAAQ;oBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;wBAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,oBAAoB,EAAE,CAAC;qBAC9C;oBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;gBACzB,CAAC;aACJ;YA1DY,kCAAoB,uBA0DhC,CAAA;QACL,CAAC,EA7DgB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QA6D7B;IAEL,CAAC,EAhEgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAgEpB;AACL,CAAC,EAlES,OAAO,KAAP,OAAO,QAkEhB"}
@@ -0,0 +1,61 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Communications;
(function (Communications) {
let Component;
(function (Component) {
class AuthTokenUpdate extends Unibase.Platform.Core.BaseComponent {
cssFiles() {
return [];
}
jsFiles() {
return ["apps/communications/components/w_authtokenupdate.js", "apps/communications/managers/authtokenmanager.js"];
}
html(id, containerid) {
let html = ``;
return html;
}
load(id, containerid, callback) {
}
init() {
this.render();
$("#BtnUpdateAuthtoken").click(function () {
Unibase.Apps.Communications.Component.AuthTokenUpdate.Instance().updateAuthtoken();
});
}
render() {
var portletwidgetid = Number($("#hf_PortletWidgetId").val());
$(".div_portletwidget_" + portletwidgetid).empty();
let html = `<div class="card shadow-hover">
<div class="card-header card-header-action bg-light bg-gradient-light"><strong>Update Auth Token</strong></div>
<div class="card-body">
<div id="divUpdateAuthToken" class="wrapper text-center bg-success card-header">
<a id="BtnUpdateAuthtoken" href="javascript:;"><span class="h4">Update Authentication Token</span></a>
</div>
</div>
</div>`;
$(".div_portletwidget_" + portletwidgetid).append(html);
}
updateAuthtoken() {
var instance = this;
instance.fileCacheHelper.loadJsFile('apps/communications/managers/authtokenmanager.js', function () {
Unibase.Apps.Communications.Managers.AuthTokenManager.Instance().updateAuthToken().then(function (response) {
MessageHelper.Instance().showSuccess(response.message, "Unibase_ValidationSummary");
});
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new AuthTokenUpdate();
}
return this.instance;
}
}
Component.AuthTokenUpdate = AuthTokenUpdate;
})(Component = Communications.Component || (Communications.Component = {}));
})(Communications = Apps.Communications || (Apps.Communications = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"w_authtokenupdate.js","sourceRoot":"","sources":["w_authtokenupdate.ts"],"names":[],"mappings":"AACA,IAAU,OAAO,CAsFhB;AAtFD,WAAU,OAAO;IACb,IAAiB,IAAI,CAoFpB;IApFD,WAAiB,IAAI;QACjB,IAAiB,cAAc,CAkF9B;QAlFD,WAAiB,cAAc;YAC3B,IAAiB,SAAS,CAgFzB;YAhFD,WAAiB,SAAS;gBAEtB,MAAa,eAAgB,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa;oBAGpE,QAAQ;wBACJ,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,OAAO;wBACH,OAAO,CAAC,qDAAqD,EAAE,kDAAkD,CAAC,CAAC;oBACvH,CAAC;oBACD,IAAI,CAAC,EAAO,EAAE,WAAmB;wBAE7B,IAAI,IAAI,GAAG,EAAE,CAAC;wBACd,OAAO,IAAI,CAAC;oBAChB,CAAC;oBACD,IAAI,CAAC,EAAO,EAAE,WAAmB,EAAE,QAAQ;oBAK3C,CAAC;oBACD,IAAI;wBACA,IAAI,CAAC,MAAM,EAAE,CAAC;wBACd,CAAC,CAAC,qBAAqB,CAAC,CAAC,KAAK,CAAC;4BAE3B,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,eAAe,EAAE,CAAC;wBACvF,CAAC,CAAC,CAAC;oBAGP,CAAC;oBACD,MAAM;wBACF,IAAI,eAAe,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;wBAC7D,CAAC,CAAC,qBAAqB,GAAG,eAAe,CAAC,CAAC,KAAK,EAAE,CAAC;wBAEnD,IAAI,IAAI,GAAG;;;;;;;;WAQxB,CAAC;wBAEY,CAAC,CAAC,qBAAqB,GAAG,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;oBAE5D,CAAC;oBACD,eAAe;wBAIX,IAAI,QAAQ,GAAG,IAAI,CAAC;wBACpB,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,kDAAkD,EAAE;4BAGpF,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,UAAU,QAAQ;gCAOlG,aAAa,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC,CAAC;4BAE5F,CAAC,CAAC,CAAC;wBACP,CAAC,CAAC,CAAC;oBAEP,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;yBACzC;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBAEJ;gBA5EY,yBAAe,kBA4E3B,CAAA;YAEL,CAAC,EAhFgB,SAAS,GAAT,wBAAS,KAAT,wBAAS,QAgFzB;QACL,CAAC,EAlFgB,cAAc,GAAd,mBAAc,KAAd,mBAAc,QAkF9B;IACL,CAAC,EApFgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAoFpB;AACL,CAAC,EAtFS,OAAO,KAAP,OAAO,QAsFhB"}
+9
View File
@@ -0,0 +1,9 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseComponent{cssFiles(){return[]}jsFiles(){return["apps/communications/components/w_authtokenupdate.js","apps/communications/managers/authtokenmanager.js"]}html(){return``}load(){}init(){this.render();$("#BtnUpdateAuthtoken").click(function(){n.Apps.Communications.Component.AuthTokenUpdate.Instance().updateAuthtoken()})}render(){var n=Number($("#hf_PortletWidgetId").val());$(".div_portletwidget_"+n).empty();let t=`<div class="card shadow-hover">
<div class="card-header card-header-action bg-light bg-gradient-light"><strong>Update Auth Token</strong></div>
<div class="card-body">
<div id="divUpdateAuthToken" class="wrapper text-center bg-success card-header">
<a id="BtnUpdateAuthtoken" href="javascript:;"><span class="h4">Update Authentication Token</span></a>
</div>
</div>
</div>`;$(".div_portletwidget_"+n).append(t)}updateAuthtoken(){var t=this;t.fileCacheHelper.loadJsFile("apps/communications/managers/authtokenmanager.js",function(){n.Apps.Communications.Managers.AuthTokenManager.Instance().updateAuthToken().then(function(n){MessageHelper.Instance().showSuccess(n.message,"Unibase_ValidationSummary")})})}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.AuthTokenUpdate=i})(i=t.Component||(t.Component={}))})(i=t.Communications||(t.Communications={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -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 = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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":"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"}
+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={}));
@@ -0,0 +1 @@
{"version":3,"file":"igallerymanager.js","sourceRoot":"","sources":["igallerymanager.ts"],"names":[],"mappings":""}
@@ -0,0 +1,101 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Communications;
(function (Communications) {
let Events;
(function (Events) {
let Managers;
(function (Managers) {
class GalleryManager extends Unibase.Platform.Core.BaseManager {
changephotplike(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/communications/events/likedphoto';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getGuestUsers() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/communications/events/getguestusers';
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
shareImage(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/communications/events/sharedphotos';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
predictedImages() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/integrations/image/predict';
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
eventWisePredictedImages(eventId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/integrations/image/eventwisepredict/eventid/' + eventId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getLikesbyPhoto(photoid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/bizgaze/communications/events/getlikesbyphoto/photoid' + photoid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
approvedImage(DocumentFileId, statusid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/bizgaze/communications/events/approvedImage/statusid/' + statusid + '/documentfileid/' + DocumentFileId;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
return response;
});
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new GalleryManager();
return this._instance;
}
}
Managers.GalleryManager = GalleryManager;
})(Managers = Events.Managers || (Events.Managers = {}));
})(Events = Communications.Events || (Communications.Events = {}));
})(Communications = Apps.Communications || (Apps.Communications = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"gallerymanager.js","sourceRoot":"","sources":["gallerymanager.ts"],"names":[],"mappings":"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"}
+1
View File
@@ -0,0 +1 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Bizgaze;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t extends Unibase.Platform.Core.BaseManager{changephotplike(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/bizgaze/communications/events/likedphoto",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getGuestUsers(){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().getAsync("apis/v4/bizgaze/communications/events/getguestusers").then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}shareImage(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/bizgaze/communications/events/sharedphotos",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}predictedImages(){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().getAsync("apis/v4/bizgaze/integrations/image/predict").then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}eventWisePredictedImages(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/bizgaze/integrations/image/eventwisepredict/eventid/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getLikesbyPhoto(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/bizgaze/communications/events/getlikesbyphoto/photoid"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}approvedImage(n,t){return __awaiter(this,void 0,void 0,function*(){const i="apis/v4/bizgaze/communications/events/approvedImage/statusid/"+t+"/documentfileid/"+n;return yield this.dataHelper().postAsync(i,null).then(function(n){return n})})}static Instance(){return this._instance===undefined&&(this._instance=new t),this._instance}}n.GalleryManager=t})(t=n.Managers||(n.Managers={}))})(t=n.Events||(n.Events={}))})(t=n.Communications||(n.Communications={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));
@@ -0,0 +1,731 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Communications;
(function (Communications) {
let Ivr;
(function (Ivr_1) {
let Components;
(function (Components) {
class Ivr extends Unibase.Platform.Core.BaseComponent {
constructor() {
super();
this.pageIndex = 0;
}
loadForm(FormId, Pk_Value, AppConfigurationId, Callback, PortletWidgetId) {
throw new Error("Method not implemented.");
}
jsFiles() {
return ["apps/communications/ivr/managers/ivrmanager.js", "platform/dataapis/managers/dataapimanager.js", "libs/jquery/pagination/jquery.pagination.js", "/DataTables/datatables.js"];
}
cssFiles() {
let css = `.pagination li:hover{
cursor: pointer;
}`;
return [css];
}
html() {
var html = '';
return html;
}
loadhtml(Containerid) {
var html = `<div></div><div style="background-color:#FFFFFF;"><br>&nbsp&nbsp<label for="fromDate"><b>FromDate</b></label> <input type="datetime-local" id="fromDate" name="fromDate">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <label for="toDate"><b>ToDate</b></label> <input type="datetime-local" id="toDate" name="toDate">&nbsp&nbsp&nbsp&nbsp<input type="text" id="txtsearchnumber" placeholder="search" data-type="number"/>&nbsp&nbsp&nbsp<button class="btn btn-sm btn-datesearch" id="search" ><b>Apply</b></button><br></div><div><table id="logData" class="table table-bordered"><thead style="background-color:#FFFFFF;"><tr><th><b>Date</b></th><th><b>Caller</b></th><th><b>Click To Call</b></th><th><b>SR number</b></th><th><b>Action</b></th><th><b>Duration</b><br></th><th><b>Recordings</b></th><th><b>Credits</b></th></tr></thead><tbody style="background-color:#FFFFFF;"> </tbody></table></div><div><label>Total Count:</label><span id="spancount"></span><div class="pull-right"><button class="btn btn-sm btn-prevbutton" id="prevbutton" >Previous</button>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<button class="btn btn-sm btn-nxtbutton" id="nxtbutton">Next</button></div></div>`;
$("." + Containerid).html(html);
}
init(Containerid) {
let recordingurl;
let url = [];
let responseuuidobj;
let callernumber;
let responseobjectarr = [];
let uuidarr = [];
let index = 1;
let refindex = 0;
let fromsearch = 0;
var prevstatus = false;
var nxtstatus = false;
let count = 0;
let arrfromsearch = [];
let arrfromsearchlength = 0;
let arrtosearch = [];
let noofrows = 8;
var jsfiles = ["apps/communications/ivr/managers/ivrmanager.js", "platform/dataapis/managers/dataapimanager.js", "libs/jquery/pagination/jquery.pagination.js"];
Ivr.Instance().fileCacheHelper.loadJsFiles(jsfiles, function () {
Ivr.Instance().loadhtml(Containerid);
Ivr.Instance().cssFiles();
loadinandout();
Bizgaze.Apps.Communications.Ivr.Managers.IvrManager.Instance().getcalllogs().then(function (response) {
$("#logData tbody").append('');
if (response != null) {
var responseobj = response.objects;
for (var i = 0; i < responseobj.length; i++) {
responseobjectarr.push(responseobj[i]);
loaduuid(responseobj[i].uuid);
}
}
});
function loaduuid(uuid) {
Bizgaze.Apps.Communications.Ivr.Managers.IvrManager.Instance().getdetailedcalllogs(uuid).then(function (responseuuid) {
responseuuidobj = responseuuid.message;
callernumber = JSON.parse(responseuuidobj).caller;
uuidarr.push(callernumber);
if (responseobjectarr.length == uuidarr.length) {
$("#prevbutton").prop('disabled', true);
loadinandout();
}
});
}
function loadinandout() {
url = [];
$("#logData tbody").html(' ');
index = 1;
count = 0;
if (nxtstatus == true) {
arrtosearch.push(fromsearch);
}
for (var i = fromsearch; i < responseobjectarr.length; i++) {
if (count == 0 && prevstatus == false && nxtstatus == false) {
arrfromsearch.push(fromsearch);
}
let dynamicTR = "<tr>";
dynamicTR = dynamicTR + "<td>" + "incoming " + "<br>" + responseobjectarr[i].start_time + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].customer_number + "</td>";
dynamicTR = dynamicTR + "<td>" + "<a><button class='btn btn-sm btn-call'> Click To Call </button></a>" + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].destination + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].business_call_type + "</td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + "<td>" + "Missed Call" + "</td>";
}
else {
if (responseobjectarr[i].call_duration < 60) {
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + " seconds" + "</td>";
}
else {
var rem = responseobjectarr[i].call_duration % 60;
var quo = responseobjectarr[i].call_duration / 60;
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + quo + " minutes" + rem + " seconds" + "</td>";
}
}
dynamicTR = dynamicTR + "<td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + '<i class="fa fa - download" aria-hidden="true">';
}
else {
dynamicTR = dynamicTR + '<a href="' + recordingurl + '"><button class= "btn"><i class="fa fa-download" aria-hidden="true"></i></button >';
}
dynamicTR = dynamicTR + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].credits_deducted + "</td>";
dynamicTR = dynamicTR + "</tr>";
$("#logData tbody").append(dynamicTR);
index++;
count++;
if (fromsearch == 0) {
$("#prevbutton").prop('disabled', true);
}
if (count == noofrows) {
if (nxtstatus == false) {
arrfromsearch.push(fromsearch);
}
break;
}
dynamicTR = "<tr>";
dynamicTR = dynamicTR + "<td>" + "outgoing " + "<br>" + responseobjectarr[i].start_time + "</td>";
dynamicTR = dynamicTR + "<td>" + uuidarr[i] + "</td>";
dynamicTR = dynamicTR + "<td>" + "<a><button class='btn btn-sm btn-call'> Click To Call</button></a>" + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].destination + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].business_call_type + "</td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + "<td>" + "Missed Call" + "</td>";
}
else {
if (responseobjectarr[i].call_duration < 60) {
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + " seconds" + "</td>";
}
else {
var rem = responseobjectarr[i].call_duration % 60;
var quo = responseobjectarr[i].call_duration / 60;
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + quo + " minutes" + rem + " seconds" + "</td>";
}
}
dynamicTR = dynamicTR + "<td>";
if (recordingurl == "") {
dynamicTR = dynamicTR + '<i class="fa fa - download" aria-hidden="true">';
}
else {
dynamicTR = dynamicTR + '<a href="' + recordingurl + '"><button class= "btn"><i class="fa fa-download" aria-hidden="true"></i></button >';
}
dynamicTR = dynamicTR + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].credits_deducted + "</td>";
dynamicTR = dynamicTR + "</tr>";
$("#logData tbody").append(dynamicTR);
index++;
count++;
if (fromsearch == 0) {
$("#prevbutton").prop('disabled', true);
}
if (i + 1 == responseobjectarr.length) {
$("#nxtbutton").prop('disabled', true);
}
if (prevstatus == true) {
fromsearch--;
}
else if (nxtstatus == true) {
fromsearch++;
}
else {
fromsearch++;
}
if (i == responseobjectarr.length - 1) {
arrfromsearch.push(fromsearch);
}
else if (count == noofrows) {
if (prevstatus == false) {
arrfromsearch.push(fromsearch);
}
break;
}
}
$('#logData').on('click', '.btn-call', function () {
var currentRow = $(this).closest("tr");
var currentphoneno = currentRow.find("td:eq(1)").html();
var knowlarityno = currentRow.find("td:eq(3)").html();
var callerid = "+91xxxxxxxxxx";
Bizgaze.Apps.Communications.Ivr.Managers.IvrManager.Instance().Makeacall(knowlarityno, knowlarityno, currentphoneno, callerid).then(function (makecall) {
alert(makecall);
});
});
$('#spancount').text(2 * responseobjectarr.length);
}
function search() {
$('#spancount').text("");
url = [];
$("#logData tbody").html(' ');
index = 1;
var fromdate;
var fromtime;
var todate;
var totime;
var tempfromdate = $('#fromDate').val();
var temptodate = $('#toDate').val();
var searchnumber = $('#txtsearchnumber').val();
let count = 0;
fromdate = tempfromdate.toString().split('T')[0];
fromtime = tempfromdate.toString().split('T')[1];
var fromdatetime = new Date(fromdate + " " + fromtime);
todate = temptodate.toString().split('T')[0];
totime = temptodate.toString().split('T')[1];
var todatetime = new Date(todate + " " + totime);
if (new Date(fromdatetime).getTime() > new Date(todatetime).getTime()) {
bootbox.alert("From Date Must be less Than To Date");
}
else {
if (nxtstatus == true) {
arrtosearch.push(fromsearch);
}
for (var i = fromsearch; i < responseobjectarr.length; i++) {
if (fromsearch == 0) {
$("#prevbutton").prop('disabled', true);
}
if (i + 1 == responseobjectarr.length) {
$("#nxtbutton").prop('disabled', true);
}
if (tempfromdate == "" && temptodate == "" && searchnumber == "") {
loadinandout();
break;
}
else if (tempfromdate == "" || temptodate == "") {
if (searchnumber == "") {
loadinandout();
break;
}
else {
if (count == 0 && prevstatus == false && nxtstatus == false) {
arrfromsearch.push(fromsearch);
}
if (searchnumber == responseobjectarr[i].customer_number || responseobjectarr[i].customer_number.includes(searchnumber) || searchnumber == responseobjectarr[i].destination || responseobjectarr[i].destination.includes(searchnumber)) {
let dynamicTR = "<tr>";
dynamicTR = dynamicTR + "<td>" + "incoming " + "<br>" + responseobjectarr[i].start_time + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].customer_number + "</td>";
dynamicTR = dynamicTR + "<td>" + "<a><button class='btn btn-sm btn-call'> Click To Call </button></a>" + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].destination + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].business_call_type + "</td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + "<td>" + "Missed Call" + "</td>";
}
else {
if (responseobjectarr[i].call_duration < 60) {
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + " seconds" + "</td>";
}
else {
var rem = responseobjectarr[i].call_duration % 60;
var quo = responseobjectarr[i].call_duration / 60;
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + quo + " minutes" + rem + " seconds" + "</td>";
}
}
dynamicTR = dynamicTR + "<td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + '<i class="fa fa - download" aria-hidden="true">';
}
else {
dynamicTR = dynamicTR + '<a href="' + recordingurl + '"><button class= "btn"><i class="fa fa-download" aria-hidden="true"></i></button >';
}
dynamicTR = dynamicTR + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].credits_deducted + "</td>";
dynamicTR = dynamicTR + "</tr>";
$("#logData tbody").append(dynamicTR);
index++;
count++;
}
if (count == noofrows) {
if (prevstatus == false) {
arrfromsearch.push(fromsearch);
}
break;
}
if (searchnumber == uuidarr[i] || uuidarr[i].includes(searchnumber) || searchnumber == responseobjectarr[i].destination || responseobjectarr[i].destination.includes(searchnumber)) {
let dynamicTR = "<tr>";
dynamicTR = dynamicTR + "<td>" + "outgoing " + "<br>" + responseobjectarr[i].start_time + "</td>";
dynamicTR = dynamicTR + "<td>" + uuidarr[i] + "</td>";
dynamicTR = dynamicTR + "<td>" + "<a><button class='btn btn-sm btn-call'> Click To Call</button></a>" + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].destination + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].business_call_type + "</td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + "<td>" + "Missed Call" + "</td>";
}
else {
if (responseobjectarr[i].call_duration < 60) {
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + " seconds" + "</td>";
}
else {
var rem = responseobjectarr[i].call_duration % 60;
var quo = responseobjectarr[i].call_duration / 60;
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + quo + " minutes" + rem + " seconds" + "</td>";
}
}
dynamicTR = dynamicTR + "<td>";
if (recordingurl == "") {
dynamicTR = dynamicTR + '<i class="fa fa - download" aria-hidden="true">';
}
else {
dynamicTR = dynamicTR + '<a href="' + recordingurl + '"><button class= "btn"><i class="fa fa-download" aria-hidden="true"></i></button >';
}
dynamicTR = dynamicTR + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].credits_deducted + "</td>";
dynamicTR = dynamicTR + "</tr>";
$("#logData tbody").append(dynamicTR);
index++;
count++;
}
}
if (prevstatus == true) {
fromsearch--;
}
else if (nxtstatus == true) {
fromsearch++;
}
else {
fromsearch++;
}
if (i == responseobjectarr.length - 1) {
arrfromsearch.push(fromsearch);
}
else if (count == noofrows) {
if (prevstatus == false) {
arrfromsearch.push(fromsearch);
}
break;
}
}
else if (tempfromdate != "" || temptodate != "") {
if (count == 0 && prevstatus == false && nxtstatus == false) {
arrfromsearch.push(fromsearch);
}
if (searchnumber == "") {
if (new Date(responseobjectarr[i].start_time).getTime() >= new Date(fromdatetime).getTime() && new Date(responseobjectarr[i].start_time).getTime() <= new Date(todatetime).getTime()) {
let dynamicTR = "<tr>";
dynamicTR = dynamicTR + "<td>" + "incoming " + "<br>" + responseobjectarr[i].start_time + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].customer_number + "</td>";
dynamicTR = dynamicTR + "<td>" + "<a><button class='btn btn-sm btn-call'> Click To Call </button></a>" + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].destination + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].business_call_type + "</td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + "<td>" + "Missed Call" + "</td>";
}
else {
if (responseobjectarr[i].call_duration < 60) {
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + " seconds" + "</td>";
}
else {
var rem = responseobjectarr[i].call_duration % 60;
var quo = responseobjectarr[i].call_duration / 60;
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + quo + " minutes" + rem + " seconds" + "</td>";
}
}
dynamicTR = dynamicTR + "<td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + '<i class="fa fa - download" aria-hidden="true">';
}
else {
dynamicTR = dynamicTR + '<a href="' + recordingurl + '"><button class= "btn"><i class="fa fa-download" aria-hidden="true"></i></button >';
}
dynamicTR = dynamicTR + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].credits_deducted + "</td>";
dynamicTR = dynamicTR + "</tr>";
$("#logData tbody").append(dynamicTR);
index++;
count++;
}
if (count == noofrows) {
if (prevstatus == true) {
arrfromsearch.pop();
}
else if (prevstatus == false) {
arrfromsearch.push(fromsearch);
}
break;
}
if (new Date(responseobjectarr[i].start_time).getTime() >= new Date(fromdatetime).getTime() && new Date(responseobjectarr[i].start_time).getTime() <= new Date(todatetime).getTime()) {
let dynamicTR = "<tr>";
dynamicTR = dynamicTR + "<td>" + "outgoing " + "<br>" + responseobjectarr[i].start_time + "</td>";
dynamicTR = dynamicTR + "<td>" + uuidarr[i] + "</td>";
dynamicTR = dynamicTR + "<td>" + "<a ><button class='btn btn-sm btn-call'> Click To Call</button></a>" + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].destination + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].business_call_type + "</td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + "<td>" + "Missed Call" + "</td>";
}
else {
if (responseobjectarr[i].call_duration < 60) {
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + " seconds" + "</td>";
}
else {
var rem = responseobjectarr[i].call_duration % 60;
var quo = responseobjectarr[i].call_duration / 60;
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + quo + " minutes" + rem + " seconds" + "</td>";
}
}
dynamicTR = dynamicTR + "<td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + '<i class="fa fa - download" aria-hidden="true">';
}
else {
dynamicTR = dynamicTR + '<a href="' + recordingurl + '"><button class= "btn"><i class="fa fa-download" aria-hidden="true"></i></button >';
}
dynamicTR = dynamicTR + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].credits_deducted + "</td>";
dynamicTR = dynamicTR + "</tr>";
$("#logData tbody").append(dynamicTR);
index++;
count++;
}
if (prevstatus == true) {
fromsearch--;
}
else if (nxtstatus == true) {
fromsearch++;
}
else {
fromsearch++;
}
if (i == responseobjectarr.length - 1) {
arrfromsearch.push(fromsearch);
}
else if (count == noofrows) {
if (prevstatus == false) {
arrfromsearch.push(fromsearch);
}
break;
}
}
else {
if (new Date(responseobjectarr[i].start_time).getTime() >= new Date(fromdatetime).getTime() && new Date(responseobjectarr[i].start_time).getTime() <= new Date(todatetime).getTime()) {
if (searchnumber == responseobjectarr[i].customer_number || responseobjectarr[i].customer_number.includes(searchnumber) || searchnumber == responseobjectarr[i].destination || responseobjectarr[i].destination.includes(searchnumber)) {
let dynamicTR = "<tr>";
dynamicTR = dynamicTR + "<td>" + "incoming " + "<br>" + responseobjectarr[i].start_time + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].customer_number + "</td>";
dynamicTR = dynamicTR + "<td>" + "<a><button class='btn btn-sm btn-call'> Click To Call </button></a>" + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].destination + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].business_call_type + "</td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + "<td>" + "Missed Call" + "</td>";
}
else {
if (responseobjectarr[i].call_duration < 60) {
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + " seconds" + "</td>";
}
else {
var rem = responseobjectarr[i].call_duration % 60;
var quo = responseobjectarr[i].call_duration / 60;
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + quo + " minutes" + rem + " seconds" + "</td>";
}
}
dynamicTR = dynamicTR + "<td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + '<i class="fa fa - download" aria-hidden="true">';
}
else {
dynamicTR = dynamicTR + '<a href="' + recordingurl + '"><button class= "btn"><i class="fa fa-download" aria-hidden="true"></i></button >';
}
dynamicTR = dynamicTR + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].credits_deducted + "</td>";
dynamicTR = dynamicTR + "</tr>";
$("#logData tbody").append(dynamicTR);
index++;
count++;
}
if (i == responseobjectarr.length - 1) {
arrfromsearch.push(fromsearch);
}
else if (count == noofrows) {
if (prevstatus == false) {
arrfromsearch.push(fromsearch);
}
break;
}
if (searchnumber == uuidarr[i] || uuidarr[i].includes(searchnumber) || searchnumber == responseobjectarr[i].destination || responseobjectarr[i].destination.includes(searchnumber)) {
let dynamicTR = "<tr>";
dynamicTR = dynamicTR + "<td>" + "outgoing " + "<br>" + responseobjectarr[i].start_time + "</td>";
dynamicTR = dynamicTR + "<td>" + uuidarr[i] + "</td>";
dynamicTR = dynamicTR + "<td>" + "<a href='" + recordingurl + "'><button class='btn btn-sm btn-call'> Click To Call</button></a>" + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].destination + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].business_call_type + "</td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + "<td>" + "Missed Call" + "</td>";
}
else {
if (responseobjectarr[i].call_duration < 60) {
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + " seconds" + "</td>";
}
else {
var rem = responseobjectarr[i].call_duration % 60;
var quo = responseobjectarr[i].call_duration / 60;
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].call_duration + quo + " minutes" + rem + " seconds" + "</td>";
}
}
dynamicTR = dynamicTR + "<td>";
recordingurl = responseobjectarr[i].call_recording;
if (recordingurl == "") {
dynamicTR = dynamicTR + '<i class="fa fa - download" aria-hidden="true">';
}
else {
dynamicTR = dynamicTR + '<a href="' + recordingurl + '"><button class= "btn"><i class="fa fa-download" aria-hidden="true"></i></button >';
}
dynamicTR = dynamicTR + "</td>";
dynamicTR = dynamicTR + "<td>" + responseobjectarr[i].credits_deducted + "</td>";
dynamicTR = dynamicTR + "</tr>";
$("#logData tbody").append(dynamicTR);
index++;
count++;
}
if (prevstatus == true) {
fromsearch--;
}
else if (nxtstatus == true) {
fromsearch++;
}
else {
fromsearch++;
}
if (i == responseobjectarr.length - 1) {
arrfromsearch.push(fromsearch);
}
else if (count == noofrows) {
if (prevstatus == false) {
arrfromsearch.push(fromsearch);
}
break;
}
}
}
}
$('#getcount').text(index - 1);
}
$('#logData').on('click', '.btn-call', function () {
var currentRow = $(this).closest("tr");
var currentphoneno = currentRow.find("td:eq(1)").html();
var knowlarityno = currentRow.find("td:eq(3)").html();
var callerid = "+91xxxxxxxxxx";
Bizgaze.Apps.Communications.Ivr.Managers.IvrManager.Instance().Makeacall(knowlarityno, knowlarityno, currentphoneno, callerid).then(function (makecall) {
alert(makecall);
});
});
}
}
$('#search').click(function () {
$("#nxtbutton").prop('disabled', false);
$("#prevbutton").prop('disabled', false);
arrfromsearchlength = 0;
fromsearch = 0;
refindex = 0;
prevstatus = false;
nxtstatus = false;
arrfromsearch = [];
arrtosearch = [];
count = 0;
search();
});
$("#txtsearchnumber").keydown(function () {
$("#nxtbutton").prop('disabled', false);
$("#prevbutton").prop('disabled', false);
arrfromsearchlength = 0;
fromsearch = 0;
refindex = 0;
prevstatus = false;
nxtstatus = false;
arrfromsearch = [];
arrtosearch = [];
search();
});
$("#txtsearchnumber").keyup(function () {
$("#nxtbutton").prop('disabled', false);
$("#prevbutton").prop('disabled', false);
arrfromsearchlength = 0;
fromsearch = 0;
refindex = 0;
prevstatus = false;
nxtstatus = false;
arrfromsearch = [];
arrtosearch = [];
search();
});
$('#prevbutton').click(function () {
$("#nxtbutton").prop('disabled', false);
if (refindex != 0) {
arrfromsearchlength--;
}
nxtstatus = false;
prevstatus = true;
var tempfromdate = $('#fromDate').val();
var temptodate = $('#toDate').val();
var searchnumber = $('#txtsearchnumber').val();
if (tempfromdate == "" && temptodate == "" && searchnumber == "") {
if (refindex == 0) {
$("#prevbutton").prop('disabled', true);
}
else if (refindex != 0) {
refindex = refindex - 1;
arrfromsearch.pop();
fromsearch = arrfromsearch[arrfromsearch.length - 2];
loadinandout();
}
}
else if (tempfromdate == "" || temptodate == "") {
if (searchnumber == "") {
if (refindex == 0) {
$("#prevbutton").prop('disabled', true);
fromsearch = 0;
loadinandout();
}
else if (refindex != 0) {
refindex = refindex - 1;
arrfromsearch.pop();
fromsearch = arrfromsearch[arrfromsearch.length - 2];
loadinandout();
}
}
else {
if (refindex != 0) {
refindex = refindex - 1;
arrfromsearch.pop();
fromsearch = arrfromsearch[arrfromsearch.length - 2];
search();
}
}
}
else {
if (refindex != 0) {
refindex = refindex - 1;
arrfromsearch.pop();
fromsearch = arrfromsearch[arrfromsearch.length - 2];
search();
}
}
});
$('#nxtbutton').click(function () {
$("#prevbutton").prop('disabled', false);
count = 0;
if (fromsearch < responseobjectarr.length) {
$("#nxtbutton").prop('disabled', false);
arrfromsearchlength++;
prevstatus = false;
nxtstatus = true;
var tempfromdate = $('#fromDate').val();
var temptodate = $('#toDate').val();
var searchnumber = $('#txtsearchnumber').val();
if (tempfromdate == "" && temptodate == "" && searchnumber == "") {
refindex += 1;
if (arrtosearch.length == 0) {
fromsearch = fromsearch;
}
else {
fromsearch = arrfromsearch[arrfromsearch.length - 1];
}
loadinandout();
}
else if (tempfromdate == "" || temptodate == "") {
if (searchnumber == "") {
if (arrtosearch.length == 0) {
fromsearch = fromsearch;
}
else {
fromsearch = arrfromsearch[arrfromsearch.length - 1];
}
}
else {
refindex += 1;
if (arrtosearch.length == 0) {
fromsearch = fromsearch;
}
else {
fromsearch = arrfromsearch[arrfromsearch.length - 1];
}
search();
}
}
else {
refindex += 1;
if (arrtosearch.length == 0) {
fromsearch = fromsearch;
search();
}
else {
fromsearch = arrfromsearch[arrfromsearch.length - 1];
search();
}
}
}
else {
$("#nxtbutton").prop('disabled', true);
}
});
});
}
load(id, containerid, callback) {
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Ivr();
}
return this.instance;
}
}
Components.Ivr = Ivr;
})(Components = Ivr_1.Components || (Ivr_1.Components = {}));
})(Ivr = Communications.Ivr || (Communications.Ivr = {}));
})(Communications = Apps.Communications || (Apps.Communications = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1,75 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Communications;
(function (Communications) {
let Ivr;
(function (Ivr) {
let Managers;
(function (Managers) {
class IvrManager extends Unibase.Platform.Core.BaseManager {
Makeacall(knumber, agentnumber, customernumber, callerid) {
return __awaiter(this, void 0, void 0, function* () {
var obj = {
"k_number": knumber,
"agent_number": agentnumber,
"customer_number": customernumber,
"caller_id": callerid
};
const url = 'apis/v4/bizgaze/integrations/ivr/makeacall';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result != null) {
response.result = JSON.parse(response.result);
}
return response;
});
});
}
getcalllogs() {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/bizgaze/integrations/ivr/getcalllog/call_type/1';
return yield this.dataHelper().getAsync(url).then(function (response) {
var obj;
if (response.result != null) {
obj = JSON.parse(response.result);
}
return obj;
});
});
}
getdetailedcalllogs(uuid) {
return __awaiter(this, void 0, void 0, function* () {
let arr = [];
var obj;
const url = 'apis/v4/bizgaze/integrations/ivr/getdetailedcalllog/uuid/' + uuid;
return yield this.dataHelper().getAsync(url).then(function (responseuuid) {
if (responseuuid.result != null) {
obj = JSON.parse(responseuuid.result);
}
return obj;
});
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new IvrManager();
return this._instance;
}
}
Managers.IvrManager = IvrManager;
})(Managers = Ivr.Managers || (Ivr.Managers = {}));
})(Ivr = Communications.Ivr || (Communications.Ivr = {}));
})(Communications = Apps.Communications || (Apps.Communications = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"ivrmanager.js","sourceRoot":"","sources":["ivrmanager.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAU,OAAO,CAmEhB;AAnED,WAAU,OAAO;IACb,IAAiB,IAAI,CAiEpB;IAjED,WAAiB,IAAI;QACjB,IAAiB,cAAc,CA+D9B;QA/DD,WAAiB,cAAc;YAC3B,IAAiB,GAAG,CA6DnB;YA7DD,WAAiB,GAAG;gBAChB,IAAiB,QAAQ,CA2DxB;gBA3DD,WAAiB,QAAQ;oBACrB,MAAa,UAAW,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW;wBAIvD,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ;;gCAE1D,IAAI,GAAG,GAAG;oCACN,UAAU,EAAE,OAAO;oCACnB,cAAc,EAAE,WAAW;oCAC3B,iBAAiB,EAAE,cAAc;oCACjC,WAAW,EAAE,QAAQ;iCACxB,CAAA;gCACD,MAAM,GAAG,GAAG,4CAA4C,CAAC;gCACzD,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;oCAEtE,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE;wCACzB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;qCACjD;oCACD,OAAO,QAAQ,CAAC;gCACpB,CAAC,CAAC,CAAC;4BACP,CAAC;yBAAA;wBAGK,WAAW;;gCACb,QAAQ,CAAC;gCACT,MAAM,GAAG,GAAG,yDAAyD,CAAC;gCACtE,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;oCAChE,IAAI,GAAG,CAAC;oCACR,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE;wCACzB,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;qCACrC;oCACD,OAAO,GAAG,CAAC;gCAEf,CAAC,CAAC,CAAC;4BACP,CAAC;yBAAA;wBACK,mBAAmB,CAAC,IAAI;;gCAC1B,IAAI,GAAG,GAAG,EAAE,CAAC;gCACb,IAAI,GAAG,CAAC;gCAER,MAAM,GAAG,GAAG,2DAA2D,GAAG,IAAI,CAAC;gCAC/E,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,YAAY;oCAEpE,IAAI,YAAY,CAAC,MAAM,IAAI,IAAI,EAAE;wCAC7B,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;qCAEzC;oCACD,OAAO,GAAG,CAAC;gCACf,CAAC,CAAC,CAAC;4BAEP,CAAC;yBAAA;wBAGD,MAAM,CAAC,QAAQ;4BACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;gCAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,EAAE,CAAC;4BACtC,OAAO,IAAI,CAAC,SAAS,CAAC;wBAC1B,CAAC;qBACJ;oBAzDY,mBAAU,aAyDtB,CAAA;gBACL,CAAC,EA3DgB,QAAQ,GAAR,YAAQ,KAAR,YAAQ,QA2DxB;YACL,CAAC,EA7DgB,GAAG,GAAH,kBAAG,KAAH,kBAAG,QA6DnB;QACL,CAAC,EA/DgB,cAAc,GAAd,mBAAc,KAAd,mBAAc,QA+D9B;IACL,CAAC,EAjEgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAiEpB;AACL,CAAC,EAnES,OAAO,KAAP,OAAO,QAmEhB"}
@@ -0,0 +1,39 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Communications;
(function (Communications) {
let Managers;
(function (Managers) {
class AuthTokenManager extends Unibase.Platform.Core.BaseManager {
updateAuthToken() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/common/updateauthtoken/np';
return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new AuthTokenManager();
return this._instance;
}
}
Managers.AuthTokenManager = AuthTokenManager;
})(Managers = Communications.Managers || (Communications.Managers = {}));
})(Communications = Apps.Communications || (Apps.Communications = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"authtokenmanager.js","sourceRoot":"","sources":["authtokenmanager.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAU,OAAO,CAwBhB;AAxBD,WAAU,OAAO;IACb,IAAiB,IAAI,CAsBpB;IAtBD,WAAiB,IAAI;QACjB,IAAiB,cAAc,CAoB9B;QApBD,WAAiB,cAAc;YAC3B,IAAiB,QAAQ,CAkBxB;YAlBD,WAAiB,QAAQ;gBACrB,MAAa,gBAAiB,SAAQ,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW;oBACrD,eAAe;;4BACjB,MAAM,GAAG,GAAG,oDAAoD,CAAC;4BACjE,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;gCACvE,IAAI,QAAQ,CAAC,MAAM,KAAK,IAAI;oCACxB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gCAClD,OAAO,QAAQ,CAAC;4BACpB,CAAC,CAAC,CAAC;wBAEP,CAAC;qBAAA;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAC;wBAC5C,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBAhBY,yBAAgB,mBAgB5B,CAAA;YACL,CAAC,EAlBgB,QAAQ,GAAR,uBAAQ,KAAR,uBAAQ,QAkBxB;QACL,CAAC,EApBgB,cAAc,GAAd,mBAAc,KAAd,mBAAc,QAoB9B;IACL,CAAC,EAtBgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAsBpB;AACL,CAAC,EAxBS,OAAO,KAAP,OAAO,QAwBhB"}
+1
View File
@@ -0,0 +1 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseManager{updateAuthToken(){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/unibase/platform/common/updateauthtoken/np","{}").then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}static Instance(){return this._instance===undefined&&(this._instance=new i),this._instance}}t.AuthTokenManager=i})(i=t.Managers||(t.Managers={}))})(i=t.Communications||(t.Communications={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1 @@
{"version":3,"file":"iauthtokenmanager.js","sourceRoot":"","sources":["iauthtokenmanager.ts"],"names":[],"mappings":""}

Some files were not shown because too many files have changed in this diff Show More