plugins/org.symbian.tools.tmw.previewer/preview/script/layout.js
author Eugene Ostroukhov <eugeneo@symbian.org>
Thu, 19 Aug 2010 17:48:04 -0700
changeset 470 d4809db37847
parent 444 org.symbian.tools.wrttools.previewer/preview/script/layout.js@6eb42310f8b5
permissions -rw-r--r--
Changed repository layout and renamed project files. This revision is untested and may not run.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
402
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     1
/**
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     2
 * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies). All
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     3
 * rights reserved. This component and the accompanying materials are made
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     4
 * available under the terms of the License "Eclipse Public License v1.0" which
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     5
 * accompanies this distribution, and is available at the URL
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     6
 * "http://www.eclipse.org/legal/epl-v10.html".
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     7
 * 
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     8
 * Initial Contributors: Nokia Corporation - initial contribution.
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     9
 * 
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    10
 * Contributors:
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    11
 * 
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    12
 * Description:
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    13
 * 
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    14
 */
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    15
function EmulatorLayout() {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    16
	this._console_minimized = true;
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    17
	this._console_enabled = false;
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    18
	this._consoleWindowHeight = 290;
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    19
	this._consoleHeaderHeight = 31;
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    20
	this._tabHeight = 27;
417
dc5d845451fc Bug 3063 - Provide a feedback when there is console output
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 416
diff changeset
    21
	this.currentTab = 0;
402
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    22
}
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    23
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    24
EmulatorLayout.prototype.init = function() {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    25
	// Toggle console window
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    26
	$('#preview-ui-bottom-header')
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    27
			.click(
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    28
					function() {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    29
						NOKIA.layout._console_minimized = (NOKIA.layout._console_minimized) ? false
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    30
								: true;
428
9b6017f46095 Bug 3063 - Provide a feedback when there is console output
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 417
diff changeset
    31
						if (NOKIA.layout.currentTab == 0) {
9b6017f46095 Bug 3063 - Provide a feedback when there is console output
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 417
diff changeset
    32
							$("#Console-Notification").hide();
9b6017f46095 Bug 3063 - Provide a feedback when there is console output
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 417
diff changeset
    33
						}
402
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    34
						NOKIA.layout.render();
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    35
						NOKIA.helper.setPreference("__SYM_NOKIA_CONSOLE_OPEN",
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    36
								!NOKIA.layout._console_minimized);
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    37
					});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    38
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    39
	// clear Log
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    40
	$("#Console-Clear-Button").click(function() {
416
461da1f79f43 Bug 3137 - If console is blank, provide usage instructions
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 402
diff changeset
    41
		$("#preview-ui-bottom-body > *").not("p#hint").remove();
461da1f79f43 Bug 3137 - If console is blank, provide usage instructions
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 402
diff changeset
    42
		$("p#hint").show();
402
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    43
	});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    44
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    45
	$('#preview-ui-bottom').show();
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    46
	NOKIA.layout.render();
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    47
};
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    48
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    49
EmulatorLayout.prototype.log = function(type, msg) {
417
dc5d845451fc Bug 3063 - Provide a feedback when there is console output
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 416
diff changeset
    50
	if (this.currentTab != 0 || this._console_minimized) {
dc5d845451fc Bug 3063 - Provide a feedback when there is console output
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 416
diff changeset
    51
		$('#Console-Notification').show();
dc5d845451fc Bug 3063 - Provide a feedback when there is console output
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 416
diff changeset
    52
	}
416
461da1f79f43 Bug 3137 - If console is blank, provide usage instructions
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 402
diff changeset
    53
	$("p#hint").hide();
402
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    54
	var p = document.createElement('p');
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    55
	p.className = type;
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    56
	p.innerHTML = msg;
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    57
	var divBody = $('#preview-ui-bottom-body');
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    58
	divBody.append(p);
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    59
	divBody[0].scrollTop = divBody[0].scrollHeight;
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    60
};
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    61
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    62
EmulatorLayout.prototype.render = function() {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    63
	var _width = parseInt(window.innerWidth);
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    64
	var _height = parseInt(window.innerHeight);
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    65
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    66
	if (!NOKIA.layout._console_enabled) {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    67
		$('#preview-ui-bottom').css( {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    68
			display : 'none'
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    69
		});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    70
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    71
		$('#preview-ui-top').css( {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    72
			height : _height + 'px'
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    73
		});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    74
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    75
		return false;
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    76
	}
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    77
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    78
	if (!NOKIA.layout._console_minimized) {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    79
		$('#Console-Toggle-Button')[0].className = 'open';
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    80
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    81
		// set STYLE details for TOP window
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    82
		$('#preview-ui-top').css(
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    83
				{
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    84
					height : parseInt(_height
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    85
							- NOKIA.layout._consoleWindowHeight)
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    86
							+ 'px'
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    87
				});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    88
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    89
		// set STYLE details for Bottom window
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    90
		$('#preview-ui-bottom').css( {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    91
			height : NOKIA.layout._consoleWindowHeight + 'px',
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    92
			display : 'block'
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    93
		});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    94
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    95
		$('#preview-ui-bottom-header').css( {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    96
			height : NOKIA.layout._consoleHeaderHeight + 'px'
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    97
		});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    98
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    99
		$('#tabs').css(
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   100
				{
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   101
					height : parseInt(NOKIA.layout._consoleWindowHeight
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   102
							- NOKIA.layout._consoleHeaderHeight)
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   103
							+ 'px',
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   104
					display : 'block'
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   105
				});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   106
		$('#console').css(
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   107
				{
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   108
					height : parseInt(NOKIA.layout._consoleWindowHeight
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   109
							- NOKIA.layout._consoleHeaderHeight
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   110
							- NOKIA.layout._tabHeight * 2)
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   111
							+ 'px',
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   112
					display : 'block'
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   113
				});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   114
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   115
		// Auto scroll when console window opened from MINIMIZED =>
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   116
		// MAXIMIZED state
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   117
		window
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   118
				.setTimeout(
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   119
						function() {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   120
							$('#preview-ui-bottom-body')[0].scrollTop = $('#preview-ui-bottom-body')[0].scrollHeight;
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   121
						}, 100);
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   122
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   123
	} else {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   124
		$('#Console-Toggle-Button')[0].className = 'close';
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   125
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   126
		// set STYLE details for TOP window
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   127
		$('#preview-ui-top').css(
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   128
				{
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   129
					height : parseInt(_height
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   130
							- NOKIA.layout._consoleHeaderHeight)
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   131
							+ 'px'
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   132
				});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   133
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   134
		// set STYLE details for Bottom window
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   135
		$('#preview-ui-bottom').css( {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   136
			height : NOKIA.layout._consoleHeaderHeight + 'px',
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   137
			display : 'block'
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   138
		});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   139
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   140
		$('#preview-ui-bottom-header').css( {
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   141
			height : NOKIA.layout._consoleHeaderHeight + 'px',
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   142
			display : 'block'
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   143
		});
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   144
	}
444
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   145
};
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   146
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   147
EmulatorLayout.prototype.openApplication = function(icon, message) {
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   148
	var iconDiv = $("#external-app-icon");
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   149
	if (icon && icon != null) {
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   150
		iconDiv.css("background-image", "url('" + icon + "')");
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   151
		iconDiv.show();
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   152
	} else {
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   153
		iconDiv.hide();
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   154
	}
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   155
	var messageDiv = $("#external-app-description");
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   156
	if (message && message != null) {
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   157
		messageDiv.html(message);
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   158
		messageDiv.show();
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   159
	} else {
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   160
		messageDiv.hide();
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   161
	}
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   162
	$("#externalapp").show();
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   163
	$("#WidgetArea").hide();
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   164
	$("#SoftKeysArea").hide();
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   165
};
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   166
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   167
EmulatorLayout.prototype.closeApplication = function() {
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   168
	$("#externalapp").hide();
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   169
	$("#WidgetArea").show();
6eb42310f8b5 Replace camera "screen" with more generic one.
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 428
diff changeset
   170
	$("#SoftKeysArea").show();
402
f943a50b6689 Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   171
};