diff --git a/kitsune/sumo/static/sumo/js/libs/jquery.ajaxupload.js b/kitsune/sumo/static/sumo/js/libs/jquery.ajaxupload.js index d5027f2ce..1622498db 100644 --- a/kitsune/sumo/static/sumo/js/libs/jquery.ajaxupload.js +++ b/kitsune/sumo/static/sumo/js/libs/jquery.ajaxupload.js @@ -9,6 +9,7 @@ * if you want to avoid that). */ +import dialogSet from "sumo/js/upload-dialog"; /** * Wrap an input in its own form and bind delete handlers. diff --git a/kitsune/sumo/static/sumo/js/upload-dialog.js b/kitsune/sumo/static/sumo/js/upload-dialog.js new file mode 100644 index 000000000..633f07af8 --- /dev/null +++ b/kitsune/sumo/static/sumo/js/upload-dialog.js @@ -0,0 +1,11 @@ +export default function dialogSet(inner, title) { + var kbox = new KBox($('

').text(inner), { + title: title, + destroy: true, + closeOnOutClick: true, + modal: true, + id: 'upload-dialog', + container: $('body') + }); + kbox.open(); +} diff --git a/kitsune/sumo/static/sumo/js/upload.js b/kitsune/sumo/static/sumo/js/upload.js index f5e4235c9..789a8379a 100644 --- a/kitsune/sumo/static/sumo/js/upload.js +++ b/kitsune/sumo/static/sumo/js/upload.js @@ -1,16 +1,5 @@ import "sumo/js/libs/jquery.ajaxupload"; - -function dialogSet(inner, title) { - var kbox = new KBox($('

').text(inner), { - title: title, - destroy: true, - closeOnOutClick: true, - modal: true, - id: 'upload-dialog', - container: $('body') - }); - kbox.open(); -} +import dialogSet from "sumo/js/upload-dialog"; $(document).ready(function () { var UPLOAD = { diff --git a/webpack/eslintrc.js b/webpack/eslintrc.js index 7ddbba38f..5e8b6487a 100644 --- a/webpack/eslintrc.js +++ b/webpack/eslintrc.js @@ -30,7 +30,6 @@ module.exports = { "detailsInit": "readonly", "tabsInit": "readonly", "trackEvent": "readonly", - "dialogSet": "readonly", "$": "readonly", "jQuery": "readonly", "diff_match_patch": "readonly", diff --git a/webpack/global-expose-rules.js b/webpack/global-expose-rules.js index 61efbc011..88d852f2f 100644 --- a/webpack/global-expose-rules.js +++ b/webpack/global-expose-rules.js @@ -3,8 +3,6 @@ // in webpack, unless a file explicitly places a variable under `window.`, // we have to expose each of these variables manually: module.exports = [ - // wrap these files to make them behave like an es6 module, exporting the named variable, and expose that globally: - exportAndExpose("../kitsune/sumo/static/sumo/js/upload.js", "dialogSet"), // we copy these libraries from external sources, so define their exports here, // rather than having to modify them, making updating them more difficult: exports(