Uploaded Test files

This commit is contained in:
Batuhan Berk Başoğlu 2020-11-12 11:05:57 -05:00
parent f584ad9d97
commit 2e81cb7d99
16627 changed files with 2065359 additions and 102444 deletions

View file

@ -0,0 +1,63 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
requirejs([
'jquery',
'base/js/utils',
'base/js/page',
'auth/js/loginwidget',
'services/config',
'terminal/js/terminado',
], function(
$,
utils,
page,
loginwidget,
configmod,
terminado
){
"use strict";
requirejs(['custom/custom'], function() {});
page = new page.Page('div#header', 'div#site');
var common_options = {
base_url : utils.get_body_data("baseUrl"),
};
var config = new configmod.ConfigSection('terminal', common_options);
config.load();
var common_config = new configmod.ConfigSection('common', common_options);
common_config.load();
// This makes the 'logout' button in the top right work.
var login_widget = new loginwidget.LoginWidget('span#login_widget', common_options);
var base_url = utils.get_body_data('baseUrl').replace(/\/?$/, '/');
var ws_path = utils.get_body_data('wsPath');
var ws_url = utils.get_body_data('wsUrl');
if (!ws_url) {
// trailing 's' in https will become wss for secure web sockets
ws_url = location.protocol.replace('http', 'ws') + "//" + location.host;
}
ws_url = ws_url + base_url + ws_path;
page.show_header();
var terminal = terminado.make_terminal($("#terminado-container")[0], ws_url);
page.show_site();
utils.load_extensions_from_config(config);
utils.load_extensions_from_config(common_config);
window.onresize = function() {
terminal.term.fit();
// send the new size to the server so that it can trigger a resize in the running process.
terminal.socket.send(JSON.stringify(["set_size", terminal.term.rows, terminal.term.cols,
$(window).height(), $(window).width()]));
};
// Expose terminal for fiddling with in the browser
window.terminal = terminal;
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,38 @@
define (["xterm", "xtermjs-fit"], function(Terminal, fit) {
"use strict";
function make_terminal(element, ws_url) {
var ws = new WebSocket(ws_url);
Terminal.applyAddon(fit);
var term = new Terminal();
ws.onopen = function(event) {
term.on('data', function(data) {
ws.send(JSON.stringify(['stdin', data]));
});
term.on('title', function(title) {
document.title = title;
});
term.open(element);
term.fit();
// send the terminal size to the server.
ws.send(JSON.stringify(["set_size", term.rows, term.cols,
window.innerHeight, window.innerWidth]));
ws.onmessage = function(event) {
var json_msg = JSON.parse(event.data);
switch(json_msg[0]) {
case "stdout":
term.write(json_msg[1]);
break;
case "disconnect":
term.write("\r\n\r\n[CLOSED]\r\n");
break;
}
};
};
return {socket: ws, term: term};
}
return {make_terminal: make_terminal};
});