Rebuilding minified JS to support #1722

pull/1749/head
Jordan Wright 2020-01-18 12:49:34 -06:00
parent 9de32746ee
commit ecb6d46914
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
function errorFlash(e){$("#flashes").empty(),$("#flashes").append('<div style="text-align:center" class="alert alert-danger"> <i class="fa fa-exclamation-circle"></i> '+e+"</div>")}function successFlash(e){$("#flashes").empty(),$("#flashes").append('<div style="text-align:center" class="alert alert-success"> <i class="fa fa-check-circle"></i> '+e+"</div>")}function modalError(e){$("#modal\\.flashes").empty().append('<div style="text-align:center" class="alert alert-danger"> <i class="fa fa-exclamation-circle"></i> '+e+"</div>")}function query(e,t,r,n){return $.ajax({url:"/api"+e,async:n,method:t,data:JSON.stringify(r),dataType:"json",contentType:"application/json",beforeSend:function(e){e.setRequestHeader("Authorization","Bearer "+user.api_key)}})}function escapeHtml(e){return $("<div/>").text(e).html()}function unescapeHtml(e){return $("<div/>").html(e).text()}window.escapeHtml=escapeHtml;var capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},api={campaigns:{get:function(){return query("/campaigns/","GET",{},!1)},post:function(e){return query("/campaigns/","POST",e,!1)},summary:function(){return query("/campaigns/summary","GET",{},!1)}},campaignId:{get:function(e){return query("/campaigns/"+e,"GET",{},!0)},delete:function(e){return query("/campaigns/"+e,"DELETE",{},!1)},results:function(e){return query("/campaigns/"+e+"/results","GET",{},!0)},complete:function(e){return query("/campaigns/"+e+"/complete","GET",{},!0)},summary:function(e){return query("/campaigns/"+e+"/summary","GET",{},!0)}},groups:{get:function(){return query("/groups/","GET",{},!1)},post:function(e){return query("/groups/","POST",e,!1)},summary:function(){return query("/groups/summary","GET",{},!0)}},groupId:{get:function(e){return query("/groups/"+e,"GET",{},!1)},put:function(e){return query("/groups/"+e.id,"PUT",e,!1)},delete:function(e){return query("/groups/"+e,"DELETE",{},!1)}},templates:{get:function(){return query("/templates/","GET",{},!1)},post:function(e){return query("/templates/","POST",e,!1)}},templateId:{get:function(e){return query("/templates/"+e,"GET",{},!1)},put:function(e){return query("/templates/"+e.id,"PUT",e,!1)},delete:function(e){return query("/templates/"+e,"DELETE",{},!1)}},pages:{get:function(){return query("/pages/","GET",{},!1)},post:function(e){return query("/pages/","POST",e,!1)}},pageId:{get:function(e){return query("/pages/"+e,"GET",{},!1)},put:function(e){return query("/pages/"+e.id,"PUT",e,!1)},delete:function(e){return query("/pages/"+e,"DELETE",{},!1)}},SMTP:{get:function(){return query("/smtp/","GET",{},!1)},post:function(e){return query("/smtp/","POST",e,!1)}},SMTPId:{get:function(e){return query("/smtp/"+e,"GET",{},!1)},put:function(e){return query("/smtp/"+e.id,"PUT",e,!1)},delete:function(e){return query("/smtp/"+e,"DELETE",{},!1)}},users:{get:function(){return query("/users/","GET",{},!0)},post:function(e){return query("/users/","POST",e,!0)}},userId:{get:function(e){return query("/users/"+e,"GET",{},!0)},put:function(e){return query("/users/"+e.id,"PUT",e,!0)},delete:function(e){return query("/users/"+e,"DELETE",{},!0)}},webhooks:{get:function(){return query("/webhooks/","GET",{},!1)},post:function(e){return query("/webhooks/","POST",e,!1)}},webhookId:{get:function(e){return query("/webhooks/"+e,"GET",{},!1)},put:function(e){return query("/webhooks/"+e.id,"PUT",e,!0)},delete:function(e){return query("/webhooks/"+e,"DELETE",{},!1)},ping:function(e){return query("/webhooks/"+e+"/validate","POST",{},!0)}},import_email:function(e){return query("/import/email","POST",e,!1)},clone_site:function(e){return query("/import/site","POST",e,!1)},send_test_email:function(e){return query("/util/send_test_email","POST",e,!0)},reset:function(){return query("/reset","POST",{},!0)}};window.api=api,$(document).ready(function(){var t=location.pathname;$(".nav-sidebar li").each(function(){var e=$(this);e.find("a").attr("href")===t&&e.addClass("active")}),$.fn.dataTable.moment("MMMM Do YYYY, h:mm:ss a"),$('[data-toggle="tooltip"]').tooltip()});
function errorFlash(e){$("#flashes").empty(),$("#flashes").append('<div style="text-align:center" class="alert alert-danger"> <i class="fa fa-exclamation-circle"></i> '+e+"</div>")}function successFlash(e){$("#flashes").empty(),$("#flashes").append('<div style="text-align:center" class="alert alert-success"> <i class="fa fa-check-circle"></i> '+e+"</div>")}function errorFlashFade(e,t){$("#flashes").empty(),$("#flashes").append('<div style="text-align:center" class="alert alert-danger"> <i class="fa fa-exclamation-circle"></i> '+e+"</div>"),setTimeout(function(){$("#flashes").empty()},1e3*t)}function successFlashFade(e,t){$("#flashes").empty(),$("#flashes").append('<div style="text-align:center" class="alert alert-success"> <i class="fa fa-check-circle"></i> '+e+"</div>"),setTimeout(function(){$("#flashes").empty()},1e3*t)}function modalError(e){$("#modal\\.flashes").empty().append('<div style="text-align:center" class="alert alert-danger"> <i class="fa fa-exclamation-circle"></i> '+e+"</div>")}function query(e,t,n,r){return $.ajax({url:"/api"+e,async:r,method:t,data:JSON.stringify(n),dataType:"json",contentType:"application/json",beforeSend:function(e){e.setRequestHeader("Authorization","Bearer "+user.api_key)}})}function escapeHtml(e){return $("<div/>").text(e).html()}function unescapeHtml(e){return $("<div/>").html(e).text()}window.escapeHtml=escapeHtml;var capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},api={campaigns:{get:function(){return query("/campaigns/","GET",{},!1)},post:function(e){return query("/campaigns/","POST",e,!1)},summary:function(){return query("/campaigns/summary","GET",{},!1)}},campaignId:{get:function(e){return query("/campaigns/"+e,"GET",{},!0)},delete:function(e){return query("/campaigns/"+e,"DELETE",{},!1)},results:function(e){return query("/campaigns/"+e+"/results","GET",{},!0)},complete:function(e){return query("/campaigns/"+e+"/complete","GET",{},!0)},summary:function(e){return query("/campaigns/"+e+"/summary","GET",{},!0)}},groups:{get:function(){return query("/groups/","GET",{},!1)},post:function(e){return query("/groups/","POST",e,!1)},summary:function(){return query("/groups/summary","GET",{},!0)}},groupId:{get:function(e){return query("/groups/"+e,"GET",{},!1)},put:function(e){return query("/groups/"+e.id,"PUT",e,!1)},delete:function(e){return query("/groups/"+e,"DELETE",{},!1)}},templates:{get:function(){return query("/templates/","GET",{},!1)},post:function(e){return query("/templates/","POST",e,!1)}},templateId:{get:function(e){return query("/templates/"+e,"GET",{},!1)},put:function(e){return query("/templates/"+e.id,"PUT",e,!1)},delete:function(e){return query("/templates/"+e,"DELETE",{},!1)}},pages:{get:function(){return query("/pages/","GET",{},!1)},post:function(e){return query("/pages/","POST",e,!1)}},pageId:{get:function(e){return query("/pages/"+e,"GET",{},!1)},put:function(e){return query("/pages/"+e.id,"PUT",e,!1)},delete:function(e){return query("/pages/"+e,"DELETE",{},!1)}},SMTP:{get:function(){return query("/smtp/","GET",{},!1)},post:function(e){return query("/smtp/","POST",e,!1)}},SMTPId:{get:function(e){return query("/smtp/"+e,"GET",{},!1)},put:function(e){return query("/smtp/"+e.id,"PUT",e,!1)},delete:function(e){return query("/smtp/"+e,"DELETE",{},!1)}},IMAP:{get:function(){return query("/imap/","GET",{},!1)},post:function(e){return query("/imap/","POST",e,!1)},validate:function(e){return query("/imap/validate","POST",e,!0)}},users:{get:function(){return query("/users/","GET",{},!0)},post:function(e){return query("/users/","POST",e,!0)}},userId:{get:function(e){return query("/users/"+e,"GET",{},!0)},put:function(e){return query("/users/"+e.id,"PUT",e,!0)},delete:function(e){return query("/users/"+e,"DELETE",{},!0)}},webhooks:{get:function(){return query("/webhooks/","GET",{},!1)},post:function(e){return query("/webhooks/","POST",e,!1)}},webhookId:{get:function(e){return query("/webhooks/"+e,"GET",{},!1)},put:function(e){return query("/webhooks/"+e.id,"PUT",e,!0)},delete:function(e){return query("/webhooks/"+e,"DELETE",{},!1)},ping:function(e){return query("/webhooks/"+e+"/validate","POST",{},!0)}},import_email:function(e){return query("/import/email","POST",e,!1)},clone_site:function(e){return query("/import/site","POST",e,!1)},send_test_email:function(e){return query("/util/send_test_email","POST",e,!0)},reset:function(){return query("/reset","POST",{},!0)}};window.api=api,$(document).ready(function(){var t=location.pathname;$(".nav-sidebar li").each(function(){var e=$(this);e.find("a").attr("href")===t&&e.addClass("active")}),$.fn.dataTable.moment("MMMM Do YYYY, h:mm:ss a"),$('[data-toggle="tooltip"]').tooltip()});

