#318 providing support for multiple jQuery versions and exposing it via webgoat.customjs namespace
This commit is contained in:
parent
693d791075
commit
f3884fe605
@ -1,4 +1,5 @@
|
||||
define(['jquery',
|
||||
'libs/jquery-vuln',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'goatApp/controller/LessonController',
|
||||
@ -8,6 +9,7 @@ define(['jquery',
|
||||
'goatApp/view/DeveloperControlsView',
|
||||
'goatApp/view/TitleView'
|
||||
], function ($,
|
||||
$vuln,
|
||||
_,
|
||||
Backbone,
|
||||
LessonController,
|
||||
@ -48,6 +50,7 @@ define(['jquery',
|
||||
|
||||
setUpCustomJS: function () {
|
||||
webgoat.customjs.jquery = $; //passing jquery into custom js scope ... still klunky, but works for now
|
||||
webgoat.customjs.jqueryVuln = $vuln;
|
||||
|
||||
// temporary shim to support dom-xss lesson
|
||||
webgoat.customjs.phoneHome = function (e) {
|
||||
|
4
webgoat-container/src/main/resources/static/js/libs/jquery-2.2.4.min.js
vendored
Normal file
4
webgoat-container/src/main/resources/static/js/libs/jquery-2.2.4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
9
webgoat-container/src/main/resources/static/js/libs/jquery-base.js
vendored
Normal file
9
webgoat-container/src/main/resources/static/js/libs/jquery-base.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// AMD (Asynchronous Module Definition) wrapper for jQuery 1.8
|
||||
define([
|
||||
// Load the jQuery source file
|
||||
'/WebGoat/js/libs/jquery-2.2.4.min.js'
|
||||
],
|
||||
function(){
|
||||
// Tell Require.js that this module returns a reference to jQuery
|
||||
return $; // Return the global scope object
|
||||
});
|
9
webgoat-container/src/main/resources/static/js/libs/jquery-vuln.js
vendored
Normal file
9
webgoat-container/src/main/resources/static/js/libs/jquery-vuln.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// AMD (Asynchronous Module Definition) wrapper for jQuery 1.8
|
||||
define([
|
||||
// Load the jQuery source file
|
||||
'/WebGoat/js/libs/jquery-2.1.4.min.js'
|
||||
],
|
||||
function(){
|
||||
// Tell Require.js that this module returns a reference to jQuery
|
||||
return $.noConflict(true); // Return the global scope object
|
||||
});
|
@ -13,14 +13,19 @@ js/main.js << main file for require.js
|
||||
require.config({
|
||||
baseUrl: "js/",
|
||||
paths: {
|
||||
//jquery: 'libs/jquery-1.10.2.min',
|
||||
jquery: 'libs/jquery-2.1.4.min',
|
||||
jquery: 'libs/jquery-2.2.4.min',
|
||||
underscore: 'libs/underscore-min',
|
||||
backbone: 'libs/backbone-min',
|
||||
text: 'libs/text',
|
||||
templates: 'goatApp/templates',
|
||||
polyglot: 'libs/polyglot.min'
|
||||
},
|
||||
|
||||
map: {
|
||||
'libs/jquery-base' : {'jquery':'libs/jquery-2.2.4.min'},
|
||||
'libs/jquery-vuln' : {'jquery':'libs/jquery-2.1.4.min'}
|
||||
},
|
||||
|
||||
shim: {
|
||||
underscore: {
|
||||
exports: "_"
|
||||
@ -32,6 +37,6 @@ require.config({
|
||||
}
|
||||
});
|
||||
|
||||
require(['jquery','underscore','backbone','goatApp/goatApp'], function($,_,Backbone,Goat){
|
||||
Goat.initApp();
|
||||
require(['jquery','libs/jquery-base','libs/jquery-vuln','underscore','backbone','goatApp/goatApp'], function($,jqueryBase,jqueryVuln,_,Backbone,Goat){
|
||||
Goat.initApp();
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user