Uh oh!
There was an error while loading. Please reload this page.
forked from Sebatyne/staticForMonitoring
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
Latest commit
35 lines (33 loc) · 1.07 KB
/
Copy pathscript.js
File metadata and controls
35 lines (33 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$(document).ready(function(){
functiondoDataUrl(data){
varframe_content=document.getElementsByTagName("iframe")[0].contentWindow;
varb64=btoa(data);
dataurl='data:text/html;base64,'+b64;
$("iframe").attr('src',dataurl);
}
if(window.self===window.top){
//not in an iframe
$(".script").click(function(e){
e.preventDefault();
varmessage=$(this).attr('href');
varslash_pos=message.search('/');
//let's differenciate kind of script called
if(slash_pos===-1||slash_pos===0){
url=message;
}
else{
url='/index.cgi';
}
$("iframe").attr('src',url+'?script='+encodeURIComponent(message));
});
$(".link").click(function(e){
e.preventDefault();
varurl=$(this).attr('href');
$("iframe").attr('src',url);
});
}
else{
//in an iframe
$("body").empty();
}
});