From 827e98f626341dbe67d2da9119266fc8ac87c2f8 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 12 Jan 2014 00:21:02 -0800 Subject: [PATCH] Use yui-compressor to combine JS into one file. Rename super to hyper to satisfy yui-compressor. --- guacamole-common-js/pom.xml | 29 +++++++++++++++++-- .../src/main/resources/common/license.js | 21 ++++++++++++++ .../src/main/resources/{ => modules}/audio.js | 0 .../main/resources/{ => modules}/guacamole.js | 0 .../main/resources/{ => modules}/keyboard.js | 22 +++++++------- .../src/main/resources/{ => modules}/layer.js | 0 .../src/main/resources/{ => modules}/mouse.js | 0 .../src/main/resources/modules/namespace.js | 6 ++++ .../resources/{ => modules}/oskeyboard.js | 0 .../main/resources/{ => modules}/tunnel.js | 0 guacamole-common-js/static.xml | 5 +++- 11 files changed, 69 insertions(+), 14 deletions(-) create mode 100644 guacamole-common-js/src/main/resources/common/license.js rename guacamole-common-js/src/main/resources/{ => modules}/audio.js (100%) rename guacamole-common-js/src/main/resources/{ => modules}/guacamole.js (100%) rename guacamole-common-js/src/main/resources/{ => modules}/keyboard.js (97%) rename guacamole-common-js/src/main/resources/{ => modules}/layer.js (100%) rename guacamole-common-js/src/main/resources/{ => modules}/mouse.js (100%) create mode 100644 guacamole-common-js/src/main/resources/modules/namespace.js rename guacamole-common-js/src/main/resources/{ => modules}/oskeyboard.js (100%) rename guacamole-common-js/src/main/resources/{ => modules}/tunnel.js (100%) diff --git a/guacamole-common-js/pom.xml b/guacamole-common-js/pom.xml index a994c67be..13d0fa1fa 100644 --- a/guacamole-common-js/pom.xml +++ b/guacamole-common-js/pom.xml @@ -49,8 +49,8 @@ - + maven-assembly-plugin 2.4 @@ -70,8 +70,33 @@ - + + net.alchim31.maven + yuicompressor-maven-plugin + 1.3.0 + + + + compress + + + + + true + + + ${project.build.directory}/guacamole.js + + ${basedir}/src/main/resources/common/license.js + **/*.js + + + + + + + diff --git a/guacamole-common-js/src/main/resources/common/license.js b/guacamole-common-js/src/main/resources/common/license.js new file mode 100644 index 000000000..c6c47cc5c --- /dev/null +++ b/guacamole-common-js/src/main/resources/common/license.js @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 Glyptodon LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ diff --git a/guacamole-common-js/src/main/resources/audio.js b/guacamole-common-js/src/main/resources/modules/audio.js similarity index 100% rename from guacamole-common-js/src/main/resources/audio.js rename to guacamole-common-js/src/main/resources/modules/audio.js diff --git a/guacamole-common-js/src/main/resources/guacamole.js b/guacamole-common-js/src/main/resources/modules/guacamole.js similarity index 100% rename from guacamole-common-js/src/main/resources/guacamole.js rename to guacamole-common-js/src/main/resources/modules/guacamole.js diff --git a/guacamole-common-js/src/main/resources/keyboard.js b/guacamole-common-js/src/main/resources/modules/keyboard.js similarity index 97% rename from guacamole-common-js/src/main/resources/keyboard.js rename to guacamole-common-js/src/main/resources/modules/keyboard.js index edf9ef9e4..28fa1e6c4 100644 --- a/guacamole-common-js/src/main/resources/keyboard.js +++ b/guacamole-common-js/src/main/resources/modules/keyboard.js @@ -88,7 +88,7 @@ Guacamole.Keyboard = function(element) { 40: [0xFF54], // down arrow 45: [0xFF63], // insert 46: [0xFFFF], // delete - 91: [0xFFEB], // left window key (super_l) + 91: [0xFFEB], // left window key (hyper_l) 92: [0xFF67], // right window key (menu key?) 93: null, // select key 112: [0xFFBE], // f1 @@ -242,8 +242,8 @@ Guacamole.Keyboard = function(element) { 0xFFE8: true, // Right meta 0xFFE9: true, // Left alt 0xFFEA: true, // Right alt (or AltGr) - 0xFFEB: true, // Left super - 0xFFEC: true // Right super + 0xFFEB: true, // Left hyper + 0xFFEC: true // Right hyper }; /** @@ -467,10 +467,10 @@ Guacamole.Keyboard = function(element) { release_key(0xFFE8); // Right meta } - // Release super if implicitly released - if (guac_keyboard.modifiers.super && state.super === false) { - release_key(0xFFEB); // Left super - release_key(0xFFEC); // Right super + // Release hyper if implicitly released + if (guac_keyboard.modifiers.hyper && state.hyper === false) { + release_key(0xFFEB); // Left hyper + release_key(0xFFEC); // Right hyper } // Update state @@ -514,7 +514,7 @@ Guacamole.Keyboard = function(element) { var keypress_unlikely = guac_keyboard.modifiers.ctrl || guac_keyboard.modifiers.alt || guac_keyboard.modifiers.meta - || guac_keyboard.modifiers.super; + || guac_keyboard.modifiers.hyper; if (keypress_unlikely && e.keyIdentifier) keysym = keysym || keysym_from_key_identifier( @@ -630,10 +630,10 @@ Guacamole.Keyboard.ModifierState = function() { this.meta = false; /** - * Whether super (windows key) is currently pressed. + * Whether hyper (windows key) is currently pressed. * @type Boolean */ - this.super = false; + this.hyper = false; }; @@ -656,7 +656,7 @@ Guacamole.Keyboard.ModifierState.fromKeyboardEvent = function(e) { // Use DOM3 getModifierState() for others if (e.getModifierState) { - state.super = e.getModifierState("OS") + state.hyper = e.getModifierState("OS") || e.getModifierState("Super") || e.getModifierState("Hyper") || e.getModifierState("Win"); diff --git a/guacamole-common-js/src/main/resources/layer.js b/guacamole-common-js/src/main/resources/modules/layer.js similarity index 100% rename from guacamole-common-js/src/main/resources/layer.js rename to guacamole-common-js/src/main/resources/modules/layer.js diff --git a/guacamole-common-js/src/main/resources/mouse.js b/guacamole-common-js/src/main/resources/modules/mouse.js similarity index 100% rename from guacamole-common-js/src/main/resources/mouse.js rename to guacamole-common-js/src/main/resources/modules/mouse.js diff --git a/guacamole-common-js/src/main/resources/modules/namespace.js b/guacamole-common-js/src/main/resources/modules/namespace.js new file mode 100644 index 000000000..4e722e389 --- /dev/null +++ b/guacamole-common-js/src/main/resources/modules/namespace.js @@ -0,0 +1,6 @@ +/** + * Namespace for all Guacamole JavaScript objects. + * @ignore + * @namespace + */ +var Guacamole = Guacamole || {}; \ No newline at end of file diff --git a/guacamole-common-js/src/main/resources/oskeyboard.js b/guacamole-common-js/src/main/resources/modules/oskeyboard.js similarity index 100% rename from guacamole-common-js/src/main/resources/oskeyboard.js rename to guacamole-common-js/src/main/resources/modules/oskeyboard.js diff --git a/guacamole-common-js/src/main/resources/tunnel.js b/guacamole-common-js/src/main/resources/modules/tunnel.js similarity index 100% rename from guacamole-common-js/src/main/resources/tunnel.js rename to guacamole-common-js/src/main/resources/modules/tunnel.js diff --git a/guacamole-common-js/static.xml b/guacamole-common-js/static.xml index d3903dc48..e857cede5 100644 --- a/guacamole-common-js/static.xml +++ b/guacamole-common-js/static.xml @@ -6,7 +6,10 @@ - src/main/resources + target/ + + *.js +