diff options
| author | oweissbarth | 2014-06-06 08:47:30 +0200 |
|---|---|---|
| committer | oweissbarth | 2014-06-06 08:47:30 +0200 |
| commit | a0dbcc1c9c510ce13168e16cea08b1bcfea6f2bd (patch) | |
| tree | 6c18d5df57caaa7d9f7f87e0e011b508ac438def /www | |
| parent | cba7002e3cae72c6d9588909a5dcc630706692dc (diff) | |
| download | files.iamfabulous.de-a0dbcc1c9c510ce13168e16cea08b1bcfea6f2bd.tar.gz | |
Added basic contextmenu. No functionality!
Diffstat (limited to 'www')
| -rw-r--r-- | www/browse.php | 34 | ||||
| -rwxr-xr-x | www/static/header.html | 2 |
2 files changed, 33 insertions, 3 deletions
diff --git a/www/browse.php b/www/browse.php index ceb1be7..4e12694 100644 --- a/www/browse.php +++ b/www/browse.php @@ -61,6 +61,19 @@ function browse($content){ 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; + } + function hideMenu() { + document.getElementById("context-menu").style.display = "none"; + } </script> <div id="new-folder-bg"> <div id="new-folder-area"> @@ -89,7 +102,24 @@ function browse($content){ </form> </div> </div> - <table cellspacing="0">'.$file_list.'</table>'; + + + <table oncontextmenu="return false" onmousedown="hideMenu()" cellspacing="0" >'.$file_list.'</table> + + + <div id="context-menu" style="display:none"> + <table> + <tr> + <td>rename</td> + </tr> + <tr> + <td>delete</td> + </tr> + <tr> + <td>set permissions</td> + </tr> + </table> + </div>'; include("static/footer.html"); } @@ -105,7 +135,7 @@ function get_icon($file){ function get_link($file){ $slash = (($_GET["folder"]!="" && substr($_GET["folder"], -1) != "/"))? "/" : ""; - return '<a class="file" href="/'.$_GET["name"]."/".$_GET["folder"].$slash.$file[3].'/">'; + return '<a oncontextmenu="showMenu(event)" class="file" href="/'.$_GET["name"]."/".$_GET["folder"].$slash.$file[3].'/">'; } function get_item($file){ diff --git a/www/static/header.html b/www/static/header.html index c1b0c46..d426333 100755 --- a/www/static/header.html +++ b/www/static/header.html @@ -6,7 +6,7 @@ <link rel="stylesheet" href="/static/font-awesome/css/font-awesome.min.css"> </head> - <body> + <body onmousedown="hideMenu()"> <div id="page-wrap"> <div class="header-bar"> |
