Skip to content

Commit

Permalink
Merge pull request #518 from GwtMaterialDesign/release_2.0
Browse files Browse the repository at this point in the history
Preparation for 2.0-rc3 release
  • Loading branch information
kevzlou7979 committed Nov 28, 2016
2 parents 4f7767a + 456bd27 commit 694a2bb
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 25 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -6,7 +6,7 @@
<br/>

## Demo
* [2.0-rc2 Release Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/)
* [2.0-rc3 Release Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/)
* [2.0 Snapshot Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/snapshot/)

## Documentation
Expand All @@ -15,12 +15,12 @@ We created <a href="http://gwtmaterialdesign.github.io/gwt-material-demo/apidocs


## Maven
### Current Version 2.0-rc2
### Current Version 2.0-rc3
```xml
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material</artifactId>
<version>2.0-rc2</version>
<version>2.0-rc3</version>
</dependency>
```
### Snapshot Version 2.0-SNAPSHOT
Expand Down
4 changes: 2 additions & 2 deletions gwt-material/pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>gwt-material-parent</artifactId>
<groupId>com.github.gwtmaterialdesign</groupId>
<version>2.0-SNAPSHOT</version>
<version>2.0-rc3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -17,7 +17,7 @@
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material-jquery</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0-rc3</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
Expand Down
@@ -0,0 +1,56 @@
/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* %%
* 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 License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package gwt.material.design.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.TextResource;
import gwt.material.design.client.resources.WithJQueryDebugResources;
import gwt.material.design.client.resources.WithJQueryResources;

public class JQueryProvider {

public TextResource jQuery() {
return null;
}

public static class JQueryDebug extends JQueryProvider {
private WithJQueryDebugResources resources;

@Override
public TextResource jQuery() {
if(resources == null) {
resources = GWT.create(WithJQueryDebugResources.class);
}
return resources.jQueryDebug();
}
}

public static class JQueryCompressed extends JQueryProvider {
private WithJQueryResources resources;

@Override
public TextResource jQuery() {
if(resources == null) {
resources = GWT.create(WithJQueryResources.class);
}
return resources.jQuery();
}
}
}
Expand Up @@ -20,6 +20,7 @@
* #L%
*/

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.ScriptInjector;
import com.google.gwt.dom.client.StyleInjector;
import com.google.gwt.resources.client.TextResource;
Expand All @@ -41,7 +42,7 @@ public FutureResource(TextResource resource, boolean removeTag, boolean sourceUr
}
}

static TextResource jqueryResource;
static final JQueryProvider jQueryProvider = GWT.create(JQueryProvider.class);
static List<FutureResource> futureResources;

