RootApp Object



 
The RootApp object is a helper object of the SiteKiosk Object Model.


Members Table

    The following table lists the members provided by the RootApp object.

    Members
    Methods Description
    registerForDeviceData Listener for keyboard emulation device input.

Remarks
    This object is available through the main object SiteKiosk.

    Note that the path of a file using SiteKiosk objects must be allowed in the
    SiteKiosk configuration (Security -> Access -> URL's With Script Permission)
    if it is not a browser skin file.
Examples
    The following example registers a listener for a keyboard emulation device and displays the recieved data.

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
    	<title>Keyboard Emulation Device Test</title>
    	<script>
    		window.external.InitScriptInterface();
    
    		var callbackFunc = function (data, devicename) {
    			document.getElementById("text").innerHTML = 
    			"Data received from device with the name: " 
    			+ devicename + ". Data: " + data;
    		};
    
    		function registerDevice() {
    			var deviceName = document.
    			getElementById("devicename").value;
    
    			if(deviceName == "")
    				return document.
    				getElementById("foundDevice").
    				innerHTML = "The device name is empty!";
    
    			SiteKiosk.RootApp.
    			registerForDeviceData(deviceName, callbackFunc);
    
    			return document.getElementById("foundDevice").
    			innerHTML = "Registered device: " + deviceName;
    		}
    	</script>
    </head>
    	<body>
    		<h1>Test page for reading the input of keyboard 
    		emulation devices configured in the configuration 
    		of SiteKiosk</h1>
    		<div>
    			Listen to input from this device that has been 
    			configured in SiteKiosk: 
    			<input id="devicename" tpye="text" /> 
    			(state the device name) 
    			<button onclick="registerDevice()">
    			Register the listener</button>
    		</div>
    		<span id="foundDevice"></span>
    		<div>
    			Data that has been received: 
    			<span id="text">Waiting for data...</span>
    		</div>
    	</body>
    </html>
    

Applies to
    SiteKiosk v9.0 (and later versions).

Back to top