-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed ZK-2931: Atlantic theme @import google fonts
- Loading branch information
christopher-szu
committed
Nov 4, 2015
1 parent
7893d6d
commit 83e3635
Showing
4 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/main/java/org/zkoss/theme/atlantic/AtlanticThemeProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.zkoss.theme.atlantic; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
import org.zkoss.html.StyleSheet; | ||
import org.zkoss.lang.Library; | ||
import org.zkoss.zk.ui.Execution; | ||
import org.zkoss.zul.theme.StandardThemeProvider; | ||
|
||
public class AtlanticThemeProvider extends StandardThemeProvider { | ||
|
||
/** Library property key. */ | ||
private static final String DONT_USE_GOOGLE_FONT = "org.zkoss.theme.atlantic.useGoogleFont.disabled"; | ||
|
||
@Override | ||
public Collection<Object> getThemeURIs(Execution exec, List<Object> uris) { | ||
if (!Boolean.parseBoolean(Library.getProperty(DONT_USE_GOOGLE_FONT))) { //false by default | ||
//ZK-2931 can't start the url with "//", encodeURL will prepend | ||
//current context path if no scheme were given | ||
uris.add(new StyleSheet(exec.getScheme() + "://fonts.googleapis.com/css?family=Open+Sans", "text/css")); | ||
} | ||
return super.getThemeURIs(exec, uris); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
-------- | ||
Atlantic 1.0.7 | ||
* Features: | ||
|
||
ZK-2931: Atlantic theme @import google fonts | ||
|
||
* Bugs: | ||
|
||
* Upgrade Notes: | ||
|