CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
AroriaNetwork

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: AroriaNetwork/TacoProxy
Path: blob/main/public/assets/js/surf.js
Views: 311
1
/* -----------------------------------------------
2
/* MIT license: http://opensource.org/licenses/MIT
3
/* How to use? : Check the documentation. Button ID attributes are used for the script below.
4
/* v2.0.0
5
/* ----------------------------------------------- */
6
$ = e => document.getElementById(e) || [];
7
8
$("tacogithub").href = "https://github.com/Tacosheel/TacoProxy";
9
10
//Alloy Default
11
12
$('alloyframe').onclick = function() {
13
var frame = document.getElementById("frame");
14
var url = $('iurl').value;
15
var det = document.domain;
16
var domain = det.replace('www.', '').split(/[/?#]/)[0];
17
const origin = btoa(url)
18
frame.src = "https://" + domain + "/prefix/" + origin;
19
frame.style['visibility'] = "visible";
20
return false;
21
};
22
23
//Alloy Frame
24
25
$('alloydefault').onclick = function() {
26
var frame = document.getElementById("frame");
27
var url = $('iurl').value;
28
var det = document.domain;
29
var domain = det.replace('www.', '').split(/[/?#]/)[0];
30
const origin = btoa(url)
31
window.location.href = "https://" + domain + "/prefix/" + origin;
32
return false;
33
};
34
35
36
window.onload = function() {
37
$('iurl').focus();
38
}
39
40