forked from jenkinsci/material-theme-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from timja/namespaced
Add live theme switching support
- Loading branch information
Showing
30 changed files
with
4,560 additions
and
599 deletions.
There are no files selected for viewing
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,20 @@ | ||
light-theme.css | ||
target | ||
|
||
# mvn hpi:run | ||
work | ||
|
||
# IntelliJ IDEA project files | ||
*.iml | ||
*.iws | ||
*.ipr | ||
.idea | ||
|
||
# Eclipse project files | ||
.settings | ||
.classpath | ||
.project | ||
|
||
# VS code project files | ||
.vscode | ||
>>>>>>> Add grey and light blue theme |
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,7 @@ | ||
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd"> | ||
<extension> | ||
<groupId>io.jenkins.tools.incrementals</groupId> | ||
<artifactId>git-changelist-maven-extension</artifactId> | ||
<version>1.3</version> | ||
</extension> | ||
</extensions> |
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,2 @@ | ||
-Pconsume-incrementals | ||
-Pmight-produce-incrementals |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
src/main/java/io/jenkins/plugins/materialtheme/AbstractMaterialTheme.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,18 @@ | ||
package io.jenkins.plugins.materialtheme; | ||
|
||
import io.jenkins.plugins.thememanager.Theme; | ||
import io.jenkins.plugins.thememanager.ThemeManagerFactory; | ||
import java.util.Arrays; | ||
|
||
public class AbstractMaterialTheme extends ThemeManagerFactory { | ||
|
||
public static final String BASE_CSS = "light-theme.css"; | ||
public static final String CUSTOMISED_CSS = "material-theme.css"; | ||
|
||
@Override | ||
public Theme getTheme() { | ||
return Theme.builder().withCssUrls( | ||
Arrays.asList(toAssetUrl(BASE_CSS), getCssUrl(), toAssetUrl(CUSTOMISED_CSS))) | ||
.build(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/io/jenkins/plugins/materialtheme/AbstractMaterialThemeDescriptor.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,17 @@ | ||
package io.jenkins.plugins.materialtheme; | ||
|
||
import io.jenkins.plugins.thememanager.ThemeManagerFactoryDescriptor; | ||
|
||
public abstract class AbstractMaterialThemeDescriptor extends ThemeManagerFactoryDescriptor { | ||
public static final String ID = "material"; | ||
|
||
@Override | ||
public String getThemeId() { | ||
return ID; | ||
} | ||
|
||
@Override | ||
public boolean isNamespaced() { | ||
return true; | ||
} | ||
} |
49 changes: 0 additions & 49 deletions
49
src/main/java/io/jenkins/plugins/materialtheme/AbstractMaterialThemeRootAction.java
This file was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
src/main/java/io/jenkins/plugins/materialtheme/MaterialGreyThemeManagerFactory.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,55 @@ | ||
package io.jenkins.plugins.materialtheme; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import hudson.Extension; | ||
import io.jenkins.plugins.thememanager.Theme; | ||
import io.jenkins.plugins.thememanager.ThemeManagerFactory; | ||
import io.jenkins.plugins.thememanager.ThemeManagerFactoryDescriptor; | ||
import org.jenkinsci.Symbol; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
public class MaterialGreyThemeManagerFactory extends ThemeManagerFactory { | ||
|
||
public static final String MATERIAL_GREY_CSS = "theme-grey.css"; | ||
public static final String MATERIAL_GREY_SYMBOL = "material-grey"; | ||
// Seems like this needs to be 'theme-<descriptor_symbol>' | ||
public static final String MATERIAL_GREY_URL_NAME = "theme-material-grey"; | ||
|
||
@DataBoundConstructor | ||
public MaterialGreyThemeManagerFactory() { | ||
} | ||
|
||
@Override | ||
public Theme getTheme() { | ||
return Theme.builder() | ||
.withCssUrl(getCssUrl()) | ||
.build(); | ||
} | ||
|
||
@Extension | ||
@Symbol(MATERIAL_GREY_SYMBOL) | ||
public static class MaterialGreyThemeManagerFactoryDescriptor extends ThemeManagerFactoryDescriptor { | ||
|
||
@NonNull | ||
@Override | ||
public String getDisplayName() { | ||
return "Material - Grey"; | ||
} | ||
|
||
@Override | ||
public ThemeManagerFactory getInstance() { | ||
return new MaterialGreyThemeManagerFactory(); | ||
} | ||
|
||
@Override | ||
public String getThemeCssSuffix() { | ||
return MATERIAL_GREY_CSS; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getThemeId() { | ||
return MATERIAL_GREY_SYMBOL; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.