Advertisement
undefined0000

IntorNET - index

Dec 12th, 2011
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.65 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.        
  5.      <SCRIPT LANGUAGE="JavaScript">
  6. <!--
  7. var currapp = "";
  8. var text="Int0RNet";
  9. var delay=50;
  10. var currentChar=1;
  11. function fileType(file) {
  12.     if(file.indexOf(".txt")) {
  13.        // alert("text");
  14.         return "text";
  15.         }
  16.         else if(file.indexOf(".jpg") || file.indexOf(".png") || file.indexOf(".gif")) {
  17.             return "picture";
  18.             }
  19.             else if(file.indexOf(".hpl")) {
  20.                 return "humanprogramming";
  21.                 }
  22.                 else {
  23.                 alert("The fuck?");
  24.                 }
  25.     }
  26. function openFile(file) {
  27.     var type=fileType(file);
  28.   //  alert("Opening: " + file);
  29.    switch(type) {
  30.        case "text":
  31.         var respondy = callPHP('action=openfile&file=' + file,'gEdit.php');
  32.            showHide("home");
  33.          //  alert(file);
  34.        document.getElementById('geditContainer').style.display = "block"
  35.  
  36.      
  37.         document.getElementById("textz").value = respondy;
  38.        
  39.            break;
  40.            default:
  41.                alert("It broke");
  42.                
  43.        }
  44.     }
  45. function callPHP(params, file) {
  46.     var httpc = new XMLHttpRequest(); // simplified for clarity
  47.     var url = file;
  48.     httpc.open("POST", url, true); // sending as POST
  49.  
  50.     httpc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  51.     httpc.setRequestHeader("Content-Length", params.length - 1); // POST request MUST have a Content-Length header (as per HTTP/1.1)
  52.  
  53.     httpc.onreadystatechange = function() { //Call a function when the state changes.
  54.     if(httpc.readyState == 4 && httpc.status == 200) { // complete and no errors
  55.        var response = httpc.responseText; // some processing here, or whatever you want to do with the response
  56.        return response;
  57.        
  58.         }
  59.     }
  60.     httpc.send(params);
  61. }
  62. function gSaveAs() {
  63.  
  64.     var filename = prompt("Please Enter A File Name.","untitled document.txt");
  65.    callPHP('filename=' + filename + "&action=save&content=" + document.getElementById("textz").value, "gEdit.php");
  66.     }
  67.  
  68. function showHide(id) {
  69.  
  70. var element = document.getElementById(id);
  71. if(element.style.display == 'none') {
  72.     element.style.display = 'block';
  73.    }
  74.    else {
  75.        element.style.display = 'none';
  76.        }
  77.      
  78.     }
  79.  
  80. function type()
  81. {
  82.  
  83.    
  84.     document.title=text.substr(0, currentChar);
  85.       currentChar++
  86.       if (currentChar>text.length)
  87.       {
  88.         currentChar=1;
  89.        // setTimeout("type()", 5000);
  90.       }
  91.       else
  92.       {
  93.         setTimeout("type()", delay);
  94.       }
  95.     }
  96.  
  97. function startTyping(textParam, delayParam)
  98. {
  99.   text=textParam;
  100.   delay=delayParam;
  101.   currentChar=1;
  102.  
  103.   type();
  104. }
  105. window.onload= function() {
  106. startTyping(text, 1000,"typerDiv");
  107. }
  108. //-->
  109. </SCRIPT>
  110.              
  111.            
  112.         <style>
  113.             #geditContainer {
  114.                  position: absolute;
  115.                 left: 10px;
  116.                 top: 50px;
  117.                        width:100%;
  118.                 height: 100%;
  119.                 background-color:#000000;
  120.                 font-size: 11px;
  121.              z-index:01;
  122.               display: none;
  123.                
  124.             }
  125.             #geditFile {
  126.                 position: absolute;
  127.                 left: 10px;
  128.                 top: 50px;
  129.                        width:75px;
  130.                 height: auto;
  131.                 background-color:#333333;
  132.                 font-size: 11px;
  133.              z-index:99;
  134.               display: none;
  135.                
  136.             }
  137.             textarea {
  138.                 overflow: auto;
  139.                 background-color: #000000;
  140.                 color: #00FF00;
  141.                 font-family: monospace, courier, system;
  142.             }
  143.             body {
  144.                 background-color: #000000;
  145.                 color: #00FF00;
  146.                 font-family: monospace,courier, system,courier new;
  147.             }
  148.             #topPanel {
  149.                
  150.                 border: 1px green dashed;
  151.                 width: 100%;
  152.                 height: 20px;
  153.                 font-size:13px;
  154.                text-transform: lowercase;
  155.             }
  156.             a {
  157.                 color: green;
  158.                 text-decoration: none;
  159.             }
  160.             #app {
  161.               width:150px;
  162.                 height: 100%;
  163.                 background-color:#333333;
  164.                 font-size: 11px;
  165.              z-index:99;
  166.               display: none;
  167.                
  168.             }
  169.             table {
  170.                 border: 1px green dashed;
  171.                 vertical-align: middle;
  172.                 width: 100%;
  173.                
  174.             }
  175.             #acc {
  176.                 left:154px;
  177.                 top: 32px;
  178.                 position: absolute;
  179.                 display: none;
  180.                   width:150px;
  181.            
  182.                 background-color:#333333;
  183.                 font-size: 11px;
  184.              z-index:99;
  185.               display: none;
  186.             }
  187.             #dashboard {
  188.                
  189.                 border: 1px green dashed;
  190.                 width: 99%;
  191.                 height: 95%;
  192.                 position: absolute;
  193.                 top:31px;
  194.                 z-index:-1;
  195.                
  196.             }
  197.             #home {
  198.                   position: absolute;
  199.                 left: 10px;
  200.                 top: 50px;
  201.                        width:100%;
  202.                 height: 100%;
  203.                 background-color:#000000;
  204.                 font-size: 11px;
  205.              z-index:01;
  206.               display: none;
  207.                
  208.             }
  209.             </style>
  210.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  211.         <title></title>
  212.     </head>
  213.     <body>
  214.         <div id="topPanel""><a href="#" onClick="showHide('app');">Applications</a>&nbsp;<a href="#" onclick="showHide('home');">Places</a>&nbsp;<a href="#" onclick="system();">System</a></div>
  215.         <div id="app">
  216.             <table>
  217.       <tr><td>{}</td><td><a href="#" onClick="showHide('acc');">Accessories |></a></td></tr>
  218.       <tr><td>{}</td><td>Games</td></tr>
  219.       <tr><td>{}</td><td>Chat</td></tr>
  220.             </table>
  221.              <div id="acc"><a href="#" onclick="showHide('geditContainer');">gedit</a></div>
  222.         </div>
  223.         <div id="dashboard">
  224.            
  225.             <div id="geditContainer">
  226.                  <div id="geditFile">
  227.             <a href="#" onclick="gSaveAs();"><u>S</u>ave As...</a><br>
  228.             <a href="#" onClick="showHide('geditContainer');">Close</a>
  229.         </div>
  230.             <div  style='height:20px; width:100%; border: 1px green solid;' id='menubar'><input type='button' value='File' onClick="showHide('geditFile');"><u>F</u>ile&nbsp;<u></a><a href='#'>E</u>dit</a>&nbsp;<a href='#'><u>V</u>iew</a></div>
  231.             <div id='textarea' style='position:absolute; left: 10px; top: 35px; border: 1px white dotted;'><textarea id="textz" rows='25' cols='100'></textarea> </div>
  232.             </div>
  233.            
  234.             <div id="home">
  235.                <?php
  236.                $results = array();
  237.                $handler = opendir("users/home/root/");
  238.                while($file = readdir($handler)) {
  239.                    if($file !="." && $file != "..") {
  240.                        $results[] = $file;
  241.                        }
  242.                    }
  243.                    closedir($handler);
  244.                    foreach($results as $i) {
  245.                        print "<a href='#' onclick=\"openFile('" . $i ."');\">" . $i . "</a><br>";
  246.                        
  247.                        }
  248.                    
  249.                ?>
  250.             </div>
  251.         </div>
  252.        
  253.     </body>
  254. </html>
  255.  
  256.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement