# HG changeset patch # User Eugene Ostroukhov # Date 1274134861 25200 # Node ID 915daddff2332faa327fc29e900079b9f5d2314a # Parent 895153411a80175aa2300e2d8668d7542790e62a JS cleanup to make it more compatible with JSDT diff -r 895153411a80 -r 915daddff233 org.symbian.tools.wrttools.previewer/.project --- a/org.symbian.tools.wrttools.previewer/.project Thu May 13 15:47:02 2010 -0700 +++ b/org.symbian.tools.wrttools.previewer/.project Mon May 17 15:21:01 2010 -0700 @@ -6,6 +6,11 @@ + org.eclipse.wst.jsdt.core.javascriptValidator + + + + org.eclipse.jdt.core.javabuilder @@ -24,5 +29,6 @@ org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature diff -r 895153411a80 -r 915daddff233 org.symbian.tools.wrttools.previewer/preview/css/style.css --- a/org.symbian.tools.wrttools.previewer/preview/css/style.css Thu May 13 15:47:02 2010 -0700 +++ b/org.symbian.tools.wrttools.previewer/preview/css/style.css Mon May 17 15:21:01 2010 -0700 @@ -295,10 +295,39 @@ padding: 3px; } +div#rotateCW{ + position: absolute; + left: 0; + top: 0; + background-image: url(../images/rotate-right.png); + height: 32px; + width: 32px; + cursor: pointer; +} +div#rotateCCW{ + position:absolute; + right: 0; + top: 0; + background-image: url(../images/rotate-left.png); + height: 32px; + width: 32px; + cursor: pointer; +} + /* preferences CSS */ +div#TopToolbar{ + background-color: olive; + position: absolute; + left: 85px; + right: 85px; + top: 0; + height: 32px; + text-align: center; +} + div#PreferencesBtn{ width: 75px; height: 85px; @@ -320,7 +349,6 @@ div#InspectorBtn{ width: 75px; height: 85px; -/* background-image: url(../images/settings-icon.png); */ background-image: url(../images/inspector.png); position: absolute; top: 10px; diff -r 895153411a80 -r 915daddff233 org.symbian.tools.wrttools.previewer/preview/script/lib/menu.js --- a/org.symbian.tools.wrttools.previewer/preview/script/lib/menu.js Thu May 13 15:47:02 2010 -0700 +++ b/org.symbian.tools.wrttools.previewer/preview/script/lib/menu.js Mon May 17 15:21:01 2010 -0700 @@ -33,7 +33,7 @@ // Event triggers onShow : null, - onRightSoftKeySelect : null, + onRightSoftKeySelect : null }; diff -r 895153411a80 -r 915daddff233 org.symbian.tools.wrttools.previewer/preview/script/lib/sapi/Landmarks.js --- a/org.symbian.tools.wrttools.previewer/preview/script/lib/sapi/Landmarks.js Thu May 13 15:47:02 2010 -0700 +++ b/org.symbian.tools.wrttools.previewer/preview/script/lib/sapi/Landmarks.js Mon May 17 15:21:01 2010 -0700 @@ -563,7 +563,7 @@ missingIdList : '%s%s : Id list is Missing', missingTID : '%s%s : TransactionID is missing', invalidMime : '%s%s : MimeType is missing', - msgNoMsg : '', + msgNoMsg : '' }; diff -r 895153411a80 -r 915daddff233 org.symbian.tools.wrttools.previewer/preview/script/lib/sapi/Sensor.js --- a/org.symbian.tools.wrttools.previewer/preview/script/lib/sapi/Sensor.js Thu May 13 15:47:02 2010 -0700 +++ b/org.symbian.tools.wrttools.previewer/preview/script/lib/sapi/Sensor.js Mon May 17 15:21:01 2010 -0700 @@ -36,7 +36,7 @@ this.RegisterForNotification = __RegisterForNotification; this.Cancel = __Cancel; this.GetChannelProperty = __GetChannelProperty; - } + }; device.implementation.extend(provider, Interface, new SensorService() ); @@ -219,7 +219,7 @@ var returnValue = property[channel][criteria.PropertyId]; if(typeof returnValue == 'undefined') return context.ErrorResult(device.implementation.ERR_NOT_FOUND); - return context.Result(returnValue,0) + return context.Result(returnValue,0); } /** diff -r 895153411a80 -r 915daddff233 org.symbian.tools.wrttools.previewer/preview/script/lib/sapi/SysInfo.js --- a/org.symbian.tools.wrttools.previewer/preview/script/lib/sapi/SysInfo.js Thu May 13 15:47:02 2010 -0700 +++ b/org.symbian.tools.wrttools.previewer/preview/script/lib/sapi/SysInfo.js Mon May 17 15:21:01 2010 -0700 @@ -87,7 +87,7 @@ "availableusbmodes":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true}, "activeusbmode":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true}, "flipstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true}, - "gripstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true}, + "gripstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true} }, "memory":{ @@ -114,7 +114,7 @@ this.SetInfo = __SetInfo; this.GetNotification = __GetNotification; this.Cancel = __Cancel; - } + }; device.implementation.extend(provider, Interface, new SysInfoService() ); diff -r 895153411a80 -r 915daddff233 org.symbian.tools.wrttools.previewer/preview/script/nokia.js --- a/org.symbian.tools.wrttools.previewer/preview/script/nokia.js Thu May 13 15:47:02 2010 -0700 +++ b/org.symbian.tools.wrttools.previewer/preview/script/nokia.js Mon May 17 15:21:01 2010 -0700 @@ -25,6 +25,7 @@ version : 'WRT 1.1', currentDevice : '240x320', mode : 'portrait', + orientation : 0, resolution : ['240x320', '320x240', '360x640', '800x352'], scriptsLoaded : { loader : false, @@ -693,7 +694,7 @@ if(/dreamweaver/i.test(navigator.userAgent)) { $("#dwDeviceHelp")[0].className = ''; - $("#resSupportLink")[0].className = 'hide'; +// $("#resSupportLink")[0].className = 'hide'; } // Selecting Resoltion var resOptions = $("#resOptions")[0]; @@ -702,34 +703,33 @@ if(NOKIA.resolution[i] == NOKIA.currentDevice) { resOptions.options[i].selected = true; - $("#resSupportLink")[0].href = resOptions.options[i].value; break; } } - // Selecting Orientation - if(NOKIA.mode == 'portrait') - $('#input_portrait')[0].checked = true; - else - $('#input_landscape')[0].checked = true; +// // Selecting Orientation +// if(NOKIA.mode == 'portrait') +// $('#input_portrait')[0].checked = true; +// else +// $('#input_landscape')[0].checked = true; - if (!NOKIA.emulator.orientationSupports()) { - if (NOKIA.mode == 'portrait') - $("#input_landscape")[0].disabled = true; - else - $("#input_portrait")[0].disabled = true; - - $("#Orientation_Info").html("Not supported"); - $("#Orientation_Info").show(); - $("#Orientation_Controls").hide(); - } - else { - $("#input_landscape")[0].disabled = false; - $("#input_portrait")[0].disabled = false; - - $("#Orientation_Info").hide(); - $("#Orientation_Controls").show(); - } +// if (!NOKIA.emulator.orientationSupports()) { +// if (NOKIA.mode == 'portrait') +// $("#input_landscape")[0].disabled = true; +// else +// $("#input_portrait")[0].disabled = true; +// +// $("#Orientation_Info").html("Not supported"); +// $("#Orientation_Info").show(); +// $("#Orientation_Controls").hide(); +// } +// else { +// $("#input_landscape")[0].disabled = false; +// $("#input_portrait")[0].disabled = false; +// +// $("#Orientation_Info").hide(); +// $("#Orientation_Controls").show(); +// } // Selecting Version if(NOKIA.version == 'WRT 1.0') @@ -957,21 +957,40 @@ return NOKIA.emulator.prefs[name]; }, - toggle : function(ele) - { - if (NOKIA.emulator.orientationSupports()) { -// var mode = (NOKIA.mode == 'portrait') ? 'landscape' : 'portrait'; - NOKIA.emulator.setMode(ele.value); + rotateCW : function() { + if (NOKIA.orientation == 0) { + this.toggle(90); + } else if (NOKIA.orientation == 90) { + this.toggle(180); + } else if (NOKIA.orientation == 180) { + this.toggle(-90); + } else { + this.toggle(0); } - else - { - ele.checked = false; - if(ele.value == 'portrait') - $("#input_landscape")[0].checked = true; - else - $("#input_portrait")[0].checked = true; + }, + rotateCCW : function() { + if (NOKIA.orientation == 0) { + this.toggle(-90); + } else if (NOKIA.orientation == -90) { + this.toggle(180); + } else if (NOKIA.orientation == 180) { + this.toggle(90); + } else { + this.toggle(0); } }, + + toggle : function(o) + { + if (NOKIA.emulator.orientationSupports() && (o == 0 || o == -90)) { + NOKIA.emulator.setMode(o == 0 ? 'portrait' : 'landscape'); + } + NOKIA.orientation = o; + var or = (NOKIA.mode == 'portrait') ? o : (o + 90); + var val = "rotate(" + or + "deg)"; + $("#preview-ui-top").css("-moz-transform", val); + $("#preview-ui-top").css("-webkit-transform", val); + }, version : function(ele) { @@ -1054,19 +1073,16 @@ } }); - $('#input_portrait').change(function(){ - NOKIA.helper.toggle(this); + $('#rotateCW').click(function(){ + NOKIA.helper.rotateCW(); }); - - $('#input_landscape').change(function(){ - NOKIA.helper.toggle(this); + $('#rotateCCW').click(function(){ + NOKIA.helper.rotateCCW(); }); - $('#resOptions').change(function(ele){ ele = ele.target || this; NOKIA.currentDevice = ele.options[ele.selectedIndex].text; - $("#resSupportLink")[0].href = ele.value; // SAVE the device DATA NOKIA.helper.setPreference('__SYM_NOKIA_EMULATOR_DEVICE', NOKIA.currentDevice); diff -r 895153411a80 -r 915daddff233 org.symbian.tools.wrttools.previewer/preview/wrt_preview.html --- a/org.symbian.tools.wrttools.previewer/preview/wrt_preview.html Thu May 13 15:47:02 2010 -0700 +++ b/org.symbian.tools.wrttools.previewer/preview/wrt_preview.html Mon May 17 15:21:01 2010 -0700 @@ -66,34 +66,6 @@ - - - - - - - -
- Resolution - -   - Device matrix featuring this resolution - See WRT Help for device specifications -
- Orientation - -
- - -
-
-
-
WRT Version @@ -228,6 +200,16 @@
+
+
+ +
+