Skip to content

Commit 7b0ef83

Browse files
authored
Merge pull request #632 from GwtMaterialDesign/release_2.0
Release 2.0-rc6
2 parents a600fa1 + f53abf3 commit 7b0ef83

File tree

355 files changed

+701
-591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

355 files changed

+701
-591
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<br/>
88

99
## Demo
10-
* [2.0-rc5 Release Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/)
10+
* [2.0-rc6 Release Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/)
1111
* [2.0 Snapshot Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/snapshot/)
1212
* [2.1 Snapshot Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/2.1/)
1313

@@ -17,12 +17,12 @@ We created <a href="http://gwtmaterialdesign.github.io/gwt-material-demo/apidocs
1717

1818

1919
## Maven
20-
### Current Version 2.0-rc5
20+
### Current Version 2.0-rc6
2121
```xml
2222
<dependency>
2323
<groupId>com.github.gwtmaterialdesign</groupId>
2424
<artifactId>gwt-material</artifactId>
25-
<version>2.0-rc5</version>
25+
<version>2.0-rc6</version>
2626
</dependency>
2727
```
2828
### Snapshot Version 2.0-SNAPSHOT

gwt-material/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>gwt-material-parent</artifactId>
66
<groupId>com.github.gwtmaterialdesign</groupId>
7-
<version>2.0-rc5</version>
7+
<version>2.0-rc6</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

@@ -17,7 +17,7 @@
1717
<dependency>
1818
<groupId>com.github.gwtmaterialdesign</groupId>
1919
<artifactId>gwt-material-jquery</artifactId>
20-
<version>2.0-rc5</version>
20+
<version>2.0-rc6</version>
2121
</dependency>
2222
<dependency>
2323
<groupId>com.google.gwt</groupId>
@@ -75,7 +75,7 @@
7575
<plugin>
7676
<groupId>org.codehaus.mojo</groupId>
7777
<artifactId>gwt-maven-plugin</artifactId>
78-
<version>${gwt-maven-plugin.version}</version>
78+
<version>${gwt.version}</version>
7979
<executions>
8080
<execution>
8181
<goals>

gwt-material/src/main/java/gwt/material/design/client/JQueryProvider.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* #%L
33
* GwtMaterial
44
* %%
5-
* Copyright (C) 2015 - 2016 GwtMaterialDesign
5+
* Copyright (C) 2015 - 2017 - 2016 GwtMaterialDesign
66
* %%
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
@@ -24,10 +24,15 @@
2424
import gwt.material.design.client.resources.WithJQueryDebugResources;
2525
import gwt.material.design.client.resources.WithJQueryResources;
2626

