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.
This commit is contained in:
Joel Martin 2011-09-23 00:51:55 -05:00
parent c506a48154
commit a7db50597c
2 changed files with 13 additions and 4 deletions

View File

@ -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');
}

View File

@ -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>