-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeskCode.html
239 lines (232 loc) · 14.6 KB
/
DeskCode.html
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Nouveau fichier code - DeskCode</title>
<link rel="icon" href="Res/fichier (4).png" type="image/x-icon">
<link rel="stylesheet" href="Lib/MonacoEditor/dev/vs/editor/editor.main.css" />
<link rel="stylesheet" href="Lib/OfficialDeskCodeLib/Dev/style/editormain.css">
</head>
<body>
<div id="loader">
<img class="imgloaderorg" src="Res/fichier (4).png">
<div class="bottom-content">
<img src="Res/logo-text-big-partionaria.png">
</div>
</div>
<div class="editor_main">
<div class="editor_workspace">
<div class="editor_workspace_leftbar">
<button style="object-fit: contain;" class="tabs-on-sidebar" class="padd" onclick="openTab('Coscript')"><img src="Res/logo-co-script-solo.png"></button>
<button class="tabs-on-sidebar" onclick="hideorshowterminal()"><img src="Res/square-terminal.png"></button>
<button class="tabs-on-sidebar" class="padd" onclick="openTab('file')"><img src="Res/document.png"></button>
<button class="tabs-on-sidebar" class="padd" onclick="openTab('propriete')"><img src="Res/settings-sliders.png"></button>
</div>
<div class="editor_workspace_leftbar_menu">
<div id="searchbar">
</div>
<div id="CoscriptTab" class="tabcontent">
<div class="TabName_sous_jacent">
<h1>Co-script</h1>
<button id="button_close_tab" onclick="CloseAllTabs()">X</button>
</div>
<img id="cosriptlogo" src="Res/logo-co-script.png" alt="co-script logo">
<input type="text" id="searchInput" onkeydown="searchCode()" placeholder="Entrez votre recherche...">
<div id="results"></div>
</div>
<!-- file tab -->
<div id="fileTab" class="tabcontent">
<div class="TabName_sous_jacent">
<h1>Fichier/Dossier</h1>
<button id="button_close_tab" onclick="CloseAllTabs()">X</button>
</div>
<div class="explorer">
<div class="files" id="fileList">
<!-- Ici seront ajoutés dynamiquement les fichiers -->
</div>
<h1>Aucun fichier ouvert</h1>
<h2>Vous n'avez ouvert aucun fichier pour le moment</h2>
<button id="button-open-folder">Ouvrir un dossier</button>
<h2>L'ouverture d'un fichier vous permettera de travailler dessus !</h2>
</div>
</div>
<!-- prop tab -->
<div id="proprieteTab" class="tabcontent">
<div class="TabName_sous_jacent">
<h1>Propriété</h1>
<button id="button_close_tab" onclick="CloseAllTabs()">X</button>
</div>
<div id="proporeteclass">
<h1>Paramètre généraux</h1>
<p>Nom du fichier</p>
<input type="text" id="file-name" value="Nouveau fichier code">
<p>Type de fichier</p>
<input type="text" id="file-type" value="Main file()" readonly>
<h1>Paramètre de langages</h1>
<p>Selection du langage</p>
<select id="language-selection">
<option value="html">HTML</option>
<option value="javascript">JavaScript</option>
<option value="css">CSS</option>
<option value="typescript">TypeScript</option>
<option value="json">JSON</option>
<option value="python">Python</option>
<option value="c">C</option>
<option value="cpp">C++</option>
<option value="asm">Assembleur</option>
<option value="sass">Sass</option>
<option value="scss">SCSS</option>
<option value="less">LESS</option>
<option value="stylus">Stylus</option>
<option value="coffee">CoffeeScript</option>
<option value="lua">Lua</option>
<option value="perl">Perl</option>
<option value="bash">Bash</option>
<option value="r">R</option>
<option value="swift">Swift</option>
<option value="rust">Rust</option>
<option value="go">Go</option>
<option value="php">PHP</option>
<option value="java">Java</option>
<option value="ruby">Ruby</option>
<option value="vb">VB.NET</option>
<option value="scala">Scala</option>
<option value="kotlin">Kotlin</option>
<option value="typescript">TypeScript</option>
<option value="perl">Perl</option>
<option value="powershell">PowerShell</option>
<option value="haskell">Haskell</option>
<option value="elixir">Elixir</option>
<option value="erlang">Erlang</option>
<option value="d">D</option>
<option value="clojure">Clojure</option>
<option value="f#">F#</option>
<option value="ocaml">OCaml</option>
<option value="racket">Racket</option>
<option value="julia">Julia</option>
<option value="nim">Nim</option>
<option value="pascal">Pascal</option>
<option value="scheme">Scheme</option>
<option value="verilog">Verilog</option>
<option value="vhdl">VHDL</option>
<option value="yaml">YAML</option>
</select>
<p>Selection du dubuger</p>
<select id="debug-language-selection">
<option value="html">DeskTolls Compilateur pour HTML</option>
</select>
<button onclick="applyLanguage()">Appliquer</button>
<h1>Paramètre de connexion</h1>
</div>
<div id="emailDisplay">
<button id="Conn-btn" onclick="openPopup()">Connectez vous</button>
</div>
</div>
</div>
<div class="editor_code_main">
<div id="top_bar">
<div class="menu-container">
<div class="dropdown">
<button class="dropdown-button">Fichier</button>
<div class="dropdown-content">
<a class="dropdown-item" href="javascript:saveFile()">Sauvegarder<span class="shortcut">CTRL + S</span></a>
<a class="dropdown-item" href="javascript:openFile()">Ouvrir depuis l'ordinateur</a>
<a class="dropdown-item" href="javascript:addTab()">Nouveau fichier<span class="shortcut">CTRL + Q</span></a>
<a class="dropdown-item" href="javascript:openTab('Coscript')">Ouvrir Co-scipt</a>
<a class="dropdown-item" href="javascript:clearTabs()">Effacer tout les onglets<span class="shortcut">CTRL + P</span></a>
<a class="dropdown-item" href="index.html">Quitter<span class="shortcut">CTRL + ALT + C</span></a>
</div>
</div>
<div class="dropdown">
<button class="dropdown-button">Editer</button>
<div class="dropdown-content">
<a class="dropdown-item" href="javascript:undo()">Annuler<span class="shortcut">CTRL + Z</span></a>
<a class="dropdown-item" href="javascript:redo()">Rétablir<span class="shortcut">CTRL + Y</span></a>
<a class="dropdown-item" href="javascript:copy()">Copier<span class="shortcut">CTRL + C</span></a>
<a class="dropdown-item" href="javascript:cut()">Couper<span class="shortcut">CTRL + X</span></a>
<a class="dropdown-item" href="javascript:paste()">Coller<span class="shortcut">CTRL + V</span></a>
</div>
</div>
<div class="dropdown">
<button class="dropdown-button">Run</button>
<div class="dropdown-content">
<a class="dropdown-item" href="javascript:debugHtmlEditor()">Commencer debuging<span class="shortcut">F9</span></a>
<a class="dropdown-item" href="javascript:printToTerminal('Current language : HTML')">Selectionner un language<span class="shortcut">ALTGR + N</span></a>
</div>
</div>
<div class="dropdown">
<button class="dropdown-button">Terminal</button>
<div class="dropdown-content">
<a class="dropdown-item" href="javascript:hideorshowterminal()">Open terminal<span class="shortcut">CTRL + ù</span></a>
<a class="dropdown-item" href="javascript:hideorshowterminal()">Run task<span class="shortcut">F5</span></a>
<a class="dropdown-item" href="javascript:hideorshowterminal()">Buid task<span class="shortcut">Indisponible</span></a>
</div>
</div>
</div>
</div>
<div id="tabs">
</div>
<div id="editor">
</div>
<div id="terminaldiv">
<div class="TabName_sous_jacent">
<h1>Terminal de commande</h1>
<button id="button_close_tab" onclick="hideorshowterminal()">X</button>
</div>
<div id="terminal" class="terminal"></div>
<input type="text" id="terminalboxtextinput" placeholder="Saisisez votre commande ici ...">
</div>
</div>
</div>
<div id="editor_bottom-bar">
<button class="Connection-button" onclick="debugHtmlEditor()"><img src="Res/play.png"> Simulator</button>
<button class="Connection-button" onclick="openPopup()"><img src="Res/times-hexagon.png"> Error</button>
<button class="Connection-button" onclick="openPopup()"><img src="Res/exclamation.png"> Warning</button>
</div>
</div>
<script>
// Fonction pour rediriger si la largeur de l'écran est inférieure à 900px
function redirectToDeskCodePage() {
var isSupported = document.documentElement.clientWidth >= 900;
if (isSupported) {
return true;
} else {
window.location.href = 'index.html';
}
}
redirectToDeskCodePage();
//-----------------------------------------------------------------------Gestion de la connection a prismID-----------------------------------------------
var popupWindow;
// Fonction pour ouvrir la fenêtre contextuelle
function openPopup() {
var width = 500;
var height = 600;
var left = (window.innerWidth - width) / 2;
var top = (window.innerHeight - height) / 2;
var options = 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left;
popupWindow = window.open('auth/0/Connection.html', 'Popup', options);
}
// Fonction appelée après la connexion réussie dans la fenêtre contextuelle
function onLoginSuccess(userInfo) {
// Extrayez l'e-mail de l'utilisateur
var userEmail = userInfo.email;
var buttonToRemove = document.getElementById('Conn-btn');
var emailDisplay = document.getElementById('emailDisplay');
// Création d'un nouvel élément paragraphe
var newParagraph = document.createElement('p');
emailDisplay.removeChild(buttonToRemove);
// Ajout de texte au paragraphe
newParagraph.textContent = "Bienvenue, " + userEmail;
// Ajout du paragraphe à l'élément 'emailDisplay'
emailDisplay.appendChild(newParagraph);
// Fermez la fenêtre contextuelle après traitement des informations
if (popupWindow) {
popupWindow.close();
}
}
</script>
<script src="Lib/MonacoEditor/dev/vs/loader.js"></script>
<script src="Lib/OfficialDeskCodeLib/Dev/loader.js"></script>
<script src="Lib/OfficialDeskCodeLib/Dev/terminal/main.js"></script>
</body>
</html>