Skip to content

Commit

Permalink
Add "auto" theme
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherp committed May 25, 2024
1 parent 2587f7d commit f93614c
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 3 deletions.
13 changes: 12 additions & 1 deletion core/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,17 @@ gulp.task('less', function () {
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(dest));

return merge(brightTheme, greyTheme, darkTheme);
var autoTheme = gulp.src(uiSrcFolder + '/less/auto.less')
.pipe(cached("auto"))
.on('error', swallowError)
.pipe(sourcemaps.init())
.pipe(less())
.on('error', swallowError)
.pipe(cleancss())
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(dest));

return merge(brightTheme, greyTheme, darkTheme, autoTheme);
});

gulp.task('copy-assets', function () {
Expand Down Expand Up @@ -166,6 +176,7 @@ gulp.task('delMainLessCache', function () {
delete cached.caches["bright"];
delete cached.caches["grey"];
delete cached.caches["dark"];
delete cached.caches["auto"];
});

gulp.task('copyStaticToClasses', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private NzbsDownload getNzbsAsFiles(Collection<Long> guids, Path targetDirectory
continue;
}
try {
String title = result.getFileName().replaceAll("[\\\\/:*?\"<>|]", "_");
String title = result.getFileName().replaceAll("[\\\\/:*?\"<>|!]", "_");
File tempFile = new File(targetDirectory.toFile(), title);
logger.debug("Writing content to temp file {}", tempFile.getAbsolutePath());
Files.write(tempFile.toPath(), result.getContent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2452,6 +2452,9 @@
{
"pattern": "\\Qstatic/css/dark.css\\E"
},
{
"pattern": "\\Qstatic/css/auto.css\\E"
},
{
"pattern": "\\Q*/static/*\\E"
},
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/resources/static/css/auto.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/src/main/resources/static/css/auto.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/src/main/resources/static/js/nzbhydra.js
Original file line number Diff line number Diff line change
Expand Up @@ -6291,6 +6291,7 @@ function ConfigFields($injector) {
type: 'select',
label: 'Theme',
options: [
{name: 'Auto', value: 'auto'},
{name: 'Grey', value: 'grey'},
{name: 'Bright', value: 'bright'},
{name: 'Dark', value: 'dark'}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/static/js/nzbhydra.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/ui-src/js/config/config-fields-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ function ConfigFields($injector) {
type: 'select',
label: 'Theme',
options: [
{name: 'Auto', value: 'auto'},
{name: 'Grey', value: 'grey'},
{name: 'Bright', value: 'bright'},
{name: 'Dark', value: 'dark'}
Expand Down
Empty file added core/ui-src/less/auto.less
Empty file.
5 changes: 5 additions & 0 deletions docker/uiDev/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

cd ../..
docker build -f docker/uiDev/Dockerfile -t ghcr.io/theotherp/nzbhydra-ui-dev:latest .
docker push ghcr.io/theotherp/nzbhydra-ui-dev:latest .

0 comments on commit f93614c

Please sign in to comment.