protected void load() {
Expand Down Expand Up @@ -93,20 +94,21 @@ public static void injectCss(TextResource resource) {
}

protected static boolean checkJQuery(boolean debug) {
if (!isjQueryLoaded()) {
if (jqueryResource != null) {
if (debug) {
injectDebugJs(jqueryResource);
} else {
injectJs(jqueryResource);
}
if (!isjQueryLoaded() && isProvidingJQuery()) {
if (debug) {
injectDebugJs(jQueryProvider.jQuery());
} else {
return false;
injectJs(jQueryProvider.jQuery());
}
}
return true;
}

public static boolean isProvidingJQuery() {
return jQueryProvider instanceof JQueryProvider.JQueryDebug ||
jQueryProvider instanceof JQueryProvider.JQueryCompressed;
}

/**
* Check to see if jQuery is loaded already
*
Expand Down
Expand Up @@ -21,13 +21,11 @@
*/

import com.google.gwt.core.client.EntryPoint;
import gwt.material.design.client.resources.WithJQueryResources;

public class MaterialWithJQuery extends MaterialDesignBase implements EntryPoint {

@Override
public void onModuleLoad() {
jqueryResource = WithJQueryResources.INSTANCE.jQuery();
load();
}
}
Expand Up @@ -21,7 +21,6 @@
*/

import com.google.gwt.core.client.EntryPoint;
import gwt.material.design.client.resources.WithJQueryDebugResources;

/**
* Entry point classes define <code>onModuleLoad()</code>.
Expand All @@ -30,7 +29,6 @@ public class MaterialWithJQueryDebug extends MaterialDesignDebugBase implements

@Override
public void onModuleLoad() {
jqueryResource = WithJQueryDebugResources.INSTANCE.jQueryDebug();
load();
}
}
Expand Up @@ -19,12 +19,10 @@
*/
package gwt.material.design.client.resources;

import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.TextResource;

public interface WithJQueryDebugResources extends ClientBundle {
WithJQueryDebugResources INSTANCE = GWT.create(WithJQueryDebugResources.class);

@Source("js/jquery-2.1.1.js")
TextResource jQueryDebug();
Expand Down
Expand Up @@ -19,12 +19,10 @@
*/
package gwt.material.design.client.resources;

import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.TextResource;

public interface WithJQueryResources extends ClientBundle {
WithJQueryResources INSTANCE = GWT.create(WithJQueryResources.class);

@Source("js/jquery-2.1.1.min.js")
TextResource jQuery();
Expand Down
Expand Up @@ -29,6 +29,14 @@
<inherits name="gwt.material.design.GwtMaterialDesignBase"/>
<inherits name="gwt.material.design.ResourcesBasic"/>

<replace-with class="gwt.material.design.client.JQueryProvider.JQueryCompressed">
<when-type-is class="gwt.material.design.client.JQueryProvider"/>
</replace-with>

<replace-with class="gwt.material.design.client.resources.WithJQueryResources">
<when-type-is class="gwt.material.design.client.resources.JQueryResource"/>
</replace-with>

<!-- Specify the app entry point class -->
<entry-point class="gwt.material.design.client.MaterialWithJQuery"/>
</module>
Expand Up @@ -29,6 +29,14 @@
<inherits name="gwt.material.design.GwtMaterialDesignBase"/>
<inherits name="gwt.material.design.ResourcesBasic"/>

<replace-with class="gwt.material.design.client.JQueryProvider.JQueryDebug">
<when-type-is class="gwt.material.design.client.JQueryProvider"/>
</replace-with>

<replace-with class="gwt.material.design.client.resources.WithJQueryDebugResources">
<when-type-is class="gwt.material.design.client.resources.JQueryResource"/>
</replace-with>

<!-- Specify the app entry point class -->
<entry-point class="gwt.material.design.client.MaterialWithJQueryDebug"/>
</module>
Expand Up @@ -29,6 +29,14 @@
<inherits name="gwt.material.design.GwtMaterialDesignBase"/>
<inherits name="gwt.material.design.Resources"/>

<replace-with class="gwt.material.design.client.JQueryProvider.JQueryCompressed">
<when-type-is class="gwt.material.design.client.JQueryProvider"/>
</replace-with>

<replace-with class="gwt.material.design.client.resources.WithJQueryResources">
<when-type-is class="gwt.material.design.client.resources.JQueryResource"/>
</replace-with>

<!-- Specify the app entry point class -->
<entry-point class="gwt.material.design.client.MaterialWithJQuery"/>
</module>
Expand Up @@ -29,6 +29,14 @@
<inherits name="gwt.material.design.GwtMaterialDesignBase"/>
<inherits name="gwt.material.design.Resources"/>

<replace-with class="gwt.material.design.client.JQueryProvider.JQueryDebug">
<when-type-is class="gwt.material.design.client.JQueryProvider"/>
</replace-with>

<replace-with class="gwt.material.design.client.resources.WithJQueryDebugResources">
<when-type-is class="gwt.material.design.client.resources.JQueryResource"/>
</replace-with>

<!-- Specify the app entry point class -->
<entry-point class="gwt.material.design.client.MaterialWithJQueryDebug"/>
</module>
Expand Up @@ -19,6 +19,7 @@
*/
package gwt.material.design.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.junit.client.GWTTestCase;
import gwt.material.design.client.resources.MaterialResources;
import gwt.material.design.client.resources.WithJQueryResources;
Expand Down Expand Up @@ -49,8 +50,9 @@ protected void gwtSetUp() throws Exception {
}

public void setup() {
WithJQueryResources jquery = GWT.create(WithJQueryResources.class);
// Test JQuery
MaterialDesign.injectJs(WithJQueryResources.INSTANCE.jQuery());
MaterialDesign.injectJs(jquery.jQuery());
assertTrue(MaterialDesign.isjQueryLoaded());
// Test Materialize
MaterialDesign.injectJs(MaterialResources.INSTANCE.materializeJs());
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -6,7 +6,7 @@
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material-parent</artifactId>
<packaging>pom</packaging>
<version>2.0-SNAPSHOT</version>
<version>2.0-rc3</version>

<modules>
<module>gwt-material</module>
Expand Down Expand Up @@ -63,7 +63,7 @@
<connection>scm:git:git@github.com:GwtMaterialDesign/gwt-material.git</connection>
<developerConnection>scm:git:git@github.com:GwtMaterialDesign/gwt-material.git</developerConnection>
<url>http://github.com/GwtMaterialDesign/gwt-material</url>
<tag>v2.0-SNAPSHOT</tag>
<tag>v2.0-rc3</tag>
</scm>

<licenses>
Expand Down

0 comments on commit 694a2bb

Please sign in to comment.