MCPcopy Create free account
hub / github.com/Milkyroad/SCiPNET / deploymentButtonFun

Function deploymentButtonFun

public/src/js/military.js:363–407  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

361
362//nuclear button event handlers
363function deploymentButtonFun() {
364 $('.nuclearButton').off('click.launch');
365 $(".nuclearButton:not(#nuclearCancel)").on('click.deploy', function () {
366 $("#nuclearWarningOuter").fadeIn(500)
367 //typing function
368 type("deploymentTitle", "NUCLEAR DEPLOYMENT PROTOCOL INITIATED (CODE: 38D42 RED)", function () {
369 // TODO: Add username
370 // TODO: Add sound effect
371 type("deploymentContent", `validating action.....Success - Code: 38D42 RED initiated from SCiPNET Local Portal\nunLocking DX-SCP Nuclear Protection System.....Success\nRemoving local cache.....Success\nChecking nuclear weapon status.....all values normal\nConfirming satellites signal.....Success, 15 signals found\n.\n.\n.\n.\n.\nOpening Nuclear Planning Dashboard.....`, function () {
372 setTimeout(function () {
373 $("#nuclearWarningOuter").fadeOut(500)
374 $(".nuclearBannerContent").text("")
375 }, 1000);
376 });
377 });
378 $(".showDash").fadeOut(500, function () {
379 $("#hiddenDash, .nuclearHide").fadeIn(500)
380 })
381 removeMiInterval()
382 globe.resize($("#militaryDashEarth").width(), $("#militaryDashEarth").height())
383 //setup new launching button
384 $("#nuclearText").text("ACTIVATE LAUNCHING PROTOCOL")
385 $(".nuclearButton:not(#nuclearCancel)").attr("id", "launchBtn")
386 //remove previous clicking handler
387 $('.nuclearButton').off('click.deploy');
388 launchButtonFun()
389 $("#targetSearch").unbind('click').bind('click', function () {
390 var search = $("#nuclearSearch").val().trim()
391 if (search != "") {
392 $("#nuclearSearch").val("")
393 $("#locationRes").text("LOCATION: LOCATING...")
394 $.getJSON(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(search)}&format=json&accept-language=en-US`, function (data) {
395 searchMarker(data)
396 }).fail(function () {
397 $.getJSON(`https://api.mapbox.com/geocoding/v5/mapbox.pladces/${encodeURIComponent(search)}.json?access_token=${config.MAPBOX}&cachebuster=1633085782227&autocomplete=false&limit=1`, function (data) {
398 mapProvider = 2
399 searchMarker(data)
400 }).fail(function () {
401 $("#locationRes").html(`LOCATION: <span class="redColour">FAILED TO FETCH LOCATION</span>`);
402 })
403 })
404 }
405 })
406 });
407}
408
409function launchButtonFun() {
410 $(".nuclearButton:not(#nuclearCancel)").on('click.launch', function () {

Callers 2

cancelButtonFunFunction · 0.85
military.jsFile · 0.85

Calls 5

typeFunction · 0.85
launchButtonFunFunction · 0.85
searchMarkerFunction · 0.85
resizeMethod · 0.80
$Function · 0.50

Tested by

no test coverage detected