Use yui-compressor to combine JS into one file. Rename super to hyper to satisfy yui-compressor.

This commit is contained in:
Michael Jumper
2014-01-12 00:21:02 -08:00
parent 9b5ef9b5ff
commit 827e98f626
11 changed files with 69 additions and 14 deletions

View File

@@ -49,8 +49,8 @@
</properties> </properties>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version> <version>2.4</version>
@@ -70,8 +70,33 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.3.0</version>
<executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<nosuffix>true</nosuffix>
<aggregations>
<aggregation>
<output>${project.build.directory}/guacamole.js</output>
<includes>
<include>${basedir}/src/main/resources/common/license.js</include>
<include>**/*.js</include>
</includes>
</aggregation>
</aggregations>
</configuration>
</plugin>
</plugins>
</build> </build>
</project> </project>

View File

@@ -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.
*/

View File

@@ -88,7 +88,7 @@ Guacamole.Keyboard = function(element) {
40: [0xFF54], // down arrow 40: [0xFF54], // down arrow
45: [0xFF63], // insert 45: [0xFF63], // insert
46: [0xFFFF], // delete 46: [0xFFFF], // delete
91: [0xFFEB], // left window key (super_l) 91: [0xFFEB], // left window key (hyper_l)
92: [0xFF67], // right window key (menu key?) 92: [0xFF67], // right window key (menu key?)
93: null, // select key 93: null, // select key
112: [0xFFBE], // f1 112: [0xFFBE], // f1
@@ -242,8 +242,8 @@ Guacamole.Keyboard = function(element) {
0xFFE8: true, // Right meta 0xFFE8: true, // Right meta
0xFFE9: true, // Left alt 0xFFE9: true, // Left alt
0xFFEA: true, // Right alt (or AltGr) 0xFFEA: true, // Right alt (or AltGr)
0xFFEB: true, // Left super 0xFFEB: true, // Left hyper
0xFFEC: true // Right super 0xFFEC: true // Right hyper
}; };
/** /**
@@ -467,10 +467,10 @@ Guacamole.Keyboard = function(element) {
release_key(0xFFE8); // Right meta release_key(0xFFE8); // Right meta
} }
// Release super if implicitly released // Release hyper if implicitly released
if (guac_keyboard.modifiers.super && state.super === false) { if (guac_keyboard.modifiers.hyper && state.hyper === false) {
release_key(0xFFEB); // Left super release_key(0xFFEB); // Left hyper
release_key(0xFFEC); // Right super release_key(0xFFEC); // Right hyper
} }
// Update state // Update state
@@ -514,7 +514,7 @@ Guacamole.Keyboard = function(element) {
var keypress_unlikely = guac_keyboard.modifiers.ctrl var keypress_unlikely = guac_keyboard.modifiers.ctrl
|| guac_keyboard.modifiers.alt || guac_keyboard.modifiers.alt
|| guac_keyboard.modifiers.meta || guac_keyboard.modifiers.meta
|| guac_keyboard.modifiers.super; || guac_keyboard.modifiers.hyper;
if (keypress_unlikely && e.keyIdentifier) if (keypress_unlikely && e.keyIdentifier)
keysym = keysym || keysym_from_key_identifier( keysym = keysym || keysym_from_key_identifier(
@@ -630,10 +630,10 @@ Guacamole.Keyboard.ModifierState = function() {
this.meta = false; this.meta = false;
/** /**
* Whether super (windows key) is currently pressed. * Whether hyper (windows key) is currently pressed.
* @type Boolean * @type Boolean
*/ */
this.super = false; this.hyper = false;
}; };
@@ -656,7 +656,7 @@ Guacamole.Keyboard.ModifierState.fromKeyboardEvent = function(e) {
// Use DOM3 getModifierState() for others // Use DOM3 getModifierState() for others
if (e.getModifierState) { if (e.getModifierState) {
state.super = e.getModifierState("OS") state.hyper = e.getModifierState("OS")
|| e.getModifierState("Super") || e.getModifierState("Super")
|| e.getModifierState("Hyper") || e.getModifierState("Hyper")
|| e.getModifierState("Win"); || e.getModifierState("Win");

View File

@@ -0,0 +1,6 @@
/**
* Namespace for all Guacamole JavaScript objects.
* @ignore
* @namespace
*/
var Guacamole = Guacamole || {};

View File

@@ -6,7 +6,10 @@
</formats> </formats>
<fileSets> <fileSets>
<fileSet> <fileSet>
<directory>src/main/resources</directory> <directory>target/</directory>
<includes>
<include>*.js</include>
</includes>
<outputDirectory></outputDirectory> <outputDirectory></outputDirectory>
</fileSet> </fileSet>
</fileSets> </fileSets>