forked from red-stone-network/clockwork
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-template.js
More file actions
36 lines (27 loc) · 1.1 KB
/
app-template.js
File metadata and controls
36 lines (27 loc) · 1.1 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
36
function start() {
////MADE FOR VERSION 0.14.0 SCRIPT SYSTEM////
////CONFIG////
var link = "https://lukasexists.netlify.app/notepad/index.html"; // link to app webpage
var title = "Notepad"; // title shown in navbar
var id = "https://redstone-nw.netlify.app/clockwork-app/notepad.js"; // set this to the url location of your script
////SCRIPT////
var ExampleLink = document.createElement("a");
var ExampleIFrame = document.createElement("iframe");
ExampleIFrame.style = "display: none;";
ExampleIFrame.className = "app "+id;
ExampleIFrame.id = id;
ExampleIFrame.src = "about:blank";
ExampleLink.href = "javascript:openapp('"+ ExampleIFrame.id +"','" + link + "');" ;
ExampleLink.innerHTML = title;
ExampleLink.className = id;
ExampleLink.addEventListener('dblclick', (e) => {
uninstallApp(ExampleIFrame.id);
});
ExampleLink.addEventListener('contextmenu', (e) => {
e.preventDefault();
closeApp(ExampleIFrame.id);
});
document.getElementById("navbar").appendChild(ExampleLink);
document.getElementById("main").appendChild(ExampleIFrame);
}
start();