overte/scripts/system/fingerPaint/html/chooseHandTab.html
Artur Gomes 91a6f2c8d9 Add undo for created Entities in order to be able to remove entities
when drawing in desktop mode.
Fix keyboard not showing.
Fix app button not being deactivated when switching to another app.
2017-08-16 18:28:56 +01:00

57 lines
No EOL
1.8 KiB
HTML

<!--Note: change the parent postmessage second parameter due to possible security issues-->
<link rel="stylesheet" type="text/css" href="../../html/css/edit-style.css">
<style type="text/css">
.changeHandButton {
width: 216px;
height: 216px;
color: white;
background-color: #2e2e2e;
border: none;
float: left;
margin: 2px;
text-transform: uppercase;
font-family: Raleway-Bold;
font-size: 13px;
}
.changeHandButton:first-child {
margin-left: 0px;
}
.changeHandButton:last-child {
margin-right: 0px;
}
.selectedHand {
background-color: rgb(16, 128, 184);
}
</style>
<div id="handButtonsContainer" >
<button class="changeHandButton" id="left" onclick="chooseHand(0)">Left</button>
<button class="changeHandButton selectedHand" id="right" onclick="chooseHand(1)">Right</button>
</div>
<script type="text/javascript">
var currentHand = 1;
function chooseHand(handIndex) {
handButtons = document.getElementById("handButtonsContainer").children;
handButtons[currentHand].classList.remove("selectedHand");
currentHand = handIndex;
handButtons[currentHand].classList.add("selectedHand");
var chooseHandEvent = {
"type" : "changeBrushHand",
"DrawingHand": handButtons[handIndex].id
};
parent.postMessage(JSON.stringify(chooseHandEvent), "*");
}
//window.addEventListener("message", restoreCurrentDrawingHand, false);
restoreCurrentDrawingHand(JSON.parse(decodeURIComponent(window.parent.location.search).substring(1)));
function restoreCurrentDrawingHand(handData) {
if (handData.currentDrawingHand) {
chooseHand(0);
} else {
chooseHand(1);
}
}
</script>