Improved Wiki Button (#15147)

* Improved Wiki Button

* delete redundant popup

Co-authored-by: Kyep <Kyep@users.noreply.github.com>
This commit is contained in:
Kyep
2021-01-10 20:11:04 +00:00
committed by GitHub
co-authored by Kyep
parent 66d0852444
commit f6b80268d7
2 changed files with 6 additions and 9 deletions
+1 -8
View File
@@ -261,14 +261,7 @@ SUBSYSTEM_DEF(changelog)
if("forum")
usr.client.forum()
if("wiki")
// Wiki needs snowflake because it has no cancel button
if(config.wikiurl)
if(alert("This will open the wiki in your browser. Are you sure?",,"Yes","No")=="No")
return
usr.client.wiki()
else
to_chat(usr, "<span class='danger'>The Wiki URL is not set in the server configuration. Please inform the server host.</span>")
usr.client.wiki()
if("github")
usr.client.github()
// Takes a PR number as argument
+5 -1
View File
@@ -4,8 +4,12 @@
set desc = "Type what you want to know about. This will open the wiki in your web browser."
set hidden = 1
if(config.wikiurl)
if(alert("Open the wiki in your browser?", null, "Yes", "No") == "Yes")
var/query = stripped_input(src, "Enter Search:", "Wiki Search", "Homepage")
if(query == "Homepage")
src << link(config.wikiurl)
else if(query)
var/output = config.wikiurl + "/index.php?title=Special%3ASearch&profile=default&search=" + query
src << link(output)
else
to_chat(src, "<span class='danger'>The wiki URL is not set in the server configuration.</span>")
return