27-
public class JQueryProvider {
27+
public abstract class JQueryProvider {
2828

29-
public TextResource jQuery() {
30-
return null;
29+
public abstract TextResource jQuery();
30+
31+
public static class NoJQuery extends JQueryProvider {
32+
@Override
33+
public TextResource jQuery() {
34+
return null;
35+
}
3136
}
3237

3338
public static class JQueryDebug extends JQueryProvider {

gwt-material/src/main/java/gwt/material/design/client/MaterialDesign.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* GwtMaterialDesign
66
* %%
7-
* Copyright (C) 2015 GwtMaterial
7+
* Copyright (C) 2015 - 2017 GwtMaterial
88
* %%
99
* Licensed under the Apache License, Version 2.0 (the "License");
1010
* you may not use this file except in compliance with the License.

gwt-material/src/main/java/gwt/material/design/client/MaterialDesignBase.java

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* GwtMaterialDesign
66
* %%
7-
* Copyright (C) 2015 GwtMaterial
7+
* Copyright (C) 2015 - 2017 GwtMaterial
88
* %%
99
* Licensed under the Apache License, Version 2.0 (the "License");
1010
* you may not use this file except in compliance with the License.
@@ -44,6 +44,7 @@ public FutureResource(TextResource resource, boolean removeTag, boolean sourceUr
4444

4545
static final JQueryProvider jQueryProvider = GWT.create(JQueryProvider.class);
4646
static List<FutureResource> futureResources;
47+
static boolean jqueryWarning;
4748

4849
protected void load() {
4950
checkJQuery(false);
@@ -78,35 +79,54 @@ public static void injectJs(TextResource resource, boolean removeTag, boolean so
7879
}
7980
futureResources.add(new FutureResource(resource, removeTag, sourceUrl));
8081
} else {
81-
String text = resource.getText() + (sourceUrl ?
82-
"//# sourceURL=" + resource.getName() + ".js" : "");
83-
84-
// Inject the script resource
85-
ScriptInjector.fromString(text)
86-
.setWindow(ScriptInjector.TOP_WINDOW)
87-
.setRemoveTag(removeTag)
88-
.inject();
82+
directInjectJs(resource, removeTag, sourceUrl);
8983
}
9084
}
9185

86+
protected static void directInjectJs(TextResource resource) {
87+
directInjectJs(resource, true, false);
88+
}
89+
90+
protected static void directInjectDebugJs(TextResource resource) {
91+
directInjectJs(resource, false, true);
92+
}
93+
94+
protected static void directInjectJs(TextResource resource, boolean removeTag, boolean sourceUrl) {
95+
String text = resource.getText() + (sourceUrl ?
96+
"//# sourceURL=" + resource.getName() + ".js" : "");
97+
98+
// Inject the script resource
99+
ScriptInjector.fromString(text)
100+
.setWindow(ScriptInjector.TOP_WINDOW)
101+
.setRemoveTag(removeTag)
102+
.inject();
103+
}
104+
92105
public static void injectCss(TextResource resource) {
93106
StyleInjector.inject(resource.getText());
94107
}
95108

96109
protected static boolean checkJQuery(boolean debug) {
97-
if (!isjQueryLoaded() && isProvidingJQuery()) {
98-
if (debug) {
99-
injectDebugJs(jQueryProvider.jQuery());
100-
} else {
101-
injectJs(jQueryProvider.jQuery());
110+
if (!isjQueryLoaded()) {
111+
if(isProvidingJQuery()) {
112+
if (debug) {
113+
directInjectDebugJs(jQueryProvider.jQuery());
114+
} else {
115+
directInjectJs(jQueryProvider.jQuery());
116+
}
117+
} else if(!jqueryWarning) {
118+
GWT.log("Warning: GWT Material is not providing JQuery. You must ensure JQuery " +
119+
"is loaded manually or use one of the GwtMaterialWithJQuery modules, failing " +
120+
"to do so will result in an endless resource loop. This message can be ignored " +
121+
"if you are doing so already (message will not appear in production).");
122+
jqueryWarning = true;
102123
}
103124
}
104125
return isjQueryLoaded();
105126
}
106127

107128
public static boolean isProvidingJQuery() {
108-
return jQueryProvider instanceof JQueryProvider.JQueryDebug ||
109-
jQueryProvider instanceof JQueryProvider.JQueryCompressed;
129+
return !(jQueryProvider instanceof JQueryProvider.NoJQuery);
110130
}
111131

112132
/**

gwt-material/src/main/java/gwt/material/design/client/MaterialDesignDebug.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* GwtMaterialDesign
66
* %%
7-
* Copyright (C) 2015 GwtMaterial
7+
* Copyright (C) 2015 - 2017 GwtMaterial
88
* %%
99
* Licensed under the Apache License, Version 2.0 (the "License");
1010
* you may not use this file except in compliance with the License.

gwt-material/src/main/java/gwt/material/design/client/MaterialDesignDebugBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* GwtMaterialDesign
66
* %%
7-
* Copyright (C) 2015 GwtMaterial
7+
* Copyright (C) 2015 - 2017 GwtMaterial
88
* %%
99
* Licensed under the Apache License, Version 2.0 (the "License");
1010
* you may not use this file except in compliance with the License.

gwt-material/src/main/java/gwt/material/design/client/MaterialWithJQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* GwtMaterialDesign
66
* %%
7-
* Copyright (C) 2015 GwtMaterial
7+
* Copyright (C) 2015 - 2017 GwtMaterial
88
* %%
99
* Licensed under the Apache License, Version 2.0 (the "License");
1010
* you may not use this file except in compliance with the License.

gwt-material/src/main/java/gwt/material/design/client/MaterialWithJQueryDebug.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* #%L
55
* GwtMaterialDesign
66
* %%
7-
* Copyright (C) 2015 GwtMaterial
7+
* Copyright (C) 2015 - 2017 GwtMaterial
88
* %%
99
* Licensed under the Apache License, Version 2.0 (the "License");
1010
* you may not use this file except in compliance with the License.

gwt-material/src/main/java/gwt/material/design/client/base/AbstractButton.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* #%L
33
* GwtMaterial
44
* %%
5-
* Copyright (C) 2015 - 2016 GwtMaterialDesign
5+
* Copyright (C) 2015 - 2017 GwtMaterialDesign
66
* %%
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)