mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2025-12-10 13:31:14 +00:00
Massive backend updoot: Juke Build, TGUI upgrades, Soft Ping, and too much to list! (#3990)
* Time to become our TGUI God. * Visually sprucing the copyrights. These shouldn't be ignored :) * babababa * https://github.com/tgstation/tgstation/pull/50422 * dooootdooot * Holy fuck Updates the tools folder Updates our build tooling Updates TGUI MASSIVELY I'm going to go scream in a hole now * ?? * Was it this dum thing? * orrrr * It's this isn't it * Did it manually * hubah * TGUI Changelog * oops * What if I use the original? * Lets try this again * Shit commenting out for now * asdasd * Fuck it use the old one and remember to replace later * Updates yarn.lock * Lets try something horrid * Nope it HATES THAT * fucc * The great eslinting * HOLY SHIT * Final? * ? * asd tgstation/tgstation/pull/59914 tgstation/tgstation/pull/66317 * Improved Asset handling. * Oops * Subsystem stuff * Recompiles the Changelong again. * Finally Fixed Communicators * Compiled Changelogs... AGAIN
This commit is contained in:
47
code/_js/byjax.dm
Normal file
47
code/_js/byjax.dm
Normal file
@@ -0,0 +1,47 @@
|
||||
//this function places received data into element with specified id.
|
||||
#define js_byjax {"
|
||||
|
||||
function replaceContent() {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var id = args\[0\];
|
||||
var content = args\[1\];
|
||||
var callback = null;
|
||||
if(args\[2\]){
|
||||
callback = args\[2\];
|
||||
if(args\[3\]){
|
||||
args = args.slice(3);
|
||||
}
|
||||
}
|
||||
var parent = document.getElementById(id);
|
||||
if(typeof(parent)!=='undefined' && parent!=null){
|
||||
parent.innerHTML = content?content:'';
|
||||
}
|
||||
if(callback && window\[callback\]){
|
||||
window\[callback\].apply(null,args);
|
||||
}
|
||||
}
|
||||
"}
|
||||
|
||||
/*
|
||||
sends data to control_id:replaceContent
|
||||
|
||||
receiver - mob
|
||||
control_id - window id (for windows opened with browse(), it'll be "windowname.browser")
|
||||
target_element - HTML element id
|
||||
new_content - HTML content
|
||||
callback - js function that will be called after the data is sent
|
||||
callback_args - arguments for callback function
|
||||
|
||||
Be sure to include required js functions in your page, or it'll raise an exception.
|
||||
*/
|
||||
/proc/send_byjax(receiver, control_id, target_element, new_content=null, callback=null, list/callback_args=null)
|
||||
if(receiver && target_element && control_id) // && winexists(receiver, control_id))
|
||||
var/list/argums = list(target_element, new_content)
|
||||
if(callback)
|
||||
argums += callback
|
||||
if(callback_args)
|
||||
argums += callback_args
|
||||
argums = list2params(argums)
|
||||
|
||||
receiver << output(argums,"[control_id]:replaceContent")
|
||||
return
|
||||
37
code/_js/menus.dm
Normal file
37
code/_js/menus.dm
Normal file
@@ -0,0 +1,37 @@
|
||||
#define js_dropdowns {"
|
||||
function dropdowns() {
|
||||
var divs = document.getElementsByTagName('div');
|
||||
var headers = new Array();
|
||||
var links = new Array();
|
||||
for(var i=0;i<divs.length;i++){
|
||||
if(divs\[i\].className=='header') {
|
||||
divs\[i\].className='header closed';
|
||||
divs\[i\].innerHTML = divs\[i\].innerHTML+' +';
|
||||
headers.push(divs\[i\]);
|
||||
}
|
||||
if(divs\[i\].className=='links') {
|
||||
divs\[i\].className='links hidden';
|
||||
links.push(divs\[i\]);
|
||||
}
|
||||
}
|
||||
for(var i=0;i<headers.length;i++){
|
||||
if(typeof(links\[i\])!== 'undefined' && links\[i\]!=null) {
|
||||
headers\[i\].onclick = (function(elem) {
|
||||
return function() {
|
||||
if(elem.className.search('visible')>=0) {
|
||||
elem.className = elem.className.replace('visible','hidden');
|
||||
this.className = this.className.replace('open','closed');
|
||||
this.innerHTML = this.innerHTML.replace('-','+');
|
||||
}
|
||||
else {
|
||||
elem.className = elem.className.replace('hidden','visible');
|
||||
this.className = this.className.replace('closed','open');
|
||||
this.innerHTML = this.innerHTML.replace('+','-');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
})(links\[i\]);
|
||||
}
|
||||
}
|
||||
}
|
||||
"}
|
||||
Reference in New Issue
Block a user