aboutsummaryrefslogtreecommitdiff
path: root/console/src
diff options
context:
space:
mode:
authorecho <91651232+exhq@users.noreply.github.com>2022-08-29 21:57:04 +0430
committerecho <91651232+exhq@users.noreply.github.com>2022-08-29 21:57:04 +0430
commit3856f9e25ea2fca1366223e5dd95c4ad12800e3c (patch)
tree8bde46c41b18562f2c5a4a41057299051362304b /console/src
parent680750abf54e831ed20050ad6df0ca4a7e2ec4ad (diff)
downloadexhq.github.io-3856f9e25ea2fca1366223e5dd95c4ad12800e3c.tar.gz
exhq.github.io-3856f9e25ea2fca1366223e5dd95c4ad12800e3c.tar.bz2
exhq.github.io-3856f9e25ea2fca1366223e5dd95c4ad12800e3c.zip
added the function "redirect".
and a surprise for m*crosoft likers ;)
Diffstat (limited to 'console/src')
-rw-r--r--console/src/jsMain/kotlin/main.kt18
1 files changed, 16 insertions, 2 deletions
diff --git a/console/src/jsMain/kotlin/main.kt b/console/src/jsMain/kotlin/main.kt
index 37c99b4..f810c55 100644
--- a/console/src/jsMain/kotlin/main.kt
+++ b/console/src/jsMain/kotlin/main.kt
@@ -7,7 +7,7 @@ import moe.nea89.website.*
import styled.injectGlobal
import kotlin.time.Duration.Companion.milliseconds
-val isnickrude = true
+var isnickrude = true
val defaultFileSystem = fileSystem {
"etc" {
"passwd" text "hunter2"
@@ -21,7 +21,14 @@ val defaultFileSystem = fileSystem {
}
"flag" text "CTF{12345abcdefghijklmonp3.1.4.1.5.9.2.8}"
}
-
+fun redirect(arg: String){
+ if(arg.matches("(https://|http://).*")){
+ window.location.href = arg
+ }
+ else{
+ window.location.href = "https://$arg"
+ }
+}
fun main() {
var startupmsg = "type help to get a list of commands"
val root = document.body!!.append.div()
@@ -97,5 +104,12 @@ fun main() {
console.addLine("bro you don have the password smh")
}
})
+ console.registerCommand(command("vscode", "vsc"){
+ console.addLine("ew microsoft")
+ redirect("https://www.youtube.com/watch?v=lpiB2wMc49g")
+ })
+ console.registerCommand(command("testredirect"){
+ redirect(args[0])
+ })
} \ No newline at end of file