mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +01:00
Revert "Removed jQuery from snowflake devices" (#55272)
* Revert "Removed jQuery from snowflake devices (#55090)"
This reverts commit ee47cb5289.
* linting SUCKS
This commit is contained in:
@@ -55,6 +55,7 @@
|
||||
dat += {"
|
||||
|
||||
<head>
|
||||
<script src="[SSassets.transport.get_asset_url("jquery.min.js")]"></script>
|
||||
<script type='text/javascript'>
|
||||
|
||||
function updateSearch(){
|
||||
@@ -69,16 +70,10 @@
|
||||
if(filter.value == ""){
|
||||
return;
|
||||
}else{
|
||||
var body_data = document.querySelector("#maintable_data");
|
||||
var found_data = body_data.querySelectorAll("table input");
|
||||
if(found_data.length >0){
|
||||
for(var i=0; i < found_data.length; i++){
|
||||
var elm = found_data\[i\];
|
||||
if(elm.value.toLowerCase().indexOf(filter) == -1)
|
||||
elm.parentElement.parentElement.parentElement.removeChild(elm.parentElement.parentElement)
|
||||
// elm.parentElement.parentElement.parentElement.style.visibility = "hidden";
|
||||
}
|
||||
}
|
||||
$("#maintable_data").children("tbody").children("tr").children("td").children("input").filter(function(index)
|
||||
{
|
||||
return $(this)\[0\].value.toLowerCase().indexOf(filter) == -1
|
||||
}).parent("td").parent("tr").hide()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,8 +86,10 @@
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
"}
|
||||
dat += {"<p style='text-align:center;'>"}
|
||||
dat += {"
|
||||
<p style='text-align:center;'>"}
|
||||
dat += "<A href='?src=[REF(src)];choice=New Record (General)'>New Record</A><BR>"
|
||||
//search bar
|
||||
dat += {"
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
if(!check_rights())
|
||||
return
|
||||
var/datum/asset/asset_datum = get_asset_datum(/datum/asset/simple/namespaced/common)
|
||||
asset_datum.send(usr.client||src)
|
||||
asset_datum.send()
|
||||
//Could somebody tell me why this isn't using the browser datum, given that it copypastes all of browser datum's html
|
||||
var/dat = {"
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
|
||||
|
||||
/datum/asset/simple/jquery
|
||||
legacy = TRUE
|
||||
assets = list(
|
||||
"jquery.min.js" = 'html/jquery.min.js',
|
||||
)
|
||||
|
||||
@@ -42,6 +42,8 @@ Notes:
|
||||
/datum/tooltip/New(client/C)
|
||||
if (C)
|
||||
owner = C
|
||||
var/datum/asset/stuff = get_asset_datum(/datum/asset/simple/jquery)
|
||||
stuff.send(owner)
|
||||
owner << browse(file2text('code/modules/tooltip/tooltip.html'), "window=[control]")
|
||||
|
||||
..()
|
||||
|
||||
@@ -87,10 +87,8 @@
|
||||
<div id="wrap" class="wrap">
|
||||
<div id="content" class="content"></div>
|
||||
</div>
|
||||
<script type="text/javascript" src="jquery.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function eventOnMouseover() {
|
||||
tooltip.hide();
|
||||
};
|
||||
var tooltip = {
|
||||
'tileSize': 32,
|
||||
'control': '',
|
||||
@@ -208,18 +206,18 @@
|
||||
|
||||
//alert(mapWidth+' | '+mapHeight+' | '+tilesShown+' | '+realIconSize+' | '+leftOffset+' | '+topOffset+' | '+left+' | '+top+' | '+posX+' | '+posY); //DEBUG
|
||||
|
||||
document.getElementsByTagName("body").className = tooltip.theme;
|
||||
var content = document.getElementById("content");
|
||||
var wrap = document.getElementById("wrap");
|
||||
$('body').attr('class', tooltip.theme);
|
||||
|
||||
content.removeEventListener("onmouseover", eventOnMouseover);
|
||||
content.innerHTML = tooltip.text;
|
||||
wrap.style = ''
|
||||
wrap.style.width = (parseInt(wrap.width,10) + 2) + "px";//Dumb hack to fix a bizarre sizing bug
|
||||
// 11/15/2020 - WarlockD, Note, I have no idea what sizing bug they are talking about here
|
||||
var $content = $('#content'),
|
||||
$wrap = $('#wrap');
|
||||
$wrap.attr('style', '');
|
||||
$content.off('mouseover');
|
||||
$content.html(tooltip.text);
|
||||
|
||||
var docWidth = wrap.offsetWidth;
|
||||
docHeight = wrap.offsetHeight;
|
||||
$wrap.width($wrap.width() + 2); //Dumb hack to fix a bizarre sizing bug
|
||||
|
||||
var docWidth = $wrap.outerWidth(),
|
||||
docHeight = $wrap.outerHeight();
|
||||
|
||||
if (posY + docHeight > map.size.y) { //Is the bottom edge below the window? Snap it up if so
|
||||
posY = (posY - docHeight) - realIconSizeY - tooltip.padding;
|
||||
@@ -228,11 +226,13 @@
|
||||
//Actually size, move and show the tooltip box
|
||||
window.location = 'byond://winset?id='+tooltip.control+';size='+docWidth+'x'+docHeight+';pos='+posX+','+posY+';is-visible=true';
|
||||
|
||||
content.addEventListener("onmouseover", eventOnMouseover);
|
||||
$content.on('mouseover', function() {
|
||||
tooltip.hide();
|
||||
});
|
||||
},
|
||||
update: function(params, client_vw , clien_vh , text, theme, special) {
|
||||
//Assign our global object
|
||||
tooltip.params = JSON.parse(params);
|
||||
tooltip.params = $.parseJSON(params);
|
||||
tooltip.client_view_w = parseInt(client_vw);
|
||||
tooltip.client_view_h = parseInt(clien_vh);
|
||||
tooltip.text = text;
|
||||
|
||||
Reference in New Issue
Block a user