View File

@ -1 +1 @@
$(document).ready(function(){$("#apiResetForm").submit(function(e){return api.reset().success(function(e){user.api_key=e.data,successFlash(e.message),$("#api_key").val(user.api_key)}).error(function(e){errorFlash(e.message)}),!1}),$("#settingsForm").submit(function(e){return $.post("/settings",$(this).serialize()).done(function(e){successFlash(e.message)}).fail(function(e){errorFlash(e.responseJSON.message)}),!1});var e=localStorage.getItem("gophish.use_map");$("#use_map").prop("checked",JSON.parse(e)),$("#use_map").on("change",function(){localStorage.setItem("gophish.use_map",JSON.stringify(this.checked))})});
$(document).ready(function(){function t(){api.IMAP.get().success(function(e){0==e.length?$("#lastlogindiv").hide():(0==(e=e[0]).enabled?$("#lastlogindiv").hide():$("#lastlogindiv").show(),$("#imapusername").val(e.username),$("#imaphost").val(e.host),$("#imapport").val(e.port),$("#imappassword").val(e.password),$("#use_tls").prop("checked",e.tls),$("#use_imap").prop("checked",e.enabled),$("#folder").val(e.folder),$("#restrictdomain").val(e.restrict_domain),$("#deletecampaign").prop("checked",e.delete_reported_campaign_email),$("#lastloginraw").val(e.last_login),$("#lastlogin").val(moment.utc(e.last_login).fromNow()),$("#imapfreq").val(e.imap_freq))}).error(function(){errorFlash("Error fetching IMAP settings")})}$('[data-toggle="tooltip"]').tooltip(),$("#apiResetForm").submit(function(e){return api.reset().success(function(e){user.api_key=e.data,successFlash(e.message),$("#api_key").val(user.api_key)}).error(function(e){errorFlash(e.message)}),!1}),$("#settingsForm").submit(function(e){return $.post("/settings",$(this).serialize()).done(function(e){successFlash(e.message)}).fail(function(e){errorFlash(e.responseJSON.message)}),!1}),$("#savesettings").click(function(){var e={};return e.host=$("#imaphost").val(),e.port=$("#imapport").val(),e.username=$("#imapusername").val(),e.password=$("#imappassword").val(),e.enabled=$("#use_imap").prop("checked"),e.tls=$("#use_tls").prop("checked"),e.folder=$("#folder").val(),e.imap_freq=$("#imapfreq").val(),e.restrict_domain=$("#restrictdomain").val(),e.delete_reported_campaign_email=$("#deletecampaign").prop("checked"),""==e.host?(errorFlash("No IMAP Host specified"),document.body.scrollTop=0,document.documentElement.scrollTop=0):""==e.port?(errorFlash("No IMAP Port specified"),document.body.scrollTop=0,document.documentElement.scrollTop=0):isNaN(e.port)||e.port<1||65535<e.port?(errorFlash("Invalid IMAP Port"),document.body.scrollTop=0,document.documentElement.scrollTop=0):(""==e.imap_freq&&(e.imap_freq="60"),api.IMAP.post(e).done(function(e){1==e.success?successFlashFade("Successfully updated IMAP settings.",2):errorFlash("Unable to update IMAP settings.")}).success(function(e){t()}).fail(function(e){errorFlash(e.responseJSON.message)}).always(function(e){document.body.scrollTop=0,document.documentElement.scrollTop=0})),!1}),$("#validateimap").click(function(){var e={};if(e.host=$("#imaphost").val(),e.port=$("#imapport").val(),e.username=$("#imapusername").val(),e.password=$("#imappassword").val(),e.tls=$("#use_tls").prop("checked"),""==e.host)return errorFlash("No IMAP Host specified"),document.body.scrollTop=0,document.documentElement.scrollTop=0,!1;if(""==e.port)return errorFlash("No IMAP Port specified"),document.body.scrollTop=0,document.documentElement.scrollTop=0,!1;if(isNaN(e.port)||e.port<1||65535<e.port)return errorFlash("Invalid IMAP Port"),document.body.scrollTop=0,document.documentElement.scrollTop=0,!1;var t=$("#validateimap").html();$("#imaphost").attr("disabled",!0),$("#imapport").attr("disabled",!0),$("#imapusername").attr("disabled",!0),$("#imappassword").attr("disabled",!0),$("#use_imap").attr("disabled",!0),$("#use_tls").attr("disabled",!0),$("#folder").attr("disabled",!0),$("#restrictdomain").attr("disabled",!0),$("#deletecampaign").attr("disabled",!0),$("#lastlogin").attr("disabled",!0),$("#imapfreq").attr("disabled",!0),$("#validateimap").attr("disabled",!0),$("#validateimap").html("<i class='fa fa-circle-o-notch fa-spin'></i> Testing..."),api.IMAP.validate(e).done(function(t){1==t.success?Swal.fire({title:"Success",html:"Logged into <b>"+$("#imaphost").val()+"</b>",type:"success"}):Swal.fire({title:"Failed!",html:"Unable to login to <b>"+$("#imaphost").val()+"</b>.",type:"error",showCancelButton:!0,cancelButtonText:"Close",confirmButtonText:"More Info",confirmButtonColor:"#428bca",allowOutsideClick:!1}).then(function(e){e.value&&Swal.fire({title:"Error:",text:t.message})})}).fail(function(){Swal.fire({title:"Failed!",text:"An unecpected error occured.",type:"error"})}).always(function(){$("#imaphost").attr("disabled",!1),$("#imapport").attr("disabled",!1),$("#imapusername").attr("disabled",!1),$("#imappassword").attr("disabled",!1),$("#use_imap").attr("disabled",!1),$("#use_tls").attr("disabled",!1),$("#folder").attr("disabled",!1),$("#restrictdomain").attr("disabled",!1),$("#deletecampaign").attr("disabled",!1),$("#lastlogin").attr("disabled",!1),$("#imapfreq").attr("disabled",!1),$("#validateimap").attr("disabled",!1),$("#validateimap").html(t)})}),$("#reporttab").click(function(){t()}),$("#advanced").click(function(){$("#advancedarea").toggle()});var e=localStorage.getItem("gophish.use_map");$("#use_map").prop("checked",JSON.parse(e)),$("#use_map").on("change",function(){localStorage.setItem("gophish.use_map",JSON.stringify(this.checked))}),t()});