فهرست منبع

Fixing iOS clipping, keyboard issues.

- Make sure that on iOS the clipping setting is always forced to be
  enabled.
- Hide the showKeyboard button unless connected.
- Use the URL text entry method and disable autocorrect and
  autocapitalize in the show keyboard input box.
Joel Martin 14 سال پیش
والد
کامیت
a7db50597c
2فایلهای تغییر یافته به همراه13 افزوده شده و 4 حذف شده
  1. 11 3
      include/ui.js
  2. 2 1
      vnc.html

+ 11 - 3
include/ui.js

@@ -73,7 +73,7 @@ load: function() {
         UI.setMouseButton();
         // Remove the address bar
         setTimeout(function() { window.scrollTo(0, 1); }, 100);
-        UI.initSetting('clip', true);
+        UI.forceSetting('clip', true);
         $D('noVNC_clip').disabled = true;
     } else {
         UI.initSetting('clip', false);
@@ -177,6 +177,12 @@ initSetting: function(name, defVal) {
     return val;
 },
 
+// Force a setting to be a certain value
+forceSetting: function(name, val) {
+    UI.updateSetting(name, val);
+    return val;
+},
+
 
 // Show the clipboard panel
 toggleClipboardPanel: function() {
@@ -392,9 +398,11 @@ updateVisualState: function() {
     if (connected) {
         UI.setViewClip();
         UI.setMouseButton(1);
+        $D('showKeyboard').style.display = "inline";
         $D('sendCtrlAltDelButton').style.display = "inline";
     } else {
         UI.setMouseButton();
+        $D('showKeyboard').style.display = "none";
         $D('sendCtrlAltDelButton').style.display = "none";
     }
     // State change disables viewport dragging.
@@ -495,8 +503,8 @@ setViewClip: function(clip) {
 
     cur_clip = display.get_viewport();
 
-    if (typeof(clip) !== 'undefined') {
-        // Nothing
+    if (typeof(clip) !== 'boolean') {
+        // Use current setting
         clip = UI.getSetting('clip');
     }
 

+ 2 - 1
vnc.html

@@ -70,7 +70,8 @@
                     id="showKeyboard" class="noVNC_status_button" 
                     value="Keyboard" title="Show Keyboard"
                     onclick="UI.showKeyboard()"/>
-                <input type="text"
+                <input type="url"
+                    autocapitalize="off" autocorrect="off"
                     id="keyboardinput" class="noVNC_status_button"
                     onKeyDown="onKeyDown(event);"/>
             </div>