@@ -139,6 +151,23 @@
randomFactor = $("#randomFactorInput").val();
$("#currentRandomFactor").text(randomFactor);
}
+
+ function zoomIn() {
+ document.getElementById("gameContainer").style.width = "100%"
+ document.getElementById("gameContainer").style.height = "100%";
+ document.getElementById("zoomInGameScreenInput").disabled = true;
+ document.getElementById("zoomOutGameScreenInput").disabled = false;
+ }
+
+ function zoomOut() {
+ var gameContainerWidth = document.getElementById("gameContainer").style.width;
+ var gameContainerHeight = document.getElementById("gameContainer").style.height;
+ document.getElementById("gameContainer").style.width = "50%"
+ document.getElementById("gameContainer").style.height = "50%"
+ document.getElementById("zoomInGameScreenInput").disabled = false;
+ document.getElementById("zoomOutGameScreenInput").disabled = true;
+ }
+
function controlAutoPilot() {
if (autoPilot) {
autoPilot = false;
diff --git a/html5/kubeinvaders.js b/html5/kubeinvaders.js
index 0cc09ff..1005781 100644
--- a/html5/kubeinvaders.js
+++ b/html5/kubeinvaders.js
@@ -77,6 +77,8 @@ var help = false;
var chaos_nodes = true;
var chaos_pods = true;
+var alert_div = '
';
+
function IsJsonString(str) {
try {
JSON.parse(str);
@@ -181,7 +183,7 @@ function startChaosNode(node_name) {
oReq.onload = function () {
//console.log(JSON.parse(this.responseText))
};;
- $('#alert_placeholder').replaceWith('
Latest action: Start Chaos Job on ' + node_name + '
');
+ $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Start Chaos Job on ' + node_name + '
');
oReq.open("GET", "https://ENDPOINT_PLACEHOLDER/kube/chaos/nodes?nodename=" + node_name + "&namespace=" + namespace);
oReq.send();
}
@@ -191,7 +193,7 @@ function deletePods(pod_name) {
oReq.onload = function () {
//console.log(JSON.parse(this.responseText))
};;
- $('#alert_placeholder').replaceWith('
Latest action: Kill ' + pod_name + '
');
+ $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Kill ' + pod_name + '
');
oReq.open("GET", "https://ENDPOINT_PLACEHOLDER/kube/pods?action=delete&pod_name=" + pod_name + "&namespace=" + namespace);
oReq.send();
}
@@ -269,13 +271,13 @@ function keyDownHandler(e) {
else if(e.keyCode == 83) {
if (shuffle) {
shuffle = false;
- $('#alert_placeholder').replaceWith('
');
+ $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Disable shuffle