Skip to content

Commit 872140a

Browse files
authored
Enhanced HipCaptcha initialization in absence of jQuery. (#357)
1 parent fd88b95 commit 872140a

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

js/HipObject.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ var WLSPHIP0 = {
7777
// you can set them here to override the default style.
7878
// (Blocked out for test purposes)
7979
// ----------------------------------------------------------------------------------------------------------
80-
// cssSet: {
81-
// cssCdHIPMenu: "csshMenu1",
82-
// cssCdHIPInput: "csshInput1",
83-
// cssCdHIPLink: "csshLink1",
84-
// cssCdHIPError: "csshError1",
85-
// cssCdHIPErrorImg: "csshErrorImg1"
86-
// },
80+
// cssSet: {
81+
// cssCdHIPMenu: "csshMenu1",
82+
// cssCdHIPInput: "csshInput1",
83+
// cssCdHIPLink: "csshLink1",
84+
// cssCdHIPError: "csshError1",
85+
// cssCdHIPErrorImg: "csshErrorImg1"
86+
// },
8787

8888
getSolution: function () { },
8989
reloadHIP: function () { },
@@ -122,10 +122,6 @@ var verifyOnClient = function (solution, token, param) {
122122
}
123123
else {
124124
fillHipData(solution, token);
125-
126-
//document.getElementById('Solution').value = solution;
127-
//document.getElementById('Token').value = token;
128-
//document.getElementById('Type').value = WLSPHIP0.type;
129125
return;
130126
}
131127
}
@@ -157,8 +153,6 @@ function refreshOutsideMenu(menu) {
157153
//set if needed
158154
var itemLength = menu.length;
159155
if (!WLSPHIP0.showMenu) {
160-
//var menu = WLSPHIP0.getMenu();
161-
162156
for (var j = 0; j < itemLength; j++) {
163157
(function (j) {
164158

@@ -169,7 +163,6 @@ function refreshOutsideMenu(menu) {
169163
ele.onclick = function () { trigger(); return false };
170164

171165
})(j);
172-
173166
}
174167
}
175168

@@ -186,11 +179,14 @@ function instructionCallback(instruction) //add instruction as parameter, and re
186179
document.getElementById('idInstruction').innerHTML = '';
187180
}
188181
else {
189-
//var instruction = WLSPHIP0.getInstruction();
190182
document.getElementById('idInstruction').innerHTML = instruction;
191183
}
192184
}
193185

194-
if (!$.ajax) {
195-
$.ajax = () => {};
186+
if (window.$ == undefined) {
187+
window.$ = {};
188+
}
189+
190+
if (!window.$.ajax) {
191+
window.$.ajax = () => { };
196192
}

0 commit comments

Comments
 (0)