File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
( function ( window , document ) {
2
2
"use strict"
3
+ let link = ""
4
+
3
5
let keys = ""
4
6
5
7
let tokens = ""
6
8
7
9
let count = 0
8
10
9
11
let list = [ ]
12
+
13
+ /**
14
+ * @function setLink
15
+ *
16
+ * @goal : setLink is to set main link for loading thinCaptcha files...
17
+ *
18
+ * @return bool
19
+ **/
20
+
21
+ const setLink = function ( url ) {
22
+ link = url
23
+ return true
24
+ }
25
+
10
26
/**
11
27
* @function setKey
12
28
*
78
94
}
79
95
80
96
const verifing = function ( index ) {
81
- ajax ( function ( res ) { alert ( res ) } , "index.php" , {
97
+ ajax ( function ( res ) { alert ( res ) } , link + "index.php" , {
82
98
method : "verify" ,
83
99
value : list [ index ] . text . value ,
84
100
code : list [ index ] . text . value ,
123
139
alert ( "hey" )
124
140
} )
125
141
let imageID = "thinCaptcha-image" + count
126
- let imageSRC = "captcha.php?code=" + json . result . code + "&token=" + tokens + "&key=" + keys
142
+ let imageSRC = link + "captcha.php?code=" + json . result . code + "&token=" + tokens + "&key=" + keys
127
143
code . innerHTML = "<img id=\"" + imageID + "\" src=\"" + imageSRC + "\">"
128
144
let image = code . querySelector ( "#" + imageID )
129
145
// code.innerHTML+="<a onclick=\"document.querySelector('#"+imageID+"').src='"+imageSRC+"'\">reload</a>"
172
188
output : output ,
173
189
} )
174
190
count ++
175
- } , "index.php" , {
191
+ } , link + "index.php" , {
176
192
method : "create" ,
177
193
key : keys ,
178
194
} , {
189
205
* @return struct
190
206
**/
191
207
window . thinCaptcha = {
208
+ setLink : setLink ,
192
209
apply : apply ,
193
210
setKey : setKey ,
194
211
ajax : ajax ,
Original file line number Diff line number Diff line change 61
61
</div>
62
62
<script type="text/javascript">
63
63
window.addEventListener("load", function() {
64
+ thinCaptcha.setLink("http://localhost/matno3/SampleCaptchaAPI/src/")
64
65
thinCaptcha.setKey("x1x1x1x1x1x1", "d4f5g6df4gd5f6ge4r89rf48")
65
66
thinCaptcha.apply("#thincaptcha-form1", "#thincaptcha-code1");
66
67
})
You can’t perform that action at this time.
0 commit comments