appinstall_plat/appmngr2runtimeapi/tsrc/data_src/widgettest/widgettest.js
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: Basic widget for installation testing
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 function showHelloView()
       
    20 {
       
    21 	// hide the main view and show the result view
       
    22 	document.getElementById("mainView").style.display = "none";
       
    23 	document.getElementById("resultView").style.display = "block";
       
    24 
       
    25 	// detect if the output <p> tag has a child
       
    26 	var child = document.getElementById('output').firstChild;
       
    27 	// remove the child if exists
       
    28 	if( child != null )
       
    29 		document.getElementById('output').removeChild(child);
       
    30 
       
    31 	// create a new text node
       
    32 	var newText = document.createTextNode( "Hello, World!" );
       
    33 	// append to the output <p> tag
       
    34 	document.getElementById('output').appendChild(newText);
       
    35 
       
    36 	// change the right softkey label and assign a custom callback function
       
    37 	window.menu.setRightSoftKeyLabel('Back', showMainView);
       
    38 }
       
    39 
       
    40 
       
    41 function showMainView()
       
    42 {
       
    43 	// hide the result view and show the main view
       
    44 	document.getElementById("resultView").style.display = "none";
       
    45 	document.getElementById("mainView").style.display = "block";
       
    46 	
       
    47 	// restore the right softkey 
       
    48 	window.menu.setRightSoftKeyLabel('', null);
       
    49 }
       
    50