Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 46B50D370 for ; Tue, 27 Nov 2012 18:37:35 +0000 (UTC) Received: (qmail 30368 invoked by uid 500); 27 Nov 2012 18:37:35 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 30278 invoked by uid 500); 27 Nov 2012 18:37:34 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 30269 invoked by uid 99); 27 Nov 2012 18:37:34 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2012 18:37:34 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1B83C812955; Tue, 27 Nov 2012 18:37:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kelveny@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: apply https://reviews.apache.org/r/7996/ Message-Id: <20121127183734.1B83C812955@tyr.zones.apache.org> Date: Tue, 27 Nov 2012 18:37:34 +0000 (UTC) Updated Branches: refs/heads/master ed5bd846e -> 7e8c605a0 apply https://reviews.apache.org/r/7996/ Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/7e8c605a Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/7e8c605a Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/7e8c605a Branch: refs/heads/master Commit: 7e8c605a0fb2e0ef6d5f99f2fe392043876e1832 Parents: ed5bd84 Author: Kelven Yang Authored: Tue Nov 27 10:37:24 2012 -0800 Committer: Kelven Yang Committed: Tue Nov 27 10:37:24 2012 -0800 ---------------------------------------------------------------------- console-proxy/js/ajaxviewer.js | 51 +++++++++++---- .../cloud/consoleproxy/ConsoleProxyClientBase.java | 1 + console-proxy/ui/viewer.ftl | 1 + 3 files changed, 41 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7e8c605a/console-proxy/js/ajaxviewer.js ---------------------------------------------------------------------- diff --git a/console-proxy/js/ajaxviewer.js b/console-proxy/js/ajaxviewer.js index 6ac56be..e95615d 100644 --- a/console-proxy/js/ajaxviewer.js +++ b/console-proxy/js/ajaxviewer.js @@ -109,17 +109,17 @@ KeyboardMapper.prototype = { // intialize keyboard mapping for RAW keyboard this.jsX11KeysymMap[AjaxViewer.JS_KEY_CAPSLOCK] = AjaxViewer.X11_KEY_CAPSLOCK; this.jsX11KeysymMap[AjaxViewer.JS_KEY_BACKSPACE] = AjaxViewer.X11_KEY_BACKSPACE; - this.jsX11KeysymMap[AjaxViewer.JS_KEY_TAB] = AjaxViewer.X11_KEY_TAB; + this.jsX11KeysymMap[AjaxViewer.JS_KEY_TAB] = AjaxViewer.X11_KEY_TAB; this.jsX11KeysymMap[AjaxViewer.JS_KEY_ENTER] = AjaxViewer.X11_KEY_ENTER; this.jsX11KeysymMap[AjaxViewer.JS_KEY_ESCAPE] = AjaxViewer.X11_KEY_ESCAPE; this.jsX11KeysymMap[AjaxViewer.JS_KEY_INSERT] = AjaxViewer.X11_KEY_INSERT; this.jsX11KeysymMap[AjaxViewer.JS_KEY_DELETE] = AjaxViewer.X11_KEY_DELETE; this.jsX11KeysymMap[AjaxViewer.JS_KEY_HOME] = AjaxViewer.X11_KEY_HOME; - this.jsX11KeysymMap[AjaxViewer.JS_KEY_END] = AjaxViewer.X11_KEY_END; + this.jsX11KeysymMap[AjaxViewer.JS_KEY_END] = AjaxViewer.X11_KEY_END; this.jsX11KeysymMap[AjaxViewer.JS_KEY_PAGEUP] = AjaxViewer.X11_KEY_PAGEUP; this.jsX11KeysymMap[AjaxViewer.JS_KEY_PAGEDOWN] = AjaxViewer.X11_KEY_PAGEDOWN; this.jsX11KeysymMap[AjaxViewer.JS_KEY_LEFT] = AjaxViewer.X11_KEY_LEFT; - this.jsX11KeysymMap[AjaxViewer.JS_KEY_UP] = AjaxViewer.X11_KEY_UP; + this.jsX11KeysymMap[AjaxViewer.JS_KEY_UP] = AjaxViewer.X11_KEY_UP; this.jsX11KeysymMap[AjaxViewer.JS_KEY_RIGHT] = AjaxViewer.X11_KEY_RIGHT; this.jsX11KeysymMap[AjaxViewer.JS_KEY_DOWN] = AjaxViewer.X11_KEY_DOWN; this.jsX11KeysymMap[AjaxViewer.JS_KEY_F1] = AjaxViewer.X11_KEY_F1; @@ -218,7 +218,6 @@ KeyboardMapper.prototype = { this.jsX11KeysymMap[AjaxViewer.JS_KEY_ALT] = AjaxViewer.X11_KEY_ALT; } }, - RawkeyboardInputHandler : function(eventType, code, modifiers, guestos, browser, browserVersion) { if(eventType == AjaxViewer.KEY_DOWN || eventType == AjaxViewer.KEY_UP) { @@ -237,6 +236,7 @@ KeyboardMapper.prototype = { return; } else if($.isArray(X11Keysym)) { for(var i = 0; i < X11Keysym.length; i++) { + // How to set the guestos, browser, version value??? add later if(this.isConditionalEntryMatched(eventType, code, modifiers, X11Keysym[i], guestos, browser, browserVersion)) { this.mappedInput.push(X11Keysym[i]); } @@ -442,8 +442,8 @@ function AjaxViewer(panelId, imageUrl, updateUrl, tileMap, width, height, tileWi window.onStatusNotify = function(status) {}; this.panel = this.generateCanvas(panelId, width, height, tileWidth, tileHeight); - - this.setupKeyboardTranslationTable(); +// this.setupKeyboardTranslationle(); + this.setupKeyboardTranslationTable(this.keyboardMappers); this.setupUIController(); } @@ -726,18 +726,20 @@ AjaxViewer.prototype = { }); this.checkEventQueue(); }, - +//NEW insert the keyboard tables file here +// ajaxKeys.js + setupKeyboardTranslationTable : function() { this.keyboardMappers = []; var mapper = new KeyboardMapper(); this.keyboardMappers[AjaxViewer.KEYBOARD_TYPE_ENGLISH] = mapper; mapper.setKeyboardType(KeyboardMapper.KEYBOARD_TYPE_COOKED); - + mapper = new KeyboardMapper(); this.keyboardMappers[AjaxViewer.KEYBOARD_TYPE_JAPANESE] = mapper; mapper.setKeyboardType(KeyboardMapper.KEYBOARD_TYPE_RAW); - + // JP keyboard plugged in a English host OS /* mapper.jsX11KeysymMap[AjaxViewer.JS_KEY_JP_COLON] = AjaxViewer.X11_KEY_COLON; @@ -759,8 +761,9 @@ AjaxViewer.prototype = { {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_TILDE, modifiers: 0, shift: true }, {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_TILDE, modifiers: 0, shift: true } ]; -*/ - +*/ + +/* Old // JP keyboard plugged in a Japanese host OS mapper.jsX11KeysymMap[222] = AjaxViewer.X11_KEY_CIRCUMFLEX_ACCENT; mapper.jsX11KeysymMap[220] = AjaxViewer.X11_KEY_YEN_MARK; @@ -789,7 +792,31 @@ AjaxViewer.prototype = { {type: AjaxViewer.KEY_DOWN, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: true }, {type: AjaxViewer.KEY_UP, code: AjaxViewer.X11_KEY_ADD, modifiers: 0, shift: true }, ]; - }, + +*/ + // create the mapping table based on the tables input + if (keyboardTables != undefined ) { + + for(var i = 0; i < keyboardTables.length; i++) { + var mappingTbl = keyboardTables[i]; + var mappings = mappingTbl.mappingTable; + var x11Maps = mappings.X11; + for (var j = 0; j < x11Maps.length; j++) { + var code = x11Maps[j].keycode; + var mappedEntry = x11Maps[j].entry; + mapper.jsX11KeysymMap[code] = mappedEntry; + } + var keyPressMaps = mappings.keyPress; + for (var j = 0; j < keyPressMaps.length; j++) { + var code = keyPressMaps[j].keycode; + var mappedEntry = keyPressMaps[j].entry; + mapper.jsKeyPressX11KeysymMap[code] = mappedEntry; + } + + } + } + + }, // end of the setupKeyboardTranslationTable function getCurrentKeyboardMapper : function() { return this.keyboardMappers[this.currentKeyboard]; http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7e8c605a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyClientBase.java ---------------------------------------------------------------------- diff --git a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyClientBase.java b/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyClientBase.java index e4f4727..289bdab 100644 --- a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyClientBase.java +++ b/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyClientBase.java @@ -302,6 +302,7 @@ public abstract class ConsoleProxyClientBase implements ConsoleProxyClient, Cons "", "", "", + "", "", "", "", http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7e8c605a/console-proxy/ui/viewer.ftl ---------------------------------------------------------------------- diff --git a/console-proxy/ui/viewer.ftl b/console-proxy/ui/viewer.ftl index d1b2b56..62de193 100644 --- a/console-proxy/ui/viewer.ftl +++ b/console-proxy/ui/viewer.ftl @@ -20,6 +20,7 @@ under the License. + ${title}