You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by js...@apache.org on 2014/10/21 17:22:08 UTC

webworks commit: CB-7835 Control whether applications run with spatialNavigation mode

Repository: cordova-blackberry
Updated Branches:
  refs/heads/master 7005fb555 -> 642e72792


CB-7835 Control whether applications run with spatialNavigation mode

 <preference name="spatialNavigation" value="enable"/>


Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/642e7279
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/642e7279
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/642e7279

Branch: refs/heads/master
Commit: 642e72792161dcaded0998e285cb3bb8a97c1007
Parents: 7005fb5
Author: Josh Soref <js...@blackberry.com>
Authored: Tue Jul 22 18:34:17 2014 -0400
Committer: Josh Soref <js...@blackberry.com>
Committed: Tue Oct 21 11:20:25 2014 -0400

----------------------------------------------------------------------
 bin/templates/project/cordova/lib/config-parser.js | 9 ++++++++-
 framework/lib/framework.js                         | 8 ++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/642e7279/bin/templates/project/cordova/lib/config-parser.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/lib/config-parser.js b/bin/templates/project/cordova/lib/config-parser.js
index 841033c..6887435 100644
--- a/bin/templates/project/cordova/lib/config-parser.js
+++ b/bin/templates/project/cordova/lib/config-parser.js
@@ -151,6 +151,7 @@ function processWidgetData(data, widgetConfig, session) {
     widgetConfig.autoDeferNetworkingAndJavaScript = true;
     widgetConfig.theme = "default";
     widgetConfig.autoHideSplashScreen = "true";
+    widgetConfig.useSpatialNavigation = false;
 
     //set locally available features to access list
     if (data.feature) {
@@ -539,6 +540,7 @@ function processNameAndDescription(data, widgetConfig) {
 function processCordovaPreferences(data, widgetConfig) {
     if (data.preference) {
         var preference = JSON.parse(JSON.stringify(processParamObj(data.preference)).toLowerCase()),
+            spatialNavigation = preference.spatialnavigation,
             hideFormControl = preference.hidekeyboardformaccessorybar;
 
         widgetConfig.packageCordovaJs = preference.packagecordovajs === "enable";
@@ -555,7 +557,7 @@ function processCordovaPreferences(data, widgetConfig) {
         }
 
         // <preference name="HideKeyboardFormAccessoryBar" value="enable/true or disable/false" />
-        if (preference.hidekeyboardformaccessorybar) {
+        if (hideFormControl) {
             widgetConfig.enableFormControl = (hideFormControl !== 'enable') && (hideFormControl !== 'true');
         }
 
@@ -591,6 +593,11 @@ function processCordovaPreferences(data, widgetConfig) {
         if (preference.diskcache) {
             widgetConfig.enableDiskCache = (preference.diskcache !== 'disable');
         }
+
+        // <preference name="spatialNavigation" value="enable/true or disable/false" />
+        if (spatialNavigation) {
+            widgetConfig.useSpatialNavigation = (spatialNavigation === 'enable') || (spatialNavigation === 'true');
+        }
     }
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/642e7279/framework/lib/framework.js
----------------------------------------------------------------------
diff --git a/framework/lib/framework.js b/framework/lib/framework.js
index d57f2aa..f693104 100644
--- a/framework/lib/framework.js
+++ b/framework/lib/framework.js
@@ -115,6 +115,14 @@ var _self = {
                 qnx.webplatform.nativeCall('webview.setEnableDiskCache', webview.id, 'true');
             }
 
+            if (config.useSpatialNavigation) {
+                var _webview = webview.getWebViewObj();
+                if ("spatialNavigation" in _webview) {
+                    _webview.spatialNavigation = true;
+                    _webview.pointerInteractionMode = false;
+                }
+            }
+
             // Workaround for executeJavascript doing nothing for the first time
             webview.executeJavascript("1 + 1");
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org