org.symbian.tools.wrttools.previewer/preview/script/nokia.js
changeset 393 5b968742b729
parent 391 62472296236e
child 394 bd0603d7cbf9
equal deleted inserted replaced
391:62472296236e 393:5b968742b729
   342 			$('#IconArea').append(div);
   342 			$('#IconArea').append(div);
   343 			$('#IconArea').show();
   343 			$('#IconArea').show();
   344 
   344 
   345 			NOKIA.menu.is_dimmed = true;
   345 			NOKIA.menu.is_dimmed = true;
   346 			
   346 			
   347 			$("#PreferencesBtn").hide();
       
   348 			$("#PreferencesTab").dialog('close');
       
   349 			
       
   350 		},
   347 		},
   351 		
   348 		
   352 		setLsk : function(func)
   349 		setLsk : function(func)
   353 		{
   350 		{
   354 			//	for RSK
   351 			//	for RSK
   641 //			$('#SoftKeys > a > img').css(style['softkeysImg']);
   638 //			$('#SoftKeys > a > img').css(style['softkeysImg']);
   642 
   639 
   643 			NOKIA.menu.createSFKArea();
   640 			NOKIA.menu.createSFKArea();
   644 			
   641 			
   645 			$("#DeviceDisplayLayout").show();
   642 			$("#DeviceDisplayLayout").show();
   646 			$("#PreferencesTab").show();
       
   647 			$("#InspectorTab").show();
   643 			$("#InspectorTab").show();
   648 			
   644 			
   649 			if(!NOKIA.menu.is_dimmed)
       
   650 				$("#PreferencesBtn").show();
       
   651 			if (/chrome/.test( navigator.userAgent.toLowerCase())) {
   645 			if (/chrome/.test( navigator.userAgent.toLowerCase())) {
   652 				$("#InspectorBtn").show();
   646 				$("#InspectorBtn").show();
   653 			}
   647 			}
   654 			if (/mac/.test( navigator.userAgent.toLowerCase())) {
   648 			if (/mac/.test( navigator.userAgent.toLowerCase())) {
   655 				$("#MacShortcut").show();
   649 				$("#MacShortcut").show();
   981 				NOKIA.helper.setPreference('__SYM_WRT_VERSION', ele.value);
   975 				NOKIA.helper.setPreference('__SYM_WRT_VERSION', ele.value);
   982 				$("#loaderDiv").html("Applying the " + ele.value + ", please wait...");
   976 				$("#loaderDiv").html("Applying the " + ele.value + ", please wait...");
   983 				$("#loaderDiv").show();
   977 				$("#loaderDiv").show();
   984 				$("#loaderDiv")[0].className = 'green';
   978 				$("#loaderDiv")[0].className = 'green';
   985 				
   979 				
   986 				$("#PreferencesTab").dialog('close');
       
   987 				
       
   988 				window.setTimeout(function(){
   980 				window.setTimeout(function(){
   989 					document.location = document.location;
   981 					document.location = document.location;
   990 				}, 3000);
   982 				}, 3000);
   991 			}
   983 			}
   992 			else
   984 			else
   999 			}
   991 			}
  1000 		},
   992 		},
  1001 
   993 
  1002 		addListeners : function()
   994 		addListeners : function()
  1003 		{
   995 		{
  1004 			/*
   996 			NOKIA.helper.loadPreferences();
  1005 			 * Render Emulator for Interaction
       
  1006 			 */
       
  1007 			NOKIA.helper.prefDailog = $("#PreferencesTab").dialog({
       
  1008 					width: 550,	minWidth: 550, minHeight: 350, height: 350, autoOpen: false, position : top, title : ' ',
       
  1009 					buttons : {
       
  1010 						Close : function(){
       
  1011 							$("#PreferencesTab").dialog('close');
       
  1012 
       
  1013 							//	Hack for Mac firefox
       
  1014 							if(/Mac/i.test(navigator.userAgent))
       
  1015 							{
       
  1016 								$("#WidgetArea iframe").css({overflow:'auto'});
       
  1017 							}
       
  1018 							
       
  1019 							//	select index : 0 tab selected
       
  1020 							$('#tabs').tabs( 'select' , 0);
       
  1021 						}
       
  1022 					}
       
  1023 				});
       
  1024 			/*
   997 			/*
  1025 			 * Render Emulator for Interaction
   998 			 * Render Emulator for Interaction
  1026 			 */
   999 			 */
  1027 			NOKIA.helper.inspectorDailog = $("#InspectorTab").dialog({
  1000 			NOKIA.helper.inspectorDailog = $("#InspectorTab").dialog({
  1028 				width: 370,	minWidth: 300, minHeight: 200, height: 250, autoOpen: false, position : top, title : ' ',
  1001 				width: 370,	minWidth: 300, minHeight: 200, height: 250, autoOpen: false, position : top, title : ' ',
  1033 				"Disconnect Debugger" : function(){
  1006 				"Disconnect Debugger" : function(){
  1034 				$.ajax({url : "__sym_command/terminateDebug"});
  1007 				$.ajax({url : "__sym_command/terminateDebug"});
  1035 			}}
  1008 			}}
  1036 			});
  1009 			});
  1037 				
  1010 				
  1038 			$('#PreferencesBtn').click(function(){
       
  1039 				//	Load preferences
       
  1040 				NOKIA.helper.loadPreferences();
       
  1041 				$('#PreferencesTab').dialog('open');
       
  1042 
       
  1043 				//	Hack for Mac firefox
       
  1044 				if(/Mac/i.test(navigator.userAgent))
       
  1045 				{
       
  1046 					$("#WidgetArea iframe").css({overflow:'hidden'});
       
  1047 				}
       
  1048 			});
       
  1049 			$('#InspectorBtn').click(function(){
  1011 			$('#InspectorBtn').click(function(){
  1050 				$('#InspectorTab').dialog('open');
  1012 				$('#InspectorTab').dialog('open');
  1051 				//	Hack for Mac firefox
  1013 				//	Hack for Mac firefox
  1052 				if(/Mac/i.test(navigator.userAgent))
  1014 				if(/Mac/i.test(navigator.userAgent))
  1053 				{
  1015 				{
  1097 				$("#WidgetArea")[0].className = 'hs_'+NOKIA.mode;
  1059 				$("#WidgetArea")[0].className = 'hs_'+NOKIA.mode;
  1098 			});
  1060 			});
  1099 
  1061 
  1100 
  1062 
  1101 			$("#iframeMask").click(function(){
  1063 			$("#iframeMask").click(function(){
  1102 
       
  1103 				$("#PreferencesBtn").show();
       
  1104 				$("#orientationIcon").hide();
  1064 				$("#orientationIcon").hide();
  1105 				$("#iframeMask").hide();
  1065 				$("#iframeMask").hide();
  1106 				$("#loaderDiv").hide();
  1066 				$("#loaderDiv").hide();
  1107 
  1067 
  1108 				NOKIA.menu.is_dimmed = false;
  1068 				NOKIA.menu.is_dimmed = false;
  1150 //						$("settings-view").show();
  1110 //						$("settings-view").show();
  1151 //						break;
  1111 //						break;
  1152 //					
  1112 //					
  1153 //				}}
  1113 //				}}
  1154 			});
  1114 			});
  1155 
  1115 			$(".tabs-bottom .ui-tabs-nav, .tabs-bottom .ui-tabs-nav > *") 
       
  1116 	 			.removeClass("ui-corner-all ui-corner-top") 
       
  1117 	 			.addClass("ui-corner-bottom");
  1156 			
  1118 			
  1157 			/*	
  1119 			/*	
  1158 			 * 	Event triggering
  1120 			 * 	Event triggering
  1159 			 */
  1121 			 */
  1160 			
  1122 			
  1272 						$("#loaderDiv")[0].className = 'green';
  1234 						$("#loaderDiv")[0].className = 'green';
  1273 						$("#loaderDiv").show();
  1235 						$("#loaderDiv").show();
  1274 
  1236 
  1275 						$("#iframeMask").show();
  1237 						$("#iframeMask").show();
  1276 						$("#orientationIcon").show();
  1238 						$("#orientationIcon").show();
  1277 						$("#PreferencesBtn").hide();
  1239 
  1278 
       
  1279 						$("#PreferencesTab").dialog('close');
       
  1280 						return true;
  1240 						return true;
  1281 					}
  1241 					}
  1282 				}
  1242 				}
  1283 			}
  1243 			}
  1284 			return false;			
  1244 			return false;			
  1384 	 */
  1344 	 */
  1385 	NOKIA.namespace('layout');
  1345 	NOKIA.namespace('layout');
  1386 	NOKIA.layout = {
  1346 	NOKIA.layout = {
  1387 		_console_minimized : true,
  1347 		_console_minimized : true,
  1388 		_console_enabled : false,
  1348 		_console_enabled : false,
  1389 		_consoleWindowHeight : 200,
  1349 		_consoleWindowHeight : 290,
  1390 		_consoleHeaderHeight : 31,
  1350 		_consoleHeaderHeight : 31,
       
  1351 		_tabHeight : 27,
  1391 
  1352 
  1392 		init : function(){
  1353 		init : function(){
  1393 			
  1354 			
  1394 			//	Toggle console window
  1355 			//	Toggle console window
  1395 			$('#Console-Toggle-Button').click(function(){
  1356 			$('#Console-Toggle-Button').click(function(){
  1453 
  1414 
  1454 				$('#preview-ui-bottom-header').css({
  1415 				$('#preview-ui-bottom-header').css({
  1455 					height: NOKIA.layout._consoleHeaderHeight + 'px'
  1416 					height: NOKIA.layout._consoleHeaderHeight + 'px'
  1456 				});
  1417 				});
  1457 
  1418 
  1458 				$('#preview-ui-bottom-body').css({
  1419 				$('#tabs').css({
  1459 					height: parseInt(NOKIA.layout._consoleWindowHeight - NOKIA.layout._consoleHeaderHeight) + 'px',
  1420 					height: parseInt(NOKIA.layout._consoleWindowHeight - NOKIA.layout._consoleHeaderHeight) + 'px',
       
  1421 					display : 'block'
       
  1422 				});
       
  1423 				$('#console').css({
       
  1424 					height : parseInt(NOKIA.layout._consoleWindowHeight
       
  1425 									- NOKIA.layout._consoleHeaderHeight
       
  1426 									- NOKIA.layout._tabHeight * 2)
       
  1427 									+ 'px',
  1460 					display : 'block'
  1428 					display : 'block'
  1461 				});
  1429 				});
  1462 				
  1430 				
  1463 				// Auto scroll when console window opened from MINIMIZED => MAXIMIZED state
  1431 				// Auto scroll when console window opened from MINIMIZED => MAXIMIZED state
  1464 				window.setTimeout(function(){
  1432 				window.setTimeout(function(){
  1481 
  1449 
  1482 				$('#preview-ui-bottom-header').css({
  1450 				$('#preview-ui-bottom-header').css({
  1483 					height: NOKIA.layout._consoleHeaderHeight + 'px',
  1451 					height: NOKIA.layout._consoleHeaderHeight + 'px',
  1484 					display : 'block'
  1452 					display : 'block'
  1485 				});
  1453 				});
  1486 
  1454 // TODO
  1487 				$('#preview-ui-bottom-body').css({
  1455 //				$('#preview-ui-bottom-body').css({
  1488 					display : 'none'
  1456 //					display : 'none'
  1489 				});
  1457 //				});
  1490 			}
  1458 			}
  1491 		}
  1459 		}
  1492 		
  1460 		
  1493 	};
  1461 	};
  1494 }
  1462 }