From 32c0502999408a2828b99dd841b56784ee715740 Mon Sep 17 00:00:00 2001 From: Glenn Wilkinson Date: Wed, 24 Aug 2022 18:00:00 +0200 Subject: [PATCH] Minified missing sending_profile file (741201b) --- static/js/dist/app/sending_profiles.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/dist/app/sending_profiles.min.js b/static/js/dist/app/sending_profiles.min.js index a77d4135..df2b5809 100644 --- a/static/js/dist/app/sending_profiles.min.js +++ b/static/js/dist/app/sending_profiles.min.js @@ -1 +1 @@ -var profiles=[];function sendTestEmail(){var e=[];$.each($("#headersTable").DataTable().rows().data(),(function(a,o){e.push({key:unescapeHtml(o[0]),value:unescapeHtml(o[1])})}));var a={template:{},first_name:$("input[name=to_first_name]").val(),last_name:$("input[name=to_last_name]").val(),email:$("input[name=to_email]").val(),position:$("input[name=to_position]").val(),url:"",smtp:{from_address:$("#from").val(),host:$("#host").val(),username:$("#username").val(),password:$("#password").val(),ignore_cert_errors:$("#ignore_cert_errors").prop("checked"),headers:e}};btnHtml=$("#sendTestModalSubmit").html(),$("#sendTestModalSubmit").html(' Sending'),api.send_test_email(a).success((function(e){$("#sendTestEmailModal\\.flashes").empty().append('
\t Email Sent!
'),$("#sendTestModalSubmit").html(btnHtml)})).error((function(e){$("#sendTestEmailModal\\.flashes").empty().append('
\t '+escapeHtml(e.responseJSON.message)+"
"),$("#sendTestModalSubmit").html(btnHtml)}))}function save(e){var a={headers:[]};$.each($("#headersTable").DataTable().rows().data(),(function(e,o){a.headers.push({key:unescapeHtml(o[0]),value:unescapeHtml(o[1])})})),a.name=$("#name").val(),a.interface_type=$("#interface_type").val(),a.from_address=$("#from").val(),a.host=$("#host").val(),a.username=$("#username").val(),a.password=$("#password").val(),a.ignore_cert_errors=$("#ignore_cert_errors").prop("checked"),-1!=e?(a.id=profiles[e].id,api.SMTPId.put(a).success((function(e){successFlash("Profile edited successfully!"),load(),dismiss()})).error((function(e){modalError(e.responseJSON.message)}))):api.SMTP.post(a).success((function(e){successFlash("Profile added successfully!"),load(),dismiss()})).error((function(e){modalError(e.responseJSON.message)}))}function dismiss(){$("#modal\\.flashes").empty(),$("#name").val(""),$("#interface_type").val("SMTP"),$("#from").val(""),$("#host").val(""),$("#username").val(""),$("#password").val(""),$("#ignore_cert_errors").prop("checked",!0),$("#headersTable").dataTable().DataTable().clear().draw(),$("#modal").modal("hide")}var dismissSendTestEmailModal=function(){$("#sendTestEmailModal\\.flashes").empty(),$("#sendTestModalSubmit").html(" Send")},deleteProfile=function(e){Swal.fire({title:"Are you sure?",text:"This will delete the sending profile. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+escapeHtml(profiles[e].name),confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise((function(a,o){api.SMTPId.delete(profiles[e].id).success((function(e){a()})).error((function(e){o(e.responseJSON.message)}))}))}}).then((function(e){e.value&&Swal.fire("Sending Profile Deleted!","This sending profile has been deleted!","success"),$('button:contains("OK")').on("click",(function(){location.reload()}))}))};function edit(e){headers=$("#headersTable").dataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]}),$("#modalSubmit").unbind("click").click((function(){save(e)}));var a={};-1!=e?($("#profileModalLabel").text("Edit Sending Profile"),a=profiles[e],$("#name").val(a.name),$("#interface_type").val(a.interface_type),$("#from").val(a.from_address),$("#host").val(a.host),$("#username").val(a.username),$("#password").val(a.password),$("#ignore_cert_errors").prop("checked",a.ignore_cert_errors),$.each(a.headers,(function(e,a){addCustomHeader(a.key,a.value)}))):$("#profileModalLabel").text("New Sending Profile")}function copy(e){$("#modalSubmit").unbind("click").click((function(){save(-1)}));var a;a=profiles[e],$("#name").val("Copy of "+a.name),$("#interface_type").val(a.interface_type),$("#from").val(a.from_address),$("#host").val(a.host),$("#username").val(a.username),$("#password").val(a.password),$("#ignore_cert_errors").prop("checked",a.ignore_cert_errors)}function load(){$("#profileTable").hide(),$("#emptyMessage").hide(),$("#loading").show(),api.SMTP.get().success((function(e){profiles=e,$("#loading").hide(),profiles.length>0?($("#profileTable").show(),profileTable=$("#profileTable").DataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]}),profileTable.clear(),profileRows=[],$.each(profiles,(function(e,a){profileRows.push([escapeHtml(a.name),a.interface_type,moment(a.modified_date).format("MMMM Do YYYY, h:mm:ss a"),"
\t\t
"])})),profileTable.rows.add(profileRows).draw(),$('[data-toggle="tooltip"]').tooltip()):$("#emptyMessage").show()})).error((function(){$("#loading").hide(),errorFlash("Error fetching profiles")}))}function addCustomHeader(e,a){var o=[escapeHtml(e),escapeHtml(a),''],t=headers.DataTable(),s=t.column(0).data().indexOf(escapeHtml(e));s>=0?t.row(s,{order:"index"}).data(o):t.row.add(o),t.draw()}$(document).ready((function(){$(".modal").on("hidden.bs.modal",(function(e){$(this).removeClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")-1)})),$(".modal").on("shown.bs.modal",(function(e){void 0===$("body").data("fv_open_modals")&&$("body").data("fv_open_modals",0),$(this).hasClass("fv-modal-stack")||($(this).addClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")+1),$(this).css("z-index",1040+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not(".fv-modal-stack").css("z-index",1039+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not("fv-modal-stack").addClass("fv-modal-stack"))})),$.fn.modal.Constructor.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy((function(e){this.$element[0]===e.target||this.$element.has(e.target).length||$(e.target).closest(".cke_dialog, .cke").length||this.$element.trigger("focus")}),this))},$(document).on("hidden.bs.modal",".modal",(function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")})),$("#modal").on("hidden.bs.modal",(function(e){dismiss()})),$("#sendTestEmailModal").on("hidden.bs.modal",(function(e){dismissSendTestEmailModal()})),$("#headersForm").on("submit",(function(){return headerKey=$("#headerKey").val(),headerValue=$("#headerValue").val(),""==headerKey||""==headerValue||(addCustomHeader(headerKey,headerValue),$("#headersForm>div>input").val(""),$("#headerKey").focus()),!1})),$("#headersTable").on("click","span>i.fa-trash-o",(function(){headers.DataTable().row($(this).parents("tr")).remove().draw()})),load()})); \ No newline at end of file +var profiles=[];function sendTestEmail(){var headers=[];$.each($("#headersTable").DataTable().rows().data(),function(i,header){headers.push({key:unescapeHtml(header[0]),value:unescapeHtml(header[1])})});var test_email_request={template:{},first_name:$("input[name=to_first_name]").val(),last_name:$("input[name=to_last_name]").val(),email:$("input[name=to_email]").val(),position:$("input[name=to_position]").val(),url:"",smtp:{from_address:$("#from").val(),host:$("#host").val(),username:$("#username").val(),password:$("#password").val(),ignore_cert_errors:$("#ignore_cert_errors").prop("checked"),headers:headers}};btnHtml=$("#sendTestModalSubmit").html();$("#sendTestModalSubmit").html(' Sending');api.send_test_email(test_email_request).success(function(data){$("#sendTestEmailModal\\.flashes").empty().append('
\t Email Sent!
');$("#sendTestModalSubmit").html(btnHtml)}).error(function(data){$("#sendTestEmailModal\\.flashes").empty().append('
\t '+escapeHtml(data.responseJSON.message)+"
");$("#sendTestModalSubmit").html(btnHtml)})}function save(idx){var profile={headers:[]};$.each($("#headersTable").DataTable().rows().data(),function(i,header){profile.headers.push({key:unescapeHtml(header[0]),value:unescapeHtml(header[1])})});profile.name=$("#name").val();profile.interface_type=$("#interface_type").val();profile.from_address=$("#from").val();profile.host=$("#host").val();profile.username=$("#username").val();profile.password=$("#password").val();profile.ignore_cert_errors=$("#ignore_cert_errors").prop("checked");if(idx!=-1){profile.id=profiles[idx].id;api.SMTPId.put(profile).success(function(data){successFlash("Profile edited successfully!");load();dismiss()}).error(function(data){modalError(data.responseJSON.message)})}else{api.SMTP.post(profile).success(function(data){successFlash("Profile added successfully!");load();dismiss()}).error(function(data){modalError(data.responseJSON.message)})}}function dismiss(){$("#modal\\.flashes").empty();$("#name").val("");$("#interface_type").val("SMTP");$("#from").val("");$("#host").val("");$("#username").val("");$("#password").val("");$("#ignore_cert_errors").prop("checked",true);$("#headersTable").dataTable().DataTable().clear().draw();$("#modal").modal("hide")}var dismissSendTestEmailModal=function(){$("#sendTestEmailModal\\.flashes").empty();$("#sendTestModalSubmit").html(" Send")};var deleteProfile=function(idx){Swal.fire({title:"Are you sure?",text:"This will delete the sending profile. This can't be undone!",type:"warning",animation:false,showCancelButton:true,confirmButtonText:"Delete "+escapeHtml(profiles[idx].name),confirmButtonColor:"#428bca",reverseButtons:true,allowOutsideClick:false,preConfirm:function(){return new Promise(function(resolve,reject){api.SMTPId.delete(profiles[idx].id).success(function(msg){resolve()}).error(function(data){reject(data.responseJSON.message)})})}}).then(function(result){if(result.value){Swal.fire("Sending Profile Deleted!","This sending profile has been deleted!","success")}$('button:contains("OK")').on("click",function(){location.reload()})})};function edit(idx){headers=$("#headersTable").dataTable({destroy:true,columnDefs:[{orderable:false,targets:"no-sort"}]});$("#modalSubmit").unbind("click").click(function(){save(idx)});var profile={};if(idx!=-1){$("#profileModalLabel").text("Edit Sending Profile");profile=profiles[idx];$("#name").val(profile.name);$("#interface_type").val(profile.interface_type);$("#from").val(profile.from_address);$("#host").val(profile.host);$("#username").val(profile.username);$("#password").val(profile.password);$("#ignore_cert_errors").prop("checked",profile.ignore_cert_errors);$.each(profile.headers,function(i,record){addCustomHeader(record.key,record.value)})}else{$("#profileModalLabel").text("New Sending Profile")}}function copy(idx){$("#modalSubmit").unbind("click").click(function(){save(-1)});var profile={};profile=profiles[idx];$("#name").val("Copy of "+profile.name);$("#interface_type").val(profile.interface_type);$("#from").val(profile.from_address);$("#host").val(profile.host);$("#username").val(profile.username);$("#password").val(profile.password);$("#ignore_cert_errors").prop("checked",profile.ignore_cert_errors)}function load(){$("#profileTable").hide();$("#emptyMessage").hide();$("#loading").show();api.SMTP.get().success(function(ss){profiles=ss;$("#loading").hide();if(profiles.length>0){$("#profileTable").show();profileTable=$("#profileTable").DataTable({destroy:true,columnDefs:[{orderable:false,targets:"no-sort"}]});profileTable.clear();profileRows=[];$.each(profiles,function(i,profile){profileRows.push([escapeHtml(profile.name),profile.interface_type,moment(profile.modified_date).format("MMMM Do YYYY, h:mm:ss a"),"
\t\t
"])});profileTable.rows.add(profileRows).draw();$('[data-toggle="tooltip"]').tooltip()}else{$("#emptyMessage").show()}}).error(function(){$("#loading").hide();errorFlash("Error fetching profiles")})}function addCustomHeader(header,value){var newRow=[escapeHtml(header),escapeHtml(value),''];var headersTable=headers.DataTable();var existingRowIndex=headersTable.column(0).data().indexOf(escapeHtml(header));if(existingRowIndex>=0){headersTable.row(existingRowIndex,{order:"index"}).data(newRow)}else{headersTable.row.add(newRow)}headersTable.draw()}$(document).ready(function(){$(".modal").on("hidden.bs.modal",function(event){$(this).removeClass("fv-modal-stack");$("body").data("fv_open_modals",$("body").data("fv_open_modals")-1)});$(".modal").on("shown.bs.modal",function(event){if(typeof $("body").data("fv_open_modals")=="undefined"){$("body").data("fv_open_modals",0)}if($(this).hasClass("fv-modal-stack")){return}$(this).addClass("fv-modal-stack");$("body").data("fv_open_modals",$("body").data("fv_open_modals")+1);$(this).css("z-index",1040+10*$("body").data("fv_open_modals"));$(".modal-backdrop").not(".fv-modal-stack").css("z-index",1039+10*$("body").data("fv_open_modals"));$(".modal-backdrop").not("fv-modal-stack").addClass("fv-modal-stack")});$.fn.modal.Constructor.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(e){if(this.$element[0]!==e.target&&!this.$element.has(e.target).length&&!$(e.target).closest(".cke_dialog, .cke").length){this.$element.trigger("focus")}},this))};$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")});$("#modal").on("hidden.bs.modal",function(event){dismiss()});$("#sendTestEmailModal").on("hidden.bs.modal",function(event){dismissSendTestEmailModal()});$("#addCustomHeader").on("click",function(){headerKey=$("#headerKey").val();headerValue=$("#headerValue").val();if(headerKey==""||headerValue==""){return false}addCustomHeader(headerKey,headerValue);$("#headerKey").val("");$("#headerValue").val("");$("#headerKey").focus();return false});$("#headersTable").on("click","span>i.fa-trash-o",function(){headers.DataTable().row($(this).parents("tr")).remove().draw()});load()}); \ No newline at end of file