]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Merge pull request #1435 from nnn1590/fix-japanese-translation
authorSamuel Mannehed <samuel@cendio.se>
Wed, 8 Jul 2020 21:25:28 +0000 (23:25 +0200)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2020 21:25:28 +0000 (23:25 +0200)
Fix Japanese translation

16 files changed:
.github/workflows/deploy.yml [new file with mode: 0644]
.github/workflows/lint.yml [new file with mode: 0644]
.github/workflows/test.yml [new file with mode: 0644]
.travis.yml [deleted file]
README.md
VERSION [deleted file]
core/rfb.js
core/util/cursor.js
docs/API.md
karma.conf.js
package.json
po/noVNC.pot
snap/local/svc_wrapper.sh [new file with mode: 0755]
snap/snapcraft.yaml
tests/test.gesturehandler.js
utils/svc_wrapper.sh [deleted file]

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644 (file)
index 0000000..454ff8b
--- /dev/null
@@ -0,0 +1,49 @@
+name: Publish
+
+on:
+  release:
+    types: [published]
+
+jobs:
+  npm:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-node@v1
+        with:
+          # Needs to be explicitly specified for auth to work
+          registry-url: 'https://registry.npmjs.org'
+      - run: npm install
+      - run: npm publish --access public
+        env:
+          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
+        if: ${{ !github.event.release.prerelease }}
+      - run: npm publish --access public --tag beta
+        env:
+          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
+        if: ${{ github.event.release.prerelease }}
+  snap:
+    runs-on: ubuntu-latest
+    container: snapcore/snapcraft
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-node@v1
+      - run: npm install
+      - run: ./utils/use_require.js --clean --as commonjs --with-app
+      - run: |
+          cp utils/launch.sh build/launch.sh
+          cp snap/local/svc_wrapper.sh build/svc_wrapper.sh
+      - run: |
+          VERSION=$(grep '"version"' package.json | cut -d '"' -f 4)
+          echo $VERSION
+          sed -i "s/@VERSION@/$VERSION/g" snap/snapcraft.yaml
+      - run: snapcraft
+      - run: |
+          mkdir .snapcraft
+          echo ${SNAPCRAFT_LOGIN} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg
+        env:
+          SNAPCRAFT_LOGIN: ${{secrets.SNAPCRAFT_LOGIN}}
+      - run: snapcraft push --release=stable *.snap
+        if: ${{ !github.event.release.prerelease }}
+      - run: snapcraft push --release=beta *.snap
+        if: ${{ github.event.release.prerelease }}
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644 (file)
index 0000000..aaa3673
--- /dev/null
@@ -0,0 +1,19 @@
+name: Lint
+
+on: [push, pull_request]
+
+jobs:
+  eslint:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-node@v1
+      - run: npm install
+      - run: npm run lint
+  html:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-node@v1
+      - run: npm install
+      - run: git ls-tree --name-only -r HEAD | grep -E "[.](html|css)$" | xargs ./utils/validate
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644 (file)
index 0000000..5b03504
--- /dev/null
@@ -0,0 +1,30 @@
+name: Test
+
+on: [push, pull_request]
+
+jobs:
+  test:
+    strategy:
+      matrix:
+        os:
+          - ubuntu-latest
+          - windows-latest
+        browser:
+          - ChromeHeadless
+          - FirefoxHeadless
+        include:
+          - os: macos-latest
+            browser: Safari
+          - os: windows-latest
+            browser: EdgeHeadless
+          - os: windows-latest
+            browser: IE
+      fail-fast: false
+    runs-on: ${{ matrix.os }}
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-node@v1
+      - run: npm install
+      - run: npm run test
+        env:
+          TEST_BROWSER_NAME: ${{ matrix.browser }}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index da51f67..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-language: node_js
-sudo: false
-cache:
-  directories:
-  - node_modules
-node_js:
-  - lts/*
-env:
-  matrix:
-  - TEST_BROWSER_NAME=chrome TEST_BROWSER_OS='Windows 10'
-# FIXME Skip tests in Linux since Sauce Labs browser versions are ancient.
-#  - TEST_BROWSER_NAME=chrome TEST_BROWSER_OS='Linux'
-  - TEST_BROWSER_NAME=chrome TEST_BROWSER_OS='OS X 10.11'
-  - TEST_BROWSER_NAME=firefox TEST_BROWSER_OS='Windows 10'
-#  - TEST_BROWSER_NAME=firefox TEST_BROWSER_OS='Linux'
-  - TEST_BROWSER_NAME=firefox TEST_BROWSER_OS='OS X 10.11'
-  - TEST_BROWSER_NAME='internet explorer' TEST_BROWSER_OS='Windows 10'
-  - TEST_BROWSER_NAME='internet explorer' TEST_BROWSER_OS='Windows 7'
-  - TEST_BROWSER_NAME=microsoftedge TEST_BROWSER_OS='Windows 10'
-  - TEST_BROWSER_NAME=safari TEST_BROWSER_OS='OS X 10.13'
-before_script: npm install -g karma-cli
-addons:
-  sauce_connect:
-    username: "directxman12"
-  jwt:
-    secure: "d3ekMYslpn6R4f0ajtRMt9SUFmNGDiItHpqaXC5T4KI0KMEsxgvEOfJot5PiFFJWg1DSpJZH6oaW2UxGZ3duJLZrXIEd/JePY8a6NtT35BNgiDPgcp+eu2Bu3rhrSNg7/HEsD1ma+JeUTnv18Ai5oMFfCCQJx2J6osIxyl/ZVxA="
-stages:
-- lint
-- test
-- name: deploy
-  if: tag is PRESENT
-jobs:
-  include:
-  - stage: lint
-    env:
-    addons:
-    before_script:
-    script: npm run lint
-  -
-    env:
-    addons:
-    before_script:
-    script: git ls-tree --name-only -r HEAD | grep -E "[.](html|css)$" | xargs ./utils/validate
-  - stage: deploy
-    env:
-    addons:
-    script: skip
-    before_script: skip
-    deploy:
-      provider: npm
-      skip_cleanup: true
-      email: ossman@cendio.se
-      api_key:
-        secure: "Qq2Mi9xQawO2zlAigzshzMu2QMHvu1IaN9l0ZIivE99wHJj7eS5f4miJ9wB+/mWRRgb3E8uj9ZRV24+Oc36drlBTU9sz+lHhH0uFMfAIseceK64wZV9sLAZm472fmPp2xdUeTCCqPaRy7g1XBqiJ0LyZvEFLsRijqcLjPBF+b8w="
-      on:
-        tags: true
-        repo: novnc/noVNC
-
-
index b695d05c465827d2955d82f984cba955f70e254d..b5b84c3c81c66e0ffe9d6872013ea3d268ae3e77 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 ## noVNC: HTML VNC Client Library and Application
 
-[![Build Status](https://travis-ci.org/novnc/noVNC.svg?branch=master)](https://travis-ci.org/novnc/noVNC)
+[![Test Status](https://github.com/novnc/noVNC/workflows/Test/badge.svg)](https://github.com/novnc/noVNC/actions?query=workflow%3ATest)
+[![Lint Status](https://github.com/novnc/noVNC/workflows/Lint/badge.svg)](https://github.com/novnc/noVNC/actions?query=workflow%3ALint)
 
 ### Description
 
@@ -69,6 +70,7 @@ Please tweet [@noVNC](http://www.twitter.com/noVNC) if you do.
 * Local cursor rendering
 * Clipboard copy/paste
 * Translations
+* Touch gestures for emulating common mouse actions
 * Licensed mainly under the [MPL 2.0](http://www.mozilla.org/MPL/2.0/), see
   [the license document](LICENSE.txt) for details
 
diff --git a/VERSION b/VERSION
deleted file mode 100644 (file)
index 9084fa2..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-1.1.0
index 4d1b6159f01acf3959f68e60a82962a923a29583..f35d503f15dc48926bbd8d248018da6624ec075d 100644 (file)
@@ -588,11 +588,6 @@ export default class RFB extends EventTargetMixin {
     }
 
     _focusCanvas(event) {
-        // Respect earlier handlers' request to not do side-effects
-        if (event.defaultPrevented) {
-            return;
-        }
-
         if (!this.focusOnClick) {
             return;
         }
index 3f0b01bd7e951768fba4a0542c7314b784a68b70..4db1dab23fb6a93e0e7b5ad24817770b663b1395 100644 (file)
@@ -125,8 +125,16 @@ export default class Cursor {
         if (!useFallback) {
             return;
         }
-        this._position.x = clientX;
-        this._position.y = clientY;
+        // clientX/clientY are relative the _visual viewport_,
+        // but our position is relative the _layout viewport_,
+        // so try to compensate when we can
+        if (window.visualViewport) {
+            this._position.x = clientX + window.visualViewport.offsetLeft;
+            this._position.y = clientY + window.visualViewport.offsetTop;
+        } else {
+            this._position.x = clientX;
+            this._position.y = clientY;
+        }
         this._updatePosition();
         let target = document.elementFromPoint(clientX, clientY);
         this._updateVisibility(target);
@@ -171,6 +179,10 @@ export default class Cursor {
         // should be visible.
         if (this._captureIsActive()) {
             window.setTimeout(() => {
+                // We might have detached at this point
+                if (!this._target) {
+                    return;
+                }
                 // Refresh the target from elementFromPoint since queued events
                 // might have altered the DOM
                 target = document.elementFromPoint(event.clientX,
index 349fdc8869093edd2ae7f349d6d3552fa76db3ee..d78360a283ec1fded2a843711d9983670483db06 100644 (file)
@@ -382,5 +382,4 @@ to the remote server.
 ###### Parameters
 
 **`text`**
-  - A `DOMString` specifying the clipboard data to send. Currently only
-  characters from ISO 8859-1 are supported.
+  - A `DOMString` specifying the clipboard data to send.
index 5cbd7a5de86abdf52fa5ddd73b641c71500fcb7d..c295b1f900cfdc2812bc11c468847bd81620af4d 100644 (file)
@@ -1,48 +1,23 @@
 // Karma configuration
 
+// The Safari launcher is broken, so construct our own
+function SafariBrowser(id, baseBrowserDecorator, args) {
+  baseBrowserDecorator(this);
+
+  this._start = function(url) {
+    this._execCommand('/usr/bin/open', ['-W', '-n', '-a', 'Safari', url]);
+  }
+}
+
+SafariBrowser.prototype = {
+  name: 'Safari'
+}
+
 module.exports = (config) => {
-  const customLaunchers = {};
   let browsers = [];
-  let useSauce = false;
-
-  // use Sauce when running on Travis
-  if (process.env.TRAVIS_JOB_NUMBER) {
-    useSauce = true;
-  } 
-
-  if (useSauce && process.env.TEST_BROWSER_NAME && process.env.TEST_BROWSER_NAME != 'PhantomJS') {
-    const names = process.env.TEST_BROWSER_NAME.split(',');
-    const platforms = process.env.TEST_BROWSER_OS.split(',');
-    const versions = process.env.TEST_BROWSER_VERSION
-      ? process.env.TEST_BROWSER_VERSION.split(',')
-      : [null];
-
-    for (let i = 0; i < names.length; i++) {
-      for (let j = 0; j < platforms.length; j++) {
-        for (let k = 0; k < versions.length; k++) {
-          let launcher_name = 'sl_' + platforms[j].replace(/[^a-zA-Z0-9]/g, '') + '_' + names[i];
-          if (versions[k]) {
-            launcher_name += '_' + versions[k];
-          }
-
-          customLaunchers[launcher_name] = {
-            base: 'SauceLabs',
-            browserName: names[i],
-            platform: platforms[j],
-          };
-
-          if (versions[i]) {
-            customLaunchers[launcher_name].version = versions[k];
-          }
-        }
-      }
-    }
 
-    browsers = Object.keys(customLaunchers);
-  } else {
-    useSauce = false;
-    //browsers = ['PhantomJS'];
-    browsers = [];
+  if (process.env.TEST_BROWSER_NAME) {
+    browsers = process.env.TEST_BROWSER_NAME.split(',');
   }
 
   const my_conf = {
@@ -80,7 +55,11 @@ module.exports = (config) => {
     exclude: [
     ],
 
-    customLaunchers: customLaunchers,
+    plugins: [
+      'karma-*',
+      '@chiragrupani/karma-chromium-edge-launcher',
+      { 'launcher:Safari': [ 'type', SafariBrowser ] },
+    ],
 
     // start these browsers
     // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
@@ -92,14 +71,6 @@ module.exports = (config) => {
     reporters: ['mocha'],
 
 
-    // web server port
-    port: 9876,
-
-
-    // enable / disable colors in the output (reporters and logs)
-    colors: true,
-
-
     // level of logging
     // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
     logLevel: config.LOG_INFO,
@@ -111,24 +82,7 @@ module.exports = (config) => {
     // Continuous Integration mode
     // if true, Karma captures browsers, runs the tests and exits
     singleRun: true,
-
-    // Increase timeout in case connection is slow/we run more browsers than possible
-    // (we currently get 3 for free, and we try to run 7, so it can take a while)
-    captureTimeout: 240000,
-
-    // similarly to above
-    browserNoActivityTimeout: 100000,
   };
 
-  if (useSauce) {
-    my_conf.reporters.push('saucelabs');
-    my_conf.captureTimeout = 0; // use SL timeout
-    my_conf.sauceLabs = {
-      testName: 'noVNC Tests (all)',
-      startConnect: false,
-      tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
-    };
-  }
-
   config.set(my_conf);
 };
index 8ef1ccf5560301c3c9a6fb682e80c3bf2d930b91..523cfbfd3cdd74121c1a2d8a46c636cc789f8b5a 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "@novnc/novnc",
-  "version": "1.1.0",
+  "version": "1.2.0-beta",
   "description": "An HTML5 VNC client",
   "browser": "lib/rfb",
   "directories": {
     "jsdom": "*",
     "karma": "*",
     "karma-mocha": "*",
+    "karma-chrome-launcher": "*",
+    "@chiragrupani/karma-chromium-edge-launcher": "*",
+    "karma-firefox-launcher": "*",
+    "karma-ie-launcher": "*",
     "karma-mocha-reporter": "*",
-    "karma-sauce-launcher": "*",
+    "karma-safari-launcher": "*",
+    "karma-script-launcher": "*",
     "karma-sinon-chai": "*",
     "mocha": "*",
     "node-getopt": "*",
index 200be01de6e83b7efe6180fb939220860ad6d29f..01db78f00bb5f37af2109e83419b9096f36113ff 100644 (file)
@@ -6,9 +6,9 @@
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: noVNC 1.1.0\n"
+"Project-Id-Version: noVNC 1.2.0\n"
 "Report-Msgid-Bugs-To: novnc@googlegroups.com\n"
-"POT-Creation-Date: 2019-01-16 11:06+0100\n"
+"POT-Creation-Date: 2020-07-03 16:11+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,286 +17,282 @@ msgstr ""
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../app/ui.js:387
+#: ../app/ui.js:394
 msgid "Connecting..."
 msgstr ""
 
-#: ../app/ui.js:394
+#: ../app/ui.js:401
 msgid "Disconnecting..."
 msgstr ""
 
-#: ../app/ui.js:400
+#: ../app/ui.js:407
 msgid "Reconnecting..."
 msgstr ""
 
-#: ../app/ui.js:405
+#: ../app/ui.js:412
 msgid "Internal error"
 msgstr ""
 
-#: ../app/ui.js:995
+#: ../app/ui.js:1008
 msgid "Must set host"
 msgstr ""
 
-#: ../app/ui.js:1077
+#: ../app/ui.js:1090
 msgid "Connected (encrypted) to "
 msgstr ""
 
-#: ../app/ui.js:1079
+#: ../app/ui.js:1092
 msgid "Connected (unencrypted) to "
 msgstr ""
 
-#: ../app/ui.js:1102
+#: ../app/ui.js:1115
 msgid "Something went wrong, connection is closed"
 msgstr ""
 
-#: ../app/ui.js:1105
+#: ../app/ui.js:1118
 msgid "Failed to connect to server"
 msgstr ""
 
-#: ../app/ui.js:1115
+#: ../app/ui.js:1128
 msgid "Disconnected"
 msgstr ""
 
-#: ../app/ui.js:1128
+#: ../app/ui.js:1143
 msgid "New connection has been rejected with reason: "
 msgstr ""
 
-#: ../app/ui.js:1131
+#: ../app/ui.js:1146
 msgid "New connection has been rejected"
 msgstr ""
 
-#: ../app/ui.js:1151
-msgid "Password is required"
+#: ../app/ui.js:1181
+msgid "Credentials are required"
 msgstr ""
 
-#: ../vnc.html:84
+#: ../vnc.html:74
 msgid "noVNC encountered an error:"
 msgstr ""
 
-#: ../vnc.html:94
+#: ../vnc.html:84
 msgid "Hide/Show the control bar"
 msgstr ""
 
-#: ../vnc.html:101
-msgid "Move/Drag Viewport"
-msgstr ""
-
-#: ../vnc.html:101
-msgid "viewport drag"
+#: ../vnc.html:91
+msgid "Drag"
 msgstr ""
 
-#: ../vnc.html:107 ../vnc.html:110 ../vnc.html:113 ../vnc.html:116
-msgid "Active Mouse Button"
-msgstr ""
-
-#: ../vnc.html:107
-msgid "No mousebutton"
-msgstr ""
-
-#: ../vnc.html:110
-msgid "Left mousebutton"
-msgstr ""
-
-#: ../vnc.html:113
-msgid "Middle mousebutton"
-msgstr ""
-
-#: ../vnc.html:116
-msgid "Right mousebutton"
+#: ../vnc.html:91
+msgid "Move/Drag Viewport"
 msgstr ""
 
-#: ../vnc.html:119
+#: ../vnc.html:97
 msgid "Keyboard"
 msgstr ""
 
-#: ../vnc.html:119
+#: ../vnc.html:97
 msgid "Show Keyboard"
 msgstr ""
 
-#: ../vnc.html:126
+#: ../vnc.html:102
 msgid "Extra keys"
 msgstr ""
 
-#: ../vnc.html:126
+#: ../vnc.html:102
 msgid "Show Extra Keys"
 msgstr ""
 
-#: ../vnc.html:131
+#: ../vnc.html:107
 msgid "Ctrl"
 msgstr ""
 
-#: ../vnc.html:131
+#: ../vnc.html:107
 msgid "Toggle Ctrl"
 msgstr ""
 
-#: ../vnc.html:134
+#: ../vnc.html:110
 msgid "Alt"
 msgstr ""
 
-#: ../vnc.html:134
+#: ../vnc.html:110
 msgid "Toggle Alt"
 msgstr ""
 
-#: ../vnc.html:137
+#: ../vnc.html:113
 msgid "Toggle Windows"
 msgstr ""
 
-#: ../vnc.html:137
+#: ../vnc.html:113
 msgid "Windows"
 msgstr ""
 
-#: ../vnc.html:140
+#: ../vnc.html:116
 msgid "Send Tab"
 msgstr ""
 
-#: ../vnc.html:140
+#: ../vnc.html:116
 msgid "Tab"
 msgstr ""
 
-#: ../vnc.html:143
+#: ../vnc.html:119
 msgid "Esc"
 msgstr ""
 
-#: ../vnc.html:143
+#: ../vnc.html:119
 msgid "Send Escape"
 msgstr ""
 
-#: ../vnc.html:146
+#: ../vnc.html:122
 msgid "Ctrl+Alt+Del"
 msgstr ""
 
-#: ../vnc.html:146
+#: ../vnc.html:122
 msgid "Send Ctrl-Alt-Del"
 msgstr ""
 
-#: ../vnc.html:154
+#: ../vnc.html:129
 msgid "Shutdown/Reboot"
 msgstr ""
 
-#: ../vnc.html:154
+#: ../vnc.html:129
 msgid "Shutdown/Reboot..."
 msgstr ""
 
-#: ../vnc.html:160
+#: ../vnc.html:135
 msgid "Power"
 msgstr ""
 
-#: ../vnc.html:162
+#: ../vnc.html:137
 msgid "Shutdown"
 msgstr ""
 
-#: ../vnc.html:163
+#: ../vnc.html:138
 msgid "Reboot"
 msgstr ""
 
-#: ../vnc.html:164
+#: ../vnc.html:139
 msgid "Reset"
 msgstr ""
 
-#: ../vnc.html:169 ../vnc.html:175
+#: ../vnc.html:144 ../vnc.html:150
 msgid "Clipboard"
 msgstr ""
 
-#: ../vnc.html:179
+#: ../vnc.html:154
 msgid "Clear"
 msgstr ""
 
-#: ../vnc.html:185
+#: ../vnc.html:160
 msgid "Fullscreen"
 msgstr ""
 
-#: ../vnc.html:190 ../vnc.html:197
+#: ../vnc.html:165 ../vnc.html:172
 msgid "Settings"
 msgstr ""
 
-#: ../vnc.html:200
+#: ../vnc.html:175
 msgid "Shared Mode"
 msgstr ""
 
-#: ../vnc.html:203
+#: ../vnc.html:178
 msgid "View Only"
 msgstr ""
 
-#: ../vnc.html:207
+#: ../vnc.html:182
 msgid "Clip to Window"
 msgstr ""
 
-#: ../vnc.html:210
+#: ../vnc.html:185
 msgid "Scaling Mode:"
 msgstr ""
 
-#: ../vnc.html:212
+#: ../vnc.html:187
 msgid "None"
 msgstr ""
 
-#: ../vnc.html:213
+#: ../vnc.html:188
 msgid "Local Scaling"
 msgstr ""
 
-#: ../vnc.html:214
+#: ../vnc.html:189
 msgid "Remote Resizing"
 msgstr ""
 
-#: ../vnc.html:219
+#: ../vnc.html:194
 msgid "Advanced"
 msgstr ""
 
-#: ../vnc.html:222
+#: ../vnc.html:197
+msgid "Quality:"
+msgstr ""
+
+#: ../vnc.html:201
+msgid "Compression level:"
+msgstr ""
+
+#: ../vnc.html:206
 msgid "Repeater ID:"
 msgstr ""
 
-#: ../vnc.html:226
+#: ../vnc.html:210
 msgid "WebSocket"
 msgstr ""
 
-#: ../vnc.html:229
+#: ../vnc.html:213
 msgid "Encrypt"
 msgstr ""
 
-#: ../vnc.html:232
+#: ../vnc.html:216
 msgid "Host:"
 msgstr ""
 
-#: ../vnc.html:236
+#: ../vnc.html:220
 msgid "Port:"
 msgstr ""
 
-#: ../vnc.html:240
+#: ../vnc.html:224
 msgid "Path:"
 msgstr ""
 
-#: ../vnc.html:247
+#: ../vnc.html:231
 msgid "Automatic Reconnect"
 msgstr ""
 
-#: ../vnc.html:250
+#: ../vnc.html:234
 msgid "Reconnect Delay (ms):"
 msgstr ""
 
-#: ../vnc.html:255
+#: ../vnc.html:239
 msgid "Show Dot when No Cursor"
 msgstr ""
 
-#: ../vnc.html:260
+#: ../vnc.html:244
 msgid "Logging:"
 msgstr ""
 
-#: ../vnc.html:272
+#: ../vnc.html:253
+msgid "Version:"
+msgstr ""
+
+#: ../vnc.html:261
 msgid "Disconnect"
 msgstr ""
 
-#: ../vnc.html:291
+#: ../vnc.html:280
 msgid "Connect"
 msgstr ""
 
-#: ../vnc.html:301
+#: ../vnc.html:290
+msgid "Username:"
+msgstr ""
+
+#: ../vnc.html:294
 msgid "Password:"
 msgstr ""
 
-#: ../vnc.html:305
-msgid "Send Password"
+#: ../vnc.html:298
+msgid "Send Credentials"
 msgstr ""
 
-#: ../vnc.html:315
+#: ../vnc.html:308
 msgid "Cancel"
 msgstr ""
diff --git a/snap/local/svc_wrapper.sh b/snap/local/svc_wrapper.sh
new file mode 100755 (executable)
index 0000000..7b0be23
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# `snapctl get services` returns a JSON array, example:
+#{
+#"n6801": {
+#   "listen": 6801,
+#   "vnc": "localhost:5901"
+#},
+#"n6802": {
+#    "listen": 6802,
+#   "vnc": "localhost:5902"
+#}
+#}
+snapctl get services | jq -c '.[]' | while read service; do # for each service the user sepcified..
+    # get the important data for the service (listen port, VNC host:port)
+    listen_port="$(echo $service | jq --raw-output '.listen')"
+    vnc_host_port="$(echo $service | jq --raw-output '.vnc')" # --raw-output removes any quotation marks from the output
+    
+    # check whether those values are valid
+    expr "$listen_port" : '^[0-9]\+$' > /dev/null
+    listen_port_valid=$?
+    if [ ! $listen_port_valid ] || [ -z "$vnc_host_port" ]; then
+        # invalid values mean the service is disabled, do nothing except for printing a message (logged in /var/log/system or systemd journal)
+        echo "novnc: not starting service ${service} with listen_port ${listen_port} and vnc_host_port ${vnc_host_port}"
+    else
+        # start (and fork with '&') the service using the specified listen port and VNC host:port
+        $SNAP/launch.sh --listen $listen_port --vnc $vnc_host_port &
+    fi
+done
index e21ef6e56afee2d3940047cf7d14b1786d571422..d1bb9dc8a6c47823e9135c45dc23b15467d0cb7c 100644 (file)
@@ -1,17 +1,19 @@
 name: novnc
 base: core18 # the base snap is the execution environment for this snap
-version: '1.1.0'
+version: '@VERSION@'
 summary: Open Source VNC client using HTML5 (WebSockets, Canvas)
 description: |
   Open Source VNC client using HTML5 (WebSockets, Canvas).
-  noVNC is both a VNC client JavaScript library as well as an application built on top of that library. noVNC runs well in any modern browser including mobile browsers (iOS and Android).
+  noVNC is both a VNC client JavaScript library as well as an
+  application built on top of that library. noVNC runs well in any
+  modern browser including mobile browsers (iOS and Android).
 
 grade: stable
 confinement: strict
 
 parts:
     novnc:
-        source: https://github.com/novnc/noVNC.git #https://github.com/novnc/noVNC/archive/v$SNAPCRAFT_PROJECT_VERSION.tar.gz 
+        source: build/
         plugin: dump
         stage-packages:
             - websockify
@@ -26,9 +28,9 @@ hooks:
 
 apps:
     novnc:
-        command: utils/launch.sh
+        command: ./launch.sh
         plugs: [network, network-bind]
     novncsvc:
-        command: utils/svc_wrapper.sh
+        command: ./svc_wrapper.sh
         daemon: forking
         plugs: [network, network-bind]
index bfb26219934ba42c772e84079d07c033f2d69b3f..ba2f7991ad630c4100dbfa594f36ad6605f0d665 100644 (file)
@@ -40,7 +40,9 @@ describe('Gesture handler', function () {
     });
 
     afterEach(function () {
-        handler.detach();
+        if (handler) {
+            handler.detach();
+        }
         target = null;
         gestures = null;
     });
diff --git a/utils/svc_wrapper.sh b/utils/svc_wrapper.sh
deleted file mode 100755 (executable)
index 51d7464..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-# `snapctl get services` returns a JSON array, example:
-#{
-#"n6801": {
-#   "listen": 6801,
-#   "vnc": "localhost:5901"
-#},
-#"n6802": {
-#    "listen": 6802,
-#   "vnc": "localhost:5902"
-#}
-#}
-snapctl get services | jq -c '.[]' | while read service; do # for each service the user sepcified..
-    # get the important data for the service (listen port, VNC host:port)
-    listen_port="$(echo $service | jq --raw-output '.listen')"
-    vnc_host_port="$(echo $service | jq --raw-output '.vnc')" # --raw-output removes any quotation marks from the output
-    
-    # check whether those values are valid
-    expr "$listen_port" : '^[0-9]\+$' > /dev/null
-    listen_port_valid=$?
-    if [ ! $listen_port_valid ] || [ -z "$vnc_host_port" ]; then
-        # invalid values mean the service is disabled, do nothing except for printing a message (logged in /var/log/system or systemd journal)
-        echo "novnc: not starting service ${service} with listen_port ${listen_port} and vnc_host_port ${vnc_host_port}"
-    else
-        # start (and fork with '&') the service using the specified listen port and VNC host:port
-        $SNAP/utils/launch.sh --listen $listen_port --vnc $vnc_host_port &
-    fi
-done