summaryrefslogtreecommitdiff
path: root/www/static/js/browser.js
blob: a0e982439a729683411928109b19651913d11086 (plain)
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
37
38
39
40
41
42
43
44

function showNewFolder(){
	document.getElementById("new-folder-bg").style.visibility = "visible";
	
	return;
}
function hideNewFolder(){
	document.getElementById("new-folder-bg").style.visibility = "hidden";
	return;
}

function showUpload(){
		document.getElementById("upload-bg").style.visibility = "visible";
		return;
}
function hideUpload(){
	document.getElementById("upload-bg").style.visibility = "hidden";
	return;
}


function showMenu(e) {
	var posx = e.clientX +window.pageXOffset +"px";
	var posy = e.clientY + window.pageYOffset + "px";
	document.getElementById("context-menu").style.position = "absolute";
	document.getElementById("context-menu").style.display = "inline";
	document.getElementById("context-menu").style.left = posx;
	document.getElementById("context-menu").style.top = posy;
	var source = e.target || e.srcElement;
	var url = source.href;
	
	//set context item commands
	document.getElementById("copy-link").setAttribute("url", url);

	
}
function hideMenu() {
	document.getElementById("context-menu").style.display = "none"; 
}

function copyToClipboard(text){
	window.clip.setText(text);
	alert("done");
}