Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 1 pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@
<exclude>systemvm/conf/agent.properties</exclude>
<exclude>systemvm/conf/environment.properties</exclude>
<exclude>systemvm/js/jquery.js</exclude>
<exclude>systemvm/js/jquery.flot.navigate.js</exclude>
<exclude>systemvm/patches/debian/systemvm.vmx</exclude>
<exclude>systemvm/patches/debian/config/root/.ssh/authorized_keys</exclude>
<exclude>systemvm/patches/debian/config/etc/apache2/httpd.conf</exclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ private void handleClientEvent(ConsoleProxyClient viewer, int event, Map<String,
case 2: // mouse down
case 3: // mouse up
case 8: // mouse double click
case 9: // mouse scroll
str = queryMap.get("x");
if (str != null) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ private String getAjaxViewerPageContent(String tileSequence, String imgUrl, Stri

String[] content =
new String[] {"<html>", "<head>", "<script type=\"text/javascript\" language=\"javascript\" src=\"/resource/js/jquery.js\"></script>",
"<script type=\"text/javascript\" language=\"javascript\" src=\"/resource/js/jquery.flot.navigate.js\"></script>",
"<script type=\"text/javascript\" language=\"javascript\" src=\"/resource/js/cloud.logger.js\"></script>",
"<script type=\"text/javascript\" language=\"javascript\" src=\"/resource/js/ajaxkeys.js\"></script>",
"<script type=\"text/javascript\" language=\"javascript\" src=\"/resource/js/ajaxviewer.js\"></script>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@ public void sendClientMouseEvent(InputEventType event, int x, int y, int code, i
}
}

if (event == InputEventType.MOUSE_SCROLL) {
if (code == -1) {
lastPointerMask = 8;
} else if (code == 1) {
lastPointerMask = 16;
} else if (code == 0) {
lastPointerMask = 0;
}
}

sendModifierEvents(modifiers);
client.sendClientMouseEvent(lastPointerMask, x, y, code, modifiers);
if (lastPointerMask == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.cloud.consoleproxy;

public enum InputEventType {
MOUSE_MOVE(1), MOUSE_DOWN(2), MOUSE_UP(3), KEY_PRESS(4), KEY_DOWN(5), KEY_UP(6), MOUSE_DBLCLICK(8);
MOUSE_MOVE(1), MOUSE_DOWN(2), MOUSE_UP(3), KEY_PRESS(4), KEY_DOWN(5), KEY_UP(6), MOUSE_DBLCLICK(8), MOUSE_SCROLL(9);

int eventCode;

Expand Down Expand Up @@ -45,6 +45,8 @@ public static InputEventType fromEventCode(int eventCode) {
return KEY_UP;
case 8:
return MOUSE_DBLCLICK;
case 9:
return MOUSE_SCROLL;
default:
break;
}
Expand Down
24 changes: 23 additions & 1 deletion 24 systemvm/js/ajaxviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ AjaxViewer.KEY_DOWN = 5;
AjaxViewer.KEY_UP = 6;
AjaxViewer.EVENT_BAG = 7;
AjaxViewer.MOUSE_DBLCLK = 8;
AjaxViewer.MOUSE_SCROLL = 9;

// use java AWT key modifier masks
AjaxViewer.SHIFT_KEY_MASK = 64;
Expand Down Expand Up @@ -617,7 +618,6 @@ AjaxViewer.prototype = {
var img = $(this.img);
this.fullImage = fullImage;
this.imgUrl=imageUrl;
this.imageLoaded = false;

img.attr('src', imageUrl).load(function() {
ajaxViewer.imageLoaded = true;
Expand Down Expand Up @@ -1230,6 +1230,23 @@ AjaxViewer.prototype = {
e.stopPropagation();
return false;
});

target.bind('mousewheel DOMMouseScroll',function(e) {
if(!ajaxViewer.ptInPanel(e.pageX, e.pageY))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you consider adding braces to if () {}

return true;

var modifiers = ajaxViewer.getKeyModifiers(e);
var sd = e.originalEvent.detail/3;

var pt = ajaxViewer.pageToPanel(e.clientX, e.clientY);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra newline.


ajaxViewer.onMouseScroll(pt.x, pt.y, sd, modifiers);
ajaxViewer.onMouseScroll(pt.x, pt.y, 0, modifiers);

e.stopPropagation();
return false;
});

// disable browser right-click context menu
target.bind("contextmenu", function() { return false; });
Expand Down Expand Up @@ -1346,6 +1363,11 @@ AjaxViewer.prototype = {
onMouseDblClick: function(x, y, whichButton, modifiers) {
this.sendMouseEvent(AjaxViewer.MOUSE_DBLCLK, x, y, whichButton, modifiers);
},

onMouseScroll: function(x, y, whichButton, modifiers) {
this.sendMouseEvent(AjaxViewer.MOUSE_SCROLL, x, y, whichButton, modifiers);
},


onKeyPress: function(code, modifiers) {
g_logger.log(Logger.LEVEL_WARN, "RAW KEYBOARD EVENT. KEY-PRESS: " + code + ", modifers: " + modifiers);
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.