Commit Graph

1775 Commits

Author SHA1 Message Date
Joel Martin a7f5589946 vnc_auto.html: sync with mobile changes.
Also, add path option settable with query string.
2011-09-27 12:49:50 -05:00
Joel Martin 6209639f2c Add WebSocket URL path to UI settings. 2011-09-27 12:36:06 -05:00
Joel Martin 7cd6118ce5 Move viewport functions.
Move viewportChange(), getCleanDirtyReset(), absX() and absY() to the
public API section. Also add some function comments.
2011-09-26 17:09:29 -05:00
Joel Martin 490d471c53 Remove support for non-HTML5 browsers.
Display API change:
    - getTile -> startTile (no longer returns a tile)
    - setSubTile -> subTile (drop img/tile first parameter)
    - putTile -> finishTile (no longer takes img/tile paramter)

The Display tile logic uses canvas image data directly and
caches/reuses a 16x16 imageData tile (for other sizes, the tile is
create for each call). This gives a 30% speedup on Chrome
13 (and no significant change for Firefox 3.6/4.0).

Other:

- Remove rgbxImageFill and cmapImageFill routines.

- Simplify constructor tests and just error if createImageData is not
  supported by canvas instead of .

- Remove webkit canvas bug workaround that effects Chrome 7. Chrome
  7 usage share is now less than 0.5 percent and the workaround is
  ugly. Drop the function wrapping in the constructor and the canvas
  flush() routine.

- Remove support for getImageData (Opera 11+ now required)

Update browser support list:

    - Chrome 8+ (really any except 7)
    - Firefox 3.6+
    - Safari 4+
    - Opera 11+
    - IE9+
    - iOS 4.2+
2011-09-26 11:28:24 -05:00
Joel Martin 859fc7f18f include/ui.js: remove console.log debug. 2011-09-26 11:16:16 -05:00
Joel Martin 1310606305 Make tests/vnc_perf.html work again. 2011-09-25 22:02:13 -05:00
Joel Martin a7db50597c 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.
2011-09-23 00:51:55 -05:00
Joel Martin c506a48154 Only show move/drag button when clipping. Cleanup.
Cleanup:

- remove unused changeViewportMeta function from include/ui.js
- remove some debug output and debug CSS.
- rename panel toggle functions and put them in same location in the
  code.
- refactor some code from updateState to updateVisualState routine
  (renamed from updateSettingsState).
2011-09-23 00:04:01 -05:00
Joel Martin a5df24b488 Viewport clip/drag for mobile/touchscreen devices.
API changes (forward compatible):

- Display: add 'viewport' conf option to turn on and off viewport
  mode.
- RFB: add 'viewportDrag' option to enable/disable viewport dragging
  mode.

Other:

- Add clip mode setting to default UI. For touch devices, clipping is
  forced on.
- Use CSS media queries to adjust visual elements based on screen
  size. Especially disconnected logo size/position and button text size.
