Added in webpack loader config for all jquery plugins, removed duplicate extended.js script calls on editor template

This commit is contained in:
Mason
2018-10-02 13:35:40 -07:00
parent c6e4e17aa8
commit e94cf6884d
4 changed files with 49 additions and 13 deletions
+19 -1
View File
@@ -1,7 +1,25 @@
/* eslint-env commonjs */
// Having a hard time making this work with standard es6 import/exports
var $ = require("jqueryVendor");
// Eww....
require("libs/jquery/jquery.migrate");
require("libs/jquery/jquery.autocomplete");
require("libs/jquery/jquery.event.hover");
require("libs/jquery/jquery.event.drag");
require("libs/jquery/jquery.mousewheel");
require("libs/jquery/jquery.form");
require("libs/jquery/jquery.rating");
require("libs/jquery/select2");
// PLACE MORE PLUGINS HERE
require("libs/jquery/jquery-ui");
// THIS ONE IS REALLY BAD, probably replace it, see if there's a more grown-up
// version or just refactor it out since there's really no sensible reason for
// an unholy marriage between localstorage and jquery
require("libs/jquery/jstorage");
require("libs/farbtastic");
require("libs/jquery/jquery.dynatree");
module.exports = $;
+28 -1
View File
@@ -73,10 +73,24 @@ let buildconfig = {
},
module: {
rules: [
// Manual shimming for standard, horrible, jquery plugins
{
test: /select2/,
test: /jquery\.(migrate|autocomplete|event\.hover|event\.drag|form|rating|dynatree)/,
use: "imports-loader?jQuery=jqueryVendor"
},
{
test: /(select2|jstorage|farbtastic)/,
use: "imports-loader?jQuery=jqueryVendor"
},
{
test: /jquery-ui\.js/,
use: "imports-loader?jQuery=jqueryVendor"
},
// Even MORE special handling!
{
test: /jquery\.mousewheel/,
use: "imports-loader?define=>false,jQuery=jqueryVendor"
},
{
test: /\.vue$/,
loader: "vue-loader",
@@ -104,6 +118,19 @@ let buildconfig = {
}
]
},
{
test: require.resolve("underscore"),
use: [
{
loader: "expose-loader",
options: "_"
},
{
loader: "expose-loader",
options: "underscore"
}
]
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
+1 -1
View File
@@ -53,9 +53,9 @@
<%def name="javascripts()">
<script>
console.log("setting yet more globals in galaxy.panels.mako");
window.Galaxy = window.Galaxy || {};
window.Galaxy.root = '${h.url_for( "/" )}';
window.jQuery = window.jquery = window.$;
</script>
## Send errors to Sentry server if configured
%if app.config.sentry_dsn:
+1 -10
View File
@@ -37,21 +37,12 @@
${parent.javascripts()}
${h.js(
## "libs/jquery/jquery.event.drag",
## "libs/jquery/jquery.event.drop",
## "libs/jquery/jquery.event.hover",
## "libs/jquery/jquery.form",
## "libs/jquery/jstorage",
## "libs/jquery/jquery.autocomplete",
"bundled/extended.bundled"
)}
<script type='text/javascript'>
$( function() {
window.bundleEntries.workflow(${h.dumps(self.editor_config)});
});
</script>
</%def>
<%def name="stylesheets()">