diff --git a/gulpfile.js b/gulpfile.js
index ea8e31b5..f89ed36e 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -17,8 +17,7 @@ var gulp = require('gulp'),
dest_js_directory = 'static/js/dist/',
dest_css_directory = 'static/css/dist/';
-gulp.task('vendorjs', function () {
- // Vendor minifying / concat
+vendorjs = function () {
return gulp.src([
vendor_directory + 'jquery.js',
vendor_directory + 'bootstrap.min.js',
@@ -46,11 +45,11 @@ gulp.task('vendorjs', function () {
}))
.pipe(uglify())
.pipe(gulp.dest(dest_js_directory));
-})
+}
-gulp.task('scripts', function () {
+scripts = function () {
// Gophish app files
- gulp.src(app_directory)
+ return gulp.src(app_directory)
.pipe(rename({
suffix: '.min'
}))
@@ -58,9 +57,9 @@ gulp.task('scripts', function () {
console.log(e);
}))
.pipe(gulp.dest(dest_js_directory + 'app/'));
-})
+}
-gulp.task('styles', function () {
+styles = function () {
return gulp.src([
css_directory + 'bootstrap.min.css',
css_directory + 'main.css',
@@ -80,8 +79,10 @@ gulp.task('styles', function () {
}))
.pipe(concat('gophish.css'))
.pipe(gulp.dest(dest_css_directory));
-})
+}
-gulp.task('build', ['vendorjs', 'scripts', 'styles']);
-
-gulp.task('default', ['build']);
\ No newline at end of file
+exports.vendorjs = vendorjs
+exports.scripts = scripts
+exports.styles = styles
+exports.build = gulp.parallel(vendorjs, scripts, styles)
+exports.default = exports.build
\ No newline at end of file
diff --git a/package.json b/package.json
index 36d7e62c..1f17d851 100644
--- a/package.json
+++ b/package.json
@@ -12,17 +12,16 @@
},
"homepage": "https://getgophish.com",
"devDependencies": {
- "clean-css": "^3.4.23",
- "gulp": "^3.9.1",
- "gulp-clean-css": "^2.3.2",
- "gulp-cli": "^1.4.0",
+ "clean-css": "^4.2.1",
+ "gulp": "^4.0.0",
+ "gulp-clean-css": "^4.0.0",
+ "gulp-cli": "^2.2.0",
"gulp-concat": "^2.6.1",
- "gulp-jshint": "^2.0.4",
- "gulp-rename": "^1.2.2",
- "gulp-uglify": "^2.0.0",
- "gulp-util": "^3.0.8",
- "gulp-wrap": "^0.13.0",
- "jshint": "^2.9.4",
+ "gulp-jshint": "^2.1.0",
+ "gulp-rename": "^1.4.0",
+ "gulp-uglify": "^3.0.2",
+ "gulp-wrap": "^0.15.0",
+ "jshint": "^2.10.2",
"jshint-stylish": "^2.2.1"
}
}
diff --git a/static/js/dist/app/autocomplete.min.js b/static/js/dist/app/autocomplete.min.js
index 09a85ec5..0f6c41b4 100644
--- a/static/js/dist/app/autocomplete.min.js
+++ b/static/js/dist/app/autocomplete.min.js
@@ -1 +1 @@
-var TEMPLATE_TAGS=[{id:1,name:"RId",description:"The unique ID for the recipient."},{id:2,name:"FirstName",description:"The recipient's first name."},{id:3,name:"LastName",description:"The recipient's last name."},{id:4,name:"Position",description:"The recipient's position."},{id:5,name:"From",description:"The address emails are sent from."},{id:6,name:"TrackingURL",description:"The URL to track emails being opened."},{id:7,name:"Tracker",description:"An HTML tag that adds a hidden tracking image (recommended instead of TrackingURL)."},{id:8,name:"URL",description:"The URL to your Gophish listener."},{id:9,name:"BaseURL",description:"The base URL with the path and rid parameter stripped. Useful for making links to static files."}],textTestCallback=function(e){return e.collapsed?CKEDITOR.plugins.textMatch.match(e,matchCallback):null},matchCallback=function(e,t){var i=/\{{2}\.?([A-z]|\})*$/,a=e.slice(0,t).match(i);return a?{start:a.index,end:t}:null},dataCallback=function(e,t){t(TEMPLATE_TAGS.filter(function(t){return 0==("{{."+t.name.toLowerCase()+"}}").indexOf(e.query.toLowerCase())}))},setupAutocomplete=function(e){e.on("instanceReady",function(e){new CKEDITOR.plugins.autocomplete(e.editor,{textTestCallback:textTestCallback,dataCallback:dataCallback,itemTemplate:'
{name}
{description}
',outputTemplate:"[[.{name}]]"}).getHtmlToInsert=function(e){var t=this.outputTemplate.output(e);return t=t.replace("[[","{{").replace("]]","}}")}})};
\ No newline at end of file
+var TEMPLATE_TAGS=[{id:1,name:"RId",description:"The unique ID for the recipient."},{id:2,name:"FirstName",description:"The recipient's first name."},{id:3,name:"LastName",description:"The recipient's last name."},{id:4,name:"Position",description:"The recipient's position."},{id:5,name:"From",description:"The address emails are sent from."},{id:6,name:"TrackingURL",description:"The URL to track emails being opened."},{id:7,name:"Tracker",description:"An HTML tag that adds a hidden tracking image (recommended instead of TrackingURL)."},{id:8,name:"URL",description:"The URL to your Gophish listener."},{id:9,name:"BaseURL",description:"The base URL with the path and rid parameter stripped. Useful for making links to static files."}],textTestCallback=function(e){return e.collapsed?CKEDITOR.plugins.textMatch.match(e,matchCallback):null},matchCallback=function(e,t){var i=e.slice(0,t).match(/\{{2}\.?([A-z]|\})*$/);return i?{start:i.index,end:t}:null},dataCallback=function(t,e){e(TEMPLATE_TAGS.filter(function(e){return 0==("{{."+e.name.toLowerCase()+"}}").indexOf(t.query.toLowerCase())}))},setupAutocomplete=function(e){e.on("instanceReady",function(e){new CKEDITOR.plugins.autocomplete(e.editor,{textTestCallback:textTestCallback,dataCallback:dataCallback,itemTemplate:'
{name}
{description}
',outputTemplate:"[[.{name}]]"}).getHtmlToInsert=function(e){var t=this.outputTemplate.output(e);return t=t.replace("[[","{{").replace("]]","}}")}})};
\ No newline at end of file
diff --git a/static/js/dist/app/campaign_results.min.js b/static/js/dist/app/campaign_results.min.js
index 8c461d9a..d02e60e3 100644
--- a/static/js/dist/app/campaign_results.min.js
+++ b/static/js/dist/app/campaign_results.min.js
@@ -1 +1 @@
-function dismiss(){$("#modal\\.flashes").empty(),$("#modal").modal("hide"),$("#resultsTable").dataTable().DataTable().clear().draw()}function deleteCampaign(){swal({title:"Are you sure?",text:"This will delete the campaign. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete Campaign",confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,showLoaderOnConfirm:!0,preConfirm:function(){return new Promise(function(e,t){api.campaignId.delete(campaign.id).success(function(t){e()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Campaign Deleted!","This campaign has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.href="/campaigns"})})}function completeCampaign(){swal({title:"Are you sure?",text:"Gophish will stop processing events for this campaign",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Complete Campaign",confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,showLoaderOnConfirm:!0,preConfirm:function(){return new Promise(function(e,t){api.campaignId.complete(campaign.id).success(function(t){e()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Campaign Completed!","This campaign has been completed!","success"),$("#complete_button")[0].disabled=!0,$("#complete_button").text("Completed!"),doPoll=!1})}function exportAsCSV(e){exportHTML=$("#exportButton").html();var t=null,a=campaign.name+" - "+capitalize(e)+".csv";switch(e){case"results":t=campaign.results;break;case"events":t=campaign.timeline}if(t){$("#exportButton").html('');var s=Papa.unparse(t,{}),i=new Blob([s],{type:"text/csv;charset=utf-8;"});if(navigator.msSaveBlob)navigator.msSaveBlob(i,a);else{var l=window.URL.createObjectURL(i),n=document.createElement("a");n.href=l,n.setAttribute("download",a),document.body.appendChild(n),n.click(),document.body.removeChild(n)}$("#exportButton").html(exportHTML)}}function replay(e){function t(){form.attr({action:url}),form.appendTo("body").submit().remove()}request=campaign.timeline[e],details=JSON.parse(request.details),url=null,form=$("