org.symbian.tools.wrttools.previewer/preview/script/helper.js
changeset 403 ba20dd5983c7
parent 402 f943a50b6689
child 404 5aff54f94943
equal deleted inserted replaced
402:f943a50b6689 403:ba20dd5983c7
   237 	}
   237 	}
   238 };
   238 };
   239 
   239 
   240 EmulatorHelper.prototype.getPreference = function(name) {
   240 EmulatorHelper.prototype.getPreference = function(name) {
   241 	return NOKIA.emulator.prefs[name];
   241 	return NOKIA.emulator.prefs[name];
   242 };
       
   243 
       
   244 EmulatorHelper.prototype.rotateCW = function() {
       
   245 	var newOrient = NOKIA.orientation + 90;
       
   246 	NOKIA.emulator.toggle(newOrient - (newOrient > 180 ? 360 : 0));
       
   247 };
       
   248 
       
   249 EmulatorHelper.prototype.rotateCCW = function() {
       
   250 	var newOrient = NOKIA.orientation - 90;
       
   251 	NOKIA.emulator.toggle(newOrient + (newOrient <= -180 ? 360 : 0));
       
   252 };
   242 };
   253 
   243 
   254 EmulatorHelper.prototype.version = function(ele) {
   244 EmulatorHelper.prototype.version = function(ele) {
   255 	if (confirm('Would you like to reload the widget to apply the changes on the Version settings?')) {
   245 	if (confirm('Would you like to reload the widget to apply the changes on the Version settings?')) {
   256 		NOKIA.helper.setPreference('__SYM_WRT_VERSION', ele.value);
   246 		NOKIA.helper.setPreference('__SYM_WRT_VERSION', ele.value);
   302 			$("#WidgetArea iframe").css( {
   292 			$("#WidgetArea iframe").css( {
   303 				overflow : 'hidden'
   293 				overflow : 'hidden'
   304 			});
   294 			});
   305 		}
   295 		}
   306 	});
   296 	});
   307 
       
   308 	$('#rotateCW').click(function() {
       
   309 		NOKIA.helper.rotateCW();
       
   310 	});
       
   311 	$('#rotateCCW').click(function() {
       
   312 		NOKIA.helper.rotateCCW();
       
   313 	});
       
   314 	$('#resOptions').change(
   297 	$('#resOptions').change(
   315 			function(ele) {
   298 			function(ele) {
   316 				ele = ele.target || this;
   299 				ele = ele.target || this;
   317 
   300 
   318 				NOKIA.currentDevice = ele.options[ele.selectedIndex].text;
   301 				NOKIA.currentDevice = ele.options[ele.selectedIndex].text;
   339 
   322 
   340 	$('#wrt_version_1_1').change(function() {
   323 	$('#wrt_version_1_1').change(function() {
   341 		NOKIA.helper.version(this);
   324 		NOKIA.helper.version(this);
   342 	});
   325 	});
   343 
   326 
   344 	$("#orientationIcon").click(function() {
       
   345 		var mode = (NOKIA.mode == 'portrait') ? 'landscape' : 'portrait';
       
   346 		NOKIA.emulator.setMode(mode);
       
   347 		$("#WidgetArea")[0].className = 'hs_' + NOKIA.mode;
       
   348 	});
       
   349 
       
   350 	$("#iframeMask").click(function() {
   327 	$("#iframeMask").click(function() {
   351 		$("#orientationIcon").hide();
   328 		$("#orientationIcon").hide();
   352 		$("#iframeMask").hide();
   329 		$("#iframeMask").hide();
   353 		$("#loaderDiv").hide();
   330 		$("#loaderDiv").hide();
   354 
   331 
   356 
   333 
   357 		$("#WidgetArea")[0].className = '';
   334 		$("#WidgetArea")[0].className = '';
   358 
   335 
   359 		NOKIA.menu.softkeys_visibility = true;
   336 		NOKIA.menu.softkeys_visibility = true;
   360 		NOKIA.menu.showSoftKeys();
   337 		NOKIA.menu.showSoftKeys();
   361 
       
   362 	});
   338 	});
   363 
   339 
   364 	// MenuItems DIV events
   340 	// MenuItems DIV events
   365 	$("#MenuItemsArea").mouseover(function() {
   341 	$("#MenuItemsArea").mouseover(function() {
   366 		if (NOKIA.helper.intervalId)
   342 		if (NOKIA.helper.intervalId)