summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Lange <lange.fabian@gmail.com>2014-07-23 22:20:43 +0200
committerVaadin Code Review <review@vaadin.com>2014-08-05 06:52:32 +0000
commit7b9cea29ff116fe4a7440b3de1b2cdbf2e57710a (patch)
treecacca1f616906328c9553181d11676c93998f3c6
parent295f116b91789bc0ff5422e54f2df4e59eb53294 (diff)
downloadvaadin-framework-7b9cea29ff116fe4a7440b3de1b2cdbf2e57710a.tar.gz
vaadin-framework-7b9cea29ff116fe4a7440b3de1b2cdbf2e57710a.zip
Adding a constant for vaadinBootstrap.js (#14284)
If for any reason a developer wants to parse the bootstrap html, this constants allows easy identification of the bootstrap js. Change-Id: I894cf6e22a7e6d9154c3c9124dda911a86a99475
-rw-r--r--server/src/com/vaadin/server/BootstrapHandler.java27
-rw-r--r--shared/src/com/vaadin/shared/ApplicationConstants.java8
2 files changed, 22 insertions, 13 deletions
diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java
index 3c75764075..73bafcca25 100644
--- a/server/src/com/vaadin/server/BootstrapHandler.java
+++ b/server/src/com/vaadin/server/BootstrapHandler.java
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2014 Vaadin Ltd.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -45,10 +45,10 @@ import com.vaadin.shared.communication.PushMode;
import com.vaadin.ui.UI;
/**
- *
+ *
* @author Vaadin Ltd
* @since 7.0.0
- *
+ *
* @deprecated As of 7.0. Will likely change or be removed in a future version
*/
@Deprecated
@@ -336,9 +336,9 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler {
* Override this method if you want to add some custom html around around
* the div element into which the actual Vaadin application will be
* rendered.
- *
+ *
* @param context
- *
+ *
* @throws IOException
* @throws JSONException
*/
@@ -397,7 +397,8 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler {
"type", "text/javascript").attr("src", pushJS));
}
- String bootstrapLocation = vaadinLocation + "vaadinBootstrap.js";
+ String bootstrapLocation = vaadinLocation
+ + ApplicationConstants.VAADIN_BOOTSTRAP_JS;
fragmentNodes.add(new Element(Tag.valueOf("script"), "").attr("type",
"text/javascript").attr("src", bootstrapLocation));
Element mainScriptTag = new Element(Tag.valueOf("script"), "").attr(
@@ -543,13 +544,13 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler {
/**
* Get the URI for the application theme.
- *
+ *
* A portal-wide default theme is fetched from the portal shared resource
* directory (if any), other themes from the portlet.
- *
+ *
* @param context
* @param themeName
- *
+ *
* @return
*/
public String getThemeUri(BootstrapContext context, String themeName) {
@@ -562,7 +563,7 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler {
/**
* Override if required
- *
+ *
* @param context
* @return
*/
@@ -574,7 +575,7 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler {
/**
* Don not override.
- *
+ *
* @param context
* @return
*/
diff --git a/shared/src/com/vaadin/shared/ApplicationConstants.java b/shared/src/com/vaadin/shared/ApplicationConstants.java
index 15eefe3b21..44c972462a 100644
--- a/shared/src/com/vaadin/shared/ApplicationConstants.java
+++ b/shared/src/com/vaadin/shared/ApplicationConstants.java
@@ -78,6 +78,14 @@ public class ApplicationConstants implements Serializable {
public static final String VAADIN_DIR_URL = "vaadinDir";
/**
+ * The name of the javascript containing the bootstrap code. The file is
+ * located in the VAADIN directory.
+ *
+ * @since 7.3
+ */
+ public static final String VAADIN_BOOTSTRAP_JS = "vaadinBootstrap.js";
+
+ /**
* The name of the javascript containing push support. The file is located
* in the VAADIN directory.
*/