From: Christos KK Loverdos Date: Mon, 2 Dec 2013 11:23:43 +0000 (+0200) Subject: Get favicon url from injected properties X-Git-Tag: 0.15rc1~3^2~1 X-Git-Url: https://code.grnet.gr/git/pithos-web-client/commitdiff_plain/bca3de0ba6e2497954872aae7db4ec48bcc186cd?ds=sidebyside Get favicon url from injected properties Not tested yet, waiting for the devenv Refs #4677 --- diff --git a/src/gr/grnet/pithos/web/client/Pithos.java b/src/gr/grnet/pithos/web/client/Pithos.java index 053afd3..197931b 100644 --- a/src/gr/grnet/pithos/web/client/Pithos.java +++ b/src/gr/grnet/pithos/web/client/Pithos.java @@ -40,6 +40,8 @@ import com.google.gwt.core.client.JsArrayString; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.RepeatingCommand; import com.google.gwt.core.client.Scheduler.ScheduledCommand; +import com.google.gwt.dom.client.*; +import com.google.gwt.dom.client.Element; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.logical.shared.ResizeEvent; @@ -180,6 +182,8 @@ public class Pithos implements EntryPoint, ResizeHandler { } } + public static String FAVICON_URL = getFromOtherPropertiesOrNull("FAVICON_URL"); + public interface Style extends CssResource { String commandAnchor(); @@ -493,6 +497,16 @@ public class Pithos implements EntryPoint, ResizeHandler { } private void initialize() { + // Inject the dynamically provided favicon + if(FAVICON_URL != null) { + final Document document = Document.get(); + final Element head = document.getElementsByTagName("head").getItem(0); + final LinkElement link = document.createLinkElement(); + link.setRel("icon"); + link.setHref(FAVICON_URL); + head.appendChild(link); + } + userCatalogs.updateWithIDAndName("*", "All Pithos users"); lastModified = new Date(); //Initialize if-modified-since value with now.