- Catch page unload while connected and give a confirm dialog.
- Change mouse button selector to a single button that changes between
  ' ', 'L', 'M', 'R' when clicked (empty means mouse is just being
  moved and doesn't send clicks).
- include/ui.js:setViewClip() routine sets the clipping of the
  viewport to the current size of the viewport area (if clipping is
  enabled).
- include/ui.js:setViewDrag() toggles/enables/disables viewport
  dragging mode.
- Add several images for the UI and for Apple devices:
    - images/clipboard.png: clipboard menu icon
    - images/connect.png: connect menu icon
    - images/disconnect.png: disconnect button icon
    - images/keyboard.png: show keyboard button
    - images/move.png: viewport drag/move toggle button
    - images/settings.png: settings menu icon
    - images/screen_320x460.png: iOS app/desktop link start image
    - images/screen_57x57.png: iOS app icon
    - images/screen_700x700.png: full size noVNC image
2011-09-22 10:36:23 -05:00
Joel Martin e0b23efe95 Fix fbUpdateRequest undefined parameter logic. 2011-09-14 10:42:15 -05:00
Joel Martin 608e0f52ee Some CSS style and DOM id/class cleanup. 2011-09-14 09:24:30 -05:00
Joel Martin 7e5f81f255 Merge branch 'master' into mobile 2011-09-13 16:53:04 -05:00
Joel Martin 832c744578 Framebuffer requests based on clean/dirty areas.
New routine fbUpdateRequests that builds the update request messages
based on the result of display.getCleanDirtyReset().

- Also, fix fbUpdateRequest to properly accept x,y,xw,yw parameters.
2011-09-13 14:42:38 -05:00
Joel Martin b70ce07706 Fix window/document sizing in firefox.
Another firefox issue is that height: 100% is calculated as 100% of
the containing element even when the containing element is the window.
This means that the size of any sibling element shifts the window size
down by that much and causes the vertical scroll bars to appear. This
doesn't happen in Chrome.

- So instead, put a pad element inside the noVNC_screen element that
  is the size of the control bar. This is hidden by the control bar,
  however, it causes things to be sized correctly.

- Also, rename noVNC_defaultScreen to noVNC_logo.

- Clean some style specification out of the HTML.
2011-09-13 13:14:11 -05:00
Joel Martin 1c3df652de Firefox offset bug: use margin instead of padding.
For some reason, the position calculation is broken in firefox when
a DOM object in the ancestry change uses padding. So use margin to
shift the view area down.
2011-09-13 12:17:44 -05:00
Joel Martin 9192cbe39c Merge branch 'master' into mobile
Conflicts:
	include/rfb.js
2011-09-13 10:14:53 -05:00
Joel Martin 54e7cbdf8f Viewport handling in include/display.js
Part of mobile device support:
https://github.com/kanaka/noVNC/issues/48

The Display object is redefined as a larger display region with
an equal or smaller visible viewport. The size of the full display
region is set/changed using resize(). The viewport is set/changed
using viewportChange().

All exposed routines that draw on the display now take coordinates
that are absolute (relative to the full display region). For example,
the result of fillRect(100, 100, 10, 10, [255,0,0]) will appear in the
canvas at (0,0) if the viewport is set to (100,100).

Details:

- Move the generic part of the viewport code from tests/viewport.html
  into include/display.

- Add two new routines to the Display interface:

    - viewportChange(deltaX, deltaY, width, height)
        - This adjusts the position of the visible viewport and/or the
          size of the viewport.

        - deltaX and deltaY specify how the position of the viewport
          should be shifted. The position of the viewport is clamped
          to the full region size (i.e. cannot outside the display
          region).

        - The clean and dirty regions of the display are updated based
          on calls to this routine. For example, if the viewport width
          is increased, then there is now a dirty box on the right
          side of the viewport. Another example, if the viewport is
          shifted down and to the left over the display region, there
          are now two dirty boxes: one on the left side and one
          on the bottom of the viewport.

    - getCleanDirtyReset()
        - This returns an object with the clean box and a list of
          dirty boxes (that need to be redrawn).

            {'cleanBox':
                {'x': x, 'y': y, 'w': w, 'h': h},
             'dirtyBoxes':
                [{'x': x, 'y': y, 'w': w, 'h': h}, ...]
             }

        - The coordinates in the clean and dirty boxes are absolute
          coordinates (relative to the full display region) but they
          are clipped to the visible viewport.

        - Calling this function also resets the clean rectangle to be
          the whole viewport (i.e. nothing visible needs to be redrawn
          dirty) so the caller of this routine is responsible for
          redrawing any
2011-09-13 09:54:44 -05:00
Joel Martin afecb83988 Pull websockify: python3 numpy buffer/string fix.
Pull from websockify 1c39c7f1f001.
2011-09-10 16:03:39 -05:00
Joel Martin 6ea8bece9b Fix setBarPosotion runtime errors. 2011-09-08 10:10:46 -05:00
Joel Martin 01a9eee991 HTML, CSS and Javascript indent/formatting.
- 4 space indenting for HTML and Javascript.
- 2 space indenting for CSS
- Use hanging start curly for conditional blocks
2011-09-08 10:00:09 -05:00
Joel Martin 0911173a89 Disable static canvas logo. 2011-09-08 09:29:05 -05:00
Joel Martin 42e04907ff Merge remote branch 'kanaka/master' into mobile 2011-09-08 08:50:18 -05:00
Joel Martin d29c54c476 Remove unused include/plain.css. 2011-09-08 08:41:50 -05:00
Chris Gordon 89a76c785c New theme. File: include/blue.css 2011-09-08 08:38:36 -05:00
Chris Gordon a7eb596d89 Updated to use CSS3 gradients instead of images.
Fixed display bug with keyboard textbox.
2011-09-08 08:36:42 -05:00
Chris Gordon 8e0f008841 Fixed bugs with connection panel, and moved functions into UI class. 2011-09-08 08:35:27 -05:00
Chris Gordon c1e8b30877 iOS keyboard bug fix. 2011-09-08 08:32:31 -05:00
Chris Gordon 2c6b8a481e Bug fix with mobile buttons. 2011-09-08 08:31:25 -05:00
Chris Gordon c327865b4b Add base.css. Bar position formatting. 2011-09-08 08:29:49 -05:00
Chris Gordon 53fc7392bb Modifed UI. Move HTML from ui.js to vnc.html. 2011-09-08 08:26:30 -05:00
Chris Gordon 1734b5e465 Helper function for viewport meta changes.
changeViewportMeta() now does viewport changes.
2011-09-08 08:21:46 -05:00
Chris Gordon 7825b9ee9f Added support for native iOS and Android keyboards.
Tested with Safari on iPad for iOS and Asus Transformer for Android.
2011-09-08 08:20:38 -05:00
Joel Martin 1150d0f70f Only output debug colourMap table once. 2011-09-06 17:46:57 -05:00
Joel Martin 7b10dc8a48 utils/websocket.py: add HyBi 13 support.
Pull from websockify 6e26306.
2011-08-31 18:06:58 -05:00
Joel Martin 94568bc08d utils/websocket.py: silence partial unmask debug.
Pull from websockify ada02f2.
2011-08-31 15:33:30 -05:00
Joel Martin fa74a6e60c websocket.py: fix payload length calculation.
Pull from websockify 0da91c7.
2011-08-31 15:08:03 -05:00
Joel Martin 48f26d799f websockify: pull HyBi fixes.
Pull 86af0b614d and 7b496ce5b from websockify.

    Fix HyBi support on 64-bit systems.

    https://github.com/kanaka/noVNC/issues/76

    - cleanup/update TODO.
    - remove explicit check for ctypes module for HyBi.

    Clarify that we support HyBi 07-10.

    HyBi 07 reports version 7 in the handshake.
    HyBi 08-10 report version 8 in the handshake.

    Remove version 9 since that is not yet actually defined.
2011-08-24 13:26:28 -05:00
Joel Martin ec40268e55 Working viewport test.
Tested on iOS (iPhone and iPad).

The viewport is correctly clipped to the screen/browser size and
resizing works correctly.

This uses the CSS3 Flexible Box Layout model.
2011-08-22 11:21:55 -05:00
Joel Martin 46c621175c Fix websockify with python2.4
https://github.com/kanaka/noVNC/issues/72

Pull from websockify 2e00f9643.
2011-08-10 17:54:15 -05:00
Joel Martin 676fbbb662 README: Zentyal (Ebox) and SlapOS to projects list. 2011-08-04 10:50:16 -05:00
Joel Martin 4245363cf4 Add a viewport example/test.
Tested with an iPad 2.

This example shows a 400x200 viewport of an 800x400 display.

It tries to be intelligent about how much it redraws. It copies what
it can, and then when the user releases the mouse, it redraws the
"dirty" areas that were newly revealed.
2011-08-03 18:18:41 -05:00
Joel Martin ce3bdbccc2 Catch Mozilla prefixing of WebSocket.
Pull 475cfae from websockify.

In Firefox 7 Mozilla has added Websockets support but prefixed the
constructor with "Moz".
2011-08-02 08:02:51 -05:00
Joel Martin ad3f762409 Touch events and mouse button selectors.
First crack at supporting touch screen for devices like Android and
iOS tablets. Part of https://github.com/kanaka/noVNC/issues/48.

This change detects touch screen support and uses the touchstart,
touchmove, touchend events in place of the normal mouse events.

In order to support middle and right mouse clicks, if the device is
a touch device, then three toggle buttons are added to the UI
representing the left, middle and right mouse buttons. These select
which mouse button will be sent when the screen is touched. All the
buttons can be toggled off, in which case then the touch events only
move the mouse cursor rather than sending a mouse down and mouse up
for touchstart and touchend events respectively. This allows fairly
full control with the mouse on touch screens.
2011-07-23 21:24:59 -05:00
Joel Martin ac99a1f791 Change default PixelFormat. Fix canvas test.
Instead of R,G,B (red-shift of 0, green-shift of 8, and blue-shift
of 16), use the default ordering of B,G,R (red-shift of 16, green-shift of 8, and blue-shift
of 0) that tightvncserver uses (and that VMWare's VNC server seems to
require). Also, warn in the console if the server does not default to
the new format.

Fix the tests/canvas.html test. This is a general fix with regards to
the rename/refactor of canvas.js into display.js and not specific to
the color re-ordering.
2011-07-18 12:17:47 -05:00
Joel Martin c0c143a153 Version 0.1, debian packaging, license text.
noVNC version 0.1

Add debian packaging directory loosely based on
http://trac.zentyal.org/browser/trunk/extra/novnc/debian

Show web root directory on startup (pulled from websockify f1c8223).

Lintian fixups:
    - Some license text clarifications.
    - remove executable permission on utils/launch.sh and
      include/web-socket-js/web_socket.js
    - Add executable permission to utils/launch.sh
2011-07-14 15:57:01 -05:00
Joel Martin 29c3cbee8b README: Fix CloudSigma link. 2011-07-13 15:19:09 -05:00
Joel Martin 241a6caea6 README: link to CloudSigma as product using noVNC. 2011-07-13 15:17:22 -05:00
Joel Martin 4f8c746518 Pull websockify socket() static method.
Pull websockify 46e2fbe.

WebSocketServer.socket() is a static method takes a host and port and
an optional connect parameter. If connect is not set then it returns
a socket listening on host and port. If connect is set then
a connection will be made host and port and the socket returned. This
has IPv6 support like the addrinfo method it replaces.

Also, prefer IPv4 resolutions if they are in the list. This can be
overriden to prefer IPv6 resolutions for the same host using the
optional prefer_ipv6 parameter.
2011-07-09 13:39:04 -05:00
Joel Martin 3a39bf60f3 Pull IPv6 and HyBi fixes from websockify.
Pull 7ae8711 from websockify.
2011-07-07 15:14:41 -05:00
Joel Martin 123e5e7445 Pull IPv6 support from websockify.
Pull from websockify 247b74950d.
2011-07-07 11:47:11 -05:00