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AI,GACxB,E","sources":["webpack:///./src/js/clientVault.js"],"sourcesContent":["////var app = app || {};\r\n////window.app = app; // expose for inline javascripts (kendo server wrappers)\r\n////app.cw = app.cw || {};\r\napp.cw.clientvault = app.cw.clientvault || {};\r\n\r\n$(function () {\r\n\t// submit form\r\n\t$(document.body).on('submit', '#cw_ajax_cv_uploader_form', function (e) {\r\n\t\tapp.cw.clientvault.onSubmitReload(e);\r\n\t});\r\n\r\n\t$(document.body).on('click', '.cw_cv_upload_new_version', function (e) {\r\n\t\te.preventDefault();\r\n\t\tconst $grid = $(e.currentTarget).closest('.k-grid').data('kendoGrid');\r\n\t\tconst dataItem = $grid.dataItem($(e.currentTarget).closest('tr'));\r\n\t\tapp.cw.common.PopupModal.show('Upload New Version - ' + dataItem.Name, '/ClientVault/DocumentList?handler=UploadVersionFormPartial&documentId=' + dataItem.Id + '&folderId=' + dataItem.FolderId);\r\n\t});\r\n\r\n\t$(document.body).on('click', '.cw_cv_download_version', function (e) {\r\n\t\te.preventDefault();\r\n\t\tconst url = $(this).data('url');\r\n\t\twindow.location.href = url;\r\n\t});\r\n\r\n\t$(document.body).on('click', '.cw_cv_version_history', function (e) {\r\n\t\te.preventDefault();\r\n\t\tconst $grid = $(e.currentTarget).closest('.k-grid').data('kendoGrid');\r\n\t\tconst dataItem = $grid.dataItem($(e.currentTarget).closest('tr'));\r\n\t\tapp.cw.common.PopupModal.show('Show Document Versions - ' + dataItem.Name, '/ClientVault/DocumentList?handler=DocumentVersionPartial&documentId=' + dataItem.Id);\r\n\t});\r\n\r\n\t$(document.body).on('click', '.cw_cv_upload_new', function (e) {\r\n\t\te.preventDefault();\r\n\t\t\r\n\t\tapp.cw.common.PopupModal.show('Upload File', '/ClientVault/DocumentList?handler=CreateDocumentUploadFormPartial');\r\n\t});\r\n\r\n\t$(document.body).on('click', '.cw_ajax_cv_edit_btn', function (e) {\r\n\t\te.preventDefault();\r\n\r\n\t\tapp.cw.clientvault.editDocument(e);\r\n\t});\r\n});\r\n\r\napp.cw.clientvault = {\r\n\teditDocument: function editDocument(e) {\r\n\t\te.preventDefault();\r\n\t\t// get data of the selected row in the grid\r\n\t\tconst grid = $(e.currentTarget).closest('.k-grid').data('kendoGrid');\r\n\t\tconst dataItem = grid.dataItem($(e.currentTarget).closest('tr'));\r\n\t\tapp.cw.common.PopupModal.show('Edit Uploaded File', '/ClientVault/DocumentList?handler=EditDocumentPartial&documentId=' + dataItem.Id);\r\n\t},\r\n\tfileTypeIcon: function fileTypeIcon(fileTypeId) {\r\n\t\tlet markup = '';\r\n\t\tlet iconCssClass;\r\n\t\tlet title;\r\n\r\n\t\tswitch (fileTypeId) {\r\n\t\t\tcase 1:\r\n\t\t\t\ticonCssClass = 'fa-file-excel';\r\n\t\t\t\ttitle = 'Excel';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\ticonCssClass = 'fa-file-word';\r\n\t\t\t\ttitle = 'Word';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\ticonCssClass = 'fa-file-pdf';\r\n\t\t\t\ttitle = 'PDF';\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\ticonCssClass = 'fa-file-alt';\r\n\t\t\t\ttitle = 'File';\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tmarkup += '';\r\n\r\n\t\treturn markup;\r\n\t},\r\n\tforgeryToken: function forgeryToken() {\r\n\t\treturn kendo.antiForgeryTokens();\r\n\t},\r\n\tonSubmitReload: function onSubmitReload(e) {\r\n\t\te.preventDefault();\r\n\t\t$.ajax({\r\n\t\t\ttype: 'POST',\r\n\t\t\turl: $('#cw_ajax_cv_uploader_form').prop('action'),\r\n\t\t\tdataType: 'json',\r\n\t\t\tdata: $('#cw_ajax_cv_uploader_form').serialize(),\r\n\t\t\tbeforeSend: function () {\r\n\t\t\t\tapp.cw.common.LoadingSpinner.show();\r\n\t\t\t},\r\n\t\t\tcomplete: function (result) {\r\n\t\t\t\tapp.cw.common.LoadingSpinner.hide();\r\n\t\t\t}\r\n\t\t}).done(function (result) {\r\n\t\t\tif (result.Error) {\r\n\t\t\t\tapp.cw.common.Notification.show('Upload Failed', result.Message, 'error'); // title, message, type\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tapp.cw.common.PopupModal.hide();\r\n\t\t\t\tapp.cw.common.Notification.show('Upload Succeeded', result.Message, 'success'); // title, message, type\r\n\r\n\t\t\t\t$('#Documents').data('kendoGrid').dataSource.read();\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\tonUploadSuccess: function onUploadSuccess(e) {\r\n\t\tif (e.response.tempFileName) {\r\n\t\t\t$('#TempFileName').val(e.response.tempFileName).trigger(\"change\");\r\n\t\t}\r\n\t},\r\n\tonUploadRemove: function onUploadRemove(e) {\r\n\t\te.data = {\r\n\t\t\ttempFileName: $('#TempFileName').val()\r\n\t\t};\r\n\t\t$('#TempFileName').val('');\r\n\t}\r\n};"],"names":["app","cw","clientvault","$","document","body","on","e","onSubmitReload","preventDefault","dataItem","currentTarget","closest","data","common","PopupModal","show","Name","Id","FolderId","url","this","window","location","href","editDocument","fileTypeIcon","fileTypeId","iconCssClass","title","markup","forgeryToken","kendo","antiForgeryTokens","ajax","type","prop","dataType","serialize","beforeSend","LoadingSpinner","complete","result","hide","done","Error","Notification","Message","dataSource","read","onUploadSuccess","response","tempFileName","val","trigger","onUploadRemove"],"sourceRoot":""}