org.symbian.tools.wrttools.previewer/preview/script/lib/menu.js
author Eugene Ostroukhov <eugeneo@symbian.org>
Wed, 14 Apr 2010 14:54:13 -0700
changeset 305 be8783adb3a8
parent 273 b1f63c2c240c
child 334 915daddff233
permissions -rw-r--r--
Removed white "Establishing debug connection" page.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
210
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     1
/**
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     2
 * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     3
 * All rights reserved.
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     4
 * This component and the accompanying materials are made available
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     6
 * which accompanies this distribution, and is available
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     8
 *
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
     9
 * Initial Contributors:
273
b1f63c2c240c Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 210
diff changeset
    10
 * Nokia Corporation - initial contribution.
b1f63c2c240c Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 210
diff changeset
    11
 * 
210
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
    12
 * Contributors:
273
b1f63c2c240c Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 210
diff changeset
    13
 * 
b1f63c2c240c Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 210
diff changeset
    14
 * Description:
b1f63c2c240c Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 210
diff changeset
    15
 * 
210
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
    16
 */
0f7abfd6ae62 Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents: 37
diff changeset
    17
37
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    18
/**
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    19
 * widget object constructor
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    20
 * @param {void}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    21
 *     widget()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    22
 * @return {void}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    23
 */ 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    24
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    25
if (typeof window.menu == "undefined" || !window.menu) 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    26
{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    27
	window.menu = 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    28
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    29
		author : 'Nokia WRT Emulation Library',
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    30
		items : [],
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    31
		index : null,
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    32
		isDimmed : false,	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    33
			
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    34
		//	Event triggers
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    35
		onShow : null,
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    36
		onRightSoftKeySelect : null,
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    37
	};
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    38
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    39
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    40
	/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    41
		Function 	:	menu.append()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    42
		Argument	:	MenuItem Object
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    43
		Returns		:	Void
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    44
		Description	:	Function appends MenuItem to a Menu Object
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    45
	*/
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    46
	menu.append = function(MenuItem)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    47
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    48
		if(this.allowedTypeOf(MenuItem))
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    49
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    50
			var i;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    51
			var flag = true;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    52
			try{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    53
			for(var key in this.items)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    54
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    55
				if(this.items[key].id == MenuItem.id)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    56
				{	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    57
					flag = false; 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    58
					break; 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    59
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    60
			}} catch(e){ }
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    61
			if(flag)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    62
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    63
				//	MenuItem.parent = this;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    64
				this.items[MenuItem.id] = MenuItem;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    65
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    66
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    67
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    68
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    69
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    70
	/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    71
		Function 	:	menu.remove()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    72
		Argument	:	MenuItem Object
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    73
		Returns		:	Void
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    74
		Description	:	Function Remove the menuItem and its children from the container options menu.
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    75
	*/
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    76
	menu.remove = function(MenuItem)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    77
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    78
		if(!this.allowedTypeOf(MenuItem))
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    79
			return false;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    80
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    81
		var flag = false;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    82
		if (this.items.length) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    83
			for (var key in this.items) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    84
				if (this.items[key].id == MenuItem.id) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    85
					flag = true;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    86
					break;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    87
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    88
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    89
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    90
		if(flag)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    91
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    92
			this.items.splice(key, 1);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    93
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    94
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    95
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    96
	/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    97
		Function 	:	menu.clear()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    98
		Argument	:	Void
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
    99
		Returns		:	Void
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   100
		Description	:	Clears (deletes) all the menu items in the menupane.
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   101
	*/
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   102
	menu.clear = function()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   103
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   104
		try
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   105
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   106
			this.items.splice(0, this.items.length);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   107
		}catch(e){}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   108
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   109
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   110
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   111
	/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   112
		Function 	:	Menu.getMenuItemById(id)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   113
		Argument	:	Integer
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   114
		Returns		:	MenuItem Object
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   115
		Description	:	Function get the MenuItem Object with the reference of id
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   116
	*/
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   117
	menu.getMenuItemById = function(id)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   118
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   119
		var menuItemRef = menu.menuItemExhistsById(this, id, 0);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   120
		if(this.allowedTypeOf(menuItemRef))
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   121
			return menuItemRef;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   122
		else
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   123
			return undefined;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   124
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   125
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   126
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   127
	/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   128
		Function 	:	Menu.getMenuItemByName(name)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   129
		Argument	:	String
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   130
		Returns		:	MenuItem Object
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   131
		Description	:	Function get the MenuItem Object with the reference of String name
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   132
	*/
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   133
	menu.getMenuItemByName = function(name)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   134
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   135
		var menuItemRef = menu.menuItemExhistsById(this, name, 1);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   136
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   137
	//	if(menuItemRef !=null)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   138
		if(this.allowedTypeOf(menuItemRef))
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   139
			return menuItemRef;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   140
		else
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   141
			return undefined;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   142
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   143
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   144
	/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   145
		Function 	:	Menu.setRightSoftkeyLabel()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   146
		Argument	:	String, Function
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   147
		Returns		:	Void
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   148
		Description	:	Set the label of the right soft key to str. This enables the default text 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   149
						to be changed from exit and a new function assigned by setting a callbackfunction
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   150
	*/
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   151
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   152
	menu.setRightSoftkeyLabel = function(label, callback)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   153
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   154
		window.menu = this;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   155
		try
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   156
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   157
			if(typeof label != '' && !label)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   158
				this.setExitToRsk();			
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   159
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   160
			else if(typeof callback != 'function' && !callback)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   161
				this.setExitToRsk();			
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   162
			
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   163
			else if (_BRIDGE_REF.nokia.menu.setRsk(callback)) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   164
				_BRIDGE_REF.parent.$("#RskLabel > a")[0].innerHTML = label;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   165
				_BRIDGE_REF.nokia.menu.rsk_label = label;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   166
				_BRIDGE_REF.nokia.menu.rsk_event = callback;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   167
				_BRIDGE_REF.nokia.menu.is_rsk_overridden = true;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   168
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   169
			else 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   170
				this.setExitToRsk();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   171
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   172
		}catch(e){ 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   173
			// alert(e);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   174
		 }
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   175
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   176
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   177
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   178
	menu.setExitToRsk = function()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   179
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   180
		this.onRightSoftKeySelect = null;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   181
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   182
		_BRIDGE_REF.nokia.menu.is_rsk_overridden = false;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   183
		_BRIDGE_REF.nokia.menu.rsk_label = '';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   184
		_BRIDGE_REF.nokia.menu.rsk_event = null;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   185
		_BRIDGE_REF.parent.$("#RskLabel > a")[0].innerHTML = 'Exit';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   186
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   187
		_BRIDGE_REF.nokia.menu.setRsk(function(){
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   188
			_BRIDGE_REF.nokia.menu.exit();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   189
		});
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   190
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   191
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   192
	/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   193
		Function 	:	Menu.showSoftkeys()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   194
		Argument	:	Void
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   195
		Returns		:	Void
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   196
		Description	:	Makes the softkeys visible. By default the softkeys are not visible
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   197
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   198
	*/
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   199
	menu.showSoftkeys = function()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   200
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   201
		/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   202
		 *  Shows showSoftkeys
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   203
		 */
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   204
		_BRIDGE_REF.nokia.menu.softkeys_visibility = true;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   205
		_BRIDGE_REF.nokia.menu.showSoftKeys();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   206
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   207
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   208
	/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   209
		Function 	:	Menu.hideSoftkeys()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   210
		Argument	:	Void
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   211
		Returns		:	Void
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   212
		Description	:	Makes the softkeys invisible. By default the softkeys are not visible. 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   213
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   214
	*/
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   215
	menu.hideSoftkeys = function()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   216
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   217
		/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   218
		 *  Hide showSoftkeys
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   219
		 */
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   220
		_BRIDGE_REF.nokia.menu.softkeys_visibility = false;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   221
		_BRIDGE_REF.nokia.menu.hideSoftKeys();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   222
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   223
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   224
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   225
	/*	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   226
	 *  
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   227
	 * ----------------------------------------------------------------
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   228
	 * Exta Functionalities which helps to make main functions to work
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   229
	 * ----------------------------------------------------------------
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   230
	 *  
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   231
	*/
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   232
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   233
	menu.cancel = function()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   234
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   235
		_BRIDGE_REF.nokia.menu.cancel();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   236
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   237
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   238
	menu.exit = function()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   239
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   240
		_BRIDGE_REF.nokia.menu.exit();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   241
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   242
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   243
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   244
	menu.triggeLSKEvent = function()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   245
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   246
		if(typeof(window.menu.onShow) == 'function')
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   247
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   248
				window.menu.onShow();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   249
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   250
		_BRIDGE_REF.parent.$('#softKeysPane').show();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   251
		this.show();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   252
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   253
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   254
	menu.triggerEvent = function(MenuItemId)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   255
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   256
		try{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   257
			var menuItemRef = this.menuItemExhistsById(this, MenuItemId, 0);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   258
			if(menuItemRef != null)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   259
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   260
				if(typeof menuItemRef.onSelect == 'function')
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   261
					menuItemRef.onSelect(MenuItemId);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   262
		
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   263
				if(_BRIDGE_REF.helper.getElementsLengthInObject(menuItemRef.items))
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   264
					this.show(MenuItemId);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   265
				else
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   266
					this.cancel();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   267
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   268
			}else
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   269
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   270
				this.show();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   271
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   272
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   273
		catch(e)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   274
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   275
			alert('triggeEvent: '+MenuItemId+' >> '+e);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   276
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   277
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   278
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   279
	menu.hasChild = function(parentId)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   280
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   281
		for(var i in this.items)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   282
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   283
			if(this.items[i].parentId == parentId)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   284
			{	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   285
				 return true;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   286
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   287
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   288
		return false;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   289
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   290
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   291
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   292
	menu.allowedTypeOf = function(MenuItem)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   293
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   294
		try
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   295
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   296
			if( (typeof(MenuItem) == 'object') && (MenuItem.type == 'MenuItem'))
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   297
				return true;			
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   298
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   299
		catch(e)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   300
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   301
			return false;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   302
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   303
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   304
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   305
	menu.show = function(parentId)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   306
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   307
		try
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   308
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   309
			var menuItemsPane = _BRIDGE_REF.parent.$('#MenuItemsArea')
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   310
			menuItemsPane = menuItemsPane[0];
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   311
			
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   312
			menuItemsPane.innerHTML = '';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   313
			
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   314
			var ul = document.createElement('ul');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   315
			var ele = window.menu;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   316
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   317
			if(typeof parentId != 'undefined' && typeof parentId == 'object')
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   318
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   319
				if (typeof window.menu.onShow != null && typeof window.menu.onShow == 'function') {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   320
					window.menu.onShow();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   321
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   322
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   323
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   324
			if(typeof parentId == 'number')
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   325
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   326
				var tempRef = menu.menuItemExhistsById(ele, parentId, 0);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   327
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   328
				if(typeof parentId != 'undefined' && typeof tempRef != 'undefined')
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   329
					ele = tempRef;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   330
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   331
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   332
			if(_BRIDGE_REF.helper.getElementsLengthInObject(ele.items))
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   333
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   334
				for(var key in ele.items)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   335
				{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   336
					if(!ele.items[key].isDimmed){
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   337
						
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   338
						try{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   339
							ul.appendChild(menu.create_menuElement(ele.items[key]));
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   340
						}catch(e){  }
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   341
					}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   342
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   343
				if(typeof parentId == 'number' && _BRIDGE_REF.helper.getElementsLengthInObject(ele.items))
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   344
				{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   345
					if(ele.parent)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   346
						ul.appendChild(menu.create_normalMenuItem('Back', ele.parent.id));	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   347
					else
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   348
						ul.appendChild(menu.create_normalMenuItem('Back', null));	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   349
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   350
				else
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   351
				{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   352
					ul.appendChild(menu.create_exitMenuItem());	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   353
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   354
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   355
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   356
				if(_BRIDGE_REF.helper.getElementsLengthInObject(ele.items) > 5)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   357
					menuItemsPane.style.overflowY = 'scroll';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   358
				else
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   359
					menuItemsPane.style.overflowY = 'hidden';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   360
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   361
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   362
			else
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   363
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   364
				menuItemsPane.style.overflowY = 'hidden';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   365
				ul.appendChild(menu.create_exitMenuItem());	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   366
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   367
			menuItemsPane.innerHTML = '<ul>'+ul.innerHTML+'</ul>';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   368
			
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   369
			_BRIDGE_REF.nokia.menu.show();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   370
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   371
		catch(e)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   372
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   373
			alert('menu.show: '+e);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   374
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   375
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   376
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   377
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   378
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   379
/*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   380
*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   381
*	HELPER FUNCTIONS
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   382
*
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   383
*/
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   384
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   385
	menu.menuItemExhistsById = function(menuReference, value, argumentType)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   386
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   387
		var flag = null;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   388
		
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   389
		for(var key in menuReference.items)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   390
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   391
			if(!argumentType)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   392
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   393
				if(menuReference.items[key].id == value)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   394
				{	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   395
					flag = true; 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   396
					break; 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   397
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   398
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   399
			else
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   400
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   401
				if(menuReference.items[key].name == value)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   402
				{	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   403
					flag = true; 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   404
					break; 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   405
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   406
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   407
			
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   408
			if(menuReference.items[key].items != undefined && menuReference.items[key].items.length)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   409
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   410
				var temp = this.menuItemExhistsById(menuReference.items[key], value, argumentType);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   411
				if(temp)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   412
					return temp;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   413
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   414
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   415
		if(flag)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   416
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   417
			// crate a package and send it
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   418
			menuReference.items[key].index = key;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   419
			return menuReference.items[key];
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   420
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   421
		else
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   422
			return null;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   423
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   424
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   425
	menu.create_menuElement = function(MenuItem) 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   426
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   427
		var listitem = document.createElement('li');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   428
		listitem.id = MenuItem.id;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   429
		listitem.setAttribute('onClick', 'javascript:NOKIA.emulator.child.menu.triggerEvent('+MenuItem.id+');');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   430
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   431
	    var anchor = document.createElement('a');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   432
		anchor.id = 'subMenuItem_'+MenuItem.id;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   433
		anchor.innerHTML = MenuItem.name;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   434
		if(_BRIDGE_REF.helper.getElementsLengthInObject(MenuItem.items))
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   435
	 	{  
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   436
			anchor.className = 'subMenuItem';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   437
			anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.show('+MenuItem.id+');');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   438
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   439
	    listitem.appendChild(anchor);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   440
		return (listitem);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   441
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   442
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   443
	menu.create_normalMenuItem = function(MenuTitle, index) 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   444
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   445
	    var listitem = document.createElement('li');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   446
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   447
	    var anchor = document.createElement('a');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   448
		anchor.id = 'subMenuItem_BACK';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   449
		anchor.innerHTML = MenuTitle;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   450
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   451
		if (MenuTitle == 'Back') {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   452
			listitem.className = 'exitOrBackBtn';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   453
			anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.triggerEvent(' + index + ');');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   454
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   455
		else 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   456
			anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.triggerEvent(' + index + ');');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   457
	    
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   458
		listitem.appendChild(anchor);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   459
		return (listitem);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   460
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   461
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   462
	menu.create_exitMenuItem = function() 
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   463
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   464
	    var listitem = document.createElement('li');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   465
		listitem.className = 'exitOrBackBtn';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   466
	    var anchor = document.createElement('a');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   467
		anchor.id = 'subMenuItem_EXIT';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   468
		anchor.innerHTML = 'Exit';
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   469
		anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.exit();');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   470
		listitem.setAttribute('onClick', 'javascript:NOKIA.emulator.child.menu.exit();');
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   471
		
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   472
	    listitem.appendChild(anchor);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   473
		return (listitem);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   474
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   475
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   476
	menu.triggeRSK = function()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   477
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   478
		try {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   479
			if (window.menu) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   480
				if (childToParent_Reference.$('softKeysPane').style.display != 'none') {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   481
					if (window.menu.onRightSoftKeySelect != null) {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   482
						window.menu.onRightSoftKeySelect();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   483
						window.menu.cancel();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   484
					}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   485
					else {
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   486
						window.menu.cancel();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   487
					}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   488
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   489
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   490
		}catch(e)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   491
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   492
			alert(e);
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   493
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   494
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   495
	
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   496
	menu.triggeLSK = function()
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   497
	{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   498
		if(window.menu)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   499
		{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   500
			window.menu.show();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   501
			if(typeof(window.menu.onShow) == 'function')
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   502
			{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   503
				if(window.menu.onShow)
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   504
				{
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   505
					window.menu.onShow();
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   506
				}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   507
			}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   508
		}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   509
	}
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   510
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   511
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   512
	//	make TRUE menu.js script loaded
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   513
	window.parent.NOKIA.scriptsLoaded.menu = true;
641b65b14318 Added WRT previewer, Mozilla Xulrunner, and Mozilla XP Com. Integrated Xulrunner browser into WRT Previewer.
tasneems@symbian.org
parents:
diff changeset
   514
}