Skip to content

Commit

Permalink
Separate the fs module; In order to ensure the accessibility in other…
Browse files Browse the repository at this point in the history
… regions, CDN was removed.
  • Loading branch information
songquanpeng committed Oct 2, 2019
1 parent a598cf1 commit ef20186
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
<title>Online terminal</title>
<meta name="keywords" content="shell terminal emulator web bash jquery.terminal example">
<meta name="description" content="Online shell (terminal) emulator; 在线终端模拟器">
<script src="https://cdn.staticfile.org/jquery/3.4.1/jquery.js"></script>
<script src="./javascript/jquery.min.js"></script>
<script src="./javascript/jquery.terminal.min.js"></script>
<link href="./stylesheet/jquery.terminal.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./stylesheet/main.css"/>
<script src="./javascript/main.js"></script>
<script type="module" src="./javascript/fs.js"></script>
<script type="module" src="./javascript/main.js"></script>
<link rel="shortcut icon" href="https://raw.githubusercontent.com/microsoft/terminal/master/res/terminal.ico">
</head>
<body>
Expand Down
19 changes: 19 additions & 0 deletions javascript/fs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
let fileSystem = {
"project": {
"python": {
"hello.py": `print("Hello World!")`
},
"nodejs": {
"hello.js": `console.log("Hello World!");`
},
"readme": `This folder contains projects.`
},
"note": {
"studyNote": `I love study`,
"gameNote": `Fortnite is the best game in the world.`,
"readme": `This folder contains notes.`
},
"readme": `This is a virtual file system.`
};

export {fileSystem};
2 changes: 2 additions & 0 deletions javascript/jquery.min.js

Large diffs are not rendered by default.

19 changes: 2 additions & 17 deletions javascript/main.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
import {fileSystem} from "./fs.js";

let nodejsCodeHistory = [];
let sorryStatement = "[[;#9933ff;]I am sorry, this command has not been implemented yet.] [[;#4dff4d;]Maybe you can pull a request?]";
let fileSystem = {
"project": {
"python": {
"hello.py": `print("Hello World!")`
},
"nodejs": {
"hello.js": `console.log("Hello World!");`
},
"readme": `This folder contains projects.`
},
"note": {
"studyNote": `I love study`,
"gameNote": `Fortnite is the best game in the world.`,
"readme": `This folder contains notes.`
},
"readme": `This is a virtual file system.`
};

function isDir(path) {
let current = fileSystem;
Expand Down

0 comments on commit ef20186

Please sign in to comment.