diff --git a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/Extension.java b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/Extension.java index 6a1462c16..ea990351f 100644 --- a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/Extension.java +++ b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/Extension.java @@ -108,6 +108,18 @@ public class Extension { */ private final Collection> authenticationProviderClasses; + /** + * The resource for the small favicon for the extension. If provided, this + * will replace the default Guacamole icon. + */ + private final Resource smallIcon; + + /** + * The resource foe the large favicon for the extension. If provided, this + * will replace the default Guacamole icon. + */ + private final Resource largeIcon; + /** * Returns a new map of all resources corresponding to the collection of * paths provided. Each resource will be associated with the given @@ -346,6 +358,17 @@ public class Extension { // Define authentication providers authenticationProviderClasses = getAuthenticationProviderClasses(manifest.getAuthProviders()); + // Get small icon resource if provided + if (manifest.getSmallIcon() != null) + smallIcon = new ClassPathResource(classLoader, "image/png", manifest.getSmallIcon()); + else + smallIcon = null; + + // Get large icon resource if provided + if (manifest.getLargeIcon() != null) + largeIcon = new ClassPathResource(classLoader, "image/png", manifest.getLargeIcon()); + else + largeIcon = null; } /** @@ -447,4 +470,26 @@ public class Extension { return authenticationProviderClasses; } + /** + * Returns the resource for the small favicon for the extension. If + * provided, this will replace the default Guacamole icon. + * + * @return + * The resource for the small favicon. + */ + public Resource getSmallIcon() { + return smallIcon; + } + + /** + * Returns the resource for the large favicon for the extension. If + * provided, this will replace the default Guacamole icon. + * + * @return + * The resource for the large favicon. + */ + public Resource getLargeIcon() { + return largeIcon; + } + } diff --git a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/ExtensionManifest.java b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/ExtensionManifest.java index 25dde7aaa..6d121b7a9 100644 --- a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/ExtensionManifest.java +++ b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/ExtensionManifest.java @@ -86,6 +86,18 @@ public class ExtensionManifest { */ private Collection authProviders; + /** + * The path to the small favicon. If provided, this will replace the default + * Guacamole icon. + */ + private String smallIcon; + + /** + * The path to the large favicon. If provided, this will replace the default + * Guacamole icon. + */ + private String largeIcon; + /** * Returns the version of the Guacamole web application for which the * extension was built, such as "0.9.7". @@ -312,4 +324,48 @@ public class ExtensionManifest { this.authProviders = authProviders; } + /** + * Returns the path to the small favicon, relative to the root of the + * extension. + * + * @return + * The path to the small favicon. + */ + public String getSmallIcon() { + return smallIcon; + } + + /** + * Sets the path to the small favicon. This will replace the default + * Guacamole icon. + * + * @param smallIcon + * The path to the small favicon. + */ + public void setSmallIcon(String smallIcon) { + this.smallIcon = smallIcon; + } + + /** + * Returns the path to the large favicon, relative to the root of the + * extension. + * + * @return + * The path to the large favicon. + */ + public String getLargeIcon() { + return largeIcon; + } + + /** + * Sets the path to the large favicon. This will replace the default + * Guacamole icon. + * + * @param largeIcon + * The path to the large favicon. + */ + public void setLargeIcon(String largeIcon) { + this.largeIcon = largeIcon; + } + } diff --git a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/ExtensionModule.java b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/ExtensionModule.java index f9d6f1084..49d7a54ad 100644 --- a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/ExtensionModule.java +++ b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/ExtensionModule.java @@ -369,6 +369,14 @@ public class ExtensionModule extends ServletModule { String staticResourcePrefix = "/app/ext/" + extension.getNamespace() + "/"; serveStaticResources(staticResourcePrefix, extension.getStaticResources()); + // Serve up the small favicon if provided + if(extension.getSmallIcon() != null) + serve("/images/logo-64.png").with(new ResourceServlet(extension.getSmallIcon())); + + // Serve up the large favicon if provided + if(extension.getLargeIcon()!= null) + serve("/images/logo-144.png").with(new ResourceServlet(extension.getLargeIcon())); + // Log successful loading of extension by name logger.info("Extension \"{}\" loaded.", extension.getName()); diff --git a/guacamole/src/main/webapp/app/login/styles/dialog.css b/guacamole/src/main/webapp/app/login/styles/dialog.css index 56886c2bc..8298131b5 100644 --- a/guacamole/src/main/webapp/app/login/styles/dialog.css +++ b/guacamole/src/main/webapp/app/login/styles/dialog.css @@ -83,8 +83,14 @@ .login-ui .login-dialog .logo { display: block; - max-width: 3em; margin: 0.5em auto; + width: 3em; + height: 3em; + background-size: 3em 3em; + -moz-background-size: 3em 3em; + -webkit-background-size: 3em 3em; + -khtml-background-size: 3em 3em; + background-image: url("images/guac-tricolor.png"); } .login-ui.continuation div.login-dialog { diff --git a/guacamole/src/main/webapp/app/login/templates/login.html b/guacamole/src/main/webapp/app/login/templates/login.html index 3de86f507..5a2c11e82 100644 --- a/guacamole/src/main/webapp/app/login/templates/login.html +++ b/guacamole/src/main/webapp/app/login/templates/login.html @@ -31,7 +31,7 @@